Use simple import.meta.url for worker creation#23889
Open
JoeOsborn wants to merge 3 commits intoemscripten-core:mainfrom
Open
Use simple import.meta.url for worker creation#23889JoeOsborn wants to merge 3 commits intoemscripten-core:mainfrom
JoeOsborn wants to merge 3 commits intoemscripten-core:mainfrom
Conversation
This needs to be tested under various bundlers.
The webpack tests won't pass until the next release, but I have checked that they do pass under webpack's latest git HEAD. I also have failing tests here for vite and webpack under the mainScriptUrlOrBlob condition. These bundlers do funny things with paths and modules so I think it's worth having the coverage.
Collaborator
|
Looking at the test failures in We could perhaps use |
Collaborator
Or we could improve our |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This needs to be tested under various bundlers. Spun out from #23804 . Allows for scripts to be renamed after compilation.
Vite and (unreleased) Webpack and (I believe) Parcel allow for the form
new Worker(import.meta.url), which simplifies the new worker creation in libpthread and avoids the need for using a macro to expand the current script name (which makes the generated code fragile).I’ve taken the opportunity to expand the test coverage for permutations of bundlers and mainScriptUrlOrBlob with and without threads (qua #23890 ), but if this feels redundant then the change in libpthread is enough.