Commit 2f7d333
Pro RSC migration: tutorial on React on Rails Pro with a React Server Components demo
Migrates this tutorial to React on Rails Pro with the Pro Node Renderer
for SSR, and adds a React Server Components demo at /server-components.
RSC is a Pro-only feature (`enable_rsc_support` doesn't exist in the OSS
gem), so demonstrating RSC inherently moves the whole app to Pro —
that's the entry ticket, not scope drift.
What changes:
- Dependencies: gem and npm move from react_on_rails to
react_on_rails_pro 16.6.0; React pinned to ~19.0.4 (RSC's minimum);
adds react-on-rails-pro-node-renderer and react-on-rails-rsc.
- SSR runtime: Server-side rendering moves from ExecJS to the Pro Node
Renderer (renderer/node-renderer.js, port 3800). The renderer wires
additionalContext: { URL, AbortController } for react-router-dom,
stubTimers: false so React's RSC server renderer can use setTimeout
for Flight-protocol yielding, and replayServerAsyncOperationLogs:
true to surface async-server-component console output.
- RSC demo: A new page at /server-components exercises React Server
Components end-to-end: server-only library imports (Node os +
lodash) that never reach the browser, async server components
streamed via <Suspense>, the donut pattern (a 'use client' component
nested in a server tree), and client-driven server-component
re-fetching with react-error-boundary + useRSC().refetchComponent.
- Bundler: shakapacker temporarily switched from rspack to webpack
while waiting for shakacode/react_on_rails_rsc#29 to ship rspack
support for the RSC plugin. Tracked by TODO in
config/shakapacker.yml.
Verification:
- Each sub-PR (#726, #728, #729) reviewed independently before
squashing into base.
- Manually QA'd on the deployed review app.
- Request and system specs cover the RSC payload endpoint and the
demo page interactions (spec/requests/server_components_spec.rb,
spec/system/server_components_demo_spec.rb).
- Lint, RSpec, and JS test workflows ran for the first time on the
base PR — sub-PRs target the base branch and skip those workflows
by trigger filter.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 5cf245f commit 2f7d333
49 files changed
Lines changed: 1631 additions & 223 deletions
File tree
- .controlplane
- templates
- .github/workflows
- app
- controllers
- views/pages
- client
- __tests__/webpack
- app
- bundles
- comments
- components
- SimpleCommentScreen/ror_components
- constants
- rescript/ReScriptShow/ror_components
- startup
- App/ror_components
- RouterApp/ror_components
- server-components
- components
- ror_components
- libs
- packs
- config
- initializers
- webpack
- renderer
- spec
- requests
- system
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
27 | 50 | | |
28 | 51 | | |
29 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
9 | 16 | | |
10 | 17 | | |
11 | 18 | | |
12 | 19 | | |
13 | 20 | | |
14 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
15 | 26 | | |
16 | 27 | | |
17 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| |||
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
30 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
85 | 107 | | |
86 | 108 | | |
87 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
| |||
115 | 121 | | |
116 | 122 | | |
117 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
118 | 128 | | |
119 | 129 | | |
120 | 130 | | |
| |||
146 | 156 | | |
147 | 157 | | |
148 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
149 | 163 | | |
150 | 164 | | |
151 | 165 | | |
152 | 166 | | |
153 | 167 | | |
154 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
155 | 172 | | |
156 | 173 | | |
157 | 174 | | |
158 | 175 | | |
| 176 | + | |
159 | 177 | | |
160 | 178 | | |
161 | 179 | | |
| |||
165 | 183 | | |
166 | 184 | | |
167 | 185 | | |
| 186 | + | |
| 187 | + | |
168 | 188 | | |
169 | 189 | | |
170 | 190 | | |
| |||
182 | 202 | | |
183 | 203 | | |
184 | 204 | | |
| 205 | + | |
185 | 206 | | |
186 | 207 | | |
187 | 208 | | |
| |||
296 | 317 | | |
297 | 318 | | |
298 | 319 | | |
299 | | - | |
| 320 | + | |
300 | 321 | | |
301 | 322 | | |
302 | 323 | | |
303 | 324 | | |
304 | 325 | | |
305 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
306 | 337 | | |
307 | 338 | | |
308 | 339 | | |
| |||
387 | 418 | | |
388 | 419 | | |
389 | 420 | | |
390 | | - | |
| 421 | + | |
391 | 422 | | |
392 | 423 | | |
393 | 424 | | |
| |||
425 | 456 | | |
426 | 457 | | |
427 | 458 | | |
| 459 | + | |
428 | 460 | | |
429 | 461 | | |
430 | 462 | | |
| |||
486 | 518 | | |
487 | 519 | | |
488 | 520 | | |
489 | | - | |
| 521 | + | |
490 | 522 | | |
491 | 523 | | |
492 | 524 | | |
| |||
498 | 530 | | |
499 | 531 | | |
500 | 532 | | |
501 | | - | |
| 533 | + | |
502 | 534 | | |
503 | 535 | | |
504 | 536 | | |
| |||
0 commit comments