Enable babel parameters/destructuring for all versions of Node#927
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! |
|
Thank you! Can you describe how you verified that your changes work? |
|
Ran the same test I tried in #904: it('renders without crashing', () => {
const obj = {
a: 'a',
b: 'b',
c: 'c'
};
const { a, ...z } = obj;
console.log(a);
console.log(z);
const div = document.createElement('div');
ReactDOM.render(<App />, div);
});And the test passed. |
|
Nice. Can you try any other cases mentioned in babel/babel#4074? |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
|
This snippet from babel/babel#4074 worked as well within the test, with an output of const fn = ({ a, ...otherProps }) => otherProps;
fn({ a: 1, b: 2 }); |
| moduleName: path.dirname(require.resolve('babel-runtime/package')) | ||
| }] | ||
| }], | ||
| // const { a, ...z } = obj; |
There was a problem hiding this comment.
Let's add a note here specifically mentioning why we need them, and link to the issue.
|
Awesome. Thank you so much! |
…ook#927) * Enable babel parameters/destructuring for all versions of Node * Add more descriptive comment explaining plugin use
…ook#927) * Enable babel parameters/destructuring for all versions of Node * Add more descriptive comment explaining plugin use
…ook#927) * Enable babel parameters/destructuring for all versions of Node * Add more descriptive comment explaining plugin use
Should fix #904. This is my first commit to this project- let me know if this is missing anything!