fix(core): remove engines field, improve compatibility documentation (#31245)

This commit is contained in:
James Henry 2025-05-16 18:00:00 +04:00 committed by GitHub
parent c4cb96c2e7
commit fcd630ddd9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 62 additions and 51 deletions

View File

@ -1,20 +1,37 @@
--- ---
title: Nx, NodeJS and TypeScript Compatibility Matrix title: Nx, Node.js and TypeScript Compatibility
description: A reference table showing which versions of Node.js and TypeScript are compatible with different major versions of Nx. description: A reference outlining Nx's support policy and current compatibility matrix for Node.js and TypeScript.
--- ---
# Nx, NodeJS and TypeScript Compatibility Matrix # Nx, Node.js and TypeScript Compatibility
Below is a reference table that matches versions the latest major versions of Nx to the version TypeScript that it uses ## Node.js Compatibility Matrix
and the version of NodeJS that we tested it against.
> _Note: Other versions of NodeJS **may** still work without issue for these versions of Nx. This table outlines the Below is a reference table that matches the most recent major versions of Nx to the versions of Node.js that they officially support, and are tested against.
> version of NodeJS that we used when building and testing each particular version of Nx._
| Nx Version | Node Version | Typescript Version | Nx's policy is to support the LTS versions (i.e. actively maintained even numbered versions) of Node.js, but we will only remove support for older versions in a major version of Nx to avoid unexpected disruption. We may add support for newer LTS versions in a minor version of Nx as long as it would not break existing projects.
| --------------- | ---------------- | ------------------ |
| 21.x (next) | 22.x, ^20.19.0, | ~5.4.2 | > _Note: Other versions of Node.js **may** still work without issue for these versions of Nx. Those include versions which are already EOL, or odd version numbers (e.g. 23), which Node.js actively
| 20.x (latest) | 22.x, 20.x, 18.x | ~5.4.2 | > discourages using in production._
| 19.x (previous) | 22.x, 20.x, 18.x | ~5.4.2 |
| 18.x | 20.x, 18.x | ~5.4.2 | | Nx Version | Node Version |
| 17.x | 20.x, 18.x | ~5.1.0 | | --------------- | ------------------ |
| 21.x (current) | ^22.12.0, ^20.19.0 |
| 20.x (previous) | 22.x, 20.x, 18.x |
| 19.x | 22.x, 20.x, 18.x |
| 18.x | 20.x, 18.x |
We intentionally do not include an `"engines"` field in the `package.json` file for Nx in order to allow for user flexibility, but this page should be considered the official compatibility matrix.
## TypeScript Compatibility
Unlike Node.js, TypeScript's policy is not to follow semver conventions around breaking changes only coming in major versions, despite using version numbers that are semver-like. Just like with Node.js, though, we will only remove support for older versions of TypeScript in a major version of Nx to avoid unexpected disruption. We may add support for newer versions in a minor version of Nx as long as it would not break existing projects.
| Nx Version | TypeScript Version |
| --------------- | ------------------ |
| 21.x (current) | >= 5.4.2 < 5.9.0 |
| 20.x (previous) | ~5.4.2 |
| 19.x | ~5.4.2 |
| 18.x | ~5.4.2 |
This page will be updated from time to time to reflect the latest versions of Node.js and TypeScript that are supported. If you encounter issues with Nx, please make sure you are using a supported version of Node.js and TypeScript before filing an issue.

View File

@ -1,20 +1,37 @@
--- ---
title: Nx, NodeJS and TypeScript Compatibility Matrix title: Nx, Node.js and TypeScript Compatibility
description: A reference table showing which versions of Node.js and TypeScript are compatible with different major versions of Nx. description: A reference outlining Nx's support policy and current compatibility matrix for Node.js and TypeScript.
--- ---
# Nx, NodeJS and TypeScript Compatibility Matrix # Nx, Node.js and TypeScript Compatibility
Below is a reference table that matches versions the latest major versions of Nx to the version TypeScript that it uses ## Node.js Compatibility Matrix
and the version of NodeJS that we tested it against.
> _Note: Other versions of NodeJS **may** still work without issue for these versions of Nx. This table outlines the Below is a reference table that matches the most recent major versions of Nx to the versions of Node.js that they officially support, and are tested against.
> version of NodeJS that we used when building and testing each particular version of Nx._
| Nx Version | Node Version | Typescript Version | Nx's policy is to support the LTS versions (i.e. actively maintained even numbered versions) of Node.js, but we will only remove support for older versions in a major version of Nx to avoid unexpected disruption. We may add support for newer LTS versions in a minor version of Nx as long as it would not break existing projects.
| --------------- | ---------------- | ------------------ |
| 21.x (next) | 22.x, ^20.19.0, | ~5.4.2 | > _Note: Other versions of Node.js **may** still work without issue for these versions of Nx. Those include versions which are already EOL, or odd version numbers (e.g. 23), which Node.js actively
| 20.x (latest) | 22.x, 20.x, 18.x | ~5.4.2 | > discourages using in production._
| 19.x (previous) | 22.x, 20.x, 18.x | ~5.4.2 |
| 18.x | 20.x, 18.x | ~5.4.2 | | Nx Version | Node Version |
| 17.x | 20.x, 18.x | ~5.1.0 | | --------------- | ------------------ |
| 21.x (current) | ^22.12.0, ^20.19.0 |
| 20.x (previous) | 22.x, 20.x, 18.x |
| 19.x | 22.x, 20.x, 18.x |
| 18.x | 20.x, 18.x |
We intentionally do not include an `"engines"` field in the `package.json` file for Nx in order to allow for user flexibility, but this page should be considered the official compatibility matrix.
## TypeScript Compatibility
Unlike Node.js, TypeScript's policy is not to follow semver conventions around breaking changes only coming in major versions, despite using version numbers that are semver-like. Just like with Node.js, though, we will only remove support for older versions of TypeScript in a major version of Nx to avoid unexpected disruption. We may add support for newer versions in a minor version of Nx as long as it would not break existing projects.
| Nx Version | TypeScript Version |
| --------------- | ------------------ |
| 21.x (current) | >= 5.4.2 < 5.9.0 |
| 20.x (previous) | ~5.4.2 |
| 19.x | ~5.4.2 |
| 18.x | ~5.4.2 |
This page will be updated from time to time to reflect the latest versions of Node.js and TypeScript that are supported. If you encounter issues with Nx, please make sure you are using a supported version of Node.js and TypeScript before filing an issue.

View File

@ -167,8 +167,5 @@
"x86_64-unknown-linux-musl", "x86_64-unknown-linux-musl",
"x86_64-unknown-freebsd" "x86_64-unknown-freebsd"
] ]
},
"engines": {
"node": "^20.19.0 || ^22.12.0"
} }
} }

View File

@ -17,8 +17,5 @@
"@types/react": "<%= reactVersion %>", "@types/react": "<%= reactVersion %>",
"@types/react-dom": "<%= reactVersion %>" "@types/react-dom": "<%= reactVersion %>"
}, },
"engines": {
"node": ">=20"
},
"sideEffects": false "sideEffects": false
} }

View File

@ -17,8 +17,5 @@
"@types/react": "<%= reactVersion %>", "@types/react": "<%= reactVersion %>",
"@types/react-dom": "<%= reactVersion %>" "@types/react-dom": "<%= reactVersion %>"
}, },
"engines": {
"node": ">=20"
},
"sideEffects": false, "sideEffects": false,
} }

View File

@ -455,7 +455,6 @@ describe('Remix Application', () => {
"private", "private",
"type", "type",
"scripts", "scripts",
"engines",
"sideEffects", "sideEffects",
"nx", "nx",
"dependencies", "dependencies",
@ -477,9 +476,6 @@ describe('Remix Application', () => {
"@types/react": "^18.2.0", "@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0", "@types/react-dom": "^18.2.0",
}, },
"engines": {
"node": ">=20",
},
"name": "@proj/myapp", "name": "@proj/myapp",
"nx": { "nx": {
"tags": [ "tags": [
@ -661,7 +657,6 @@ describe('Remix Application', () => {
"private", "private",
"type", "type",
"scripts", "scripts",
"engines",
"sideEffects", "sideEffects",
"nx", "nx",
"dependencies", "dependencies",
@ -694,9 +689,6 @@ describe('Remix Application', () => {
"@types/react": "^18.2.0", "@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0", "@types/react-dom": "^18.2.0",
}, },
"engines": {
"node": ">=20",
},
"name": "@proj/myapp", "name": "@proj/myapp",
"private": true, "private": true,
"scripts": {}, "scripts": {},

View File

@ -16,8 +16,5 @@
"@types/react": "<%= typesReactVersion %>", "@types/react": "<%= typesReactVersion %>",
"@types/react-dom": "<%= typesReactDomVersion %>" "@types/react-dom": "<%= typesReactDomVersion %>"
}, },
"engines": {
"node": ">=20"
},
"sideEffects": false "sideEffects": false
} }

View File

@ -16,8 +16,5 @@
"@types/react": "<%= typesReactVersion %>", "@types/react": "<%= typesReactVersion %>",
"@types/react-dom": "<%= typesReactDomVersion %>" "@types/react-dom": "<%= typesReactDomVersion %>"
}, },
"engines": {
"node": ">=20"
},
"sideEffects": false "sideEffects": false
} }