Skip to content

v17.3.0.rc.0

Pre-release
Pre-release

Choose a tag to compare

@justin808 justin808 released this 01 Dec 02:29
· 9 commits to main since this release

Security

  • [Pro] The RSC generator pins react-on-rails-rsc 19.3.2, which requires the patched Flight runtime:
    Published react-on-rails-rsc 19.3.1 depends on react-server-dom-webpack ~19.3.0, so an existing app could
    upgrade and still resolve Flight 19.3.0, which React's 2026-10-14 advisories (critical RCE
    GHSA-xqc2-xf4c-x3h3 and DoS
    GHSA-h3gv-c5rc-p453) affect.
    react-on-rails-rsc 19.3.2 depends on
    ~19.3.1 and peers on React ^19.3.1. New RSC apps now install it, and Doctor and the Node renderer's startup
    check now require React 19.3.x at 19.3.1 or later with react-on-rails-rsc 19.3.x at 19.3.2 or later. Apps on
    react-on-rails-rsc 19.3.1 keep working with React 19.3.0, and Doctor still warns about a vulnerable lockfile.
    Action required for upgraders: upgrade react-on-rails-rsc to 19.3.2 together with react and react-dom
    19.3.1, remove or update any override or resolution that pins react-server-dom-webpack below 19.3.1, and confirm
    the refreshed lockfile resolves only patched react-server-dom-webpack copies.
    #5339 by justin808.

  • [Pro] Doctor and the Node renderer name a patched release for superseded RSC prereleases: the error
    for a rejected react-on-rails-rsc 19.3.1-rc.x soak prerelease used to recommend stable 19.3.1 with React
    19.3.0, which can keep vulnerable Flight 19.3.0. It now recommends 19.3.2 with React 19.3.1. The error for the
    19.3.0-rc.4 pin that React on Rails 17.1.0 generated still recommends stable 19.3.0, now with React 19.2.9 so
    its ~19.2.8 Flight range resolves the patched 19.2.9. Both errors now tell you to refresh the
    lockfile so every react-server-dom-webpack copy is patched for its React line.
    Action required for upgraders: apps still on the 17.0 react-on-rails-rsc 19.2.1 set should move React and
    React DOM to 19.2.9 together and refresh the lockfile so every react-server-dom-webpack copy is patched: 19.2.9 or later on
    19.2.x, or 19.3.1 or later on 19.3.x.
    #5342 by justin808.

  • create-react-on-rails-app no longer commits the Rails master key: The CLI runs rails new --skip-git and then
    writes .gitignore itself, but Rails adds its key-file ignore rule only when .gitignore already exists. When the
    CLI rendered .gitignore from the installed Rails template, its first generated commit therefore tracked
    config/master.key, the key that decrypts config/credentials.yml.enc. Only the CLI's bundled fallback
    .gitignore, used when that template cannot be rendered, already ignored the key.
    Generated apps now ignore /config/*.key and /config/credentials/*.key before the first commit.
    Action required for upgraders: an app generated by create-react-on-rails-app 16.6.0-rc.0 through 17.2.1 may
    have committed config/master.key. Run these steps from the app’s root directory, because Git resolves the
    config/ paths below from the current directory:

    1. Untracking key files deletes them from each teammate’s working tree on their next pull and breaks any deploy
      that reads them from the Git checkout. First back up every tracked config/*.key and config/credentials/*.key
      file outside the repository, for teammates to restore after that pull, and move such deploys to a
      RAILS_MASTER_KEY environment variable or secret.
    2. Add /config/*.key and /config/credentials/*.key to the app’s .gitignore. Then run git add .gitignore and
      git rm --cached --ignore-unmatch ':(glob)config/*.key' ':(glob)config/credentials/*.key', and commit both
      changes together, so no key file those rules cover stays tracked. The :(glob) prefix keeps * from also
      matching keys in other config/ subfolders.
    3. Check the history in the app’s own checkout, not a fresh clone, so unpushed local branches are included. If
      that checkout is shallow or single-branch, git fetch --unshallow alone misses keys that exist only on other
      branches, so first run git remote set-branches origin '*' and then git fetch --unshallow origin (or
      git fetch origin if it is not shallow), using your remote’s name in place of origin. Then run
      git log --all --full-history --oneline -- ':(glob)config/*.key' ':(glob)config/credentials/*.key'.
    4. If that lists a commit, rotate the credentials. Put each new key in the RAILS_MASTER_KEY secret of every
      deploy that reads its credentials file and give it to teammates, then remove the old keys from the history
      before publishing the repository. If a commit containing the key was ever pushed, including on a branch
      deleted since, treat the key as compromised.

    #5182 by justin808.

Added

  • [Pro] Async props on the RSC payload endpoint:
    config.register_async_props("ComponentName", "ProviderClassName") registers the provider that supplies a
    component's async props when the RSC payload endpoint renders it, so RSCRoute.refetch() works for
    components that read getReactOnRailsAsyncProp. Previously the built-in endpoint template rendered
    every component without async props, so such a refetch failed unless the app shadowed that template.
    The provider is called as .call(emit, props, controller). To build the async props in the payload
    controller itself, override rsc_payload_async_props_block_override; it takes precedence over the
    registry for the components it handles. The endpoint now also returns HTTP 400 when props is a non-empty value that is not a string, such as bracket-notation
    props[key]=value (previously HTTP 500), or is JSON that is not an object. Fixes
    #5075.
    #5091 by
    AbanoubGhadban.

Improved

  • [Pro] Uncached server renders no longer hash the render code: Pro now computes the MD5
    request digest over js_code and its serialized props only when prerender caching needs it as a
    cache key. Uncached renders send the Node Renderer a cheap Component-pid-counter id in the same
    URL segment, which the renderer does not use. The route shape is unchanged.
    NodeRenderingPool.prepare_render_path and .prepare_incremental_render_path now take only
    render_options; drop the js_code argument if you call or override them.
    #5223 by
    justin808. Fixes
    #4880.
  • [Pro] Node Renderer server bundles read globals faster: on Node 20.18+ and 22.8+, the
    Node Renderer builds each bundle's VM context with vm.constants.DONT_CONTEXTIFY, so global
    lookups inside the bundle skip V8's sandbox interceptors. Renders of three real application
    bundles used about 20-25% less CPU in a local A/B. Rendered HTML and request isolation are
    unchanged, and older Node versions keep the previous context.
    #5313 by
    alexeyr-ci2 and justin808.

Changed

  • [Pro] The Node renderer now requires Node.js 20.19 or later: react-on-rails-pro-node-renderer
    raises engines.node from >=18.19.0 to >=20.19.0. Fresh installs already resolved Fastify 5
    dependencies that declare Node 20 or later, and the renderer already exited at startup on Node 18.
    The documented Node 18 workaround, overriding fastify to ^4.29.0, is no longer supported
    because Fastify 4 is affected by
    GHSA-p68q-wchp-6fh7.
    Action required for upgraders: run the Node renderer on Node.js 20.19 or later, and remove any
    fastify, @fastify/formbody, or @fastify/multipart overrides or resolutions that pin Fastify 4. On Node.js 20 with npm engine-strict, a fresh install can still reject
    cookie 2.x, which needs Node.js 22; the Node renderer docs show an override. A new weekly CI
    check fails when a fresh install resolves a package that rejects the advertised floor.
    #5317 by
    justin808. Part of
    #5305.

  • [Pro] React on Rails Pro adopts The ShakaStack License, version 1.0: ShakaStack Pro covers React on Rails Pro, ShakaPerf, and Inertia Rails SSR Cache for the whole organization with no size limit. React on Rails Pro remains free in development, test, CI, and staging when preparing an application before production. Releases before 17.3.0 keep the terms they shipped with.
    #5346 by
    sashakhar1.

  • [Pro] RSCRoute takes ref as a regular prop instead of forwardRef: The public
    <RSCRoute ref={…}> handle API and onRefetchError behavior are unchanged, and no minimum React
    version changes — the core package still supports React >= 16, and the RSC client path keeps its
    existing React 19 floor (now enforced: rendering <RSCRoute> on older React fails fast with a
    branded error naming the React >= 19 requirement and the version it found, instead of a cryptic
    use is not a function, and CI re-runs the RSC client suite against real pinned React installs —
    18.3.1 below the floor plus 19.0.x/19.1.x/19.2.x — with no mocks). useEffectEvent was deliberately not adopted to keep that floor. Calling
    useEffectEvent, useFormStatus, or useFormState in a server component without 'use client'
    now gets the branded missing-directive diagnostic. Implements
    #5030.
    #5031 by
    AbanoubGhadban.

Fixed

  • [Pro] TanStack Router loader errors now hydrate consistently after JSON transport. Production SSR and hydration use a generic error message, omitting private error details. Development preserves names, messages, and stacks, and warns about non-JSON loader data such as Date values.
    #5340 by justin808.

  • [Pro] Every published Pro JavaScript file carries the Pro license header: The compiled
    registerServerComponent/client.js and registerServerComponent/server.js in react-on-rails-pro shipped
    without the header because TypeScript dropped it with an unused import. CI now packs both Pro npm packages and
    fails if any packed .js file lacks the header. Fixes #5308.
    #5316 by justin808.

  • [Pro] Production refetch recovery handles streamed boundary errors. HTTP 200 Flight
    responses whose root resolves before a descendant fails now restore the previous route content,
    report refetchError and onRefetchError, and keep Retry available. Restoring content can remount
    descendant client components and reset their local state. Incomplete records are classified as failed
    streams and restore prior content even when the decoded root never throws. Scalar return values stay
    unchanged. Initial-load
    render failures still propagate to the outer error boundary. Fixes
    #5078.
    #5135 by
    Justin Gordon.

  • Server rendering works when Bun is installed: ExecJS 2.9+ picks Bun ahead of Node.js, and Bun fails to
    evaluate some server bundles ("Expected CommonJS module to have a function wrapper"), so a freshly generated
    --standard app returned HTTP 500 on its server-rendered page. When ExecJS autodetects Bun and Node.js is
    installed, React on Rails now renders with Node.js. ExecJS.runtime itself is unchanged for other ExecJS users,
    and an explicit EXECJS_RUNTIME still wins; set EXECJS_RUNTIME=Bun to force Bun (assigning
    ExecJS.runtime in Ruby code is treated like autodetection). react_on_rails:doctor reports the runtime server
    rendering uses and warns when it is Bun. Pro apps that render through the Node Renderer change only on their ExecJS
    fallback path.
    Fixes #5288.
    #5319 by justin808.

  • [Pro] TanStack Router SSR now passes dehydrate output to hydrate: react-on-rails-pro/tanstack-router
    now calls the router's dehydrate option once on the server after router.load(), and passes its result to the
    hydrate option on the client. Previously the helper probed a router.dehydrate() method that TanStack Router
    does not have, so hydrate always received undefined and a TanStack Query cache or other external state never
    reached the client. The value travels as JSON, so Date, Error, and Map values lose their types. The helper
    no longer calls custom router.dehydrate() or router.hydrate() methods.
    Fixes #5126.
    #5312 by justin808.

  • npm packages no longer ship sourceMappingURL pointers to missing .map files: The published
    create-react-on-rails-app and react-on-rails-pro-node-renderer .js and .d.ts files, and the .d.ts files in
    react-on-rails and react-on-rails-pro, ended with //# sourceMappingURL= comments for maps the packages never
    shipped. node --enable-source-maps, debuggers, and error trackers that followed them looked for a file that
    isn't there. The packages' tsc builds no longer emit source or declaration maps, and CI now packs all four
    packages and fails on any dangling pointer. Fixes #5307.
    #5321 by justin808.

  • bin/dev pack generation keeps variables that bin/dev sets after Bundler loads: The
    react_on_rails:generate_packs child now receives every variable that changed since Bundler
    loaded, and loses any that were deleted. Bundler's own variables stay out, so the child still
    runs unbundled. Previously Bundler.with_unbundled_env reset the child to Bundler's startup
    snapshot. An initializer that needed a variable set after require "bundler/setup", or under
    bundle exec bin/dev, then failed at "Generating packs". Fixes
    #5297.
    #5320 by
    justin808.

  • Components inside a Turbo Frame now mount after a frame navigation: With turbo: true, the react-on-rails
    package now handles turbo:frame-render. It unmounts the components the frame render removed and mounts the ones
    in the new frame content. Components outside the frame stay mounted.
    Previously the open-source package never mounted frame content loaded by navigation and leaked the
    replaced frame's React roots. Fixes #5128.
    #5220 by justin808.

  • [Pro] Turbo Frame navigation releases the replaced frame's React roots: With turbo: true, the
    react-on-rails-pro package now handles turbo:frame-render and unmounts the components the frame render removed.
    Components outside the frame stay mounted, and the new frame content still mounts through each component's inline
    script. Previously the replaced roots stayed mounted until the next full Turbo page visit.
    Fixes #5128.
    #5227 by justin808.

  • A failed load of react-dom/client is reported instead of swallowed: With React 18 or later, when
    react-dom/client exists but one of its own dependencies fails to load, React on Rails now rethrows that
    error when the bundle loads. Previously it was discarded and surfaced later as
    reactDomClient.hydrateRoot is not a function, or not at all in a server bundle. React 16 and 17 apps are
    unaffected: a missing react-dom/client still falls back to react-dom. The optional-module behavior
    is preserved with webpack and Rspack.
    RSC bundles avoid the client-only import. Action required for upgraders: if a server bundle now
    fails to load, restore or bundle the missing dependency named in the original error.
    Fixes #5180.
    #5181 by justin808.

  • [Pro] Generated Pro apps ignore the Node renderer bundle cache: react_on_rails:install --pro and --rsc,
    including the default Pro and --rsc setups of create-react-on-rails-app, now add .node-renderer-bundles and its preseed lock/snapshot siblings to
    .gitignore, so the server bundles that the generated renderer/node-renderer.js caches there stay out of commits.
    #5182 by justin808.

  • Doctor recognizes more static watcher commands: With a shared output path and a dev-server Procfile.dev,
    rake react_on_rails:doctor exited 1 reporting Procfile.dev-static-assets missing unless that file contained the
    exact text bin/shakapacker --watch. It now accepts --watch or -w on bin/shakapacker or the generated
    bin/shakapacker-watch, and ignores commented-out commands.
    #5304 by justin808.

  • Single render results reject incomplete trailing records: Server rendering now raises
    ReactOnRails::JsonParseError when a complete result is followed by a partial length-prefixed record, instead
    of silently discarding the remainder.
    Valid producer responses and warning-only streaming flush behavior are unchanged.
    #5206 by justin808.

  • [Pro] Streams reject non-object metadata: The TypeScript length-prefixed parser now rejects JSON
    null, arrays, and scalar metadata before yielding a chunk, matching Ruby's existing object requirement.
    Valid object metadata, control frames, and blank or CRLF separators retain their behavior.
    #5206 by justin808.