From 4a7f78ed66c60603441187cc5ce696db369c9c6a Mon Sep 17 00:00:00 2001 From: Vesa Laakso Date: Thu, 17 Nov 2016 18:14:36 +0200 Subject: [PATCH] Remove unnecessary transform plugins for object spread to work (#1052) * 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 * 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 | 4 +--- 2 files changed, 2 insertions(+), 12 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 6ddae417bc2..13f00ed227d 100644 --- a/packages/babel-preset-react-app/package.json +++ b/packages/babel-preset-react-app/package.json @@ -12,9 +12,7 @@ ], "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.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",