-
Notifications
You must be signed in to change notification settings - Fork 213
loader-merge: Fix usage of object-rest-spread
#890
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! Keeping the docs up to date is really important.
The master
branch is now using Babel 7, whose preset-env includes this plugin, which has also been renamed to proposal-object-rest-spread
:
https://github.com/babel/babel/blob/v7.0.0-beta.47/packages/babel-preset-env/data/plugins.json#L227
Given that the plugin is now included, I wonder if there is another example "not-included-by-default" plugin we can use instead? Or else something generic like 'my-babel-plugin'
so it never goes out of date causing confusion?
It would be good to fix the docs on the release/v8
branch to use the correct Babel 6 name of transform-object-rest-spread
though.
Also, the docs are in two places in the repo - once under |
@AlanFoster would you be willing to update this PR based on @edmorley's comments? |
According to the current version of babel, the usage of the object rest spread plugin name should be prefixed with `transform` ``` { "plugins": [ ["transform-object-rest-spread", { "useBuiltIns": true }] ] } ``` https://babeljs.io/docs/plugins/transform-object-rest-spread/#via-node-api
Good idea! PR updated 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Many thanks for the PR :-)
The failed Netlify build is because After this PR, I think we should also add object-rest-spread to the web preset on |
According to the current version of babel, the usage of the object rest spread plugin name should be prefixed with
transform
https://babeljs.io/docs/plugins/transform-object-rest-spread/#via-node-api