Skip to content

[codex] support React Router 8 compatibility#74

Draft
ScriptedAlchemy wants to merge 30 commits into
mainfrom
codex/react-router-8-compat-v2
Draft

[codex] support React Router 8 compatibility#74
ScriptedAlchemy wants to merge 30 commits into
mainfrom
codex/react-router-8-compat-v2

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Collaborator

Summary

Restores the closed React Router 8 compatibility work from PR #67 onto current main, keeping the newer lazy compilation/dev background resource path from PR #54.

  • adds React Router 8 and RSC plugin support, exports, templates, examples, and framework compatibility coverage
  • keeps classic mode route transforms/lazy prewarm behavior on the current main implementation
  • makes dev background route resources tolerate RSC mode where there is no classic route transform executor
  • intentionally leaves the dynamic CSS parity branch closed per follow-up scope

Validation

  • CI=true pnpm install --lockfile-only
  • pnpm build
  • pnpm test:package-interop
  • pnpm test:core
  • pnpm --filter './examples/{react-router-8,rsc-mode}' typecheck\n- pnpm --filter './examples/{react-router-8,rsc-mode}' test:e2e\n\n## Notes\n\nThe workspace still reports existing engine warnings for several examples under Node 24 and peer warnings from mixed React Router fixture versions; the validation commands above completed successfully.

@pkg-pr-new

pkg-pr-new Bot commented Jul 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 0871b63

Comment thread tests/react-router-framework/integration/helpers/create-fixture.ts Fixed
Comment thread tests/react-router-framework/integration/helpers/create-fixture.ts Fixed
Comment thread tests/react-router-framework/integration/helpers/create-fixture.ts Fixed
Comment thread tests/react-router-framework/integration/helpers/create-fixture.ts Fixed
Comment thread tests/react-router-framework/integration/helpers/create-fixture.ts Fixed
Comment on lines +269 to +271
return `export const HydrateFallback = React.lazy(() => import(${JSON.stringify(
target
)}).then(mod => ({ default: mod.HydrateFallback })));`;
Comment on lines +278 to +280
return `export const ${exportName} = async (...args) => import(${JSON.stringify(
target
)}).then(mod => mod.${exportName}(...args));`;
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results

Compared PR head 0871b63 against base c93ec98.

Dev Rollup

Group Fixtures Base total Head total Delta Base ready Head ready Ready delta Base routes Head routes Route delta Base update/HMR Head update/HMR Update delta Speedup
All dev fixtures 7 29.47s 35.24s +19.6% 19.72s 18.53s -6.0% 3.97s 3.65s -7.9% 3.27s 3.02s -7.5% 0.84x
Large app 1 13.83s 14.68s +6.2% 8.44s 7.95s -5.8% 2.01s 1.81s -10.1% 1.75s 1.63s -6.9% 0.94x
Standard fixtures 6 15.65s 20.56s +31.4% 11.28s 10.58s -6.2% 1.96s 1.85s -5.7% 1.52s 1.39s -8.2% 0.76x

Production Build Benchmarks

Rendered 7 production build benchmarks.

Benchmark Runs Base total Head total Delta Head mean Head p95 Speedup Head RSS p95
large-355-ssr-esm 5 8.71s 8.43s -3.2% 8.45s 8.61s 1.03x 1520 MB
synthetic-1024-ssr-esm 5 4.18s 3.64s -12.9% 3.71s 3.91s 1.15x 636 MB
synthetic-1024-ssr-esm-split 5 5.57s 5.11s -8.2% 5.11s 5.20s 1.09x 802 MB
synthetic-256-sourcemaps 10 2.17s 2.00s -7.9% 2.02s 2.20s 1.09x 447 MB
synthetic-256-ssr-esm 10 2.02s 1.88s -7.0% 1.89s 2.07s 1.08x 394 MB
synthetic-256-ssr-esm-split 10 2.44s 2.26s -7.0% 2.28s 2.42s 1.08x 449 MB
synthetic-48-ssr-esm 10 1.35s 1.31s -2.9% 1.33s 1.59s 1.03x 322 MB

full Dev Fixture Summary

Rendered 7 dev benchmark fixtures from the full profile.

Benchmark Runs Base total Head total Delta Base ready Head ready Base routes Head routes Base update/HMR Head update/HMR Update delta Head mean Head p95 Speedup Head RSS p95
large-355-ssr-esm 5 13.83s 14.68s +6.2% 8.44s 7.95s 2.01s 1.81s 1.75s 1.63s -6.9% 14.74s 15.10s 0.94x -
synthetic-1024-ssr-esm 5 4.63s 6.43s +39.0% 3.30s 3.10s 0.56s 0.52s 0.50s 0.50s +0.1% 6.43s 6.49s 0.72x -
synthetic-1024-ssr-esm-split 5 4.60s 6.44s +40.1% 3.29s 3.07s 0.54s 0.53s 0.51s 0.50s -0.5% 6.44s 6.54s 0.71x -
synthetic-256-sourcemaps 10 2.00s 2.65s +32.5% 1.50s 1.43s 0.25s 0.22s 0.15s 0.13s -16.9% 2.64s 2.72s 0.75x -
synthetic-256-ssr-esm 10 1.76s 2.03s +15.5% 1.27s 1.17s 0.24s 0.22s 0.15s 0.10s -31.4% 2.02s 2.07s 0.87x -
synthetic-256-ssr-esm-split 10 1.75s 2.05s +17.1% 1.26s 1.20s 0.23s 0.22s 0.15s 0.10s -32.6% 2.03s 2.07s 0.85x -
synthetic-48-ssr-esm 10 0.91s 0.96s +5.1% 0.66s 0.60s 0.13s 0.12s 0.05s 0.05s +0.4% 0.95s 0.98s 0.95x -

large-355-ssr-esm Plugin Operations

Environment Operation Count Base total Head total Delta Head wall Head max Reports
web route:module 1785 1713.2ms 1792.4ms +4.6% 1792.4ms 16.7ms 10
node route:module 1785 910.1ms 849.9ms -6.6% 849.9ms 13.1ms 10
web route:client-entry 1785 380.3ms 483.1ms +27.0% 483.1ms 11.1ms 10
node manifest:transform 5 141.8ms 118.5ms -16.4% 118.5ms 32.6ms 5
web manifest:stage 15 14.4ms 19.6ms +36.1% 19.6ms 2.0ms 15
web manifest:transform 5 0.5ms 0.5ms 0.0% 0.5ms 0.1ms 5
node assets:relocate-ssr-only 10 - 134.1ms - 134.1ms 14.0ms 10

synthetic-1024-ssr-esm Plugin Operations

Environment Operation Count Base total Head total Delta Head wall Head max Reports
web route:module 5130 2035.1ms 1957.0ms -3.8% 1957.0ms 13.1ms 10
node route:module 5130 921.3ms 1009.1ms +9.5% 1009.1ms 16.4ms 10
web route:client-entry 5130 627.2ms 602.4ms -4.0% 602.4ms 8.7ms 10
node manifest:transform 5 208.2ms 190.5ms -8.5% 190.5ms 39.9ms 5
node module:client-only-stub 5 103.1ms 228.7ms +121.8% 228.7ms 166.9ms 5
web manifest:stage 15 59.4ms 61.6ms +3.7% 61.6ms 7.2ms 15
web manifest:transform 5 0.5ms 0.5ms 0.0% 0.5ms 0.1ms 5
node assets:relocate-ssr-only 10 - 2.0ms - 2.0ms 0.3ms 10

synthetic-1024-ssr-esm-split Plugin Operations

Environment Operation Count Base total Head total Delta Head wall Head max Reports
web route:module 5130 2056.4ms 1987.2ms -3.4% 1987.2ms 13.0ms 10
node route:module 5130 919.2ms 960.1ms +4.4% 960.1ms 15.0ms 10
web route:client-entry 5130 603.6ms 562.3ms -6.8% 562.3ms 8.6ms 10
node module:client-only-stub 5 469.5ms 79.4ms -83.1% 79.4ms 20.3ms 5
node manifest:transform 5 204.7ms 202.9ms -0.9% 202.9ms 45.5ms 5
web manifest:stage 15 60.7ms 60.6ms -0.2% 60.6ms 7.0ms 15
web manifest:transform 5 0.5ms 0.5ms 0.0% 0.5ms 0.1ms 5
node assets:relocate-ssr-only 10 - 2.0ms - 2.0ms 0.3ms 10

