From 2283e99ac828fe8e2b93f4f4d1d99247be66f2b7 Mon Sep 17 00:00:00 2001 From: Zach Wegrzyniak Date: Tue, 23 Mar 2021 19:01:36 -0400 Subject: [PATCH] Don't pull in all of core-js with core (#1601) --- babel.config.js | 22 ++++++ docs/3.x upgrade guide.md | 17 +++++ mkdocs.yml | 1 + packages/antd/babel.config.js | 49 +----------- packages/antd/package-lock.json | 33 --------- packages/antd/package.json | 7 -- packages/bootstrap-4/package.json | 2 - packages/core/babel.config.js | 45 +---------- packages/core/package-lock.json | 74 +++---------------- packages/core/package.json | 6 +- .../core/src/components/fields/ArrayField.js | 2 +- packages/core/src/utils.js | 2 +- packages/core/webpack.config.dist.js | 23 +----- packages/fluent-ui/package.json | 2 - packages/material-ui/package.json | 5 +- packages/playground/.babelrc | 2 +- packages/playground/package-lock.json | 30 ++++++-- packages/playground/package.json | 4 +- packages/semantic-ui/babel.config.js | 49 +----------- packages/semantic-ui/package-lock.json | 38 ++-------- packages/semantic-ui/package.json | 3 - 21 files changed, 97 insertions(+), 319 deletions(-) create mode 100644 babel.config.js create mode 100644 docs/3.x upgrade guide.md diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000000..8054c52335 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,22 @@ +const BABEL_ENV = process.env.BABEL_ENV; +const IS_TEST = BABEL_ENV === "test" +const ignore = IS_TEST ? [] : ['test/**/*.js'] +const targets = IS_TEST ? { node: "current" } : { browsers: "defaults" } + +module.exports = { + presets: [ + [ + "@babel/preset-env", + { + modules: ["cjs", "test"].includes(BABEL_ENV) ? "commonjs" : false, + targets + }, + ], + "@babel/preset-react" + ], + plugins: [ + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-optional-chaining" + ], + ignore, +}; diff --git a/docs/3.x upgrade guide.md b/docs/3.x upgrade guide.md new file mode 100644 index 0000000000..ad362ad384 --- /dev/null +++ b/docs/3.x upgrade guide.md @@ -0,0 +1,17 @@ +# 3.x Upgrade Guide + +## BREAKING + +### Bring your own polyfills + +core-js@2 has been removed from @rjsf/core. See more about [the rationale here](https://github.com/rjsf-team/react-jsonschema-form/pull/2211#issue-563700810). + +If you're using a framework like [Create React App](https://create-react-app.dev/docs/supported-browsers-features#supported-browsers), [Gatsby](https://www.gatsbyjs.com/docs/how-to/custom-configuration/browser-support/), [Next.js](https://nextjs.org/docs/basic-features/supported-browsers-features), or transpiling code through something like `@babel/preset-env`, polyfills are already included there and you won't have to do anything. + +If you were directly depending on @rjsf/core's @babel/runtime pulling in core-js@2, just `npm install core-js` and using a side effectful import at the top of your entry point (`import 'core-js'`) might be enough. + +For a slightly more elaborate setup, [@babel/preset-env](https://babeljs.io/docs/en/babel-preset-env#how-does-it-work) is probably a good second choice. + +From `@babel/preset-env`'s docs + +> We leverage [`browserslist`, `compat-table`, and `electron-to-chromium`] to maintain mappings of which version of our supported target environments gained support of a JavaScript syntax or browser feature, as well as a mapping of those syntaxes and features to Babel transform plugins and core-js polyfills. diff --git a/mkdocs.yml b/mkdocs.yml index 6016a782b7..ad29e1ef32 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -30,6 +30,7 @@ nav: - Theme-Specific Reference: - semantic-ui: api-reference/themes/semantic-ui/uiSchema.md - "<Form /> props": api-reference/form-props.md + - 3.x Migration: 3.x upgrade guide.md markdown_extensions: - toc: diff --git a/packages/antd/babel.config.js b/packages/antd/babel.config.js index 9d904069ee..a64c2f69ff 100644 --- a/packages/antd/babel.config.js +++ b/packages/antd/babel.config.js @@ -1,48 +1,3 @@ -const BABEL_ENV = process.env.BABEL_ENV; +const defaultConfig = require('../../babel.config') -const defaultPlugins = []; - -module.exports = { - "presets": [ - [ - "@babel/preset-env", - { - modules: ["cjs", "test"].includes(BABEL_ENV) ? "commonjs" : false, - targets: - BABEL_ENV === "test" ? { node: "current" } : { browsers: "defaults" }, - }, - ], - "@babel/preset-react" - ], - "plugins": [ - "@babel/plugin-proposal-object-rest-spread", - "@babel/plugin-proposal-class-properties", - [ - "@babel/plugin-transform-runtime", - { - "corejs": 2 - } - ] - ], - "env": { - cjs: { - plugins: defaultPlugins, - ignore: ['test/**/*.js'] - }, - umd: { - plugins: defaultPlugins, - ignore: ['test/**/*.js'] - }, - es: { - plugins: [ - ...defaultPlugins, - ['@babel/plugin-transform-runtime', { useESModules: true, corejs: 2 }] - ], - ignore: ['test/**/*.js'] - }, - test: { - plugins: defaultPlugins, - ignore: [] - } - } -}; \ No newline at end of file +module.exports = defaultConfig diff --git a/packages/antd/package-lock.json b/packages/antd/package-lock.json index 0216ca5a0c..0ecae737a2 100644 --- a/packages/antd/package-lock.json +++ b/packages/antd/package-lock.json @@ -1048,17 +1048,6 @@ } } }, - "@babel/plugin-proposal-object-rest-spread": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.5.tgz", - "integrity": "sha512-VP2oXvAf7KCYTthbUHwBlewbl1Iq059f6seJGsxMizaCdgHIeczOr7FBqELhSqfkIl04Fi8okzWzl63UKbQmmg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-object-rest-spread": "^7.8.0", - "@babel/plugin-transform-parameters": "^7.9.5" - } - }, "@babel/plugin-proposal-optional-catch-binding": { "version": "7.10.1", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.10.1.tgz", @@ -2984,16 +2973,6 @@ } } }, - "@babel/plugin-transform-parameters": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.9.5.tgz", - "integrity": "sha512-0+1FhHnMfj6lIIhVvS4KGQJeuhe1GI//h5uptK4PvLt+BGBxsoUJbd3/IW002yk//6sZPlFgsG1hY6OHLcy6kA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3" - } - }, "@babel/plugin-transform-property-literals": { "version": "7.10.1", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.10.1.tgz", @@ -3089,18 +3068,6 @@ } } }, - "@babel/plugin-transform-runtime": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.9.0.tgz", - "integrity": "sha512-pUu9VSf3kI1OqbWINQ7MaugnitRss1z533436waNXp+0N3ur3zfut37sXiQMxkuCF4VUjwZucen/quskCh7NHw==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "resolve": "^1.8.1", - "semver": "^5.5.1" - } - }, "@babel/plugin-transform-shorthand-properties": { "version": "7.10.1", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.10.1.tgz", diff --git a/packages/antd/package.json b/packages/antd/package.json index 44b836701e..7a959f87a2 100644 --- a/packages/antd/package.json +++ b/packages/antd/package.json @@ -28,11 +28,9 @@ }, "peerDependencies": { "@ant-design/icons": "^4.0.0", - "@babel/runtime-corejs2": "^7.10.3", "@rjsf/core": "^2.0.0", "antd": "^4.0.0", "antd-dayjs-webpack-plugin": "1.0.0", - "core-js": "^2.5.7", "dayjs": "^1.8.0", "lodash": "^4.17.15", "react": ">=16" @@ -42,20 +40,16 @@ "@babel/cli": "^7.4.4", "@babel/core": "^7.4.5", "@babel/plugin-proposal-class-properties": "^7.5.5", - "@babel/plugin-proposal-object-rest-spread": "^7.5.5", "@babel/plugin-transform-react-jsx": "^7.3.0", - "@babel/plugin-transform-runtime": "^7.5.5", "@babel/preset-env": "^7.10.3", "@babel/preset-react": "^7.0.0", "@babel/register": "^7.4.4", - "@babel/runtime-corejs2": "^7.10.3", "@rjsf/core": "^2.5.1", "antd": "^4.0.0", "atob": "^2.0.3", "babel-eslint": "^10.0.1", "babel-loader": "^8.0.6", "concurrently": "^5.1.0", - "core-js": "^2.5.7", "cross-env": "^2.0.1", "css-loader": "^3.2.0", "dayjs": "^1.8.0", @@ -70,7 +64,6 @@ "less-loader": "^5.0.0", "lodash": "^4.17.15", "react": "^16.8.6", - "react-app-polyfill": "^1.0.4", "react-dom": "^16.8.6", "react-test-renderer": "^16.13.1", "rimraf": "^3.0.2", diff --git a/packages/bootstrap-4/package.json b/packages/bootstrap-4/package.json index 0364d697ed..451b70201e 100644 --- a/packages/bootstrap-4/package.json +++ b/packages/bootstrap-4/package.json @@ -25,9 +25,7 @@ "devDependencies": { "@babel/core": "^7.0.0-0", "@babel/plugin-proposal-class-properties": "^7.5.5", - "@babel/plugin-proposal-object-rest-spread": "^7.5.5", "@babel/plugin-transform-modules-commonjs": "^7.8.3", - "@babel/plugin-transform-runtime": "^7.5.5", "@babel/preset-env": "^7.5.5", "@babel/preset-react": "^7.0.0", "@rjsf/core": "^2.5.1", diff --git a/packages/core/babel.config.js b/packages/core/babel.config.js index fa91642aeb..a64c2f69ff 100644 --- a/packages/core/babel.config.js +++ b/packages/core/babel.config.js @@ -1,44 +1,3 @@ -const BABEL_ENV = process.env.BABEL_ENV; +const defaultConfig = require('../../babel.config') -const defaultPlugins = [ - '@babel/plugin-proposal-class-properties', - '@babel/plugin-proposal-object-rest-spread', - '@babel/plugin-proposal-optional-chaining', - // IE 11 support - '@babel/plugin-transform-object-assign' -]; - -module.exports = { - presets: [ - [ - "@babel/preset-env", - { - modules: ["cjs", "test"].includes(BABEL_ENV) ? "commonjs" : false, - targets: - BABEL_ENV === "test" ? { node: "current" } : { browsers: "defaults" }, - }, - ], - "@babel/preset-react", - ], - env: { - cjs: { - plugins: defaultPlugins, - ignore: ['test/**/*.js'] - }, - umd: { - plugins: defaultPlugins, - ignore: ['test/**/*.js'] - }, - es: { - plugins: [ - ...defaultPlugins, - ['@babel/plugin-transform-runtime', { useESModules: true, corejs: 2 }] - ], - ignore: ['test/**/*.js'] - }, - test: { - plugins: defaultPlugins, - ignore: [] - } - }, -}; +module.exports = defaultConfig diff --git a/packages/core/package-lock.json b/packages/core/package-lock.json index 9cfd5112ac..60f488699e 100644 --- a/packages/core/package-lock.json +++ b/packages/core/package-lock.json @@ -2414,41 +2414,6 @@ "@babel/helper-plugin-utils": "^7.0.0" } }, - "@babel/plugin-transform-runtime": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.4.4.tgz", - "integrity": "sha512-aMVojEjPszvau3NRg+TIH14ynZLvPewH4xhlCW1w6A3rkxTS1m4uwzRclYR9oS+rl/dr+kT+pzbfHuAWP/lc7Q==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.0.0", - "@babel/helper-plugin-utils": "^7.0.0", - "resolve": "^1.8.1", - "semver": "^5.5.1" - }, - "dependencies": { - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "resolve": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz", - "integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true - } - } - }, "@babel/plugin-transform-shorthand-properties": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz", @@ -2807,27 +2772,6 @@ } } }, - "@babel/runtime-corejs2": { - "version": "7.8.7", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.8.7.tgz", - "integrity": "sha512-R8zbPiv25S0pGfMqAr55dRRxWB8vUeo3wicI4g9PFVBKmsy/9wmQUV1AaYW/kxRHUhx42TTh6F0+QO+4pwfYWg==", - "requires": { - "core-js": "^2.6.5", - "regenerator-runtime": "^0.13.4" - }, - "dependencies": { - "core-js": { - "version": "2.6.11", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", - "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==" - }, - "regenerator-runtime": { - "version": "0.13.4", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.4.tgz", - "integrity": "sha512-plpwicqEzfEyTQohIKktWigcLzmNStMGwbOUbykx51/29Z3JOGYldaaNGK7ngNXV+UcoqvIMmloZ48Sr74sd+g==" - } - } - }, "@babel/template": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.2.2.tgz", @@ -4919,11 +4863,6 @@ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, - "core-js": { - "version": "2.5.7", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", - "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" - }, "core-js-compat": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.1.4.tgz", @@ -4952,6 +4891,12 @@ "integrity": "sha512-xc3rkNS/Zc3CmpMKuczWEdY2sZgx09BkAxfvkxlAEBTqcMHeL8QnPqhKse+5sRTi3nrw2pJwToD2WvKn1Uhvww==", "dev": true }, + "core-js-pure": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.1.4.tgz", + "integrity": "sha512-uJ4Z7iPNwiu1foygbcZYJsJs1jiXrTTCvxfLDXNhI/I+NHbSIEyr548y4fcsCEyWY0XgfAG/qqaunJ1SThHenA==", + "dev": true + }, "electron-to-chromium": { "version": "1.3.163", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.163.tgz", @@ -4967,10 +4912,9 @@ } }, "core-js-pure": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.1.4.tgz", - "integrity": "sha512-uJ4Z7iPNwiu1foygbcZYJsJs1jiXrTTCvxfLDXNhI/I+NHbSIEyr548y4fcsCEyWY0XgfAG/qqaunJ1SThHenA==", - "dev": true + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", + "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==" }, "core-util-is": { "version": "1.0.2", diff --git a/packages/core/package.json b/packages/core/package.json index 1d95862b1b..f1b45b6fda 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -40,15 +40,13 @@ "react": ">=16" }, "dependencies": { - "@babel/runtime-corejs2": "^7.8.7", "@types/json-schema": "^7.0.4", "ajv": "^6.7.0", - "core-js": "^2.5.7", + "core-js-pure": "^3.6.5", "json-schema-merge-allof": "^0.6.0", "jsonpointer": "^4.0.1", "lodash": "^4.17.15", "prop-types": "^15.7.2", - "react-app-polyfill": "^1.0.4", "react-is": "^16.9.0", "shortid": "^2.2.14" }, @@ -56,11 +54,9 @@ "@babel/cli": "^7.4.4", "@babel/core": "^7.4.5", "@babel/plugin-proposal-class-properties": "^7.4.4", - "@babel/plugin-proposal-object-rest-spread": "^7.4.4", "@babel/plugin-proposal-optional-chaining": "^7.8.3", "@babel/plugin-transform-object-assign": "^7.8.3", "@babel/plugin-transform-react-jsx": "^7.3.0", - "@babel/plugin-transform-runtime": "^7.4.4", "@babel/preset-env": "^7.4.5", "@babel/preset-react": "^7.0.0", "@babel/register": "^7.4.4", diff --git a/packages/core/src/components/fields/ArrayField.js b/packages/core/src/components/fields/ArrayField.js index 5af33d1a39..241979af29 100644 --- a/packages/core/src/components/fields/ArrayField.js +++ b/packages/core/src/components/fields/ArrayField.js @@ -1,7 +1,7 @@ import AddButton from "../AddButton"; import IconButton from "../IconButton"; import React, { Component } from "react"; -import includes from "core-js/library/fn/array/includes"; +import includes from "core-js-pure/es/array/includes"; import * as types from "../../types"; import { diff --git a/packages/core/src/utils.js b/packages/core/src/utils.js index 7bece94742..d0e31714cb 100644 --- a/packages/core/src/utils.js +++ b/packages/core/src/utils.js @@ -1,7 +1,7 @@ import React from "react"; import * as ReactIs from "react-is"; import mergeAllOf from "json-schema-merge-allof"; -import fill from "core-js/library/fn/array/fill"; +import fill from "core-js-pure/features/array/fill"; import union from "lodash/union"; import jsonpointer from "jsonpointer"; import fields from "./components/fields"; diff --git a/packages/core/webpack.config.dist.js b/packages/core/webpack.config.dist.js index 37d1f7d218..44bad97ca3 100644 --- a/packages/core/webpack.config.dist.js +++ b/packages/core/webpack.config.dist.js @@ -25,21 +25,10 @@ module.exports = { }) ], devtool: "source-map", - externals: { - react: { - root: "React", - commonjs: "react", - commonjs2: "react", - amd: "react" - }, - 'react-dom': { - root: "ReactDOM", - commonjs2: 'react-dom', - commonjs: 'react-dom', - amd: 'react-dom', - umd: 'react-dom', - } - }, + externals: [ + 'react', + 'react-dom' + ], module: { rules: [ { @@ -47,10 +36,6 @@ module.exports = { use: [ "babel-loader", ], - exclude: [ - path.join(__dirname, "node_modules", "core-js"), - path.join(__dirname, "node_modules", "babel-runtime"), - ], }, ] } diff --git a/packages/fluent-ui/package.json b/packages/fluent-ui/package.json index 7e8d39e59d..862aa67702 100644 --- a/packages/fluent-ui/package.json +++ b/packages/fluent-ui/package.json @@ -25,9 +25,7 @@ "devDependencies": { "@babel/core": "^7.0.0-0", "@babel/plugin-proposal-class-properties": "^7.5.5", - "@babel/plugin-proposal-object-rest-spread": "^7.5.5", "@babel/plugin-transform-modules-commonjs": "^7.8.3", - "@babel/plugin-transform-runtime": "^7.5.5", "@babel/preset-env": "^7.5.5", "@babel/preset-react": "^7.10.1", "@fluentui/react": "^7.114.2", diff --git a/packages/material-ui/package.json b/packages/material-ui/package.json index 600f519bfe..d29b2d3ea0 100644 --- a/packages/material-ui/package.json +++ b/packages/material-ui/package.json @@ -22,9 +22,7 @@ "devDependencies": { "@babel/core": "^7.0.0-0", "@babel/plugin-proposal-class-properties": "^7.5.5", - "@babel/plugin-proposal-object-rest-spread": "^7.5.5", "@babel/plugin-transform-modules-commonjs": "^7.8.3", - "@babel/plugin-transform-runtime": "^7.5.5", "@babel/preset-env": "^7.5.5", "@babel/preset-react": "^7.0.0", "@material-ui/core": "^4.2.0", @@ -67,5 +65,6 @@ "type": "git", "url": "git+https://github.com/rjsf-team/react-jsonschema-form.git" }, - "license": "Apache-2.0" + "license": "Apache-2.0", + "dependencies": {} } diff --git a/packages/playground/.babelrc b/packages/playground/.babelrc index 81c7196420..3c41771fcd 100644 --- a/packages/playground/.babelrc +++ b/packages/playground/.babelrc @@ -10,7 +10,7 @@ [ "@babel/plugin-transform-runtime", { - "corejs": 2 + "corejs": 3 } ] ], diff --git a/packages/playground/package-lock.json b/packages/playground/package-lock.json index 53be7f96f2..afa9e3503d 100644 --- a/packages/playground/package-lock.json +++ b/packages/playground/package-lock.json @@ -2833,6 +2833,22 @@ } } }, + "@babel/runtime-corejs3": { + "version": "7.11.2", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.11.2.tgz", + "integrity": "sha512-qh5IR+8VgFz83VBa6OkaET6uN/mJOhHONuy3m1sgF0CV6mXdPSEBdA7e1eUbVvyNtANjMbg22JUv71BaDXLY6A==", + "requires": { + "core-js-pure": "^3.0.0", + "regenerator-runtime": "^0.13.4" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.13.7", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==" + } + } + }, "@babel/template": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.2.2.tgz", @@ -4182,6 +4198,11 @@ "regenerator-runtime": "^0.11.0" }, "dependencies": { + "core-js": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", + "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==" + }, "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", @@ -5239,9 +5260,9 @@ } }, "core-js": { - "version": "2.5.7", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", - "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz", + "integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==" }, "core-js-compat": { "version": "3.1.4", @@ -5288,8 +5309,7 @@ "core-js-pure": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.1.4.tgz", - "integrity": "sha512-uJ4Z7iPNwiu1foygbcZYJsJs1jiXrTTCvxfLDXNhI/I+NHbSIEyr548y4fcsCEyWY0XgfAG/qqaunJ1SThHenA==", - "dev": true + "integrity": "sha512-uJ4Z7iPNwiu1foygbcZYJsJs1jiXrTTCvxfLDXNhI/I+NHbSIEyr548y4fcsCEyWY0XgfAG/qqaunJ1SThHenA==" }, "core-util-is": { "version": "1.0.2", diff --git a/packages/playground/package.json b/packages/playground/package.json index f4d1f4fef1..f5fe7ca91a 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -36,7 +36,7 @@ }, "dependencies": { "@ant-design/icons": "^4.2.1", - "@babel/runtime-corejs2": "^7.4.5", + "@babel/runtime-corejs3": "^7.11.2", "@fluentui/react": "^7.121.5", "@material-ui/core": "^4.9.4", "@rjsf/antd": "^2.5.1", @@ -47,7 +47,7 @@ "@rjsf/semantic-ui": "^2.5.1", "ajv": "^6.7.0", "antd": "^4.3.5", - "core-js": "^2.5.7", + "core-js": "^3.6.5", "dayjs": "^1.8.28", "json-schema-merge-allof": "^0.6.0", "jss": "^10.0.3", diff --git a/packages/semantic-ui/babel.config.js b/packages/semantic-ui/babel.config.js index aec683e974..a64c2f69ff 100644 --- a/packages/semantic-ui/babel.config.js +++ b/packages/semantic-ui/babel.config.js @@ -1,48 +1,3 @@ -const BABEL_ENV = process.env.BABEL_ENV; +const defaultConfig = require('../../babel.config') -const defaultPlugins = []; - -module.exports = { - "presets": [ - [ - "@babel/preset-env", - { - modules: ["cjs", "test"].includes(BABEL_ENV) ? "commonjs" : false, - targets: - BABEL_ENV === "test" ? { node: "current" } : { browsers: "defaults" }, - }, - ], - "@babel/preset-react" - ], - "plugins": [ - "@babel/plugin-proposal-object-rest-spread", - "@babel/plugin-proposal-class-properties", - [ - "@babel/plugin-transform-runtime", - { - "corejs": 2 - } - ] - ], - "env": { - cjs: { - plugins: defaultPlugins, - ignore: ['test/**/*.js'] - }, - umd: { - plugins: defaultPlugins, - ignore: ['test/**/*.js'] - }, - es: { - plugins: [ - ...defaultPlugins, - ['@babel/plugin-transform-runtime', { useESModules: true, corejs: 2 }] - ], - ignore: ['test/**/*.js'] - }, - test: { - plugins: defaultPlugins, - ignore: [] - } - } -}; \ No newline at end of file +module.exports = defaultConfig diff --git a/packages/semantic-ui/package-lock.json b/packages/semantic-ui/package-lock.json index 4396eeea60..d2aa9d0248 100644 --- a/packages/semantic-ui/package-lock.json +++ b/packages/semantic-ui/package-lock.json @@ -451,15 +451,6 @@ "@babel/types": "^7.8.3" } }, - "@babel/helper-module-imports": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", - "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, "@babel/helper-module-transforms": { "version": "7.10.1", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.1.tgz", @@ -1157,16 +1148,6 @@ } } }, - "@babel/plugin-proposal-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-8qvuPwU/xxUCt78HocNlv0mXXo0wdh9VT1R04WU8HGOfaOob26pF+9P5/lYjN/q7DHOX1bvX60hnhOvuQUJdbA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-syntax-object-rest-spread": "^7.8.0" - } - }, "@babel/plugin-proposal-optional-catch-binding": { "version": "7.10.1", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.10.1.tgz", @@ -2412,18 +2393,6 @@ } } }, - "@babel/plugin-transform-runtime": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.8.3.tgz", - "integrity": "sha512-/vqUt5Yh+cgPZXXjmaG9NT8aVfThKk7G4OqkVhrXqwsC5soMn/qTCxs36rZ2QFhpfTJcjw4SNDIZ4RUb8OL4jQ==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "resolve": "^1.8.1", - "semver": "^5.5.1" - } - }, "@babel/plugin-transform-shorthand-properties": { "version": "7.10.1", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.10.1.tgz", @@ -2897,6 +2866,7 @@ "version": "7.9.2", "resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.9.2.tgz", "integrity": "sha512-ayjSOxuK2GaSDJFCtLgHnYjuMyIpViNujWrZo8GUpN60/n7juzJKK5yOo6RFVb0zdU9ACJFK+MsZrUnj3OmXMw==", + "dev": true, "requires": { "core-js": "^2.6.5", "regenerator-runtime": "^0.13.4" @@ -2905,7 +2875,8 @@ "regenerator-runtime": { "version": "0.13.5", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", - "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==" + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", + "dev": true } } }, @@ -6113,7 +6084,8 @@ "core-js": { "version": "2.6.11", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", - "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==" + "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==", + "dev": true }, "core-js-compat": { "version": "3.6.5", diff --git a/packages/semantic-ui/package.json b/packages/semantic-ui/package.json index c02f38afe3..bccfa78648 100644 --- a/packages/semantic-ui/package.json +++ b/packages/semantic-ui/package.json @@ -37,9 +37,7 @@ "@babel/cli": "^7.4.4", "@babel/core": "^7.4.5", "@babel/plugin-proposal-class-properties": "^7.4.4", - "@babel/plugin-proposal-object-rest-spread": "^7.4.4", "@babel/plugin-transform-react-jsx": "^7.3.0", - "@babel/plugin-transform-runtime": "^7.4.4", "@babel/preset-env": "^7.10.3", "@babel/preset-react": "^7.0.0", "@babel/register": "^7.4.4", @@ -119,7 +117,6 @@ }, "license": "Apache-2.0", "dependencies": { - "@babel/runtime-corejs2": "^7.9.2", "semantic-ui-css": "^2.4.1", "semantic-ui-react": "^0.87.3" }