Skip to main content
Edit on GitHub

React on Rails 16.4.0 Release Notes

Upgrading from 16.3.x to 16.4.0

Update your gem and npm package versions:

# Gemfile
gem "react_on_rails", "16.4.0"
// package.json
{
"dependencies": {
"react-on-rails": "16.4.0"
}
}

Pro users: Use react-on-rails-pro instead of react-on-rails in package.json, and react_on_rails_pro instead of react_on_rails in your Gemfile. See the Pro upgrade guide for details.

Then run bundle install and your package manager's install command.

Highlights

This is a large release with significant improvements to the install generator, development workflow, and Pro stability. See the CHANGELOG for the full list of changes.

Generator Improvements

  • TypeScript and rspack config detection: The install generator now correctly handles TypeScript configs (.ts) and rspack bundler configs. PR 2567.
  • Incomplete install messaging: The generator now warns explicitly when Shakapacker setup fails, instead of showing a misleading "Successfully Installed" banner. PR 2613.
  • --pretend safe dry run: --pretend no longer executes real setup commands or crashes on File.chmod. PR 2536.
  • Clean stale webpack config on --rspack install: Removes leftover config/webpack/ files when switching to rspack. PR 2597.

Development Workflow

  • Automatic dev asset reuse for tests: When bin/dev static is running, bundle exec rspec automatically detects and reuses fresh development assets. PR 2570.
  • Environment-variable-driven ports: Procfile templates now use ${PORT:-3000} and ${SHAKAPACKER_DEV_SERVER_PORT:-3035}, enabling multiple worktrees. PR 2539.
  • create-react-on-rails-app --rsc: Single command to scaffold an RSC-ready app. PR 2430.

SSR and Rendering

  • server_render_js handles non-Error throws: Defensive error serialization now supports thrown primitives and null values. PR 2599.
  • Smarter duplicate registration warnings: Re-registering the same component (common with HMR) is now silently accepted. PR 2354.

Pro Changes

  • TanStack Router SSR: New createTanStackRouterRenderFunction via react-on-rails-pro/tanstack-router. PR 2516.
  • CSP nonce for immediate hydration and RSC streaming: Inline <script> tags now include CSP nonce attributes. PR 2398, PR 2418.
  • License verification rake task: New react_on_rails_pro:verify_license task with JSON output for CI/CD. PR 2385.
  • RSC payload template format: Pro now renders RSC payload templates with formats: [:text] to prevent Rails view annotations from corrupting NDJSON. If you override custom_rsc_payload_template, ensure it resolves to a .text.erb template. PR 2535.
  • Breaking: removed legacy key-file license fallback: config/react_on_rails_pro_license.key is no longer read. Move your token to the REACT_ON_RAILS_PRO_LICENSE environment variable. PR 2454.

Bug Fixes

Numerous bug fixes for CSS module SSR with rspack, bin/dev hook resolution, generator test defaults, precompile hook coordination, and more. See the CHANGELOG for details.