synthetic-256-sourcemaps Plugin Operations

Environment Operation Count Base total Head total Delta Head wall Head max Reports
web route:module 2580 1410.9ms 1402.9ms -0.6% 1402.9ms 11.6ms 20
node route:module 2580 598.2ms 660.4ms +10.4% 660.4ms 5.6ms 20
web route:client-entry 2580 397.2ms 336.1ms -15.4% 336.1ms 6.4ms 20
node module:client-only-stub 10 244.6ms 179.0ms -26.8% 179.0ms 107.1ms 10
node manifest:transform 10 145.5ms 160.9ms +10.6% 160.9ms 19.5ms 10
web manifest:stage 31 20.1ms 27.5ms +36.8% 27.5ms 1.4ms 31
web manifest:transform 10 1.0ms 1.0ms 0.0% 1.0ms 0.1ms 10
node assets:relocate-ssr-only 21 - 4.4ms - 4.4ms 0.4ms 21

synthetic-256-ssr-esm Plugin Operations

Environment Operation Count Base total Head total Delta Head wall Head max Reports
web route:module 2581 1358.0ms 1315.1ms -3.2% 1315.1ms 15.9ms 21
node route:module 2580 553.6ms 602.5ms +8.8% 602.5ms 4.9ms 20
web route:client-entry 2581 383.5ms 396.9ms +3.5% 396.9ms 6.8ms 21
node module:client-only-stub 10 195.5ms 256.6ms +31.3% 256.6ms 139.8ms 10
node manifest:transform 10 151.0ms 156.4ms +3.6% 156.4ms 21.7ms 10
web manifest:stage 31 20.2ms 27.1ms +34.2% 27.1ms 1.4ms 31
web manifest:transform 10 1.0ms 2.0ms +100.0% 2.0ms 1.1ms 10
node assets:relocate-ssr-only 21 - 4.2ms - 4.2ms 0.3ms 21

synthetic-256-ssr-esm-split Plugin Operations

Environment Operation Count Base total Head total Delta Head wall Head max Reports
web route:module 2583 1325.3ms 1347.9ms +1.7% 1347.9ms 18.3ms 23
node route:module 2581 542.4ms 591.8ms +9.1% 591.8ms 8.3ms 21
web route:client-entry 2583 380.0ms 372.7ms -1.9% 372.7ms 6.2ms 23
node manifest:transform 10 179.8ms 140.7ms -21.7% 140.7ms 21.9ms 10
node module:client-only-stub 10 131.9ms 131.8ms -0.1% 131.8ms 32.3ms 10
web manifest:stage 33 20.6ms 31.9ms +54.9% 31.9ms 4.2ms 33
web manifest:transform 10 1.0ms 1.0ms 0.0% 1.0ms 0.1ms 10
node assets:relocate-ssr-only 25 - 5.0ms - 5.0ms 0.3ms 25

synthetic-48-ssr-esm Plugin Operations

Environment Operation Count Base total Head total Delta Head wall Head max Reports
web route:module 500 487.5ms 429.0ms -12.0% 429.0ms 9.3ms 20
node route:module 500 163.8ms 136.6ms -16.6% 136.6ms 1.6ms 20
web route:client-entry 500 107.7ms 81.1ms -24.7% 81.1ms 2.4ms 20
node module:client-only-stub 10 76.8ms 68.7ms -10.5% 68.7ms 13.0ms 10
node manifest:transform 10 50.2ms 44.2ms -12.0% 44.2ms 6.2ms 10
web manifest:stage 30 5.5ms 7.8ms +41.8% 7.8ms 0.4ms 30
web manifest:transform 10 1.0ms 1.0ms 0.0% 1.0ms 0.1ms 10
node assets:relocate-ssr-only 20 - 4.0ms - 4.0ms 0.3ms 20

