Skip to content

Commit 5e9e27f

Browse files
committed
Bump minimum supported node version v12.22.9 to v18.3.0.
This change updates the minimum support node version for the generated code. v18.3.0 was chosen because that is currently minimum supported version for running emscripten itself.
1 parent 57df161 commit 5e9e27f

17 files changed

+35
-145
lines changed

.circleci/config.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ commands:
106106
cat ~/emsdk/.emscripten
107107
echo "export PATH=\"$HOME/node-v${version}-linux-x64/bin:\$PATH\"" >> $BASH_ENV
108108
install-node-oldest:
109-
description: "install node 12.22.9 (oldest)"
109+
description: "install node 18.3.0 (oldest)"
110110
steps:
111111
- install-node-version:
112112
# Keep this in sync with `OLDEST_SUPPORTED_NODE` in `feature_matrix.py`
113-
node_version: "12.22.9"
113+
node_version: "18.3.0"
114114
install-node-lts:
115115
description: "install node 22.21.0 (current LTS)"
116116
steps:
@@ -970,8 +970,7 @@ jobs:
970970
# support in the generated code.
971971
- install-node-oldest
972972
- run-tests:
973-
title: "node (oldest / 12.22.9)"
974-
extra-cflags: "-sMIN_NODE_VERSION=122209"
973+
title: "node (oldest / 18.3.0)"
975974
# We include most but not all of the nodefs and node rawfs tests here.
976975
# test_fs_nodefs_rw, test_fs_nodefs_statvfs, and test_unistd_io_nodefs_bigint fail.
977976
test_targets: "

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ See docs/process.md for more on how version tagging works.
2929
- SDL3 port updated from 3.2.30 to 3.4.2 (#26572)
3030
- Fixed a race condition in syscall proxying that caused some hangs and ASan
3131
errors (#26582)
32+
- The minimum supported version of node for the generated code as bumped from
33+
v12.22.0 to v18.3.0. (#26604)
3234

3335
5.0.4 - 03/23/26
3436
----------------

site/source/docs/tools_reference/settings_reference.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2919,10 +2919,10 @@ MIN_NODE_VERSION
29192919
Specifies minimum node version to target for the generated code. This is
29202920
distinct from the minimum version required to run the emscripten compiler.
29212921
Version is encoded in MMmmVV, e.g. 181401 denotes Node 18.14.01.
2922-
Minimum supported value is 122209, which was released 2022-01-11 (see
2923-
feature_matrix.py). This version aligns with the Ubuntu TLS 22.04 (Jammy).
2922+
Minimum supported value is 180300, which was released 2022-05-18 (see
2923+
feature_matrix.py).
29242924

2925-
Default value: 160000
2925+
Default value: 180300
29262926

29272927
.. _minimal_runtime:
29282928

src/babel-plugins/strip-node-prefix.mjs

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/runtime_common.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,6 @@ function updateMemoryViews() {
136136
#endif
137137
}
138138

139-
#if ENVIRONMENT_MAY_BE_NODE && MIN_NODE_VERSION < 160000
140-
// The performance global was added to node in v16.0.0:
141-
// https://nodejs.org/api/globals.html#performance
142-
if (ENVIRONMENT_IS_NODE) {
143-
// This is needed for emscripten_get_now and for pthreads support which
144-
// depends on it for accurate timing.
145-
// Use `global` rather than `globalThis` here since older versions of node
146-
// don't have `globalThis`.
147-
global.performance ??= require('perf_hooks').performance;
148-
}
149-
#endif
150-
151139
#if IMPORTED_MEMORY
152140
// In non-standalone/normal mode, we create the memory here.
153141
#include "runtime_init_memory.js"

src/settings.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,9 +1920,9 @@ var MIN_CHROME_VERSION = 85;
19201920
// Specifies minimum node version to target for the generated code. This is
19211921
// distinct from the minimum version required to run the emscripten compiler.
19221922
// Version is encoded in MMmmVV, e.g. 181401 denotes Node 18.14.01.
1923-
// Minimum supported value is 122209, which was released 2022-01-11 (see
1924-
// feature_matrix.py). This version aligns with the Ubuntu TLS 22.04 (Jammy).
1925-
var MIN_NODE_VERSION = 160000;
1923+
// Minimum supported value is 180300, which was released 2022-05-18 (see
1924+
// feature_matrix.py).
1925+
var MIN_NODE_VERSION = 180300;
19261926

19271927
// If true, uses minimal sized runtime without POSIX features, Module,
19281928
// preRun/preInit/etc., Emscripten built-in XHR loading or library_browser.js.

test/codesize/test_codesize_hello_O0.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"a.out.js": 24261,
3-
"a.out.js.gz": 8714,
2+
"a.out.js": 24262,
3+
"a.out.js.gz": 8723,
44
"a.out.nodebug.wasm": 14850,
55
"a.out.nodebug.wasm.gz": 7311,
6-
"total": 39111,
7-
"total_gz": 16025,
6+
"total": 39112,
7+
"total_gz": 16034,
88
"sent": [
99
"fd_write"
1010
],

test/codesize/test_codesize_minimal_O0.expected.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
// Note: We use a typeof check here instead of optional chaining using
2020
// globalThis because older browsers might not have globalThis defined.
2121
var currentNodeVersion = typeof process !== 'undefined' && process.versions?.node ? humanReadableVersionToPacked(process.versions.node) : TARGET_NOT_SUPPORTED;
22-
if (currentNodeVersion < 160000) {
23-
throw new Error(`This emscripten-generated code requires node v${ packedVersionToHumanReadable(160000) } (detected v${packedVersionToHumanReadable(currentNodeVersion)})`);
22+
if (currentNodeVersion < 181901) {
23+
throw new Error(`This emscripten-generated code requires node v${ packedVersionToHumanReadable(181901) } (detected v${packedVersionToHumanReadable(currentNodeVersion)})`);
2424
}
2525

2626
var userAgent = typeof navigator !== 'undefined' && navigator.userAgent;

test/codesize/test_codesize_minimal_O0.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"a.out.js": 19452,
3-
"a.out.js.gz": 6998,
2+
"a.out.js": 19453,
3+
"a.out.js.gz": 7007,
44
"a.out.nodebug.wasm": 1015,
55
"a.out.nodebug.wasm.gz": 602,
6-
"total": 20467,
7-
"total_gz": 7600,
6+
"total": 20468,
7+
"total_gz": 7609,
88
"sent": [],
99
"imports": [],
1010
"exports": [
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"hello_world.js": 57078,
3-
"hello_world.js.gz": 17753,
3+
"hello_world.js.gz": 17757,
44
"hello_world.wasm": 14850,
55
"hello_world.wasm.gz": 7311,
66
"no_asserts.js": 26654,
77
"no_asserts.js.gz": 8901,
88
"no_asserts.wasm": 12010,
99
"no_asserts.wasm.gz": 5880,
1010
"strict.js": 54896,
11-
"strict.js.gz": 17061,
11+
"strict.js.gz": 17065,
1212
"strict.wasm": 14850,
1313
"strict.wasm.gz": 7311,
1414
"total": 180338,
15-
"total_gz": 64217
15+
"total_gz": 64225
1616
}

0 commit comments

Comments
 (0)