-
Notifications
You must be signed in to change notification settings - Fork 47.1k
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
Update tooling docs to suggest babel #4546
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! |
Done deal. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@@ -32,11 +32,41 @@ If you like using JSX, we provide an in-browser JSX transformer for development | |||
|
|||
### Productionizing: Precompiled JSX | |||
|
|||
If you have [npm](https://www.npmjs.com/), you can simply run `npm install -g react-tools` to install our command-line `jsx` tool. This tool will translate files that use JSX syntax to plain JavaScript files that can run directly in the browser. It will also watch directories for you and automatically transform files when they are changed; for example: `jsx --watch src/ build/`. | |||
If you have [npm](https://www.npmjs.com/), you can run `npm install -g babel`. `babel` has built-in support for React v0.12 and v0.13. Tags are automatically transformed to their equivalent `React.createElement(...)`, `displayName` is automatically inferred and added to all React.createClass calls. It's completely compatible with the original ([though deprecated](https://facebook.github.io/react/blog/2015/06/12/deprecating-jstransform-and-react-tools.html)) JSX/React transformer even down to whitespace handling. |
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 just drop the last sentence here – no one will remember react-tools in a few months anyway.
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 deal.
Thanks! Can you link to http://babeljs.io/docs/usage/browser/ instead of JSXTransformer.js too? |
Linked to the browser page on babeljs as well, though it doesn't provide a download link (so I had to reword the section). |
All done with revisions. Thanks @spicyj! |
Awesome work. Do you mind squashing your commits together? |
Not a problem at all. I'll squish and report back. |
`react-tools` is deprecated, `babel` is our future * https://facebook.github.io/react/blog/2015/06/12/deprecating-jstransform-and-react-tools.html * https://babeljs.io/docs/usage/jsx/
All set! |
Update tooling docs to suggest babel
Thank you @rgbkrk! |
Would you be interested in doing a scan of the rest of our docs and see where else we are talking about using JSXTransformer (and |
A quick pass shows fixes certainly need to be made in the Japanese and Korean versions of the docs, but I certainly can't fix those. 😉 I've got to run so I can't scan this evening. runs off and doesn't click Apparently I had to run so quick that I left this comment but didn't submit it. Sorry! Were you able to get to this @zpao? |
I started to and I can finish it up today (I'm going to make some other related changes so will try to get them all in together). |
react-tools
is deprecated,babel
is our future