Synthetic Rsbuild App

Rendered 2 production build benchmarks.

Benchmark Runs Base total Head total Delta Head mean Head p95 Speedup Head RSS p95
complex app 2 113.46s 112.07s -1.2% 112.07s - 1.01x -
complex app 2 78.98s 77.86s -1.4% 77.86s - 1.01x -

Rendered 1 dev benchmark fixture from the embedded complex app.

Benchmark Runs Base total Head total Delta Base ready Head ready Base routes Head routes Base update/HMR Head update/HMR Update delta Head mean Head p95 Speedup Head RSS p95
complex app 2 96.87s 97.14s +0.3% 88.10s 85.36s 2.88s 2.79s 3.29s 3.15s -4.2% 97.14s - 1.00x -

Profile: full; mode: dev; iterations: 10; warmup: 0.
The uploaded benchmark artifact includes diagnostics/summary.md and diagnostics/summary.json with runner metadata, per-run timing samples, CPU/RSS samples, and plugin timing hot spots.
Workflow run

ScriptedAlchemy and others added 10 commits July 3, 2026 20:28
…typing

- one resolveAppPackagePath/getPackageVersion pair in plugin-utils
  (react-router version now resolved from the app, not the plugin install)
- extract createRouteManifestItem from the dev-manifest effect and
  collapse the per-chunk module lookups
- replace Awaited<ReturnType<...>>/Parameters<...>[5] gymnastics with
  the exported ReactRouterManifestForDev/RouteChunkManifestOptions types
- type modePlan webOutput/webOptimization with Rspack config types and
  drop the as-const noise
- dedupe classic server-build options, single rsc-option normalization,
  inline single-use query helpers, remove plugin factory indirection

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Transformed routes import UNSAFE_withComponentProps and friends from
react-router, which only exist from 7.7.0; 7.13 is the lowest v7 line
this plugin is tested against (main's previous floor). Widening the
peer range to ^7.0.0 let 7.0-7.12 installs pass peer resolution and
then fail every classic-mode build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Register the RSC request listener via the server.setup post-callback so
it runs after compiled-asset and public-dir middlewares, making it the
fallback for anything static serving declines - the same routing
semantics as production. This removes the GET/POST and file-extension
bypass heuristics that 404'd extension-ful resource routes (e.g.
/sitemap.xml) and non-GET/POST resource routes in dev; only /__rsbuild_
internals bypass the handler now.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Wire the prerender config into the RSC mode plan and add an
onAfterBuild step that replays upstream's RSC prerender pipeline
against the built server bundle's fetch handler: emits
<path>/index.html plus <path>.rsc flight payloads (_.rsc for the
root), meta-refresh documents for redirects, raw bytes for resource
routes, and __spa-fallback.html/.rsc for ssr:false builds. The RSC
preview fixture now serves prerendered documents and the SPA fallback
like upstream's configurePreviewServer. Classic-mode prerender is
untouched.

Vendored parity tests rsc/rsc-prerender-test.ts now pass 3/3.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
createReactRouterModePlan is now a thin dispatcher over
createClassicModePlan / createRscModePlan with a narrow shared
ModePlanContext, so each mode's planner owns only the inputs it uses
instead of one 30-field options blob feeding both branches.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The sync script now carries a pinned upstream ref
(4cf6e62d0cdf9d7f6e09b0ea10077d7fb0e1b438), refuses to sync from a
dirty or mismatched source checkout (--update-pin adopts a new sha),
and writes tests/react-router-framework/UPSTREAM.json recording the
repository, sha, source dirs, file count, and adapter-owned overlay
list. The README documents the pin-update flow and that everything
outside the adapter-owned files is generated and must not be
hand-edited.

