-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Inline pthread worker.js file into the main output file #21701
Conversation
50b906f
to
5691c6f
Compare
256a82f
to
23f46b0
Compare
Would you consider doing this for wasm workers and audio worklets? Also, if this has many advantages, I would suggest making this the default, while keeping option to NOT embed the wasm file, for reduced size, module caching and stuff. |
Absolutely! One step a time though. Getting pthreads done first because it probably most used (and likely the hardest to get working) so a good proof of concept. |
What about this being default and wasm file embedding? What do you think? We can make another setting called EMBED_WASM |
My plan is to make this not only the default, but the only option. I don't see any reason at this point to keep the old method around. Don't we already have |
SINGLE_FILE seems to mean embed everything into one file, not just the wasm, I think we should have another name for embedding or separate the wasm since this can be quite misleading |
But if we remove the separate worker files, what other file are there? Another way of putting it: What files would you not want to embed when you use |
You're right, my mistake. But should we just rename the settings anyway? I'm really excited for this to land ngl |
Doesn't |
We should use a global switch statement for this? For simplicity I suggest just doing |
Rather than using a query string (which may complicate caching), can you use the name option? Only potential issue I can see is that it's not supported in Android Webview, but I'm not sure if that's a supported browser. |
Sure we can try that. Can you explain what you mean by "may complicate caching"?
|
Just that many caches may distinguish query strings. It may not be added to service worker caches either. I was thinking of a case where you add all the files in a service worker for offline use, but then it fails because of the query string. If someone was using a service worker they could work around that though. But it might be more predictable to avoid it possible. I don't know that the name property is a viable alternative however. |
Are you saying that adding the query string would mean that the file would not cached at all, or that maybe we would end up with two seperate cache entries (one for the |
In emscripten-core#21701 the running of extern-pre/post-js in pthreads was disabled. The reason was that we had a couple of tests that seemed to be assuming this. However, it turns out that there are important use cases that depend on this code running in threads. Instead, fix the two test cases by adding an extra condition. Fixes: emscripten-core#22012
In emscripten-core#21701 the running of extern-pre/post-js in pthreads was disabled. The reason was that we had a couple of tests that seemed to be assuming this. However, it turns out that there are important use cases that depend on this code running in threads. Instead, fix the two test cases by adding an extra condition. Fixes: emscripten-core#22012
In #21701 the running of extern-pre/post-js in pthreads was disabled. The reason was that we had a couple of tests that seemed to be assuming this. However, it turns out that there are important use cases that depend on this code running in threads. Instead, fix the two test cases by adding an extra condition. Fixes: #22012
…-core#22013) In emscripten-core#21701 the running of extern-pre/post-js in pthreads was disabled. The reason was that we had a couple of tests that seemed to be assuming this. However, it turns out that there are important use cases that depend on this code running in threads. Instead, fix the two test cases by adding an extra condition. Fixes: emscripten-core#22012
In the part using unquoted key here meant that closure would minify these key and this was a problem because the separate worker.js files would not then be able to interpret them. However since emscripten-core#21701 landed there is no longer separate worker.js file so closure can minify these keys and it will effect both sending and receiving code.
In the part using unquoted key here meant that closure would minify these key and this was a problem because the separate worker.js files would not then be able to interpret them. However since emscripten-core#21701 landed there is no longer separate worker.js file so closure can minify these keys and it will effect both sending and receiving code.
In the part using unquoted key here meant that closure would minify these key and this was a problem because the separate worker.js files would not then be able to interpret them. However since #21701 landed there is no longer separate worker.js file so closure can minify these keys and it will effect both sending and receiving code.
We stopped using a separate worker file back in emscripten-core#21701. That was released in 3.1.58 back in April. This change ends the transition period by no longer generating a dummy/useless worker.js file alongside the output.
We stopped using a separate worker file back in emscripten-core#21701. That was released in 3.1.58 back in April. This change ends the transition period by no longer generating a dummy/useless worker.js file alongside the output.
We stopped using a separate worker file back in emscripten-core#21701. That was released in 3.1.58 back in April. This change ends the transition period by no longer generating a dummy/useless worker.js file alongside the output.
We stopped using a separate worker file back in emscripten-core#21701. That was released in 3.1.58 back in April. This change ends the transition period by no longer generating a dummy/useless worker.js file alongside the output.
We stopped using a separate worker file back in #21701. That was released in 3.1.58 back in April. This change ends the transition period by no longer generating a dummy/useless worker.js file alongside the output.
These were introduced in emscripten-core#21701 but were never used.
These were introduced in emscripten-core#21701 but were never used.
These were introduced in #21701 but were never used.
…#22908) These were introduced in emscripten-core#21701 but were never used.
This method has many advantages over the previous method of generating a separate file:
-sSINGLE_FILE
now works with pthreadsThe test_pthread_custom_pthread_main_url test was completely removed
since it was testing how worker.js was located and worker.js no longer
exists.
Fixes: #9796