-
Notifications
You must be signed in to change notification settings - Fork 388
Static import of custom code #151
Comments
I'm inclined to tell you and other to stick with If you're in a situation in which it's technically impossible to accomplish what you'd want with You mentioned having several reason why |
Due to the problem with migration to newer sw-precache versions I tried not to fork the The main problem I am currently having with And I also fear, since serviceworker are already quite complex to test (manually and/or automatically) even though the Chrome Dev Tools has made an immense progress for service workers, which I really like, that |
Yeah, the service worker-specific documentation on The best technical description probably comes from the HTML Spec. The most _import_ant bits are that if the imported script throws an exception, that gets propagated up to the service worker's scope. And if fetching the script initially fails, that also throws an exception. If an unhandled exception is throw during service worker installation, originating from The one wrinkle with a service worker's usage of |
Thanks for the information. So if you are against the static import, we could close this ticket? |
Yup! Hopefully that all sounds reasonable. Also, when #147 is implemented, it will be much more straightforward for developers to "own" their top-level service worker, and then just pull in |
You currently can only use
importScripts
to insert some custom logic to the serviceworker script.Since
importScripts()
involves making additional requests (and for maybe several other reasons), it would be nice, if there would be an option in which you can specify additional files and their content is added to the generatedservice-worker.js
when building the file. That way you could extend the generated SW file without the need of usingimportScripts()
.The text was updated successfully, but these errors were encountered: