From 465f4277a5d4b9f9c8cff5113f8e8db71a00b35a Mon Sep 17 00:00:00 2001 From: Rob Hogan Date: Mon, 20 Feb 2023 05:40:42 -0800 Subject: [PATCH 1/2] Remove `.node-version` file from repo root and template Differential Revision: D43421085 fbshipit-source-id: c8a0419db7cf22156cdeeb9d89040cb6c5bb2a0f --- .node-version | 1 - template/_node-version | 1 - 2 files changed, 2 deletions(-) delete mode 100644 .node-version delete mode 100644 template/_node-version diff --git a/.node-version b/.node-version deleted file mode 100644 index 3c032078a4a21c..00000000000000 --- a/.node-version +++ /dev/null @@ -1 +0,0 @@ -18 diff --git a/template/_node-version b/template/_node-version deleted file mode 100644 index 3c032078a4a21c..00000000000000 --- a/template/_node-version +++ /dev/null @@ -1 +0,0 @@ -18 From f40d4ae3b8e3a5656b5803c01284c67fbf09e6d1 Mon Sep 17 00:00:00 2001 From: Rob Hogan Date: Mon, 20 Feb 2023 05:41:08 -0800 Subject: [PATCH 2/2] Breaking - Bump minimum Node version from 14 to 16 Summary: ## Bump minimum Node JS version to 16 via `react-native/package.json#engines` In https://github.com/facebook/react-native/pull/35443 we stopped running CI in Node 14 - this follows up by formally making Node 16 the minimum supported version ahead of the 0.72 cut. Node 14 [ends maintenance releases in April](https://github.com/nodejs/release#release-schedule), and bumping this minimum will allow other associated Node JS tools (CLI, Metro, Jest) to reduce their support burden. ## Insert `engines` into `template/package.json` The constraint at `react-native/package.json#engines` ensures the minimum at install/init time, with package managers providing an actionable error or warning if the constraint is not met. However, it doesn't help guide users to a supported version if on an existing project they run (e.g.) `yarn start`. Adding a constraint to the template helps prevent accidental use of an older version, as well as providing a clear reference for the current minimum. Insertion of `engines` below existing `package.json` fields is consistent with [`sort-package-json`](https://github.com/keithamus/sort-package-json/blob/main/defaultRules.md) and [`prettier-package-json`](https://github.com/cameronhunter/prettier-package-json/blob/main/src/defaultOptions.ts) - and keeps it out of the way of fields RN developers are likely to be more concerned about. ## Docs PR https://github.com/facebook/react-native-website/pull/3580 ## Changelog: [General][Breaking] Bump minimum Node JS version to 16 Differential Revision: D43436883 fbshipit-source-id: 3ccef744b15e295a31717bd94b61b0019c51b3e3 --- package.json | 2 +- template/package.json | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6a8c70926ad977..a57a338e3f0325 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "license": "MIT", "repository": "github:facebook/react-native", "engines": { - "node": ">=14" + "node": ">=16" }, "types": "types", "jest-junit": { diff --git a/template/package.json b/template/package.json index cf3b10d19e9e0e..817c5fccb243cd 100644 --- a/template/package.json +++ b/template/package.json @@ -28,5 +28,8 @@ "prettier": "^2.4.1", "react-test-renderer": "18.2.0", "typescript": "4.8.4" + }, + "engines": { + "node": ">=16" } }