From bda39104e9852a8da81815d35d2a85c771419652 Mon Sep 17 00:00:00 2001 From: eps1lon Date: Mon, 22 Mar 2021 12:41:07 +0100 Subject: [PATCH] [core] Drop support for React 16 --- babel.config.js | 9 +-------- framer/Material-UI.framerfx/package.json | 4 ++-- packages/material-ui-docs/package.json | 4 ++-- packages/material-ui-icons/package.json | 2 +- packages/material-ui-lab/package.json | 4 ++-- packages/material-ui-styled-engine/package.json | 2 +- packages/material-ui-styles/package.json | 2 +- packages/material-ui-system/package.json | 4 ++-- packages/material-ui-unstyled/package.json | 6 +++--- packages/material-ui-utils/package.json | 4 ++-- packages/material-ui/package.json | 6 +++--- yarn.lock | 2 +- 12 files changed, 21 insertions(+), 28 deletions(-) diff --git a/babel.config.js b/babel.config.js index 3de4b2c53f01b8..9240d2d6f1597c 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,4 @@ const path = require('path'); -const React = require('react'); const errorCodesPath = path.resolve(__dirname, './docs/public/static/error-codes.json'); const missingError = process.env.MUI_EXTRACT_ERROR_CODES === 'true' ? 'write' : 'annotate'; @@ -29,8 +28,6 @@ const productionPlugins = [ module.exports = function getBabelConfig(api) { const useESModules = api.env(['legacy', 'modern', 'stable', 'rollup']); - const isReactPreRelease = /\d+\.\d+\.\d+-\w+/.test(React.version); - const presets = [ [ '@babel/preset-env', @@ -45,11 +42,7 @@ module.exports = function getBabelConfig(api) { [ '@babel/preset-react', { - runtime: isReactPreRelease - ? // default in Babel 8 - // TODO: Always use automatic once we drop React 16 - 'automatic' - : 'classic', + runtime: 'automatic', }, ], '@babel/preset-typescript', diff --git a/framer/Material-UI.framerfx/package.json b/framer/Material-UI.framerfx/package.json index 02900ad1f8c08a..64fa3b90b5bc1c 100644 --- a/framer/Material-UI.framerfx/package.json +++ b/framer/Material-UI.framerfx/package.json @@ -22,8 +22,8 @@ "peerDependencies": { "@types/react": "^16.8.6", "framer": "^1.0.0", - "react": "^16.8.0 || ^17.0.0", - "react-dom": "^16.8.0 || ^17.0.0" + "react": "^17.0.0", + "react-dom": "^17.0.0" }, "peerDependenciesMeta": { "@types/react": { diff --git a/packages/material-ui-docs/package.json b/packages/material-ui-docs/package.json index 35943bca97c7c0..02fc55eec6fdce 100644 --- a/packages/material-ui-docs/package.json +++ b/packages/material-ui-docs/package.json @@ -36,8 +36,8 @@ "peerDependencies": { "@material-ui/core": "^5.0.0-alpha.1", "@types/react": "^16.8.6 || ^17.0.0", - "react": "^16.8.0 || ^17.0.0", - "react-dom": "^16.8.0 || ^17.0.0" + "react": "^17.0.0", + "react-dom": "^17.0.0" }, "peerDependenciesMeta": { "@types/react": { diff --git a/packages/material-ui-icons/package.json b/packages/material-ui-icons/package.json index e6cb86ebc6b165..16f796f43bc0ff 100644 --- a/packages/material-ui-icons/package.json +++ b/packages/material-ui-icons/package.json @@ -41,7 +41,7 @@ "peerDependencies": { "@material-ui/core": "^5.0.0-alpha.15", "@types/react": "^16.8.6 || ^17.0.0", - "react": "^16.8.0 || ^17.0.0" + "react": "^17.0.0" }, "peerDependenciesMeta": { "@types/react": { diff --git a/packages/material-ui-lab/package.json b/packages/material-ui-lab/package.json index 43a4d266996657..cf06f00e3d080e 100644 --- a/packages/material-ui-lab/package.json +++ b/packages/material-ui-lab/package.json @@ -42,7 +42,7 @@ "dayjs": "^1.8.17", "luxon": "^1.21.3", "moment": "^2.24.0", - "react": "^16.8.0 || ^17.0.0" + "react": "^17.0.0" }, "peerDependenciesMeta": { "@types/react": { @@ -71,7 +71,7 @@ "@material-ui/utils": "5.0.0-alpha.27", "clsx": "^1.0.4", "prop-types": "^15.7.2", - "react-is": "^16.8.0 || ^17.0.0", + "react-is": "^17.0.0", "react-transition-group": "^4.4.1", "rifm": "^0.12.0" }, diff --git a/packages/material-ui-styled-engine/package.json b/packages/material-ui-styled-engine/package.json index 207ad7c6206915..b06a81e7e9404b 100644 --- a/packages/material-ui-styled-engine/package.json +++ b/packages/material-ui-styled-engine/package.json @@ -45,7 +45,7 @@ "peerDependencies": { "@emotion/react": "^11.0.0", "@emotion/styled": "^11.0.0", - "react": "^16.8.0 || ^17.0.0" + "react": "^17.0.0" }, "peerDependenciesMeta": { "@emotion/react": { diff --git a/packages/material-ui-styles/package.json b/packages/material-ui-styles/package.json index b6fd0f937c0706..81e7ee99cf23d2 100644 --- a/packages/material-ui-styles/package.json +++ b/packages/material-ui-styles/package.json @@ -39,7 +39,7 @@ }, "peerDependencies": { "@types/react": "^16.8.6 || ^17.0.0", - "react": "^16.8.0 || ^17.0.0" + "react": "^17.0.0" }, "peerDependenciesMeta": { "@types/react": { diff --git a/packages/material-ui-system/package.json b/packages/material-ui-system/package.json index a294e6d3e6671a..d6d2192cc618f9 100644 --- a/packages/material-ui-system/package.json +++ b/packages/material-ui-system/package.json @@ -39,8 +39,8 @@ }, "peerDependencies": { "@types/react": "^16.8.6 || ^17.0.0", - "react": "^16.8.0 || ^17.0.0", - "react-dom": "^16.8.0 || ^17.0.0" + "react": "^17.0.0", + "react-dom": "^17.0.0" }, "peerDependenciesMeta": { "@types/react": { diff --git a/packages/material-ui-unstyled/package.json b/packages/material-ui-unstyled/package.json index db6ec8a80d4ed0..4cc3f7745c3793 100644 --- a/packages/material-ui-unstyled/package.json +++ b/packages/material-ui-unstyled/package.json @@ -37,8 +37,8 @@ }, "peerDependencies": { "@types/react": "^16.8.6 || ^17.0.0", - "react": "^16.8.0 || ^17.0.0", - "react-dom": "^16.8.0 || ^17.0.0" + "react": "^17.0.0", + "react-dom": "^17.0.0" }, "peerDependenciesMeta": { "@types/react": { @@ -50,7 +50,7 @@ "@material-ui/utils": "5.0.0-alpha.27", "clsx": "^1.0.4", "prop-types": "^15.7.2", - "react-is": "^16.8.0 || ^17.0.0" + "react-is": "^17.0.0" }, "devDependencies": { "@material-ui/types": "5.1.7" diff --git a/packages/material-ui-utils/package.json b/packages/material-ui-utils/package.json index 4a4adf8cd77602..2a15cc7c7647ea 100644 --- a/packages/material-ui-utils/package.json +++ b/packages/material-ui-utils/package.json @@ -35,14 +35,14 @@ "typescript": "tslint -p tsconfig.json \"{src,test}/**/*.{spec,d}.{ts,tsx}\" && tsc -p tsconfig.json" }, "peerDependencies": { - "react": "^16.8.0 || ^17.0.0" + "react": "^17.0.0" }, "dependencies": { "@babel/runtime": "^7.4.4", "@types/prop-types": "^15.7.3", "@types/react-is": "^16.7.1 || ^17.0.0", "prop-types": "^15.7.2", - "react-is": "^16.8.0 || ^17.0.0" + "react-is": "^17.0.0" }, "devDependencies": { "@babel/helper-module-imports": "^7.8.3", diff --git a/packages/material-ui/package.json b/packages/material-ui/package.json index a4e5d83cb74293..580f43bb695dad 100644 --- a/packages/material-ui/package.json +++ b/packages/material-ui/package.json @@ -44,8 +44,8 @@ "@emotion/react": "^11.0.0", "@emotion/styled": "^11.0.0", "@types/react": "^16.8.6 || ^17.0.0", - "react": "^16.8.0 || ^17.0.0", - "react-dom": "^16.8.0 || ^17.0.0" + "react": "^17.0.0", + "react-dom": "^17.0.0" }, "peerDependenciesMeta": { "@types/react": { @@ -72,7 +72,7 @@ "csstype": "^3.0.2", "hoist-non-react-statics": "^3.3.2", "prop-types": "^15.7.2", - "react-is": "^16.8.0 || ^17.0.0", + "react-is": "^17.0.0", "react-transition-group": "^4.4.0" }, "sideEffects": false, diff --git a/yarn.lock b/yarn.lock index e8f5c18a3024c7..02ecbab081c3e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13374,7 +13374,7 @@ react-final-form@^6.3.0: dependencies: "@babel/runtime" "^7.12.1" -react-is@16.10.2, react-is@16.13.1, "react-is@^16.12.0 || ^17.0.0", react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, "react-is@^16.8.0 || ^17.0.0", react-is@^16.8.1, react-is@^17.0.0, react-is@^17.0.1: +react-is@16.10.2, react-is@16.13.1, "react-is@^16.12.0 || ^17.0.0", react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^17.0.0, react-is@^17.0.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==