-
Notifications
You must be signed in to change notification settings - Fork 263
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
Modularize emscripten build. #26
Conversation
How was basis_transcoder.wasm rebuilt? It looks like in this build the settings from CMakeLists.txt from #7 aren't picked up, so the transcoder is back to being large. |
Hmm, I'm not sure why this is. I noticed my version of emscripten is behind latest. I've upgraded to Checking out origin/master and rebuilding also gives me the larger size so possibly something else is going on. I'll continue investigating, thanks! |
Ok this is my fault; my change in #7 didn't update CMakeLists correctly :( I'll make a patch for this. |
Added #27, sorry about that! |
No worries! I will rebase and update this PR once #27 is merged |
This PR has been rebased with HEAD after #27's merge |
Just want to make sure everything is fine with #27 - was the .wasm file rebuilt after rebase? GH seems to say that the .wasm file in this PR is still very large, but when I locally do this on a fresh Linux box:
I get this:
(the 200-ish KB .wasm file is what I'd expect, whereas this PR still has a ~750 KB file) |
Sorry! I'm not used to checking in binaries. I had rebuilt, confirmed the size change,but did not checkin updated binaries. Will do so early tomorrow. |
By default, emscripten's generated javascript modules lives in the global object "Module'. This makes it impossible to load multiple emscripten modules on the same page. In attempt to avoid namespace collision, this change modularizes the emscripten build so the Module is instead called 'BASIS'. Many target applications for Basis are likely to already be using other emscripten modules. Testing: The existing webgl/(texture|gltf) pages have been updated to use the new name and seem to operate as before
third time is the charm: updated binary now included |
Could we please review and merge this? It's important for modularity of Basis Universal's WebAssembly build. Thanks! |
Got it, thanks! |
By default, emscripten's generated javascript modules lives in the global object "Module'.
This makes it impossible to load multiple emscripten modules on the same page if they are all built using this default.
In attempt to avoid namespace collision, this change modularizes the emscripten build so the Module is instead called 'BASIS'. See the emscripten FAQ for more info: https://emscripten.org/docs/getting_started/FAQ.html
Many of the target applications for Basis are possibly using other emscripten modules, so this change will reduce friction of adding Basis(assuming any of their existing modules are not modularized)
This will require existing consumers of this package to change how they load Basis when they next upgrade their Basis build.
Testing:
The existing webgl/(texture|gltf) pages have been updated to use the new name and seem to operate as before
(Built/tested on OS X with emscripten sdk-1.38.29-64bit)