Docs: record RSC Rspack client refs investigation#4269
Conversation
Capture why the lazyCompilation fix is separate from the unresolved async client-reference inclusion design, including addInclude POC outcomes and upstream Rspack API blockers.
WalkthroughAdds a new internal decision record documenting the history of React Server Components + Rspack client-reference manifest generation, the ChangesRSC Rspack Client-Reference Inclusion Decision Record
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR adds an internal decision record for RSC and Rspack client-reference handling. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "docs: record RSC Rspack client refs deci..." | Re-trigger Greptile |
Review: RSC Rspack client-reference inclusion decision recordThis PR adds a well-structured internal decision record capturing the investigative history from the first Eight findings below — five are ready to fix in this PR, three are minor cleanup. Inline comments on specific lines follow. Findings
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/analysis/rsc-rspack-client-reference-inclusion-decision-record-2026-06-27.md (1)
395-399: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueClarify the fragment "mark exports used in unknown way."
This line reads as an incomplete verb phrase. Consider expanding to "mark exports as used in unknown way" or, if this references a specific Rspack/webpack API (e.g.,
usedExports: "unknown"), use the exact option name for precision.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/analysis/rsc-rspack-client-reference-inclusion-decision-record-2026-06-27.md` around lines 395 - 399, The phrase “mark exports used in unknown way” is incomplete and should be clarified in the decision record entry under the server bundle section. Update the wording to either use the exact Rspack/webpack API term if applicable (for example, the relevant `usedExports` setting) or rewrite it as a complete verb phrase such as “mark exports as used in an unknown way” so the intent is precise and readable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@internal/analysis/rsc-rspack-client-reference-inclusion-decision-record-2026-06-27.md`:
- Around line 395-399: The phrase “mark exports used in unknown way” is
incomplete and should be clarified in the decision record entry under the server
bundle section. Update the wording to either use the exact Rspack/webpack API
term if applicable (for example, the relevant `usedExports` setting) or rewrite
it as a complete verb phrase such as “mark exports as used in an unknown way” so
the intent is precise and readable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a22e1e25-7769-4540-ba37-843d1bc2e7cc
📒 Files selected for processing (1)
internal/analysis/rsc-rspack-client-reference-inclusion-decision-record-2026-06-27.md
Address-review summaryScan scope: full PR history; no prior summary. Mattered
Optional
Skipped
Follow-up issue: None. Next default scan starts after this comment. Say |
| - Fresh generated RORP RSC + Rspack apps now work in normal `bin/dev` because `react_on_rails` disables top-level Rspack `lazyCompilation` for generated RSC + Rspack dev-server configs in [react_on_rails#4227](https://github.com/shakacode/react_on_rails/pull/4227). | ||
| - [react_on_rails#4213](https://github.com/shakacode/react_on_rails/pull/4213) and [react_on_rails#4223](https://github.com/shakacode/react_on_rails/pull/4223) added interim install/doctor/artifact diagnostics before the runtime dev-server fix. | ||
| - [react_on_rails#4234](https://github.com/shakacode/react_on_rails/pull/4234) added follow-up docs and doctor guardrails. | ||
| - [react_on_rails#4243](https://github.com/shakacode/react_on_rails/issues/4243) tracks a smaller doctor false-warning gap for equivalent custom lazy-compilation configs. |
There was a problem hiding this comment.
Stale status: #4243 was already resolved by PR #4249.
PR #4249 is already merged and appears in CHANGELOG.md (lines 51–61). It changed the doctor from a false "still enabled" assertion to a softer "could not confirm" warning, covering all the equivalent config variants listed later in this section.
The bullet should either be removed from "Current status" or updated to note the fix shipped:
| - [react_on_rails#4243](https://github.com/shakacode/react_on_rails/issues/4243) tracks a smaller doctor false-warning gap for equivalent custom lazy-compilation configs. | |
| - ~~[react_on_rails#4243](https://github.com/shakacode/react_on_rails/issues/4243)~~ Doctor false-warning gap for equivalent custom `lazyCompilation` configs was fixed in [react_on_rails#4249](https://github.com/shakacode/react_on_rails/pull/4249): doctor now emits "could not confirm" rather than a false "still enabled" assertion. |
| Graph-derived refs reduce false positives. They do not, by themselves, provide a safe Rspack client-reference inclusion primitive. | ||
|
|
||
| ### 5. `react_on_rails#4200` and `react_on_rails#4227`: normal `bin/dev` failure | ||
|
|
There was a problem hiding this comment.
Wrong issue number. PR #4227 says "Fixes #4226" — not #4200. Issue #4200 was the install/doctor diagnostics gap fixed by PR #4213. The section title and opening sentence should reference #4226 as the tracking issue for the bin/dev failure.
| ### 5. `react_on_rails#4226` and `react_on_rails#4227`: normal `bin/dev` failure |
|
|
||
| Three concrete `compilation.addInclude` shapes were tested after the lazyCompilation failure. Each shape answered a specific question about whether `addInclude` can replace source-level dynamic imports for RSC client-reference inclusion. These were June 2026 local implementation tests, not merged package changes; rerun them against current `react_on_rails_rsc` before using any result as design proof. | ||
|
|
||
| ### Test 1: separate `addInclude` entry/group |
There was a problem hiding this comment.
Test 1 is missing a setup description. Tests 2 and 3 each open with a sentence describing the approach before listing results. Test 1 jumps straight to "Result:" with no config excerpt, no entry name used, and no indication of which file was added via addInclude.
The section header at line 197 explicitly cautions to "rerun them against current react_on_rails_rsc before using any result as design proof" — but Test 1 cannot be reproduced without knowing what was actually tested. Even a short paragraph matching the style of Test 2 ("This approach attached discovered refs to…") would make this reproducible.
| - In [shakacode/shakapacker#984](https://github.com/shakacode/shakapacker/issues/984#issuecomment-4089667879), a Shakapacker/Rspack adopter said they had to disable Rspack lazy compilation because the Shakapacker server did not handle it out of the box. | ||
| - In [web-infra-dev/rspack#14194](https://github.com/web-infra-dev/rspack/issues/14194), a Rails + Shakapacker + Rspack starter hit lazy-trigger 404s around optional dynamic imports. The workaround was top-level `lazyCompilation: false`. | ||
|
|
||
| Internal context: Hichee's Rspack migration also disabled top-level `lazyCompilation` in its Rails/Rspack dev-server wiring; see private PR `shakacode/hichee#9508` for the RSC + Rspack migration context. |
There was a problem hiding this comment.
Private reference used as corroborating evidence without an accessibility note. shakacode/hichee#9508 is cited to support the claim about Hichee's Rspack migration disabling lazyCompilation. Readers without access to that repo will get a 404 (or a permissions error). Since this doc may be linked from public issues (#3488 per the open questions section), worth labelling:
| Internal context: Hichee's Rspack migration also disabled top-level `lazyCompilation` in its Rails/Rspack dev-server wiring; see private PR `shakacode/hichee#9508` for the RSC + Rspack migration context. | |
| Internal context: Hichee's Rspack migration also disabled top-level `lazyCompilation` in its Rails/Rspack dev-server wiring (private repo — shakacode/hichee, not publicly accessible); see private PR `shakacode/hichee#9508` for the RSC + Rspack migration context. |
Review: RSC Rspack client-reference inclusion decision recordWell-written and thorough internal decision record. The mechanism comparison table, the three Two confirmed factual errors and two structural gaps worth fixing before merge: Confirmed errorsLine 21 — Issue #4243 is already resolved Line 141 — Wrong issue number for the bin/dev failure Structural gapsLine 199 — Test 1 missing setup description Line 337 — Private reference lacks accessibility label |
…cale-fix * origin/main: Docs: record RSC Rspack client refs investigation (#4269)
…ion-eviction-test * origin/main: Docs: record RSC Rspack client refs investigation (#4269) Release train: release-forward-port re-homes changelog to [Unreleased] (#4257) Release train: add `release finish` promote + close-out scripts (#4258) Release train: /update-changelog release-vs-main target (#4256) Release train: add `release start` (auto-create release/X.Y.Z on rc cut) (#4255) Release train: ci-changes-detector classifies release-tooling paths (skip full matrix) (#4262) Fix release forward-port post-merge review findings (#4261)
…d-layout-owned-pack * origin/main: Docs: record RSC Rspack client refs investigation (#4269)
…layout-context * origin/main: Docs: record RSC Rspack client refs investigation (#4269)
…ered-rsc-rendering * origin/main: Docs: record RSC Rspack client refs investigation (#4269)
…pool-warmup * origin/main: Docs: record RSC Rspack client refs investigation (#4269) Release train: release-forward-port re-homes changelog to [Unreleased] (#4257) Release train: add `release finish` promote + close-out scripts (#4258) Release train: /update-changelog release-vs-main target (#4256) Release train: add `release start` (auto-create release/X.Y.Z on rc cut) (#4255) Release train: ci-changes-detector classifies release-tooling paths (skip full matrix) (#4262) Fix release forward-port post-merge review findings (#4261) Make RSC Rspack doctor lazyCompilation warning honest about its limitation (#4249) docs: cross-link the TanStack Start comparison from the decision guide and Next.js RSC doc (#4254) docs: add "RoR Pro vs TanStack Start" architecture comparison (#4246) docs: add "React on Rails vs TanStack Start" to the decision guide (#4242)
…ession * origin/main: Docs: record RSC Rspack client refs investigation (#4269) Release train: release-forward-port re-homes changelog to [Unreleased] (#4257) Release train: add `release finish` promote + close-out scripts (#4258) Release train: /update-changelog release-vs-main target (#4256) Release train: add `release start` (auto-create release/X.Y.Z on rc cut) (#4255) Release train: ci-changes-detector classifies release-tooling paths (skip full matrix) (#4262) Fix release forward-port post-merge review findings (#4261) Make RSC Rspack doctor lazyCompilation warning honest about its limitation (#4249) docs: cross-link the TanStack Start comparison from the decision guide and Next.js RSC doc (#4254) docs: add "RoR Pro vs TanStack Start" architecture comparison (#4246) docs: add "React on Rails vs TanStack Start" to the decision guide (#4242)
…r-timing * origin/main: Docs: record RSC Rspack client refs investigation (#4269) Release train: release-forward-port re-homes changelog to [Unreleased] (#4257) Release train: add `release finish` promote + close-out scripts (#4258) Release train: /update-changelog release-vs-main target (#4256) Release train: add `release start` (auto-create release/X.Y.Z on rc cut) (#4255) Release train: ci-changes-detector classifies release-tooling paths (skip full matrix) (#4262) Fix release forward-port post-merge review findings (#4261) Make RSC Rspack doctor lazyCompilation warning honest about its limitation (#4249) docs: cross-link the TanStack Start comparison from the decision guide and Next.js RSC doc (#4254) docs: add "RoR Pro vs TanStack Start" architecture comparison (#4246) docs: add "React on Rails vs TanStack Start" to the decision guide (#4242)
…ypes * origin/main: Fail fast for RSC on Rspack v1 (#4289) [codex] Document agent workflow trust boundary (#4288) Fix precompile hook forcing UTF-8 onto non-UTF-8 (national) locales (#4244) Regenerate Pro llms bundle (#4280) Docs: clarify RSC layout request context (#4267) [Pro] Document renderer warmup/pool/keep-alive for streamed RSC; fix stale pool docs (#4240) (#4253) [Pro] Verify and document compression for streamed RSC responses (#4238) (#4252) [Pro] Server-Timing attribution for streamed RSC responses (#4239) (#4251) Harden docs-only safety guard against pagination regressions (#4270) Generate Tailwind as a layout-owned pack (#4182) [Pro] Test rejected RSC replacement retry notifications (#4250) Docs: record RSC Rspack client refs investigation (#4269) Release train: release-forward-port re-homes changelog to [Unreleased] (#4257) Release train: add `release finish` promote + close-out scripts (#4258) Release train: /update-changelog release-vs-main target (#4256) Release train: add `release start` (auto-create release/X.Y.Z on rc cut) (#4255) Release train: ci-changes-detector classifies release-tooling paths (skip full matrix) (#4262) Fix release forward-port post-merge review findings (#4261)
…codex/4248-rpc-helper * origin/codex/4247-rails-ts-types: Clarify response type initializer loading Fail fast for RSC on Rspack v1 (#4289) [codex] Document agent workflow trust boundary (#4288) Fix precompile hook forcing UTF-8 onto non-UTF-8 (national) locales (#4244) Regenerate Pro llms bundle (#4280) Docs: clarify RSC layout request context (#4267) [Pro] Document renderer warmup/pool/keep-alive for streamed RSC; fix stale pool docs (#4240) (#4253) [Pro] Verify and document compression for streamed RSC responses (#4238) (#4252) [Pro] Server-Timing attribution for streamed RSC responses (#4239) (#4251) Harden docs-only safety guard against pagination regressions (#4270) Generate Tailwind as a layout-owned pack (#4182) [Pro] Test rejected RSC replacement retry notifications (#4250) Docs: record RSC Rspack client refs investigation (#4269) Release train: release-forward-port re-homes changelog to [Unreleased] (#4257) Release train: add `release finish` promote + close-out scripts (#4258) Release train: /update-changelog release-vs-main target (#4256) Release train: add `release start` (auto-create release/X.Y.Z on rc cut) (#4255) Release train: ci-changes-detector classifies release-tooling paths (skip full matrix) (#4262) Fix release forward-port post-merge review findings (#4261)
Summary
RSCRspackPluginwork through thelazyCompilationfix.addInclude-only client inclusion is not yet a final architecture and what remains open for Rspack/Shakapacker follow-up.Rationale
Fresh RSC + Rspack apps now work in normal
bin/dev, but the longer-term client-reference inclusion design is still unresolved. This document preserves the investigation context so future work starts from the known constraints instead of rediscovering them.Related: #3488, #3553, #4200, #4227, #4243.
Testing
git diff --checkpnpm exec prettier --check internal/analysis/rsc-rspack-client-reference-inclusion-investigation-record-2026-06-27.mdChangelog
Review updates
addIncludeserver-entry constraints, server parity qualification, test provenance caveat, and reference completeness.