Skip to content

fix: reload on route manifest metadata changes#58

Merged
ScriptedAlchemy merged 4 commits into
mainfrom
codex/route-dev-reload-parity
Jun 29, 2026
Merged

fix: reload on route manifest metadata changes#58
ScriptedAlchemy merged 4 commits into
mainfrom
codex/route-dev-reload-parity

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Collaborator

Summary

  • detect dev route manifest metadata changes such as loader/clientLoader/export flag changes
  • trigger a full browser reload for those changes instead of relying on a React Router Vite-only route HMR runtime
  • add runtime and controller tests proving the reload path

Validation

  • pnpm test:core
  • pnpm build
  • git diff --check

Notes

Stacked on codex/asset-query-parity. This intentionally chooses the conservative full-reload fallback because the Rsbuild plugin does not currently ship React Router's Vite route-HMR runtime.

@ScriptedAlchemy ScriptedAlchemy force-pushed the codex/asset-query-parity branch from 1f2dcfd to 88aa4ec Compare June 27, 2026 06:06
@ScriptedAlchemy ScriptedAlchemy force-pushed the codex/route-dev-reload-parity branch from 7e75bfb to a38d779 Compare June 27, 2026 06:06
@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results

Compared PR head ca54408 against base 3f6db5c.

Total median wall time: 12.03s -> 11.83s (-1.7%, 1.02x speedup)
Compiler ready median: 9.90s -> 9.77s (-1.3%)
Route load median: 2.02s -> 2.00s (-0.8%)

Benchmark Base total Head total Delta Head ready Head routes Speedup Head RSS p95
large-355-ssr-esm 12.03s 11.83s -1.7% 9.77s 2.00s 1.02x -

Profile: large; mode: dev; iterations: 5; warmup: 0.
Workflow run

@ScriptedAlchemy ScriptedAlchemy force-pushed the codex/asset-query-parity branch from 88aa4ec to 8b08bd7 Compare June 28, 2026 19:58
@ScriptedAlchemy ScriptedAlchemy force-pushed the codex/route-dev-reload-parity branch from a38d779 to 6ab91d0 Compare June 28, 2026 19:58
@ScriptedAlchemy ScriptedAlchemy force-pushed the codex/asset-query-parity branch from 90ec8f4 to d20c605 Compare June 29, 2026 06:59
Base automatically changed from codex/asset-query-parity to main June 29, 2026 13:55
@ScriptedAlchemy ScriptedAlchemy force-pushed the codex/route-dev-reload-parity branch from d62c5f2 to b09e3a9 Compare June 29, 2026 16:24
@pkg-pr-new

pkg-pr-new Bot commented Jun 29, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/rsbuild-plugin-react-router@ca54408

commit: ca54408

@ScriptedAlchemy ScriptedAlchemy marked this pull request as ready for review June 29, 2026 16:34
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ScriptedAlchemy, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9249d041-d842-48c5-9d24-c70feca56f91

📥 Commits

Reviewing files that changed from the base of the PR and between 80c3447 and ca54408.

📒 Files selected for processing (3)
  • tests/dev-generation.test.ts
  • tests/dev-runtime-controller.test.ts
  • tests/dev-runtime-fixtures.ts
📝 Walkthrough

Walkthrough

A new onRouteManifestChanged callback option is added to createReactRouterDevRuntime. finishAttempt compares route manifest metadata between previous and next web compilations, and invokes the callback when the metadata changes. The runtime controller handles the callback by sending a full-reload socket message. Test fixtures are updated to support route manifest overrides and callback wiring, and new tests cover the generation and controller behavior.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: reloading on route manifest metadata changes.
Description check ✅ Passed The description accurately matches the implemented metadata-change detection, full reload fallback, and added tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/route-dev-reload-parity

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@src/dev-generation.ts`:
- Around line 589-591: Coalesce the duplicate full-reload path in the mixed CSS
+ route metadata update flow: `notifyRouteManifestChanged()` in
`src/dev-generation.ts` can be reached after the CSS ownership notification
path, and both end up triggering the same `server.sockWrite('full-reload', {
path: '*' })` behavior in `dev-runtime-controller`. Update the decision logic
around the CSS notification and `routeManifestMetadataChanged` handling so a
single rebuild attempt only emits one hard-reload, using the existing
`notifyRouteManifestChanged`/CSS notification branches as the points to dedupe.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d0d36390-a048-4803-b14b-7ded15ca891a

📥 Commits

Reviewing files that changed from the base of the PR and between 3f6db5c and b09e3a9.

📒 Files selected for processing (6)
  • src/dev-generation.ts
  • src/dev-runtime-controller.ts
  • tests/dev-generation-fixtures.ts
  • tests/dev-generation.test.ts
  • tests/dev-runtime-controller.test.ts
  • tests/dev-runtime-fixtures.ts

Comment thread src/dev-generation.ts
@ScriptedAlchemy ScriptedAlchemy merged commit b322159 into main Jun 29, 2026
7 checks passed
@ScriptedAlchemy ScriptedAlchemy deleted the codex/route-dev-reload-parity branch June 29, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant