Service Worker Gotchas

Osvaldas Valutis from kollegorna.se has written an in-depth article on Service Workers

We’ve learned there quite a few gotchas to grasp in order to get Service Worker working correctly…

Comes with some solid advice and lots of code snippets.

One thing mentioned, that hadn’t crossed my mind before at all, is that it’s perfectly possible to “just” use ES2015 in your service worker:

It is completely safe to use the renewed JavaScript syntax in your serviceworker.js file, because browsers which support ES6 syntax also support Service Workers. However, I wouldn’t recommend using the new syntax for code that registers Service Worker, unless you use a transpiler.

Service Worker gotchas →

Related: Una Kravets’ writeup Implementing “Save For Offline” with Service Workers also forms a good start when it comes to Service Workers.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.