-
Notifications
You must be signed in to change notification settings - Fork 388
Better explanation of how importScripts can extend default behavior #49
Comments
This should also explain that editing the generated service worker file is a Very Bad Idea, and if you really need to tweak the generated code, it should be done with using the |
ServiceWorker API is emerging: more and more What's important then - is to give all the details about the update issues with And of course, let's keep an eye on the possible solution: w3c/ServiceWorker#839 |
The next incantation of sw-* libraries that this team has been working on will actually be taking steps to give the developer lilbrary that generate the file + revision list and perform the precaching and management that they'd use in their service worker - rather than the current implementation that controls the top-level service worker. This should allow developer to use this how ever they want. |
@gauntface do you mean https://github.com/GoogleChrome/sw-helpers ? Because my next question was how is |
@webmaxru yes I am.
|
@gauntface thanks for the explanation! I scaffolded a book called "Progressive Web Applications" or just #pwabook, where |
@webmaxru awesome!! Hopefully we'll get it moved over to a chapter soon ;) |
Regarding service worker events, wouldn't the general use case be to implement them after registering the service worker in the project-specific code? |
One of the takeaways from @gauntface's feedback at #43 is that it's not clear how an experienced SW developer can extend the default
sw-precache
behavior to, e.g., implement a specific runtime caching strategy for a specific URL pattern. Or write their own SWpush
event handlers, which is something thatsw-precache
doesn't attempt to do at all.@jpmedley, this is a topic I tried to touch on in Service Workers in Production, but we could use a specific set of guidance in the docs that covers this use case. Something like "
sw-precache
handles your static resources. To extend your SW to handle other things, useimportScripts(...)...
" and then some inline examples and a link to the App Shell demo I'm working on, or the Web Starter Kit integration.The text was updated successfully, but these errors were encountered: