Introducing a new way to review your PRs.

Read the announcement

shakacode / react_on_rails

Integration of React + Webpack + Rails including server-side rendering of React, enabling a better developer experience and faster client performance.

View on GitHub

19 documents · Updated Nov 18, 2026

overview

Knowledge Base updated: 2026-11-17

React on Rails knowledge base

React on Rails is a monorepo for integrating React with Rails applications. It contains the open-source Ruby gem and JavaScript runtime, development tooling, application scaffolding, CI and release automation, and Pro rendering features.

The core integration spans Rails engine/configuration code, browser and server JavaScript registration/rendering, and Ruby-to-Node server-rendering transport. Pro functionality adds managed Node renderers, streaming, caches, deployment controls, licensing, observability, and React Server Components support.

Critical operational configuration lives in Ruby configuration and engine code, JavaScript package entry points and registries, GitHub Actions workflows, package/gem manifests, and Pro renderer/deployment integrations.

flowchart LR
  Rails[Rails application] --> Gem[react_on_rails Ruby gem]
  Gem --> Helpers[Helpers and controllers]
  Helpers --> Client[Browser ReactOnRails runtime]
  Client --> Components[Component and store registries]
  Gem --> Pool[Rendering pool]
  Pool --> Node[Node renderer]
  Node --> SSR[SSR / streaming output]
  SSR --> Client
  Pro[React on Rails Pro] --> Node
  Pro --> RSC[React Server Components]
  RSC --> Client
  Tooling[CLI, scripts, and generators] --> Rails
  CI[GitHub Actions] --> Tooling
  CI --> Release[Package and gem releases]

Glossary

  • ReactOnRails: JavaScript API and runtime used to register and render components and stores.
  • Rendering pool: Ruby-side abstraction that manages requests to server-side renderers.
  • Node renderer: Pro process topology that executes JavaScript rendering work.
  • RSC payload: React Server Components response data transported from server rendering to browser hydration.
  • Async props: Pro mechanism for emitting asynchronously resolved values during streaming rendering.

Invariants

  • Rails integration configuration is established through the gem and engine entry points; changes should preserve their initialization contract (lib/…/engine.rb, lib/…/configuration.rb).
  • Browser and server rendering depend on explicit component/store registration rather than implicit module discovery (node_package/…/ReactOnRails.ts).
  • Server-rendering request and response handling must preserve the Ruby/Node transport protocol (lib/…/server_rendering_pool.rb, node_package/src/).
  • Required CI remains the repository gate for supported validation paths (.github/…/ci-required.yml).
  • Pro operational features must retain their licensing and deployment safety checks (react_on_rails_pro/).

Routing table