WICG / import-maps

How to control the behavior of JavaScript imports
https://html.spec.whatwg.org/multipage/webappapis.html#import-maps
Other
2.7k stars 72 forks source link

"However, service workers are not available on first load" #70

Closed annevk closed 5 years ago

annevk commented 6 years ago

Will this be true forever? If Origin Policy/Manifest somehow works well, I could imagine also preloading the service worker.

domenic commented 6 years ago

That is my current understanding talking to service worker engineers. I'd love to hear otherwise from them, if you've been talking to a different set of folks.

annevk commented 6 years ago

Given how far along Origin Policy/Manifest is (not that far), it seems a little premature to declare that this will never happen.

domenic commented 6 years ago

Ok. I'd be happy to continue this discussion if you can point to some concrete statements contrary to what I've heard.

johntron commented 5 years ago

Even if service workers become an option for the first page load, are there additional reasons for not using them? It might be useful to describe those as well. One that comes to mind is that service workers may not be available in some situations (private browsing?).

BTW - this proposal might solve an inevitable problem when building microfrontends: loading assets from disparate servers in one browser runtime.

Malvoz commented 5 years ago

Will this be true forever? If Origin Policy/Manifest somehow works well [...]

Alternatively, with Early Hints we could do:

HTTP/1.1 103 Early Hints
     Link: </sw.js>; rel=preload; as=script

And (?) if we kept rel=serviceworker:

HTTP/1.1 103 Early Hints
     Link: </sw.js>; rel=serviceworker; scope=/