fix: Disable wasm reference-types for compatibility with devices like iOS 16#946
Merged
fix: Disable wasm reference-types for compatibility with devices like iOS 16#946
Conversation
Contributor
WASM Size Report
|
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
target_featurescustom section from the rawloro_wasm.wasmbefore runningwasm-bindgen, so generated JS falls back to slab-based object handles instead of externref table glue.strip-customcommand toloro-wasm-toolsand use it in theloro-wasmbuild pipeline.Root Cause
wasm-bindgen0.2.100 reads the wasmtarget_featurescustom section. When it sees+reference-types, it emits externref table glue. Safari 16.0-16.3 lacks WebAssembly reference-types support, which can surface as an out-of-bounds table access trap.Validation
git diff --checkcargo check -p loro-wasm-toolspnpm -C crates/loro-wasm build-releaseexternref,addToExternrefTable, and__wbindgen_init_externref_tableacrossbundler,nodejs,web, andbase64outputs.target_featuresandreference-types.