-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Enable babel parameters/destructuring for all versions of Node #927
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 [email protected]. 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 }); |
@@ -27,7 +27,10 @@ const plugins = [ | |||
regenerator: true, | |||
// Resolve the Babel runtime relative to the config. | |||
moduleName: path.dirname(require.resolve('babel-runtime/package')) | |||
}] | |||
}], | |||
// const { a, ...z } = obj; |
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.
Let's add a note here specifically mentioning why we need them, and link to the issue.
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.
Done.
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!