diff --git a/plugins/woocommerce-admin/babel.config.js b/plugins/woocommerce-admin/babel.config.js index 1608eec9451..ac7db3ed398 100644 --- a/plugins/woocommerce-admin/babel.config.js +++ b/plugins/woocommerce-admin/babel.config.js @@ -3,6 +3,13 @@ module.exports = function ( api ) { return { presets: [ '@wordpress/babel-preset-default' ], + plugins: [ + /** + * This allows arrow functions as class methods so that binding + * methods to `this` in the constructor isn't required. + */ + '@babel/plugin-proposal-class-properties', + ], env: { production: { plugins: [ diff --git a/plugins/woocommerce-admin/package-lock.json b/plugins/woocommerce-admin/package-lock.json index 6bc57fb7052..756b2592c91 100644 --- a/plugins/woocommerce-admin/package-lock.json +++ b/plugins/woocommerce-admin/package-lock.json @@ -1280,6 +1280,14 @@ "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==", + "dev": true + } } }, "@babel/runtime-corejs3": { @@ -6338,7 +6346,7 @@ "@wordpress/keycodes": "2.11.0", "@wordpress/viewport": "2.15.1", "classnames": "2.2.6", - "core-js": "2.6.11", + "core-js": "3.6.5", "d3-axis": "1.0.12", "d3-format": "1.4.4", "d3-scale": "2.2.2", @@ -6380,6 +6388,12 @@ "regenerator-runtime": "^0.13.2" } }, + "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==", + "dev": true + }, "moment": { "version": "2.22.2", "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", @@ -6407,6 +6421,12 @@ "core-js": "^2.6.5", "regenerator-runtime": "^0.13.2" } + }, + "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==", + "dev": true } } }, @@ -6458,6 +6478,12 @@ "tannin": "^1.1.0" } }, + "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==", + "dev": true + }, "moment": { "version": "2.22.2", "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", @@ -6488,6 +6514,12 @@ "regenerator-runtime": "^0.13.2" } }, + "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==", + "dev": true + }, "qs": { "version": "6.9.1", "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.1.tgz", @@ -6515,6 +6547,12 @@ "core-js": "^2.6.5", "regenerator-runtime": "^0.13.2" } + }, + "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==", + "dev": true } } }, @@ -6733,6 +6771,12 @@ } } } + }, + "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==", + "dev": true } } }, @@ -6861,30 +6905,41 @@ } }, "@wordpress/babel-preset-default": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@wordpress/babel-preset-default/-/babel-preset-default-4.10.0.tgz", - "integrity": "sha512-fVwtjumi0iIvaD2iTw/X2zK7dQnl0bwUy3L7mBU0M5WkUQ6C4wd6ukA+HRGSH8QKqqxm4ZL1OQnpshJfgioxfw==", + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@wordpress/babel-preset-default/-/babel-preset-default-4.17.0.tgz", + "integrity": "sha512-9SvyQIC2oYerc+zsZJtQH/P8KqKOJJJH+QrmCIrD2PQ1cw9QrF456sV/xHuNfaAoV3QGFLxP+0wVFOLKdU22DQ==", "dev": true, "requires": { - "@babel/core": "^7.8.3", - "@babel/plugin-proposal-async-generator-functions": "^7.8.3", - "@babel/plugin-proposal-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-react-jsx": "^7.8.3", - "@babel/plugin-transform-runtime": "^7.8.3", - "@babel/preset-env": "^7.8.3", - "@babel/runtime": "^7.8.3", - "@wordpress/babel-plugin-import-jsx-pragma": "^2.5.0", - "@wordpress/browserslist-config": "^2.6.0", - "@wordpress/element": "^2.11.0", - "@wordpress/warning": "^1.0.0", - "core-js": "^3.1.4" + "@babel/core": "^7.9.0", + "@babel/plugin-transform-react-jsx": "^7.9.4", + "@babel/plugin-transform-runtime": "^7.9.0", + "@babel/preset-env": "^7.9.0", + "@babel/runtime": "^7.9.2", + "@wordpress/babel-plugin-import-jsx-pragma": "^2.7.0", + "@wordpress/browserslist-config": "^2.7.0", + "@wordpress/element": "^2.16.0", + "@wordpress/warning": "^1.2.0", + "core-js": "^3.6.4" }, "dependencies": { - "core-js": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz", - "integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==", + "@wordpress/browserslist-config": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-2.7.0.tgz", + "integrity": "sha512-pB45JlfmHuEigNFZ1X+CTgIsOT3/TTb9iZxw1DHXge/7ytY8FNhtcNwTfF9IgnS6/xaFRZBqzw4DyH4sP1Lyxg==", "dev": true + }, + "@wordpress/element": { + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/@wordpress/element/-/element-2.16.0.tgz", + "integrity": "sha512-1ijo/GR/uBfL4teCQ3oFdUTqkeV2EZ32SCvXl30iPbqYmaNSzT1ZI1dlW8GO5o5UBja9BG11hnaOwm93pE2y2A==", + "dev": true, + "requires": { + "@babel/runtime": "^7.9.2", + "@wordpress/escape-html": "^1.9.0", + "lodash": "^4.17.15", + "react": "^16.9.0", + "react-dom": "^16.9.0" + } } } }, @@ -9380,26 +9435,6 @@ "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", "dev": true }, - "puppeteer": { - "version": "npm:puppeteer-core@3.0.0", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-3.0.0.tgz", - "integrity": "sha512-oWjZFGMc0q2ak+8OxdmMffS79LIT0UEtmpV4h1/AARvESIqqKljf8mrfP+dQ2kas7XttsAZIxRBuWu7Y5JH8KQ==", - "dev": true, - "requires": { - "@types/mime-types": "^2.1.0", - "debug": "^4.1.0", - "extract-zip": "^2.0.0", - "https-proxy-agent": "^4.0.0", - "mime": "^2.0.3", - "mime-types": "^2.1.25", - "progress": "^2.0.1", - "proxy-from-env": "^1.0.0", - "rimraf": "^3.0.2", - "tar-fs": "^2.0.0", - "unbzip2-stream": "^1.3.3", - "ws": "^7.2.3" - } - }, "read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -11466,6 +11501,12 @@ "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==", + "dev": true + }, "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", @@ -14323,9 +14364,9 @@ } }, "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==" + "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.6.5", @@ -28324,6 +28365,34 @@ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, + "puppeteer": { + "version": "npm:puppeteer-core@3.0.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-3.0.0.tgz", + "integrity": "sha512-oWjZFGMc0q2ak+8OxdmMffS79LIT0UEtmpV4h1/AARvESIqqKljf8mrfP+dQ2kas7XttsAZIxRBuWu7Y5JH8KQ==", + "dev": true, + "requires": { + "@types/mime-types": "^2.1.0", + "debug": "^4.1.0", + "extract-zip": "^2.0.0", + "https-proxy-agent": "^4.0.0", + "mime": "^2.0.3", + "mime-types": "^2.1.25", + "progress": "^2.0.1", + "proxy-from-env": "^1.0.0", + "rimraf": "^3.0.2", + "tar-fs": "^2.0.0", + "unbzip2-stream": "^1.3.3", + "ws": "^7.2.3" + }, + "dependencies": { + "mime": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", + "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==", + "dev": true + } + } + }, "q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", @@ -34398,6 +34467,14 @@ "minimist": "^1.2.0", "request": "^2.88.0", "rx": "^4.1.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==", + "dev": true + } } }, "wait-port": { @@ -35495,6 +35572,12 @@ } } }, + "ws": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", + "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", + "dev": true + }, "x-is-string": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/x-is-string/-/x-is-string-0.1.0.tgz", diff --git a/plugins/woocommerce-admin/package.json b/plugins/woocommerce-admin/package.json index 143a458690d..d95509dd96d 100644 --- a/plugins/woocommerce-admin/package.json +++ b/plugins/woocommerce-admin/package.json @@ -112,7 +112,7 @@ "@wordpress/url": "2.13.0", "@wordpress/viewport": "2.15.1", "classnames": "2.2.6", - "core-js": "2.6.11", + "core-js": "3.6.5", "debug": "4.1.1", "dompurify": "2.0.12", "gridicons": "3.3.1", @@ -134,6 +134,7 @@ "@automattic/mini-css-extract-plugin-with-rtl": "0.8.0", "@babel/cli": "7.10.5", "@babel/core": "7.11.1", + "@babel/plugin-proposal-class-properties": "^7.10.4", "@babel/plugin-transform-async-to-generator": "7.10.4", "@babel/plugin-transform-react-jsx": "7.10.4", "@babel/runtime-corejs2": "7.11.2", @@ -162,7 +163,7 @@ "@woocommerce/number": "file:packages/number", "@woocommerce/tracks": "file:packages/tracks", "@wordpress/babel-plugin-makepot": "2.1.3", - "@wordpress/babel-preset-default": "4.10.0", + "@wordpress/babel-preset-default": "4.17.0", "@wordpress/browserslist-config": "2.6.0", "@wordpress/custom-templated-path-webpack-plugin": "1.6.0", "@wordpress/postcss-plugins-preset": "1.3.0", diff --git a/plugins/woocommerce-admin/packages/components/package.json b/plugins/woocommerce-admin/packages/components/package.json index 37a76809661..26730ce9005 100644 --- a/plugins/woocommerce-admin/packages/components/package.json +++ b/plugins/woocommerce-admin/packages/components/package.json @@ -36,7 +36,7 @@ "@wordpress/keycodes": "2.11.0", "@wordpress/viewport": "2.15.1", "classnames": "2.2.6", - "core-js": "2.6.11", + "core-js": "3.6.5", "d3-axis": "1.0.12", "d3-format": "1.4.4", "d3-scale": "2.2.2", diff --git a/plugins/woocommerce-admin/packages/components/src/calendar/date-picker.js b/plugins/woocommerce-admin/packages/components/src/calendar/date-picker.js index ed1f43e423c..180bafd2958 100644 --- a/plugins/woocommerce-admin/packages/components/src/calendar/date-picker.js +++ b/plugins/woocommerce-admin/packages/components/src/calendar/date-picker.js @@ -1,8 +1,8 @@ /** * External dependencies */ -import 'core-js/fn/object/assign'; -import 'core-js/fn/array/from'; +import 'core-js/features/object/assign'; +import 'core-js/features/array/from'; import { __, sprintf } from '@wordpress/i18n'; import { Component } from '@wordpress/element'; import { Dropdown, DatePicker as WpDatePicker } from '@wordpress/components'; diff --git a/plugins/woocommerce-admin/packages/components/src/calendar/date-range.js b/plugins/woocommerce-admin/packages/components/src/calendar/date-range.js index 0ac314e2b63..0efaf030c73 100644 --- a/plugins/woocommerce-admin/packages/components/src/calendar/date-range.js +++ b/plugins/woocommerce-admin/packages/components/src/calendar/date-range.js @@ -1,8 +1,8 @@ /** * External dependencies */ -import 'core-js/fn/object/assign'; -import 'core-js/fn/array/from'; +import 'core-js/features/object/assign'; +import 'core-js/features/array/from'; import { __, sprintf } from '@wordpress/i18n'; import classnames from 'classnames'; import { Component, createRef } from '@wordpress/element';