4.0 Release Notes

🚀 Major New Features

React Server Components (RSC) - Full Production Support

React on Rails Pro now provides comprehensive support for React Server Components, enabling you to build the next generation of React applications:

  • Full RSC Integration: Seamlessly use React Server Components in your Rails apps with zero configuration
  • Bundle Optimization: Automatic client/server code splitting that significantly reduces client-side JavaScript
  • Server-Side Data Fetching: Direct access to databases, APIs, and server resources from React components
  • Progressive Hydration: Client components hydrate independently for optimal performance
  • RSC Payload Streaming: Efficient streaming of component data with embedded payloads
  • Compatible with React Router: Use React Router with RSC

See our complete RSC tutorial to get started.

Advanced Streaming Server Rendering

Building on React 19's streaming capabilities, React on Rails Pro delivers:

  • Progressive HTML Streaming: Send page content as it becomes available
  • Suspense Boundary Support: Handle async components with proper loading states
  • Selective Hydration: Components become interactive as soon as they're ready
  • Error Boundary Handling: Graceful error handling during streaming with configurable error raising
  • Async Console Log Replay: Debug async server-side rendering with client-side console output

Enhanced Error Reporting & Tracing

Completely redesigned error reporting system with:

  • Custom Integration Support: Integrate with any error reporting service (Sentry, Honeybadger, or custom)
  • Sentry SDK v8 Support: Latest Sentry integration with improved performance
  • Flexible Configuration: Configure error reporting according to your preferences
  • Enhanced Tracing: Better visibility into rendering performance and issues

Performance Improvements

Node Renderer Architecture

  • Fastify 5 Integration: Upgraded from Express to Fastify for significantly better performance
  • HTTP/2 Cleartext Communication: Rails communicates with Node renderer over HTTP/2 instead of HTTP/1.1
  • HTTPX Client: Replaced Net::HTTP with HTTPX for improved connection handling
  • Pino Logging: Switched from Winston to Pino for better performance and Fastify compatibility

These changes provide:

  • Better performance when Node renderer is deployed on the same machine as Rails
  • Significantly improved performance when deployed in separate workloads
  • Enhanced connection reuse and multiplexing capabilities
  • Better error handling and process management

Changes Specific For RSC Rendering Optimization

  • Cross-Bundle Communication: Components can now interact seamlessly across different bundles using the new runOnOtherBundle function, enabling advanced composition and modularization patterns.
  • Single-Pass Server Component Rendering: Server components are rendered just once within the RSC bundle, then efficiently reused for both SSR and client hydration—eliminating redundant work and improving performance.
  • Reduced HTTP Requests: RSC payloads are now embedded directly into the initial HTML response. No need to make an additional request to fetch the RSC payload.
  • Protocol v2.0 – Unified Bundle Management: The new protocol allows simultaneous upload of both server and RSC bundles in a single request, supporting multiple bundle uploads and providing robust, flexible bundle management for complex applications.

Breaking Changes

Configuration Updates

  • Sentry/Honeybadger: Remove old configuration options starting with sentry or honeybadger
  • Timer Polyfills: includeTimerPolyfills is renamed to stubTimers
  • Environment Variables: RENDERER_STUB_TIMERS instead of INCLUDE_TIMER_POLYFILLS
  • Error Reporting: Follow the Error Reporting and Tracing documentation for new setup

Dependency Requirements

  • Ruby 3+: Dropped support for Ruby 2.7 (EOL)
  • React on Rails 15+: Required for RSC and streaming features
  • Node 20+: Strongly recommended (older versions require specific package.json resolutions)

Package.json Resolutions (for Node < 20)

If using older Node versions, add to your package.json:

"resolutions": {
  "@fastify/formbody": "^7.4.0",
  "@fastify/multipart": "^8.3.1",
  "fastify": "^4.29.0"
}

Getting Started

Support & Community

  • Documentation: Comprehensive guides and tutorials available
  • Examples: Working examples in the spec/dummy application
  • GitHub: Active development and community support
  • Discussions: Join the React on Rails community for help and updates

React on Rails Pro 4.0 represents a major evolution in server-side React rendering, bringing React Server Components and advanced streaming to the Rails ecosystem with enterprise-grade performance and reliability.