Skip to content

Commit 18c4da5

Browse files
valscionjarlef
authored andcommitted
Remove unnecessary transform plugins for object spread to work (facebook#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
1 parent 58bc07e commit 18c4da5

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

Diff for: packages/babel-preset-react-app/index.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,7 @@ const plugins = [
2727
regenerator: true,
2828
// Resolve the Babel runtime relative to the config.
2929
moduleName: path.dirname(require.resolve('babel-runtime/package'))
30-
}],
31-
// The following two plugins are currently necessary to get
32-
// babel-preset-env to work with rest/spread. More info here:
33-
// https://github.com/babel/babel-preset-env#caveats
34-
// https://github.com/babel/babel/issues/4074
35-
// const { a, ...z } = obj;
36-
require.resolve('babel-plugin-transform-es2015-destructuring'),
37-
// const fn = ({ a, ...otherProps }) => otherProps;
38-
require.resolve('babel-plugin-transform-es2015-parameters')
30+
}]
3931
];
4032

4133
// This is similar to how `env` works in Babel:

Diff for: packages/babel-preset-react-app/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
],
1313
"dependencies": {
1414
"babel-plugin-transform-class-properties": "6.16.0",
15-
"babel-plugin-transform-es2015-destructuring": "6.16.0",
16-
"babel-plugin-transform-es2015-parameters": "6.17.0",
17-
"babel-plugin-transform-object-rest-spread": "6.16.0",
15+
"babel-plugin-transform-object-rest-spread": "6.19.0",
1816
"babel-plugin-transform-react-constant-elements": "6.9.1",
1917
"babel-plugin-transform-react-jsx-self": "6.11.0",
2018
"babel-plugin-transform-react-jsx-source": "6.9.0",

0 commit comments

Comments
 (0)