mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-29 09:55:43 +08:00
Remove outdated babel plugins (#8353)
Updates dependencies and removes babel plugins that are now covered by `@babel/preset-env`. Co-authored-by: hdineen <hdineen@hubspot.com>
This commit is contained in:
@@ -43,6 +43,9 @@
|
|||||||
"tempy": "^0.2.1",
|
"tempy": "^0.2.1",
|
||||||
"wait-for-localhost": "^3.1.0"
|
"wait-for-localhost": "^3.1.0"
|
||||||
},
|
},
|
||||||
|
"resolutions": {
|
||||||
|
"mkdirp": "0.5.1"
|
||||||
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
"pre-commit": "lint-staged"
|
"pre-commit": "lint-staged"
|
||||||
|
|||||||
@@ -117,29 +117,29 @@ module.exports = function(api, opts, env) {
|
|||||||
// Experimental macros support. Will be documented after it's had some time
|
// Experimental macros support. Will be documented after it's had some time
|
||||||
// in the wild.
|
// in the wild.
|
||||||
require('babel-plugin-macros'),
|
require('babel-plugin-macros'),
|
||||||
// Necessary to include regardless of the environment because
|
// Disabled as it's handled automatically by preset-env, and `selectiveLoose` isn't
|
||||||
// in practice some other transforms (such as object-rest-spread)
|
// yet merged into babel: https://github.com/babel/babel/pull/9486
|
||||||
// don't work without it: https://github.com/babel/babel/issues/7215
|
// Related: https://github.com/facebook/create-react-app/pull/8215
|
||||||
[
|
// [
|
||||||
require('@babel/plugin-transform-destructuring').default,
|
// require('@babel/plugin-transform-destructuring').default,
|
||||||
{
|
// {
|
||||||
// Use loose mode for performance:
|
// // Use loose mode for performance:
|
||||||
// https://github.com/facebook/create-react-app/issues/5602
|
// // https://github.com/facebook/create-react-app/issues/5602
|
||||||
loose: false,
|
// loose: false,
|
||||||
selectiveLoose: [
|
// selectiveLoose: [
|
||||||
'useState',
|
// 'useState',
|
||||||
'useEffect',
|
// 'useEffect',
|
||||||
'useContext',
|
// 'useContext',
|
||||||
'useReducer',
|
// 'useReducer',
|
||||||
'useCallback',
|
// 'useCallback',
|
||||||
'useMemo',
|
// 'useMemo',
|
||||||
'useRef',
|
// 'useRef',
|
||||||
'useImperativeHandle',
|
// 'useImperativeHandle',
|
||||||
'useLayoutEffect',
|
// 'useLayoutEffect',
|
||||||
'useDebugValue',
|
// 'useDebugValue',
|
||||||
],
|
// ],
|
||||||
},
|
// },
|
||||||
],
|
// ],
|
||||||
// Turn on legacy decorators for TypeScript files
|
// Turn on legacy decorators for TypeScript files
|
||||||
isTypeScriptEnabled && [
|
isTypeScriptEnabled && [
|
||||||
require('@babel/plugin-proposal-decorators').default,
|
require('@babel/plugin-proposal-decorators').default,
|
||||||
@@ -156,15 +156,6 @@ module.exports = function(api, opts, env) {
|
|||||||
],
|
],
|
||||||
// Adds Numeric Separators
|
// Adds Numeric Separators
|
||||||
require('@babel/plugin-proposal-numeric-separator').default,
|
require('@babel/plugin-proposal-numeric-separator').default,
|
||||||
// The following two plugins use Object.assign directly, instead of Babel's
|
|
||||||
// extends helper. Note that this assumes `Object.assign` is available.
|
|
||||||
// { ...todo, completed: true }
|
|
||||||
[
|
|
||||||
require('@babel/plugin-proposal-object-rest-spread').default,
|
|
||||||
{
|
|
||||||
useBuiltIns: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
// Polyfills the runtime needed for async/await, generators, and friends
|
// Polyfills the runtime needed for async/await, generators, and friends
|
||||||
// https://babeljs.io/docs/en/babel-plugin-transform-runtime
|
// https://babeljs.io/docs/en/babel-plugin-transform-runtime
|
||||||
[
|
[
|
||||||
@@ -194,15 +185,6 @@ module.exports = function(api, opts, env) {
|
|||||||
removeImport: true,
|
removeImport: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
// Adds syntax support for import()
|
|
||||||
require('@babel/plugin-syntax-dynamic-import').default,
|
|
||||||
// Adds syntax support for optional chaining (?.)
|
|
||||||
require('@babel/plugin-proposal-optional-chaining').default,
|
|
||||||
// Adds syntax support for default value using ?? operator
|
|
||||||
require('@babel/plugin-proposal-nullish-coalescing-operator').default,
|
|
||||||
isEnvTest &&
|
|
||||||
// Transform dynamic import to require
|
|
||||||
require('babel-plugin-dynamic-import-node'),
|
|
||||||
].filter(Boolean),
|
].filter(Boolean),
|
||||||
overrides: [
|
overrides: [
|
||||||
isFlowEnabled && {
|
isFlowEnabled && {
|
||||||
|
|||||||
@@ -97,29 +97,29 @@ module.exports = function(api, opts) {
|
|||||||
],
|
],
|
||||||
].filter(Boolean),
|
].filter(Boolean),
|
||||||
plugins: [
|
plugins: [
|
||||||
// Necessary to include regardless of the environment because
|
// Disabled as it's handled automatically by preset-env, and `selectiveLoose` isn't
|
||||||
// in practice some other transforms (such as object-rest-spread)
|
// yet merged into babel: https://github.com/babel/babel/pull/9486
|
||||||
// don't work without it: https://github.com/babel/babel/issues/7215
|
// Related: https://github.com/facebook/create-react-app/pull/8215
|
||||||
[
|
// [
|
||||||
require('@babel/plugin-transform-destructuring').default,
|
// require('@babel/plugin-transform-destructuring').default,
|
||||||
{
|
// {
|
||||||
// Use loose mode for performance:
|
// // Use loose mode for performance:
|
||||||
// https://github.com/facebook/create-react-app/issues/5602
|
// // https://github.com/facebook/create-react-app/issues/5602
|
||||||
loose: false,
|
// loose: false,
|
||||||
selectiveLoose: [
|
// selectiveLoose: [
|
||||||
'useState',
|
// 'useState',
|
||||||
'useEffect',
|
// 'useEffect',
|
||||||
'useContext',
|
// 'useContext',
|
||||||
'useReducer',
|
// 'useReducer',
|
||||||
'useCallback',
|
// 'useCallback',
|
||||||
'useMemo',
|
// 'useMemo',
|
||||||
'useRef',
|
// 'useRef',
|
||||||
'useImperativeHandle',
|
// 'useImperativeHandle',
|
||||||
'useLayoutEffect',
|
// 'useLayoutEffect',
|
||||||
'useDebugValue',
|
// 'useDebugValue',
|
||||||
],
|
// ],
|
||||||
},
|
// },
|
||||||
],
|
// ],
|
||||||
// Polyfills the runtime needed for async/await, generators, and friends
|
// Polyfills the runtime needed for async/await, generators, and friends
|
||||||
// https://babeljs.io/docs/en/babel-plugin-transform-runtime
|
// https://babeljs.io/docs/en/babel-plugin-transform-runtime
|
||||||
[
|
[
|
||||||
@@ -138,11 +138,6 @@ module.exports = function(api, opts) {
|
|||||||
absoluteRuntime: absoluteRuntimePath,
|
absoluteRuntime: absoluteRuntimePath,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
// Adds syntax support for import()
|
|
||||||
require('@babel/plugin-syntax-dynamic-import').default,
|
|
||||||
isEnvTest &&
|
|
||||||
// Transform dynamic import to require
|
|
||||||
require('babel-plugin-dynamic-import-node'),
|
|
||||||
].filter(Boolean),
|
].filter(Boolean),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,23 +21,17 @@
|
|||||||
"test.js"
|
"test.js"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/core": "7.8.3",
|
"@babel/core": "7.8.4",
|
||||||
"@babel/plugin-proposal-class-properties": "7.8.3",
|
"@babel/plugin-proposal-class-properties": "7.8.3",
|
||||||
"@babel/plugin-proposal-decorators": "7.8.3",
|
"@babel/plugin-proposal-decorators": "7.8.3",
|
||||||
"@babel/plugin-proposal-nullish-coalescing-operator": "7.8.3",
|
|
||||||
"@babel/plugin-proposal-numeric-separator": "7.8.3",
|
"@babel/plugin-proposal-numeric-separator": "7.8.3",
|
||||||
"@babel/plugin-proposal-object-rest-spread": "7.7.4",
|
"@babel/plugin-transform-flow-strip-types": "7.8.3",
|
||||||
"@babel/plugin-proposal-optional-chaining": "7.8.3",
|
"@babel/plugin-transform-react-display-name": "7.8.3",
|
||||||
"@babel/plugin-syntax-dynamic-import": "7.7.4",
|
"@babel/plugin-transform-runtime": "7.8.3",
|
||||||
"@babel/plugin-transform-destructuring": "7.7.4",
|
"@babel/preset-env": "7.8.4",
|
||||||
"@babel/plugin-transform-flow-strip-types": "7.7.4",
|
"@babel/preset-react": "7.8.3",
|
||||||
"@babel/plugin-transform-react-display-name": "7.7.4",
|
"@babel/preset-typescript": "7.8.3",
|
||||||
"@babel/plugin-transform-runtime": "7.7.6",
|
"@babel/runtime": "7.8.4",
|
||||||
"@babel/preset-env": "7.7.6",
|
|
||||||
"@babel/preset-react": "7.7.4",
|
|
||||||
"@babel/preset-typescript": "7.7.4",
|
|
||||||
"@babel/runtime": "7.7.6",
|
|
||||||
"babel-plugin-dynamic-import-node": "2.3.0",
|
|
||||||
"babel-plugin-macros": "2.8.0",
|
"babel-plugin-macros": "2.8.0",
|
||||||
"babel-plugin-transform-react-remove-prop-types": "0.4.24"
|
"babel-plugin-transform-react-remove-prop-types": "0.4.24"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
"envinfo": "7.5.0",
|
"envinfo": "7.5.0",
|
||||||
"fs-extra": "8.1.0",
|
"fs-extra": "8.1.0",
|
||||||
"hyperquest": "2.1.3",
|
"hyperquest": "2.1.3",
|
||||||
"inquirer": "7.0.3",
|
"inquirer": "7.0.4",
|
||||||
"semver": "6.3.0",
|
"semver": "6.3.0",
|
||||||
"tar-pack": "3.4.1",
|
"tar-pack": "3.4.1",
|
||||||
"tmp": "0.1.0",
|
"tmp": "0.1.0",
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -52,7 +52,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/code-frame": "7.8.3",
|
"@babel/code-frame": "7.8.3",
|
||||||
"address": "1.1.2",
|
"address": "1.1.2",
|
||||||
"browserslist": "4.8.3",
|
"browserslist": "4.8.6",
|
||||||
"chalk": "3.0.0",
|
"chalk": "3.0.0",
|
||||||
"cross-spawn": "7.0.1",
|
"cross-spawn": "7.0.1",
|
||||||
"detect-port-alt": "1.1.6",
|
"detect-port-alt": "1.1.6",
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
"globby": "8.0.2",
|
"globby": "8.0.2",
|
||||||
"gzip-size": "5.1.1",
|
"gzip-size": "5.1.1",
|
||||||
"immer": "1.10.0",
|
"immer": "1.10.0",
|
||||||
"inquirer": "7.0.3",
|
"inquirer": "7.0.4",
|
||||||
"is-root": "2.1.0",
|
"is-root": "2.1.0",
|
||||||
"loader-utils": "1.2.3",
|
"loader-utils": "1.2.3",
|
||||||
"open": "^6.4.0",
|
"open": "^6.4.0",
|
||||||
|
|||||||
@@ -34,8 +34,8 @@
|
|||||||
"lib/index.js"
|
"lib/index.js"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/code-frame": "7.5.5",
|
"@babel/code-frame": "7.8.3",
|
||||||
"@babel/core": "7.7.5",
|
"@babel/core": "7.8.4",
|
||||||
"anser": "1.4.9",
|
"anser": "1.4.9",
|
||||||
"babel-eslint": "10.0.3",
|
"babel-eslint": "10.0.3",
|
||||||
"babel-jest": "^24.9.0",
|
"babel-jest": "^24.9.0",
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
"rimraf": "^3.0.0",
|
"rimraf": "^3.0.0",
|
||||||
"settle-promise": "1.0.0",
|
"settle-promise": "1.0.0",
|
||||||
"source-map": "0.5.6",
|
"source-map": "0.5.6",
|
||||||
"terser-webpack-plugin": "2.3.2",
|
"terser-webpack-plugin": "2.3.4",
|
||||||
"webpack": "^4.35.0"
|
"webpack": "^4.35.0"
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
},
|
},
|
||||||
"types": "./lib/react-app.d.ts",
|
"types": "./lib/react-app.d.ts",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/core": "7.7.5",
|
"@babel/core": "7.8.4",
|
||||||
"@svgr/webpack": "4.3.3",
|
"@svgr/webpack": "4.3.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^2.10.0",
|
"@typescript-eslint/eslint-plugin": "^2.10.0",
|
||||||
"@typescript-eslint/parser": "^2.10.0",
|
"@typescript-eslint/parser": "^2.10.0",
|
||||||
@@ -38,17 +38,17 @@
|
|||||||
"babel-plugin-named-asset-import": "^0.3.5",
|
"babel-plugin-named-asset-import": "^0.3.5",
|
||||||
"babel-preset-react-app": "^9.1.0",
|
"babel-preset-react-app": "^9.1.0",
|
||||||
"camelcase": "^5.3.1",
|
"camelcase": "^5.3.1",
|
||||||
"case-sensitive-paths-webpack-plugin": "2.2.0",
|
"case-sensitive-paths-webpack-plugin": "2.3.0",
|
||||||
"css-loader": "3.3.2",
|
"css-loader": "3.4.2",
|
||||||
"dotenv": "8.2.0",
|
"dotenv": "8.2.0",
|
||||||
"dotenv-expand": "5.1.0",
|
"dotenv-expand": "5.1.0",
|
||||||
"eslint": "^6.6.0",
|
"eslint": "^6.6.0",
|
||||||
"eslint-config-react-app": "^5.1.0",
|
"eslint-config-react-app": "^5.1.0",
|
||||||
"eslint-loader": "3.0.3",
|
"eslint-loader": "3.0.3",
|
||||||
"eslint-plugin-flowtype": "4.5.2",
|
"eslint-plugin-flowtype": "4.6.0",
|
||||||
"eslint-plugin-import": "2.20.0",
|
"eslint-plugin-import": "2.20.0",
|
||||||
"eslint-plugin-jsx-a11y": "6.2.3",
|
"eslint-plugin-jsx-a11y": "6.2.3",
|
||||||
"eslint-plugin-react": "7.17.0",
|
"eslint-plugin-react": "7.18.0",
|
||||||
"eslint-plugin-react-hooks": "^1.6.1",
|
"eslint-plugin-react-hooks": "^1.6.1",
|
||||||
"file-loader": "4.3.0",
|
"file-loader": "4.3.0",
|
||||||
"fs-extra": "^8.1.0",
|
"fs-extra": "^8.1.0",
|
||||||
@@ -58,9 +58,9 @@
|
|||||||
"jest-environment-jsdom-fourteen": "1.0.1",
|
"jest-environment-jsdom-fourteen": "1.0.1",
|
||||||
"jest-resolve": "24.9.0",
|
"jest-resolve": "24.9.0",
|
||||||
"jest-watch-typeahead": "0.4.2",
|
"jest-watch-typeahead": "0.4.2",
|
||||||
"mini-css-extract-plugin": "0.8.0",
|
"mini-css-extract-plugin": "0.9.0",
|
||||||
"optimize-css-assets-webpack-plugin": "5.0.3",
|
"optimize-css-assets-webpack-plugin": "5.0.3",
|
||||||
"pnp-webpack-plugin": "1.5.0",
|
"pnp-webpack-plugin": "1.6.0",
|
||||||
"postcss-flexbugs-fixes": "4.1.0",
|
"postcss-flexbugs-fixes": "4.1.0",
|
||||||
"postcss-loader": "3.0.0",
|
"postcss-loader": "3.0.0",
|
||||||
"postcss-normalize": "8.0.1",
|
"postcss-normalize": "8.0.1",
|
||||||
@@ -68,16 +68,16 @@
|
|||||||
"postcss-safe-parser": "4.0.1",
|
"postcss-safe-parser": "4.0.1",
|
||||||
"react-app-polyfill": "^1.0.5",
|
"react-app-polyfill": "^1.0.5",
|
||||||
"react-dev-utils": "^10.0.0",
|
"react-dev-utils": "^10.0.0",
|
||||||
"resolve": "1.13.1",
|
"resolve": "1.15.0",
|
||||||
"resolve-url-loader": "3.1.1",
|
"resolve-url-loader": "3.1.1",
|
||||||
"sass-loader": "8.0.0",
|
"sass-loader": "8.0.2",
|
||||||
"semver": "6.3.0",
|
"semver": "6.3.0",
|
||||||
"style-loader": "1.0.1",
|
"style-loader": "1.1.3",
|
||||||
"terser-webpack-plugin": "2.3.2",
|
"terser-webpack-plugin": "2.3.4",
|
||||||
"ts-pnp": "1.1.5",
|
"ts-pnp": "1.1.5",
|
||||||
"url-loader": "2.3.0",
|
"url-loader": "2.3.0",
|
||||||
"webpack": "4.41.5",
|
"webpack": "4.41.5",
|
||||||
"webpack-dev-server": "3.9.0",
|
"webpack-dev-server": "3.10.1",
|
||||||
"webpack-manifest-plugin": "2.2.0",
|
"webpack-manifest-plugin": "2.2.0",
|
||||||
"workbox-webpack-plugin": "4.3.1"
|
"workbox-webpack-plugin": "4.3.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ function print_help {
|
|||||||
echo "OPTIONS:"
|
echo "OPTIONS:"
|
||||||
echo " --node-version <version> the node version to use while testing [12]"
|
echo " --node-version <version> the node version to use while testing [12]"
|
||||||
echo " --git-branch <branch> the git branch to checkout for testing [the current one]"
|
echo " --git-branch <branch> the git branch to checkout for testing [the current one]"
|
||||||
echo " --test-suite <suite> which test suite to use ('simple', installs', 'kitchensink', 'kitchensink-eject', 'all') ['all']"
|
echo " --test-suite <suite> which test suite to use ('all', 'behavior', installs', 'kitchensink', 'kitchensink-eject', 'simple') ['all']"
|
||||||
echo " --interactive gain a bash shell after the test run"
|
echo " --interactive gain a bash shell after the test run"
|
||||||
echo " --help print this message and exit"
|
echo " --help print this message and exit"
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
Reference in New Issue
Block a user