-
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
SINGLE_FILE html and worker fixes + tests #5736
Conversation
Otherwise looks good, thanks! |
Thanks! re: 1 and 2, got it, will go ahead and make those changes. re: 3, yep, now using SINGLE_FILE with html output will produce just a single html file with all JS included as inline scripts. It is a change from the previous behavior, but I don't remember if we'd decided one way or the other how this option should work with html or documented anything about that combination anywhere, so the fact that it left the JS separate from the html was probably just an oversight. |
Sounds good about 3. Please also add a test for it (just a few extra lines in an existing test, that no .js file is emitted). |
That is covered in the existing tests (see the assertion at the end of each one). |
Well, |
Yeah, some old debug code there assumed both html and js files existed. I fixed that on incoming now, so you should be able to merge that and then use that option here. |
Cool, thanks; just pushed the updated test. |
Great, thanks! |
While further investigating this as requested, I found some SINGLE_FILE bugs that impacted html output and workers.
Specifically:
SINGLE_FILE with html output would fail to compile, due to embedding the wasm in the js and deleting it, then afterwards trying to embed the deleted wasm in the html.
In the case of both html and workers, multiple files would be produced/required (respectively, test.html + test.js and test.js + test.worker.js).
Most of the lines changed in emcc.py are just indentation, so this will be easier to view with ?w=1.