-
Notifications
You must be signed in to change notification settings - Fork 32
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
Please create better documentation on main page #39
Comments
Right here there a example how use it http://www.smashingmagazine.com/2015/04/21/react-to-the-future-with-isomorphic-apps/ |
Just asking for you to put up bit of info up front like most open source projects do... I that article explains nothing to what your module's use case.
|
Hi @dschinkel, With how small this module is, the usage info in the readme really is sufficient. There just isn't much more to add docs for. (The entire module is only 34 lines) As far as why you would want/need to use this, the statement:
kind of sums it up. The problem this module solves is that Node cannot parse jsx files due to the syntax. If you try to require a file with jsx syntax, it will freak out. However, when working with React components on the server (such as with isomorphic apps) you will find that you do need to require jsx files, most likely to render them and send the html to the client. In order to require them without errors, you have a few options: 1) compile the jsx files to regular js first, then require that or 2) dynamically transform jsx files as they are required. Node-jsx takes the latter, simpler approach which avoids having an extra build step on the server-side. If you already have a build process for your server, then you could just add jsx compilation there and not need to use this module. As the name implies, node-jsx is strictly for the server, and is not needed in the browser. A quick note on usage the readme doesn't mention: The statement Hope I was able to clear some things up. :) |
Thanks Zack, your last paragraph answered what I was missing and could not infer. I am new to node and react so I would know know of that pain yet :)
|
I know you may take it for granted and are seasoned at node + react, but on your main page can you explain the use case for this? I want to know what this gives me, not just how to use it. And being new to this, it's not that evident as you have no description and I cannot just infer by the usage why I should require jsx in my code for react. Just for newbies you need to have a little more explanation.
The text was updated successfully, but these errors were encountered: