-
-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Shared Web Workers #401
Comments
Hey @bebraw! Regarding the steps… I think you pretty much wrapped it up already. Just to have an overview:
If you can contribute something, I would be happy to review and release it 🙂 |
I set up #402 . It's good for an early look and I'll refine based on your feedback. |
FYI: Safari added support again. I can already enable it on Mac with Safari 15.6 as an experimental feature. |
Well, see the pull request for some hints why adding SharedWorkers to threads.js is somewhat difficult. But it was not for nothing. I made this in the meantime, only for WebWorkers (dedicated, shared, maybe also service). Similar to the threads.js api, but not quite the same. The pool is a little basic, but I'm sure it can be improved in the future: |
Shared Web Workers are a relatively new feature that allow multiple scripts communicate with a single worker. A good use case would be for example sharing computation between multiple browser tabs.
When it comes to browser support, the feature is well supported apart from Safari. It used to have the feature for a while but then it was dropped. The background for the decision is explained at https://bugs.webkit.org/show_bug.cgi?id=149850 .
As we would have a direct use case for the feature in our current project, would it be possible for you to consider inclusion of the feature to threads.js? I am happy to contribute the code if we can agree on the steps. I imagine we would have to expose
SharedWorker
from threads.js itself and then also make sure the addition works with the webpack plugin. Safari might require some kind of a strategy as well.Reference: GoogleChromeLabs/worker-plugin#42 (shared worker support in Google's worker-plugin)
The text was updated successfully, but these errors were encountered: