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

Update Node.js to 22.x #4085

Open
5 tasks
marcelgerber opened this issue Oct 25, 2024 · 0 comments · May be fixed by #4351
Open
5 tasks

Update Node.js to 22.x #4085

marcelgerber opened this issue Oct 25, 2024 · 0 comments · May be fixed by #4351
Labels
ops Devops related issues (stagings servers, ...) priority 3 - nice to have site viz

Comments

@marcelgerber
Copy link
Member

marcelgerber commented Oct 25, 2024

We are currently running all our servers on Node 18.16, a version released in April 2023.

2024-10-29 (next Tuesday) marks the day when Node 22 goes into Active LTS.

New features

Going from 18.16 to (e.g.) 22.10 gives us the following new features:

  • (v20) Support for immutable Array.toReversed(), .toSorted(), etc. operations
  • (v20) A Node-inbuilt test runner
  • (v21) Support for Object.groupBy() and Map.groupBy()
  • (v22) Set methods like Set.union(), Set.intersection()
  • (v22) Watch mode (node --watch)
  • (v22) Inbuilt glob and globSync
  • Performance improvements
  • (v22.7) More compatible RequireJS/ESM module loading (Module syntax detection)
  • (v22.6) Experimental TypeScript type stripping

Compatibility

I have silently run my local dev setup on Node 22.x for quite a while and haven't noticed any compatibility issues. The only issue I noticed is that we're getting this deprecation warning a bunch of times:

(node:90744) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

We can most likely fix this one by upgrading/fixing the version of whatwg-url in our dependencies.

Steps

  • Update our server setup scripts in https://github.com/owid/ops to install Node 22
  • Ensure that new staging servers run on Node 22
  • Update prod servers to Node 22
  • Switch to using Corepack (corepack enable) rather than installing yarn manually?
  • ...?
@rakyi rakyi added viz site ops Devops related issues (stagings servers, ...) priority 3 - nice to have and removed needs triage labels Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ops Devops related issues (stagings servers, ...) priority 3 - nice to have site viz
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants