From 79f40cde27b13ffee5985d8dabb5dd8e1bb5f774 Mon Sep 17 00:00:00 2001 From: Alex Page Date: Wed, 15 Feb 2023 12:56:54 +1100 Subject: [PATCH] Remove support for React 16 and 17 (#8340) ### WHY are these changes introduced? Fixes https://github.com/Shopify/polaris/issues/8331 ### WHAT is this pull request doing? Removing support for v16 and v17 from Shopify Polaris. --- documentation/guides/migrating-from-v10-to-v11.md | 4 ++++ polaris-react/package.json | 4 ++-- polaris-react/rollup.config.mjs | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/documentation/guides/migrating-from-v10-to-v11.md b/documentation/guides/migrating-from-v10-to-v11.md index 4436cd26920..b82cfc6a940 100644 --- a/documentation/guides/migrating-from-v10-to-v11.md +++ b/documentation/guides/migrating-from-v10-to-v11.md @@ -14,6 +14,10 @@ Polaris v11.0.0 ([full release notes](https://github.com/Shopify/polaris/release NodeJS version 14 is no longer supported. NodeJS 18 is recommended and 16 is the minimum supported version. +## React support + +React version 16 and 17 is no longer supported. React 18 is the minimum supported version. + ## TypeScript Built types in `@shopify/polaris` have moved from `build/ts/latest` to `build/ts`. diff --git a/polaris-react/package.json b/polaris-react/package.json index 07cf19d817a..4b8bc304501 100644 --- a/polaris-react/package.json +++ b/polaris-react/package.json @@ -66,8 +66,8 @@ "react-transition-group": "^4.4.2" }, "peerDependencies": { - "react": "^16.14.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0" + "react": "^18.0.0", + "react-dom": "^18.0.0" }, "devDependencies": { "@changesets/get-release-plan": "^3.0.13", diff --git a/polaris-react/rollup.config.mjs b/polaris-react/rollup.config.mjs index d4c67eb25f9..1ebb6092c1a 100644 --- a/polaris-react/rollup.config.mjs +++ b/polaris-react/rollup.config.mjs @@ -33,7 +33,6 @@ function generateConfig({output, targets, stylesConfig}) { // Options that may be present on the `babelConfig` object but // we want to override envName: 'production', - // @ts-expect-error targets is a valid babel option but @types/babel__core doesn't know that yet targets, }), replace({