Skip to content

Commit 8d88a4a

Browse files
NickGerlemanmeta-codesync[bot]
authored andcommitted
Update Emscripten SDK from 3.1.28 to 4.0.23 (#1907)
Summary: Pull Request resolved: #1907 Update the Emscripten SDK used for the JavaScript WASM build from 3.1.28 to 4.0.23. This brings ~2 years of Emscripten improvements including better WASM codegen and smaller JS glue output. Required build config changes for Emscripten 4.x compatibility: - Remove `--memory-init-file 0` (deprecated, no longer accepted) - Change `TEXTDECODER=0` to `TEXTDECODER=2` (0 is no longer valid) - Add `EXPORTED_RUNTIME_METHODS=['HEAPF32','HEAP32']` (heap views are no longer on Module by default in 4.x) **Bundle size:** | Metric | emsdk 3.1.28 | emsdk 4.0.23 | Change | |---|---|---|---| | Raw | 115,370 B | 90,219 B | -21.8% | | Gzip | 42,764 B | 34,445 B | -19.4% | **Benchmark results (median of 3 runs):** | Benchmark | 3.1.28 | 4.0.23 | Change | |---|---|---|---| | Stack with flex | 9ms | 6ms | similar | | Align stretch | 5ms | 4ms | similar | | Nested flex | 4ms | 4ms | same | | Huge nested layout | 5ms | 4ms | similar | Reviewed By: cortinico Differential Revision: D95012856 fbshipit-source-id: b594f1a50626dc6c30b7a934c6146774b74ccfc1
1 parent 5ea3509 commit 8d88a4a

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

javascript/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ add_compile_options(${COMPILE_OPTIONS})
3232
add_link_options(
3333
${COMPILE_OPTIONS}
3434
"SHELL:--closure 1"
35-
"SHELL:--memory-init-file 0"
3635
"SHELL:--no-entry"
3736
"SHELL:-s ALLOW_MEMORY_GROWTH=1"
3837
"SHELL:-s ASSERTIONS=0"
@@ -44,12 +43,14 @@ add_link_options(
4443
"SHELL:-s MODULARIZE=1"
4544
"SHELL:-s EXPORT_ES6=1"
4645
"SHELL:-s WASM=1"
47-
"SHELL:-s TEXTDECODER=0"
46+
"SHELL:-s TEXTDECODER=2"
4847
"SHELL:-s SUPPORT_BIG_ENDIAN=1"
4948
# SINGLE_FILE=1 combined with ENVIRONMENT='web' creates code that works on
5049
# both bundlders and Node.
5150
"SHELL:-s SINGLE_FILE=1"
52-
"SHELL:-s ENVIRONMENT='web'")
51+
"SHELL:-s ENVIRONMENT='web'"
52+
"SHELL:-s EXPORTED_RUNTIME_METHODS=['HEAPF32','HEAP32']"
53+
"SHELL:-Wl,--export-dynamic")
5354

5455
add_library(yogaObjLib OBJECT ${YOGA_SOURCES} ${BRIDGE_SOURCES})
5556

javascript/just.config.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function runBenchTask() {
137137
};
138138
}
139139

140-
const emsdkVersion = '3.1.28';
140+
const emsdkVersion = '4.0.23';
141141
const emsdkPath = path.join(__dirname, '.emsdk');
142142
const emsdkBin = path.join(
143143
emsdkPath,

0 commit comments

Comments
 (0)