Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: truePre-merge checks:
|
🦋 Changeset detectedLatest commit: 5d84d88 The changes in this PR will be included in the next version bump. This PR includes changesets to release 25 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
|
View your CI Pipeline Execution ↗ for commit b4966c6
💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗ ☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview15 package(s) bumped directly, 10 bumped as dependents. 🟨 Minor bumps
🟩 Patch bumps
|
Bundle Size Benchmarks
The following scenarios have bundle-size changes compared with the baseline:
Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better. |
Headroom after this PR. How much time a faster compiler could still win, and where the rest goes. 338-route Start apps and 333-route Router apps, median ms of 7 runs at
¹ Three of the seven floor runs read 1.27–2.08 s (a load blip), so the CI says nothing here; the other four read 880–907 ms. Compiler-only work can still win at most ~0.15–0.5 s on Router and ~0.7–1.1 s on Start, for React and Solid alike. Solid's floor is 1.4–5× React's because of HMR against
|
Merging this PR will regress 1 benchmark2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
What this rewrite unlocks. Before: each transform re-parsed the previous one's output, APIs were matched by name, and removal was guessed. Now:
The stance of this PR. Route splitting, Effort: S = days, M = weeks, L = a quarter. Kept out of this PR, cheap to add now
Top picks beyond
|
… a split method reads it, as on main A method that stays in the route module is route-module code: main reads no method when it picks shared names. It counts as a reader only of names a split method reads (DESIGN-u4-2-shared-vs-method.md). c3 (a split method's shared value runs before the route module's statements) goes to KNOWN-BUGS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he loader metadata A module the router's or Start's loader passes through keeps the fourth callback argument an earlier loader handed on (u7#1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… when Vite empties the output directory With `emptyOutDir: false`, `build.write: false` in watch mode or an output directory outside the root, the last client build stays on disk: a failed rebuild keeps its record (u7#2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le's environment On the server, only an entry point the compiler reads counts as Start use; a runtime subpath (`@tanstack/react-start/server`) no longer fails an SSR-only module. The client stays conservative (u7#3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ylesheet of cssCodeSplit: false The client's option decides; the server links what the capture recorded and no longer reads its own `cssCodeSplit` (u7#4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and hydration ids per host Vite and Rsbuild each read a module's resource once and collect both kinds of manifest metadata into ordered sets (u7#6). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…publishes before another plugin's asset move (u7#5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rule keeps its predicates and other effects; a nested rule's oneOf picks the RSC-specific SWC options per module, after the rule's own effects and before its oneOf. Replaces the whole-rule clones and the delete-every-key loop (u9#2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… reaches it
The asset rule no longer needs a `url` dependency: a denied file a
pattern import reaches (`webpackContext`, a template `import()`) is
served its mock, as Vite's `load` serves it; a JSON module's mock is
`{}` (u6#1, Rsbuild half; main too). Vite's `new URL` half stays a pin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ild fails `clientOutputMissing` covers every production server build, not only RSC ones: `rsbuild build --environment ssr` built a server whose manifest was the placeholder and whose gate answered no client call (u7g#1; main failed this build too). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…der replacement `tapManifestRebuild` at finishMake stage 10 rebuilds the RSC server's manifest module before `processAssets` (a cold e2e/react-start/rsc-rsbuild build never met the placeholder there), and a build without a client build fails at `clientOutputMissing`: the asset scan, the placeholder and `generateManifestValueLiteral` go (u7g#3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… breaks the client build Stripping a link removed the text from the receiver's end to the call's end, so a grouping paren before the receiver stayed in the output. The call now renders as its receiver: the text of the call before and after the receiver goes, in the client output and in a lazy provider's split-chunk caller copy. System review wave 1, u5#1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e dot is a boundary The prefetch skipped a namespace import unless the raw text held the contiguous `NS.Hydrate`; the parsed member check already decides which member tags are boundaries. System review wave 1, u5#3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r environments Server environments erased the children between the tags only; the `children` attribute now goes too (self-closing elements included), with the same RSC handler exception. Main renders it on the server too. System review wave 1, u5#2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Edge names spelled an opaque namespace or require() use as '*', so the planner and the mock emitter dropped a real export of that name and the build failed to link (Vite MISSING_EXPORT, Rsbuild missing export). Names stay literal; `EdgeRecord.opaque` carries the opaque use, which only the Rsbuild `transformImport` rewrite reads. Both '*' blacklists are gone. System review wave 1, u6#1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t reaches the file With no verified call, the report took the importer's first pattern call that might have reached the denied file, so of two `import()` calls with a variable path it could point at the wrong one. A call is named only when it names the file (a literal glob that matches it, a webpack context of a literal directory holding it, a `require()` of its path); otherwise the report names the importer alone, as main's Vite build does. The `import()` kind, its suggestion and its wording go. System review wave 1, u6#2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…location The private source-map decoder dropped one-field segments, so a position in generated text another plugin's map leaves unmapped took the preceding segment's original position. Locations now come from `@jridgewell/trace-mapping` (`traceSegment`), which keeps them; the Base64/VLQ decoder and its line cache are gone. System review wave 1, u6#3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… client factory (u1#1) System review wave 1: a rare shape whose fix adds complexity, recorded as a known bug with no pin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ies` loses its name (u2#1) System review wave 1: a rare shape whose fix adds complexity, recorded as a known bug with no pin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tale diagnostic line (u3#2) System review wave 1: a rare shape whose fix adds complexity, recorded as a known bug with no pin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d `splitBehavior` capture (u4#5) System review wave 1: a rare shape whose fix adds complexity, recorded as a known bug with no pin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…that call `clientAction()(fn)` was replaced whole by the implementation or the stub, so the call selecting the factory (`clientAction()`, a sequence, a conditional) no longer ran. A callee that is not a name or a member of one now runs once, as written, before them: `(clientAction(), fn)`. System review wave 1, u1#2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…client gets a mock of Vite's commit wrote a mocked (or import-protection-failed) module's server fns to the registry, where Rsbuild's record of the same answer holds none. On Vite they became client-referenced and took client-rank ids: with a custom generateFunctionId giving two fns one id, a server-only module a pattern import reaches took the client's own fn's id (`one`, the client fn `one_1`; Rsbuild `one`). Only a served module declares server fns now, on both hosts. System review wave 1, u3#3 (Gemini). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…efused like any other `readsOnDemand` answered false for every `\0` id, so the prefetch never read the exports of a Vite plugin's virtual module by that convention: its namespace passed where the compiler cannot follow compiled silently on the client, with the server code attached there, where a plain `virtual:` id is refused. Virtual modules now read on demand like the app's. System review wave 1, Gemini u5#1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… namespace member or helper call (Gemini u5#2) Main fails on these spellings too (the module throws when it loads). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…any import
The `rsc-css` planner's gate admitted a module only by a direct import of
the RSC entry or the helpers' names in its text, so a helper re-exported
under another name (`export { renderServerComponent as renderRsc }`) got
no CSS loader, though start-env recognizes it. The step now runs in
start-env on its own analysis (`StartEnvConfig.loadCssExpression`, set in
the env that renders server components); the planner, its gate, slot,
config and planner data are gone.
System review wave 1, Gemini u5#3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rsed code The report path found pattern imports, `require()` calls and string literals with a hand-written lexer, which misread a regular expression holding a quote (`/'/`): a later call or literal fell inside a phantom string and the report lost its location. One walk over the parsed module (`parseModule`, `forEachChild`, `unwrapExpression`) now collects them; a markup file's JavaScript is its `<script>` elements (Vue SFCs keep their located reports); a file that does not parse gets a file-level report. The lexer (comment/string ranges, literal reader, type-argument skipping, call regexes) is gone. System review wave 1, Gemini u6#3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…edge alive
`import { type DbRow }` beside a tree-shaken `import { queryDb }` of a
denied file made the edge's mock evaluated, so both Vite and Rsbuild
production builds failed where main builds. An import of type names only now
counts for nothing, as on main: TypeScript erases it, and one a host keeps
bare under `verbatimModuleSyntax` imports the pure mock, which the build
drops. Each value declaration still decides for itself; a re-export of type
names keeps its rule and its `export type` advice. SPEC J6.4 and the import
protection guide say so (decision 11-29, Gemini u6#2); the Rspack build info
version moves to 9.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… client build's output
`new URL('./x.server.ts', import.meta.url)` let Vite read a denied file
from disk past every import and inline it as a data: URL or copy it as an
asset (main too). One rule now covers the output: the client inlines no
file import protection may deny (its file rule, or a server-only marker its
text names; the user's `assetsInlineLimit` for every other file), and
generateBundle judges every emitted asset by its source file with the rule
an asset query uses (`ownViolation`, shared with `assetOutput`): a denied
one is reported at the module naming it, emptied in mock mode, an error in
error mode. The pin becomes a passing test that also reads data: URLs.
System review wave 1, Gemini u6#1 (Vite half; F6 fixed Rsbuild's).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Every TanStack build-time compiler now runs on one shared core built on Yuku. That covers route code splitting and route HMR (router-plugin), all of Start's transforms (server functions, environment separation,
<Hydrate>, RSC CSS, import protection) and the route generator. Babel,babel-dead-code-eliminationand the Prettier hot path are gone.Guaranteed against
mainmaindoes. Wherevermain's output builds and runs correctly, ours does too, with the same runtime behaviour (the same options split, one instance wheremainhas one, code run once wheremainruns it once) and no more client bytes. Wheremainfails to compile a route, it builds and works here. The exceptions are listed under Behaviour changes, and the byte differences on the corpus under Testing..serverfiles and markers, and the route options a client build removes. Each use of a Start builder or factory is either compiled or fails the client build at that use, so a shape the compiler can't follow doesn't ship silently. What this doesn't cover is under Not guaranteed.Headline numbers (tables under Performance)
mainin a few measured places, each listed with its number and cause under Losses.Checked by the oracle (known-bug pins drop from 874 to 55, all listed below), differential gates against
mainon a 58,075-compile corpus, a leak canary over 139 app builds, and the e2e suites. 27 issues are closed: 23 are fixed here, and 4 thatmainalready handles get their tests here.Parts of this PR have landed on
mainas separate PRs (#8849, #8851, #8852, #8853, #8855, #8856, #8857, #8858, #8860, #8861, #8863, #8866, #8867, #8868, #8869, #8870, #8871, #8876 and thevisible()fix #8653). This branch is merged with them, and their changes aren't described again here.Contents
main· better thanmain· not guaranteedUpgrading an app: read Different from
main, accepted. Reviewing the code: read Architecture, then How to review.Architecture
One compile of one module, from its text to its outputs. Full map:
packages/router-utils/src/compiler/README.md.flowchart TD src["Module text<br/>(one environment, one config)"] --> parse["Parse once with Yuku"] parse --> analysis["Shared analysis<br/>top-level units, bindings, references"] raw["Imported modules<br/>(raw text, never the bundler's pipeline)"] --> summaries["Summaries<br/>what each export is"] analysis --> planners summaries --> planners subgraph planners["Planners: each adds edits and roots to one shared plan"] direction LR p1["start-env<br/>server fns, middleware,<br/>env-only code"] --> p2["hydrate<br/>Hydrate boundaries"] --> p3["rsc-css<br/>RSC CSS"] --> p4["router<br/>route splitting,<br/>deleteNodes, HMR"] --> p5["import-edges<br/>import protection"] end planners --> placement["One placement<br/>what each output holds, imports and copies"] placement -. "an output would assign a binding it imports:<br/>that code stays in place, the planners run again" .-> planners placement --> plan["Frozen plan<br/>plain data"] plan --> policy["Edge policies, per output<br/>import protection: verdicts, mocks, diagnostics"] policy --> publish[("Published: cached per environment, module and config<br/>only if no newer save of the file superseded this compile")] publish --> facts["Facts<br/>import edges, server-fn registry,<br/>diagnostics, dependencies"] publish --> emit["Emit: rewrite on the original source ranges<br/>exact source maps, user code never re-printed"] emit --> o1["Env module<br/>(the route module)"] emit --> o2["Split chunks<br/>?tsr-split=…"] emit --> o3["Shared module<br/>?tsr-split=shared---…"] emit --> o4["Server-fn modules<br/>?tss-serverfn-handler<br/>?tss-serverfn-split"] emit --> o5["Hydrate chunks<br/>?tss-hydrate=…"]The boxes, top to bottom:
start-env → hydrate → rsc-css → router → import-edges. The router plugin alone runs onlyrouter. One recogniser (routeCallOf, router-generator) decides what a route file is, for the generator and the router planner, and the planner acts only on files the generator lists.placement.ts) serves every plan: route files, server-fn handler modules, the RSC provider copy,<Hydrate>chunks and every plan that only erases code. Its rules are closed: they follow names, references and assignments, and never ask what code does (whether it is pure, or what it writes). Purity is only import protection's effect model.?tsr-split=…,?tss-hydrate=…,?tss-serverfn-split,?tss-serverfn-handler) and facts (import edges, server-fn registry, diagnostics, dependencies). Any id of a file may be requested first.OutputBuilderwrites VLQ maps directly and composes them with input maps.start-env<ClientOnly>start-plugin-core/src/planners/start-env.tshydrate<Hydrate>children extracted into chunksstart-plugin-core/src/planners/hydrate.tsrsc-cssstart-plugin-core/src/planners/rsc-css.tsrouterdeleteNodes, route HMRrouter-plugin/src/planners/router.tsimport-edgesstart-plugin-core/src/planners/edges.tsWhere to start reading: the README above, with
router-utils/tests/helpers.tsopen (toy planners and an in-memory host that use every interface). The full reading order is under How to review.Placement rules: what goes into which output
mainsplits them:main's shared names go into one shared module; chunks importRoute, whatexport const|let|vardeclares and the shared names, and copy the rest.Server functions (lazy handlers, builder escapes), the verifier, caching and hosts
?tss-serverfn-handler) holds it, with its validator and middleware, and imports what the file keeps. A split chunk that calls it holds a caller copy, as onmain: the user's own chain with the validator dropped and the handler replaced bycreateSsrRpc(id). Calls go through the registry to the one executing instance.start-envtracks each Start builder or factory through bindings, re-exports, namespaces and factories. A use it can't follow is a compile error at that use: a client build fails before it emits, and in dev the module fails (overlay).TSR_COMPILER_VERIFY=1, on in the oracle). Every output is re-parsed and checked: no assignment to an import, glue imports resolve, each kept top-level statement is emitted once in its home and once per chunk that copies it, and no output reads a module binding it neither declares nor imports. A separate server-code check fails a client build that would hold recognised server code (a temporary safety net, see Losses).invalidate(); no Yuku objects are retained. We own the hosts: a native Vite plugin, a Rspack/webpack loader, and Start Rsbuild loaders (withbuildInforeplay for the persistent cache). Start's Vite and Rsbuild hosts share one bundler-free Start session. unplugin remains only for the generator and esbuild.Performance
Measured with
benchmarks/compiler-perfat0c3f86ecb9againstmain0b6d4f3f6b: medians over 4 paired rounds, times in ms, memory in MB. Large = 1,485 route files, medium = 333 (338 on Start). n.s. = the 95% CI includes 0; every other Δ in these tables excludes it. Method, CIs and footnotes are in the details below. Every other measurement names its own commit.Large apps
main, msAcross all 11 cells (medium and large), every cell builds, cold-starts and compiles significantly faster. Build −54…−79%, cold start −54…−80%, compile-all −56…−82%, listen −25…−80%.
HMR by edit kind
Δ of the HMR p50 per edit kind. Slower cells are in bold and listed under Losses. – = not measured in that cell. Neither side full-reloads on any edit.
<Hydrate>Memory
eedc638e42).Losses against
mainOne line each; the first three are detailed below.
0c3f86ecb9(n.s. on the large ones). The cause is a wait, not compile work: a route update is held until React Refresh's next pass, which@vitejs/plugin-reactdebounces by 16 ms. Since then a route module that holds no component refreshes at once (loader edits −28.6% on react-start Vite medium); the loss stands for an unsplit route and for a route with an unsplitpendingComponent.hotUpdatere-checks the plans of the edited file's importers;maindoesn't track that dependency. Not worth changing..mapfiles after hashing. Save → DOM is within noise.0c3f86ecb9). It is a self-contained safety net, to be removed a couple of months after the release.0c3f86ecb9), to tell which importers still exist.main("Server bytes" under Other measurements).createClientServerFn(id, chain), which ships once: an annotation on the user's own chain would let bundlers drop the user's calls in it.d5f1352c43, 8 paired rounds).main's text filter skips a module that names no Start API; we parse every app module and resolve its imports to know whether they are Start values, about 0.14 ms per module and environment. The generated and real apps above hold such modules too and are faster overall.d5f1352c43), once per server process; later requests are equal or faster. The server-fn modules that request loads are larger (they hold the server wrappers and load handlers lazily); the rest isn't attributed.0331deb61c, paired): kroma +5.4% [1.3, 8.3] (+93 MB, 5 rounds; onemainoutlier at 2,904 MB left out, with it n.s.) and bm.md +5.8% [2.2, 9.5] (+110 MB, 12 quiet rounds). Their builds are 4.1% and 1.8% faster. bm.md (Start) has less live heap thanmain: its peak depends on when the last mark-compact runs, and nothing was found to change. kroma wasn't re-measured after the Vitenode_modulesfilter below, which may cover it: it wraps its plugins in its own bundler package, so whether it uses the router's Vite plugin wasn't checked.0331deb61c. The router plugin's Vite transform handed every dependency module's text to the plugin (LibrePhotos: 9,763 of 10,950 calls), and the garbage that left raised the peak. With dependencies filtered out natively (2501c14687, 12 paired rounds), both are belowmain: LibrePhotos 1,252.5 → 1,146.5 MB (−8.4% [−8.9, −8.0]), Observal 880.5 → 852 MB (−3.3% [−3.9, −2.7]), with byte-identical output and builds 31% and 11% faster thanmain. That run was on a machine with no free huge pages, where the head without the filter read −0.8% [−1.6, 0.1] and +3.3% [2.4, 4.2].Losses in detail: the React Refresh wait, Solid shared-module edits, Rsbuild map text
0c3f86ecb9loader edits were slower thanmainon the three medium React cells: react-start +17.1% [13.5, 21.2] (57.8 → 67.7 ms), react-start-deps +13.8% [9.5, 19.7] (60.8 → 69.2 ms) and react-router +35.2% [4.8, 57.4] (25.4 → 34.4 ms). On the large React cells the CIs include 0. The loss was a wait, not compile work: a route update is held until React Refresh's next pass, which@vitejs/plugin-reactdebounces by 16 ms (Run React Refresh at vite:afterUpdate instead of after a fixed 16 ms vitejs/vite-plugin-react#1565), so that a route's components and options land together.undefined. Loader edits are −28.6% [−32.8, −26.9] on react-start Vite medium (64.7 → 46.1 ms;mainread 57.8 ms in the matrix run above). On react-router Vite medium they are −57.5% [−58.7, −57.0] (33.9 → 14.4 ms;main25.9–33.4 ms), measured with the probe route'spendingComponentremoved. These are A/B runs against the head before the change, 4 paired rounds, 20 edits per kind.pendingComponent. The default groupings don't splitpendingComponent, and the generated apps give one to about 30% of their routes. With itspendingComponent, the react-router probe route reads 34.8 → 34.7 ms (unchanged). Rsbuild loader edits are unchanged (202 ms either way; −34% againstmainat0c3f86ecb9).main(37.8 ms in the matrix run). On Vite the route refresh now runs at once and the component swap after React Refresh's pass, likely two renders instead of one (not verified). Avoiding it needs new ordering state for route refreshes.0c3f86ecb9. Before Vite sends the update, ourhotUpdatereads the edited file again and re-checks the plans of its importers (0.43 ms per edit), so an edit that changes an importer's output reaches the page.maindoesn't track that dependency. Not worth changing..mapfiles after hashing costs 14–17 ms of CPU per hot update on a medium app and 37–50 ms on a large one. Save → DOM is within noise: −1.1% [−6.5, 1.2] without the fill (react-start Rsbuild medium, 4 paired rounds,0c3f86ecb9). Rspack won't fill it natively ([Feature]: fill missingsourcesContentfrom the module resource when emitting source maps web-infra-dev/rspack#16348, closed: a map's text must take part in HMR invalidation).0c3f86ecb9a reload or a new tab could show a split chunk's previous text after an edit that left that chunk's code unchanged: Rspack writes an asset again only when its version changes. Now a new fill of an unchanged chunk's map gets its own version. The server environment's maps are filled only when Rsbuild writes them to disk (dev.writeToDisk), because nothing reads them in memory. Against the head before the fix (react-start Rsbuild medium, 4 paired rounds, 20 edits per kind), route component edits are +3.7% [−0.6, 6.8] (n.s.) and loader edits −5.8% [−6.9, −4.3].Method and footnotes ¹ ² ³
Measured with
benchmarks/compiler-perfat0c3f86ecb9againstmain0b6d4f3f6b. Both checkouts run at once on mirrored core sets, swapped per round and per cell, over 4 paired rounds. Each round is 1 warmup + 1 run, 10 edits per HMR kind and 1 memory run. Each cell starts only once the 1-minute load average is below 8. 16 of the 44 cell-rounds saw a load reading of 12 or more from other jobs and were re-run at a load of 3.8 or less. Values are medians, times are in ms and heap in MB. In parentheses: Δ% and its 95% t interval over the paired log ratios. Large = 1,485 route files. Every other measurement below names its own commit.n.s. = the 95% CI includes 0.
¹ Two of
main's Rsbuild runs failed in the harness, and this PR's runs had no failures. In react-start Rsbuild large round 3,main's run aborted when it opened the<Hydrate>probe page (page.goto: net::ERR_ABORTED), so memory and<Hydrate>HMR have 3 rounds in that cell. In react-start Rsbuild medium round 1,main's dev memory run hit the harness's dev port race (ERR_CONNECTION_REFUSED). Rsbuild route-edit medians per round: this PR 578–629 ms,main904–1,143.²
main's dev heap is bimodal across runs on these cells. On react-router large, all four rounds read 130 MB (on 11-16 all four read 103). This PR reads 87.5 MB in all four rounds, which is −15% againstmain's lower mode. On solid-router large,mainreads 92.4 MB in three rounds and 120.4 in one, and this PR reads 91.3–93.3.³ react-start plus a generated dependency graph and tanstack.com's
manualChunks. Dev SSR fails on both sides here because of a?urlwasm asset in the harness, so<Hydrate>HMR is not measured.All 11 cells: values, Δ with 95% CIs, HMR p50 in ms
0c3f86ecb9vsmain0b6d4f3f6b, the same run as the table above. Medium = 333 route files (338 on Start). Δ CIs are 95% t intervals of the paired log ratios.Δ% [95% CI] of the same cells:
HMR p50, ms,
main→ this PR, Δ% [95% CI]:<Hydrate>HMR p50 by kind, cells whose CI excludes 0:
<Hydrate>: −10…−65% on Vite, and −68% / −52% on Rsbuild.0c3f86ecb9; faster now on routes whose module holds no component) and the Solid Router shared-module edits listed under Losses.tanstack.com: build 15.3 → 9.4 s (−39%), first hydration −14%, edits at parity
598befed, offline, fresh caches,0c3f86ecb9vsmain0b6d4f3f6b, one side at a time, 5 clean pairs.main: 0.80 s). An edit waits on Tailwind rebuilding the stylesheet (~100 ms) and the browser applying the update (40–60 ms); the compiler is 7 ms of a route edit (main: 32 ms) and 2 ms of a shared-component edit.0c3f86ecb9ourhotUpdateheld a route edit's update 6 ms longer thanmainand a shared edit's 5 ms. For the route edit it transformed the route module in each environment to learn which split chunks still exist, the SSR environment included (6–9 ms of it on tanstack.com); for the shared edit it re-checks the importers' plans. Now the SSR environment compiles the route module inhotUpdateonly when a derived module of the update needs it. On react-start Vite medium that hook takes 0.18 ms per call instead of 1.80 (2 rounds per side, 48 calls each), and route component edits are 3.3% faster [−9.1, −0.3] (4 paired rounds). tanstack.com wasn't re-measured.e18e framework tracker: dev startup −9.9%, cold build −13.9%, warm build −14.3%
e18e framework tracker (their harness and starter on 2 CPUs, 12 paired rounds,
0c3f86ecb9vsmain0b6d4f3f6b, 0 errors): dev server startup 1,452 → 1,308 ms (−9.9%, 95% CI [−11.1, −8.1]), cold build 1,547 → 1,332 ms (−13.9%, [−14.4, −12.7]), warm build 1,394 → 1,194 ms (−14.3%, [−15.3, −12.9]). Scaled onto the tracker's published values of 10-29, that would move TanStack Start from 5th to 4th place in cold builds (1,748 vs SvelteKit's 1,821 ms) and from 5th to 3rd in warm builds (1,560 vs React Router's 1,617 ms), and leave it 5th in dev startup. The places weren't checked against the tracker's current results. The build margins (3.5–4%) are smaller than the tracker's run-to-run spread.Other measurements against main: issue repros, soak, real apps, Vue, webpack, RSC, bytes
0c3f86ecb9, the reporter's 1,500-module workload): import protection in dev adds +3 MB of live heap, wheremainadds +322 MB.0c3f86ecb9, 3,000 modules, 600 routes, Nitro): heap when the last environment starts is 65.6 MB, vs 500.0 MB onmain.18ef570edc, KB per cycle, PR vsmain): react-start Vite −0.7 vs 11.2, react-router Vite 2.3 vs 6.3; react-start Rsbuild 20.9. The remaining growth is upstream: Dev server module graph keeps nodes of deleted files for the life of the server vitejs/vite#23907, and [Bug]: Dev server's in-memory output file system keeps every hot-update file web-infra-dev/rsbuild#8736 (fixed in Rsbuild 2.3.0).0331deb61cvsmain0b6d4f3f6b, 126 apps, each with its own toolchain, 3 paired rounds, medians of per-app Δ): build −14.6%, dev ready −20.0%, first render −12.9%, peak RSS −4.8%. No app builds slower (111 faster with a CI below 0). Peak RSS is higher in 18 (at most +140 MB).0331deb61cvsmain0b6d4f3f6b, each with its own toolchain): all 14 build on both sides with the same warnings (one reworded generator message). Builds are 4–31% faster in 11 (redpanda, Rsbuild + Module Federation, −6.7%), at parity in 3 (bm.md −1.0%, CADAM −3.7%, Bombom). kroma (barrel-heavy) builds 4.1% faster. tamery, which failed on the PR side before, builds too. Peak RSS is higher on three of them, re-measured on a quiet machine (12 paired builds each): bm.md +5.8% (+110 MB, 95% CI [2.2, 9.5]), LibrePhotos +8.8% (+121 MB, [7.0, 10.6]) and Observal +10.7% (+114 MB, [6.2, 15.4]). LibrePhotos and Observal are belowmainsince the Vitenode_modulesfilter (2501c14687, under Losses).0331deb61cvsmain, 200 generated SFCs): an SFC without Start costs the same on both sides (<script setup>+0.10 ms [0.00, 0.19],<script>−0.11 ms [−0.32, 0.10] per SFC). A top-level server fn in a plain<script lang="ts">block adds 1.83 ms [1.66, 2.00] per SFC;mainfails that build.0331deb61cvsmain): webpack build (React Router medium) 6,455 → 4,214 ms, −34.7% [−36.0, −33.0]; RSC build (React Start RSC medium) 8,846 → 2,478 ms, −72.0% [−72.6, −71.2].mainda2adec76d; the PR-side commit isn't recorded, and it wasn't re-measured): Vue Start / Vue Router build 8,665 → 3,917 / 4,162 → 1,588 ms, cold start 10,692 → 3,073 / 5,017 → 1,349 ms.0331deb61cvsmain0b6d4f3f6b, both measured on 2026-11-17 on one machine): none grows in gzip or raw. 12 are byte-identical. Six are 1–10 B gzip smaller (6–20 B raw): react-start.full −8, react-start.rsbuild.full −1, react-start.rsbuild.minimal −10, react-start.rsbuild.minimal-iife −3, solid-start.full −4 and vue-start.full −6. In brotli, two of those six are larger: react-start.full +9 B and solid-start.full +4 B.5dd914a2f9) ships its helper once in a Start client with server fns. Againstc99ee06725(bytes identical to0331deb61c): react-start.full +19 B gzip, vue-start.full +9, solid-start.full +6; the other 15 scenarios are unchanged. Summed with the run above, that puts react-start.full at +11 B gzip againstmain, vue-start.full at +3 and solid-start.full at +2 (not re-measured at the head). Thefullfixtures have no unused server fn; in a scratch app with 4 used and 4 unused exported server fns, the client is 213 B (Vite) and 205 B (Rsbuild) gzip smaller than before the change.ad2b1855ccvsmaine7358c36d8,.js/.mjssummed per server directory): Vite scenarios are −450…+4 B raw. react-start.rsbuild.minimal is +23 raw / −10 gzip. react-start.rsbuild.full is +605 raw / +79 gzip: the resolver imports the defining module, which makes__roota second concatenation root, and lazy handlers add their per-file glue; one named cache group that merges the server-fn provider chunks into the router chunk recovers −94 raw / −248 gzip of it.Testing
The oracle (
packages/compiler-test-utils/oracle) drives real bundlers, dev servers and browsers through public APIs only.main's bugs are pinned as.fails.main's compilers,80d1890bed).fails)The suites were pruned at the end to one standard: passing them must guarantee a working compiler even if every internal were rewritten. Internal tests were deleted behind a coverage gate and a mutation gate, and replaced by behaviour tests where they were the only cover of a reachable path. Start's
srccoverage is 95.1% of lines and 84.1% of branch arms.Final local gates. The full set ran at
8014d07f4e, after the first external review round: the Vite router transform'snode_modulesfilter and the fixes from that review of the core, the router, the hosts and Start (each with its own tests). The previous runs were at0331deb61cand2322af5907. The full e2e suite and the platform jobs run in CI on the pushed head.Since
8014d07f4e: the fixes from a second review round (each with a regression test) and the server-fn client stub. Each change ran unit, types and eslint of the packages it touched, and its own regression tests. The client-stub change also ran the corpus (server outputs unchanged; client outputs identical once the stub's new shape is normalised, except 2 that lose an eslint-disable comment written inside.handler(), the leak canary (identical sets), the bundle benchmark (above), and the server-function and RSC e2e suites on Vite and Rsbuild. The full gate set wasn't run again at the head.Gate by gate: corpus, differential gates against main, leak canary, bundle bytes, integration, e2e
8014d07f4e8014d07f4e0331deb61c8014d07f4emain(12,337 corpus route files, 156 fixtures)8014d07f4e0331deb61con both sides. 12,113 corpus rows equal or better. 30 have more eager bytes thanmain: 13 are gate artefacts (inputs that are already compiler output, a Solid file compiled as React) and 17 are +1 to +23 B (a binding imported wheremaincopies it, minifier naming, one string component now split). 45 split fewer options, the same recorded set as in earlier runs. 3 fail only onmain, 146 on bothmain(161 probes, 8,359 corpus files; leaks, imports, kept statements, bytes, run trace)8014d07f4e2322af5907<Hydrate>againstmain(2,312 records)8014d07f4e2322af5907, failing kinds are the recorded limits8014d07f4e2322af5907except one probe's split chunk, by the anonymous default class fixclerk-basicfails onmaintoo)8014d07f4e0331deb61c.main: 2 (a marker leak, pinned)vite build --sourcemap2322af5907main): no new exposure8014d07f4e0331deb61c; againstmain, 12 identical and 6 smaller in gzip (before the server-fn client stub: "Client bytes" under Performance)main(52 fixtures × 3 groupings)8014d07f4e2322af59078014d07f4e8014d07f4e8014d07f4e8014d07f4eKnown flakes:
hotUpdatehooks run is cached with the old timestamp, so the module exists twice. It fails onmaintoo when forced; an upstream draft isn't filed yet.serialization-adaptersstream: the router's$_TSR.e()deletes$_TSRbefore Solid's last script reads it. It fails onmaintoo (about 1 run in 4). It isn't a compiler bug and is out of scope here.Beyond the oracle:
main(the table above):main's compiler and this PR's run on the same inputs and are compared for leaks first, then imports, bytes and runtime behaviour. All 14 planted compiler faults are caught by the erasure gate.mainand with this PR, in a network-restricted sandbox.main. The last round had separate passes for architecture, performance (with measurements), maintainability, core placement,<Hydrate>, server-fn security and import protection. The security pass found no leak and nothing callable over HTTP thatmainrefuses;mainanswers more (a private helper, on every host). Independent coherence, dead-code and coverage reviews too. Every PR bug they found is fixed with a regression test, except the open items under Follow-ups.Corpus and fuzzer results (October)
Corpus (
b25984c166vs npmmain):390ca815c3.main's behaviour), a Vite optimizer race that exists without the PR, and noise.Fuzzers:
mainand four times by the PR): 0 crashes or nondeterministic outputs.main. The remaining differences exist onmainor are upstream (Editing a module that renders <html> (SSR + hydrate) throws "template is not a function" and breaks HMR solidjs/solid-refresh#91, Module that stops registering components (e.g. becomes a re-export): old proxies point to themselves, stack overflow solidjs/solid-refresh#92).Vite 6 and 7: the router-plugin e2e projects pass
Vite 6 / 7 (
0331deb61c): the 13 router-plugin e2e projects pass on Vite 6.0.15, 6.4.5 and 7.3.7 (398 tests each, 0 failed or flaky). Split Solid and Vue routes update in place, as onmainsince #8870.Remaining fail pins (55)
Each pin asserts the correct outcome and fails today.
oracle/KNOWN-BUGS.mdhas the details and the accepted limits that aren't pins.main: route CSS is eager (applying it only once the route matches needs a per-route asset loader, a follow-up).main(the "Not covered" row).All 55 pins by reason
main's behaviour on purposemain.srcDirectory/includegets the real module of an in-scope denied file it imports. It gets the mock: the denied file is judged at its own compile, which doesn't know who imports it.<script setup>block that hands a Start builder or factory to its template compiles. It is a compile error on the dev servers (Vite and Rsbuild) and in builds with Vue's devtools: there compiler-sfc hands the block's bindings to the template, in JavaScript every import too. No server code ships. Hit by a JavaScript block importing a builder or factory, and by any block whose local holds an open builder. Two of the four shapes (an imported builder the block never uses, a namespace of a module exporting one) built onmainon Vite. A default production build inlines the template and builds, except on Vite with<template src>.RoutefromcreateFileRouteto an app's own helper shows in place. It needs a reload, as onmain.main?workerimporting a denied file;new URL('./x.server.ts', import.meta.url); a marked.mdx/.vuewith an asset query; a marked file that doesn't parse with an asset query; on Rsbuild, a plainwebpackContextof a denied.json. They reach the client unreported..pageasjavascript/auto) importing a denied specifier is reported. Rspack rules select by resource.Duplicate routes found) (vitejs/vite#24046).memo(Page as any)route component keeps its state on edit, with and without splitting. It remounts: oxc's React Refresh doesn't register through a TS cast (oxc-project/oxc#29281, fixed in oxc 0.159.0; no Rolldown release ships it yet).mainshows neither.bundledDev, a factory that becomes a server-fn builder drops its handler from the client bundle. This needs the full-bundle API.withBuilder(createIsomorphicFn().server(f)).client(g)keeps each implementation..server()finished the value, so nothing refuses it and the module throws at load, as onmain. No server code ships.main<Hydrate>children,ref={field}naming a module-levelletbinds theletthe module reads. It binds the chunk's copy, so the module's own code readsundefined: a JSX ref isn't an assignment before Solid lowers it, so the module-write refusal misses it. Workaround: aletin the component, orsplit={false}.main)<Hydrate>children passing the component'sargumentsas a shorthand property ({ arguments }) render its props. The chunk's rewrite ofargumentsis a text edit that doesn't see the shorthand: React gets the keytsrArguments(a hydration error) and Solid's chunk doesn't parse. The fix needs the capture scan to mark a shorthand property. Workaround:{ arguments: arguments }.Behaviour changes
Every item is a difference from
main0b6d4f3f6b, run on both sides unless it says otherwise.main, acceptedmainmay need a change, or an accepted limitmainmainfailed, shipped server code or showed stale codemainhas tooThe 18 changesets this PR adds carry the same text for release notes (minor:
start-plugin-core,react-start,solid-start,vue-start,react-start-rsc,router-plugin,router-generator,router-utils,router-core; patch:router-cliandreact-router,solid-routerandvue-router,start-client-core). It also editsstart-server-fn-custom-id-check.md, which is already onmain.Different from
main, acceptedStart: server functions and builders
.inputValidator()fails the client build at the call.mainstill compiles it, though the method left Start's runtime in refactor(start)!: remove the deprecated inputValidator #8694. If a dependency calls it, update the dependency.A client-only
createIsomorphicFn().client(fn)orcreateMiddleware().client(fn)passed to other code fails the client build, as a precaution;mainbuilds it.Or pass the middleware to
.middleware([…])orcreateStart's lists directly.A builder's options object passed on, written to, or read for its
middlewarelist fails the client build;mainbuilds these..optionsis typed read-only.A server fn whose handler is itself
createClientOnlyFn(…)throws when called (… can only be called on the client).mainran the client implementation on the server.A Vite build whose
ssrenvironment builds before the client fails, saying to build the client first. Onmainit builds a server that answers no server fn. Start's ownbuildAppis unaffected.A
virtual:module with aserver-onlymarker (an id without\0) fails a Vite build, naming the module.mainbuilds it. Fix: move the code into a file.Kits that list Start under
dependenciesare excluded from Vite's dependency optimizer, like peer kits: a CommonJS kit, or a kit's CommonJS dependency, needs anoptimizeDeps.includeentry.Some handlers load with their file instead of on the first call: a handler-only value that reads file state at load, a handler that assigns file state, and a module with top-level
await(5 corpus files).mainloads each handler, and its file a second time, on the first call.A class,
enumornamespaceonly a handler reads runs at the first call on the server.mainruns it when the route loads and again at the first call, and ships it to the client. Fix: read it from code that runs at load.A handler-only snapshot of an imported object that the file writes before and after it reads the later value. In
import { cfg } from './state'; cfg.value = 'opening'; const onOpen = cfg.value; cfg.value = 'ready', a handler returningonOpengets'ready';mainruns the file again at the first call and gets'opening'. Fix: read the snapshot from code that runs at load, or write through a local alias (const c = cfg).The server namespace of a module with a lazy handler module has extra keys (
Object.keys(ns)differs from the client's). Fix: enumerate an explicit list.A server fn whose chain runs a function at load that reads a declaration of its own statement (an IIFE, a synchronous callback, a getter) builds, and the function reads the declaration before it is initialised (
undefinedin a Vite build).mainfails these builds.A server fn inside a statement is created before the statement's earlier operands run. In
export const api = { first: update(), run: createServerFn({ method }).handler(fn) }, whereupdate()setsmethod = 'POST', the chain readsmethodfirst and the server fn isGET.mainfails the build (createServerFn must be assigned to a variable!). Fix: set what the chain reads before the statement, or declare the server fn at the top level..handler(selected), where the module assignsselectedelsewhere, runs whatselectedholds at the first call;maintakes the value when the chain is created. The build warns at the argument. Fix: pass a function written in place, or aconst.A server fn that reaches the browser only as data (a loader returning it) is no longer callable over HTTP in production builds;
mainanswers it. Fix: reference it from client code.Vite: a server fn of a
node_moduleslibrary the app doesn't list inpackage.json, called during SSR, throws (500).mainrenders the page without the value. Fix: declare the library.Ids that a custom
generateFunctionIdmakes collide across files are numbered by file path (functions client code references first), on Vite and Rsbuild, not by compile order, so such ids can change once. Default ids,functionName,serverFnMetaand the manifest's quoting are unchanged. Dev-server ids have a new payload (dev only).Two outcomes worse than
main, kept on purpose:import('…/server-only')inside a function the client keeps no longer fails the build (a top-level one still does), and an isomorphic.client(() => ({ handler: (f) => f }))followed byiso().handler(h)shipsh.Vue
<script setup>: the 4 pinned shapes above; two of them built onmainon Vite.Start on Rsbuild: an app's own binary file with a JavaScript extension, imported as an asset (
src/media/clip.ts), fails the client build ("cannot parse").mainbuilds and emits a corrupted asset. The same file in a dependency is emitted unchanged here.Route files and code splitting
React's classic JSX runtime isn't supported with automatic code splitting, nor in files Start compiles: a split chunk with JSX has no
Reactin scope and throwsReact is not defined.mainrenders it. No known users; restoring it means copying never-used imports into chunks.A second call of a route file's route constructor fails the build at that call, also through the router's namespace (
Router.createFileRoute(…)), on every host, whatever its options hold.mainbuilds it and serves the route (run on Vite, router-only and Start, with a second call holding onlystaticData). Fix: one call per file, bound toRoute.A re-exported
createFileRoute(from an app module, another package, a package subpath or a#import) isn't recognised: the route is served as written and isn't split, and under Start itsserver,ssrandheadersship to the client with no warning.mainfails each of these builds, router-only and Start (Vite): its generator adds an import ofcreateFileRoutefrom the router package to the route file on disk, and the duplicate binding stops the build. Fix: importcreateFileRoutefrom the framework's router package.A value import used only in types is in no output under
verbatimModuleSyntaxonce the code naming it is split;mainloads it. A module imported for its side effects needsimport './x'.A
constthe source reads only in types is removed when split code reaches it, and its initialiser doesn't run;mainruns it. A class,enumornamespacethat removed and kept code both name only in types leaves with the removed code. Fix: read it by value from code that stays.A
vardeclared inside a top-level statement that a split option reads runs when the route loads;mainruns it when the chunk loads.In a route file with a value
export * from …, a target's export namedtsr$<name>can be shadowed: when splitting makes the route module export one of its bindings to a chunk, the glue name istsr$<name>, and the module's own export wins over the star's.mainhas no glue exports. No corpus route file has such an export. Fix: don't givetsr$-prefixed exports to a module a route file star-re-exports.function Unused() { return <Page/> }keepsPageeager whenPageisn't a plain function with effect-free imports: code nothing uses stays for the bundler.mainhasPageonly in the chunk.Route files under
node_modulesaren't split, on Vite, webpack and Rspack, with one warning per file: aphysical()mount of an installed package, or a routes package resolved withresolve.preserveSymlinks.mainsplits them. A pnpm or Yarn workspace's routes package resolves to its real path and is split as before. On Vite this keeps dependency modules out of the router plugin's transform (peak RSS under Losses).Deterministic webpack and Rspack module ids change once with this release, for app and dependency modules. The code doesn't change.
node_modules, and of no dependency module.mainput unplugin's loaders in every module's request, dependencies included.mainthe requests hold unplugin's loader path instead.mainto this PR, every compared app and dependency module got a new id. With only the router plugin's install path moved, every app module's id changed here and none did onmain.<Hydrate>More refusals (the build fails at the code;
split={false}keeps the boundary in place).mainbuilds them and the split children work on a copy or a snapshot:React.useId(),Route.useLoaderData()). Move the call into a child component.usewritten directly in the children,use(Context)anduse(promise)alike (also renamed, or asReact.use). Onmainthe call moves into the split component, whereuse(Context)reads another context than on the server (a hydration error). The error points at the call, for every hook.letthe component reassigns, also through a nested<Hydrate>. UseuseRef.new.targetin the children, and a nested Solid boundary assigning an outer local throughref.Split children passing
argumentsas a shorthand property ({ arguments }) get the keytsrArguments(React: a hydration error) or fail to parse (Solid).mainrenders them. Pinned, below; write{ arguments: arguments }.A hook only a
<Hydrate fallback>reads is dropped on the server in every file.mainkeeps it outside a route's split component. A browser-only hook no longer crashes the server render; a hook taking an id (useId, Solid'screateUniqueId) shifts the ids after it, as with<ClientOnly>children onmain. Fix: call the hook in a component inside the boundary.Import protection
allowImport(info)decides,onViolation(info)reports (breaking).Returning
falsefromonViolationno longer allows an import: the import gets the normal outcome and Start points toallowImport. Onmain,falsesilenced the report; a marker file then shipped for real and a.serverfile stayed mocked.allowImportruns once per import before the mock replaces it, in dev and builds;truegives the real module with no report. Itsinfohas notraceorsnippet.An importer that
excludeorignoreImportersexempts gets the real module of a denied file it imports plainly.maingave it the mock, silently. This is what the exemption means, and it does put that file in the client.Importers that disagree fail the build, on Vite and Rsbuild, under both behaviours: one importer needs a denied file as it is (exempt, or allowed) while a checked module reaches the file itself (a pattern import, or an import another plugin added).
mainbuilt it on Rsbuild and on Vite withmock. The error names the file, both importers and the two fixes.Rsbuild builds with
errorfail on pattern imports of a denied file (templateimport(),import.meta.webpackContext) and on a denied import in a worker built by a child compiler.mainmocked both silently.Route generation
routeTree.gen.tsformatting changes once. The file is printed in yourquoteStyle/semicolons, andenableRouteTreeFormattingnow defaults tofalse(trueuses Prettier, loaded lazily). If a formatter runs over the file, ignore the file or set the option totrue; otherwise the generator and the formatter rewrite each other's output.mainbuilt with the tree on disk, without the route. Start builds andtsr generatealready fail onmain. Dev and watch report the error and keep the last good tree.Dev servers and HMR
mainrecovers in place on Rsbuild with React and on Solid, and stays stuck on the error on Vite with React. State is fresh on both sides.codeSplitGroupingsresets the component's state;mainkeeps it.loaddidn'taddWatchFilethe edited file (for exampleinvalidateModuleand afull-reloadfrom the plugin's own watcher). In Vite bundled dev and withserver.hmr: falsethere is no hot update to read, so any regeneration is missed there.maindoesn't read a virtual module's exports, so its compile doesn't depend on them.mainshows it, because it hot-updates every output of the file on every edit; that is the widening the narrow hot updates avoid. A reload or a new tab shows the current text. The server environment's maps hold the text only when Rsbuild writes them to disk (dev.writeToDisk).Packages and APIs
Peer floors (router-plugin's ranges are unchanged):
vite@rsbuild/core@rspack/core, for react-start-rsc@babel/coreno longer comes with the router plugin or Start: declare it if a plugin of yours needs it (e.g. React Compiler).Removed:
compilerTransforms,serverFnProviderModuleDirectivesandStartCompilerPlugin;react-start-rsc/plugin/rscCssTransform, replaced byrsc: { loadCssExpression, providerDirective };ssrIsProviderofTanStackStartCoreOptions;format,inferFullPath,checkRouteFullPathUniqueness,writeIfDifferentandafterTransform, and theGenerator's undocumentedfsoption (it reads and writes route files directly).onRouteTreeChangednow receives{ model, generator }.The router plugin context must come from
createRouterPluginContext()(@tanstack/router-plugin/context), imported in the same module format (ESM or CJS) as the plugins. A hand-built{ routesByFile: new Map() }, or a context from the other module format, throws when the plugin is created, with an error naming the factory.mainaccepted both.New entries:
@tanstack/router-utils/compiler(internal, no semver),@tanstack/router-core/tooling,@tanstack/router-plugin/planners, and the dev-only@tanstack/router-core/hmrand@tanstack/{react,solid,vue}-router/hmr.Examples: the WorkOS example uses
@workos/authkit-tanstack-react-start^0.12.0(0.5.0 calls.inputValidator()).Better than
mainItems that begin with Fails the build stop a build that
mainlets through on at least one bundler.Start: server functions, builders, erasure
Fails the build: a builder the compiler can't follow, at the use, with the fix (in dev the module fails, with the overlay).
mainbuilt these and shipped the handler to the client in most of them (16 of 21 shapes run):const h = createServerFn().handler,.call,.bind, an unknown method;ifwith tworeturns, an async function, a method, a getter), aletbuilder reassigned with something else, a builder in a TSnamespace, a project namespace passed around when its module exports a builder;(fn) => createServerOnlyFn(fn),({ handler }) => createMiddleware().server(handler).More builder shapes compile. On
maintheir handlers shipped to the client:const { createServerFn } = Start,(0, createServerFn)(), a builder chosen by?:,??,||or&&, a factory with statements before its singlereturn,export * as ns, a factory twoexport *branches reach under two names of one binding (export { api as a, api as b }), a factory exported as'*'.A server fn that isn't a top-level declaration builds, in every position evaluated exactly once when the module loads: an object or array entry, a call argument,
export default, an assignment's right-hand side, a member's object, a class's static field or block, a top-levelawait. On Vite,mainfails all of them (createServerFn must be assigned to a variable!); on Rsbuild,mainbuilds them, ships the handler to the client and registers nothing.Fails the build: a server fn in any other position (a function body, a condition, a loop, an instance field, a Vue
<script setup>block), naming the position and the fix: define it at the top level and pass what it needs in its input. On Vite these fail onmaintoo, without the position; on Rsbuildmainshipped the handler; in<script setup>on Vitemainbuilt and the call failed at runtime.One instance per server fn (SSR as the provider): the handler imports what its file keeps, so module state exists once and a class passes
instanceof(fix(start): share module bindings between server function handlers and their module #8656). The handler and what only it uses still load on the first call.Server code can call a server fn the client never imports (Server functions that are stored in a separate file cause middlewares to throw error #7213, "Server function info not found" when calling a server function that's *only* called on the server #8731). On
mainthat call fails withServer function info not found.Production answers HTTP calls only for server fns the emitted client bundle still calls, on Vite and Rsbuild, with and without RSC. On
maina server fn private to a module the client imports (a helper only another handler calls) answers a direct HTTP call by its id, which anyone with the source can compute. Server code still calls it.An exported server fn the client never uses leaves the client bundle and isn't callable over HTTP (Vite, except with
build.minify: 'esbuild'; Rsbuild, except withoutput.minify: false; see Not guaranteed). The code of its chain (options, middleware arguments) still runs. Onmainits stub stays in the client bundle and the server fn answers. The stub is now one pure-annotated call of a helper of ours, which costs +5…+19 B gzip once (under Losses).An env-only or isomorphic function called at once with a method (
createClientOnlyFn(obj.method)()) calls the method detached ((0, obj.method)()), as the function the factory returns does.maincalls it withobjasthis.createServerOnlyFn(…)orcreateIsomorphicFn()written in place as a handler works (If you pass createServerOnlyFn(...) directly as an argument to createServerFn().handler(), it will generate a broken server function. #8446); onmainthe whole app answers 500.A class,
enumornamespaceonly server code uses leaves the client, with its imports, and so does a declaration that removed code names only in a type (typeof cfg).mainkeeps them, so their imports stay in the client bundle.A parameter only read inside server code (
(role) => createMiddleware().server(() => check(role))) gets one warning: what callers pass for it ships to the client, as onmain, which says nothing.Kits that list Start under
dependenciesare compiled on the Vite server, like peer kits. Onmaintheir server fns returnundefinedduring SSR.vite build --watch: the server builds after the client's first build, so the first build answers server fns (onmainit answers none), and a server fn the client stops importing stops being callable after the rebuild. The two watchers are tied by a file in a per-run directory under the system's temporary directory; abuild.watch.excludematching it isn't supported.Vite dev: a request for a server fn the dev server hasn't compiled yet (a page left open across a restart) compiles its file, when the file is inside
srcDirectory, outsidenode_modulesand allowed byserver.fs(start-plugin-core: the dev server-fn id validator's recovery can never succeed — it transforms under the one flag that skips the compile #8447). A server fn an edit removes answersInvalid server function IDinstead of aTypeError. The dev server may warn when it has compiled no client code calling a server fn yet; the warning is a hint, not the production check.Dev servers: a module that imported a file that didn't exist yet loads it once the file exists;
mainkept failing until a restart. Withserver.hmr: false(Vitest), a module whose import became a server-fn builder is recompiled;mainkept the handler in the client module.Fails the build (RSC):
renderServerComponentorcreateCompositeComponentoutside a server function, at the call. Onmainit built and threw at runtime. Server fns that only a'use client'module imports are in the production manifest (Start RSC mode: server functions imported only from 'use client' modules are missing from the production manifest ("Server function info not found") #7943).RSC CSS through conditionals: a server component passed to
renderServerComponent,createCompositeComponentorrenderToReadableStreamthrough?:,&&,||or??gets its CSS on each operand that can be the JSX rendered.mainadds the CSS only to a JSX argument written directly.Rsbuild:
@rsbuild/plugin-vue(mainfails the build of an SFC that imports Start);performance.buildCache, a build after an edit names the new client entry (onmainevery page links the previous build's entry and never hydrates).A route whose
serverhandlers are in its route file and whose page is in its.lazyfile stays in the client route tree, on Vite and Rsbuild, so client-side navigation reaches it. On Vite,mainprunes it.Symlinked route files are compiled: their
serverhandlers are removed from the client (Start: symlinked route files skip the client-sideserver.handlersstrip — server code and node-only imports ship in the client bundle #8514), they split, and the document links their split chunks' CSS.mainserves them as written. When two route files link to one file, the generator gives the second its own file, as onmain, and both routes load.Under Start, while route generation has never succeeded (a dev server started with a route file that doesn't parse), a module exporting
Routefails with the generator's error.mainserved it as written, itsservercode included.Start's Vite plugin order no longer matters for React:
tanstackStart()may come after@vitejs/plugin-react, wheremainfails with a plugin-order error. Solid still needstanstackStart()first, as onmain.Route files and code splitting
Values
mainfails to compile stay in the route module and work: a member access (pages.Home), a namespace member,satisfies,!, a class, an array-pattern binding, a sequence, and a call holding JSX or TypeScript syntax (memo(() => <p />);memo(Page)splits).An object-form loader splits its handler (router-plugin: object-form loader breaks the code splitter when loader is split #8753):
handlersplits like a function loader, and the object with its other keys stays in the route module. A loader object held by a localconststays whole and works.mainfails the build when the loader is split.An option whose chunk would assign a variable it shares with the route module or another chunk stays in place.
mainfails the build (Cannot assign to import).Options written as methods split (
component() {…}, Code splitter does not support the method shorthand syntax #8623).A function using its own
thisorsuperstays unsplit, with a warning (Handle route callbacks that reference this during code splitting #8688).mainsplits it and calls it with anotherthis.Already-unused declarations run once.
maincopiesconst unused = register('x')into every chunk and runs it again.Route options named through several
consts or a cast are split and their server options removed. Onmainthey are neither, andserverships.deleteNodesremoves what only the removed options read from every output, split chunks included (a destructuring default only aserverhandler reads). It also applies withautoCodeSplitting: false, where it does nothing onmain.A server fn written in place as the
loaderis compiled, and the page gets its value. Onmainthe handler ships to the client and the loader returnsundefined, with the default groupings and withloaderin the groupings (Vite build). It isn't split here either; withloaderin the groupings a warning (split-claimed) says so.Route options the compiler can't read warn, saying what to write: a spread, options from a call or an import, options written to after their declaration, a computed key. What they hold isn't split or removed, so server code in them ships, as on
main, which says nothing.A route made in an app's own factory function is served as written, with a warning naming the cause.
mainsplits it and the page throws.A
Routethat isn't one variable (destructured, declared twice) is served unsplit with a warning.mainleaves a destructured one out of the route tree and fails the build on a repeated one.Other shapes that fail or break on
mainbuild and work: a chunk or shared module compiled before its route file (router-plugin: split chunk and shared module miss shared bindings when compiled before the route file #8754), two@babel/traversecopies (router-plugin: a split route option that is also a shared binding exports an undeclaredSplit…when two @babel/traverse copies are installed #8715), exports of a split route (Compiler correctness: split-route exports and distinct re-export aliases #8505), an imported component used ascomponentandpendingComponent(autoCodeSplitting: imported component used as both component and pendingComponent is left undefined (ReferenceError) #8914), project paths with'or#(Code-splitter breaks every route when the project path contains a single quote/apostrophe (autoCodeSplitting: falsedoes not avoid it) #7754).Production source maps name a split chunk's source by the route file's path, not
route.tsx?tsr-split=….Route generation
@tanstack/router-plugin/esbuildgenerates the route tree at each build start and rebuild. Onmainan app without a committed tree fails to build.mainit fails route generation and the build.'/x' as constis kept in sync.createFileRoute(path), andcreateFileRoutein__rootbecomescreateRootRoute.// @ts-nocheck,// @ts-checkor/// <reference …/>stays first when the generator adds the router import to a route file.mainputs the import above it, and TypeScript then ignores the directive.routeTree.gen.tsis written again, and edits of the virtual route config and of__virtual.tsfiles are picked up. Onmaineach of these leaves a stale tree undertsr watch..tsroute files get a scaffold without JSX (Empty .ts route file is scaffolded with JSX, breaking all route generation #8480)..lazy.vuefiles androute.component.vuepieces belong to their route.tsr watchand the Rspack and webpack plugins watch every route root,physical()mounts included, andvite build --watchpicks up new route files. Siblingphysical()mounts no longer declare one identifier twice (router-generator: siblingphysical()subtrees in a virtual route config generate duplicate identifiers #8879).tmpDiron another filesystem (EXDEVonmain) and a deleted.tanstack/tmp(git stash -u); onmainevery later route change fails until a restart.tsr generate;mainexits 0 and writes the tree.<Hydrate>, import protection, HMR, diagnostics
<Hydrate><Hydrate>imported through the app's own re-exports (a barrel,export *, a namespace import) splits its children. A renamed re-export, or one through a package, stays unsplit.use*()functions directly and are split;mainfails the build on a bareuseX()call.awaitoryielddirectly in the children, and a read of a private name of the enclosing class (this.#label), fail with a message instead of a parse error.Import protection
<ClientOnly>for a component rendered on the server (for a component a route option renders, a wrapper passing the router's props on:errorComponent: (props) => <ClientOnly fallback={...}><Oops {...props} /></ClientOnly>),createClientOnlyFnfor a function.mainprints a generic hint. A marker violation names the position of the marker import (src/count.ts:3:8).!exclusion. On Rsbuild, traces start at the app's first file instead of Start's client entry.mainis silent.?rawof a file with aserver-onlymarker serves the mock;mainships its text.mainis silent.mainit is silent.Route HMR
const Page = flag ? Wide : Narrowand a layout import switched to another module are stale onmainuntil a reload. The router takes the new component after React Refresh's pass, and React Refresh alone decides whether state survives.mainis stale. Split chunks carry the route file's@refreshpragmas, so a split component keeps its state under@refresh granular. After a rename or a removed component in a split route, later edits need a reload (pinned, Renaming a component causes an endless HMR invalidate loop on webpack/Rspack solidjs/solid-refresh#88).*.lazy.tsx) update in place, with React state;mainreloads the page. The page still reloads, as onmain, when an edit removes an option the route loaded from the lazy file, and when the router the page created last has its own route of that id without the lazy file.mainthe page keeps the old loader's data.*.component.vuefile. Onmainthe page goes blank until a reload.Diagnostics
[tanstack-router]or[tanstack-start]prefix.mainprints e.g.createServerFn must be assigned to a variable!with neither. On Rsbuild, Rspack and webpack the position is the compilation's own (File: ./src/routes/x.tsx:3:23) instead of:1:1.Not guaranteed (as on
main)Routefrom an app's own helper, or a file the generator doesn't list, is served as written; under Start itsserver,ssrandheadersship to the client. The same holds for what unreadable route options hold.import(),require()andimport.meta.globneither fail nor warn. Keep builders statically analyzable.Route.update(), code-basedcreateRoute({ server }), and a file read on purpose as text.mainmakes them:<Hydrate>chunk copies the module-level declarations its children reach, so a context, a store or a reassignedletexists twice (ten shapes in KNOWN-BUGS);letorvarthat code staying in the route module assigns, so it can read a stale value (every split option alike: an arrow, a method or an object-formhandler).Routethrough an import cycle, the page fails to load (on webpackCannot access 'Route' before initialization).output.minify: falseor Vite'sbuild.minify: 'esbuild', the stub of an exported server fn the client never uses stays in the client bundle, and the server fn stays callable over HTTP. So does a stub a user call continues (….handler(fn).bind(x), left unannotated so the user's call keeps its effects), and one that client code calls only in a branch the bundler doesn't remove (a constantif (false)is removed by the default minifiers).createServerFn,createIsomorphicFn, …) under another name, or the whole router package from a package of your own (see the re-exportedcreateFileRouteabove), isn't a supported pattern. A renamed Start primitive is compiled where the compiler can follow it, but on the Vite dev server a module that imports it from a virtual module can keep its previous compile when that virtual module switches between a primitive and an ordinary function, until a restart.maindoesn't follow the rename and ships the server implementation.loader: loaderObjectfrom another module) splits whole when the loader is split, and breaks at runtime. Write the object in the route options.tools.rspack: the SSR build fails for a.vuewhose<script>defines a server fn.@rsbuild/plugin-vueworks;mainfails every Start.vueon Rsbuild.Follow-ups
mainin splitting and<Hydrate>were kept out on purpose and are in the "What this rewrite unlocks" comment: splitting an option whose value the route file exports, one instance instead of copies in<Hydrate>chunks, an imported loader object.createServerFn({ serializable: true }).<Hydrate>boundary is inert on a fresh page (maintoo): it reports hydrated but its button ignores clicks, on Vite and Rsbuild production builds. It works after client navigation and withsplit={false}. The cause is in the Solid runtime, not the compiler. Nested split boundaries can also stall: on about half of cold loads neither gate hydrates, the inner chunk is never requested and a button outside the boundary stays dead too (Vite and Rsbuild,maintoo). Add an e2e that clicks a split boundary, and a control outside it, on a fresh page.<Hydrate>: the first click can be lost (maintoo, runtime, also withsplit={false}): with the default strategy a click right afterpointerenteris dropped, and withevents: 'click'the replayed click lands on the boundary's wrapper instead of the button. Touch devices hit the first case.let: a candidate closed rule keeps an option in the route module when its chunk would copy a binding that staying code assigns (the stale-copy limit under Not guaranteed). It costs a lost split when the staying writer never runs before the read; not taken here, to split asmaindoes.__rootcache group: unblocked now that [Bug]: Panic "Chunk not found in ChunkByUkey" when a splitChunks cache group is named like a webpackChunkName chunk web-infra-dev/rspack#16289 is fixed.solid-router/src/hmr-chunk-importer.tsandchunkImporterCallin router-plugin's split planner ([Bug]: lazy compilation:import()of a module that accepts its own updates keeps resolving to its first namespace web-infra-dev/rspack#16594);HACK(rspack#16567)batch inrouter-utils/src/compiler/hosts/rebuild.ts([Bug]: compilation.rebuildModule callback never called when the module's rule match changes or another rebuild removes it web-infra-dev/rspack#16567). The batch also works on 2.3.3; dropping it needs the plain rebuild path to accept 2.3.3's answer for a module another rebuild of the pass removed (an error, "no longer in the module graph").main; reusing it needs a sound "graph unchanged" test, likely an Rspack change set); the plain-module cost under Losses.tsr generatewrite different routeTree.gen.ts (Start footer added, then stripped) #8437 CLI half, server routes with a.tsextension gets the wrong boilerplate while creating the file. #4462, Vite HMR blank page when editing__root.tsx(Solid SSR) #6331 (Editing a module that renders <html> (SSR + hydrate) throws "template is not a function" and breaks HMR solidjs/solid-refresh#91), [@tanstack/react-start/plugin/rsbuild] tanstackStart() eclipses the client environment's output.assetPrefix, blocking downstream plugins #7827 andssr: falseroutes still bundle components in server output #6400.solid-start.fullserver scenario renders its error page andvue-start.fullan empty shell, onmaintoo. Fix them in a separate benchmark PR.url()of a denied file on Rsbuild builds a silent mock; import protection reports a dead re-export of a denied module with a top-levelawait.close(): [Bug]: objects captured by closeBundle remain retained after bundle release and repeated GC rolldown/rolldown#11444 (closed; the fix, fix: allow plugins to be garbage collected afterbundle.close()rolldown/rolldown#11467, is merged but not yet released).vite devwith@cloudflare/vite-plugin, a memoizedimport()started by a request that has already answered never settles: vite-plugin: a request abandoned by its client is cut off ~10 s later invite dev, and a dynamicimport()it started never settles, so every later request awaiting it hangs cloudflare/workers-sdk#16214.Upstream issues filed
One line per issue; GitHub shows each one's state. A note stays only where the state doesn't tell what users get.
Yuku: 28 filed. The PR pins Yuku 0.29.0, which has every fix. yuku-toolchain/yuku#290 was closed because its fix is deferred to Yuku's upcoming transformer; we don't need it.
All 28 Yuku issues
_/$/Unicodeimport X = ns.Ymarks thensreference as a type position yuku-toolchain/yuku#229import X = ns.Yexportyuku-toolchain/yuku#230 decorators afterexportJSXText.valueis not entity-decoded yuku-toolchain/yuku#231 JSXText entities@yuku-core/wasmparses stale bytes for an empty source in WebContainers yuku-toolchain/yuku#244 WASM stale bytesunwrapfor any node, likeisWrapperyuku-toolchain/yuku#247unwraptypingmodule.copyAst(): a mutable copy of the analyzed tree that maps back to it [feature request] yuku-toolchain/yuku#248copyAst()export {} from "m"produces no module record yuku-toolchain/yuku#251export {} fromimport()/require()when the specifier is parenthesized or a plain template literal yuku-toolchain/yuku#252import()specifiers++operand followed by a line comment yuku-toolchain/yuku#255 postfix++parensfor (init;;)no-inrestriction leaks into parentheses and literals, misparsing or rejecting valid code yuku-toolchain/yuku#256for (init;;)no-inimport type {} from 'x'as invalidimport type 'x'yuku-toolchain/yuku#258import type {}super()in a nested class field's computed key yuku-toolchain/yuku#259super()in computed key</>is lexed as JavaScript, so<p><>a</> — b</p>fails to parse yuku-toolchain/yuku#260 JSX text after</>printdrops the parentheses in(a?.b)!.cand changes optional-chain semantics yuku-toolchain/yuku#287(a?.b)!.cJSXTextbuilt withb.JSXText({ value })is printed unescaped, producing invalid JSX yuku-toolchain/yuku#288 JSXText escapingprintignores an editedJSXText.value(the stalerawwins), unlikeLiteral: is that intended? yuku-toolchain/yuku#289 stale JSXTextrawprint(file, { strip: true })keepsexport { I }/export default Iof type-only bindings, so the JavaScript does not link yuku-toolchain/yuku#290stripkeeps type-only exportsfile.exportshas no record forexport namespace A.Byuku-toolchain/yuku#318export namespace A.Binfile.exportsVite:
Failed to reloadhotUpdatehooks run is cached with the old?t=, so a module that imports itself runs twice (behind a recurring route HMR test flake)vite build --watchdoes not close its watchers on Ctrl-C or SIGTERM (closeWatchernever runs) vitejs/vite#24181vite build --watchruns nocloseWatcheron Ctrl-C/SIGTERM, so Start's watch-build sentinel leaves its temp directoryexport *from a module still evaluating in a cycle never gets its later exports (undefinedwhere Node has the value) vitejs/vite#24183 module runner:export *through a cycle never gets a later export (undefinedwhere Node has the value)build --watch:closeBundledoes not run when an output hook fails vitejs/vite#24219build --watchruns nocloseBundlewhen an output hook (renderStart…writeBundle) fails; Start's client-build record does not depend on itvite:afterUpdatevite build --watchexits 1 withENOENTbefore the first build is writtenvite buildexits 0 (same defect as [Bug]: RSC: build exits 0, but the app fails at runtime: a client component returned by a client-imported server action is missing from the client manifest web-infra-dev/rspack#16786)loadModuleruns in the last server's environment, then fails with "Vite module runner has been closed" once that server closes (Start's RSC test that hit it now runs in its own process)Rolldown:
vite build --watch(commented with a repro; an existing issue)this.load()returns null in bundled-dev HMR@__NO_SIDE_EFFECTS__is ignored for functions exported withexport { fn }rolldown/rolldown#11221@__NO_SIDE_EFFECTS__onfunction f+export { f }is ignored across modules (commented with a cross-chunk repro; an existing issue)moduleSideEffects: falseafter its hooks stop returning it rolldown/rolldown#11223 stalemoduleSideEffectsin watch modeimport()of a never-loaded chunk throwsMissingFactoryErrorwithdevMode.lazy: falserolldown/rolldown#11300 bundled-devMissingFactoryErrorupdaterolldown/rolldown#11648 a file removed and re-created within 100 ms keeps failing to resolve in Vite's dev serveroutput.topLevelVar(which Vite 8 sets) turns a top-levelusing/await usingintovar, so its disposer never runswatcher.close()before the watcher is created is ignored: the build runs and the process never exits (also through Vitebuild({ build: { watch } }))closeBundleruns twice after a build-phase error rolldown/rolldown#11969 watch mode:closeBundleruns twice after a build-phase error (theERRORevent's result closes an already closed bundle)Rspack:
sourcesContententries are emitted as""instead ofnullweb-infra-dev/rspack#16347 a missingsourcesContententry is emitted as"", notnull(fixed in Rspack 2.3.1)sourcesContentfrom the module resource when emitting source maps web-infra-dev/rspack#16348 feature: fill missingsourcesContentfrom the module resource at map emission (closed with no small, robust fix: a map's text must take part in HMR invalidation)rebuildModule's callback is never called when the module's rule match changes (fixed in Rspack 2.3.3; worked around here below it)assertion failed: self.backup.is_some()in the compilation after one whosefinishMaketap rejected web-infra-dev/rspack#16578 the compilation after one whosefinishMaketap rejected panics (fixed in Rspack 2.3.3)attempt to steal from stolen value: BuildModuleGraphArtifactaftercompilation.rebuildModule()answers an error web-infra-dev/rspack#16579 arebuildModulethat answers an error panics the compilation (fixed in Rspack 2.3.3)import()of a module that accepts its own updates keeps resolving to its first namespace web-infra-dev/rspack#16594 lazy compilation: a laterimport()of a self-accepting module answers its first namespace (fixed in Rspack 2.3.3; worked around for Solid, wrapper emitted on every version)maintoo)finishMaketap that rejects before stage 0 hangs the build at 100 % CPU instead of failing it (fixed by fix(rsc): unblock compiler shutdown after a fatal build error web-infra-dev/rspack#16818, not released yet)VirtualModulesPlugin.writeModule()inthisCompilationof a fresh compiler is ignored, so the build keeps the cached content (fixed by fix(cache): honor virtual module writes in thisCompilation web-infra-dev/rspack#16820, not released yet)rebuildModule()the next build links imports to the wrong modules (an RsbuildbuildCachebuild after removing a server function underbuild --watchfails; a fresh cache builds)Rsbuild:
SWC (Rsbuild's transform):
await usingleaves laterexport const/let/vardeclarations after the disposal, so the disposer hits a TDZ(new F)()is printed asnew F(), dropping the call (the PR printsnew F()for an argument-less keptnew, so Start's output is unaffected)0, "use strict";becomes a"use strict"directive swc-project/swc-ai-issues#1031 the minifier turns0, "use strict";into a"use strict"directive (a SyntaxError in a function with default parameters); hit by a compiler test during the rewrite, the compiler now emits(void x)solid-refresh:
__root.tsx(Solid SSR) #6331)chokidar:
changewhen the new target has the old one's mtime and a later atimeOthers:
\nas a line break (lone\r, U+2028, U+2029 ignored) Rich-Harris/magic-string#368 only\ncounts as a line breakmoduleCache: falsedoesn't reload an edited.mjsor.cjsconfig, so a native JS virtual route config keeps its first version until restart (commented with a jiti-only repro; an existing issue)typeof xtype query keepsxalive pcattori/babel-dead-code-elimination#50typeof xkeepsxTextEncoder.encodeInto('')returns the previous call's{ read, written }stackblitz/webcontainer-core#2173encodeInto('')returns stale datamemo(Page as any)andmemo(Page!)are not registered oxc-project/oxc#29281 React Refresh doesn't registermemo(Page as any)(fixed in oxc 0.159.0; no Rolldown release ships it yet)n!: -1n), aborting the process (Vite 8)oxc-parserleaks native memory on everyparseSynccall; hit in our own tooling, not in the PR's code, and commented there (fixed in oxc 0.159.0)enqueueUpdate(callback)drops the callback while a refresh is pending rstackjs/rspack-plugin-react-refresh#146enqueueUpdate(callback)drops the callback while a refresh is pending (fixed in 2.0.3)pnpm run dev -- --config) tanstack.com#1353 the playground drops Start configIssues
server.handlersstrip — server code and node-only imports ship in the client bundle #8514autoCodeSplitting: falsedoes not avoid it) #7754Split…when two @babel/traverse copies are installed #8715autoCodeSplittingis enabled #6667physical()subtrees in a virtual route config generate duplicate identifiers #8879bundledDev: true#7535.andhandler/server/client, silently disabling transform after AST-roundtripping pre-plugins #7280Each of these was reproduced on
main0b6d4f3f6band run again on this branch, except five:autoCodeSplittingis enabled #6667, whose fix is fix(router-plugin): point split routes' source maps at the route file #8860, a PR split out of this one and merged early.mainno longer shows. Each one is closed by a test here that reproduces its shape:bundledDev: true#7535 (SSR runs an edited module in bundled dev) and start-compiler-plugin fails to lazy-load dependencies with Vite bundledDev #8407 (a server-fn module calling a dependency at load bundles in bundled dev):mainworks since fix(start): preserve dev SSR CSS order #7830. Tests:start-compiler-dev-server.test.ts, "SSR runs an edited handler, called directly and by id" and "a server fn module with a top-level call of a dependency bundles for the client without its handler"..andhandler/server/client, silently disabling transform after AST-roundtripping pre-plugins #7280 (whitespace or a comment between.andhandler):mainallows it since fix: whitespace in server function .handler() not matching compiler regex #6216. Test:createServerFn.test.ts, "a handler called with a newline after the dot is extracted" and its four siblings, with the builder in the module and in another module.mainwith Vite 8.3.4 or 8.2.1. Test:start-compiler-dev-server.test.ts, "a module whose factory becomes a server fn builder bundles again without errors".Other issues:
mainno longer fails the October repro (0 of 10 runs on Vite 8.2.1). A test here covers concurrent first calls of one server fn whose handler's imports load slowly (start-compiler-dev-server.test.ts), not the issue's server fn calling another.physical()subtrees in a virtual route config generate duplicate identifiers #8879: the build no longer fails (taken names get a numeric suffix, e.g.Index2Route). The issue's preferred names (AccountsIndexRoute) are fix(router-generator): include the parent route path in variable names for physical() mounts #8880's change, which still applies after merge.export { component as View }the option is split, soView !== Route.options.component.tsr generatewrite different routeTree.gen.ts (Start footer added, then stripped) #8437, partially addressed: Start's footer followsquoteStyle/semicolons, buttsr generatestill writes none.main.strictExecutionOrder: trueonssr.Supersedes #8459, #8504, #8630, #8721, #8773, #8756, #8755, #8732, #8686, #8682, #8681, #8061, #8493, #8481, #7892, #8515, #7281, #8797, #8662, #8296, #8215, #8454, #8276, #8675, #8540, #8523, #8524, #8680, #8684, #8749, #8801, #7338, #8798, #8818, #8899, #8832, #8656, #7925, #8799
Supersedes in part (what is still missing):
{ read, render: pending }), identity after a loader-only edit.autoCodeSplittingwith esbuild is still refused, as onmainsince fix(router-plugin): throw on autoCodeSplitting with esbuild #8852.export { Layout as View }the option is split, sooptions.component === Viewdoesn't hold; the loader alias is untested.mainthrough fix(start-plugin-core): Rsbuild manifests list only a route's own chunks #8876.console.errorfor an uncompiled factory reaching the browser stub, hooks recognised by binding, warnings for<Hydrate>children from a spread and for getter/setter split options.Implementation obsolete (needs a re-port after merge): #8804, #7693, #7766, #7872, #8291, #8842, #8833. In part: #8293 (the prerender-env wiring and build-time stripping), #8277 (its route-HMR half is superseded; the rest applies as a normal PR), #6748 (
startInstance.createServerFn(…)needs one recogniser entry and a test), #8882 (only its Vitestart-router-pluginpiece), and #8845 and #8877 (stacked on #8842; a restack only).Still apply after a rebase: #8800 (3 small conflict hunks), #8880 (only deleted snapshot fixtures conflict), #8057 (mechanical: re-run the migration). #8256 is overtaken by
mainand could be closed.How to review
The diff against
mainis 2,344 files. Tests and the test harness are 1,686 of them (the oracle fromcompiler-tests/baseline, plus this PR's suites), and regenerated route trees are another 198. Product code is 249 files inpackages/*/src.router-utils/src/compiler/README.md, then readidentity→source/analysis→units/mutation→rewrite→placement(withclustersandreads) →plan→emit→values/summary/facts→cache/pipeline→verify. Keeptests/helpers.tsandtests/placement.test.tsopen alongside.router-plugin/ARCHITECTURE-CODE-SPLITTING.md, thensrc/planners/.start-plugin-core/src/planners/(start-env,hydrate,rsc-css,edges), withsrc/compiler/,src/server-fns/andsrc/import-protection/. Builder escapes:ESCAPE_MESSAGESinstart-env.tsandtests/start-compiler-builder-shapes.test.ts.router-plugin/src/hosts/.src/vite/compiler-plugin.ts.src/rsbuild/(readCOMPILER_ARCHITECTURE.mdfirst).router-generator(AGENTS.md,analyze/,model/,print/).router-core/src/hmr.tsand{react,solid,vue}-router/src/hmr.ts;solid-router/src/hmr-chunk-importer.tsis the temporary Rspack workaround.README.md,SPEC.mdandKNOWN-BUGS.md.To reproduce the measurements, see:
packages/compiler-test-utils/oracle/README.mdbenchmarks/compiler-perf/README.mdpnpm benchmark:bundle-size:runscripts/benchmarks/bundle-size/server.mjsThis PR was written with AI assistance: Claude Code agents working under a human architect. Their work was checked against the oracle, e2e, perf and bytes gates above.
🤖 Generated with Claude Code