Join GitHub today
This wiki is used ONLY for React on Rails Pro, the paid, enhanced version or React on Rails.
2018-06-26: I'm looking for pilot customers of React on Rails Pro. Interested? Please email me.
React on Rails Pro
Performance enhancements and priority support for React on Rails.
The price we paid for the consultation + the React on Rails pro license has already been made back a couple of times from hosting fees alone. The entire process was super hands off, and our core team was able to focus on shipping new feature during that sprint.
We've got this already in production at https://egghead.io.
Fragment Caching View Helpers
Fragment caching is available via the
cached_react_component_hash view helpers. This includes lazy evaluation of props. Such fragment caching saves a ton of CPU work for your web server and greatly reduces the request time.
Fragment caching is a HUGE win, as it completely skips the evaluation costs of:
- Database calls to compute the props.
Note, even without server rendering (without step 3 above), fragment caching is still effective.
See Caching for more additional details.
React On Rails Pro Node React Render
The "React on Rails Pro Node React Renderer" provides more efficient React Server Side Rendering on a standalone Node JS server.
Overall Management Memory and CPU on both the Rendering and Ruby Servers
Proper Node Tooling
Caching of React Rendering
To limit the load on the renderer server or embedded ExecJS, caching of React rendering requests can be enabled by a config setting. Because current React rendering requests are idempotent (same value regardless of calls), caching should be feasible for all server rendering calls. The current renderer does not allow any asynchronous calls to fetch data. The rendering request includes all data for rendering.
Rolling Restart of Node Workers
See the Node React Render Docs.
Other Utility Methods
See the Ruby API.
"Do you want your app to randomly crash sometimes in hard to predict ways? Then ExecJS is perfect for you" Anybody who regularly hits six digit request numbers a day is going to be in for a bad time." Pete Keen, https://egghead.io
For details, see Egghead React on Rails Pro Deployment Highlights.
Why should I use React on Rails Pro if ExecJS seems to work?
Caching is extremely useful to any server rendering you're doing, with or without ExecJS.
React on Rails pro support caching at 2 levels:
- Caching of rendering request to ExecJS (or the Node renderer). This avoids extra calls to ExecJS.
- Fragment caching of server rendering. This avoids even the calculations of prop values from the database and the cost of converting the props to a string (lots of CPU there)
By doing such caching, you will take a CPU load off your Ruby server as well as improving response time. And this is with virtually no code changes on your part.
You have 2 options:
- React on Rails Pro comes with a ShakaCode Pro Support Plan.
- You can buy a license for $950/year. I can do a free trial for select companies.
For more info, email firstname.lastname@example.org.