-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Do not quote JSX attribute keys for IdentifierName #8045
Conversation
Given the following ```js a = <F new/> ``` We used to generate: ```js a = React.createElement(F, {"new": true}) ``` but now we generate ```js a = React.createElement(F, {new: true}) ``` If you need to quote these (ie for ES3 you can use transform-property-literals)
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/8195/ |
1 similar comment
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/8195/ |
What is the process for merging this? |
Two approved reviews |
I'm just wondering why we don't quote everything? |
@xtuc Do you quote all your keys in object literals? In member expressions? |
@arv quoting every key would simplify the logic here and it's in the generated code. |
@xtuc The code here is pretty simple and the gain in readability in the generated code makes it worth it. Plus, quoting keys had some bad side effects for people using Closure Compiler further down their build pipeline. |
Thanks, @jridgewell |
Given the following
We used to generate:
but now we generate
If you need to quote these (for ES3 for example, you can use transform-property-literals)