-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Will Service Workers be considered as a use case? #62
Comments
Service Workers use cases seem a fine to hope they match, but various things like having a HTTP cache implementation as the means of controlling things like Loader use cases are more complex, but we do have some insurance that the model can be emulated in the web and vice versa with proof of concepts we generate every so often so we do consider compatibility but not design important. A polyfill of |
@bmeck i also invested into the serviceWorker concept and i guess it is importent to have it including the origin level while that is blocking and looking like none sense in first case out of my view it would help to algin the ecosystems as also would enable some really nice extra usecases Explainer Web Worker API (Concept)i vote for a complet serviceWorker implementation as also bind it to a Web Worker Specification so a NodeJS WebWorker will offer fetch (the full spec) including the context like location as web workers do it in the browser and finally this web workers would be able to instantiate service workers the browser got a so called activation api to init the service worker and directly activate it via api without page reload this will be the standard behavior of the node implementation and finaly we did it we enabled nodejs users to run stuff in a isolated by url context. and also made clear that this is not needed for none web development the web worker will also expose Web Streams and Web Crypto directly it will be like the browser implementation of it the configuration of the Web Worker new webWorker() will offer configuration options for the cache and the whole policy headers. loader related alternativeregister the service worker via a loader and then this service worker will only work for the nodejs Web Worker API if the context matches. |
Service Workers are different.
They are registered by a script.
But restarting/reloading the app with a service worker in control will intercept requests.
This incudes requests for
import
A Service Worker can receive messages via postMessage.
A Loader has a message port too.
A Loader can preload global code, but it is also possible to load source code and augment it.
So I definitely see how a
loader
could be used to create a similar experience to controlling service workers, even though the registration/installation process is a bit different to service workers.Is that a use case that is or maybe should be considered by this group?
Or was it considered?
If loaders are here to stay and would in principle enable all features service workers enable, that would be amazing.
This would help to write almost no overhead frameworks or smal shims for service worker code which could run in browsers and nodejs with no changes, which would be awesome :-)
The text was updated successfully, but these errors were encountered: