-
Notifications
You must be signed in to change notification settings - Fork 3
Doesn't work with transform-object-rest-spread #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Think I got it to work with: {
"presets": ["es2015-node6"],
"plugins": [
"babel-plugin-transform-es2015-destructuring",
"transform-object-rest-spread"
]
} |
You're right, I'll add back Keep this issue open. :) |
Node.js@6 has destructing support! |
@ss4xxi it does... The issue is that |
This playground can simply reproduce the problem. Also I commented on T7316. I'll try to fix it this week. |
@jhen0409 thanks :) |
Object rest spread depends on destructuring so we would have to rewrite it to be independent of it |
What's preventing this issue from being closed? |
Probably because Babel still requires additional plugins for object rest spread to work (babel/babel#4074), |
After many hours searching for info and lots of trial and error, I have tried every combination of plugins and presets possible, yet none of them have worked. Can someone please confirm a set up that works? I am compiling for the browser and am running webpack in Node V6.2.2 |
@Billy- Use |
As I said, I have tried every combination of plugins and presets I have come across. My most recent babelrc file contains es2015 preset (and react), transform-es2015-destructuring and transform-object-rest-spread plugins. |
Can you share your .babelrc file and what parsing error you are getting? I'm using: {
"presets": ["eslatest-node6"],
"plugins": [
"transform-es2015-destructuring",
"transform-es2015-parameters",
["transform-object-rest-spread", { "useBuiltIns": true }]
]
} |
Sorry guys, false alarm.. Not sure what was going on at work earlier. Pulled down my WIP and it worked 😠. I reduced down my .babelrc and it actually works with only the object rest spread transform plugin:
Will try to replicate the issue at work on Monday... |
trying to get it working for node..
and it still complains Syntax Error |
https://github.com/babel/babel/releases/tag/v6.19.0 |
Yep it should work now without the 2 plugins! |
@hzoo can you confirm this is actually working? I'm using |
@deadbeef84 can be related: babel/babel#4883 |
You can test in the repl - it would be useful you can post the relevant code too. The transform basically had to be rewritten for rest so it's likely some cases were missed. |
I love babel, and thanks for the work on it! I'm coming across a similar error. I was following https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters#Destructuring_rest_parameters, and in Babel, I'm unable to get either of the following to work (SyntaxError is the result):
I don't know if those are intended to work with the solo object rest spread plugin. I'm running [email protected]. |
@juanpaco I think it's this bug: babel/babel#4851 .. work around is to "use the parameter/destructuring transforms until it's fixed". |
Since Babel 6.22 I think this issue and #4 can be closed |
Anyone managed to get this preset to work with https://babeljs.io/docs/plugins/transform-object-rest-spread/?
Seems it works fine for spread but doesn't work for rest. I'm guessing I need to install an additional preset. Reported here as well: https://phabricator.babeljs.io/T7316
The text was updated successfully, but these errors were encountered: