-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add customWorkerFactory
to customize tsworker directly
#4035
Conversation
@microsoft-github-policy-service agree |
Afaik this approach does not work, as |
Ah I think I understand, you want to provide a replacement for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a little bit ugly that you pass in unserializable data into the create function to override the TypeScriptWorker (and I hope nobody tries to pass in this data from the host side that creates the worker), but I don't see a much nicer solution.
@microsoft-github-policy-service agree |
I actually think #3488 is a better solution. |
I had no idea that |
It does not have to be serializable when called from a script that imports the worker, but the data the host passes in has to be serializable. So it would have worked in your use-case, but it could confuse users. Thanks for coming up with this PR anyway! :) |
Add a way to customize typescript worker in module workers, avoiding importScripts (which the customWorkerPath uses to extend the typescript worker).
Hoping to provide some progress to #3151.