Skip to content

Releases: shakacode/react_on_rails

v16.6.0

09 Apr 22:46

Choose a tag to compare

Removed

  • Removed immediate_hydration configuration and parameter: The immediate_hydration config option, helper parameter, data-immediate-hydration HTML attribute, and redux_store immediate_hydration: keyword argument have been completely removed. Immediate hydration is now always enabled for React on Rails Pro users and disabled for non-Pro users, with no per-component override. Remove any immediate_hydration references from your initializer and helper calls. Passing immediate_hydration: to react_component / react_component_hash is now ignored, and passing it to stream_react_component logs a warning. This change also fixes HTML attribute escaping for redux store names to prevent attribute injection from unsafe store keys. Closes Issue 2142.
    PR 2834 by
    justin808.

Added

  • [Pro] Auto-resolve renderer password from ENV: setup_renderer_password now falls back to ENV["RENDERER_PASSWORD"] when neither config.renderer_password nor a URL-embedded password is set, aligning Rails-side behavior with the Node Renderer defaults. Blank values (nil or "") are treated identically and fall through the full resolution chain: config → URL → ENV. PR 2921 by justin808.
  • Interactive mode prompt for create-react-on-rails-app: Running npx create-react-on-rails-app without --pro or --rsc now shows an interactive prompt to choose between Standard, Pro, and RSC modes (default: RSC recommended). Explicit flags skip the prompt, and non-interactive environments fall back to standard mode automatically. PR 3063 by justin808.
  • [Pro] Configurable HTTP keep-alive timeout for node renderer connections: Added renderer_http_keep_alive_timeout configuration option (default: 30s) to control how long idle persistent HTTP/2 connections to the node renderer are kept alive, preventing SSR failures from stale connections. PR 3069 by justin808.
  • [Pro] react_on_rails:pro now automates Pro and RSC Pro upgrades: Added first-class --rsc-pro install mode, automatic react_on_rails -> react_on_rails_pro Gemfile and package swaps, and frontend import rewrites to streamline existing app upgrades. PR 2822 by justin808.

Improved

  • [Pro] Clearer node renderer request context in exception messages: Exception formatting now uses a generic Request: label instead of render-specific wording, so /upload-assets failures and other non-render paths report the actual request context more clearly. PR 2877 by AbanoubGhadban.
  • [Pro] Cleaner node renderer diagnostic output: Invalid render-request diagnostics no longer redundantly list renderingRequest in the bodyKeys output since it is already reported via the Received type: line, and renderer_http_keep_alive_timeout documentation now recommends setting it shorter than the node renderer's server-side idle timeout. PR 3086 by justin808.
  • Doctor enforces strict version constraints: react_on_rails:doctor now escalates non-exact gem and npm version specs (^, ~, >=) from warnings to errors, matching the runtime VersionChecker behavior. Wildcard checks now also cover Pro packages (react-on-rails-pro, react_on_rails_pro). PR 3070 by justin808.
  • Error messages recommend doctor: Runtime version-check crashes, configuration validation errors, and autobundling errors now suggest running bundle exec rake react_on_rails:doctor for diagnostics and bundle exec rake react_on_rails:sync_versions WRITE=true to fix version mismatches. PR 3070 by justin808.
  • sync_versions handles range specs: Version ranges like ^16.5.0, ~16.5.0, and >=16.5.0 are now parsed and rewritten to the exact expected version instead of being skipped as unsupported. When FIX=true is set, doctor auto-runs sync_versions to fix detected mismatches. PR 3070 by justin808.
  • [Pro] Improved node renderer error messages for malformed render requests: Added early validation for missing or invalid renderingRequest payloads on the render endpoint, returning actionable 400 messages that include received type, body keys, and likely causes (truncation, malformed multipart, content-length mismatch). PR 3068 by justin808.
  • react_on_rails:doctor now prefers runtime configuration: Doctor now reads loaded ReactOnRails.configuration values before falling back to initializer parsing, improving diagnostics for customized SSR and NodeRenderer setups. PR 2823 by justin808.
  • Fresh app onboarding for create-react-on-rails-app: New apps now land on a generated root page with links to the local demos, docs, OSS vs Pro guidance, the Pro quick start, and the marketplace RSC demo. bin/dev opens that page on first boot, --rsc scaffolds the same fresh-app experience, and the generated app records step-by-step educational git commits for each scaffold phase. PR 2849 by justin808.

