developit / web-worker

Consistent Web Workers in browser and Node.
https://npm.im/web-worker
Apache License 2.0
1.06k stars 55 forks source link

Relative handling, import.meta.url encouragement #5

Closed guybedford closed 4 years ago

guybedford commented 4 years ago

This resolves https://github.com/developit/web-worker/issues/3, supporting non-string inputs into new Worker (applying toString per the browser), removing the stack hack, and encouraging the use of import.meta.url in the readme.

We can likely include a reference to the stack approach in the readme note I've added, where I've called out that test and build support may still be an issue with this pattern. Ideally we could start chasing these up via https://github.com/developit/web-worker/issues/4.

developit commented 4 years ago

LGTM, figured I'd try to clarify the whole document URL / cwd metaphor, if that's alright.

guybedford commented 4 years ago

Great... maybe we can get the local tests running in this pattern too then using your Babel trick?