Comments (2)
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 file:
URLs likely won't match up in implementation. Additionally, service workers have a concept of origins that doesn't make as much sense on the backend and prevent seeing cross origin requests.
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 ServiceWorker
on top of --loader is possible by injecting a global during globalPreload and then having the loader spin up a worker. I think having some ship for it would be good but I doubt it would land in Node's core anytime soon, certainly not before loaders are fully stabilized.
from loaders.
@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 alternative
register the service worker via a loader and then this service worker will only work for the nodejs Web Worker API if the context matches.
from loaders.
Related Issues (20)
- Loaders allow breaking JS spec invariants HOT 16
- Official `fs` overlay HOT 3
- Node.js Loaders Team Meeting 2023-11-21
- bug: CJS exports analysis reads directly from disk HOT 7
- Node.js Loaders Team Meeting 2023-12-05 HOT 9
- Node.js Loaders Team Meeting 2023-12-19
- Bad coverage information when loaders are used
- Node.js Loaders Team Meeting 2024-01-02
- Node.js Loaders Team Meeting 2024-01-16 HOT 2
- improve registration HOT 2
- Node.js Loaders Team Meeting 2024-01-30 HOT 3
- --experimental-loader breaks in Node 18.19 HOT 5
- Node.js Loaders Team Meeting 2024-02-13 HOT 1
- Node.js Loaders Team Meeting 2024-02-27 HOT 2
- Node.js Loaders Team Meeting 2024-03-12 HOT 1
- Node.js Loaders Team Meeting 2024-03-26 HOT 1
- Node.js Loaders Team Meeting 2024-04-09 HOT 15
- Node.js Loaders Team Meeting 2024-04-13
- Node.js Loaders Team Meeting 2024-04-23 HOT 3
- Node.js Loaders Team Meeting 2024-05-07 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loaders.