corpusVerified is false: 13 checked-in files drift from the pinned
sha (a locally added rsc-framework-test.ts plus Rsbuild adaptations
and small edits) - recorded in the manifest as an undeclared overlay
to classify in a follow-up.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The corpus is repo-owned and rsbuild-adapted; UPSTREAM.json records
provenance only. Delete the five checked-in template vite.config.ts
files (the adapter generates rsbuild.config.ts and never reads them)
and strip vite/@vitejs/@vanilla-extract/vite-plugin/@cloudflare/
vite-plugin/vite-tsconfig-paths entries from corpus package.jsons
(never installed - the corpus is not a workspace package and the
adapter rewrites fixture deps wholesale). No test file imports 'vite'
at top level; remaining matches are fixture template strings the
adapter converts. vite-env-only stays: fixture app code imports its
macros.

Verified: playwright smoke 7/7, test:core 490/490.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
RSC mode silently ignored buildEnd, presets, serverBundles, and
subResourceIntegrity from react-router.config - a user's buildEnd hook
never fired and serverBundles/SRI produced nothing with no signal.
Upstream's RSC vite plugin rejects these with a validation error;
assertReactRouterRscConfigSupport now does the same.

allowedActionOrigins was also dropped in RSC mode even though
react-router's matchRSCServerRequest supports it (upstream's default
RSC entry drops it too). Expose it as a
virtual/react-router/unstable_rsc/allowed-action-origins module and
pass it through the entry template so action-origin restrictions apply.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The RSC mode plan pinned routeChunkConfig.splitRouteModules to false,
so a configured 'enforce' never triggered chunk validation. Upstream's
RSC vite plugin gates validation on config.splitRouteModules ===
'enforce' while chunk splitting itself stays content-detected - pass
the resolved config value through to match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ScriptedAlchemy and others added 10 commits July 3, 2026 23:42
The config factory in integration/helpers/vite.ts now emits
rsbuild.config.ts content (pluginReactRouter/pluginReactRouterRSC +
pluginReact, pluginMdx when needed) with real option mappings:
base->output.assetPrefix, port->server.port+strictPort,
assetsInlineLimit->output.dataUriLimit, assetsDir->output.distPath,
vanilla-extract via @vanilla-extract/webpack-plugin (deterministic
identifiers, realContentHash off, sideEffects workaround). ~35 inline
vite.config fixture strings converted across 20+ test files; Vite-only
suites (plugin-order validation, @cloudflare/vite-plugin, fs.allow)
carry visible describe/test.skip with reasons. The vite-7/vite-8
template pair is collapsed to one (identical under rsbuild), halving
template-parameterized suite runs. The adapter's vite.config
interception is now a warn-loudly dead path (0 hits across all runs).

Verified against captured baselines: no test that passed before fails
after; vite-manifests (3), server-bundles dev/build-manifest,
spa-mode manifest, and vanilla-extract no-JS suites (3) newly pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Route edits in classic dev now apply through react-refresh instead of
full reloads, and loader/action changes trigger client revalidation:

- src/dev-hmr.ts: resolves @rsbuild/plugin-react's react-refresh
  runtime, generates a dev-only HMR runtime virtual module, and
  maintains an HDR revision module that the dev runtime bumps when a
  node rebuild commits so the browser revalidates loader data.
- route transforms gain a devHmr mode wrapping client route modules
  with refresh registration; dev-runtime-controller patches route
  metadata on the client and signals rebuild commits instead of
  forcing full reloads.
- When the react-refresh runtime is absent (or in RSC/build mode),
  everything falls back to the previous full-reload behavior.

Vendored parity tests vite-hmr-hdr-test.ts now pass 3/3 (previously
0/6 pre-template-collapse). vite-dev-test.ts guard: 12 passed, 4
pre-existing failures verified identical without this change.

This work was implemented by a subagent whose worktree was lost to a
session limit; the change set was recovered by replaying its recorded
54 edit operations and validated byte-for-byte against its partial
snapshot.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The helper spawnSyncs 'rsbuild dev' expecting Vite's validate-and-exit
startup behavior; rsbuild's dev server never self-terminates, which
blocked a suite run indefinitely when a test assumed an error exit.
Triage confirmed no plugin or rsbuild bug (config function-form was
coincidental): a 30s timeout keeps any such assumption from hanging
the harness again.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two manifest asset-URL bugs:

