Disabling SINGLE_FILE_BINARY_ENCODE flag to prevent Binary-encoded inline wasm #90
Open
Leafmire wants to merge 2 commits into
Open
Disabling SINGLE_FILE_BINARY_ENCODE flag to prevent Binary-encoded inline wasm #90Leafmire wants to merge 2 commits into
Leafmire wants to merge 2 commits into
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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