Commit 58ab0dd
authored
Fix RSC install and doctor diagnostics (#4213)
## Why
This batch covers the RSC install/doctor blockers filed by Justin in
#4198, #4199, #4200, and #4204.
RSC setup failures were too easy to misdiagnose: `react-on-rails-rsc`
could be installed on a React line that its own peer dependencies did
not support, a stale `latest` vs `next` npm track could be missed, and
an empty or dev-server-backed client manifest could surface as a generic
React Client Manifest/bundler failure.
## What changed
- Adds doctor validation for installed `react-on-rails-rsc` peer
requirements against installed `react` and `react-dom`, including
`FORMAT=json` coverage under `react_server_components`.
- Warns when installed `react-on-rails-rsc` is behind newer `next` or
`rc` npm dist-tags.
- Adds doctor diagnostics for missing, URL-backed, invalid,
missing-metadata, or empty RSC client manifests, with `bin/dev static`
and clean rebuild guidance.
- Enriches Pro RSC React Client Manifest lookup failures with
stale/empty/cross-version manifest guidance.
- Adds generator test coverage proving the current stable RSC pairing
remains intentional: React/React DOM on the `~19.0.4` policy and
`react-on-rails-rsc@19.0.5`.
- Adds a scoped #4204 investigation comment for the remaining
artifact/freshness and RSC-only doctor-mode work:
#4204 (comment)
## Issue handling
- Fixes #4198.
- Addresses #4199 with generator coverage and live npm evidence that the
stable pin is intentional.
- Fixes #4200.
- Scopes #4204; the remaining artifact/freshness checks and a dedicated
RSC-only doctor entrypoint are deferred to a focused follow-up.
## Verification
Coordinator and QA lane evidence:
- `bundle exec rspec spec/lib/react_on_rails/doctor_spec.rb --format
progress` -> 286 examples, 0 failures.
- `bundle exec rspec
spec/react_on_rails/generators/install_generator_spec.rb:2769
spec/react_on_rails/generators/install_generator_spec.rb:3139 --format
progress` -> 2 examples, 0 failures.
- `bundle exec rspec
spec/react_on_rails/generators/js_dependency_manager_spec.rb:702
--format progress` -> 3 examples, 0 failures on the #4199 lane.
- `pnpm --filter react-on-rails-pro run test:rsc` -> 6 suites, 18 tests
passed.
- `pnpm --filter react-on-rails-pro run type-check` -> pass.
- `pnpm --filter react-on-rails-pro run build` -> pass.
- `BUNDLE_GEMFILE=../Gemfile bundle exec rubocop
lib/react_on_rails/doctor.rb spec/lib/react_on_rails/doctor_spec.rb
spec/react_on_rails/generators/install_generator_spec.rb` -> no
offenses.
- `git diff --check` -> pass.
- `pnpm exec prettier --check ...` on touched TS files -> pass.
- Targeted ESLint exited 0; the new RSC test file is ignored by the repo
config with a warning.
- `script/ci-changes-detector origin/main` routes this as broad: Ruby
core, generator, Pro TS, and uncategorized/full-suite safety.
## Flagship demo decision
No flagship demo update is needed. No recommended Pro/RSC defaults
changed. Live npm metadata still has `react-on-rails-rsc@latest =
19.0.5` with React peers `^19.0.4`; `next = 19.2.0-rc.4` peers on React
`^19.2.7`.
## Risks / deferred work
- No live `bin/dev` / `bin/dev static` browser smoke was run in this
batch. Coverage is focused doctor/generator/Pro RSC unit evidence plus
the required QA lane.
- `claude-review` is not installed in this environment, so the
independent review gate used here was the dedicated QA subagent plus
local validation.
- #4204 freshness design remains UNKNOWN until a follow-up chooses
authoritative build metadata or a tested heuristic for cross-manifest
consistency.
## Closeout update
- Latest reviewed head: `eb44230070e4065edc393a2bdba4cf75b32bff0a`.
- Additional local validation on the final review-fix batches: Ruby
syntax checks; `bundle exec rspec
spec/lib/react_on_rails/doctor_spec.rb` -> 305 examples, 0 failures;
focused RuboCop -> no offenses; `pnpm exec prettier --check
packages/react-on-rails-pro/src/handleErrorRSC.ts` -> pass; `pnpm
--filter react-on-rails-pro test:rsc -- --runTestsByPath
tests/handleErrorRSC.rsc.test.ts` -> 6 suites, 18 tests passed; `git
diff --check` -> pass.
- Review thread closeout: trusted Claude threads through
2026-06-26T04:47:15Z were replied to and resolved; latest
unresolved-thread sweep on `eb4423007` found 0 unresolved threads.
- Merge ledger: `script/pr-merge-ledger 4213 --strict --pretty
--changelog-classification changelog_present` at 2026-06-26T04:53:21Z
reported `complete_allowed: true`; final ledger will be rerun after
current-head hosted checks/review finish.
- Security preflight note: `github-actions[bot]` comment content is
ignored as untrusted per maintainer acknowledgement; trusted review
comments only were used as actionable input.
## Merge authority
User-authorized auto-merge when gates pass. Maintainer instruction in
Codex thread on 2026-06-26: proceed while ignoring the untrusted GitHub
Actions bot comment content, and auto-merge when gates pass.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Enhanced React Server Components setup diagnostics: React/ReactDOM
peer compatibility validation for `react-on-rails-rsc`, npm dist-tag
awareness for potentially stale installs, and React Client Manifest
checks with static-mode recovery guidance.
* **Bug Fixes**
* Improved Pro React Server Components render error messaging by
appending targeted help when the React Client Manifest lookup fails.
* **Tests**
* Expanded RSC doctor and Pro error-handling test coverage for manifest
edge cases, dist-tag behavior, and peer/version validation.
* **Documentation**
* Updated the changelog with the new Pro RSC diagnostic behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 41a81e6 commit 58ab0dd
6 files changed
Lines changed: 1424 additions & 28 deletions
File tree
- packages/react-on-rails-pro
- src
- tests
- react_on_rails
- lib/react_on_rails
- spec
- lib/react_on_rails
- react_on_rails/generators
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
29 | 44 | | |
30 | 45 | | |
31 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
20 | 39 | | |
21 | | - | |
| 40 | + | |
22 | 41 | | |
23 | 42 | | |
24 | 43 | | |
| |||
Lines changed: 77 additions & 0 deletions
| 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 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
0 commit comments