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.
--pretendsafe dry run:--pretendno longer executes real setup commands or crashes onFile.chmod. PR 2536.- Clean stale webpack config on
--rspackinstall: Removes leftoverconfig/webpack/files when switching to rspack. PR 2597.
Development Workflow
- Automatic dev asset reuse for tests: When
bin/dev staticis running,bundle exec rspecautomatically 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_jshandles non-Error throws: Defensive error serialization now supports thrown primitives andnullvalues. 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
createTanStackRouterRenderFunctionviareact-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_licensetask 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 overridecustom_rsc_payload_template, ensure it resolves to a.text.erbtemplate. PR 2535. - Breaking: removed legacy key-file license fallback:
config/react_on_rails_pro_license.keyis no longer read. Move your token to theREACT_ON_RAILS_PRO_LICENSEenvironment 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.