The project is in a healthy, maintained state
See README.md
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

Runtime

>= 2.6
~> 2.9
~> 1.5
~> 2.7
>= 1.1.1
 Project Readme

CircleCI

See the CHANGELOG for release updates and upgrade details.

React on Rails Pro

Node rendering and caching performance enhancements for React on Rails (Documentation).

Getting Started

The best way to see how React on Rails Pro works is to install this repo locally and take a look at the example application:

spec/dummy

  1. Uses a standard Shakapacker configuration.
  2. Has pages that demonstrate:
    1. caching
    2. loadable-components
  3. Has all the basic react_on_rails specs that run against the Node Renderer
  4. Demonstrates using HMR and loadable-components with almost the same example that is present in loadable-components for SSR

See the README.md in those sample apps for more details.

Features

Caching

Caching of SSR is critical for achieving optimum performance.

  • Fragment Caching: for react_component and react_component_hash, including lazy evaluation of props.
  • Prerender Caching: Server rendering JavaScript evaluation is cached if prerender_caching is turned on in your Rails config. This applies to all JavaScript evaluation methods.

See docs/caching for more details.

Clearing of Global State

If you detect that some library used in server-rendering is leaking state between calls to server render, then you can set the config.ssr_pre_hook_js in your config/initializers/react_on_rails_pro.rb to run some JavaScript to clear the globally leaked state at the beginning of each call to server render.

For more details, see Rails Configuration.

React On Rails Pro Node Renderer

The "React on Rails Pro Node Renderer" provides more efficient server rendering on a standalone Node JS server. See the Node Renderer Docs.

Bundle Caching

Don't wait for the same webpack bundles to built over and over. See the bundle-caching docs.

Other Utility Methods

See the Ruby API.

References

Contributing

Please see CONTRIBUTING for more details.