simple-web-worker
simple-web-worker copied to clipboard
not failing in module scope when run in node
For universal (a.k.a. "isomorphic") rendering: Even though this is a web-only module, it's important to not fail when imported server-side, because sometimes that's where components get rendered.
Hi @antialias!
First of all, I am so truly sorry for the long hiatus on this project!
Thank you for your contribution!
As far as I know, Node has a worker_threads module that has been stable since 12.x. This package is not intended to be used on node, only on web environments. So, why use this package over the native node one?
why use this package over the native node one?
For rendering the components server-side. Even if it doesn't make sense to use a web worker on the server, it's important to not break the process when importing this module in a node environment.
why use this package over the native node one?
For rendering the components server-side. Even if it doesn't make sense to use a web worker on the server, it's important to not break the process when importing this module in a node environment.
This makes sense. ~It's amazing how narrow our vision and thoughts can be sometimes, isn't?~ 😅
Anyway, can you please add something to the README file to point out this use possibility, and perhaps some example case?