Skip to content

Commit b25f683

Browse files
Add major performance breakthroughs guide for React on Rails Pro v4 and React on Rails v15
1 parent 18ef203 commit b25f683

File tree

2 files changed

+119
-64
lines changed

2 files changed

+119
-64
lines changed
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# React on Rails Pro: Major Performance Breakthroughs - React Server Components, SSR Streaming & Early Hydration
2+
3+
**Subject: 🚀 Revolutionary Performance Breakthroughs: React Server Components, SSR Streaming & Early Hydration Now Available in React on Rails Pro v4 & React on Rails v15**
4+
5+
---
6+
7+
June 24, 2025
8+
9+
We're thrilled to announce a major update: [React on Rails Pro](https://www.shakacode.com/react-on-rails-pro/) v4 and [React on Rails](https://github.com/shakacode/react_on_rails) v15 now deliver **unprecedented performance improvements** that will transform your applications. These updates introduce multiple breakthrough technologies that work together to deliver the fastest possible user experience.
10+
11+
## 🎯 What This Means for Your Applications
12+
13+
- **Dramatically faster load times**
14+
- **Smaller JavaScript bundles**
15+
- **Better Core Web Vitals**
16+
- **Improved SEO**
17+
- **Smoother user interactions**
18+
- **Eliminated race conditions**
19+
- **Optimized streaming performance**
20+
21+
## 🔥 React Server Components
22+
23+
Server Components execute on the server and stream HTML to the client—no server-side JavaScript in your bundle. Real‑world results include:
24+
25+
- [productonboarding.com experiment](https://frigade.com/blog/bundle-size-reduction-with-rsc-and-frigade):
26+
- **62% reduction** in client‑side bundle size
27+
- **63% improvement** in Google Speed Index
28+
- Total blocking time: **from 110 ms to 1 ms**
29+
- [geekyants.com Case Study](https://geekyants.com/en-gb/blog/boosting-performance-with-nextjs-and-react-server-components-a-geekyantscom-case-study):
30+
- **52% smaller** JavaScript and TypeScript codebase
31+
- Lighthouse scores improved **from ~50 to ~90**
32+
- [Airbnb's RSC migration results](<https://questlab.pro/blog-posts/web-development/wd-pl-2024-articleId912i1h212818#:~:text=%22Our%20migration%20to%20React%20Server%20Components%20resulted%20in%20a%2015%25%20improvement%20in%20core%20web%20vitals%20and%20a%2023%25%20reduction%20in%20Time%20to%20First%20Byte%20(TTFB)%20across%20all%20markets.%22%20%2D%20Airbnb%20Engineering%20Team>):
33+
- **15% improvement** in core web vitals
34+
- **23% reduction** in Time to First Byte
35+
- [Meta's developer portal migration](https://questlab.pro/blog-posts/web-development/wd-pl-2024-articleId912i1h212818#:~:text=Meta%27s%20RSC%20Implementation%20Results):
36+
- **30% reduction** in JavaScript bundle size
37+
- **60% improvement** in Time to Interactive
38+
- **45% faster** First Contentful Paint
39+
- **50% reduction** in server response time
40+
- **25% decrease** in overall maintenance complexity
41+
42+
Please note that only the first of these directly compares performance of equivalent applications with and without React Server Components.
43+
Other migrations may include React or other dependency upgrades and so on.
44+
45+
## 🌊 SSR Streaming
46+
47+
SSR Streaming sends HTML to the browser in chunks as it's generated, enabling progressive rendering:
48+
49+
- [An experiment at Nordnet comparing equivalent applications with and without streaming SSR](https://www.diva-portal.org/smash/get/diva2:1903931/FULLTEXT01.pdf):
50+
- **32% faster** time to first byte
51+
- **40% faster** total blocking time
52+
- Negative result: **2% increase** in server load
53+
- [Hulu case study](https://www.compilenrun.com/docs/framework/nextjs/nextjs-ecosystem/nextjs-case-studies/#case-study-3-hulus-streaming-platform):
54+
- **30% faster** page load times
55+
- [styled‑components v3.1.0: A massive performance boost and streaming server-side rendering support](https://medium.com/styled-components/v3-1-0-such-perf-wow-many-streams-c45c434dbd03)
56+
57+
## ⚡️ **BREAKTHROUGH: Early Hydration Technology**
58+
59+
**React on Rails now starts hydration even before the full page is loaded!** This revolutionary change delivers significant performance improvements across all pages:
60+
61+
- **Eliminates Race Conditions**: No more waiting for full page load before hydration begins
62+
- **Faster Time-to-Interactive**: Components hydrate as soon as their server-rendered HTML reaches the client
63+
- **Streaming HTML Optimization**: Perfect for modern streaming responses - components hydrate in parallel with page streaming
64+
- **Async Script Safety**: Can use `async` scripts without fear of race conditions
65+
- **No More Defer Needed**: The previous need for `defer` to prevent race conditions has been eliminated
66+
67+
This optimization is particularly impactful for:
68+
- **Streamed pages** where content loads progressively
69+
- **Large pages** with many components
70+
- **Slow network conditions** where every millisecond counts
71+
- **Modern web apps** requiring fast interactivity
72+
73+
*Performance improvement visualization:*
74+
75+
![Performance comparison showing early hydration improvement](https://github.com/user-attachments/assets/ae33fe14-42f1-4cc1-bde3-9c5bb570cdbf)
76+
77+
*The image above demonstrates the dramatic performance improvement:*
78+
- **Left (Before)**: Hydration didn't start until the full page load completed, causing a huge delay before hydration
79+
- **Right (After)**: Hydration starts immediately as soon as components are available, without waiting for full page load
80+
- **Result**: Components now become interactive much faster, eliminating the previous race condition delays
81+
82+
## 🚀 Enhanced Performance Infrastructure
83+
84+
### Fastify-Based Node Renderer
85+
- **3x faster** Node renderer based on Fastify instead of Express
86+
- **HTTP/2 Cleartext** communication between Rails and Node renderer
87+
- **Multiplexing and connection reuse** for significantly better performance
88+
- **No code changes required** - automatic performance boost
89+
90+
### Optimized Script Loading Strategies
91+
- New `generated_component_packs_loading_strategy` configuration
92+
- **Async loading by default** for Shakapacker ≥ 8.2.0 (optimal performance)
93+
- **Smart hydration timing** that works perfectly with streaming HTML
94+
- **Eliminated waterfall delays** in component hydration
95+
96+
## 💰 Why This Upgrade is Critical
97+
98+
These performance improvements aren't just nice-to-haves—they're essential for:
99+
100+
- **Competitive advantage** in today's performance-focused web landscape
101+
- **SEO improvements** as Core Web Vitals become ranking factors
102+
- **User retention** - faster sites keep users engaged longer
103+
- **Conversion rates** - every millisecond counts for e-commerce
104+
- **Mobile performance** - crucial for global markets with slower connections
105+
106+
---
107+
108+
Adopting these features in React on Rails Pro v4 and React on Rails v15 will help you deliver **dramatically faster, leaner, and more SEO‑friendly applications** with fewer client‑side resources and eliminated performance bottlenecks.
109+
110+
**Ready to get started?**
111+
112+
1. Update to React on Rails v15
113+
2. Update to React on Rails Pro v4
114+
3. Follow our [RSC & SSR Streaming migration guide](https://www.shakacode.com/react-on-rails-pro/docs/react-server-components/tutorial/)
115+
116+
Let's make your apps faster—together.
117+
118+
**ShakaCode Team**
119+
*Building the future of Rails + React performance*

docs/react-on-rails-pro/react-server-components.md

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)