Commit b76a52c
docs: RSC integration pitfalls from tutorial app (#3087)
## Summary
Documents five real-world RSC integration pitfalls discovered during the
[react-webpack-rails-tutorial RSC
integration](shakacode/react-webpack-rails-tutorial#723):
- **VM sandbox constraints** (`rendering-flow.md`,
`rsc-troubleshooting.md`): Documents why `externals` must not be used
for Node builtins in the server bundle (generates `require()` calls that
fail in the VM sandbox), and that `resolve.fallback: false` is the
correct approach
- **MessageChannel polyfill** (`rsc-troubleshooting.md`): Documents the
`BannerPlugin` polyfill pattern for `react-dom/server.browser.js` which
needs `MessageChannel` at module load time
- **`'use client'` classification audit**
(`upgrading-existing-pro-app.md`): Adds a pre-migration section covering
the `.server.jsx` naming collision, how auto-classification works, and a
checklist of client APIs to audit for
- **CI/test environment setup** (`basics.md`): Documents
`Rails.env.local?` vs `Rails.env.development?`, TCP readiness checks,
`RENDERER_PASSWORD` in CI, and a common CI failures table
- **Three-bundle architecture table** (`rendering-flow.md`): Adds a
reference table comparing all three bundles across runtime, Node builtin
handling, `require()` availability, CSS extraction, and env vars
Closes #3076
## Test plan
- [ ] Verify all markdown links resolve (pre-push hook validates this)
- [ ] Verify formatting passes prettier (pre-commit hook validates this)
- [ ] Review each doc section for technical accuracy against the
[tutorial
PR](shakacode/react-webpack-rails-tutorial#723)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk because changes are documentation-only, though reviewers
should sanity-check technical accuracy of the new webpack/VM and CI
guidance.
>
> **Overview**
> Adds a new **CI/test setup section** for the Node Renderer, including
`Rails.env.local?` initializer guarding, a GitHub Actions example that
starts the renderer with an HTTP/2 (h2c) readiness probe,
`RENDERER_PASSWORD` guidance, and a common-failures table.
>
> Expands RSC troubleshooting and Pro RSC docs to clarify **bundle
runtime differences** (client vs SSR server bundle VM sandbox vs
full-Node RSC bundle), document `require()`/missing-global failure
modes, recommend `resolve.fallback: false` over webpack `externals` for
Node builtins in the server bundle, and add guidance for handling
missing `MessageChannel` (polyfill via `BannerPlugin` / prefer
`additionalContext`).
>
> Adds a pre-migration checklist for existing Pro apps to audit for
client-only APIs and warns about the `.server.jsx` naming collision that
can cause unintended Server Component classification without `'use
client'`.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
bf26cb1. 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
* **Documentation**
* Added CI/test SSR setup with readiness checks, env guidance,
retry/fail behavior, and mapped common CI failure symptoms to fixes.
* Expanded runtime and bundle architecture guidance, clarifying
sandboxed server vs full-Node RSC constraints and safer handling of Node
builtins to avoid runtime require failures.
* Added troubleshooting entries for missing globals (require,
MessageChannel) and guidance for polyfill or context-injection fixes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 63c4cfe commit b76a52c
4 files changed
Lines changed: 245 additions & 15 deletions
File tree
- docs
- oss
- building-features/node-renderer
- migrating
- pro/react-server-components
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
124 | 200 | | |
125 | 201 | | |
126 | 202 | | |
| |||
0 commit comments