Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Emscripten build configuration for the spz-wasm package by disabling binary encoding for the inlined WASM file. This change is intended to resolve compatibility issues with certain bundlers, though it results in a larger bundle size due to base64 encoding. The reviewer suggests adding a comment to the build script to document this trade-off and prevent future maintainers from reverting the change without understanding its necessity.
|
Has anyone reviewed this PR? It would help solve an issue that is affecting CesiumJS. |
|
@Leafmire @WillGrayMSU |
Summary
This PR was motivated by a report from issue:
Octal escape sequences from v0.3.1 affecting Cesium JS #89
@spz-loader/core 0.3.1 appears to trigger bundler/parser issues, while overriding back to 0.3.0 resolves the problem. One important version boundary is that packages/core/package.json in 0.3.1 pins the wasm build to emscripten/emsdk:5.0.3.
Related Emscripten issue:
emscripten-core/emscripten#25906
Based investigation, the likely cause is the single-file binary encoding format used by newer Emscripten builds default option. This PR explicitly disables that encoding and falls back to the older base64-compatible single-file output.
If the inclusion of binary encoding was not intended, this PR will revert it to the same encoding format as the previous version.
Change
add
-s SINGLE_FILE_BINARY_ENCODE=0to packages/core/lib/spz-wasm/build.sh