3 ms·
You can create a new thread via. `new Worker` but using a worker requires a separate file, and lots of serialisation code as you communicate via `postMessage`.
by bfgeek 2y ago
You can create a new thread via. `new Worker` but using a worker requires a separate file, and lots of serialisation code as you communicate via `postMessage`. TC39 module expressions helps but not a lot of movement recently. https://github.com/tc39/proposal-module-expressions?tab=readme-ov-file#problem-space https://github.com/tc39/proposal-module-expressions?tab=read...
- bakkoting 2y agoThere's some progress on that proposal, just happening elsewhere. https://github.com/tc39/proposal-esm-phase-imports https://github.com/tc39/proposal-esm-phase-imports defines machinery for importing a ModuleSource object which you can instantiate as a Worker, and once that's done module expressions would just be syntax which evaluates to a ModuleSource rather than needing a separate import.