- The dev manifest derived its asset prefix solely from
  output.assetPrefix, ignoring dev.assetPrefix (Rsbuild's effective
  prefix in dev, defaulted from server.base). Asset URLs 404'd for any
  app configuring a dev prefix. resolveEffectiveAssetPrefix now mirrors
  Rsbuild's per-mode precedence off the normalized config, resolved in
  onBeforeCreateCompiler.

- The build-mode browser manifest was generated at processAssets stage
  'additions' (-100), before rspack's realContentHash rename at
  OPTIMIZE_HASH (2500), so manifest CSS/JS URLs could reference
  pre-rename hashed names absent from the output. Build-mode manifest
  generation and emission now run at 'report' (5000), unifying the
  previously separate SRI deferral; dev keeps 'additions' (no
  realContentHash pass in dev).

test:core 491 -> 499. Classic-mode basename dev/build corpus cases all
pass; vanilla-extract build cases pass with the fixtures'
realContentHash:false workaround removed (workaround removal lands
with the corpus rename commit).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Content-level renames completing the file renames that landed with
fb25f5a: viteConfig->rsbuildConfig (77 refs), vitePreview->
rsbuildPreview, viteDevCmd->rsbuildDevCmd, viteMajorTemplates->
bundlerTemplates, Rsbuild-accurate describe/test titles ('Vite CSS'->
'CSS', 'vite dev'->'rsbuild dev', ...), rsc fixture package scripts
now say rsbuild, and UPSTREAM.json gains a complete upstream->corpus
renames map (31 entries) so manual upstream comparison survives the
renames. The two describe.skip'ed Vite-only suites keep their accurate
Vite titles, as do assertions on strings React Router itself emits.

Also applies the deferred manifest-fix corpus hunk to the renamed
config factory: 'base' now maps to dev.assetPrefix as well (the plugin
honors it since fb25f5a) and the vanilla-extract realContentHash:false
workaround is removed (manifest reads post-hash names now).

Verified: test:core 499; smoke 7/7; hmr-hdr 3/3; css+basename exactly
match pre-existing baselines (24 passed / 14 failed / 3 skipped / 1
DNR - zero new failures); corpus greps for vite-flavored helper names
come back empty.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Assets referenced only by server code (asset?url imports, .css?url
files) are returned to the client as URLs but were never emitted to
build/client, 404ing at runtime. Mirroring upstream's ssrEmitAssets +
writeBundle move/remove: a node-target processAssets 'report' hook
(post-realContentHash, so names are final) relocates emitted static
assets into the client output when absent and strips them from the
server build; server code-split chunks get a proper async chunkFilename
and server-only .css?url output is redirected to the flat
static/assets layout while preserving postcss processing.

Verified against rsbuild source: dev serves from real disk when
writeToDisk is on (setupOutputFileSystem), cleanAll runs before
compilations so relocated files survive, and the uniform assetPrefix
keeps loader-returned URLs aligned. No rsbuild/rspack built-in covers
cross-environment asset sharing (tracedecay-searched), so the
relocation module stays.

Corpus: build-test + extra-server-environment now 9/9 (combined with
the post-realContentHash manifest fix, even code-split CSS passes);
smoke 7/7; test:core 506.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
tests/react-router-framework/.tmp/ (7,856 materialized fixture files)
was accidentally committed by a broad git add during the corpus work,
inflating the PR diff massively. Untrack it and ignore fixture scratch,
test-results, and playwright reports going forward.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Four-angle review (reuse/simplification/efficiency/altitude) over the
RR8 branch diff:

- assetPrefix now has a single writer (onBeforeCreateCompiler); the two
  config-phase assignments are gone and the virtual-module publicPath
  reads output.assetPrefix locally
- RscModePlan drops its routeTransformExecutor/routeChunkOptions
  sentinels; the one unguarded consumer gates on plan kind
- shared parseVersionMajorMinor replaces two divergent react-router
  version parsers; getPackageVersion memoizes default-resolver lookups
- rsc-route-transforms imports CLIENT_NON_COMPONENT_EXPORTS from
  constants instead of redefining it; SPA_FALLBACK_HTML_FILE is a
  shared constant across both prerender pipelines; RSC basename/
  bootstrap prefixes reuse normalizeAssetPrefix (was 4 copies)
