Skip to content

Bump minimum supported node version 10.19.0 -> 12.22.9 #24807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -835,10 +835,10 @@ jobs:
# support in the generated code.
# Keep this in sync with `OLDEST_SUPPORTED_NODE` in `feature_matrix.py`
- install-node-version:
node_version: "10.19.0"
node_version: "12.22.9"
- run-tests:
title: "node (oldest / 10.19.0)"
extra-cflags: "-sMIN_NODE_VERSION=101900"
title: "node (oldest / 12.22.9)"
extra-cflags: "-sMIN_NODE_VERSION=122209"
# We include most but not all of the nodefs and node rawfs tests here.
# test_fs_nodefs_rw, test_fs_nodefs_statvfs, and test_unistd_io_nodefs_bigint fail.
test_targets: "
Expand Down
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ See docs/process.md for more on how version tagging works.

4.0.12 (in development)
-----------------------
- The oldest supported node version was bumped from 10.19.0 to 12.22.9. Ths
means the smallest value that can now be passed to `-sMIN_NODE_VERSION` is
`122209`.
- In `-sMODULARIZE` mode the factory function will now always return a promise,
even when `WASM_ASYNC_COMPILATION` is disabled. This is because emscripten
has other features that might also return async module creation (e.g. loading
Expand Down
4 changes: 2 additions & 2 deletions site/source/docs/tools_reference/settings_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2908,9 +2908,9 @@ MIN_NODE_VERSION

Specifies minimum node version to target for the generated code. This is
distinct from the minimum version required run the emscripten compiler.
This version aligns with the current Ubuuntu TLS 20.04 (Focal).
This version aligns with the current Ubuuntu TLS 22.04 (Jammy).
Version is encoded in MMmmVV, e.g. 181401 denotes Node 18.14.01.
Minimum supported value is 101900, which was released 2020-02-05 (see
Minimum supported value is 122209, which was released 2022-01-11 (see
feature_matrix.py).

Default value: 160000
Expand Down
4 changes: 2 additions & 2 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1903,9 +1903,9 @@ var MIN_CHROME_VERSION = 85;

// Specifies minimum node version to target for the generated code. This is
// distinct from the minimum version required run the emscripten compiler.
// This version aligns with the current Ubuuntu TLS 20.04 (Focal).
// This version aligns with the current Ubuuntu TLS 22.04 (Jammy).
// Version is encoded in MMmmVV, e.g. 181401 denotes Node 18.14.01.
// Minimum supported value is 101900, which was released 2020-02-05 (see
// Minimum supported value is 122209, which was released 2022-01-11 (see
// feature_matrix.py).
var MIN_NODE_VERSION = 160000;

Expand Down
16 changes: 5 additions & 11 deletions test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from tools.shared import get_canonical_temp_dir, path_from_root
from tools.utils import MACOS, WINDOWS, read_file, read_binary, write_binary, exit_with_error
from tools.settings import COMPILE_TIME_SETTINGS
from tools import shared, feature_matrix, building, config, utils
from tools import shared, building, config, utils

logger = logging.getLogger('common')

Expand Down Expand Up @@ -1204,16 +1204,15 @@ def setUp(self):
nodejs = self.get_nodejs()
if nodejs:
node_version = shared.get_node_version(nodejs)
if node_version < (11, 0, 0):
if node_version < (15, 0, 0):
# The default behaviour changes in v15:
# https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode
self.node_args.append('--unhandled-rejections=strict')
if node_version < (11, 0, 0):
self.node_args.append('--experimental-wasm-se')
else:
# Include backtrace for all uncuaght exceptions (not just Error).
self.node_args.append('--trace-uncaught')
if node_version < (15, 0, 0):
# Opt in to node v15 default behaviour:
# https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode
self.node_args.append('--unhandled-rejections=throw')
self.node_args += shared.node_bigint_flags(nodejs)

# If the version we are running tests in is lower than the version that
Expand All @@ -1228,11 +1227,6 @@ def setUp(self):
self.cflags += building.get_emcc_node_flags(node_version)
self.cflags.append('-Wno-transpile')

# This allows much of the test suite to be run on older versions of node that don't
# support wasm bigint integration
if node_version[0] < feature_matrix.min_browser_versions[feature_matrix.Feature.JS_BIGINT_INTEGRATION]['node'] / 10000:
self.cflags.append('-sWASM_BIGINT=0')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm particularly interested in delete this gross couple of lines.. here we are basically saying that if the node version we are testing against is old enough we change the default settings for -sWASM_BIGINT... which seems very hacky.


self.v8_args = ['--wasm-staging']
self.env = {}
self.temp_files_before_run = []
Expand Down
4 changes: 2 additions & 2 deletions tools/feature_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
OLDEST_SUPPORTED_CHROME = 55 # December 1, 2016
OLDEST_SUPPORTED_FIREFOX = 50 # November 15, 2016
OLDEST_SUPPORTED_SAFARI = 101000 # September 20, 2016
# 10.19.0 is the oldest version of node that we do any testing with.
# 12.22.9 is the oldest version of node that we do any testing with.
# Keep this in sync with the test-node-compat in .circleci/config.yml.
OLDEST_SUPPORTED_NODE = 101900
OLDEST_SUPPORTED_NODE = 122209 # Janurary 11, 2022
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to keep node so much more recent (2022) than the browsers (2016)?

Or, is there a particular benefit to bumping node from 10 to 12?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to remove the complications around the --experimental-wasm-bigint flag. Right now we have to worry about 3 different cases:

  1. Really old versions of node that don't support that flag
  2. Somewhat old version that support the feature but require the flag
  3. New versions don't support that flag because its now the default.

But bumping to 12 we no longer need to worry bout the first case which simplifies things somewhat.

Also, I don't think we have any reason to support older versions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to keep node so much more recent (2022) than the browsers (2016)?

I think the reason here is that folks who run servers don't tend to let them get quite that out of date. I don't think we have any server-side users who are running such ancient distros.. but I could be wrong.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, my concern is that I feel I know more about web users than node users... I'm really not sure what kind of node versions people use. And 2022 feels fairly recent to me, though that's subjective.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth asking on the mailing list before making this change?



class Feature(IntEnum):
Expand Down
5 changes: 2 additions & 3 deletions tools/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,8 @@ def check_node_version():

def node_bigint_flags(nodejs):
node_version = get_node_version(nodejs)
# The --experimental-wasm-bigint flag was added in v12, and then removed (enabled by default)
# in v16.
if node_version and node_version < (16, 0, 0) and node_version >= (12, 0, 0):
# The --experimental-wasm-bigint was removed (enabled by default) in v16.
if node_version and node_version < (16, 0, 0):
return ['--experimental-wasm-bigint']
else:
return []
Expand Down