-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[WASM_WORKERS] Inline .ww.js
file into the main output .js
file
#24163
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
Conversation
02fe7c8
to
c823cd9
Compare
Very happy to see this happening, thanks for working on it! I think conceptually .aw.js are also very similar, I gave a stab to trying to inline them before, but the amount of changes was getting out of hand (now I see why from this diff, it does require quite a bit of work). Do you think they could be also covered in or after this PR? |
I think may be possible, but would likely be a followup. |
c823cd9
to
65b40c8
Compare
7ba347e
to
b74a829
Compare
b74a829
to
081ac97
Compare
61dd4db
to
6d8ef34
Compare
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 there is further cleanup that could be made here (eg replacing onmessage =
with addEventListener
/ removeEventListener
to merge more polyfills together) but those can be left for future PRs.
LGTM % CI fixes.
What is the origin that the Worker gets loaded from after this change? Is it in the same origin? Also, does this retain csp-eval safety? |
@juj The worker is the main JS file itself, so the origin and CSP properties should remain the same, since you needed to load main JS before this PR as well (without it nothing works). |
8773c80
to
14a2674
Compare
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
This is similar to what we already did for pthreads (emscripten-core#24163) and normal wasm workers (emscripten-core#24163). By integrating this file we can actually share more startup code with normal wasm workers.
Now that the wasm worker code is always in the same file as the main JS code there is no need to quote or minify these names. See emscripten-core#24163.
Now that the wasm worker code is always in the same file as the main JS code there is no need to quote or minify these names. See emscripten-core#24163.
Now that the wasm worker code is always in the same file as the main JS code there is no need to quote or minify these names. See emscripten-core#24163.
Now that the wasm worker code is always in the same file as the main JS code there is no need to quote or minify these names. See emscripten-core#24163.
Now that the wasm worker code is always in the same file as the main JS code there is no need to quote or minify these names. See emscripten-core#24163.
Now that the wasm worker code is always in the same file as the main JS code there is no need to quote or minify these names. See #24163.
Similar to what we did for pthreads in #21701.
This is win for both code size and complexity. Importantly it avoid the issue how to package and deploy the extra
.ww.js
file.This also completely removes the need for the
-sWASM_WORKERS=2
mode.