-
Notifications
You must be signed in to change notification settings - Fork 755
Node runtime required in production #418
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
Comments
ExecJS is also required for transforming JSX (by external It doesn't have to be Node.js -- it could be any of ExecJS's JS runtimes. (AFAIK, therubyracer is the best option for CRuby: #290.) Maybe you could get away without a JS runtime on your production server if you precompiled assets on a different machine. I'm not sure what it would take to support this in react-rails, but if you can figure it out without too much API change, I'd be on board! |
Great, the second scenario you describe is exactly my current setup (assets are built on a build server). I'll see if I can whip something up. Would a config setting be the normal way options like this are handled? I did notice that execjs does have a Disabled option for the runtime, and I imagine we can do something similar (or take advantage of that pseudo renderer). |
A config setting would be a great way to handle that! |
We actually handled this quite simply by setting the EXECJS_RUNTIME env variable to "DisabledRuntime" in our production environments. This works perfectly! Maybe we can add something in the README or to a config value that sets this runtime? |
Why is node a requirement when running in production if the application is not taking advantage of server side rendering? Could this be configurable?
This seems to be happening simply because execjs is being required, though unless I'm misunderstanding, it shouldn't actually be needed.
Thank you all for your contributions so far, this gem has made integrating react into an existing rails project pretty seamless.
The text was updated successfully, but these errors were encountered: