Closed
Description
Node.js users has two problems:
- Simple and powerful sandboxing.
- Using ES modules.
Workers can solve both of them in very elegant way with custom resolvers which are the same as experimental es module resolver.
const worker = new Worker('./worker-path.js', {
moduleLoader: {resolve, dynamicInstantiate},
});
It solves sandboxing with full dependency control in custom context. And it simplifies es modules usage with preserving usual code flow in main thread and es flow in worker thread.
/cc @addaleax @TimothyGu @Qard @aqrln @oe @benjamingr @nodejs/workers