Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ember Service Worker - EmberFest Edition

Marten
October 28, 2016

Ember Service Worker - EmberFest Edition

Marten

October 28, 2016
Tweet

More Decks by Marten

Other Decks in Programming

Transcript

  1. Progressive Web Apps a Service Worker ➡ Ember PWA &

    Ember Serv•ice Work•er (sûrˈvĭs wûrˈkər)
  2. Progressive Web Apps a Service Worker ➡ Ember ember-service-worker PWA

    & Ember Serv•ice Work•er (sûrˈvĭs wûrˈkər)
  3. Progressive Web Apps Web apps that feel like native apps

    by means of progressive enhancement
  4. Service Workers Web App Manifest Offline Push Notifications Background Sync

    Add to home screen Display mode Progressive Web Apps
  5. PWA & Ember Deliver the raw HTML content by server-side

    rendering with FastBoot Image from: EmberCamp 2016 Keynote by Yehuda Katz & Tom Dale
  6. Image from: EmberCamp 2016 Keynote by Yehuda Katz & Tom

    Dale PWA & Ember Load the minimum amount of JS needed by eliminating dead code and deferring to lazy-loading engines
  7. PWA & Ember A Service Worker makes the application rely

    less on the network by pre-loading frequently-used data and assets Image from: EmberCamp 2016 Keynote by Yehuda Katz & Tom Dale
  8. make css, js, fonts and logo images offline first on

    install make images and other assets offline first on demand use IndexedDB as fallback for the API PWA & Ember
  9. An event-driven Web Worker, which responds to events dispatched from

    documents and other sources Serv•ice Work•er (sûrˈvĭs wûrˈkər)
  10. Not attached to a particular document, instead it is registered

    to an origin and a scope Serv•ice Work•er (sûrˈvĭs wûrˈkər)
  11. Only active while handling events, assume the browser kills it

    until the next event happens Serv•ice Work•er (sûrˈvĭs wûrˈkər)
  12. Progressive Web Apps a Service Worker ➡ Ember PWA &

    Ember Serv•ice Work•er (sûrˈvĭs wûrˈkər)
  13. Re-solving well-solved, common problems is a waste of resources. -

    Edward Faulkner https://github.com/emberjs/rfcs/pull/143
  14. Don't waste time making trivial choices. Ember.js incorporates common idioms

    so you can focus on what makes your app special, not reinventing the wheel. http://emberjs.com
  15. Ember Service Worker Common Boilerplate Discover all Service Worker plugins

    Compile all SW code into one file using Babel and Rollup
  16. Ember Service Worker Common Boilerplate Discover all Service Worker plugins

    Compile all SW code into one file using Babel and Rollup Compile the SW registration code, w Babel and Rollup
  17. Ember Service Worker Common Boilerplate Injects Service Worker Registration into

    index.html Discover all Service Worker plugins Compile all SW code into one file using Babel and Rollup Compile the SW registration code, w Babel and Rollup
  18. Ember Service Worker Plugin Examples Offline first assets Offline first

    API with background sync Push notifications Asset Diff Patching
  19. Prediction The plugin ecosystem will cover 90% of the use-cases

    with little to no configuration. The other 10% can be achieved by writing custom code or building private plugins.
  20. Working with Service Workers exposes you to cache invalidation problems.

    You should thoroughly test before deploying to production.
  21. The code isn't backed by a decent automated test- suite

    yet, this is because testing Service Workers is a new problem, that hasn't been done or documented that much.
  22. The addon has not been widely tested yet, please install

    the addon and test it on your staging deploys and report issues.