Skip to content

Commit

Permalink
Remove unnecessary transform plugins for object spread to work (faceb…
Browse files Browse the repository at this point in the history
…ook#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
  • Loading branch information
valscion authored and alexdriaguine committed Jan 23, 2017
1 parent a7121e2 commit 07e1e53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
10 changes: 1 addition & 9 deletions packages/babel-preset-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions packages/babel-preset-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 07e1e53

Please sign in to comment.