Skip to content

Instantly share code, notes, and snippets.

@tennisonchan
Forked from addyosmani/ember-serviceworker.md
Created October 12, 2016 15:55
Show Gist options
  • Save tennisonchan/ff89c2302a445f90294b7cd101bb6ffd to your computer and use it in GitHub Desktop.
Save tennisonchan/ff89c2302a445f90294b7cd101bb6ffd to your computer and use it in GitHub Desktop.
Ember Service Worker support

Ember.js currently doesn't have baked in support for Service Worker. They want this and there's an ember-cli RFCS thread discussing strategies however a number of tooling efforts exist to help fill in this gap today.

Note: you can of course just write vanilla Service Worker code for your Ember.js apps and that will work just fine. This doc tracks tooling and libraries that lower the friction for getting this setup

Service Worker Libraries

These static resource precaching and runtime caching libraries are lower-level than Broccoli, but can be used directly from your package.json as a post-build step.

Broccoli helpers

broccoli-serviceworker sits on top of sw-toolbox and works relatively painlessly with apps built using Ember CLI. An Ember PWA I built uses it with minimal configuration.

Ember CLI add-on

DockYard have been exploring Service Worker support for their PWAs and wrote ember-service-worker which comes with a number of add-ons available with different network strategies:

The project is currently marked as experimental and not yet recommended for production.

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