-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Enable use of Tools.LoadScript in a WebWorker #12884
Enable use of Tools.LoadScript in a WebWorker #12884
Conversation
…oked in a WebWorker
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
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.
GG !!!! thanks a lot
Just a tiny format issue and good to go :-) |
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.
you rock! thanks a lot
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://babylonsnapshots.z22.web.core.windows.net/refs/pull/12884/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/12884/merge To test the snapshot in the playground with a playground ID add it after the snapshot query string: https://playground.babylonjs.com/?snapshot=refs/pull/12884/merge#BCU1XR#0 |
* use importScripts instead of HTMLScriptElement when LoadScript is invoked in a WebWorker * lint Former-commit-id: 1aa95194fb1287d6c0033a04a93cdacc219024fd
Fixes #12882
LoadScript
is called from aWebWorker
context and, if so, usesimportScripts
instead ofHTMLScriptElement
to load the script.LoadScript
always resolves with eitheronSuccess
oronError
Use case: using
ImportMeshAsync
in aWebWorker
for meshes requiringMeshoptCompression
RE the typings: there's apparently no clean solution as TypeScript is extremely not a fan of code designed to run in both DOM and WebWorker, these hideous double type assertions seemed less bad than falsely declaring importScripts as available on the Window interface