- route modules are no longer parsed for analysis in the node
  transform (client-entry covers every route; disk fallback intact),
  removing 1-2 redundant SWC parses per route per build
- ssr-asset-relocation caches relocated destinations across node
  compilations (serverBundles, dev rebuilds) skipping steady-state
  stat/write syscalls; dev-hmr skips redundant mkdir after first bump
- react-refresh runtime resolution no longer falls back to a bare
  root resolve that could bind a different physical instance than the
  browser graph (silent no-op refresh); unavailable now means the
  documented full-reload path
- devHmr options pass through the mode plan without re-projection;
  RSC virtual modules share a defaultExport helper; classic
  createResolveConfig drops its empty-alias conditional

Skipped deliberately: the node .css?url filename mapping (documented,
empirically-validated tradeoff), hooks-per-mode/discriminated-union
mode-plan reshape (deferred, larger), PrerenderConfig type unification
(low value vs inference churn), shared classic/RSC alias builder
(resolution semantics deliberately differ). manifestChunkNames on
RscModePlan was confirmed live (web clientStats), not dead state.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The interop script's hand-rolled plugin API stub predates the
onBeforeCreateCompiler registration added for effective-asset-prefix
resolution, so CI's build-test failed with 'api.onBeforeCreateCompiler
is not a function'. The hook exists on the real Rsbuild plugin API
(@rsbuild/core 2.x); only the stub was stale.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ScriptedAlchemy and others added 4 commits July 4, 2026 02:42
Repo-wide sweep found exactly two stale references from the vite->
rsbuild corpus renames (template package name, a comment pointing at a
pre-rename test filename) plus one ambiguous upstream-provenance line
in the react-router-8 example README. Everything else matching vite*
is intentional: upstream BuildEndHook.viteConfig API surface, the
UPSTREAM.json renames/provenance maps, and rename documentation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Leftovers sweep follow-ups: the package-interop API stub gains
modifyBundlerChain and isPluginExists (only reached on the RSC path
today - same failure class as the onBeforeCreateCompiler break);
hdrRevisionModuleContent is de-exported (single in-file consumer).
tsc --noUnusedLocals verified zero unused imports; mode-plan/
entry-paths type exports stay - declaration emit requires them for
exported function signatures.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- requestSingleFetchData now re-keys decoded SingleFetchRedirect
  entries onto the harness react-router's symbol instance - the fixture
  (RR 8.1) and harness (RR 7.18) each own a distinct
  Symbol('SingleFetchRedirect'), so equality assertions could never
  match (6 failures)
- SPA-mode preview serves build/client statically with an index.html
  fallback (extension-ful misses 404 so networkidle settles) instead of
  invoking react-router-serve on a server bundle SPA builds don't have
- the 'Custom dev servers need an Rsbuild dev-server adapter'
  placeholders are replaced with a real adapter (createRsbuild ->
  createDevServer -> express app.use(devServer.middlewares)), which the
  plugin's classic AND rsc dev handlers both attach to - covers 9 of 10
  custom-server cases; loader-context keeps an accurate throw (needs a
  plugin-side load-context entry, out of harness scope)

RSC bundler-mode fixtures (rsc-test/rsc-nojs, 4 failures) are NOT
converted: they target unstable_RSCRouteConfig bundler mode while the
adapter generates framework-mode configs - a fixture mode-migration
tracked separately, not a rename.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…l, splat warning, prerender root loader

Salvaged from credit-interrupted agents (quick-wins batch + workflow
prerender feature), verified via unit suite:

- dev/browser manifest no longer lists a route's own module inside
  route.imports (duplicate modulepreload hrefs)
- route-config-not-found error names app/routes.ts like upstream
  instead of the last-probed .tsx extension
- entry.client web entry sets html:false so no stray entry.client.html
  lands in build/client
- prerender:true now warns for dynamic/splat paths that cannot be
  enumerated, matching upstream's message
- ssr:false prerender validation exempts the root route's loader the
  way upstream does (root loader is allowed when prerendering)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants