Added
- [Pro] Tag-based cache revalidation (a Next.js
revalidateTaganalog): The fragment-caching helpers (cached_react_component,cached_react_component_hash,cached_stream_react_component,cached_async_react_component) now accept an optionalcache_tags:option (String, Proc, any object responding tocache_keysuch as an ActiveRecord model, or an Array of any mix), and the newReactOnRailsPro.revalidate_tag(tag)/revalidate_tags(*tags)API deletes every cached entry registered under a tag via aRails.cache-backed tag->key index. A newReactOnRailsPro::Cache::RevalidatesActiveRecord concern (revalidates_react_cache) drives revalidation fromafter_commit, so the model that owns the data also owns cache invalidation (and composes withtouch:). Revalidation is best-effort with correctness bounded byexpires_in(a development-mode warning fires whencache_tags:is used without it); index growth is bounded by the newconfig.cache_tag_index_expires_in(default 7 days) andconfig.cache_tag_index_max_keys(default 5,000) settings. Existingcache_key:-only behavior is unchanged. Closes Issue 3871. PR 3964 by justin808. - React 19 root error callbacks:
ReactOnRails.setOptions({ rootErrorHandlers: { onRecoverableError, onCaughtError, onUncaughtError } })registers React's root error callbacks globally; React on Rails applies them to everyhydrateRoot/createRootcall it makes and invokes them with an extra context argument whosecomponentNameanddomNodeIdfields are optional. In development, recoverable hydration errors now log an actionable React on Rails message (component name, dom id, component stack, and a link to the new Debugging Hydration Mismatches guide) alongside React's default error reporting, which stays intact so window-'error'-based tooling keeps working. PartialrootErrorHandlersupdates merge per key, so registering one callback later does not drop the others. On React <19 (and <18 foronRecoverableError), React on Rails retains registrations for future upgrades, but the current runtime cannot invoke unsupported callbacks and logs a one-time console warning. On React on Rails Pro RSC/streaming hydration paths, user callbacks chain with (never replace) Pro's internal recoverable-error handler. Addresses Issue 3892. PR 3933 by justin808. useRailsFormhook +render_model_errorscontroller concern (an InertiauseForm-style bridge to Rails controllers): New React hookuseRailsForm(importable fromreact-on-rails/useRailsForm) makes posting a React form to a plain Rails controller turnkey:data/setData, per-fielderrors,processing,wasSuccessful, submit verbs (post/put/patch/delete/submit),reset/clearErrors/setError, automatic CSRF attachment from the Rails csrf-token meta tag, JSON request/response handling, and mapping of422+{ errors: { field: ["message"] } }responses onto per-field error state. Success results surface aredirectTotarget (followed-redirect URL or JSONredirect_tohint) without navigating, forward-compatible with the client-routing work in Issue 3873. The gem side adds the opt-inReactOnRails::Controller::FormRespondersconcern whoserender_model_errors(record)renders ActiveModel errors in exactly that shape, so validations stay in the model with no API layer and no client-side duplication. Includes a new Forms and Mutations docs page (with an InertiauseFormmapping table and a Server Functions Issue 3867 cross-link) and a runnable dummy-app example (/rails_form). v1 is fetch-only;transform,recentlySuccessful, and file-uploadprogressare deferred. Closes Issue 3872. PR 3942 by justin808.- [Pro] Built-in node renderer
/healthand/readyprobe endpoints: The node renderer can now register first-class liveness (GET /health->200with a status-only body) and readiness (GET /ready->503until the answering worker is online and has at least one server bundle compiled, then200) endpoints, replacing the hand-rolledconfigureFastifyhealth-check recipe for the common case. The endpoints are off by default and enabled with the newenableHealthEndpointsconfig option (orRENDERER_ENABLE_HEALTH_ENDPOINTS=true,TRUE,yes,YES, or1); they are unauthenticated like/infobut expose no runtime version or path details. The1alias is scoped toRENDERER_ENABLE_HEALTH_ENDPOINTSso existing node-renderer boolean environment flags keep their previous parsing behavior. Includes a new Health and Readiness Endpoints docs page with working Kubernetes (tcpSocket+execwithcurl --http2-prior-knowledge-- the h2c listener cannot be probed with HTTP/1.1httpGet), ECS, and Docker Compose probe examples. Closes Issue 3880. PR 3939 by justin808. - [Pro] Source-mapped stack traces in the Node renderer: SSR errors now point at the original TypeScript/JavaScript
file:line:columninstead of bundled positions. When the server bundle carries an inline source map (or a.mapfile is available next to the uploaded bundle), the renderer captures the map text for the VM's bundle generation and lazily parses it on the first error before remapping stack frames — both for exceptions returned to Rails as renderer errors and for stacks captured inside the bundle that surface throughReactOnRails::PrerenderError. Bundles are also now evaluated with their real file path, so even unmapped stacks name the bundle file rather thanevalmachine.<anonymous>. No per-request overhead: map parsing and frame remapping happen only when an error's stack is accessed, and parsed maps are cached per bundle generation. Uses Node's built-inmodule.SourceMap(no new dependencies). Part of Issue 3893. PR 3940 by justin808.
Changed
- [Pro] RSC peer compatibility accepts the coordinated React 19.2 floor: The Pro node renderer now allows React and React DOM
19.2.xstarting at19.2.7, matching the floor required by thereact-on-rails-rsc19.2 package line while preserving the existing React19.0.xsupport window. Refs Issue 3865. PR 4026 by justin808.
Fixed
- Rspack generated apps start in HMR mode: Fresh
rails generate react_on_rails:install --rspackandcreate-react-on-rails-appprojects now install@rspack/dev-server, use theReactRefreshRspackPluginexport, and keepbin/switch-bundler rspack's dev dependencies complete sobin/devcan launch Rspack serve instead of crashing during dev-server startup. Fixes Issue 3925. PR 3926 by AbanoubGhadban and ihabadham.