Commit a5bdaee
Move Node Renderer entry point to renderer/ directory (#3165)
## Summary
Establishes `renderer/node-renderer.js` as the canonical location for
the Pro Node Renderer entry point. Previously the path was inconsistent
across docs (`node-renderer.js`, `client/node-renderer.js`, or
`react-on-rails-pro-node-renderer.js`).
Using a dedicated top-level `renderer/` directory also makes it trivial
to exclude from production Docker builds that strip JS sources after
bundling — the Node Renderer process still needs its entry file at
runtime.
## Changes
- **Generator** (`pro_setup.rb`, `base_generator.rb`,
`demo_page_config.rb`, `USAGE`, initializer template) now creates the
entry at `renderer/node-renderer.js`
- **Template file** moved to
`templates/pro/base/renderer/node-renderer.js`
- **Pro `spec/dummy`** — renderer file, `Procfile.dev`, `Procfile.prod`,
`package.json` scripts, `.controlplane/rails.yml`, and
`benchmarks/bench-node-renderer.rb` updated
- **All 13 docs** now use `renderer/node-renderer.js` consistently; the
Docker-cleanup rationale is added to the container deployment guide
- **Generator specs** updated; 13 renderer-related examples pass
Existing apps are unaffected — the generator skips files that already
exist, so upgrades keep their current `client/node-renderer.js`.
## Test plan
- [x] `rubocop` passes on all changed Ruby files
- [x] `prettier --check` passes on all changed docs + JS
- [x] Renderer-related generator specs all pass (`rspec ... --example
"creates node-renderer" --example "adds node-renderer process" --example
"does not overwrite existing"`, 13 examples)
- [x] Full `pro_generator_spec.rb` passes (79 examples)
- [x] Link-check (`lychee`) passes on all modified docs
- [ ] Review rendered markdown
Fixes #3073
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Moderate risk because it changes the Pro generator’s output paths and
Procfile wiring for SSR, which could break dev/prod startup if projects
rely on the old `client/node-renderer.js` location or have customized
Procfiles.
>
> **Overview**
> **Pro installs now standardize the Node Renderer entrypoint at
`renderer/node-renderer.js`** (instead of `client/node-renderer.js`),
including updated generator hints, initializer comments, and a new
template under `templates/pro/base/renderer/`.
>
> The Pro generator adds safer upgrade behavior: it detects an existing
legacy `client/node-renderer.js`, avoids overwriting it, conditionally
skips/avoids duplicating `Procfile.dev` entries, and emits targeted
warnings when a Procfile still points at the legacy path.
>
> Docs, dummy app scripts/Procfiles, deployment examples
(Docker/K8s/Heroku), benchmarks, and generator specs are updated to
reference the new `renderer/` path consistently, with added
documentation explaining the Docker build rationale.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
20633e7. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Changed**
* Pro generator now places the Node renderer in a dedicated top-level
renderer directory, preserves existing legacy renderer files, and adds a
configurable server-bundle cache location.
* **Documentation**
* Updated guides, examples, deployment and profiling docs, and sample
startup scripts to reference the new renderer location.
* **Tests**
* Added/updated generator tests to cover legacy vs. new renderer
presence and Procfile/script handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c4d8687 commit a5bdaee
File tree
30 files changed
+426
-62
lines changed- benchmarks
- docs
- oss
- api-reference
- building-features
- node-renderer
- deployment
- migrating
- pro
- packages/react-on-rails-pro-node-renderer
- react_on_rails_pro
- .controlplane
- spec/dummy
- renderer
- react_on_rails
- lib/generators/react_on_rails
- pro
- templates/pro/base
- config/initializers
- renderer
- spec/react_on_rails
- generators
30 files changed
+426
-62
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
175 | 177 | | |
176 | 178 | | |
177 | 179 | | |
178 | | - | |
| 180 | + | |
179 | 181 | | |
180 | 182 | | |
181 | | - | |
| 183 | + | |
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
| |||
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
202 | | - | |
| 204 | + | |
203 | 205 | | |
204 | 206 | | |
205 | 207 | | |
| |||
220 | 222 | | |
221 | 223 | | |
222 | 224 | | |
223 | | - | |
| 225 | + | |
224 | 226 | | |
225 | 227 | | |
226 | 228 | | |
| |||
488 | 490 | | |
489 | 491 | | |
490 | 492 | | |
491 | | - | |
| 493 | + | |
492 | 494 | | |
493 | 495 | | |
494 | 496 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
| 65 | + | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
| 414 | + | |
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| |||
0 commit comments