Breaking Changes
- Ruby 3.3+ is required for React on Rails v17: The open-source gem now requires Ruby
>= 3.3.0, aligning it with React on Rails Pro,create-react-on-rails-app, and the CI minimum matrix. React on Rails v16 remains the upgrade path for applications that must stay on Ruby 3.2 or older. PR 3500 by justin808.
Added
- [Pro] Imperative refetch API for
<RSCRoute>:<RSCRoute>now accepts an optionalreftyped asRSCRouteHandle, exposingrefetch()so a parent or sibling can refetch a server component without knowing itscomponentNameorcomponentProps. A newuseCurrentRSCRoute()hook returns the same handle for client components rendered inside the RSC subtree (for example, an inline "Refresh" button rendered by the server component itself); calling it outside an<RSCRoute>ancestor throwsuseCurrentRSCRoute must be used inside an <RSCRoute>. Both APIs auto-update the rendered tree with no caller-sidesetKey/useStateworkaround and propagate to every<RSCRoute>instance bound to the same cache key. The internal cache invalidation runs inside a React transition, so old content stays visible while the new RSC payload streams in without a Suspense-fallback flash. The existinguseRSC().refetchComponent(name, props)API and theServerComponentFetchError-based retry flow are unchanged. Fixes Issue 3106. PR 3552 by AbanoubGhadban. - [Pro]
<RSCRoute ssr={false}>defers initial RSC payload generation:<RSCRoute>now acceptsssr={false}to skip server-side RSC payload generation for that route — the server streams the nearest<Suspense>fallback and the client fetches the payload through the existingRSCProviderpath (cache lookup,/rsc_payload/:componentNamefetch,ServerComponentFetchError, anduseRSC().refetchComponent(...)retry).ssrdefaults totrue, so existing routes are unchanged and a mixed page can server-render some routes while deferring others. Deferred roots that do not manually callwrapServerComponentRendererare now supported automatically: RSC-enabled generated client packs register a default RSC provider (also exported asreact-on-rails-pro/registerDefaultRSCProvider/clientfor manual entrypoints) that wraps auto-bundledreact_component(..., prerender: false)and deferred-onlystream_react_componentroots. Completes Issue 3101. PR 3318, PR 3394 by ihabadham. - Ruby 4.0 CI support: Updated OSS latest-runtime CI coverage, local CI switching guidance, and public compatibility docs to test Ruby 4.0 while keeping Ruby 3.3 as the minimum supported CI lane. PR 3529 by justin808.
- [Pro] HTTP rolling-deploy endpoint auto-mount: Configuring
config.rolling_deploy_adapter = ReactOnRailsPro::RollingDeployAdapters::Httpnow automatically mountsReactOnRailsPro::RollingDeploy::BundlesControlleratconfig.rolling_deploy_mount_path(default/react_on_rails_pro/rolling_deploy). Set the mount path tonilor blank to opt out and keep a manualdraw_routesmount; apps that previously mounted the default route manually should remove that route or give secondary manual mounts a distinctas_prefix:to avoid duplicate named-route errors. Fixes Issue 3476. PR 3504 by justin808.
Changed
- Generator defaults to Rspack for fresh installs:
rails generate react_on_rails:installandcreate-react-on-rails-appnow default to the Rspack bundler on fresh installs (significantly faster builds via SWC), instead of Webpack. Pass--no-rspack(or its alias--webpack) to use Webpack. This only affects fresh installs — existing apps that already declare anassets_bundlerinconfig/shakapacker.ymlare left unchanged, an explicit--rspack/--no-rspack/--webpackalways wins, and the default falls back to Webpack on Shakapacker versions below 9.0 (where Rspack is unsupported). PR 3484 by justin808.
Improved
- RSC setup verification warns on dynamic plugin options:
react_on_rails:install --rscnow warns whennew RSCWebpackPlugin(...)uses computed options that cannot be statically verified, avoiding misleading missing-clientReferencesreports for dynamic config. Fixes Issue 3412. PR 3505 by justin808. - Rspack-aware diagnostics and dev-server help: Doctor, system checker, and
bin/dev --helpoutput now label Rspack apps as Rspack instead of webpack while preserving webpack wording for default apps. Fixes Issue 3388. PR 3508 by justin808.
Fixed
- Shakapacker config warnings now report resolved relative paths: When
SHAKAPACKER_CONFIGis set to a relative missing path, the Rails boot warning now includes the Rails-root-resolved path that React on Rails actually checked. Fixes Issue 3436. PR 3441 by justin808. - Base-port renderer URLs preserve localhost-equivalent hosts:
bin/devbase-port mode now keeps localhost-equivalent renderer hosts and schemes, such as127.0.0.1andhttps://localhost, when derivingREACT_RENDERER_URL; remote or invalid hosts still fall back tohttp://localhost:<port>. Fixes Issue 3466. PR 3506 by justin808. - [Pro] Streamed RSC rendering now propagates CSP nonces: React on Rails Pro now passes the Rails CSP nonce to React's streamed RSC renderer options so streamed script output can satisfy strict content security policies. Fixes Issue 3491. PR 3507 by justin808.
- [Pro] RSC stream parser tolerates blank separator lines:
LengthPrefixedStreamParsernow skips blank separator lines (including a lone CR from a split CRLF) between length-prefixed records instead of treating them as malformed headers, matching the default Pro RSC payload template that inserts extra newlines between chunks. Malformed non-empty headers still raise as before, and a stream ending mid-\r\nno longer logs a spurious incomplete-stream warning. Fixes Issue 3499. PR 3515 by justin808. - Generated build scripts run the auto-bundle hook before building bundles: Newly generated apps now run the Shakapacker precompile (auto-bundle) hook before the generated
build,build:test, scaffolded CI, andbuild_test_commandbundle builds, so packs are regenerated before bundling. Apps with custom Shakapacker hooks keep them under Shakapacker's control so the hook does not double-run. PR 3535 by justin808.