Skip to content

Instantly share code, notes, and snippets.

@mike-north
Last active January 11, 2017 04:29
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mike-north/d03e632df9db487954571b26865fa4aa to your computer and use it in GitHub Desktop.
Save mike-north/d03e632df9db487954571b26865fa4aa to your computer and use it in GitHub Desktop.
EmberFest 2016 - Enemy of the state

Enemy of the state - Mike North

* **GitHub:** [mike-north](https://github.com/mike-north) * **Twitter:** [michaellnorth](https://twitter.com/michaellnorth) * **Speaking Engagements:** [northm](lanyrd.com/profile/northm/) * **Instagram:** [officetoday](https://www.instagram.com/officetoday/) * **Videos:** [Videos of Mike's talks](https://www.youtube.com/playlist?list=PLk9PtblnhxXjdNGSp39GzD7BeS2mh0S5o)

Resources

Videos

EnemyOfTheState

Summary

For over a decade, most of us built web UIs operating under the assumption that servers would render mostly-static HTML, and we’d boil the ocean and free all client-side memory with every page load. This was a simple world, where the server-side was aware of the user’s intent and context.

Enter the Single Page Application (SPA) - there are all sorts of usability and performance, and scalability benefits that come along with building a web app this way, but there are also some serious challenges. There are some implicit assumptions that our users make about how apps should work, and we must work a bit harder in order to keep them intact. Take the “Back” and “Refresh” buttons, for example: in order for this to work as our users expect, we must keep certain elements of state serialized in the URL in order to avoid “breaking” this as we simulate a multi-page experience in a SPA.

Add in the concept of “server-side rendering”, where our asset serving layer sometimes needs browser details (i.e. viewport dimensions) in order to render the correct content, and state decisions become even more consequential and complex.

In this talk, I’ll outline four types of state

  • Navigation state
  • Persisted state
  • UI state
  • “Will be persisted” state

and provide examples for each. Along the way, we’ll start to assemble a framework of questions that you can ask yourself when encountering new pieces of state, to lead you down the right path(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment