Skip to content

stabilize to a single minimum NodeJS LTS version for engines #1379

@thescientist13

Description

@thescientist13

Type of Change

Enhancement

Summary

Coming out of #1202 / #1372, we opened up the range for NodeJS LTS version to try and accommodate all minimum versions with the least amount of experimental features based on the current compatibility matrix at the time

"engines": {
  "node": "^18.20.5 || ^20.18.3 || >=22.12.0"
}

Per research into opening #1372 , here's a current breakdown of key feature we're using and where they stand in the NodeJS release / API status

Feature Min. Node Version Changelog Notes / Status
import.meta.resolve 18.19.0, 20.6.0 https://nodejs.org/docs/latest-v22.x/api/esm.html#importmetaresolvespecifier Release Candidate
JSON import attributes 18.20.5, 20.18.3, 22.12.0 https://nodejs.org/docs/latest-v22.x/api/esm.html#json-modules Stable
New Loader Hooks 20.6.0 https://nodejs.org/docs/latest-v22.x/api/module.html#customization-hooks Release Candidate
TypeScript 22.6.0 With --experimental-strip-types flag, unflagged in >=23, Node v22.x unflagged backport incoming Experimental (we should also be able to remove the --experimental-strip-types flag from our init TS template)

Details

Prior to 1.0, would like to go back to a single minimum version, using >= so we don't have to constantly be chasing the LTS release schedule, e.g.

The main items we're waiting on

I think eventually we can go to something like this for the engines field

"engines": {
  "node": ">=20.?.0"
}

We should also be able to clean up our test scenarios (consolidate TS tests into standard test suite) as well as swap over to using Amaro, if we can jump right to >=22 (since for now we decided to use sucrase in #1433)

Also, we would want to keep up with Vercel's NodeJS supported versions in our adapter
https://github.com/ProjectEvergreen/greenwood/blob/master/packages/plugin-adapter-vercel/src/types/index.d.ts#L3

Also, coming out of #1519, we could also consider enforcing our ESLint rule for node prefixes to match a NodeJS version.
We should also be able to remove our typescript specific test scripts


Some additional APIs that would be nice to get out of NodeJS and we should start tracking on

Metadata

Metadata

Labels

CLITypes(cript)Requires type definition or TypeScript related work / documentationalpha.6breakingenhancementImprove something existing (e.g. no docs, new APIs, etc)v0.33.0

Projects

Status

✅ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions