From df39eadc03edcd23fab47712d24818d2d0c75d16 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Fri, 6 Jun 2025 05:21:39 -0700 Subject: [PATCH] Bump minimum Node.js version to 22.14.0 (#51840) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51840 Bumps the minimum version of Node.js in React Native to the current active LTS release (22.x, upgraded from 18.x which is now out of support). - CI configurations are reduced from `[22, 20, 18]` to `[24, 22]`. {F1978909878} See https://nodejs.org/en/about/previous-releases. Changelog: [General][Breaking] - Our new minimum Node version is Node.js 22 Reviewed By: yungsters, cortinico Differential Revision: D76037015 fbshipit-source-id: b6e4b3ee279a9a93d716a13297420bba73f45250 --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/ISSUE_TEMPLATE/debugger_bug_report.yml | 2 +- .github/ISSUE_TEMPLATE/new_architecture_bug_report.yml | 2 +- .github/actions/lint/action.yml | 2 +- .github/actions/setup-node/action.yml | 2 +- .github/actions/test-js/action.yml | 2 +- .github/workflows/monitor-new-issues.yml | 2 +- .github/workflows/test-all.yml | 4 ++-- .../npm/@tsconfig/{node18_v1.x.x.js => node22_v22.x.x.js} | 2 +- package.json | 2 +- packages/assets/package.json | 2 +- packages/babel-plugin-codegen/package.json | 2 +- packages/community-cli-plugin/package.json | 2 +- packages/core-cli-utils/package.json | 2 +- packages/debugger-frontend/package.json | 2 +- packages/debugger-shell/package.json | 2 +- packages/dev-middleware/package.json | 2 +- packages/eslint-config-react-native/package.json | 2 +- packages/eslint-plugin-react-native/package.json | 2 +- packages/eslint-plugin-specs/package.json | 2 +- packages/gradle-plugin/package.json | 2 +- packages/helloworld/package.json | 2 +- packages/metro-config/package.json | 2 +- packages/new-app-screen/package.json | 2 +- packages/polyfills/package.json | 2 +- packages/react-native-babel-preset/package.json | 2 +- packages/react-native-babel-transformer/package.json | 2 +- packages/react-native-bots/package.json | 2 +- .../react-native-codegen-typescript-test/package.json | 2 +- packages/react-native-codegen/package.json | 2 +- packages/react-native-compatibility-check/package.json | 2 +- packages/react-native/package.json | 2 +- packages/rn-tester/package.json | 2 +- packages/virtualized-lists/package.json | 2 +- scripts/build/config.js | 2 +- yarn.lock | 8 ++++---- 36 files changed, 40 insertions(+), 40 deletions(-) rename flow-typed/npm/@tsconfig/{node18_v1.x.x.js => node22_v22.x.x.js} (83%) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 9fea71cb797..2049a6d802b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -83,7 +83,7 @@ body: path: /bin/zsh Binaries: Node: ... - version: 18.14.0 + version: 22.14.0 ... render: text validations: diff --git a/.github/ISSUE_TEMPLATE/debugger_bug_report.yml b/.github/ISSUE_TEMPLATE/debugger_bug_report.yml index b586e9b5266..be4ea961726 100644 --- a/.github/ISSUE_TEMPLATE/debugger_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/debugger_bug_report.yml @@ -62,7 +62,7 @@ body: path: /bin/zsh Binaries: Node: ... - version: 18.14.0 + version: 22.14.0 ... render: text validations: diff --git a/.github/ISSUE_TEMPLATE/new_architecture_bug_report.yml b/.github/ISSUE_TEMPLATE/new_architecture_bug_report.yml index 2d6581600b1..4f4936bb2dc 100644 --- a/.github/ISSUE_TEMPLATE/new_architecture_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/new_architecture_bug_report.yml @@ -95,7 +95,7 @@ body: path: /bin/zsh Binaries: Node: ... - version: 18.14.0 + version: 22.14.0 ... render: text validations: diff --git a/.github/actions/lint/action.yml b/.github/actions/lint/action.yml index 1eeec5361e3..1b763e19359 100644 --- a/.github/actions/lint/action.yml +++ b/.github/actions/lint/action.yml @@ -4,7 +4,7 @@ inputs: node-version: description: "The node.js version to use" required: false - default: "20" + default: "22" github-token: description: "The GitHub token used by pull-bot" required: true diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml index 8123f5a7855..b22fb3e822d 100644 --- a/.github/actions/setup-node/action.yml +++ b/.github/actions/setup-node/action.yml @@ -4,7 +4,7 @@ inputs: node-version: description: 'The node.js version to use' required: false - default: '20' + default: '22' runs: using: "composite" steps: diff --git a/.github/actions/test-js/action.yml b/.github/actions/test-js/action.yml index 7755fc410b1..2528973d6e4 100644 --- a/.github/actions/test-js/action.yml +++ b/.github/actions/test-js/action.yml @@ -4,7 +4,7 @@ inputs: node-version: description: "The node.js version to use" required: false - default: "20" + default: "22" runs: using: composite steps: diff --git a/.github/workflows/monitor-new-issues.yml b/.github/workflows/monitor-new-issues.yml index da36abc93b1..f5ace495311 100644 --- a/.github/workflows/monitor-new-issues.yml +++ b/.github/workflows/monitor-new-issues.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: '20' + node-version: '22' - name: Install dependencies uses: ./.github/actions/yarn-install - name: Extract next oncall diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 6e8a5fd21d1..edeea4ef7b4 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -585,7 +585,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: ["22", "20", "18"] + node-version: ["24", "22"] steps: - name: Checkout uses: actions/checkout@v4 @@ -601,7 +601,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Run all the Linters + - name: Run all the linters uses: ./.github/actions/lint with: github-token: ${{ env.GH_TOKEN }} diff --git a/flow-typed/npm/@tsconfig/node18_v1.x.x.js b/flow-typed/npm/@tsconfig/node22_v22.x.x.js similarity index 83% rename from flow-typed/npm/@tsconfig/node18_v1.x.x.js rename to flow-typed/npm/@tsconfig/node22_v22.x.x.js index 3e7f193200f..b5ad2231a48 100644 --- a/flow-typed/npm/@tsconfig/node18_v1.x.x.js +++ b/flow-typed/npm/@tsconfig/node22_v22.x.x.js @@ -8,6 +8,6 @@ * @format */ -declare module '@tsconfig/node18/tsconfig.json' { +declare module '@tsconfig/node22/tsconfig.json' { declare module.exports: any; } diff --git a/package.json b/package.json index 77bc35fc405..36f49e7c4d4 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "@microsoft/api-extractor": "^7.52.2", "@react-native/metro-babel-transformer": "0.80.0-main", "@react-native/metro-config": "0.80.0-main", - "@tsconfig/node18": "1.0.1", + "@tsconfig/node22": "22.0.2", "@types/react": "^19.0.0", "@typescript-eslint/parser": "^7.1.1", "ansi-styles": "^4.2.1", diff --git a/packages/assets/package.json b/packages/assets/package.json index f5806d9412d..fef11670750 100644 --- a/packages/assets/package.json +++ b/packages/assets/package.json @@ -17,7 +17,7 @@ ], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "files": [ "path-support.js", diff --git a/packages/babel-plugin-codegen/package.json b/packages/babel-plugin-codegen/package.json index f0af6dd7550..b6896dceaf7 100644 --- a/packages/babel-plugin-codegen/package.json +++ b/packages/babel-plugin-codegen/package.json @@ -19,7 +19,7 @@ ], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "files": [ "index.js" diff --git a/packages/community-cli-plugin/package.json b/packages/community-cli-plugin/package.json index cc9b19514ce..c065551b548 100644 --- a/packages/community-cli-plugin/package.json +++ b/packages/community-cli-plugin/package.json @@ -43,6 +43,6 @@ } }, "engines": { - "node": ">=18" + "node": ">= 22.14.0" } } diff --git a/packages/core-cli-utils/package.json b/packages/core-cli-utils/package.json index cbed8b6a354..4e320029403 100644 --- a/packages/core-cli-utils/package.json +++ b/packages/core-cli-utils/package.json @@ -21,7 +21,7 @@ ], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "files": [ "dist" diff --git a/packages/debugger-frontend/package.json b/packages/debugger-frontend/package.json index 249e5dfe90a..7b529939c51 100644 --- a/packages/debugger-frontend/package.json +++ b/packages/debugger-frontend/package.json @@ -20,6 +20,6 @@ "BUILD_INFO" ], "engines": { - "node": ">=18" + "node": ">= 22.14.0" } } diff --git a/packages/debugger-shell/package.json b/packages/debugger-shell/package.json index 9b1a70737b4..cf3062ba0d6 100644 --- a/packages/debugger-shell/package.json +++ b/packages/debugger-shell/package.json @@ -26,7 +26,7 @@ }, "license": "MIT", "engines": { - "node": ">=18", + "node": ">= 22.14.0", "electron": ">=36.2.0" }, "dependencies": { diff --git a/packages/dev-middleware/package.json b/packages/dev-middleware/package.json index 02dff6e7cd1..590ef435fbb 100644 --- a/packages/dev-middleware/package.json +++ b/packages/dev-middleware/package.json @@ -35,7 +35,7 @@ "ws": "^6.2.3" }, "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "devDependencies": { "selfsigned": "^2.4.1", diff --git a/packages/eslint-config-react-native/package.json b/packages/eslint-config-react-native/package.json index fd4596f06fb..47b55f317c9 100644 --- a/packages/eslint-config-react-native/package.json +++ b/packages/eslint-config-react-native/package.json @@ -16,7 +16,7 @@ ], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "main": "index.js", "dependencies": { diff --git a/packages/eslint-plugin-react-native/package.json b/packages/eslint-plugin-react-native/package.json index 55360291317..d5bfa2fef2f 100644 --- a/packages/eslint-plugin-react-native/package.json +++ b/packages/eslint-plugin-react-native/package.json @@ -22,6 +22,6 @@ "hermes-eslint": "0.28.1" }, "engines": { - "node": ">=18" + "node": ">= 22.14.0" } } diff --git a/packages/eslint-plugin-specs/package.json b/packages/eslint-plugin-specs/package.json index 9bd6490e4c8..7eac34bee85 100644 --- a/packages/eslint-plugin-specs/package.json +++ b/packages/eslint-plugin-specs/package.json @@ -36,6 +36,6 @@ "hermes-eslint": "0.28.1" }, "engines": { - "node": ">=18" + "node": ">= 22.14.0" } } diff --git a/packages/gradle-plugin/package.json b/packages/gradle-plugin/package.json index d3c872fe64f..86f05236f7b 100644 --- a/packages/gradle-plugin/package.json +++ b/packages/gradle-plugin/package.json @@ -16,7 +16,7 @@ ], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "scripts": { "build": "./gradlew build", diff --git a/packages/helloworld/package.json b/packages/helloworld/package.json index 82448d2dd67..14b421fca22 100644 --- a/packages/helloworld/package.json +++ b/packages/helloworld/package.json @@ -34,6 +34,6 @@ "rxjs": "^7.8.1" }, "engines": { - "node": ">=18" + "node": ">= 22.14.0" } } diff --git a/packages/metro-config/package.json b/packages/metro-config/package.json index e78bebb99cd..6abbf1995a8 100644 --- a/packages/metro-config/package.json +++ b/packages/metro-config/package.json @@ -16,7 +16,7 @@ ], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "exports": { ".": "./src/index.js", diff --git a/packages/new-app-screen/package.json b/packages/new-app-screen/package.json index 07a44d08837..4586172b671 100644 --- a/packages/new-app-screen/package.json +++ b/packages/new-app-screen/package.json @@ -30,6 +30,6 @@ } }, "engines": { - "node": ">=18" + "node": ">= 22.14.0" } } diff --git a/packages/polyfills/package.json b/packages/polyfills/package.json index e90a8921fe8..2332da70e51 100644 --- a/packages/polyfills/package.json +++ b/packages/polyfills/package.json @@ -18,7 +18,7 @@ ], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "files": [ "console.js", diff --git a/packages/react-native-babel-preset/package.json b/packages/react-native-babel-preset/package.json index fca1a0f8b34..021e3c4788e 100644 --- a/packages/react-native-babel-preset/package.json +++ b/packages/react-native-babel-preset/package.json @@ -13,7 +13,7 @@ ], "license": "MIT", "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "main": "src/index.js", "files": [ diff --git a/packages/react-native-babel-transformer/package.json b/packages/react-native-babel-transformer/package.json index c88caa07250..968615e7130 100644 --- a/packages/react-native-babel-transformer/package.json +++ b/packages/react-native-babel-transformer/package.json @@ -14,7 +14,7 @@ ], "license": "MIT", "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "main": "src/index.js", "files": [ diff --git a/packages/react-native-bots/package.json b/packages/react-native-bots/package.json index d52b22fe820..0ab7d1a97b4 100644 --- a/packages/react-native-bots/package.json +++ b/packages/react-native-bots/package.json @@ -11,7 +11,7 @@ }, "homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/react-native-bots#readme", "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "devDependencies": { "@rnx-kit/rn-changelog-generator": "^0.4.0", diff --git a/packages/react-native-codegen-typescript-test/package.json b/packages/react-native-codegen-typescript-test/package.json index 6540cc1b25b..d730a21dcb0 100644 --- a/packages/react-native-codegen-typescript-test/package.json +++ b/packages/react-native-codegen-typescript-test/package.json @@ -11,7 +11,7 @@ }, "homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/react-native-typescript-test", "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "scripts": { "build": "yarn clean && node scripts/build.js --verbose && tsc", diff --git a/packages/react-native-codegen/package.json b/packages/react-native-codegen/package.json index 639afa1648b..cf1cb449e0b 100644 --- a/packages/react-native-codegen/package.json +++ b/packages/react-native-codegen/package.json @@ -18,7 +18,7 @@ ], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "scripts": { "build": "yarn clean && node scripts/build.js --verbose", diff --git a/packages/react-native-compatibility-check/package.json b/packages/react-native-compatibility-check/package.json index c86b5d1bcfc..ee0666aace3 100644 --- a/packages/react-native-compatibility-check/package.json +++ b/packages/react-native-compatibility-check/package.json @@ -19,7 +19,7 @@ ], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "exports": { ".": "./src/index.js", diff --git a/packages/react-native/package.json b/packages/react-native/package.json index dd9989830b2..ac051a9e315 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -21,7 +21,7 @@ ], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "bin": { "react-native": "cli.js" diff --git a/packages/rn-tester/package.json b/packages/rn-tester/package.json index 5adb5f10177..f459ac8dae5 100644 --- a/packages/rn-tester/package.json +++ b/packages/rn-tester/package.json @@ -10,7 +10,7 @@ "directory": "packages/rn-tester" }, "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "scripts": { "start": "react-native start", diff --git a/packages/virtualized-lists/package.json b/packages/virtualized-lists/package.json index 0b22fa4aee3..8dd09f2d30e 100644 --- a/packages/virtualized-lists/package.json +++ b/packages/virtualized-lists/package.json @@ -17,7 +17,7 @@ ], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=18" + "node": ">= 22.14.0" }, "exports": { ".": { diff --git a/scripts/build/config.js b/scripts/build/config.js index dffd9d736ec..04829f3d5f2 100644 --- a/scripts/build/config.js +++ b/scripts/build/config.js @@ -97,7 +97,7 @@ function getTypeScriptCompilerOptions( switch (target) { case 'node': return { - ...require('@tsconfig/node18/tsconfig.json').compilerOptions, + ...require('@tsconfig/node22/tsconfig.json').compilerOptions, moduleResolution: ModuleResolutionKind.NodeJs, }; } diff --git a/yarn.lock b/yarn.lock index 69b9dd43ffc..23b8950d557 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1949,10 +1949,10 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== -"@tsconfig/node18@1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@tsconfig/node18/-/node18-1.0.1.tgz#ea5b375a9ead6b09ccbd70c3894ea069829ea1bb" - integrity sha512-sNFeK6X2ATlhlvzyH4kKYQlfHXE2f2/wxtB9ClvYXevWpmwkUT7VaSrjIN9E76Qebz8qP5JOJJ9jD3QoD/Z9TA== +"@tsconfig/node22@22.0.2": + version "22.0.2" + resolved "https://registry.yarnpkg.com/@tsconfig/node22/-/node22-22.0.2.tgz#1e04e2c5cc946dac787d69bb502462a851ae51b6" + integrity sha512-Kmwj4u8sDRDrMYRoN9FDEcXD8UpBSaPQQ24Gz+Gamqfm7xxn+GBR7ge/Z7pK8OXNGyUzbSwJj+TH6B+DS/epyA== "@types/argparse@1.0.38": version "1.0.38"