Re: [w3c/ServiceWorker] Clarify dynamic-imported scripts are never installed (#1356)

#developer-pain

Like hugo i have also recently adopted a fetch + eval using [shimport](https://github.com/Rich-Harris/shimport)
feels unnecessary to load the hole application when only parts of the service worker is being used.
Sometimes if feels like you don't have a choice when you have external dependencies that use dynamic imports and you have no way of changing it unless you fork the hole dependency tree and replace everything with static import or rather importScript.

Would be grate if "Allow fetches of dynamic imports to go to the service worker's own FetchEvent to enable offline."
I'm not really concerned about having it working offline. in this modern world we are connected all the time. And static CDN assets have a grate cache header anyway. But to make it work offline it would be grate if it could go throught regular FetchEvent so you can respond with something from CacheStorage or from the sandboxed FileSystem api.

I would be fine by not having dynamically import files never installed, and that it's my responsibility to cache it if i really want to make it work offline.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1356#issuecomment-782481186

Received on Saturday, 20 February 2021 00:41:09 UTC