Fixed

  • Pin third-party npm dependency versions in generator: All third-party npm dependencies installed by the react_on_rails:install generator and bin/switch-bundler are now pinned to ^major.0.0 version ranges, preventing peer dependency conflicts from uncontrolled major version bumps. Fixes CI breakage caused by @rspack/plugin-react-refresh@2.0.0 requiring @rspack/core@^2.0.0-0 while @rspack/core latest was still 1.7.11. SWC dependency pins match Shakapacker's own version constraints. Closes Issue 3082. PR 3083 by ihabadham.
  • [Pro] Fixed TanStack Router SSR hydration mismatches in the async path: Client hydration now restores server match data before first render, uses RouterProvider directly to match the server-rendered tree, and stops the post-hydration load when a custom router.options.hydrate callback fails instead of continuing with partially hydrated client state. PR 2932 by justin808.
  • [Pro] Fixed infinite fork loop when node renderer worker fails to bind port: When a worker failed during app.listen() (e.g., EADDRINUSE), the master previously reforked unconditionally, causing an infinite fork/crash loop that consumed CPU and filled logs. Workers now send a WORKER_STARTUP_FAILURE IPC message to the master before exiting; the master sets an abort flag and exits with a clear error message instead of reforking. Scheduled restarts and runtime crashes continue to refork as before. PR 2881 by justin808.
  • [Pro] Fixed Pro generator multiline and template-literal rewrites: The Pro install generator now correctly handles multiline non-parenthesized gem "react_on_rails" declarations while preserving trailing options, and correctly rewrites module specifiers around template literals by preserving escaped sequences and detecting multiline template-literal starts after a closed inline template. PR 2918 by justin808.
  • [Pro] Fixed SSR failures from stale persistent HTTP/2 connections to the node renderer: When idle connections became stale (closed by the node renderer but still considered active by the Ruby side), render requests could be truncated mid-flight, producing confusing FST_ERR_CTP_INVALID_CONTENT_LENGTH and "INVALID NIL or NULL result for rendering" errors. The new renderer_http_keep_alive_timeout config (default: 30s) prevents this by closing idle connections before they go stale. Content-Length mismatches now produce specific diagnostic messages instead of generic errors, and sensitive field names are filtered from diagnostic output. Fixes Issue 3071. PR 3069 by justin808.
  • Legacy Shakapacker migrations are more resilient: react_on_rails:install now falls back cleanly when the package_json gem is unavailable, installs only missing JS packages through the detected package manager, and auto-switches legacy JSX-in-.js apps to Babel when needed. PR 2901 by justin808.
  • New-app root-route generation is more robust: Generator root-route detection is now centralized, duplicate route insertion is avoided, and home-page generation warns instead of failing when config/routes.rb is missing or unexpected. PR 2891 by justin808.
  • **`...
Read more

v16.6.0.rc.1

08 Apr 08:28

Choose a tag to compare

v16.6.0.rc.1 Pre-release
Pre-release

Removed

  • Removed immediate_hydration configuration and parameter: The immediate_hydration config option, helper parameter, data-immediate-hydration HTML attribute, and redux_store immediate_hydration: keyword argument have been completely removed. Immediate hydration is now always enabled for React on Rails Pro users and disabled for non-Pro users, with no per-component override. Remove any immediate_hydration references from your initializer and helper calls. Passing immediate_hydration: to react_component / react_component_hash is now ignored, and passing it to stream_react_component logs a warning. This change also fixes HTML attribute escaping for redux store names to prevent attribute injection from unsafe store keys. Closes Issue 2142.
    PR 2834 by
    justin808.

Added

  • [Pro] Auto-resolve renderer password from ENV: setup_renderer_password now falls back to ENV["RENDERER_PASSWORD"] when neither config.renderer_password nor a URL-embedded password is set, aligning Rails-side behavior with the Node Renderer defaults. Blank values (nil or "") are treated identically and fall through the full resolution chain: config → URL → ENV. PR 2921 by justin808.
  • Interactive mode prompt for create-react-on-rails-app: Running npx create-react-on-rails-app without --pro or --rsc now shows an interactive prompt to choose between Standard, Pro, and RSC modes (default: RSC recommended). Explicit flags skip the prompt, and non-interactive environments fall back to standard mode automatically. PR 3063 by justin808.
  • [Pro] Configurable HTTP keep-alive timeout for node renderer connections: Added renderer_http_keep_alive_timeout configuration option (default: 30s) to control how long idle persistent HTTP/2 connections to the node renderer are kept alive, preventing SSR failures from stale connections. PR 3069 by justin808.
  • [Pro] react_on_rails:pro now automates Pro and RSC Pro upgrades: Added first-class --rsc-pro install mode, automatic react_on_rails -> react_on_rails_pro Gemfile and package swaps, and frontend import rewrites to streamline existing app upgrades. PR 2822 by justin808.

Improved

  • Doctor enforces strict version constraints: react_on_rails:doctor now escalates non-exact gem and npm version specs (^, ~, >=) from warnings to errors, matching the runtime VersionChecker behavior. Wildcard checks now also cover Pro packages (react-on-rails-pro, react_on_rails_pro). PR 3070 by justin808.
  • Error messages recommend doctor: Runtime version-check crashes, configuration validation errors, and autobundling errors now suggest running bundle exec rake react_on_rails:doctor for diagnostics and bundle exec rake react_on_rails:sync_versions WRITE=true to fix version mismatches. PR 3070 by justin808.
  • sync_versions handles range specs: Version ranges like ^16.5.0, ~16.5.0, and >=16.5.0 are now parsed and rewritten to the exact expected version instead of being skipped as unsupported. When FIX=true is set, doctor auto-runs sync_versions to fix detected mismatches. PR 3070 by justin808.
  • [Pro] Improved node renderer error messages for malformed render requests: Added early validation for missing or invalid renderingRequest payloads on the render endpoint, returning actionable 400 messages that include received type, body keys, and likely causes (truncation, malformed multipart, content-length mismatch). PR 3068 by justin808.
  • react_on_rails:doctor now prefers runtime configuration: Doctor now reads loaded ReactOnRails.configuration values before falling back to initializer parsing, improving diagnostics for customized SSR and NodeRenderer setups. PR 2823 by justin808.
  • Fresh app onboarding for create-react-on-rails-app: New apps now land on a generated root page with links to the local demos, docs, OSS vs Pro guidance, the Pro quick start, and the marketplace RSC demo. bin/dev opens that page on first boot, --rsc scaffolds the same fresh-app experience, and the generated app records step-by-step educational git commits for each scaffold phase. PR 2849 by justin808.

Fixed

  • [Pro] Fixed TanStack Router SSR hydration mismatches in the async path: Client hydration now restores server match data before first render, uses RouterProvider directly to match the server-rendered tree, and stops the post-hydration load when a custom router.options.hydrate callback fails instead of continuing with partially hydrated client state. PR 2932 by justin808.
  • [Pro] Fixed infinite fork loop when node renderer worker fails to bind port: When a worker failed during app.listen() (e.g., EADDRINUSE), the master previously reforked unconditionally, causing an infinite fork/crash loop that consumed CPU and filled logs. Workers now send a WORKER_STARTUP_FAILURE IPC message to the master before exiting; the master sets an abort flag and exits with a clear error message instead of reforking. Scheduled restarts and runtime crashes continue to refork as before. PR 2881 by justin808.
  • [Pro] Fixed Pro generator multiline and template-literal rewrites: The Pro install generator now correctly handles multiline non-parenthesized gem "react_on_rails" declarations while preserving trailing options, and correctly rewrites module specifiers around template literals by preserving escaped sequences and detecting multiline template-literal starts after a closed inline template. PR 2918 by justin808.
  • [Pro] Fixed SSR failures from stale persistent HTTP/2 connections to the node renderer: When idle connections became stale (closed by the node renderer but still considered active by the Ruby side), render requests could be truncated mid-flight, producing confusing FST_ERR_CTP_INVALID_CONTENT_LENGTH and "INVALID NIL or NULL result for rendering" errors. The new renderer_http_keep_alive_timeout config (default: 30s) prevents this by closing idle connections before they go stale. Content-Length mismatches now produce specific diagnostic messages instead of generic errors, and sensitive field names are filtered from diagnostic output. Fixes Issue 3071. PR 3069 by justin808.
  • Legacy Shakapacker migrations are more resilient: react_on_rails:install now falls back cleanly when the package_json gem is unavailable, installs only missing JS packages through the detected package manager, and auto-switches legacy JSX-in-.js apps to Babel when needed. PR 2901 by justin808.
  • New-app root-route generation is more robust: Generator root-route detection is now centralized, duplicate route insertion is avoided, and home-page generation warns instead of failing when config/routes.rb is missing or unexpected. PR 2891 by justin808.
  • bin/dev now exits quietly on Ctrl-C: The process manager and generated Shakapacker watcher wrapper now treat interrupt-driven shutdown as a clean exit, avoiding Ruby backtraces during local development. PR 2652 by justin808.
  • bin/dev browser auto-open now waits for route readiness: --open-browser and --open-browser-once now poll the target app route and open the browser only after receiving a success or redirect response, reducing premature opens during boot. PR 2885 by justin808.

v16.6.0.rc.0

02 Apr 09:11

Choose a tag to compare

v16.6.0.rc.0 Pre-release
Pre-release

Added

  • [Pro] react_on_rails:pro now automates Pro and RSC Pro upgrades: Added first-class --rsc-pro install mode, automatic react_on_rails -> react_on_rails_pro Gemfile and package swaps, and frontend import rewrites to streamline existing app upgrades. PR 2822 by justin808.

Improved

  • react_on_rails:doctor now prefers runtime configuration: Doctor now reads loaded ReactOnRails.configuration values before falling back to initializer parsing, improving diagnostics for customized SSR and NodeRenderer setups. PR 2823 by justin808.
  • Fresh app onboarding for create-react-on-rails-app: New apps now land on a generated root page with links to the local demos, docs, OSS vs Pro guidance, the Pro quick start, and the marketplace RSC demo. bin/dev opens that page on first boot, --rsc scaffolds the same fresh-app experience, and the generated app records step-by-step educational git commits for each scaffold phase. PR 2849 by justin808.

Fixed

  • Legacy Shakapacker migrations are more resilient: react_on_rails:install now falls back cleanly when the package_json gem is unavailable, installs only missing JS packages through the detected package manager, and auto-switches legacy JSX-in-.js apps to Babel when needed. PR 2901 by justin808.
  • New-app root-route generation is more robust: Generator root-route detection is now centralized, duplicate route insertion is avoided, and home-page generation warns instead of failing when config/routes.rb is missing or unexpected. PR 2891 by justin808.
  • bin/dev now exits quietly on Ctrl-C: The process manager and generated Shakapacker watcher wrapper now treat interrupt-driven shutdown as a clean exit, avoiding Ruby backtraces during local development. PR 2652 by justin808.
  • bin/dev browser auto-open now waits for route readiness: --open-browser and --open-browser-once now poll the target app route and open the browser only after receiving a success or redirect response, reducing premature opens during boot. PR 2885 by justin808.

v16.5.1

28 Mar 08:00

Choose a tag to compare

Fixed

  • [Pro] Fixed missing rake tasks in published gem: The Pro gemspec excluded lib/tasks/ from packaged files, so all react_on_rails_pro:* rake tasks (verify_license, pre_stage_bundle_for_node_renderer, copy_assets_to_remote_vm_renderer, process_v8_logs) were unavailable after gem install. PR 2872 by justin808.
  • [Pro] Fixed bundle duplication in remote node renderer asset uploads: When RSC support is enabled, running rake react_on_rails_pro:copy_assets_to_remote_vm_renderer no longer duplicates bundle JS files across bundle directories. Previously, both the server bundle and RSC bundle were copied into every target directory; now each bundle is placed only in its own directory while shared assets (manifests, stats) are correctly distributed to all. PR 2768 by AbanoubGhadban. Fixes Issue 2766.

v16.4.0

17 Mar 01:47

Choose a tag to compare

Fixed

  • Install generator now handles TypeScript and rspack bundler configs correctly: Projects using Shakapacker 9.4+ with TypeScript configs (.ts) were incorrectly prompted to confirm config replacement during rails generate react_on_rails:install, because the installer didn't recognize the ESM-style stock configs. The installer and react_on_rails:doctor now detect all config variants (webpack/rspack, JS/TS), use the correct replacement template for each, and show accurate bundler-specific diagnostic messages. PR 2567 by AbanoubGhadban.
  • Show incomplete install message after Shakapacker failure: The react_on_rails:install generator now tracks when automatic Shakapacker setup fails and emits an explicit "installation incomplete" warning with manual recovery steps, instead of the misleading "Successfully Installed" banner. PR 2613 by justin808. Fixes Issue 2600.
  • Ruby 3.4 compatibility for heredocs: Replaced legacy strip_heredoc usage with native squiggly heredocs (<<~) and removed redundant chaining where indentation is already normalized by Ruby. PR 2599 by justin808.
  • Fix install generator load path for ReactOnRails::GitUtils: Added an explicit require "react_on_rails/git_utils" so generator execution does not rely on broader app boot side effects for this constant to be available. PR 2599 by justin808.
  • server_render_js now handles non-Error throws safely: Defensive error serialization now supports thrown primitives and null values without raising secondary TypeError exceptions while building SSR error payloads. PR 2599 by justin808.
  • Clean stale webpack config on --rspack install: Running rails g react_on_rails:install --rspack now removes leftover config/webpack/ files when switching from webpack to rspack, preventing Shakapacker deprecation warnings. Only known stock/generated webpack configs are removed; custom files are preserved with a warning. PR 2597 by justin808. Fixes Issue 2549.
  • Fixed bin/setup failing on pnpm workspace member directories: bin/setup now checks for the presence of pnpm-lock.yaml before running pnpm install --frozen-lockfile, preventing failures in workspace member directories (e.g., spec/dummy) where dependencies are managed by the workspace root. PR 2477 by justin808.
  • CSS module SSR fixes for rspack: Fixed CSS module class name divergence between client and server bundles when using rspack. Server webpack config now filters rspack's cssExtractLoader in addition to mini-css-extract-plugin, uses spread syntax to preserve existing CSS module options when setting exportOnlyLocals: true, and adds null guards against undefined entries in rule.use arrays. Note: exportOnlyLocals: true is no longer applied when cssLoader.options.modules is falsy (disabled), which is the correct behavior but a change from prior versions. PR 2489 by justin808.
  • Fixed private_output_path not configured on fresh Shakapacker installs: When running rails g react_on_rails:install without pre-existing Shakapacker configuration, private_output_path: ssr-generated was left commented out in the generated config/shakapacker.yml. The generator now detects whether Shakapacker was just installed and passes a shakapacker_just_installed flag to BaseGenerator, which uses force: true when copying the config template to ensure the RoR version replaces Shakapacker's default. PR 2411 by ihabadham.
  • Install generator --pretend now behaves as a safe dry run: react_on_rails:install previously executed real Shakapacker setup commands (bundle add, bundle install, and rails shakapacker:install) and could crash on File.chmod because Thor pretend mode does not create files. --pretend now skips automatic Shakapacker installation and raw chmod calls so dry-run previews complete without side effects. PR 2536 by justin808.
  • Generator test defaults now consistently use build_test_command + TestHelper, with Minitest support: Fresh installs now enable config.build_test_command and wire React on Rails TestHelper for RSpec and Minitest, while generated config/shakapacker.yml sets test compile: false to avoid mixed compilation strategies by default. Doctor now validates helper wiring per framework (including mixed RSpec+Minitest apps), detects separate vs shared test/development output-path workflows, and supports FIX=true auto-fixes for the recommended setup path. Added bin/dev test-watch with auto|full|client-only modes so test watching is easier to run consistently. bin/dev help and testing docs now explicitly document both the recommended separate-output workflow and the advanced static-only shared-output workflow, including migration from manual watcher commands. PR 2513 by justin808.
  • bin/dev hook script path resolution without Rails.root: Fixed resolve_hook_script_path failing in early startup (before Rails is initialized) by adding a project_root helper that resolves the project root via BUNDLE_GEMFILE dirname or Dir.pwd when Rails.root is unavailable. PR 2568 by ihabadham. Fixes Issue 2438.
  • Rspack generator config path: Fixed --rspack generator placing config files under config/webpack/ instead of config/rspack/, causing Shakapacker deprecation warnings. All config file destinations are now dynamically remapped based on the active bundler, and using_rspack? auto-detects rspack projects for standalone generators (react_on_rails:rsc, react_on_rails:pro). PR 2417 by justin808.
  • Precompile hook load-based execution path: Fixed the precompile hook not executing its tasks when invoked via load (as used by bin/dev) instead of direct script execution. Added a shared run_precompile_tasks entry point that works regardless of invocation method. PR 2419 by justin808. Fixes Issue 2195.
  • create-react-on-rails-app validation improvements: Tightened CLI validation to enforce Rails 7+ and app-name leading-letter requirements, with clearer error messages for invalid names containing hyphens or underscores. PR 2577 by justin808.
  • Install @babel/preset-react for non-SWC generator installs: The generator now installs @babel/preset-react as a dev dependency when the project uses Babel (not SWC) as the transpiler, fixing JSX compilation errors on fresh installs with older Shakapacker defaults. PR 2421 by justin808.
  • Fix react_on_rails:doctor false positives for Pro/SWC setups: Doctor now recognizes react-on-rails-pro npm package for presence and version sync checks, skips @babel/preset-react check when SWC is the transpiler, and fixes a nil-safety bug where missing "dependencies" in package.json silently dropped devDependencies from checks. PR 2581 by ihabadham.
  • Fixed ScoutApm instrumentation depending on Gemfile ordering. ScoutApm instrumentation for react_component, react_component_hash, and exec_server_render_js was previously installed at gem load time using defined?(ScoutApm) guards, which meant it was silently skipped if scout_apm appeared after react_on_rails in the Gemfile, and produced noisy INFO log messages if it appeared before (since ScoutApm wasn't yet initialized). Moved instrumentation into an initializer that runs after scout_apm.start, ensuring it works regardless of gem ordering and only after ScoutApm is fully configured. PR 2442 by tonyta.
  • RSC WebpackLoader with SWC transpiler: Fixed RSC WebpackLoader never being injected when using SWC (Shakapacker's default transpiler). The RSC config only handled array-based rule.use (Babel) but SWC uses a function-based rule.use, so 'use client' files passed through untransformed into the RSC bundle. Now handles both array and function loader declarations. PR 2476 by AbanoubGhadban.
  • RSC Generator Layout Wiring: Fixed MissingEntryError on fresh RSC installs where HelloServerController fell back to Rails' application.html.erb (which uses javascript_pack_tag "application" that is not created by the RSC flow). The generator now alw...
Read more

v16.4.0.rc.10

16 Mar 01:48

Choose a tag to compare

v16.4.0.rc.10 Pre-release
Pre-release

Fixed

  • Show incomplete install message after Shakapacker failure: The react_on_rails:install generator now tracks when automatic Shakapacker setup fails and emits an explicit "installation incomplete" warning with manual recovery steps, instead of the misleading "Successfully Installed" banner. PR 2613 by justin808. Fixes Issue 2600.
  • Ruby 3.4 compatibility for heredocs: Replaced legacy strip_heredoc usage with native squiggly heredocs (<<~) and removed redundant chaining where indentation is already normalized by Ruby. PR 2599 by justin808.
  • Fix install generator load path for ReactOnRails::GitUtils: Added an explicit require "react_on_rails/git_utils" so generator execution does not rely on broader app boot side effects for this constant to be available. PR 2599 by justin808.
  • server_render_js now handles non-Error throws safely: Defensive error serialization now supports thrown primitives and null values without raising secondary TypeError exceptions while building SSR error payloads. PR 2599 by justin808.
  • Clean stale webpack config on --rspack install: Running rails g react_on_rails:install --rspack now removes leftover config/webpack/ files when switching from webpack to rspack, preventing Shakapacker deprecation warnings. Only known stock/generated webpack configs are removed; custom files are preserved with a warning. PR 2597 by justin808. Fixes Issue 2549.
  • Fixed bin/setup failing on pnpm workspace member directories: bin/setup now checks for the presence of pnpm-lock.yaml before running pnpm install --frozen-lockfile, preventing failures in workspace member directories (e.g., spec/dummy) where dependencies are managed by the workspace root. PR 2477 by justin808.
  • CSS module SSR fixes for rspack: Fixed CSS module class name divergence between client and server bundles when using rspack. Server webpack config now filters rspack's cssExtractLoader in addition to mini-css-extract-plugin, uses spread syntax to preserve existing CSS module options when setting exportOnlyLocals: true, and adds null guards against undefined entries in rule.use arrays. Note: exportOnlyLocals: true is no longer applied when cssLoader.options.modules is falsy (disabled), which is the correct behavior but a change from prior versions. PR 2489 by justin808.
  • Fixed private_output_path not configured on fresh Shakapacker installs: When running rails g react_on_rails:install without pre-existing Shakapacker configuration, private_output_path: ssr-generated was left commented out in the generated config/shakapacker.yml. The generator now detects whether Shakapacker was just installed and passes a shakapacker_just_installed flag to BaseGenerator, which uses force: true when copying the config template to ensure the RoR version replaces Shakapacker's default. PR 2411 by ihabadham.
  • Install generator --pretend now behaves as a safe dry run: react_on_rails:install previously executed real Shakapacker setup commands (bundle add, bundle install, and rails shakapacker:install) and could crash on File.chmod because Thor pretend mode does not create files. --pretend now skips automatic Shakapacker installation and raw chmod calls so dry-run previews complete without side effects. PR 2536 by justin808.
  • Generator test defaults now consistently use build_test_command + TestHelper, with Minitest support: Fresh installs now enable config.build_test_command and wire React on Rails TestHelper for RSpec and Minitest, while generated config/shakapacker.yml sets test compile: false to avoid mixed compilation strategies by default. Doctor now validates helper wiring per framework (including mixed RSpec+Minitest apps), detects separate vs shared test/development output-path workflows, and supports FIX=true auto-fixes for the recommended setup path. Added bin/dev test-watch with auto|full|client-only modes so test watching is easier to run consistently. bin/dev help and testing docs now explicitly document both the recommended separate-output workflow and the advanced static-only shared-output workflow, including migration from manual watcher commands. PR 2513 by justin808.
  • bin/dev hook script path resolution without Rails.root: Fixed resolve_hook_script_path failing in early startup (before Rails is initialized) by adding a project_root helper that resolves the project root via BUNDLE_GEMFILE dirname or Dir.pwd when Rails.root is unavailable. PR 2568 by ihabadham. Fixes Issue 2438.
  • Rspack generator config path: Fixed --rspack generator placing config files under config/webpack/ instead of config/rspack/, causing Shakapacker deprecation warnings. All config file destinations are now dynamically remapped based on the active bundler, and using_rspack? auto-detects rspack projects for standalone generators (react_on_rails:rsc, react_on_rails:pro). PR 2417 by justin808.
  • Precompile hook load-based execution path: Fixed the precompile hook not executing its tasks when invoked via load (as used by bin/dev) instead of direct script execution. Added a shared run_precompile_tasks entry point that works regardless of invocation method. PR 2419 by justin808. Fixes Issue 2195.
  • create-react-on-rails-app validation improvements: Tightened CLI validation to enforce Rails 7+ and app-name leading-letter requirements, with clearer error messages for invalid names containing hyphens or underscores. PR 2577 by justin808.
  • Install @babel/preset-react for non-SWC generator installs: The generator now installs @babel/preset-react as a dev dependency when the project uses Babel (not SWC) as the transpiler, fixing JSX compilation errors on fresh installs with older Shakapacker defaults. PR 2421 by justin808.
  • Fix react_on_rails:doctor false positives for Pro/SWC setups: Doctor now recognizes react-on-rails-pro npm package for presence and version sync checks, skips @babel/preset-react check when SWC is the transpiler, and fixes a nil-safety bug where missing "dependencies" in package.json silently dropped devDependencies from checks. PR 2581 by ihabadham.
  • Fixed ScoutApm instrumentation depending on Gemfile ordering. ScoutApm instrumentation for react_component, react_component_hash, and exec_server_render_js was previously installed at gem load time using defined?(ScoutApm) guards, which meant it was silently skipped if scout_apm appeared after react_on_rails in the Gemfile, and produced noisy INFO log messages if it appeared before (since ScoutApm wasn't yet initialized). Moved instrumentation into an initializer that runs after scout_apm.start, ensuring it works regardless of gem ordering and only after ScoutApm is fully configured. PR 2442 by tonyta.
  • RSC WebpackLoader with SWC transpiler: Fixed RSC WebpackLoader never being injected when using SWC (Shakapacker's default transpiler). The RSC config only handled array-based rule.use (Babel) but SWC uses a function-based rule.use, so 'use client' files passed through untransformed into the RSC bundle. Now handles both array and function loader declarations. PR 2476 by AbanoubGhadban.
  • RSC Generator Layout Wiring: Fixed MissingEntryError on fresh RSC installs where HelloServerController fell back to Rails' application.html.erb (which uses javascript_pack_tag "application" that is not created by the RSC flow). The generator now always copies hello_world.html.erb, HelloServerController explicitly uses layout "hello_world", and post-install output now shows stream_react_component for RSC installs. PR 2429 by justin808.
  • Fixed string values interpolated into generated JS code without proper escaping. All string values (component names, DOM IDs, Redux store names) embedded in server-rendering JavaScript now use .to_json instead of unescaped single-quoted interpolation, preventing potential JS breakage from special characters. [PR 2440](https://github.com/shakacode...
Read more

v16.4.0.rc.9

13 Mar 09:31

Choose a tag to compare

v16.4.0.rc.9 Pre-release
Pre-release

Improved

  • Auto-install react_on_rails_pro gem for --rsc/--pro generator flags: Running rails g react_on_rails:install --rsc or --pro now automatically installs the react_on_rails_pro gem via bundle add instead of only printing an error, matching how Shakapacker is handled in the same generator. PR 2439 by justin808.
  • create-react-on-rails-app validation and test coverage: Tightened app name validation (must start with a letter), added Rails 7.0+ prerequisite validation, and expanded validator/setup test coverage (including validateAll success path). PR 2571 by justin808.

Fixed

  • Fixed bin/setup failing on pnpm workspace member directories: bin/setup now checks for the presence of pnpm-lock.yaml before running pnpm install --frozen-lockfile, preventing failures in workspace member directories (e.g., spec/dummy) where dependencies are managed by the workspace root. PR 2477 by justin808.

Changed

  • Clarified Pro-installation signaling for immediate hydration warnings: Updated Ruby/TypeScript warning text and related docs to state that railsContext.rorPro indicates Pro gem installation (not license validity), and renamed immediate_hydration_pro_license_warning to immediate_hydration_pro_install_warning (no backward-compatible alias needed since the method had no external callers). PR 2590 by justin808.

Pro

Added
  • Startup warning for unsafe compression middleware callbacks: Added a startup guard that detects Rack::Deflater or Rack::Brotli middleware with :if callbacks that iterate the response body via body.each, which can break streaming SSR/RSC and deadlock ActionController::Live. The warning includes the middleware source location and remediation guidance. PR 2554 by justin808.
  • Configurable host binding for Node Renderer Fastify worker: Added a host setting (default: process.env.RENDERER_HOST || 'localhost') to control the bind address for the Pro Node Renderer. Set it to 0.0.0.0 in containerized environments where external health checks need to reach the renderer. PR 2585 by justin808.

Changes since the last non-beta release.

Added

  • Automatic dev asset reuse for tests: When bin/dev static is running, bundle exec rspec (and Minitest) now automatically detects and reuses the fresh development assets instead of running a separate build_test_command. The TestHelper reads config/shakapacker.yml, verifies the dev manifest is static-mode (not HMR) and fresh, then temporarily overrides Shakapacker's test config to point at the dev output. No environment variables or extra commands needed — tests "just work" with bin/dev static. HMR mode (bin/dev) continues to require separate test compilation via build_test_command or bin/dev test-watch. PR 2570 by justin808.
  • TanStack Router SSR integration (Pro): Added createTanStackRouterRenderFunction and serverRenderTanStackAppAsync via react-on-rails-pro/tanstack-router for TanStack Router SSR with the Pro Node Renderer. Uses TanStack Router's public router.load() API for reliable async SSR. Requires rendering_returns_promises = true in Pro config. PR 2516 by justin808.
  • create-react-on-rails-app --rsc flow: Added --rsc support to npx create-react-on-rails-app so a single command can scaffold an RSC-ready app. The CLI now installs react_on_rails_pro, passes --rsc to react_on_rails:install, and points users to /hello_server after setup. PR 2430 by justin808.
  • Environment-variable-driven ports in Procfile templates: Procfile templates now use ${PORT:-3000} and ${SHAKAPACKER_DEV_SERVER_PORT:-3035} instead of hardcoded ports, enabling multiple worktrees to run bin/dev concurrently without port conflicts. Includes a PortSelector that auto-detects free ports when defaults are occupied, plus a generated .env.example documenting manual overrides. PR 2539 by ihabadham.
  • CSP nonce support for RSC streaming and console replay scripts: Added cspNonce to rails_context and threaded nonce values through Pro RSC streaming paths (server-side HTML stream injection and client-side console replay script insertion), with nonce sanitization. PR 2418 by justin808.

Fixed

  • CSS module SSR fixes for rspack: Fixed CSS module class name divergence between client and server bundles when using rspack. Server webpack config now filters rspack's cssExtractLoader in addition to mini-css-extract-plugin, uses spread syntax to preserve existing CSS module options when setting exportOnlyLocals: true, and adds null guards against undefined entries in rule.use arrays. Note: exportOnlyLocals: true is no longer applied when cssLoader.options.modules is falsy (disabled), which is the correct behavior but a change from prior versions. PR 2489 by justin808.
  • Fixed private_output_path not configured on fresh Shakapacker installs: When running rails g react_on_rails:install without pre-existing Shakapacker configuration, private_output_path: ssr-generated was left commented out in the generated config/shakapacker.yml. The generator now detects whether Shakapacker was just installed and passes a shakapacker_just_installed flag to BaseGenerator, which uses force: true when copying the config template to ensure the RoR version replaces Shakapacker's default. PR 2411 by ihabadham.
  • Install generator --pretend now behaves as a safe dry run: react_on_rails:install previously executed real Shakapacker setup commands (bundle add, bundle install, and rails shakapacker:install) and could crash on File.chmod because Thor pretend mode does not create files. --pretend now skips automatic Shakapacker installation and raw chmod calls so dry-run previews complete without side effects. PR 2536 by justin808.
  • Generator test defaults now consistently use build_test_command + TestHelper, with Minitest support: Fresh installs now enable config.build_test_command and wire React on Rails TestHelper for RSpec and Minitest, while generated config/shakapacker.yml sets test compile: false to avoid mixed compilation strategies by default. Doctor now validates helper wiring per framework (including mixed RSpec+Minitest apps), detects separate vs shared test/development output-path workflows, and supports FIX=true auto-fixes for the recommended setup path. Added bin/dev test-watch with auto|full|client-only modes so test watching is easier to run consistently. bin/dev help and testing docs now explicitly document both the recommended separate-output workflow and the advanced static-only shared-output workflow, including migration from manual watcher commands. PR 2513 by justin808.

Pro

Fixed
  • Fix streaming deadlock, exception masking, and cache poisoning on client disconnect: Fixed async streaming bugs where client disconnect could cause deadlocks, mask producer exceptions, or cache partial results. PR 2562 by AbanoubGhadban.
  • Handle HTTPX error responses when fetching dev-server bundle/assets for upload: During development startup races, get_form_body_for_file could receive HTTPX::ErrorResponse and still call response.body, causing an unexpected crash path. The request layer now raises ReactOnRailsPro::Error with HTTPX error details before body access and includes regression tests for local path, HTTP success, and HTTP error cases. PR 2532 by justin808.
  • Fix streaming SSR hangs and silent error absorption in RSC payload injection: Fixed two related issues: (1) streaming SSR renders hanging forever when errors occur because Node.js stream.pipe() doesn't propagate errors or closure from source to destination, and (2) errors in the RSC payload injection pipeline being silently absorbed, preventing them from reaching error reporters like Sentry. Introduced a shared safePipe utility and used 'close' events as reliable termination signals across the streaming pipeline (Node renderer, RSC payload injection, transform streams, and Ruby async task). Also added a Ruby safety net to prevent Rails request hangs when async rendering tasks raise before the first chunk. PR 2407 by AbanoubGhadban.
  • Node renderer duplicate error reports for render failures: Fixed duplicate errorReporter.message notifications when unexpected exceptions occurred in `handleRenderRequ...
