Skip to content
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

build(deps): upgrade node to 18.13.0 #6018

Merged
merged 1 commit into from
Feb 2, 2023
Merged

Conversation

matt-boris
Copy link
Contributor

This upgrades Node.js to the latest LTS version available, v18.13.0. Previous version was v16.19.0 and it was scheduled to hit EoL later this year.

View the release schedule here.

@matt-boris matt-boris requested a review from a team as a code owner January 30, 2023 16:33
@matt-boris matt-boris requested review from lotas and petemoore and removed request for a team January 30, 2023 16:33
@@ -9,8 +9,8 @@

[build.environment]
YARN_FLAGS = "--frozen-lockfile"
YARN_VERSION = "1.22.4"
NODE_VERSION = "16.19.0"
YARN_VERSION = "1.22.19"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Missed this in #5586.

@matt-boris matt-boris force-pushed the matt-boris/node18.13.0 branch 2 times, most recently from cb8ed2c to 96a3158 Compare January 30, 2023 17:09
Comment on lines +11 to +13
"build": "export NODE_OPTIONS=--openssl-legacy-provider && webpack --mode production",
"start": "export NODE_OPTIONS=--openssl-legacy-provider && cross-env GENERATE_ENV_JS=1 webpack-dev-server --mode development",
"start:docker": "export NODE_OPTIONS=--openssl-legacy-provider && cross-env GENERATE_ENV_JS=1 webpack-dev-server --host 0.0.0.0 --disable-host-check --hot --mode development",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since Node.js v17, it now supports OpenSSL v3.0, which brings tightened restrictions on the allowed algorithms and key sizes. Because we can't upgrade webpack to the latest version (Neutrino doesn't support), we need to use the legacy provider to avoid the ERR_OSSL_EVP_UNSUPPORTED error.

@@ -179,7 +179,7 @@
"release": "node infrastructure/tooling/src/main.js release",
"staging-release": "node infrastructure/tooling/src/main.js staging-release",
"release:publish": "node infrastructure/tooling/src/main.js release:publish",
"generate": "node infrastructure/tooling/src/main.js generate",
"generate": "export NODE_OPTIONS=--dns-result-order=ipv4first && node infrastructure/tooling/src/main.js generate",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since Node.js v17, the DNS result order is returned how the resolver sent the list PR. This breaks some of our testing/infra scripts because IPv6 localhosts are now returned instead of IPv4.

Copy link

@treysis treysis Jan 31, 2023

Choose a reason for hiding this comment

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

Instead of interfering with DNS order returned by the operating system, it's probably better to make use of Happy Eyeballs*, which was finally implemented in Node v18. EDIT: Unfortunately the folllowing option is only available in 19.4 for now :(

Suggested change
"generate": "export NODE_OPTIONS=--dns-result-order=ipv4first && node infrastructure/tooling/src/main.js generate",
"generate": "export NODE_OPTIONS=--enable-network-family-autoselection && node infrastructure/tooling/src/main.js generate",

*Happy Eyeballs is used by every web browser around (Chrome, Firefox, Opera, Internet Explorer, ...). It also solves issues in round-robin cases where one returned IP address isn't accessible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Awesome, thanks for this note @treysis!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@treysis it seems like this command line option is not available yet in v18:

/usr/local/bin/node: --enable-network-family-autoselection is not allowed in NODE_OPTIONS

https://nodejs.org/api/cli.html#--enable-network-family-autoselection

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll likely just revert to what we had and will come back to this if/when that CLI option is backported to v18.

@treysis do you happen to know if that's on the roadmap? I looked through some open issues/PRs and wasn't able to tell for sure.

Copy link

Choose a reason for hiding this comment

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

Oops. No idea how I overlooked that. I was sure the cli option made it into 18.13. Apparently it's just the general support for Happy Eyeballs that made it into 18.13. It requires to set the option autoSelectFamily=true for each net-call separately.

Yes, it's a bit confusing. Seems to depend on nodejs/node#45994 to make it into 18.x. It's worked on. So fingers crossed!

@@ -10,7 +10,7 @@
],
"scripts": {
"lint": "eslint src/*.js test/*.js",
"test": "karma start --single-run"
"test": "export NODE_OPTIONS=--openssl-legacy-provider && karma start --single-run"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since Node.js v17, it now supports OpenSSL v3.0, which brings tightened restrictions on the allowed algorithms and key sizes. Because we can't upgrade webpack to the latest version (Neutrino doesn't support), we need to use the legacy provider to avoid the ERR_OSSL_EVP_UNSUPPORTED error.

@matt-boris matt-boris marked this pull request as ready for review January 30, 2023 18:05
@matt-boris matt-boris merged commit 4abdc33 into main Feb 2, 2023
@matt-boris matt-boris deleted the matt-boris/node18.13.0 branch February 2, 2023 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants