4 ms·
"Pre-process" isn't quite accurate. To me that implies processing before serving, but it appears JSX is processed in the browser by a transpiler weighing in at
by drgath 13y ago
"Pre-process" isn't quite accurate. To me that implies processing before serving, but it appears JSX is processed in the browser by a transpiler weighing in at 300k (uncompressed). http://fb.me/JSXTransformer-0.3.0.js http://fb.me/JSXTransformer-0.3.0.js
- jlogsdon 13y agoYes, but the code is still pre-processed before it is executed by anywhere. edit: The fact that the pre-processing library is 300kb uncompressed is a pretty huge deterrent.
- simonw 13y agoPresumably if you run the pre-processer as part of your deploy (the jsx node.js command-line tool) you don't have to ship the pre-processing library to the client.
- peterhunt 13y agoThis is just for making development easy. We have a prebuild step that will do this ahead of time. Just do: npm install -g react-tools and you'll have a jsx command available. We cover this towards the bottom of this page: http://facebook.github.io/react/docs/getting-started.html http://facebook.github.io/react/docs/getting-started.html
- drgath 13y agoThanks for the FYI. I'd consider swapping the order and list the offline method first, since that's the more common approach people take (I'd hope), and it's easier to grok at a glance.
- shaneos 13y agoYou can also process it offline, so you only ship standard JS. The in-browser processing is an option you can choose to use at development time if you find it quicker/simpler.
- deleted 13y ago[deleted]