Read more

v16.4.0.rc.8

11 Mar 03:05

Choose a tag to compare

v16.4.0.rc.8 Pre-release
Pre-release

Changes since the last non-beta release.

Added

  • TanStack Router SSR integration (Pro): Added createTanStackRouterRenderFunction and serverRenderTanStackAppAsync via react-on-rails-pro/tanstack-router for TanStack Router SSR with the Pro Node Renderer. Uses TanStack Router's public router.load() API for reliable async SSR. Requires rendering_returns_promises = true in Pro config. PR 2516 by justin808.

  • create-react-on-rails-app --rsc flow: Added --rsc support to npx create-react-on-rails-app so a single command can scaffold an RSC-ready app. The CLI now installs react_on_rails_pro, passes --rsc to react_on_rails:install, and points users to /hello_server after setup. PR 2430 by justin808.

  • Environment-variable-driven ports in Procfile templates: Procfile templates now use ${PORT:-3000} and ${SHAKAPACKER_DEV_SERVER_PORT:-3035} instead of hardcoded ports, enabling multiple worktrees to run bin/dev concurrently without port conflicts. Includes a PortSelector that auto-detects free ports when defaults are occupied, plus a generated .env.example documenting manual overrides. PR 2539 by ihabadham.

  • CSP nonce support for RSC streaming and console replay scripts: Added cspNonce to rails_context and threaded nonce values through Pro RSC streaming paths (server-side HTML stream injection and client-side console replay script insertion), with nonce sanitization. PR 2418 by justin808.

  • Pro and RSC generator flags: Added --pro and --rsc flags to rails g react_on_rails:install, plus standalone react_on_rails:pro and react_on_rails:rsc generators for upgrading existing apps to Pro and React Server Components. Includes idempotent setup modules, webpack config transforms, prerequisite validation, and example components. PR 2284 by ihabadham.

  • Auto-registration for Redux stores: Added stores_subdirectory configuration option (e.g., "ror_stores") for automatic Redux store registration, following the same pattern as component auto-registration via ror_components. Store files placed in ror_stores/ directories are automatically discovered, and packs are generated that call ReactOnRails.registerStore(), eliminating manual registration boilerplate. Includes auto_load_bundle parameter for the redux_store helper. PR 2346 by justin808.

  • create-react-on-rails-app CLI tool: New npx create-react-on-rails-app command for single-command project setup. Phase 1 supports JavaScript and TypeScript templates with npm/pnpm, orchestrating rails new + bundle add react_on_rails + rails generate react_on_rails:install with prerequisite validation and progress output. PR 2375 by justin808.

  • Extensible bin/dev precompile pattern: New alternative approach for handling precompile tasks directly in bin/dev, providing better support for projects with custom build steps (ReScript, TypeScript), direct Ruby API access via ReactOnRails::Locales.compile, and improved version manager compatibility. PR 2349 by justin808.

  • Database setup check in bin/dev: The bin/dev command now checks database connectivity before starting the development server. This provides clear error messages when the database is missing or unavailable, instead of buried errors in the logs. Note: This adds ~1-2 seconds to startup time as it spawns a Rails runner process.

    Opt-out options (for apps without databases or when faster startup is needed):

    • CLI flag: bin/dev --skip-database-check
    • Environment variable: SKIP_DATABASE_CHECK=true bin/dev
    • Configuration: config.check_database_on_dev_start = false in config/initializers/react_on_rails.rb

    PR 2340 by justin808.

