Skip to content

Upgrade Node.js runtime version to 22#24140

Merged
paescuj merged 19 commits intomainfrom
node-22
Jan 8, 2025
Merged

Upgrade Node.js runtime version to 22#24140
paescuj merged 19 commits intomainfrom
node-22

Conversation

@rijkvanzanten
Copy link
Member

@rijkvanzanten rijkvanzanten commented Dec 4, 2024

Scope

Upgrade Node.js runtime version to 22

Potential Risks / Drawbacks

  • Unknown / un-identified breaking changes between Node.js versions
  • People that are running the raw Node process somewhere somehow will have to upgrade
    • That might be an issue depending on your host, though Node 22 came out in April so you'd hope enough time has gone by for hosts to upgrade their stack

Review Notes / Questions

  • It's another game of What is a breaking change? As far as I can tell, Node 22 is backwards compatible with 18 so no breaks there, though there's always the chance of weirdness with external modules.
    • ✅ It's not breaking for Docker users per se, it's a potential breaking for raw-process and non-sandboxed extensions users. This is mentioned in the breaking changes docs pages.
  • Isolated-vm might have some wonkiness. I remember that being a thing last time we checked
    • ✅ Confirmed that the "snapshot" issue is not affecting us. Other issues with newer Node.js versions seem to be solved as well in the latest isolated-vm version. Tested on AMD and ARM. We therefore go without the --no-node-snapshot Node.js flag as this would come with unnecessary start-up time / performance degradation.
  • Do we want to make 22+ required, or keep 18+ as the requirement and allow 22? The latter makes it not a breaking change at the downside that we're now technically supporting 3 major versions of the runtime
    • ✅ Making 22+ required as keeping it on 18+ would prevent us from being able to use new 22 features and keeping dependencies up-to-date which have dropped support for < 22 as well. The complexity of supporting too many different Node.js runtime versions at the same time would therefore come with a certain reduction in quality.

Fixes #22124

@changeset-bot
Copy link

changeset-bot bot commented Dec 4, 2024

🦋 Changeset detected

Latest commit: e9ddb08

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 31 packages
Name Type
directus Minor
create-directus-project Major
@directus/api Major
@directus/constants Major
@directus/env Major
@directus/errors Major
@directus/extensions Major
@directus/extensions-registry Major
@directus/extensions-sdk Major
@directus/format-title Major
@directus/memory Major
@directus/pressure Major
@directus/random Major
@directus/release-notes-generator Major
@directus/schema Major
@directus/sdk Major
@directus/storage Major
@directus/storage-driver-azure Major
@directus/storage-driver-cloudinary Major
@directus/storage-driver-gcs Major
@directus/storage-driver-local Major
@directus/storage-driver-s3 Major
@directus/storage-driver-supabase Major
@directus/system-data Major
@directus/types Major
@directus/update-check Major
@directus/utils Major
@directus/validation Major
@directus/composables Patch
create-directus-extension Patch
@directus/themes Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rijkvanzanten rijkvanzanten requested a review from paescuj December 4, 2024 00:52
(for the sake of completeness)
The version specified under engine is picked up by some Node.js version managers
such as tj/n or fnm, as well as actions/setup-node which means we get a
single source of truth.

Under root it makes sense to use a fixed major version and strictly
disallow newer versions, so we all develop & test against the current
version officially supported by us.
>=22 is sufficient since there have been no significant changes since
initial 22 version (as opposed as 18.17 used to have)
@paescuj paescuj marked this pull request as ready for review January 7, 2025 21:22
@paescuj paescuj requested a review from a team January 7, 2025 21:22
@paescuj paescuj requested a review from a team as a code owner January 7, 2025 21:22
@paescuj paescuj requested a review from a team January 7, 2025 21:22
Copy link
Contributor

@hola-soy-milk hola-soy-milk left a comment

Choose a reason for hiding this comment

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

Thanks for this! Release notes look perfect 👍

@paescuj paescuj changed the title Upgrade node runtime version to 22 Upgrade Node.js runtime version to 22 Jan 8, 2025
@paescuj paescuj merged commit b8cc796 into main Jan 8, 2025
5 checks passed
@paescuj paescuj deleted the node-22 branch January 8, 2025 12:26
@github-actions github-actions bot added this to the Next Release milestone Jan 8, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Directus Project to Support Node.js Version 20

4 participants