|
1 | 1 | # 4.0 Release Notes |
2 | 2 |
|
3 | | -## New Features |
| 3 | +## 🚀 Major New Features |
4 | 4 |
|
5 | | -* [Support for React Server Components](../react-server-components/tutorial.md) (very useful for performance in many cases!). |
6 | | -* Experimental [support for streaming server rendering](../streaming-server-rendering.md). |
7 | | -* It's now possible to [integrate with error reporting and tracing services](../node-renderer/error-reporting-and-tracing.md) other than Sentry and Honeybadger, and to configure those fully according to your preferences. Sentry SDK v8 or later is now supported as well. |
| 5 | +### React Server Components (RSC) - Full Production Support |
| 6 | +React on Rails Pro now provides comprehensive support for React Server Components, enabling you to build the next generation of React applications: |
8 | 7 |
|
9 | | -## Performance |
| 8 | +- **Full RSC Integration**: Seamlessly use React Server Components in your Rails apps with zero configuration |
| 9 | +- **Bundle Optimization**: Automatic client/server code splitting that significantly reduces client-side JavaScript |
| 10 | +- **Server-Side Data Fetching**: Direct access to databases, APIs, and server resources from React components |
| 11 | +- **Progressive Hydration**: Client components hydrate independently for optimal performance |
| 12 | +- **RSC Payload Streaming**: Efficient streaming of component data with embedded payloads |
| 13 | +- **Compatible with React Router**: [Use React Router with RSC](../react-server-components/inside-client-components.md) |
10 | 14 |
|
11 | | -There are several background changes to improve performance: |
12 | | -* the Node renderer is now based on Fastify instead of Express; |
13 | | -* Rails communicates with the Node renderer over HTTP/2 Cleartext instead of HTTP/1.1. |
| 15 | +See our [complete RSC tutorial](../react-server-components-tutorial.md) to get started. |
14 | 16 |
|
15 | | - This should improve performance somewhat when the Node renderer is deployed on the same machine as the Rails app, and significantly more when they are deployed in separate workloads, |
16 | | - thanks to multiplexing and better connection reuse. |
| 17 | +### Advanced Streaming Server Rendering |
| 18 | +Building on React 19's streaming capabilities, React on Rails Pro delivers: |
17 | 19 |
|
18 | | -They shouldn't require any changes to your existing code or configuration. |
| 20 | +- **Progressive HTML Streaming**: Send page content as it becomes available |
| 21 | +- **Suspense Boundary Support**: Handle async components with proper loading states |
| 22 | +- **Selective Hydration**: Components become interactive as soon as they're ready |
| 23 | +- **Error Boundary Handling**: Graceful error handling during streaming with configurable error raising |
| 24 | +- **Async Console Log Replay**: Debug async server-side rendering with client-side console output |
| 25 | + |
| 26 | +### Enhanced Error Reporting & Tracing |
| 27 | +Completely redesigned error reporting system with: |
| 28 | + |
| 29 | +- **Custom Integration Support**: Integrate with any error reporting service (Sentry, Honeybadger, or custom) |
| 30 | +- **Sentry SDK v8 Support**: Latest Sentry integration with improved performance |
| 31 | +- **Flexible Configuration**: Configure error reporting according to your preferences |
| 32 | +- **Enhanced Tracing**: Better visibility into rendering performance and issues |
| 33 | + |
| 34 | +## Performance Improvements |
| 35 | + |
| 36 | +### Node Renderer Architecture |
| 37 | +- **Fastify 5 Integration**: Upgraded from Express to Fastify for significantly better performance |
| 38 | +- **HTTP/2 Cleartext Communication**: Rails communicates with Node renderer over HTTP/2 instead of HTTP/1.1 |
| 39 | +- **HTTPX Client**: Replaced Net::HTTP with HTTPX for improved connection handling |
| 40 | +- **Pino Logging**: Switched from Winston to Pino for better performance and Fastify compatibility |
| 41 | + |
| 42 | +These changes provide: |
| 43 | +- Better performance when Node renderer is deployed on the same machine as Rails |
| 44 | +- Significantly improved performance when deployed in separate workloads |
| 45 | +- Enhanced connection reuse and multiplexing capabilities |
| 46 | +- Better error handling and process management |
| 47 | + |
| 48 | + |
| 49 | +### Changes Specific For RSC Rendering Optimization |
| 50 | +- **Cross-Bundle Communication**: Components can now interact seamlessly across different bundles using the new `runOnOtherBundle` function, enabling advanced composition and modularization patterns. |
| 51 | +- **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. |
| 52 | +- **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. |
| 53 | +- **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. |
19 | 54 |
|
20 | 55 | ## Breaking Changes |
21 | 56 |
|
22 | | -* If you used Sentry or Honeybadger integrations for the Node renderer, remove the old configuration options starting with `sentry` or `honeybadger`, and follow the [Error Reporting and Tracing](../node-renderer/error-reporting-and-tracing.md) documentation. |
23 | | -* `includeTimerPolyfills` is renamed to `stubTimers`. The corresponding environment variable is `RENDERER_STUB_TIMERS` instead of `INCLUDE_TIMER_POLYFILLS`. |
| 57 | +### Configuration Updates |
| 58 | +- **Sentry/Honeybadger**: Remove old configuration options starting with `sentry` or `honeybadger` |
| 59 | +- **Timer Polyfills**: `includeTimerPolyfills` is renamed to `stubTimers` |
| 60 | +- **Environment Variables**: `RENDERER_STUB_TIMERS` instead of `INCLUDE_TIMER_POLYFILLS` |
| 61 | +- **Error Reporting**: Follow the [Error Reporting and Tracing](../node-renderer/error-reporting-and-tracing.md) documentation for new setup |
| 62 | + |
| 63 | +### Dependency Requirements |
| 64 | +- **Ruby 3+**: Dropped support for Ruby 2.7 (EOL) |
| 65 | +- **React on Rails 15+**: Required for RSC and streaming features |
| 66 | +- **Node 20+**: Strongly recommended (older versions require specific package.json resolutions) |
| 67 | + |
| 68 | +### Package.json Resolutions (for Node < 20) |
| 69 | +If using older Node versions, add to your `package.json`: |
| 70 | +```json |
| 71 | +"resolutions": { |
| 72 | + "@fastify/formbody": "^7.4.0", |
| 73 | + "@fastify/multipart": "^8.3.1", |
| 74 | + "fastify": "^4.29.0" |
| 75 | +} |
| 76 | +``` |
| 77 | + |
| 78 | +## Getting Started |
24 | 79 |
|
25 | | -### Required dependency versions |
| 80 | +- **RSC Tutorial**: [Complete React Server Components Guide](../react-server-components-tutorial.md) |
| 81 | +- **Streaming SSR**: [Streaming Server Rendering Documentation](../streaming-server-rendering.md) |
| 82 | +- **Error Reporting**: [Error Reporting and Tracing Setup](../node-renderer/error-reporting-and-tracing.md) |
| 83 | +- **Performance**: [Caching and Optimization Guide](../caching.md) |
26 | 84 |
|
27 | | -* Ruby 3+. |
28 | | -* Node 20+ is not strictly required, but strongly recommended. If you're using older versions, you need to add |
29 | | - ``` |
30 | | - "resolutions": { |
31 | | - "@fastify/formbody": "^7.4.0", |
32 | | - "@fastify/multipart": "^8.3.1", |
33 | | - "fastify": "^4.29.0" |
34 | | - } |
35 | | - ``` |
36 | | - to your `package.json`, or to update your existing `"resolutions"` section. |
| 85 | +## Support & Community |
37 | 86 |
|
38 | | -* Shakapacker 7+ (8 is recommended): |
39 | | - * [Upgrading from Shakapacker v6 to v7](https://github.com/shakacode/shakapacker/blob/main/docs/v7_upgrade.md). |
40 | | - * [Upgrading from Shakapacker v7 to v8](https://github.com/shakacode/shakapacker/blob/main/docs/v8_upgrade.md). |
41 | | -* React on Rails 15+ (released together with this version). |
| 87 | +- **Documentation**: Comprehensive guides and tutorials available |
| 88 | +- **Examples**: Working examples in the spec/dummy application |
| 89 | +- **GitHub**: Active development and community support |
| 90 | +- **Discussions**: Join the [React on Rails community](https://forum.shakacode.com/) for help and updates |
42 | 91 |
|
43 | | -## Other changes |
| 92 | +--- |
44 | 93 |
|
45 | | -* If you use an application performance management service, they generally break out HTTP requests. But different APM services support different HTTP client libraries, so please check if the one you use supports HTTPX. If not, you may want to add custom instrumentation. |
46 | | - * Similarly, if you apply APM to the Node renderer, please check if it supports Fastify. |
| 94 | +*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.* |
0 commit comments