Improved

  • Smarter duplicate registration warnings: Component and store registration now only warns when a different component or store is registered under an already-used name. Re-registering the same component (common with HMR) is silently accepted. PR 2354 by justin808.

Fixed

  • CSS module SSR fixes for rspack: Fixed CSS module class name divergence between client and server bundles when using rspack. Server webpack config now filters rspack's cssExtractLoader in addition to mini-css-extract-plugin, uses spread syntax to preserve existing CSS module options when setting exportOnlyLocals: true, and adds null guards against undefined entries in rule.use arrays. Note: exportOnlyLocals: true is no longer applied when cssLoader.options.modules is falsy (disabled), which is the correct behavior but a change from prior versions. PR 2489 by justin808.
  • Fixed private_output_path not configured on fresh Shakapacker installs: When running rails g react_on_rails:install without pre-existing Shakapacker configuration, private_output_path: ssr-generated was left commented out in the generated config/shakapacker.yml. The generator now detects whether Shakapacker was just installed and passes a shakapacker_just_installed flag to BaseGenerator, which uses force: true when copying the config template to ensure the RoR version replaces Shakapacker's default. PR 2411 by ihabadham.
  • Install generator --pretend now behaves as a safe dry run: react_on_rails:install previously executed real Shakapacker setup commands (bundle add, bundle install, and rails shakapacker:install) and could crash on File.chmod because Thor pretend mode does not create files. --pretend now skips automatic Shakapacker installation and raw chmod calls so dry-run previews complete without side effects. PR 2536 by justin808.
  • bin/dev hook script path resolution without Rails.root: Fixed resolve_hook_script_path failing in early startup (before Rails is initialized) by adding a project_root helper that resolves the project root via BUNDLE_GEMFILE dirname or Dir.pwd when Rails.root is unavailable. PR 2568 by ihabadham. Fixes Issue 2438.
  • Rspack generator config path: Fixed --rspack generator placing config files under config/webpack/ instead of config/rspack/, causing Shakapacker deprecation warnings. All config file destinations are now dynamically remapped based on the active bundler, and using_rspack? auto-detects rspack projects for standalone generators (react_on_rails:rsc, react_on_rails:pro). PR 2417 by justin808.
  • Precompile hook load-based execution path: Fixed the precompile hook not executing its tasks when invoked via load (as used by bin/dev) instead of direct script execution. Added a shared run_precompile_tasks entry point that works regardless of invocation method. PR 2419 by justin808. Fixes Issue 2195.
  • create-react-on-rails-app validation improvements: Tightened CLI validation to enforce Rails 7+ and app-name leading-letter requirements, with clearer error messages for invalid names containing hyphens or underscores. PR 2577 by justin808.
  • Install @babel/preset-react for non-SWC generator installs: The generator now installs @babel/preset-react as a dev dependency when the project uses Babel (not SWC) as the transpiler, fixing JSX compilation errors on fresh installs with older Shakapacker defaults. PR 2421 by justin808.
  • Fix react_on_rails:doctor false positives for Pro/SWC setups: Doctor now recognizes react-on-rails-pro npm package for presence and version sync checks, skips @babel/preset-react check when SWC is the transpiler, and fixes a nil-safety bug where missing "dependencies" in package.json silently dropped devDependencies from checks. PR 2581 by ihabadham.
  • Fixed ScoutApm instrumentation depending on Gemfile ordering. ScoutApm instrumentation for react_component, react_component_hash, and exec_server_render_js was previously installed at gem load time using defined?(ScoutApm) guards, which meant it was silently skipped if scout_apm appeared after react_on_rails in the Gemfile, and produced noisy INFO log messages if it appeared before (since ScoutApm wasn't yet initialized). Moved instrumentation into an initializer that runs after scout_apm.start, ensuring it works regardless of gem ordering and only after ScoutApm is fully configured. [PR 2442](https://github....
Read more