From 378df6a30839da61c370bbbfc00ae45ec799d346 Mon Sep 17 00:00:00 2001 From: Vesa Laakso Date: Thu, 17 Nov 2016 09:39:06 +0200 Subject: [PATCH 1/2] Update `babel-plugin-transform-object-rest-spread` to v6.19.0 The `babel-plugin-transform-object-rest-spread` v6.19.0 update will allow us to remove the `babel-plugin-transform-es2015-destructuring` and `babel-plugin-transform-es2015-parameters` as the object rest spread transform will now work standalone and not require additional tranforms --- packages/babel-preset-react-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-preset-react-app/package.json b/packages/babel-preset-react-app/package.json index 6ddae417bc2..82f3ba3e35b 100644 --- a/packages/babel-preset-react-app/package.json +++ b/packages/babel-preset-react-app/package.json @@ -14,7 +14,7 @@ "babel-plugin-transform-class-properties": "6.16.0", "babel-plugin-transform-es2015-destructuring": "6.16.0", "babel-plugin-transform-es2015-parameters": "6.17.0", - "babel-plugin-transform-object-rest-spread": "6.16.0", + "babel-plugin-transform-object-rest-spread": "6.19.0", "babel-plugin-transform-react-constant-elements": "6.9.1", "babel-plugin-transform-react-jsx-self": "6.11.0", "babel-plugin-transform-react-jsx-source": "6.9.0", From 7554d3008e22b7e37e7d92d4c9848c41b2387f32 Mon Sep 17 00:00:00 2001 From: Vesa Laakso Date: Thu, 17 Nov 2016 10:43:51 +0200 Subject: [PATCH 2/2] Remove unnecessary babel transform plugins from babel-preset-react-app The `babel-plugin-transform-object-rest-spread` v6.19.0 update makes these plugins unnecessary, as v6.19.0 can be used stand-alone --- packages/babel-preset-react-app/index.js | 10 +--------- packages/babel-preset-react-app/package.json | 2 -- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/packages/babel-preset-react-app/index.js b/packages/babel-preset-react-app/index.js index 2aa1641ce35..a2639c6d4cf 100644 --- a/packages/babel-preset-react-app/index.js +++ b/packages/babel-preset-react-app/index.js @@ -27,15 +27,7 @@ const plugins = [ regenerator: true, // Resolve the Babel runtime relative to the config. moduleName: path.dirname(require.resolve('babel-runtime/package')) - }], - // The following two plugins are currently necessary to get - // babel-preset-env to work with rest/spread. More info here: - // https://github.com/babel/babel-preset-env#caveats - // https://github.com/babel/babel/issues/4074 - // const { a, ...z } = obj; - require.resolve('babel-plugin-transform-es2015-destructuring'), - // const fn = ({ a, ...otherProps }) => otherProps; - require.resolve('babel-plugin-transform-es2015-parameters') + }] ]; // This is similar to how `env` works in Babel: diff --git a/packages/babel-preset-react-app/package.json b/packages/babel-preset-react-app/package.json index 82f3ba3e35b..13f00ed227d 100644 --- a/packages/babel-preset-react-app/package.json +++ b/packages/babel-preset-react-app/package.json @@ -12,8 +12,6 @@ ], "dependencies": { "babel-plugin-transform-class-properties": "6.16.0", - "babel-plugin-transform-es2015-destructuring": "6.16.0", - "babel-plugin-transform-es2015-parameters": "6.17.0", "babel-plugin-transform-object-rest-spread": "6.19.0", "babel-plugin-transform-react-constant-elements": "6.9.1", "babel-plugin-transform-react-jsx-self": "6.11.0",