df2bab3dd4 kept them in the whole RSC env. That env also evaluates modules
whose components only SSR and the browser render; their children may read
browser-only code: a `.client` child failed the build on import protection,
an unmarked one threw `window is not defined` in the provider chunk (main
builds and runs both). Keep the children only inside a server fn's handler
range, erase the rest as in every server env. A server component outside a
handler shows its fallback, as on main: KNOWN-BUGS. SPEC J4.11.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the bundle-size skill's coverage step: an env-only call as the first or
second .handler() argument is stubbed with the list; a Solid capture named
children keeps its name; a boundary rendering only the children a component
receives passes them as children; a virtual module's stale update is still
sent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
E2: main's unused import { Route } in split chunks under verbatimModuleSyntax
(Rolldown partitions the graph differently; not ours). A2: an edit that only
changes codeSplitGroupings resets React component state in dev. B3: a server fn
of an unlisted node_modules library throws when called during Vite SSR (main
is broken there too).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The importer const sat before the statement holding the group's first
placeholder, between a declaration and the route options spreading it
(`const base = {…}`, `createFileRoute('/x')({ ...base, component })`): Rolldown
inlined neither (+17 B eager against main on Vite 8). A group with one split
option now writes `() => import(…)` in its placeholder; a group read by
several options, or wrapped, keeps one const after the imports, where it
separates no statements.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A route file renamed or deleted on a Vite dev server: the registry change
invalidated the removed path and reloadStaleModules sent its update ahead of
the route tree's full reload, so the page fetched the gone file (404, '[vite]
Failed to reload'). Its module is still invalidated; the update is Vite's own
removal event, as on main. A virtual module's update is still sent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
children is an ordinary prop of the self-closing placeholder, as on main; only
key and ref, which React keeps for itself, travel under another name. Saves
the tsrCap$children renaming in the parent and the chunk (+7 B each).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main's splitter reads the text Start leaves in the route module. On the client
a server fn's handler is erased, so a server fn only another one's handler and
the split component name is the component's: it moves into the chunk instead
of the shared module the entry loads (consistent.tsx of the server-functions
e2e apps: +65 B / +84 B eager against main).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Step 5 erased <ClientOnly> children in every server env, the RSC env included.
A Flight render serialises ClientOnly's props for the browser, so the children
were gone there too: the browser never rendered them (JSX in a handler, a
composite component's slot). Erase only where HTML is rendered; SPEC J4.11.
e2e: rsc-client-only (Vite build, Rsbuild build, Rsbuild dev).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With a cast, .handler(fn, other) type-checks no more but compiles: the stub
replaced the first argument only, so the client (and an SSR caller, an RSC env
module) kept the rest and what it imports. The stub now replaces the list,
first argument's start to the last's end; the provider keeps it as written.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Neither react nor vue declares sideEffects: false, so importing one already makes
a denied module effectful: the rows never changed a verdict. Probe on Vite and
Rsbuild (memo/forwardRef/lazy, React.memo, defineComponent/defineAsyncComponent):
one client report each, with and without the rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R162 refuses a server fn inside a function body, which includes Vue
`<script setup>`: a server fn is created once, when its module loads.
`getSecret` now lives in the component's plain `<script lang="ts">` block,
as the build error advises, so the e2e still covers a server fn defined in
a Vue SFC. `createIsomorphicFn` stays in `<script setup>` (not refused).
Assertions unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A hoisted server fn reads what its chain reads at load before its own
statement runs. An import and a function declaration (async and generator
ones too) are initialised before any statement runs, so a function declared
below is read as in the source; a `var` is `undefined` until its declarator
runs, so only one its own statement declares before the server fn differs;
a `let`, a `const` and a class its own statement or a later one declares
are not initialised there and stay refused. `SymbolTable.initialisation`
states the rule per binding kind.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`pure-calls.ts`, `values.ts` and `placement.ts` comments no longer describe
the deleted engine; `Placement.extracted` is `sharedExports`
(`SharedExport`); `isPureClass` is `purity.ts`'s own. Describe and row titles
of `placement.test.ts` and the headers of the pure-router-API and
pure-builder build tests state what the rows assert now. The changeset gives
the measured speed-up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- F1: the hoisted `const` has the env module as its fixed home, so it stays
right above its statement and other outputs import it; it no longer moves
to the shared handler module the file imports, which created it before
every statement of the file (an imported middleware list an earlier
statement fills, a global set before: 0 middlewares, options undefined).
- F2: a server fn a sequence discards is compiled like any position (it was
left in place, its handler shipping to the client).
- F3: the order refusal counts only what the chain reads when the module
loads, not what a function of it (a validator, the handler) reads later.
- F4: a refusal names its position (an `if` or loop body, not "a block"; a
class static block's local, a class expression's own name, `this` of a
class's static parts); a top-level `await` in the options compiles; the
Vue `<script setup>` local-read message says to leave the block.
- F6: rows for each of these, the position texts, and a labeled statement,
an enum member, a namespace body, a decorator argument.
SPEC J4.6 and the changeset say where in the order it is created.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Server fns in a method, a function, a component and an object entry's arrow
are refused since R162 (load-positions rows cover each category); the static
field and the call argument stay, still loaded beside the provider.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The core README describes placement as it is (clusters per unit, the
assignment table, reads, the removal rule, the function-scope cleanup and
its hook naming convention, the planning rounds) and the verifier's rules;
SPEC G3 points at J2.0, J4.2, J5.2 and J4 instead of describing the
deleted engine; comments no longer name extracted exports. Changeset for
the phase.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`route-placement.ts` places every plan, so it is `placement.ts`, with the
types `reach.ts` held; `placement/clusters.ts` and `placement/reads.ts`
move up as `clusters.ts` and `reads.ts`, the latter with
`readFromRemoved` (`placement/roots.ts`). Moves and import paths only,
and the comments naming the old paths.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rule (d) counted a `<Hydrate>` chunk's wrapper, generated text mapped to
the boundary inside a top-level statement, as a second emission of that
statement (`Tabs.Panel = function Panel() { return <Hydrate>… }`,
`register('p', () => <Hydrate>…)`: "emitted 2 times"). A text segment now
carries `gen` when it is a generated unit's own body text, and (d) counts
mapped text only without it; emit and the caches ignore the field. The
copying-output branch of (d) goes: placement never homes a statement in a
copying output. Rules (e) and (h) went with extracted exports. New rows
keep every remaining rule a real check: removing any one turns a row red.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The position walk met a function's body block (or a condition or loop in
it) before the function, so the message said "in a block": a function
around the refused position is now the reason given. Positions unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SPEC J4.6 states R162: a server fn that is no top-level declarator's
value works where its module creates it exactly once, unconditionally,
when it loads, and the build fails at it anywhere else; §5.13 and the
KNOWN-BUGS entries follow. The server-functions guide gains "Where to
Define Server Functions"; the changesets no longer promise hoisting from
functions or suggest a fix the build refuses.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hoist's position rule is now the principle itself, closed by the
grammar: every expression position a top-level statement evaluates is once
and unconditional (a member's object, a callee, an operand, a template's
or JSX's expression, a spread, any operand of a sequence, a computed key,
a top-level `await`'s operand, besides the earlier list), except the kinds
the language may skip, repeat or run later: a ternary's branches, the right
operand of `&&` / `||` / `??` and of a logical assignment, what follows a
`?.` in its chain, a destructuring default, an instance field's
initialiser, a function (body or default parameter), a loop, `if`, a block,
`try`, `switch`, a namespace's body (`refusedKind`, one reason each).
`createServerFn().handler(…).bind(null)` compiles again. The local-builder
capture message, and its `<script setup>` twin, give a fix R162 accepts.
Tests: a row per newly allowed kind (a callee and a tag compile only: they
call the server fn when the module loads) and per new refusal; the
integration tier's in-function shapes deleted where the position was the
subject (server fns in erased code, in split components, in handlers, in a
`<script setup>` block, the extracted-export cases) and moved to allowed
positions where it was not (ids, wrapper names, lazy handler modules,
generated statements, message fixes, Vue fixes, the RSC provider).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces the hoist's temporary refusal. A server fn that is no top-level
declarator's value is hoisted only when the top-level statement holding it
evaluates it exactly once, unconditionally, when the module loads
(`loadPosition`: object and array literal entries, call and `new`
arguments outside optional chaining, `export default`, an assignment's
right-hand side and so a declarator's initialiser, class static fields and
static blocks, parentheses, casts, `!` and a sequence's last operand), and
the hoisted `const` goes immediately above that statement, so it is created
as often and in the same order as the source creates it (d22). Anywhere
else (a condition, a loop, `try`, `switch`, a block, a function body,
`<script setup>` included) is a build error at the server fn; captures stay
refused at the capture. A private name of the enclosing class is refused
(d19: the handler module did not parse); a bare chain statement builds
(b13): the hoist's placeholder maps to the chain, and the verifier's rule
(d) counts the placeholder of a claim covering a statement's whole text.
Tests: load-positions.test.ts (each allowed position builds and returns the
handler's value, each refused category fails at the server fn; d19, d22,
b13), the in-function and conditional hoist rows deleted, the others moved
to allowed positions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README's purity section says who asks it now (`effects()`, for the
effect witness of import protection, in builds) and that placement and
erasure read names, references and assignments only; rule L, the
compile's builder purity and the member write of a builder link go.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Purity has one job left: import protection's effect witness (whether an
unused import of a denied module counts, `effects()`), which only Start
reads. `pure-calls.ts` moves, unchanged, from the router plugin's
planners to `start-plugin-core/src/import-protection/`, and the router
session's raw facts no longer take it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No compile asks purity any more: the per-compile purity
(`ModuleAnalysis.purity` with the compile's builder chains, the `env`
option, `buildUnits` recording `const` builders) and the
`isPureExpression` export go. `effects()` keeps its own contexts, the
module's statements' and the recognizer's chain factories' per
environment, now built when a module is first asked about as a target
(`purityForEffects`), not in every constructor.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`isMutated` lost its last two callers (the options' wording and the
hoist), so the member-write detection behind it goes: `ClassifiedRef.
memberWrite`, `memberUse` with `forwards`, `writesAt`, `writeTargets`,
`MUTATORS` and `isObjectMutator`, the builder-link writes (`linksOn`,
`linkedBuilder`, `BuilderPurity.writes`, `RecognizerTable.
builderLinksWrite`). `MutationModel` answers `isReassigned` only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hoist's rule awaits the maintainer's decision (review-kept-analyses
4.1: closed conditions with `isReassigned`, or refusing every nested
server fn). Until then it refuses wherever it asked `isPureExpression` (an
option expression outside the handler) or `isMutated` (a module binding
read outside the handler), so neither is asked any more. Replaced by the
chosen rule before merge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A write through a const of the options' chain is a second reference to
it, so `chainSoleUse` already makes the options opaque; `chainWritten`
(the mutation model's member-write detection) only chose the warning's
words. It goes with the `written` reason: such options are reported as
"also used outside the route call", at the same place and severity.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`cleanOrphanedDeclarations` asked purity of a class, the only purity
question in the file: a class whose evaluation the model took for an
effect stayed, with the server import only it read (`class Repo { static
x = secret() }` in a component kept `./db.server` on the client), while
the same class at module level goes without any such question. A class
now goes like a declarator and like a module-level class.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`callsWhenEvaluated` (with `EvaluatedCall(s)` and `runsWhenPassed`),
`Tier1.runsLaterAt`, `ClassifiedRef.eager` and `Tier1.purity` only fed the
walk of what an evaluation runs and the old write table, both gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What the model followed through other names (the values a binding holds,
local names, parameters, thrown values, the objects a member write through
an alias may write) had its last readers in the old engine and in
`visitRuns`, which nothing calls any more: `MutationModel` keeps
`sitesOf`, `isReassigned` and `isMutated`, and goes with `visitRuns`,
the write constructs, `ClassifiedRef.readsThrough`, `ownsItsValue` and
`createsItsValue`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`Unit.effectful`, `augments`, `augmentEffects`, `copyable` and
`identityFree` had no reader once the clusters stopped computing effects:
they go, with `evaluationHasEffects`, the augmentation helpers,
`isPrimitiveLiteral`, `isIdentityFreeValue`, and the purity placement
judged effects with (`ModuleAnalysis.effectPurity`, rule L:
`languagePurity` and the language operations it accepted). `buildUnits`
takes the planners' purity, which records `const` builders as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The one placement builds one cluster per unit and reads only assignments
of the write table: `buildClusters` loses its `byUnit` switch and the
writer unions, the member-write and augmentation rows (route-placement
skipped them at both of its reads), the cluster fields only the old engine
read (`effectful`, `writer`, `exported`, `start`, `copyable`,
`identityFree`, `envPinned`) and the own-augmentation exception of
`Cluster.kind` (empty with one cluster per unit). `readIndex` keeps
`clusterReads` and `successors`: `reach`, `runs` and the walk of generated
names go. Probes before the edit (a non-empty own-augmentation set, an
effect homed in a copying output) were silent on the corpus and the fast
tiers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No planner calls `extractExport` and route-placement never homes a cluster
in an `export` output, so nothing emits `?tsr-split=export---…`: the
`export` output and derived kind go from the core (plan, placement input,
freeze, identity), with the hosts' work for them: the eager-export warning
(`hosts/eager-exports.ts`, the Vite `generateBundle` and webpack/Rspack
`processAssets` taps), the `sideEffects: false` rule on their query and
`moduleSideEffects`. The verifier loses rules (e) and (h), about extracted
modules.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nothing reaches them since the dispatch cut: the event table and order
rules, the settle solver, kept declarations, homes and inclusion
(`placement/events.ts`, `settle.ts`, `kept.ts`, `homes.ts`, `inclusion.ts`),
the seeds of `roots.ts` (`readFromRemoved` and `typeOnlyExportRanges` stay),
the cluster helpers and `ClusterGraph` fields only they read, and their
helpers in analysis, mutation, purity, units and rewrite. Route-placement
keeps nothing (`Placement.kept`, `check`) and reports only `shared-writer`
and `exhausted` fallbacks, without a binding: `kept-diagnostics.ts`
(`eager-split:*`, `shared-split:unused`, `eager-export:*`) and the fallback
fields go, with the assertions that nothing such is reported.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`onOldEngine` and the old branch of `computePlacement` go: no planner
declares a `split` output without a route module (R155), so the dispatch
only ever chose route-placement for shipped plans. `plan.ts` calls the one
placement directly; `reach.ts` keeps the types.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 459 core rows that assert where the old placement engine put code for a
`split` plan without a route module (a plan no planner produces) go; the
mechanisms of kept files stay as rows on route-placement: the toy splitter
takes `imported` (a route file, `setRouteModule`), used by the shared-writer
fallbacks, the glue of renamed bindings, the env-readers unit, the rounds
bound and two rewrite rows. `extractExports` leaves the toy splitter, with
the verifier's (e) and (h) rows. 644 rows, green on both engines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The copy analogue of H4 now reads like H4: code that moved (the children,
what only they use) assigning the chunk's copy of a binding the env module
keeps falls back; a helper the env module holds too writes each side's own
copy, as on main. A lazily built cache or a scratch variable both sides
call builds again and reads its values (it was refused at ef9aa56252);
every refusal of the fix's own rows stays. The id counter, the run-once
flag and the setter pair build with two instances as on main (R153), and
a let only the route's component reads stays the module-keeper case:
KNOWN-BUGS items 9 and 10.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
H4, copy analogue: a <Hydrate> chunk that would assign its copy of a
binding the env module keeps falls back (hydrate-module-write), in the
same writers check as assigning an import: the copy would be written and
the module's read (a module let the loader and the page read, assigned in
the children, built silently wrong; the base refused it, main fails the
build). The refusal now advises split={false} only.
H2 (a): the hydrate output's import set is its planner's set plus the
route binding (RouteModule.route, set by the router planner), as split
chunks import it, whatever encloses the boundary: children reading Route
from an exported component outside the route's component no longer get a
second createFileRoute(...).
Rows failing at 9cc5260b80: route-file refusals (counter, store), h4's
refusal, the chunk importing Route (fast tier), and a Vite/Rsbuild build
where the children read the one route the tree updated. KNOWN-BUGS, SPEC,
README, guide row and changeset follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KNOWN-BUGS accepted limit (p21: +21 B eager, the chunk imports what main
copies; t05: children assigning it are refused, as at the base). SPEC J5.2,
the core README and the isHydrate comment name the clause. No rule change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deletes the nine rows whose outcome is now main's (the chunk's own copy):
the six of known-bugs-hydrate-module-level (context, reassigned let, one
instance, compound member, Object.assign, registry), the Solid context row
of hydrate-pages-solid, and hydrate-build-cases' b1 (an exported let a
component outside the boundary assigns) and b2 (an export initialised by a
call) with their pages. They are listed with their inputs in KNOWN-BUGS'
accepted limits, with the d1 difference (a destructuring copied whole); no
tests (the limit itself). The split={false} row stays, retitled.
SPEC J5.2/J5.5/J5.8, the core README (Hydrate chunks on route-placement,
the dead-claim rule), the guide's rejection row and the hydrate-refusals
changeset say the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without the hint the route module's own import evaluates the component's
module eagerly, on main too, so the row asserted better than main. With
it, the route module's unused export and import drop: eager at
75647e727a (the chunk imports the component from the route module), lazy
with H1 (the chunk copies it), on Vite and Rsbuild.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After H1 the refusal remains only for a binding the chunk imports (a name
a top-level statement declares, or one leading back to the boundary); a
writer moved into a component outside the boundary is copied with the
boundary and still assigns the import, so that advice no longer clears it
(review-phase2-stops 2.4). The guide's row says the same; the
hydrate-ordered-effect row goes with the code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
H1: a hydrate output copies every declaration its children reach, by
binding and transitively, exported or not, and no top-level statement.
H2: it imports only what cannot be a copy: a binding its planner names
(OutputDecl.imported: a declaration leading back to the boundary, the
route or a recursive component, computed by the Hydrate planner from
names on the source), a name a statement declares, what another module of
the file holds (main's shared names, D3; a generated declaration with its
own home). A hydrate output is no needer and no home, so the common lazy
module between boundaries goes. H4 unchanged: an output assigning what it
imports falls back (shared-writer, the one reason the planner keeps).
As main: two chunks each copy a helper, children assigning a module let
assign their own copy (no hydrate-module-write), statements stay in the
file. Tests of spec 5.2 updated (extraction rows; the rejects rows and
their route-file twin replaced by N3; the composition row moved to the
router planner); core rows for H1, H2, H4 on the toy planner.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fixed home says where a generated declaration lives, not whether it
does (the removal rule, R153 amendment): when an erasure removed a claim's
occurrence and nothing else reads its owner (hasClaim), the owner is no
root, has no home and is not rendered. A <Hydrate> boundary inside a route
option the router deletes on the client (server, headers) builds again, as
on main, instead of failing with server-code-in-client
(review-phase2-stops 1, k1 and k2). The core's dead-claim rows pass on
route-placement.
Deletes the two Hydrate engine-fallback rows (hydrate-writer) and the
Hydrate kept-diagnostics row (spec-phase2-hydrate 4.3, 5.2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
onOldEngine no longer sends a plan with a hydrate or export output to the
old engine (the export outputs only the Hydrate planner declared:
extractExports is deleted). A file with a boundary gets the removal rule
like any other: a function only an erased handler calls, which assigns
state a kept function reads, leaves the client file and the chunk with
its import (N1 green).
Not to be pushed alone: chunks import what the file keeps until H1/H2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
N1: a function only an erased handler calls, assigning state a kept
function reads, leaves the client file and the chunk with its denied
import (fast tier; Vite and Rsbuild dev with import protection: builds
tree-shake it, dev serves it). N2: a route file's chunk copies the exported
component its children render (r2, r3); r4 imports Route (pins head).
N3-N6: children assigning a module let get their own copy (h4, a5); no
statement is copied (h6); two boundaries each copy a helper (h5); a
statement-declared var the children assign is rejected (a4). N7: a real
build loads the module such a component imports with the chunk.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A hoisted server fn the file's own code names now lives in one module
the file and the lazy module import (the lazy module's re-export of the
wrapper is its only root), loaded with the file as before; unit rows
restated. The changeset no longer names the stub or the runtime packages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Builder shapes S1-S5 (imported, same-file, barrel, factory, non-literal
options) now load their chain with the chunk as on main, the handler's
imports at the first call. The validator is still in the copy here (a
schema is built by the copy and by the instance, as on main); step 3
removes it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rule 4 (R157) pins a declaration the lazy module would hold when its
evaluation reads file state: a declaration of the source the env module
keeps (fileState). A declaration a planner generates (Start's
lazy-handler loader, which an unnamed server fn's handler stand-in reads)
is none: no source code can name it. Fixes the step-4 stop (22 corpus
routes whose loader names another server fn).
createSsrFnStub forwards __executeServer to the instance and returns a
FetcherBase (now exported from start-client-core). namedByEnvRoots no
longer skips claim owners: symRefsOf reads text parts only, so a claim
owner names only its own symbol (no test depended on it).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The file roots no wrapper of a server fn declared as const fn = <chain>
whose root is createServerFn(<no options | literal method>); the lazy
module re-exports the wrapper and the server fn (tsrFn$...), so the file
holds them only when its own code names the server fn, else the lazy
module does. In split chunks the declarator's value renders as
createSsrFnStub(id, method, () => import(lazy).then((m) => m.tsrFn$...))
(start-server-core, exported from each framework's ssr-rpc): a chunk
copying the declaration calls the one instance at the call. Dev test: a
server fn the lazy module holds, edits of its validator module and of its
handler reach HTTP calls (Vite, Rsbuild).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EditScope { kinds }: an insert, placeholder or claim applies in the
outputs of these kinds (the plan sets RewriteSet.outputKind). Start
renders a server fn's value as a stub in split chunks this way, before the
router planner declares them.
namedByEnvRoots: the declarations the env module keeps that the text of
claim-free generated code names, where the env module or a planner's lazy
(custom) module roots it. Start roots the re-exports of a server fn and
its wrapper in the lazy module: a chunk imports the server fn when the
file holds it, and copies it (as the stub) otherwise.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The registry's module is a derived id with a query: Vite and Rolldown read
a # of its path as a fragment (an app under "C# project #2"). The
resolver prints it with # escaped as \0#, which webpack and Rspack
resolve and the Vite host resolves for the resolver module. A Vite dev
lookup now imports the lazy module, which accepts no hot update: an edit
of a module only a handler reads reached the lookup and fully reloaded
the server; the lookup accepts its own updates, the file stays the other
boundary.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The registry's module is fixed per file by configuration and path
(ServerFnFact.provider): the separate provider's module (RSC), the file
(late pass), otherwise the lazy module, which now exists for every
in-place provider file with server fns (also when every handler stays in
place: top-level await, a handler writing kept state) and re-exports each
wrapper; the file no longer exports the wrapper under the registry's
name. An HTTP call loads the lazy module, then runs the middleware, as
main's provider module. Dev test: an edit of a handler kept in place
reaches server code and HTTP calls (Vite, Rsbuild).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OutputView.isRelocatedAt: the innermost claim around a byte is owned by
generated code another output is home to. A declaration only a route's
server-fn handler reads (jsedlacek/knihovna's log, zoe-resume's
layoutSchema) is no longer shared, so it moves to the lazy handler module
and its import loads on the first call, as on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rule 3: `custom` leaves isChunk: the lazy handler module is another
planner's derived output again, importing what the env module keeps (one
instance: the validator's state, a class, the module's writes; #8656).
Rule 4: one fixed point after the env closure: a declaration the lazy
module would hold, not exactly a function, stays in the env module when
its evaluation reads, by name and transitively through what the lazy
module would hold, something the env module keeps (x2: 'a/b'). Rule 5 is
the existing shared-writer fallback. Split chunks unchanged (R153).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The handler module imports what its module keeps (rule 3): the R156-era
rows go back to the source's values (#8656 class identity, compose-project
path, lazy-handlers state, start-env (4), route-file-writes (2),
preserves-user-code, parity e07/e10/e11/e13/e23/e26/e29b/l1/l13), the R1
rows read the one instance (r7 and r5b now the source's values), v_state
flips from a pinned known difference. New rows: rule 4 (x2 transitively
through a function, a pinned declaration's import at load, a handler-only
function stays lazy, t1) and rule 5 (h_write), p8656 in the fast tier.
Each fails at b89355a9fe.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start's in-place provider roots each server fn's createServerRpc export in
its file, so the file keeps the server fn. A split chunk or a handler module
reading it copied it: a second instance with its own validator schema and
chain state (main: 1 2 3, ours 1 1 2; handler modules 1 2 3 4 vs 1 1 2 2).
Chunks now import such a declaration (design-ssr-serverfn-double-build.md,
option a). The client has no such root: its outputs are unchanged. Start
tags its glue exports whenever the file provides server fns in place.
v_state (a handler reading state its validator writes) pinned as a known
difference.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code reaching a copied binding only through a binding the chunk imports from
the env module (what main imports, a statement declaring a name, a
declaration such a statement names) is not copied: the imported binding is
the env module's one instance, already set up there. A route chunk no longer
runs state.n++ again for export const state; a handler module no longer
reruns if (opts) { var conn = connect(opts) } (review-phase1-final 3.1).
read() and the walk share one predicate (importsFromEnv).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A class read only by an export is not copied with what its code reaches
(main keeps every class): KNOWN-BUGS accepted limit, pinned (test.fails).
known-bugs-code-splitter-server: the chunk re-runs the registration as
main's chunk does (two registries); main throws on this file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The R1 rule took an exported declaration nothing else reads as a root, so a
copy also took export const xQuery = queryOptions({ queryFn: () => getX() })
when it reached the copied server fn and ran it a second time; main's copy
strips its exports and deletes what only they read (31 gate corpus rows
'runs more than main'). An export now counts as a reference, as in main's
removal rule. r7 and the RSC s1/l1 copies follow main; a class read only by
an export stays out of the copy (open: main keeps every class).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The RSC provider copy (kind provider) copied what its handlers reach but no
statement or never-read declaration reaching it: a class static block, a
never-read declaration and a default-export expression were missing where
main's copy of the whole file runs them (gate probes r5, r6, x3 under RSC).
The R1 rule applies to every output that copies, in the same code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A chunk (a route chunk, a server-fn handler module) copying a binding the env
module keeps also copies every top-level statement, and every declaration
nothing in the module reads (exports aside), whose code reaches that binding
through the names it references, transitively, and what they need by the
same rules. Names only: no value, call or write analysis. main's chunk keeps
every statement reading a name it still declares, every class and every
never-read declaration; main's provider runs the whole file: so a registry
filled through a helper, a write through an alias, a class static block and
a never-read declaration give main's values in the copy (review-phase1 3.1).
Tests (failing before): R1 for handler modules (r1-r3, r5-r7, r8 control)
and route chunks (bump(), helper, alias, static block, never-read). Also the
handler fallback row (a var a statement declares), the Z1 pin (accepted),
and spec 8.2's import-protection rows. Words: route-placement and README,
SPEC J2.0/J4.2, Rsbuild architecture note, KNOWN-BUGS; the changeset keeps
the one change against the release (enum, namespace).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A derived output now drops only the `export` (`default`) keywords of a copied
declaration (`TopLevelItem.exportKeyword` covers the tokens and the spaces after
them, never a comment) and keeps its leading text, so `/* #__NO_SIDE_EFFECTS__ */
export function f` copied into a chunk keeps its annotation and the bundler drops
an unused call there, as on main.
`export default <expression>` counts among the statements a chunk copies with what
it reads or writes (its synthetic `default` is no declared binding); a derived
output runs it as `void (<expression>);` without re-exporting a default. A chunk
copying `ready` of `let ready = false; export default (ready = true)` reads
`true`, as main's chunk does.
Corpus vs ed239d5283: 140 files changed, chunks/shared modules only, blank lines
or comments only; bytes gate 0 larger, 0 smaller; parse gate 0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
known-bugs (class identity, PR #8656) and start-compose-project-path now
assert main's values: the lazy handler module copies the class and state its
handler reads, so instanceof fails and module writes are not what the handler
reads. Accepted under R156; #8656 is the follow-up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A lazy handler module is a chunk of the one placement: it copies what its
handlers read that the module keeps, with the top-level statements reading or
writing it, and imports nothing of the module, as main's provider (a copy of
the whole file, exports stripped) does. RouteModule.imported stays the split
chunk's (main's router splitter imports Route and export const|let|var). So a
value the module read at load before a later write keeps that value in the
handler (x2, start-build-handler-local-writes: 'a/b'), and main's second
instance comes back only where main has one.
Tests follow main: x2 (fast tier, kind A), the handler-module rows of the
parity, preserves-user-code, start-env and route-file-writes files, and
start-build-lazy-handlers (R29/R31 superseded by R153; R66 amended by R156).
SPEC G3/J4.2, core README, start-env header and the changeset say so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main deletes type-only export statements (stripTypeExports: export type X =,
export interface, export type { X }, an export { type X } specifier) before
its removal rule, so a value only they read is no longer referenced and goes
with its imports. readFromRemoved now counts their text as removed text: such
a value was used by the source and goes when nothing left reads it by value.
A value a local type, an annotation or a class used as a type reads stays.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An inline type import specifier that left with its statement's values
(`import { db, type Row }` on the client, or the route module's moved
import) left `export type { Row }` / `export { type Row }` dangling: Babel's
parser rejects it ("Export 'Row' is not defined"), so a Babel plugin after
the compiler (React Compiler via @rolldown/plugin-babel) failed builds main
passes. One closed rule, in freeze (`isTypeOnlyExport`): `export type { }`,
`export type { } from`, `export type * from`, `export { type X }`
specifiers and an all-type `export { type X } from` are in no output; the
`type X` specifiers of a mixed `export { y, type X } from` render nowhere
(`reexport-list`). Type declarations unchanged.
Tests (fail on 3d7bdd91e4): router-plugin dev route + Babel after (2 of 3
rows), Start client/server + Babel after (4 of 6), Vite build client/ssr
with Babel after (2 of 2), core placement rows (2). Corpus vs b7baa085be:
6 of 58,075 files changed, all type-only exports removed from the route
module; parse gate 10 -> 0 unparseable outputs. Non-route tool: 52 -> 2
(the 2: a truncated source Babel rejects itself).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
computePlacement sends every plan the old engine does not still need (a
<Hydrate> chunk, its export outputs, a split output without a route module)
to the route placement: server-fn handler modules, the RSC provider copy and
erasure-only plans. Statements stay in the module with what they name (R154)
and run at load; a declaration only removed text used leaves (l1: a function
only the handler calls goes from the client; its handler stays in place on
the server, accepted: main makes a second instance there); the handler
module imports what the module keeps. The shared-set fixed point of the
route placement looks generated members' readers up in a map: with 6,400
hoisted handlers it scanned every member per member.
Kind A tests (failing before): l1 client, e13/l10, e11, e23, l13 and t1 on
the server, a kept const imported by the handler module, RSC l1 roles; the
three tests whose expectations follow R154 updated.
Open (notes, stop condition): a dangling inline type export specifier.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An enum or a namespace only removed text used (a split option's value,
erased code) leaves the env module like any declaration; one that code
staying there reads stays (a chunk copies it, as main does). Before, they
stayed in the route module as statements and the chunk copied them too.
Lands before handler modules move to this placement: without it, an enum
or namespace a handler reads would keep its .server import on the client.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kind B rows of spec-phase1-handlers-erasure 8.2 that main gets right (e02, e06,
e07, e08/n1, e11/e11b, e12, e26, e29b, t2, t3), better-than-main pins (e03,
e10d/e10g, e10e/e10f, l6) and the RSC roles of s1 and l1. They pass on the old
engine.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
F1: the router calls route options as plain functions; the warning, guide,
changeset and comments now say only that splitting can change what this
refers to. Tests run the loader through the router (renderRoute), with
rows for parameter defaults, class extends and computed keys, field
initialisers, static blocks, typeof this in types and generator methods.
F2: the React route-HMR hoist skipped no method, so a method using super
became a function expression (syntax error); ownThisOf now gates it.
F3: a JSX member expression's object JSXIdentifier named this is a use.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A method-shorthand route option (component() {}, loader() {}, async and
generator methods) is split as the function expression with its body: the
chunk declares function (...) {...}, the route module's property becomes
key: lazy wrapper, and its reads count for main's shared names. A function
expression or method whose own this or super is used (the language's
scoping: arrow functions count, nested non-arrow functions, methods, class
field initialisers and static blocks do not) stays in the route module and
the build warns at the property. Guide, SPEC J2.9, architecture notes and
a patch changeset.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A route module that only re-exports a shared name imports the shared
module last, so a bare import moved there ran after the imports the
route module keeps; they now stay in the route module (main's order).
- Cleanup: home.has() check; symbols.ts and the core README no longer
describe the removed classic JSX factory read; KNOWN-BUGS S1 lists only
existing tests.
- Tests: re-export link row; namespace row comment; the generated-import
row asserts the shared module too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Removal rule (placement/roots.ts readFromRemoved, shared with erasure):
"the original used it" counts type-position references too; "nothing left
uses it" counts value references. An import or declaration only removed
code read, in a type too, leaves (`useState<Model.Row[]>`, `null as Db`,
`typeof db` in an erased handler).
- Already-unused code: a declaration nothing references stays in the route
module only (runs once). An import nothing in the source references (bare
and CSS ones included; never a planner's generated import such as
`lazyRouteComponent`) moves to the shared module, in source order, when the
route module imports it; otherwise it stays. Chunks, Hydrate and handler
modules load after the route module and get none.
- W1: the shared set's "assigned outside" ignores writes the env module
erases (a server-function handler on the client).
- Tests: #8504 and #6480 rows restored; T1-T3, W1 (client and server),
polyfill order through the shared module, bare import not repeated in a
chunk, never-read declaration runs once with two chunks, generated import
not in a chunk, handler module runs after its route file over HTTP on a
fresh server (Vite and Rsbuild). Classic-runtime rows that need React in a
chunk deleted (classic runtime: not supported).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- One removal predicate (placement/roots.ts readFromRemoved, the general
engine's provenance): a declaration or import specifier leaves an output
when the source read it, by value references, from text the output no
longer holds and nothing left uses it. Code already unused stays; split
chunks hold it too, as main's do.
- JSX is not a use of React: the implicitJsxFactory reference and what
exists only for it are removed (analysis, clusters, edges, freeze, plan,
hydrate). Classic-runtime apps behave as on main.
- N1: a name dropped from the shared set is placed like any declaration
(no unconditional keep): server-only state leaves the client route module.
- N2: the shared set's fixed point counts writers in any module, another
planner's output included; generated declarations are in the set while a
member reads them.
- Tests: Start route-file rows (client and server); never-read declaration
and import rows; main-value rows labelled; classic and already-unused
removal rows deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- One fixed point over main's shared names (and the generated declarations
they read that the route module does not root): a name leaves when code
outside the set assigns it or when it reads a declaration outside it; a
dropped name stays in the route module. The statement-write and
read-before-declaration conditions are gone.
- Split chunks copy everything else they reach, also what another chunk
copies; the module for several outputs remains for other planners' outputs.
- sharedNamesOnMain collects names as Babel's t.isReferenced does: an
assignment's target is no read.
- Tests: R1 (eager component, TDZ at load), R2, R3 rows failing on
61011c835f; rows of the deleted conditions show main's output; the HMR
loader count checks each edit's start.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every name main shares (a staying option's reads included) is declared in
the shared module; the route module imports it from there and re-exports
the exported ones, and a chunk imports from the route module only Route
and export const|let|var. One the route module or a chunk assigns, one a
top-level statement writes or reads before its last declaration, and one
reading a declaration main never shares stay in the route module.
The re-export glue skips an export row the route module's own statement
exports; a chunk importing a shared binding the route module reads gets
route HMR's kept-reader registration. On Vite 8 the 12-route app is now
byte-identical to main (no react-*.js chunk).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A split chunk imports from the route module only what main imports (Route,
export const|let|var, the names main shares: chunkImportsOnMain, a
transcription of computeSharedBindings) and copies every other declaration
it reads, with the statements that read or write it; a binding a statement
declares is imported. An exported shared name moves to the shared module,
which the route module re-exports it from.
- splitOnMain / exportedAsOnMain transcribe compileCodeSplitVirtualRoute's
cases and hasExport (bare identifiers only); overloads are one function.
- Overload signatures do not make a declaration non-removable.
- The route module keeps statements, exports, enums and namespaces and what
they reach; every other declaration goes, read in the source or not.
- Tests: the review's 22 inputs, the Start client leak; tests of one instance
in main's two-instance shapes and of kept never-read declarations deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The toy split planner no longer marks a route module, so placement.test.ts
tests the engine as non-route plans use it. Deleted: 26 test cases of rules
only route files had (R152 calls the router calls later, the route-module
type-specifier drops, offers naming the route).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A top-level statement that is not a declaration stays a root where erased
text reaches its binding's cluster, with everything it names, as on main:
whether it changes only that binding has no syntactic answer. Declarations
are still deleted by reachability. The RSC provider-module tests that
asserted the old deletion now expect the env module to keep the statement.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rows 15 to 23 and 35 of review-erasure-deletion-bounded.md: main keeps and
runs each statement; the compiler deletes it today (failing).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rolldown's and Rollup's watchers report the files of the bundle only, so
a route file created during a Vite watch build never joined the route
tree or the output (older than the rewrite: main and before perf B2
alike). A watch build now generates through the session's own watcher,
as Rspack/webpack watch builds do; its route tree makes the build compile
again. The watch decision reads what Vite builds with: the top level's
build.watch or any environment's (B2 generates at the top-level
resolution only, which does not see a per-environment watch). Each watch
generation gets a new watcher (inline plugin objects re-create the
generator per resolution), closed at closeWatcher. Builds whose config
file gives the plugins still generate once; non-watch builds unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
originalPositions compared the code with the file's text to tell whether
it is the file's own; a virtual module (or the planner tests' memory host)
has no file, and every position was dropped. Such a module is its code, as
before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 2 F5-2: `createLazyFileRoute(ID as any)` in a route file is
repaired to `createFileRoute`, and the id warning was positioned in the
source before the repair (3:42; the file as written has the id at 3:38).
A Vite build then printed it twice (its second config resolution read the
repaired file), Rsbuild once at the stale column. The analysis positions
its id warning in the text it writes: one warning, at the position the user
sees.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 2 F4-2: in a default production build (the Vue plugins make no
map), import protection located an SFC importer with the compiled script's
coordinates (Vite src/C.vue:7:24, Rsbuild 4:24 for 10:24) and framed the
compiled code, onViolation's importerLoc too. The compiler's own refusals
already found the SFC's line by the statement's text. One owner now,
originalPositions (reprinted.ts): through the input map, else the
statement's line in the original text, else no position; the compiler's
reports and import protection's edges both use it (mapLocate and
vueLocator removed). MDX on Vite was right already (its plugin hands a map).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 2 F4-1: on Rsbuild (and on Vite for require()), a require() of a
denied file, or import.meta.webpackContext written through a TypeScript
assertion, was reported as "an import its source does not have (another
plugin's transform added it)", without a position, with a fix about that
plugin. The pattern-import locator now reads a literal require() of the file
(and import.meta/require in an assertion): the report names
require("./db.server") at its position, with a code frame and a plain
import's fixes (applied in tests on Vite and Rsbuild), and the context with
its regExp fix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite's watcher reports the files of the bundle only: a route file created
while a watch build watches never joins the route tree or the output, not
even at a later rebuild (Vite 6, 7 and 8; config file and inline plugins;
router-only and Start). The Start build harness settles a Vite watch edit
that no watcher reports once a build begun after it bundles the file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 2 F2-3: `const idx = hits.push('x')`, with `hits` kept by
beforeLoad and `idx` read only by split code, joined `hits`'s cluster as a
writer and stayed with no warning (also a template, an enum member, a member
or binding assignment in the initialiser). The joined-statement pass reports
it as `eager-split:written` at the declaration, with the fix that works:
change the kept binding in a statement of its own and declare the binding
without changing it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3670c3d65b committed the notes' corpus runner (tests/research) into the
package: it hard-codes local paths and fails start-plugin-core's unit
project at load.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A reference counts toward a local name's value only when its value is what
the source expression evaluates to (a branch, a literal's element, a member
read of it, a spread), not through a call (its result is not what it is
handed, R149 answer F) or a function. Without it a reduce or superRefine
callback's parameter took everything the receiver's text named (corpus: 4
files changed; now none).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mutation model gives a local name (a parameter, a for…of or catch
variable, a function's own const) the value its sources give: its
initialiser and assignments, the elements a for…of loop runs over, the
thrown values, and for a parameter the arguments of the calls that may reach
its function (round 1 F2-1, F2-2). A member write a value's or a
declaration's evaluation runs in a function it calls is its write at load,
judged as an inline write (round 1 F2-3; the let twin was handled).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A write through a local name (a parameter, a for…of or catch variable)
of state read at load before it; a split value whose wrapper writes state
the route module keeps. Red at e5380aeb16.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 1, F5-1 to F5-4.
- routeCallOf (the one recogniser of a route's call) knows the router's
createRoute: a listed file whose Route it makes is foreign ('code-based')
and the planner reports it (route-unrecognized), with the
createFileRoute call to write.
- A Route declared by a destructuring pattern is foreign through the
binding's declarator, so the constructor it holds makes it 'wrapped' and
reported, as the other unrecognised shapes (maintainer, 11-13: not
supported, never silent).
- The route id is read through parentheses and TypeScript assertions
(stringLiteralOf) by the generator's upkeep, its stale-id report and the
no-options check.
- The generator plugin prints each warning once per Vite build: the
generations of the build's config resolutions share one printed set,
ended by the build's start (inline plugins generate once per
resolution). The Generator and the scan take the host's logger.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Listed route files whose Route the compiler does not read and nothing
reports (a code-based createRoute, a Route bound by a destructuring
pattern), a parenthesised route id reported as not a string literal, and a
generator warning printed once per Vite config resolution when Start's
plugins are passed inline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Removes @tanstack/compiler-test-utils/time-sequencer, its control test,
the stored tests/integration/file-times.json weights (start-plugin-core,
router-plugin), their Vitest config wiring and the AGENTS.md refresh note.
The slow-tier shards split with Vitest's own --shard (BaseSequencer), the
runner's built-in mechanism, as main's sharded targets do.
start-plugin-core keeps 6 shard targets; router-plugin keeps 4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without the client-build file (an unusable temporary directory) the server
does not follow the client's builds. The warning said only client-only saves
were affected and offered a save of a file the server bundles as the fix;
when the client's build of such a save starts after the server's (a slower
watcher, a plugin's slow watchChange), the server keeps the client's older
files too. The warning (and the one for a failed write of that file) now
says so and offers a writable temporary directory (or TMPDIR) and a restart.
The test asserts the wording and what the degraded mode guarantees, then
applies the fix (a client plugin with a 500 ms watchChange makes the late
client build deterministic) and checks the document follows the client.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A file a build writes (Start's client-build sentinel, in `generateBundle`)
reaches the other environment's watcher a moment after that build ended;
the window counted only reports and build starts, so a client build longer
than it settled the edits at its own end, before the server's watcher
reported the sentinel ("a fix saved while the client builds…" flaked
1 in 82 under load: the document named the client's previous files).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A client build that emits what the one before emitted moves nothing the
server embeds (Rolldown's watcher reports one save twice under load: the
client builds it again after the server's rebuild began, and the harness
waited 20 s for a server build begun after it; Start's server had embedded
that last client build already).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fails: the build harness's `rebuilds` wait asks for a server build begun
after every client build began, also a client build that emitted the same
files (CI flake of 2026-11-13: Rolldown reported one save twice under load).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
start-plugin-core runs its slow tier in 6 shards (from 5). Both
start-plugin-core and router-plugin split their shards with
@tanstack/compiler-test-utils/time-sequencer: longest file first, each to
the shard with the least time so far, by the files' CI times
(tests/integration/file-times.json, from green PR run 43429421183),
instead of Vitest's split by path hash (CI shards of one tier finished
145 to 306 s apart). A file without a time counts as the median.
Predicted longest shard: start-plugin-core 306 s -> 195 s, router-plugin
282 s -> 227 s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`export const Route = createFileRoute('/')({ component: (n = 5, …) })`
writes `n` at load and joins its cluster: taken as an unused declaration,
it reported `flags`, which the loader reads, with "run that statement in
the code that needs it".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Keep that state in an object or in its own module": applied with the
`let` moved to its own module, the split chunk still assigns it, an
imported binding (read-only; the build fails on Vite and Rspack). The
working version: a module of its own that also exports the functions
writing it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A `written` report whose statement changes the binding the route module
keeps offered "run that statement in the code that needs it": moved, the
statement changes that binding later than the route module's code reads
it (P04b: beforeLoad saw table.size 0 instead of 1 on Vite and Rspack).
When code the route module keeps uses that binding after the statement,
or in a function (seenBy: not a read of its contents at load before the
statement), the warning names that code's line and says moving or
deleting the statement would change what it sees.
The joined-statement pass also takes a declaration joined as a writer
(`const n = table.add(d).size`, unused): `d` stayed with no warning.
Unused code changing such a binding (its `link` twin) is reported the
same way instead of asking to delete it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
P04b (`table.add(d)`, `beforeLoad: () => table.size`): the offered
fix "run that statement in the code that needs it" makes beforeLoad see
an empty table. `const n = table.add(d).size` was silent; its `link`
twin asked to delete `n`, which changes the table the same way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
moveOf treated every cluster holding a claimed region, and every cluster
holding generated code, as staying in the route module whatever moves. A
claim or generated unit of another planner (Start's server function handler
and client stubs, a hydration boundary) is made again from its source
wherever that goes: the corpus's exported server functions reading a
middleware or a schema got "It can't move …: that module would also need
the code on line 148" (generated code past the file's end) where the move
works. The fixed set is now the route options' declaration (the values the
router calls later, PlacementInput.calledLater) and the generated code made
from it; other generated-only clusters are neither named nor blocking.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The module comment now says the net is meant to be removed a couple of
months after the release, and lists the README paragraph in its removal
recipe.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite resolves the config at the top and once per environment; with
builder.sharedPlugins it runs `config` on the plugins each resolution was
given, then swaps in the top-level objects and calls their
`configResolved` again. The generator plugin marks, in `config`, that a
resolution was given it, and a build's `configResolved` without that mark
keeps the top-level generation. Plugins passed inline are given to every
resolution and generate in each, as before; dev is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A build whose config file gives the plugins generates the tree three times
today (top-level resolution and one per environment): Vite 6, 7, 8 with
buildApp, by hand and in watch mode; a Start build too. Dev and builds
after a route file was added (config file or the same plugins inline) are
covered as they pass today. Start's build harness gains viteConfigFile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pass reporting bindings joined by a statement writing them at load
skipped exported clusters, so export const a with if (on) { a.v = 1;
k.v = 2 } stayed in the route module with no warning while its unexported
twin was reported (guarantee 7). Exported clusters now go through it too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its page test ("a dependent that stops compiling") moves to
start-dev-freshness-page.test.ts; the rest runs without a browser and joins
smokeTests (phase 6 decision 4).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
code-splitter-module-state (`var` declared again: the components are
lazy), dev-source-maps (the split component's module is not loaded with the
route module), known-bugs-dev-server (loading the component requests a
module of its own).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
62 sequential Start builds (31 s alone): server fn ids and the route tree
stay; router.codeSplittingOptions and the generated-statement / erased-code
server fn rows move to files of their own, unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ruled (phase 6 decision 5): whole tiers have no budget; the 15 s per-file
limit, the edit-to-result limit and CI's shard times stay. The reporter
still prints each tier's time.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The phase 6 patch (G3 after R146, J2.4 after R149-R151, J2.7 root routes,
J5.5, J6.7 pattern imports, the unsupported inputs, §8 lazy loading is
behaviour), plus the 11-13 rulings it cites: guarantee 6's wording, B4
widened, B11 (row 8), and R132's check in J4.12.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Root routes (R60) and pattern imports (R142, once) under a new "Accepted
limits" part with their ordinary tests; the Rolldown `var` row out of the
remaining pins (no pin exists); the Vite dev orphaned importer row out of the
safe-direction rejections, saying why it has no test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The file keeps its ordinary tests of the outcome (one warning per denied file
naming it and the fix; dev reports) and the 5 pins of an importer outside
srcDirectory (phase 6 decision 3).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"a root route's components load with the route module": errorComponent and
notFoundComponent eager, on Vite and Rspack (phase 6 decision 2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A binding the declaration of the statement's cluster reads (const store =
reactive(settings), with Object.assign(store, …) joined to it) is used by
the route module itself: it was reported as kept only by the statement
(router-plugin guide: a call result that is the object it was handed).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The joined-statement report read the statement's own references: a holder
(const h = { d }; table.add(h)) kept d with no warning, and an exported
binding was skipped. It now takes what the statement uses from
Events.unitChanges (the one owner of what a statement uses: names, runs and
the objects those hold), reports each binding it keeps as the follower
statement's report does, and keeps the env module's reach behind that
candidate check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A method the mutation model knows (Set.add, Array.push, Map.set) writes
only its receiver, so table.add(d) joins table's cluster as its writer at
load instead of following both as a statement: no stay pin was made, and d,
which only the component reads, stayed in the route module with no warning
(guarantee 7; phase 6 step 3, P04b written with add). The pass reporting a
binding a joined statement keeps (writtenTogether) now also reports a
binding of another cluster such a statement uses, when the env module keeps
the statement's cluster for its own needs and nothing else in the env
module uses the binding: the same eager-split:written report the follower
statement gets. The env module's reach is walked only for such candidates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The moves an eager-split:written report offered (code that runs later
changes it: the binding and the statements using it at load; a statement
using it and a binding of another output: both and that statement) named
neither what the moved bindings read when the module loads nor the other
statements writing them then. Applied to an export (the route module
imports the new module to re-export it), the new module imported a
binding back from the route module (Vite undefined, Rspack TDZ); a write
at load left behind assigned an import (build error). The report takes
its move from Events.movedWith (moveOf), as state and reads do, without
the statement it names; when the move needs the route options or
generated code it offers none and says why.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fix an eager-export:reads report offered named only the export and the
binding it reads: what those read when the module loads (a binding the read
one reads, a holder, a function the export calls and what that reads) stayed
behind, and the new module imported it back from the route module, a cycle
(Vite undefined, Rspack TDZ), and a write at load left behind ran after the
export read the value. The report now takes its move from Events.movedWith,
as the state report does (moveOf), and when the move needs the route
options' declaration or generated code it offers none and says why.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The move an eager-split:state / eager-export:state report offers named only
the declaration, the binding it reads and their writers at load: a holder
it reads the binding through (class A: h6) stayed behind, and the new module
imported it back from the route module, a cycle (Vite undefined, Rspack
TDZ). Events.movedWith gives the move: what the moved code touches when the
module loads (the event table's one walk), the code writing a moved binding
at load or assigning it at any time (an import is read-only), and what reads
a moved binding before a moved write at load (the moved module runs first).
The report names those bindings and statements; when the move needs a
declaration holding route options or generated code, no move is offered and
the message says why it stays (a read inside the code, when it works, is
still offered).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An export cancelled because it reads a binding (`reads`) stays only for
that binding: when a reported cause keeps it, the export is the cause's
cascade, not reported, and it no longer hides the cause (kept.ts). A cause
kept because the exports' modules would share it (`shared`) stays their
cascade. A `state` report whose write runs when the module loads names
that write's line and offers the move that keeps the order: the
declaration, the binding and the statements writing them at load.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The router plugin's unlisted-file row (P11 cannot reach it: the Vite host's
routeEntry gate stops an unlisted file first) and the B1 row (B01 changes the
warning's stated cause, not placement) are removed: not red under their
mutations.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A: the event table's walk stopped at a binding written later at an unknown
time (V), so a cluster that recheck ruling C still lets into its writer's
chunk had no spans for O: a read through a holder moved past a later write.
The walk now records every span.
B and C: a member of an extracted export's module was never asked O. After
each round's slots, a member reading what a write at load in another output
changes stays (B: the object's own module, which it imports, runs the later
write first); a follower stays with the binding it uses there, worded as the
statement using two outputs' bindings (C: the statement read the chunk's
`let` in the export's module). slotOf answers a member's module; a
follower kept by O is reported with the output the write runs in, not as
code that runs later.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each planner's `serverCode` recorder lists what its recognition calls
server-only in a client compile (Start: every builder link the recognizer
table keeps on the server, every createServerOnlyFn argument; the router:
every recognised route option in deleteNodes), read on the final plan;
the planners' `rewrites.serverOnly` calls and RewriteSet.serverOnly go.
A compile already holding an error is not checked. The check and its
recorders are self-contained; the module comment says how to remove them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start records the server-only text of a client compile with what it is
(a handler, a validator, a middleware's or isomorphic function's server
implementation, a createServerOnlyFn body). After freeze the core reads
every output, the derived ones included: a slice of the source over a
recorded range, or text mapped into one, is a hit. A hit throws under
the self-checks and is an error for the module in users' runs, naming
the file, the range and the output. A net under the planners, removable
once nothing is left for it to catch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R101: an exported let the boundary's children assign is refused with two
offered fixes. Applied in the shared build: split={false} keeps the
children's code eager, and the writer in a component declared outside the
boundary builds; neither reports a problem for its page, both hydrate, and a
click's assignment is what the page's importers read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Like Start's planner: a boundary whose children assign a binding the module
keeps (hydrate-writer) stays in place, its reason in the facts (`kept`).
The toy ignored fallbacks, so its chunk assigned an imported binding.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fails: the toy Hydrate planner ignores the core's hydrate-writer fallback and
the verifier rejects its chunk ("assigns the imported binding count"). Real
Start's planner keeps the boundary and reports hydrate-module-write (Vite and
Rsbuild, builds and dev).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test's fixed variant warns to move `flags` and the statements using it
when the module loads to their own module, and stopped there. Applied (R101):
the route re-exports `flags` from that module, nothing is reported and the
component's write moves with its chunk.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CompileOutput.edges is gone; the test host reads EmitPlan.edges of the
output instead, like router-utils' MemoryHost.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its cause is computed only in rounds the single-writer fallback discards, or
dropped by the envOwn filter (dead-code scan section 5). The cause, its
wording, the KeptReason member and its doc mentions go, with the PR-only
changeset that reworded it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TargetFacts.effectful with ModuleEffects.own (the planners read codeEffects),
CompileOutput.edges (no host reads it; tests read the plan's edges),
PrefetchContext.targetFacts (no planner's prefetch asks; the policy context
keeps its own), DevViolationError.at (Rsbuild reads each report's at),
ImportEntry.declRange, and the uncalled ownModule test helper, whose cases
report nothing since R151 (dead-code scan T1-T6). CompileOutput.output
stays: import protection's violationsOf keys violations by it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PlannerEdit.n and its counter (PlannerEdit is Edit again),
ServerOnlyText.subject (and the four subject strings start-env passed),
ReadIndex.clusterRuns, SymbolTable.isConst with SymbolInfo.constant,
RegionTable.unitOf, emitSettled's identity/host,
ImportProtectionEnv.conflicts' holds, Renderer.output, callsValue,
Placement.clusters, annotationFrees' plan and TextFrag.declares (dead-code
scan A1-A12). A13 (CompiledOutputLike.output) stays: violationsOf reads it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Four sentences of model, one table of the warnings with their cause and a
fix applied in the test, a "What the compiler doesn't see" heading with one
example per accepted break, and the copy, pure-call and bundler details in a
short reference note. code-splitter-guide.test.ts asserts every example and
warning of the section through the public plugin, each fix, and each break by
what the page shows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A unit assigning a binding is in the binding's cluster, so extracting the
cluster takes every writer along: the reassigned-export exclusion only
decided whether the let itself or another export of its cluster was the
candidate. Kept for a binding a split option assigns (the single-writer
rule). Placement rows that used a reassigned let as their kept export now
use one reading what the route module keeps; the reassigned-wording row is
gone (no shape reaches it now); module names follow the cluster's first
export.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under R152 the NOTE's row (component: wrap(render)) is decided by the held
call; a named function the value reaches otherwise (wrap(flag ? render :
Fallback)) was still refused 'kept' where its inline spelling splits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The router planner states the values the router calls later (component and
loader options, split or not: PlanContext.calledLater). Placement's one
predicate (ClusterGraph.holds) holds such a value's call, the initialiser
of a const every use of which is one, and a call handed to such a call;
it is recorded from the calls callsWhenEvaluated already walks (each
call's outer call, the names it is handed directly or inside an object or
array) and the units' const initialisers, with no extra program walk.
Nothing in a function a holding call is handed runs at load, and a name it
is handed is read as a value. The extraction check (readsKept, through
touches with everyCallRuns) and the verifier keep reading every call as
running what it is handed. A declaration kept for a read only inside what
it hands to another call is reported as one that may use the binding.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Core rows: option values through wrappers of wrappers, consts and a chain,
an unsplit option value, names inside an object or array handed to such a
call, the factory row (accepted break), the extraction check's control,
and 'may use' wording for every other call (a wrapped sub-component used
as a JSX tag among them). The three rows stating the opposite rule now
expect the split. Real-planner rows on Vite and Rspack builds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Server function and middleware builders expose `.options` as read-only
(fields and lists), so writes such as `base.options.validator = …` are
type errors, as the compiler refuses them. Reads by name keep their
types; runtime is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
T names a binding of the source before a generated one; when only a
generated binding keeps the export (a server fn Start moves out of a
function the export calls, server build only), no eager-export:reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Architect's ruling on F-PEG-1's report: silent like the extraction-identity
rule; a report never names a generated binding.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A server fn or middleware builder's options read by name
(`base.options.method`, `const { method } = base.options`) are no
escape. The object handed on, written to (a validator is server code) or
its `middleware` list (open builders) stays refused, now with a message
saying to read options by name.
- An open middleware's flow message offers keeping it in its own `const`
and calling `.server()` there (a middleware in an object finished later:
a second `.server()` on the finished one leaked).
- A late-pass module (MDX, …) re-exporting an open builder names it and the
module to import it from, and to drop the re-export.
- A factory returned from a getter or method is named as a factory.
- Positions without a usable map (reprinted.ts, shared by Vue and other
late compiles): a statement a later tool reprints over several lines is
matched against one original line, unique or nothing; MDX re-exports on
Rsbuild and `export *` on Vite get their position, a Vue getter on
Rsbuild its line and column (before, a no-map Rsbuild build reported it
as generated code at the import).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A builder's options read by name build without leaking; a middleware kept
in an object is told to stay in a const and get .server() there; an MDX
re-export is told to import the builder from its own module, at its
position on Vite and Rsbuild; a factory returned from a getter is named,
at its position in the SFC on every host. Each fix applied builds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`judge` asks the same T predicate the member rule leaves on, so a
follower is not put back into the module it was taken out of.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fuzz seed 1514297's shape after the previous fix: the follower joined the
function's module each round and left it for reading the moved binding.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The T rule (an extracted export's module evaluates before the route
module's body) read the bindings generated text names only in a
candidate's own eager text. `ReadIndex.runs` now reports them by the
same rules as references: in the bodies the walk enters and in a
function passed to a call. A server fn Start moves out of a function the
export calls keeps the export in the route module on the server (no
import cycle, no TDZ); its report words the generated binding as an
unnamed one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
F-PEG-1 at the core: calling the function, handing it or a function
holding the moved call to a call, and an IIFE (whose report named the
generated binding). Start's cases gain the callback spelling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
F-PEG-1: the export's module reads the nested server fn the route module
holds while the route module re-exports it (self-check throws; users'
Vite SSR renders undefined, Rsbuild's server bundle fails to load).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A request of an older text whose plan hit waited on its validation (a slow
read or resolution) looked again and noted its revision anew: it took the
latest revision back from a newer text compiled meanwhile, and its compile
published its own plan and dependency rows over the newer one. An edit of
what the newer text imports then re-planned nothing (F-PEG-2, freshness
schedules seeds 169216 and 167651).
`PlanCache.begin(key, revision)` replaces `noteRevision` and the
per-compile `begin`: a request notes its revision once and keeps its key
live until it ends, so a later look of the same request compiles without
publishing when a newer text arrived meanwhile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Written-out schedule of the freshness-schedules rows seed 169216 (stretch 1,
jitter 8) and seed 167651 (stretch 1, jitter 12): a plan hit of the old text
waits on a resolution while the new text compiles and publishes; the old
request then publishes its own plan over the newer one, and an edit of what
the new text imports re-plans nothing (F-PEG-2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R67's "a kept `let` still pins" fired only when the reader had an
effect of its own: a `let` nothing assigns is read like a `const`, and an
assigned one is caught by the write rules with the true reason
(`eager-split:state`). Its other half (an effect reading another effect
evaluates in that one's slot) decides nothing since the slots and R151's
shared modules do it. Deletes readConflict, the effectful reads of the
facts walk, the `reads` reason of a split declaration with its message
and `const`/annotation hints, and the tests that only pinned the rule.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every applied file event moves the file set and asks the failed
resolutions, and a change runs the shadow pass too: relabelling a change
of a path the caches hold nothing of as an add decides nothing any more.
The two 'removed and back as a change' rows keep guarding against an
early return for such a change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
react-start-rsc: main's dependency bumps (@vitejs/plugin-rsc ^0.5.39, react-server-dom-rspack ^0.1.1, peer floors
>=0.5.38 / >=0.1.1) with the PR's @rspack/core peer floor (>=2.2.9) and its compiler-test-utils dev dependency.
pnpm-lock.yaml regenerated with pnpm 12.18.0. virtual-modules.ts: the PR already had main's pathsOf().manifest fix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With lazy compilation on (Rsbuild's dev default), a later import() of a
module that accepts its own updates answers its first namespace; solid-refresh
makes every Solid split chunk such a module. Design 7b, built as a temporary,
self-contained workaround the user authorized:
- solid-router `src/hmr-chunk-importer.ts` (new): records each chunk
evaluation's handed-over exports; `__tsrChunkImporter` answers the newest.
Hooked in `hmr.ts` (record call, adapter `retire`, re-export).
- router-plugin `planners/split.ts` `chunkImporterCall`: Solid, dev client,
webpack-style hosts: each group's importer is wrapped.
- router-core: one keep rule for the hot slot: an evaluation a chunk handed
over is decided by `keepPatched`, any other by `keep`; `settleWith` loses its
`keep` parameter (general, stays when the workaround goes).
Unpins the grouped-loader KNOWN-BUGS row; upstream-table row says what to
delete once rspack#16594 is fixed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red at head on Rsbuild with autoCodeSplitting (5 rows, every edit stale):
a loader grouped with the component (inline arrow, a function of the file,
an object), a conditional component then staleTime edits, a grouped loader
then staleTime edits. The grouped-loader pin becomes an ordinary row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the route options object, or a const of the chain naming it, is
referenced anywhere besides the route call and the chain, the options are
opaque (`options-opaque`): not split, the `deleteNodes` options not
removed, reported. A reference count, no alias analysis (user ruling,
2026-11-12). Before, a write through another name (`const z = a;
z.server = …`) was not seen: the literal's `server` was removed and the
write's server code shipped to the client silently.
Unpins the KNOWN-BUGS row; SPEC J2.8 and the import-protection guide name
the case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The KNOWN-BUGS shape (`const z = a; z.server = …`), an exported options
object and a chain const named in a function: not split, reported, in dev
(Vite) and in Start builds (Vite, Rsbuild). Controls: a chain of consts
used nowhere else splits and removes `server` in Start builds; a type-only
name changes nothing; the warning's fix (the options in the call) splits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Members of an extracted module that the env module now evaluates, or that
read at load what it keeps, leave the module (a follower member is judged
again): seeds 10112 and 12263. A candidate cancelled `live` records its own
violation (Roots.liveOwn), reported unless a statement report names it or
the env module needs it of its own. stayPin looks in followed clusters only
for statements, outside the binding's own cluster, naming it at load.
Joined unused code using reported unused code joins its report.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A member of an export's module reading at load an export the route module
comes to keep leaves it (10112), and the export reported at its own cause
with its fix applied; a member a declaration kept in the route module reads
at load stays with it (12263). The statement named for an export: not a
function the statement calls (x04), not the binding's own statements (x14).
An unused chain is one report (m12).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
React dev client +1.0 % per module before (iterMsMin CI [0.17, 1.69]);
after: Solid -0.04 % [-1.05, 0.96], React +0.14 % [-0.95, 1.22].
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What moves with what, shared modules, extracted exports, the accepted breaks
(code that moves runs later), what stays and its warnings, quoted from
router-plugin's code-splitter-guide.test.ts. compiler-test-utils/AGENTS.md:
a test whose subject is text the docs quote verbatim checks its wording.
Changeset for the recheck fixes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A, B (R150): an export's effect cluster is a candidate and its effect unit no
env root; a declaration only an extracted module and split chunks need, and
a follower whose places are that module and lazy chunks, are its members.
A cancelled extraction re-judges its followers and members. D (R148):
followers judged in dependency order; placesOf answers follows, members and
joined first. C: lazyConflict drops V when every later write of what a
cluster touches is another cluster's and runs in its slot (writesIn). E:
the self-check expects a unit homed in a copying output there only.
Messages (R100): joined unused code is reported only when deleting it
separates its bindings (reach without joined code), as one report naming all
of it (moreUnused); roots.joining deleted. stayPin names the statement whose
text names the binding. A kept cluster's effect writing at load a binding env
code uses and one only split code uses reports the latter. A V pin from the
statement's own callback names the binding's load-time reader. V's fix moves
what uses the binding at load. A joined follower is not imported by the
outputs it is rooted in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rows that fail before the fix: an export with effects the file also writes
is extracted with its statement (B); what only an extracted export and split
code use goes to the export's module (A); an unused chain follows what it
reads transitively (D); a load-time reader whose every later writer is in its
chunk moves there (C), with a control where the writer stays; a top-level
write to state only an RSC provider's handler reads lives in the provider
module only (E). Messages: unused code is reported only when deleting it
separates the bindings, several such declarations in one report; an export's
warning names the statement that uses the kept binding (x02); a statement
writing two bindings at load reports the one it keeps (m03, m16, m17); a
statement's own callback names the binding and its load-time reader (m04);
V's fix moves only load-time code. Break D named in a row; chunks import
from a shared module only what they use.
Restated for C: four router-plugin order rows (fx and the statements calling
it move to the component chunk together and run there in order).
The guide's top-level code examples and warnings, in a real build
(code-splitter-guide.test.ts).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
solid-refresh (and React Refresh's `@refresh reset`) read the pragma per
module; the route module kept it and its chunks lost it, so a split Solid
component never kept its state under `@refresh granular`. Development
client only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Design 7. One keep rule read from the values (`keepPatched`): Solid keeps a
held component when both are solid-refresh proxies of the same name and
file (`location`); Vue keeps its `__hmrId` rule. Solid's `keep` goes (a
chunk re-imported after a route update is kept only when it is the same
object). Deleted: `RouteHmrMeta.unsplit`, `bindingIdentity`,
`RouterRound.unsplit`, the planner's record branch, the emitted `unsplit`
meta and `sameName`. On webpack-style hosts every Solid split chunk hands
its exports to the route's lazy wrappers when it evaluates again on its own
(`LazyRouteComponentHot.take`, decided by `keepPatched`); only a chunk
holding a non-component option refreshes the route. Dev only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The granular row edits the loader and a pending component grouped with the
route component in one save: the component chunk evaluates again with the
route component unchanged (red: the chunk lacks the file's pragma). A
loader grouped with a component never shows its edit on Rsbuild split
(solid-refresh's self-accept keeps Rspack's lazy-compilation proxy on the
chunk's first module): found by the matrix, pinned. The Vite cycle row's
reload carries the cycle's logged error (Vite's rule, at head too).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red at head: a barrel that switches module (unsplit, both bundlers), a
conditional behind a const (Rsbuild split), and a granular route whose
loader shares the component's chunk (Rsbuild split). Pinned: a rename or a
removed component stops later hot updates on Rsbuild split (solid-refresh,
upstream); Vite split mounts a component twice per save.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two split options reading an effect share one lazy module: the kept
declaration reported once per environment (build and dev) is now one a
staying statement changes; the impure builder chain loads with the
chunks' shared module (its effect is a target fact).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An imported, called or member loader that tests split for other purposes
now calls it from an arrow (the warning's fix); Start's in-place server fn
as the loader warns instead of failing the build (the object-form handler
still fails at the server fn).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A binding a split option writes lives with that writer; unused code
joined with it stayed in the shared module, which then imported the
writer's chunk while that chunk imported the shared module: a cycle
(`w14` read before initialisation, seed 11838). Homes move a joined
follower to the chunk its binding was given (settle exposes what each
joined follower follows).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 0 rooted it in one chunk; when a binding it uses then goes to a
shared module (another follower joined it), followConflict kept it in
the route module and the group with it. Each round re-judges followers
on their places before the slots, as cluster membership; the round cap
counts that growth. Unused code is reported only when it put its
bindings together (joined in round 0).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- slotFor: an effectful cluster several split outputs need has no slot;
homes give it their shared module (the `pure` gate is gone)
- followSlot: a follower whose bindings go to several split outputs is
rooted in each (one cluster with them); demoted with its pin when one of
its bindings comes to stay
- readConflict: a const in the shared module the reader's chunk imports
is ordered like a kept one
- a candidate is never a timed cluster (its place is its module)
- eager-split:needers is never reported (it stays only beside an
extracted module or a provider, no split code alone); its wording and
"several split options use what it changes" are deleted
- unused code: one warning at it naming what it keeps in the route module
(eager-split:unused) or puts in one shared module (shared-split:unused)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two split options' code goes to their shared module: statements of two
chunks (finding 7, b33, e04), `env-declared` values of one effect, R138's
two-chunk const, seeds 1141/1055. Rows whose subject was
eager-split:needers are deleted or restated; the effect classification
they observed through it (a known pure call with an impure argument,
`#__NO_SIDE_EFFECTS__` before a `let` or a later declarator) moves to
target facts. A row for an effectful binding exported under another name
(the pages' crash), and one for a statement beside an extracted module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The brief's statement case, `const x = make()` read by two split options,
unused `debugDump` with its warning and fix, careflow's shape (an
extracted export and a split binding share no module: it stays, and the
warning names what it keeps), and executing rows on Vite and Rspack that
the effect runs once whichever chunk loads first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The chunk imports the extracted module, which evaluates first, as the env
module does (R29 (c)). readConflict takes the round's slots again; a
candidate counts as kept.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host ledger reports a wording once per file; another row's reassigned
`count` made this row's warning a duplicate in the whole run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An effectful augmentation of an exported component runs once, when the
chunk imports the component (effects have no order of their own, R146);
the enum rows whose subject was eager-export:effects are deleted; the
kept-export report row uses a reassigned export.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route joins the cluster of an export a route option value writes at
load; its createFileRoute call used to exclude that cluster as code that
runs, so the route never left. With effects no longer excluding
candidates, the kept export itself excludes it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- a binding being extracted gives its module as a follower's only place;
an export with a follower is imported, never copied; dev keeps the
followers with their extracted bindings in the route module, and a
cancelled extraction keeps them there too
- effects no longer exclude a candidate: `extractionEffects`,
`unitEffects`, `runsCode`, the effectful-slot rule into an extracted
module and `eager-export:effects` are deleted
- a candidate some output renders otherwise (a placeholder or claim
scoped away from it) is not extracted: one identity every output imports
- `readConflict` sees a candidate's module as its slot
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Effects no longer keep an export in the route module: decorated classes,
destructurings with a call, augmentations with effects, `new URL(text)`,
effectful initialisers and what only an extracted export needs move into
its module. Rows whose subject was eager-export:effects are deleted; the
reporting rows use the reassigned reason. A follower of an export with
effects of its own lands in its module too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ruling 1 changed (user + architect): an extracted export's module is a
destination, so the statement follows the export there instead of being
reported.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`label = db.get(label)` stayed only because it changed another module's
object; R149 removes that rule (answer A: startup work used only by a server
fn moves into the handlers module, as the load(label) row pins).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the verb is the statement's per binding (changes or uses), what it
changes counted in its own text and the function bodies it runs, not in a
writer of a name it reads;
- "change X in a statement of its own" only for a statement of several
statements changing X; one call kept by a route-module binding: "run that
statement in the code that needs it"; by another option's binding: move
both and the statement to their own module;
- unused code (R148) is named ("`debugDump` (line N), which nothing uses")
with "delete it", and every binding it keeps eager is reported (E);
- a follower kept by V (code that runs later changes what it uses: f08, c15)
is reported, naming that later write;
- copied primitive consts neither keep a follower nor are reported;
- a write of an import joins no cluster: the import is no declaration of
the module (b07: no warning, no route-module export, the chunk imports it
itself).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
E: an unused function reading bindings of two chunks stays (R148) and both
bindings it keeps are reported, each naming it, with "delete it" (applied).
A statement writing an import is no writer of a declaration: the exported
reader of the import is now reported for the state the module writes at load
(eager-export:state). The plural rows use a statement that only reads the
kept binding (registry.add(k) stores k in registry, one cluster). The
annotation row reads the route module again: under R149 the call uses no
binding that moves.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R149 replaces the amendment's "outside the module" clause. Deleted: the
outside-change detection (OutsideChange, outsideChangeIn and the walker it
needed, which callsWhenEvaluated returns to; the roots' outside pins; the
ReadIndex.runs enter hook; Pin/KeptDeclaration.outside and its wording) and
the extracted-module exception of a follower's place (placers).
A follower (a statement, a declaration's dead code) follows every module
binding it uses (reads or changes, also in what it runs, and what those
hold; imports apart) into the one chunk they all go to, else stays; an
exported binding is one that stays (review finding 1). Statements and dead
declarations are judged in one place, settle's round 0 (review fix 2); the
roots no longer seed statements as env roots. What a statement changes now
only words the warnings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restated to R149: an unused function reading an exported binding stays (E
open); a statement using a binding two chunks need stays; the plural rows'
trigger is a binding the route module keeps.
Messages (review finding 5, R100): the verb is the statement's per binding
(`table.setup(cfg)` changes table and uses cfg); one call is not offered a
split (a route-kept binding: run the statement where it is needed; another
option's: move both and the statement to their own module); unused code is
named, with "delete it"; code that runs later changing a binding (V: f08,
c15) is reported; an import a statement changes is no declaration (b07: no
warning, no route-module export, the chunk imports it itself). Each fix
applied.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R149 replaces the amendment's "outside the module" clause: Sentry.init(cfg),
window/console/analytics, import.meta.hot, import() move with the binding
only the component uses; Sentry.init({ dsn }) and i18n.use(backend) stay; a
statement using a binding that stays (one the route module keeps, even
only read; an exported one: review finding 1) stays. Finding 7 pinned:
reading bindings of two chunks stays with or without a later write. 10
failing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Vite hosts (router plugin, Start) set moduleSideEffects: false when the
output is an extracted export (identity.derived.kind), as the webpack-family
hosts' rule on the query already did; EmitPlan.sideEffects, freeze's
computation, OutputSpec/OutputDecl.sideEffectFree and
CompileOutput.sideEffectFree go (Vite's computed flag never differed on
1,315 corpus modules: RESEARCH-side-effect-free-outputs.md). The pin that an
extracted module holds nothing with effects of its own replaces it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hosts flag every extracted export's module side-effect free; this pins
what makes that safe: for ten extraction shapes (functions, classes, static
props, literals, a function reading a call result, an annotated call; a call,
a language operation, `new URL`, a member read not extracted), each extracted
module's own statements have no effect as the deletion purity judges them
(ModuleAnalysis.effects, R139 pure writes of its own binding aside), client
and server (part C, "Side-effect-free outputs": one owner for the flag).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The wrapped reason follows the file's own module-level bindings the Route
initialiser reads (a same-file route factory, a stored constructor call),
not imports (an app helper stays silent, R130). Found by the oracle: the
J2.10 rows lost their warning.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The file's tests run concurrently (sequence.concurrent): Vitest's global
onTestFinished names the test that started last, so after an await a row
could find no current test (CI: 'Hook onTestFinished() can only be called
inside a test'). The test-scope helper keeps each row's own test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generator session publishes the last run's error while no run has
generated the routes (Generator.hasGenerated); the plugin context keeps it
(publishRoutes), the registry view answers it (RouteRegistry.failure, one
digest for every file), and the router planner fails a module that passes
its gate with the generator's error, as the route tree does, instead of
serving it as written (server code included) on a Vite dev server whose
first generation failed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- routeCallOf's foreign result carries why (no options call, type-only
import, a root constructor called the wrong way, a wrapped or stored
call, or nothing of the router's: R130), decided by binding; the
generator's re-walk by name (isConstructorName, isTypeOnlyImport) is gone
- the generator repairs a constructor of the other kind when the id is not
a string literal (the id is still reported): a route compiler waits for
that repair, and a Start build shipped the route's server code
- route-unrecognized: one text per cause, with the call of the file's kind
(createRootRouteWithContext<Ctx>()({ … }) for the context case); nothing
for an app-helper route; options in a reassigned let say so
- a one-property loader object whose chain is written later is not split
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- generator: a wrong-kind constructor with a non-literal id is repaired
(both directions); an aliased router constructor without an options call
is reported; an app helper named createFileRoute is not (R130)
- router plugin: each route-unrecognized cause is reported and its offered
fix is read; app-helper routes report nothing; a written one-property
loader object keeps the option written later
- Start: wrong-kind constructor with a non-literal id, both bundlers;
symlinked route file, both bundlers (passes at head); Vite dev started
while generation fails serves no route as written
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
seed is now imported by the module whose state the handlers read, which
goes to the lazy handler module with them: the entry loads seed.ts at load
for the recording global.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A denied file with real demand (an exempt plain importer, an allowed
import) and an importer the compiler does not read (an exempt pattern
import, a plugin-added import) is served as the build compiled it first.
The shape is now reported under behavior whatever was served, when
something of the file was kept (its surviving mock, or its rendered
code), so the outcome does not depend on the order. Rsbuild builds it
again and serves it real, unreported. The stale watch report (served real,
no demand) stays. The allowed-import row now warns too. Guide, SPEC
J6.11, KNOWN-BUGS, changeset.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- isObjectMutator takes Reflect.set/defineProperty/deleteProperty/
setPrototypeOf as Object.assign: a write of the argument (the write table
orders it; changesObject no longer takes the global Reflect as changed).
- followSlot's imports' users fallback is for followers that run nothing of
their own (an unused component); an effect stays where it was written
unless a binding takes it (the dead-code page's namespace).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by the oracle run of part B:
- enum-member-reads "a built-in": Reflect.set(E, ...) was taken as a change
of the global Reflect; the read moved past it (wrong value).
- dead-code page: namespace Unused { value = track('namespace') } moved
into the chunk with its import's users; an unused declaration with an
effect of its own stays where it was written (core row added).
- enum-member-reads "an imported function": write(E) now follows E after
the read, which keeps the first value (the row pinned the break).
- lazy-handlers SSR effect timing: seed imported, as in router-plugin's
rows (a method of globalThis keeps a statement, not a declaration).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The exempt plain importer compiled first serves the file real and nothing
is reported; the other order fails the error build. Fails at this commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A reader anywhere imports an extracted export from its module, so that
module is no destination a follower must share (followSlot, followConflict:
placers). careflow's unused CheckStep follows the page into its chunk and
Shell, Title, CallFooter stay extracted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
careflow-clinic-compass (corpus): the unused CheckStep read Shell, an
extracted export, and stayed, cancelling three extractions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R148 and the amendment: dead code follows what it reads, and imports go
wherever their users go. StatementChanges.imports lists the imports a
follower reads; followSlot takes their users' one lazy output when the
bindings it follows decide nothing. An import never keeps a follower (every
output imports one itself).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by the corpus: drivewise, oushodhwala, MomentumV2 and others' unused
components stayed in the route module with their UI imports.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The finishMake pass canonicalised every module's resource (+7.3 ms per
compilation on a 1,485-route app, Rsbuild dev HMR, paired).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The written report took the clusters a statement follows (what it reads,
when it changes nothing) whatever their placement: registerRoute(Route)
named the component Route's value holds, which moves. Only what the env
module evaluates with the statement is reported; a statement changing no
binding "uses" what keeps it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
registerRoute(Route) stays (Route stays) and named the component Route's
value holds, which moves to the chunk (spelling variants, hoist-const of an
option component).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`boundValueOf` returns the consts it walked (`syms`); two questions over
them replace the hand-written single-const readers: `chainWritten` (any
is written to in the env output) and `chainSoleUse` (each has its one
use, unexported). Route options named through a chain of consts are read
(written: opaque `written`; else the last const's unit holds the object;
the chain's end gives the opaque reason), a spread and a computed key
through `boundValueOf` + `chainSoleUse`, an object-form loader through
`boundValueOf` (`member: 'handler'`, or split inside the object under
`chainSoleUse`, else `loader-object`). D8: one `options-opaque` and one
`options-unread` warning less; the loader chunk exports the handler.
`declaratorOf` is private to `boundValueOf`. Changeset for design 5.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
changesAsArgument: a function the module declares shows what it does with
what it is handed (any other writes nothing it is handed, R146); its
parameter changed in the body (changesObject), handed on to a call, or no
plain name makes the argument's binding changed. Closes the hole the
"what it only reads may stay" reading opened (fill(k) moving with d while
the loader keeps k). The written warning names an extracted export's module
without "the split".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
if (on) { d.init(); fill(k) } with function fill(o) { o.v = 3 }: fill writes
k, which the loader keeps, so the statement stays; it moved with d (the
loader read k before the write). Found by the review probes' b08 report.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- effect timing (router-plugin unit and integration): the effect is
spelled as a call of a function (`seed()`, an import in builds) rather
than a method of `globalThis`: a method of a global is a change of a
global, which keeps a statement and not a declaration, while the row
compares an initialiser with an assignment (incidental spelling).
- start-env: module state and its effect follow a hoisted handler when the
effect calls an imported function; a method of another module's object
(`db.get(label)`) keeps both in the defining module (new row).
- preserves-user-code: an object and its writes that only call an import
go with the handler, in source order there; a call between them stays
(no order between effects); the client's order is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deleted with their tests: the error or warning for a route whose
createFileRoute an app module re-exports (`route-factory-foreign`, R85)
and the check of route factory calls other than the route's own
(`route-unowned-options`, `route-unowned-unread`, R92 amendment answer
3), with `FACTORIES`, `ROUTER_PACKAGE_RE` and the factory reference count.
Builds that failed with them pass, and what those calls hold ships (D7).
`route-unrecognized` under `deleteNodes` says the options listed are
not removed (design 5 decision 2 B). SPEC J2.11 loses its sentence on
such calls. The diagnostic-location test's compile error is now invalid
`codeSplitGroupings` (the foreign factory is gone).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Finding 3: the first page gets the real module (before, the file's own
check reloaded it after a mock). The orphan row's first build is the
exempt-only Vite race (R142 (2)); its rebuild is what the row checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`plan()` returns for a file the registry does not list (R145: served as
written, D5) and reads the route call with `routeCallOf` (the
generator's answer) for the entry's kind: a Route not made by the
configured framework's router package (D3: another framework, a subpath),
a constructor of another kind of file (D4, repaired by the generator), a
type-only import (D6) or a call the generator still repairs is left
alone. The kind and id come from the entry, the router package from the
configuration. Deleted: `resolveFactory`, `importsFactory`, the
RouteRecognition pair, the planner's `propertyKeyName` (the generator's),
both `routeId === null` branches; `isAlreadyLazy` compares with the
configured package.
`routeCallOf` reads the binding's one declarator (a type, interface or
type namespace merged with `Route` declares none; two declarators make no
route call), as the planner did. The unread-options Start tests move their
route into the routes directory: a file the generator lists.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One rule for statements, a declaration's own writes and dead code
(Events.statementChanges / unitChanges, the replacement of statementTouches):
what a statement changes is the bindings it assigns, writes a member of or
calls a method on (units.ts changesObject; a call the purity model knows
changes nothing is none: callChangesNothing), directly or in what it runs
(ReadIndex.runs, with an enter hook for the function units it reaches), and
the objects those hold (heldBy). Calling, reading or passing a binding or
an import changes nothing. It stays when it changes something outside the
module's bindings (OutsideChange: an import's object, a global, import.meta,
a dynamically imported module: outsideChangeIn over the shared
walkEvaluated); else it follows the bindings it changes, or what it reads
when it changes none; what it only reads may stay (the chunk imports it).
R148: settle's dead-code drop is deleted; an unread declaration (or dead
cycle) is a follower judged in round 0, what erased code reaches aside
(orphaned by us); homes drops no declaration. Part A's finding-2 deletion
fix goes with it; extraction keeps asking ClusterGraph.runsCode
(Tier1.deletionEffects renamed extractionEffects).
Finding 3: Seeds.augmentedRoots is replaced by stayPins: the roots and
settle record why a statement stays (outside change, a changed binding that
stays or another output uses, several outputs using what it changes), and
eager-split:written reports the declarations it changes (or uses, when it
changes none) with the statement's line and that cause; the fix offered is
to change the other binding in a statement of its own, or to move the
declaration and the statement to their own module. Imports joined to a
reported cluster are not named.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eager-split:written names what keeps the statement (another module's object,
a global, a binding the route module keeps or another split option uses, or
several split options using what it changes) with its line, and each offered
fix applied lets the declaration load with its chunk (finding 3, R100).
Restated (R146 amendment, R148): a call handing a binding to an import
follows what it reads (register(Page), log(client), connectAuthEmulator);
registry.add(log) and homeUrl.search = docsUrl.search = REF move with what
they change; seed 1302 moves whole; an unread declaration and an unused
function move with what they read (part A's "never deleted" rows); the
annotation row reads the chunk; a statement with a binding it only reads two
chunks need moves with what it changes. Deleted: "moves a call of a function
only the component reads, whatever it touches when called" (finding 5,
pinned the other way by the amendment rows). The written row of the
annotation table goes: marking the initialiser no longer frees a statement.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Guide: Pattern Imports says a checked pattern or plugin-added importer
and one needing the file as it is fail the build (R147), with both fixes;
the Vite build race keeps to exempt importers; held importers in watch
builds. Limitations: the Vite dev server keeps a denied file real after
its exempt importer is orphaned or an allowed import removed, until a
restart. KNOWN-BUGS and SPEC J6.11 follow. Changeset.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R147: when one importer needs a denied file as it is (an exempt or
unchecked plain importer, an import allowImport allows) and a checked
importer reaches the file itself (a pattern import, an import another
plugin added), every build fails under both behaviors, checked on the
complete graph (Vite generateBundle, Rspack processAssets), whichever was
served. The error names the file, each importer and why, and both fixes.
Dev servers report the same error (Vite's log once, each Rspack
compilation) and keep serving as the ledger says. It replaces the served
mismatch report for that shape.
Real demand counts only importers the compilation holds: an environment
forgets the records of the module ids a compilation no longer holds
(Rsbuild at a later compilation's finishMake, before serveAsDemanded;
vite build --watch at buildEnd), keyed by output id so a split-out part of
an exempt route is dropped too. ImportProtection.retain keeps the scope
cache only; Rsbuild's per-environment path retain of the records is
superseded and removed.
An allowed import's target lives as long as the import: read from the
ledger (an edge module served real with a registered violation) instead
of a session set; a released environment's targets stay (RSC: the ssr
environment loads what rsc allowed). An importer compiled again releases
the imports it lost in builds too.
A build registers allowImport's answers at the importer's compile, as dev
does. A self verdict reads its demand again after allowImport answered.
The mismatch report fires in the mock direction only when the mock
survived, and names each early importer by its cause and position; R89's
warning names the pattern import of each importer that has one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`GetRoutesByFileMapResultValue.kind` ('root' | 'file' | 'lazy', from the
scan), read by the router planner's registry view, in the entry's digest
and in the registry change detection. No output change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R147 rows (both hosts, both behaviors, a plugin-added import on Vite, the
pattern fix applied), held importers in watch builds and Rsbuild dev (an
orphaned exempt importer, a removed split route component, a removed
allowed import), the build registering allowImport's answer at the
importer's compile, the dev re-read after allowImport, and the reports'
wording fixes (mock direction only when it survived, the pattern import's
position). The shared apps move to served-verdict-app.ts. These rows fail
at this commit; the next commits fix them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The user's examples: it stays when it changes another module's object, a
global, `import.meta.hot`, a dynamically imported module, or (finding 5)
through a local function it calls; it moves with the bindings it changes
when it only calls or passes imports, in an `if` as in a plain statement
(finding 4), and when what it only reads stays (the chunk imports it). A
declaration's own write is judged the same way. 8 failing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 2 restated these three rows for rule L deciding extraction; the
architect's ruling on finding 2 has extraction judged as deletion is (a host
may flag the extracted module side-effect free), so head's assertions hold
again. Found by the lane's oracle run (3 pass→fail vs round 2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`routeCallOf` (analyze/route-call.ts, exported) answers which call makes a
file's Route and what the generator still repairs: the namespace object is
unwrapped like every position (D1), the root kind accepts the root
constructors, and a constructor of the other kind of file is repaired
(R144: createRootRoute/createRootRouteWithContext in a route file to
createFileRoute(id), createFileRoute/createLazyFileRoute in __root to
createRootRoute). The root file is analysed like every route file: a
normal root is listed with routerConstructor (D2). The app-helper warning
goes (R130, design 5 decision 3); the two warnings about the router's own
constructor stay. classifyCallee and the declarator walk are deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generator: a root constructor in a route file and a file route constructor
in __root are repaired to the constructor of the file's kind (R144); the
registry lists a normal root and a cast namespace import as router-made.
Router plugin: the registry's verdict equals the page's split, per
spelling; options, spreads and loader objects named through a chain of
consts. Start: a file the generator does not list is served as written
(R145).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A candidate for an extracted export's module, and an unexported cluster
only such a module needs, is judged by `ClusterGraph.runsCode` (what may run
code or throw, rule L's language operations included): a host may flag the
module side-effect free whatever it holds (webpack family: a rule on the
query), so code that may throw never moves there. The `effects` report of
an export kept so words its initialiser as the cause and offers the
annotation only when it frees the initialiser under that purity. The
side-effect-free flag computed for Vite is back to `effectful` (no flag or
host rule changes: a separate investigation).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The webpack-family hosts flag every extracted-export module side-effect free
by a rule on its query, whatever it holds, so the side-effect-free flag
cannot carry the distinction: an extraction candidate asks deletion's
purity, as at head. `export const url = new URL(text)` read only by the
component stays in the route module, reported `eager-export:effects` with
its initialiser as the cause; the offered `/* @__PURE__ */` fix extracts it.
An unexported `new URL(text)` only an extracted export reads stays in the
route module. Real builds: Vite, Rspack, webpack, Rsbuild (kept reports).
Rows round 2 restated for rule L return to head's answers: an export
augmented by a property of an imported object is not extracted, nor an
exported language operation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fable's review of order rule v2, smaller points: the row asserts placement
and an empty report, not the removed warning (AGENTS.md: no tests of removed
things); `packages/router-utils/undefined.out` was committed empty by
f5529e64a4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A unit's `effectful` is placement's timing (rule L: language operations are
no effect); the dead declarations placement drops and an extracted export's
side-effect-free flag asked it, so an unread `const check = JSON.parse(x)`
reading what a chunk needs was deleted from every output, and
`export const url = new URL(text)` was extracted into a module a bundler may
drop (Fable's review of order rule v2, finding 2).
One judge of a unit's code (`evaluationHasEffects`) is asked with placement's
purity by the unit model and with the planners' by `unitEffects`
(`Tier1.deletionEffects`, lazy, a few units per module); `ClusterGraph.runsCode`
is `effectful` with the units judged that way (the same loop, R139's pure
writes judged by their values). Settle's dead candidates, homes' drop and
freeze's side-effect-free flag ask it: such a declaration stays in the route
module as an unread effect does (an env root, or orphaned by us), and the
extracted module is not flagged. An extraction candidate keeps rule L
(it moves code, deletes nothing: architect's ruling).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fable's review of order rule v2, finding 2 (src3/, src1/e01): an unread
declaration of language operations (`JSON.parse(x)`, `new URL(x)`, a member
read) that reads what a chunk needs is deleted from every output, client and
server. Rule L decides timing only (purity.ts): such a declaration stays in
the route module with what it reads, as at head. Ruling (architect): an
extraction candidate may take rule L (it moves code, deletes nothing), the
side-effect-free flag may not: `export const url = new URL(text)` extracted
is not flagged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
memberUse climbs through every expression that evaluates to its operand's
value (a conditional's branch, `??`/`||`/`&&`, a sequence's last, `await`,
an assignment's value) and through array and object literals a member read
reads back, before asking what reads or writes the value. One rule instead
of a list of parent shapes: `(alias ?? {}).b`, `[alias][0].b` and
`(on ? alias : {}).b = 2` read or write what `alias` holds, ordered against
writes of the original (Fable's review of order rule v2, finding 1:
cases/wrap.json 125/125 and cases/lmatrix.json 880/880 agree, head's 3
included). A mutating method's receiver is a member of the value, not a
literal holding it (`[x].push(1)` writes no `x`).
The report-reading check of placement.test.ts follows names a destructuring
binds, so it can check the destructured-alias row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fable's review of order rule v2, finding 1 (cases/wrap.json): a name inside
a conditional's branch, `??`/`||`/`&&`, a sequence's last, `await`, an
assignment's value or a literal read back (`(alias ?? {}).b`, `[alias][0].b`)
reads the object it holds, as `alias.b` does; with `const`, `let` and
destructured aliases. The same climb finds the object a member write
through such an expression writes (`(on ? alias : {}).b = 2`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An Rsbuild build with a portable cache (Rspack's cache.portable), the app
moved to another path before a second build that reads the cache: the
allowed import gets the real module, the denied one its mock, reported.
Passes at head (Rspack 2.3.1 restores no app module at the new path), so
design 4 step 5 (root-relative EdgeModuleContent.resolved) is not taken.
Equal chunk names across roots are not tested: SPEC G4 leaves generated
names free across roots (R100).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deleted guardedGraphView (Rsbuild): its catch covered a read of a
compilation Rspack dropped, which no read reaches. Rspack (2.2.9, 2.3.1)
keeps a compilation readable after close() and drops it only while it
creates the next one, in the same synchronous section in which Start's
thisCompilation tap sets the environment's graph to null; hook reads see
a live compilation. A throw there is now the compilation error reporting()
produces. The Rspack graph view's optional calls (getIncomingConnections,
getParentModule, getModule, entries) are required: all exist at the
supported floor, and a missing one read as 'nothing imports it'.
surviving(): a surviving mock of a denied file with no importer in the
build's graph (no supported configuration has one: a Vite build refuses a
second client entry, the dev servers report such a file at its compile)
is an R116 invariant instead of producing nothing (I5): thrown in our
test runs, one internal-invariant warning naming the file otherwise.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A production build of both bundlers: an import's mock (it carries its
importer's path) is in the output exactly when import protection reported
the import, i.e. when the bundler's graph said the mock survived: used,
unused, an effect, and the same in an async chunk (Rspack's scope-hoisted
inner modules included). Passes at head; goes red when the graph the
witness reads changes shape.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dev: after each compile (and the edge index change it made), the denied
files the ledger served otherwise than their importers now ask for go into
the environment's stale set and reloadStaleModules builds them again,
before the compiled module is served. Only when the ledger holds anything.
Build: surviving() takes the build's module ids from a host that cannot
build a module again; a denied file it holds whose served verdict differs
from mismatches() is reported under behavior (R142 (2)), replacing its
other reports (R89's warning, its pattern importers' violations). The
report names the file, the unchecked importers that need it (demanders(),
the one rule selfAllowed reads) and the pattern importer's fix; a watch
rebuild's kept-real file names its importers and the save that fixes it.
Docs: pattern imports aren't covered (R142); the order-dependence and
'fails either way' paragraphs replaced; the Vite build order case listed
with the accepted rejections (KNOWN-BUGS). Pins unpinned.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite dev: an exempt plain importer compiled after the denied file was
served the mock for a pattern importer, or a plain import allowImport
allows read after it, gives both the real module once the server settled.
Vite build in that order: the error build fails naming the file (R142 (2));
the mock build warns naming it. vite build --watch: a rebuild that compiles
the denied file before its edited exempt importer, which no longer imports
it, reports the file it kept as it is; a later save mocks it. The user
plugin holding a load re-arms per build and applies to the client only.
New failing rows are .fails pins; the mock and later-save rows pass at head.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At finishMake the ledger is compared with what the compilation's importers
ask for (`mismatches`: an exempt importer compiled or restored after the
file, an exempt import gone, a restored module's `allowImport` answer); the
modules that differ go through the environment's stale set and are built
again until none differs (a second flip is an R116 invariant). The served
state is kept in each module's `buildInfo` (edge modules too), so a restore
is compared instead of rebuilt. Deleted: `selfAllowedNow` and its loop, the
`allowImport` clauses of `unjudged` and `unconfirmed`.
A compile the import-edges planner skips (the module imports nothing now)
removes the module's entry of the edge index: an exempt importer edited to
import nothing no longer keeps a denied file real.
F5-2, F5-1 (pattern first) and F5-1b fixed on Rsbuild builds, F5-6's exempt
half on Rsbuild dev. Core: `invariantViolated`/`invariantDiagnostic` exported.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The loop or block declaring `x` again touches only `x` and follows it
into the component's chunk, so no module imports the `var` and
Rolldown's inlining bug is not reached (passes under
COMPILER_TESTS_PINS=run). KNOWN-BUGS says when it still is.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One record of what each environment handed to the bundler: an edge
module's state and the verdict on a denied file compiled under its own id,
written when it is handed. It replaces `allowed` and `selfModules`; the
edge modules' code, `allowedTarget`, the witness, the build report and the
dev re-report read it, and the report no longer derives the verdict again
(the second `selfAllowed` call is gone). Messages only: a file served real
is no surviving mock (F5-1: no "Import mocked" report, no `error` failure
for the pattern import that got the real module, R142), and R89's warning
prints when the file was served the mock (F5-2's shape).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Real builds and dev servers, both hosts: one served verdict per denied file
whatever the compile order or cache, and no report saying "mocked" about a
file served real. All fail at head as .fails pins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A cluster whose statement writes only what the cluster declares
(`const d = make(0); d.add(0)`) touches nothing else: the seeds took it
for a statement touching nothing and kept it an env root. And a follower
the env module evaluates (`let seq` with a top-level `if` assigning it,
read by a function the loader keeps) was judged on its touches only:
followSlot and followConflict now ask the env liveness of the follower
itself.
Four `eager-split:written` rows restated: their writing statement now
touches an import (`links.extra = make()`, `registry.add(log)`, `REF`,
`registry.add(make())`), so it stays and keeps the subject; with a
literal it follows its binding into the chunk.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by the follow scaling row: `const d = make(0); d.add(0)` stays in
the route module (`eager-split:written`) although only the component
reads `d`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An unknown method of an object the route module or another chunk keeps
writes nothing it is handed (no condition 2), so a member read of the
object (rule L) moves past or away from the call.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The member-written row rendered instead of probed by a statement writing
a global (that statement now follows `B`, the only binding it touches,
into the chunk). The imported-function row reported: the member read
moves (rule L), the call stays (it touches an import) and writes nothing
it is handed, so the chunk reads the written value. The other out-of-sight
rows pass (an alias, an import alias, a holder: the enum owner fix; an
argument, Reflect.set, a method of the object, a namespace function: the
statement follows the enum into the chunk).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two holes rule L exposed in the one owner of "the object a binding
names": `'p' in alias` was no read through `alias` (memberUse), so a
write through a holder of the object after it ordered nothing (seed 309
with the object kept); a reassigned `let o0 = { v: 1 }` named no object
(namesObject), so a holder of it held nothing and a write through the
holder was no write of `o0` (seed 1919).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seeds 1919 and 309 restated as a read and a later write of one object
evaluating in one module in source order, alone and with the loader
keeping the object (the shape each fix needs: 309 alone already moves
together). Seed 555 is reported, not fixed: closing it needs an unknown
method call to count as a write of its receiver (condition 2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ownsItsValue took an enum or namespace declaration for another binding's
value, so the mutation model never counted it among the objects an alias,
an import alias or a holder holds: a write through one of those was no
write of the enum, and a member read rule L lets move ran after it. One
owner fixed, the four rows pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A statement that declares nothing (a call, an assignment, an if/try/loop
block) was an env root. It now follows what it touches: the module
bindings its text names and the objects their values hold
(MutationModel.heldBy, factored out of the through-writes walk: one owner
of "the object a binding names"). Touching an import, or nothing of the
module, keeps it an env root (decided in seeds, once). Otherwise it is a
follower: judged once against reach without it, rooted in the one chunk
every touched cluster and its own declarations go to (a cluster only it
reads follows it), then checked every round with the slots (each touched
cluster still has only that chunk, none stays, a timed one is there too,
plus readConflict/writeConflict); demoted, it becomes an env root.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The user's examples (1) to (5) and the statements kept in the route module
(an import touched: Sentry.init, i18n.use; bindings two chunks need; an
alias of an object the route module keeps), with what the statement rule
moves later (an install call, a call of a moved function, Firebase). Rule
L's holes: an enum or namespace written through an alias, an import alias
or a holder, and the three executing-property rows (seeds 1919, 309, 555)
unpinned. 12 fail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 1's no-order rule counted a module binding handed to a call the
model does not know as written by it (ClassifiedRef.handed,
handedToCall, the handed rows of placement's write table, the benign
route chain that exempted the route factory). Gone: such a call reads
what it is handed. markBenignEffect had no other use and goes with it.
Rows whose subject was condition 2 are restated: a snapshot with a
write through another name moves with it in source order, a split
option value handing a binding moves with it, two rows go back to
head's shapes and reports, the imprecise export report pinned under
condition 2 passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rows whose subject was an effect pinned by a later `validateSearch` call
state the no-order behaviour (every route loads its declaration with the
chunk, unreported); the warning plumbing rows (every environment, dev
once, positioned) and the impure builder chain probe a declaration two
split options read (`needers`); rows of two values' order, R65's
augmentations and mutator-named methods flip to what moves and what runs
first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The three rows asserting a member read stays an effect (a getter, an
imported or declared enum) state rule L instead; openstory's template
initialisers call CONFIG.url() to stay effects. The ten rows of an enum
written out of sight still fail: rule L lets the read move past the
write (reported, not changed).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The executing property's seeds 309 and 555/1880, in both order rules:
member reads, spreads and `in` are no effect, and neither an `in`
through an alias nor a method call inside a route option's function is a
recorded read or write of the object.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The executing property's seed 1919: with member reads no effect, nothing
orders the read before the write, which the alias model does not count
as a write of the reassigned binding.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Their dev-server rows asserted the order with the effects after them;
under no order rule they show when they run now. handedToCall's loop
types under TypeScript 5.6 and 5.7.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deleted: orderConflict and the effect list it walked, Cluster.firstEffect,
ClusterGraph.effectUnits, the order pin (Pin.other's unit), the order
case of the split message with its hints (effectStays, the same-effect
'with', the const-before hint, #__NO_SIDE_EFFECTS__ on a local callee),
firstImpure, effectAt, and the rows whose subject was that order. The
extraction candidate no output needs is 'unneeded', no longer 'order'.
Condition 2: a module binding handed when the module loads to a call the
model does not know (an argument, inside a literal, or a method's
receiver: ClassifiedRef.handed) is a member write of it in placement's
write table, through other names too; the route factory chain a planner
names (markBenignEffect, now: writes nothing it is handed) is not.
Rows whose subject was an effect's classification probe it through
extraction or two split options instead of a later effect; condition 2's
merges are written into the rows they change (one pinned as a known
imprecision). The properties check the same effects, each output's in
source order (ORDER = modules).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Core rows: a schema only the component reads moves past the one
validateSearch keeps; an unknown call handed a binding writes it (the
table snapshot stays with the call that changes the table); what the
rule reorders (a value before a bare call, R65's augmentations, a
top-level await, an option value's input, S-1 to S-3). Router-plugin
builds: the maintainer's two snapshot shapes show the source's value,
the column helper and columns load with the component, and S-1 throws,
S-2 and the hydrated store show the reordered state.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The unit model judges top-level effects with ModuleAnalysis.effectPurity:
member reads, spreads, in/instanceof, calls and new of standard globals
and the methods of what they return or of a literal, with pure
arguments (callbacks judged the same way, imported ones are effects).
Deletion (raw facts' effects, function-scope orphans) is unchanged.
Tests whose premise was a member read or new URL as an effect now use
an unknown call or constructor; two augmentation rows flip to extracted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member reads, spreads, in/instanceof, standard globals' calls and the
methods of what they return no longer keep a declaration in the route
module; what is no language operation stays an effect.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI tiers hold static tests only, and the repository holds no generator:
the executing placement property (router-utils toy planner, router-plugin
unit and slow tier), placement-random, rewrite-random and freshness
property (b) are deleted. They are development tools now, kept outside
the repository; every case they found is a written-out test (previous
commit, and the tests each fix added).
The workers no longer get --experimental-vm-modules (only the executing
property ran ES modules in `node:vm`). compiler-test-utils AGENTS.md
states the rule: no generated or seeded tests in the repository; a
generator is a development tool kept outside it, and each case it finds
becomes a static test naming its source.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every case the seeded and random properties found that had no written-out
test of its own:
- placement: the executing property's seeds 85 (an option value writing
through an array holder, read by another option's function) and 305 (an
extracted export of an object written through a chain of aliases), and
REVIEW-design2-final cases A9 (a value writing through a conditional
alias of an extracted function) and B1 (two option values linking one
middleware the route module reads). All four red at the design 2
closing base (6b70a972af), green at head.
- freshness: form c of the design 3 final review's finding 2 (property (b)
seed 1732051583): a twin found by a plan replaced before the folded
change that brought its file back. Red when the file set moves only on
`add`/`unlink` events.
- rewrite: the two shapes the random rewrite trees found in design 1 (an
output's placeholder on exactly a region claimed for the others; a claim
on exactly a slice another edit keeps), liveness against what each output
holds, verify on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scaling rows caught three costs of the lane (head vs lane, median of 5):
chain 6,400 2.1 s -> 5.9 s (a write's expression found with nodeAt, a walk
from the file root, per write site), and an alias chain of 1,600 written
through 41 ms -> 1.7 s (a linear membership test, a row per intermediate
alias, each write walking the whole chain). A write's expression is recorded
when its reference is classified; rows go to the bindings that name an object
of their own (a read through an alias walks to them); a name's held objects
are walked once and not followed again. Rows now at head's times.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"a server fn the client stops importing is refused over HTTP" failed in the
oracle's parallel run (the server's sentinel rebuild came after the 300 ms
quiet); it and the failed-first-client-build row now settle on
`rebuilds: ['ssr']`. Rsbuild's settle ignores the field.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack reports no event for the linked package's package.json; the
importer's save is a file event, which now moves the file set, so its
compile asks the package's export again. Flipped in the lane's oracle run;
confirmed green twice with the file filter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The oracle's rsc-start-nested-class row (after-declaration) failed: a
registry whose add() call holds a middleware, and a method writing
registry.fns, made the middleware count as written through another name, and
Start's nested server-fn hoist refused correct code. Through-writes are an
over-approximation: placement takes them (write table, isDuplicable), where a
false one costs a pin; a planner refusal would not.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`WatchStep.rebuilds`: the environments a step rebuilds by cause (the server
after a save only the client bundles) settle once each began a build after
the others' last builds began, and all ended. The rows that expect the
server's sentinel rebuild use it; under load the sentinel reaches the
server's watcher later than the 300 ms quiet. Design 3 final review,
finding 6.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A unit that is no declaration and no own augmentation makes its cluster an
effect, and the lazy slot rules are asked of declaration clusters only:
never reached over the core suite, the corpus's 53,490 compiles, 2,000 toy
and 1,500 router-planner seeds of the executing property.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Any file event may hide a creation (a removal and re-creation reported as
one change), so the resolution memo and the plans' resolutions don't
outlive one: the twin a compile found while the file was gone is asked
again (forms a, b, c of the final review's finding 2). `fresh`,
`StandingAnswers.failed`, `CompilerCaches.events` and the re-ask loop in
`resolveForAnalysis` are deleted: "an event ran since" is "the file-set
version moved". The snapshot asks the resolutions again once a check
overlapped an event. The eager passes at an event stay. Seven tests that
asserted a change asks the resolver nothing (or shares a pending answer
across a save) follow. README: the invalidation paragraph split.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start's asset mock declared its file in every environment; it now takes the
condition derived ids' `load` has (a watch build, Vite's bundled dev), so an
unbundled dev server records no import of the mock on its file. Design 3
final review, finding 6.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Five scenes (a compile in flight finds the twin, with and without a published
plan, the file back with the same or another text; the twin answered after
the change), and property (b) rows with twins and folded removals, with the
review's failing seed. Red at head. Design 3 final review, finding 2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It shared the solver's inputs: it passed findings 1-3 of the final review.
With four solver rules broken one at a time, the executing property (toy,
seeds 1-400) caught every break the checker reported (writeConflict: 46
disagreements vs 17 invariant reports in the core suite; orderConflict 202 vs
38; V 54 vs 44; readConflict: neither). Its own comment said it could go once
the compiler's exhaustiveness was checked otherwise. Its test of a planner
that ignores a fallback goes with it; Events.touches/spans/effects were its
only external uses.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Random route modules compiled and run as ES modules (node:vm), source against
outputs, under three timings: router-utils with the toy planner (seeds 1-400),
router-plugin with the router planner (unit seeds 1-150, slow tier 151-1150).
The generator and executor are the review's (router-utils
tests/placement-exec/); workers run with --experimental-vm-modules. The toy
planner imports its runtime wrapper once (two split keys gave a module that
did not parse), so the executor no longer dedupes import lines. README: dev
imports what a build copies into a chunk with an extracted export (P6).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The run turns the stats knob on (`TSR_COMPILER_STATS`, `./run-directory`);
the shared setup file compares the live compilers' `staleHits` and stale
paths at a file's end with its start (a process keeps earlier files'
compilers alive). The registry prefetch planner test plays the host and
takes the stale set its failed hit left. Design 3 final review, finding 3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`mkdtemp` in the real (`realpathSync.native`) system temp dir: mode 0700
under an unpredictable name, so nothing can be planted in it and two runs of
one app no longer rebuild each other's server; removed once every watcher of
the run closed (`closeWatcher`). An unusable temp dir warns once and leaves
the build working (client-only saves then don't rebuild the server); the
directory is never made again. The cacheDir hash, the existsSync rewrite and
the recursive mkdir go. Design 3 final review, finding 1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red at head: the sentinel's directory is made with the default mode under a
name derived from the app's path and never removed; a missing temporary
directory fails the server build (design 3 final review, finding 1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Node runs --import modules in every worker thread, so the watchdog module
started a new watchdog thread from each one: 424 threads and 3.6 GB after
4 s. Likely the cause of the Windows CI stalls of the first SSR run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(a) the order warning names the declarations it reads that the same effect
keeps (KeptDeclaration.with); (b) an effect another chunk loads gets a module
or the annotation, not a swap; (c) shared: its own module; (d) an export's
reads name the binding (readsKept returns it); (e) gone with item 4; (f) a
use inside a write of the kept declaration gets the move only; (g) an option
writing a binding kept for its initialiser's effects gets the annotation
(Fallback.writes 'used' | 'kept', FallbackRecord.annotate); (h) a let nothing
assigns gets const.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A write at an unknown time only the evaluation's own text makes, of a binding
no other evaluation touches at load, pins neither a declaration (V) nor an
option value (ownLate, asked by both).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reference's classification decides it (linkedBuilder: the receiver of a
link of a kind whose links write it, on a module-level const holding one),
so a link in a function is a write at an unknown time and one in an option
value is the value's own write. BuilderPurity.linked, Tier1.builderLinks and
the units' slice of the purity check's side list are deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A linear scan of each list made a statement of many guarded children (JSX
children replaced by Hydrate or `<ClientOnly>`) quadratic in them: 3,200
`<ClientOnly>` children froze in 74 ms against the base walk's 21. A scaling
row pins it (25,600 against 400 children: base 52, binary search 62, linear
scan 778).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mutation model owns "the object a binding names" for reads and writes:
one value walk (visitRuns' worklist and visitValues merged, a write's text
narrowed to its own expression), and from it the bindings a member write
through a name that does not own its value, or through a nested member, may
write (objectsWrittenBy). Placement's write table gets a row for each, so O
and V order and pin readers of the original name, and the writer joins the
cluster of what it writes; isMutated answers the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under load (the oracle's parallel tiers, six runs at once) the harness's
300 ms quiet settle ended before the server's sentinel-triggered rebuild
began, and the row read the first build's document. It now waits, within
15 s, for a server build begun after the client's rebuild to end (red
without the END reconcile: the server is not rebuilt).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guard asked which statement list an offset starts in by walking the whole
top-level statement on first need (every Hydrate boundary on the client,
every `<ClientOnly>` on the server). It now asks whether the text before
could be continued first, then descends from the module's statement through
the nodes holding the offset only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guard's first-token regex backtracked over its optional comment group and
read `/*b*/` as starting with `/`, adding a `;` before it. One trivia
pattern now serves the guard and `tokenStart`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
liveModules transformed the file's module in each environment for every
event of a file with derived modules, to drop those its plan no longer
produces (design 3 step 5 review, finding 6: 1,500 transforms and 14,400
resolveId calls for 750 routes rewritten with the same text). A derived
module nothing requested (import analysis created it; isSelfAccepting
unset) stops Vite's propagation whether kept or dropped: when no derived
module of the update was analysed, the update is Vite's own. A tripwire
test pins both Vite behaviours.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stale-set drain asks an idle compiler for a compilation from
afterDone; neither bundler documents when a watching compiler is idle.
The RSC Rsbuild rebuild test is named as the tripwire of the manifest's
finishMake stage (red with the tap moved before Rspack's RSC plugin).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- vite build --watch: a client build failing in generateBundle ends the
server's wait (its watcher's ERROR); the server's rebuild ends within a
bound and the next save rebuilds both (red with ERROR ignored)
- the empty-read rule: truncating an empty file moves its modification
time, or the clock is whole seconds (unknown to the rule)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The watch-build audit (auditStaleSet, Session.builds in both Vite hosts)
could not count: every Rolldown watch rebuild transforms every module
again, so a path stale at buildStart was always compiled (design 3 step 5
review, finding 7). Each environment's buildStart in a watch build takes
its stale set; a tripwire test fails if a rebuild stops transforming
every module of the first build, and another if a plugin context kept
from a finished build stops resolving (Session.resolvers).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A file removed and created again within one change (a twin, x/index.ts,
beside it): a module compiled meanwhile found the twin, and the change
asked nothing (no failed resolution, no file-set move) while the memo
still answered the twin. The shadow check (a lookup since step 5) now runs
on every event of a file but its removal (a package.json on its first
event only), and asks those resolutions past the memo when the file set
stands (resolveForAnalysis fresh). The .fails pin passes and is kept as a
test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cached walk did a Set lookup per touch of an effectful cluster and a
span Map lookup per touch of a written binding, where the walks it replaced
did neither: the registry scaling row (1,600 augmentations) was ~5 % above
head. The touched cluster's effect is checked first, and a run of touches
of one binding updates its span without a lookup. Registry, chain and flat
rows now equal head under the lock (4 rounds).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PlanCache kept seven maps per key (entries, generations, latest, active,
pathOf, inFlight, restored) beside its byPath index. One PlanRecord per
live key now holds them, byPath indexes the records; inFlight is read
through flight/fly/land. compilerStats: records replaces generations,
latest and trackedKeys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No host read { evicted, dependents }. The tests that read it observe the
stale sets (takeStale / staleAfter) or the plans themselves.
Start forgot a removed file's server functions and import protection's
records by asking rawFacts.knows after the await (Vite) or by the kind it
sent (Rsbuild): two forms of one need, the first open to a re-creation's
event in between. createCompilerCaches takes a removed callback, called
where applyChange applies the removal; Start's session passes its forget.
forgetRemoved and Rsbuild's unlink branch are deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A row of the dependents index held one flag, so a key with a published
plan and a compile running shared a row that said "published": an event
checked the old plan and never the compile (design 3 step 5 review,
finding 5). A row now holds both facts: an event restarts the compiles
that asked (but for a failed resolution) and checks the published plan.
A compile's failed resolutions are its own to ask again: the resolution
memo asks again a failed answer whose ask a file event overlapped
(CompilerCaches.events), and the snapshot asks the failed ones again once
a file event ran since the attempt began, until a check overlaps none.
DependentEntry.failed, failedInFlight and allCurrent are deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the sentinel lives in the system's temporary directory (one per app's
cache directory): an app's build.watch.exclude of node_modules no
longer hides it; a non-empty build.watch.include of a server
environment takes it in (configEnvironment)
- the client build's digest serialises the manifest's maps by entries
(unhashed names: a new stylesheet moved nothing)
- each server environment's watcher is followed: at its END a server
build that embedded another client build than the last one is built
again (Rolldown watches a build's files once it ended)
- the sentinel's directory is created again before each write, a missing
sentinel is written again at embed, and a failed write warns instead of
failing the client's bundle
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Watch builds: a build.watch filter hiding the sentinel (exclude, include),
unhashed names adding a stylesheet, a client-only save during the
server's first build, the cache directory removed during the watch; and
the plain client-only save (a guard, green). Core: rule A beside a
published plan with a failed import; a failed answer whose ask an event
overlapped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
readsThrough climbed every value reference's parents a second time after
writesMember (react-start client profile: 7.9 ms self in readsThrough and
+7 ms in parentOf over 30 iterations). memberUse answers both from one
climb; writesMember and readsThrough are gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
factsOf walked every touch to collect spans and effectful reads, where the
walk it replaced stopped at the first binding written at an unknown time:
a call chain's declarations each walked the whole chain below them (scaling
row chain 6,400: 2.1 s at head, 14.5-16.5 s). A volatile cluster takes no
slot, so nothing asks its reads or the rest of its spans; the checker still
meets the touch that ended the walk.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The oracle row asserted the removed rule (both kept in the route module);
both now load with the component's chunk, in source order. Adjusted with a
note; the values and the order of the effects are still asserted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
validateSearch: createSchema(…) runs in the route module after them: they
stay, reported once at columns as eager-split:order naming the call.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red at the integration head: both stay with eager-split:reads (the control
stays too, reported as reads instead of order).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Step 4 recorded every link on a const builder as a write of it, so two
server fns on one shared base were one cluster: a page-only one stayed in
the route module, unreported. Only createMiddleware's links Object.assign
the builder's options; createServerFn's and createIsomorphicFn's copy them
into a new builder. RecognizerTable.builderLinksWrite names the kinds whose
links write (Start: middleware), carried into BuilderPurity.writes;
builderCall records a link receiver only for those.
Listed difference: two exported server fns on one shared const base no
longer leave together to one extracted module (step 4, listed difference
1, with two links); the base, a call result two extracted modules read,
stays once in the route module and both stay with eager-export:reads (R77).
The test of that row now uses the middleware kind; the server fn spelling
has its own row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A server fn's links copy the builder's options (start-client-core
createServerFn), so a page-only server fn on a shared base should move to
its chunk while the loader's stays; today every link writes its builder,
so all three stay, with no warning. Guard: a middleware's links assign the
base's options (createMiddleware) and stay one cluster with it. The toy
recognizer names the kinds whose links write (builderLinksWrite).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
V refused a claimed value whose call runs a function writing module state
(component: memo(function Page() { didInit = true })) even when nothing
else touched the state, where the same write at load splits (rulings 2 and
3). V for a value now tells the late writes that evaluate in its output
(its own text, or a function only that output holds, so the named
memo(Page) spelling agrees with the inline one) from the others: those
are judged as the value's writes at load (confined: the binding evaluates
in that output, nothing else there touches it), one shared check. The
checker accepts a late write by code only the reader's output holds, of a
binding it holds.
A kept value that writes the binding is worded as a write (Fallback.writes,
FallbackRecord.writes): "it writes `didInit`, which other code also uses"
instead of "it uses `didInit` when the module loads".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
component: memo(function Page() { didInit = true }) and its member-write,
event-handler, import and named spellings stay in the route module with
not-split:ordered-effect, although nothing else of the module touches the
state (the same write at load splits). Control: another reader keeps it.
Core rows on the toy planner, real rows on Vite and Rspack client builds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
refreshRegisters unwraps a call's first argument before the identifier
test, so component: memo(Page as any) is hoisted like memo(Page) (dev
only). SWC (Rsbuild) registers the hoist and the component keeps its
state. oxc (plugin-react on Vite), like react-refresh/babel, registers no
family through the cast: that cell stays a pin (KNOWN-BUGS upstream table).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
writesOnly took the receiver of any call whose method is in MUTATORS as a
pure write, so log.push('first') on an object literal (a class's static
add, a function given a set method, a call result's set) moved with its
chunk past track('second'). Such a method is the module's own code: a call
(R65), an effect, which also writes its receiver (writeTargets still
records it). A mutator call is a pure write only when the receiver is a
const holding an array literal or a new Map/Set/WeakMap/WeakSet of the
global constructor whose methods of those names nothing replaces
(builtinCollection).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R139's amendment made a write through an alias an effect but left the read
side: an evaluation reading alias.v, holder.cfg.v, { ...alias } or a
destructuring of alias touched only alias, so it moved past cfg.v = 'NEW'
and read the new value. The object a binding names is its value (its
declaration and its writes at load): a reference reading through its
binding (readsThrough, the read side of writesMember: a member read's
object, a spread's argument, a destructuring or for-in/of source) runs the
eager references of that value, transitively (visitValues), as a call runs
all of it already. Holding a function still runs nothing.
The P4 property's reference model follows the same reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A read through an alias, a holder, an array, a spread or a destructuring
before a write of the original binding moves past the write and reads the
new value (Vite and Rspack client builds render NEW; the source gives OLD).
A call of a method named push, set or add on an object literal, a class, a
function given the method or a pure call result counts as a pure write and
moves with its chunk, after an effect written after it. Controls: a read
after the write, a holder of a function only, and the built-in mutators of
an array literal, a Map and a Set still move.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R29 (c) leaves lazyConflict, which judged it before the other side had a
slot ("as if the other side stays"): readConflict asks it in solveSlots'
fixed point, against target, next to orderConflict and writeConflict. An
effectful cluster's read of another effectful cluster passes when that one
evaluates in the same slot, or the env module keeps it (live, an env root,
or demoted this round) and it is a const; a let still pins (R67). A demoted
read cluster re-judges its reader (the loop repeats). lazyConflict keeps
written and V and loses its walk and liveEnv parameter.
One walk per cluster (factsOf) now gives V's and ordered's pairs, the span
of each written binding touched (writeConflict and checkPlacement read it,
no walk per round) and the effectful clusters it reads.
Tests: the old rule's own case (an initialiser reading an effectful
binding stays with it) deleted; the kept-reports row loses api/client,
which now move.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The runtime no longer reads a prediction, so the planner stops writing one:
markSplitComponents and RouterRound.splitComponents/registers,
routeRefreshMarkers and Hydrate's $$tsrRefreshId writer
(HydratePlannerConfig.refreshMarkers), the core's homeId SymRef context
and homeIdOf, and React's unsplit record in planHmrHoists. Hoisting and
the lowercase rename stay: they give an inline component a React Refresh
family. Solid and Vue keep unsplit and bindingIdentity. Deleted with the
mechanism: Hydrate's marker test, the homeId placement test and helper
option, isMemberOfImport (its only caller was the marker list).
Dev output differences: split and Hydrate chunks lose the $$tsrRefreshId
statement; React route modules lose unsplit in the route HMR meta.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Core rows: TanStack Table columns reading their helper, a schema reading a
schema, a literal reading a helper result, a member read after a write of
the helper result, a chain of three; both kept when an effect after them
stays; a reader of a `const` that stays for its own reason moves (judged
on its final slot); a `let` that stays still pins. Integration: Vite,
Rspack and Rsbuild builds run the effects with the chunk, in order.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The React adapter's whenRefreshed runs a route update once React Refresh
processed the evaluated modules (Vite: a task after the
__registerBeforePerformReactRefresh hooks; webpack/Rspack: the
enqueueUpdate callback), or after a 200 ms bound of its own per update,
at once without a refresh runtime. Core runs through the adapter's
settled: the unsplit route refresh, a lazy wrapper's settle of a
re-imported chunk (the newest-import rule checked again after the wait),
and a lazy route file's in-place update. The live wrappers re-import when
the route module evaluates (once per wrapper pair), so the chunk's settle
waits for the same pass. React's keep, keepUnsplit and kept() are gone:
React Refresh decides whether the mounted component keeps its state.
keep/keepUnsplit are optional (Solid, Vue unchanged).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every React route edit shows in place, with state kept where React Refresh
refreshes the component, on Vite and Rsbuild, split and unsplit, two edits
each. Red at head: 11 stale first edits (a conditional behind a const, a
factory's result, an unexported class, a barrel that switches module) and
memo(Page as any) remounting (Vite split; unsplit on both bundlers).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The graph records each unit's own-augmentation verdict (roots.ts reads it;
the exported scan per unit is deleted); member writes per owning unit and
the owns-its-object verdict per binding are indexed once. The registry row
(1,600 attach statements) was 10-15 % above head.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rolldown builds a bundled dev environment and rebuilds a module only for
files it watches: without the call an edit of a split route never reached
its chunk (router-plugin dev-full-bundle.test.ts). Only an unbundled dev
server goes without it (finding 1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two oracle rows asserted the removed rule (a pure write ordered against
other effects; a link on a const builder an effect): adjusted, each with a
note. Values and identities are still asserted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A direct write (the binding, `X.p = v`, `X.push(v)`, `Object.assign(X, …)`)
to a binding never reassigned whose declaration creates its value
(`ownsItsValue`). `const alias = E; alias.A = …`, `import F = E`,
`holder.e.A = …` and `Page.meta.title = …` write another binding's object:
effects, as before step 4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red at the step 4 commit: an alias, a member of a holder, a reassigned
binding (oracle enum-member-reads rows: the read moved past the write).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- clusters: an effect is purity's verdict but for a pure write of a binding
its cluster declares (`effectUnits`); `Cluster.sideEffects` and
`lastEffect` deleted, `effectful` is the one field; `writer`: the
cluster writes what it declares at load
- a link on a `const` holding a builder: the planners' purity notes builder
consts (`noteBuilderConsts` moved to purity.ts) and records the link's
receiver (`builderLinks`): a member write in the write table, so the
builder and its links are one cluster; a link statement augments it
- the solver: a writer is timed (its only lazy needer's slot, so a reader
before the write may evaluate there); with several needers homes place
it (a shared module its readers import); `slotOf` answers a candidate's
module; demotion is the pins; candidates have no effect (the effectful
candidates in `solveSlots` and their branch in `candidatePin` deleted)
- O: the static half deleted ("static outputs evaluate in source order
among themselves"); the checker's effect loop has no time 0
- tests asserting the removed rule adjusted (augmented exports extracted
whatever effects precede; pushes no longer co-locate their reader)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red before step 4: a pure augmentation an unknown call follows, a first
effect after the unknown call, a pure augmentation two chunks need (shared
module), a page-only chain on a const builder, two links on one builder,
and the builder-in-const pin (its `.fails` removed). The const-builder row
of "keeps a link on a const builder and an impure argument effects" asserted
the removed rule and is deleted. Guard: an exported binding a statement
writes and an exported reader after it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- a write's owner is the evaluation holding it: the unit or claimed region
(an unclaimed region is its unit's text, finding 1)
- the option-value ruling covers assignments (finding 2) and member writes
of an import (finding 3: stays unless no other output includes the import
and nothing in its output reads it at load)
- a write in a function an evaluation passes to a call is a write at an
unknown time of that evaluation too (`passed`), as when it is named
(finding 4)
- the checker: a reader importing a binding from the output its write
evaluates in evaluates after it (a chunk importing another chunk's
single-writer binding)
- the calls cache moves to the cluster graph (`callsOf`), shared by the
write table and `runs`
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The measurement of design 3 step 5 (start-build-watch app, 20 edits each,
server builds per edit): without a wait, an edit of a route (both
environments bundle it) builds the server twice (2.0: the server embeds the
client build before the edit's, the client's build rewrites the sentinel);
an edit only the client bundles 1.0. Base (ClientRebuild) 1.0 and 1.0. With
the server's resolver and start manifest waiting for the client build that
is running (its watcher's BUNDLE_START to BUNDLE_END or ERROR, followed from
Start's buildApp): 1.0 and 1.0. An optimisation only: the sentinel still
rebuilds a server that embedded another client build (F6-2's test builds it
twice).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assignments and import member writes in a split option value, a write in a
function the value or a declaration passes to a call, and a member write
inside an unclaimed region: red at the base.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vite build --watch: the client's build is one record on the run's session
(its start manifest, the server functions it references, their digest), set
by the client's manifest capture. The server's resolver and start manifest
embed it; in watch mode they watch a sentinel file in the app's cache
directory, and a client build whose digest differs from one a server build
embedded rewrites it: the server's own watcher rebuilds the server, in any
order of the two watchers (F6-2). Deleted: ClientRebuild (the wait on the
client build a file event began), Session.clientFiles (the server watching
the client's graph), the start manifest's closure capture.
- The build-order error (J4.2) is keyed on the record being absent outside
watch mode; in watch mode a client whose first build failed embeds as no
build, and its first build rebuilds the server.
- The sentinel is filtered before invalidate(): it is ours, not a source.
- A watch build's invalidation asks each plan's resolutions with its own
environment's resolver (the plugin context of its last build).
- Both Vite hosts take their stale sets at each environment's buildEnd in a
watch build, as an audit: a path stale when the build began that the
build bundles and did not compile counts as a stale hit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A guard for the client-build record (green at head, where the failed build's
buildEnd still set the client's file list): the server built after the
failed client build must not raise the build-order error (J4.2), and the
client's first build must rebuild it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server's build fails at its entry, the client builds the route edit
(held); the fix is saved meanwhile. The server's watcher, idle, rebuilds at
once and waits for the client build that is running; the client then builds
the fix and the server is never rebuilt: the document names six client files
the client's last build did not emit (red at head).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`watchEdits` takes a list of steps: each is written once the builds of the
previous one ended, or once its `when` resolves (Vite: while a build of the
previous step runs); the result describes the last step's rebuilds, an
earlier step's may fail. Vite's settle counts every file a watcher reports
(a file a build writes for another environment's watcher, too) and waits for
the watchers to stay quiet for a moment. Control: a rebuild after a failed
one shows the fix (both bundlers, passes at head).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Finding 1: a derived id's load declares its file to the watcher only in a
watch build. Vite's dev server recorded it as an import of the derived
module, putting every split route in an import cycle with its route
module; a failed update import there reloaded the page into SSR's 500.
- Finding 3: a compile in flight that met a failed resolution is restarted
only when a file event makes one resolve (its row carries the failed
resolutions it recorded); a repeat of a package.json or tsconfig event
moves no file set.
- Finding 5: an add looks up the dependency paths it may shadow in an index
by directory and stem instead of scanning every path of every plan cache.
- Finding 8: a modification time of whole seconds counts as unknown for the
empty-read retry; the record is in the stats.
- Findings 6, 7: one hotUpdate body for both Vite hosts (staleHotUpdate);
the event's file leaves the stale set before the take; updates sent
outside a hook catch their failures per module (reloadStaleModules).
- Finding 9: the stale sets track the environments whose bundler holds
modules (Vite dev environments, a webpack-family compiler at its first
drain); a registry change stales its file there, and the hosts no longer
write to the sets.
- Start: a removed file's server functions leave the registry only when the
core judged the event a removal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Failing at head: a compile in flight with a failed import restarted by an
unrelated save and its repeat; a repeat of a package.json/tsconfig event
moving the file set; the first save of a file created empty on a clock of
whole seconds; the empty-read record missing from stats; the route on the
page saved broken reloading into SSR's 500 (Start) and a broken split chunk
reloading the page (router, Vite). Guard: a compile in flight restarts when
its failed import resolves now. Pin: the twin case of a file removed and
created again within one change (base too).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A claimed option value's member write when the module loads is a write of
its event, ordered by O like any other: the value evaluates where its owner
does, after that output's own code, and a reader of the binding where the
binding does. Unless the binding evaluates in the value's output and nothing
else there reads it at load, the value falls back (ordered-effect, naming the
binding). Wrong output before (and at dd7a83110f): the write moved to the
chunk and code reading the binding at load saw it unwritten. checkPlacement
places such a write after its output's own code. The router's and Hydrate's
ordered-effect messages cover a write and the router's names the binding.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The kept-reports row asserted the old record of a reader the union merged
into the state the loader keeps (`const label = 'MARK' + n` after `n++`).
It now moves with the component and is not reported.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ruled: such files inside an app are not supported; R97's plain error
stays. Reverts 6a2555d105 (message, test, changeset line) and 13a4b564a2
(the test's typing), keeping 6a2555d105's sort of a router host import.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ordered-evaluation union goes, with kept.ts's readersInWrittenClusters.
A binding's writers when the module loads stay in its cluster: the join now
takes a unit's eager member writes (`const y = f(cfg.x = 1)`), which the
union used to join as readers. The mutation predicate is split: a write at an
unknown time is V (cached per cluster, absolute), a write at load after a read
is O, judged on the slots of both sides in the solver's fixed point
(writeConflict): a reader moves only to the slot its later writer evaluates
in. For an extracted module a write outside it before the read conflicts too,
unless an extracted module it imports makes it. R29's rule (c) is asked of
effectful clusters only. A pure reader several chunks need is reported with
its pair. checkPlacement checks the writer's side: a write at load evaluates
where the binding does.
Listed difference: a declaration that reads a binding after its last write at
load no longer travels with it; it moves, and its eager-split:state warning
goes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red at head: a declaration reading a binding after its last write at load
travels with the binding the route module keeps (the listed difference), and
a pure reader of state several chunks need is reported without the binding.
Guards from the step 2 review (member writers in initialisers, a reader and
its later write moving together, an extracted reader of an import a
declaration writes) pass at head. Pinned: a member write an option value
makes at load moves to the chunk past a later route-module reader (also at
dd7a83110f).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
checkPlacement ran only on a placement without fallbacks, assuming such a plan
is planned again; a planner that does not act on a fallback (the router's dev
HMR hoist) left the module unchecked. The placement keeps its check as a
function (Placement.check) and the pipeline asks it of the final plan.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each written binding keeps whether a live write runs at an unknown time and
where its last live eager write is, so the mutation predicate answers "none"
without scanning the binding's writes; checkPlacement scans a binding's writes
once per evaluation (its first and last touch decide every comparison), not
once per touch; visitRuns follows a name once per evaluation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ruled (R97): Start keeps compiling every in-scope JS/TS module, and a binary
file with a .ts extension in the app fails the client build. The message
named the file and position; it now gives the fix (R100), which the test
applies: under another extension the build emits the file unchanged.
Also sorts an import of the router host (eslint).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After a start from webpack's filesystem or Rspack's persistent cache, the
bundler restores route modules without the loader compiling them: their
environment had no plan cache, so a registry change reached no stale set
(review finding 4), and a module compiled under an older route list stayed
as it was (the config changed while no dev server ran; stale at the step 3
base too). As Start's Rsbuild host does, the loader persists each route
module's plan in its buildInfo when the cache outlives the process, and the
first finishMake restores the plans of the modules it did not compile
(`restorePlans`): a stale one's file joins the stale set the drain builds,
and the environment's plans make later registry changes reach it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red at the integration head, made while the dev server runs and while none
ran: the bundler restores the route module without compiling it, so its
environment has no plan cache, and a registry change reaches no stale set
(the review's finding 4; the while-down shape is stale at the step 3 base
too). The generator dev app takes a persistent cache and restarts on the
same app, writing files while no dev server runs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A rejected tap ends webpack's and Rspack's watcher (neither finishes the
compilation nor watches again; Rspack 2.3.1 panics at the next one).
`reportingFailure` (router-utils) runs each async tap of the router's
webpack host and of Start's Rsbuild host (watchRun, make, finishMake,
finishModules, processAssets, the resolver and RSC manifest rebuilds): in
watch mode a failure is an error of the compilation, a watchRun's of the
compilation it starts. `StaleSetDrain.rebuild` gives back the paths it took
when a rebuild fails; the wake bound ends a failure that repeats. The
registry listeners ask for compilations after a failed invalidation too. A
one-shot build still rejects.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red at the integration head: webpack dev (an app plugin's buildModule hook
throws once in the router's rebuild of a route module) stops answering;
Rsbuild dev (the app's onViolation throws once in Start's finishModules)
fails the compilation fatally, and the watcher is gone. The webpack dev app
takes the app's plugins after the router's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The loader rule stays static and leaves node_modules out (ruled); a module of
the compilation whose file is a route there is reported once per file, naming
it, through the session's warning ledger.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red at the integration head: the static loader rule excludes node_modules, so
such a route file is no longer split, and nothing says so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The router's static loader rule matches every JS file outside node_modules,
and Start's rule every JS file: both bundlers decoded a binary file with a JS
extension (a .ts video segment imported as an asset) for the loader, which
passed the string on. The loaders are raw now; they decode (UTF-8, byte
order mark dropped, as the bundlers do for a loader that is not raw) only
what they compile (`loaderText`, router-utils).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red at the integration head: the router's static loader rule and Start's
loader rule decode the file to a string and pass the string on (752 bytes
in, 1,502 out). The build harnesses take bytes for a binary app file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The core stales a registry change's file only in the environments that have a
plan cache; after a dev server restart a module served before it became a
route has none. The registry listeners add the file to each environment's set
before they take it (router-plugin dev-server-restart rows).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The checker's effect order walks the effect list O memoised instead of
asking every unit again, and only when a cluster with a source effect is
homed outside the env module (an effectful generated unit in a chunk is
compiler code): the benign check runs where the solver asked it already.
Generated names are recorded only where a member's text has some.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One hook shape: every environment's hotUpdate forwards the event, takes its
environment's stale set (held paths on a creation) and hands the modules to Vite
with the event's own (liveModules filters those only); invalidated with the
one-argument form, so a transform in flight is dropped. Where Vite calls no
hotUpdate (bundled dev, hmr: false) and in the registry listeners, every
environment's set is taken (reloadModule outside a hot update). Deleted:
Session.invalidations (the ctx.read memo), awaitingAdd, outputDigests and
changedDependents, applyViteInvalidation and its five-argument call,
takesStaleSets (Rsbuild's session hands import protection the stale sets
itself), the overtaken compile's dependency-only record and its warning.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Option A of the seed-24344 report (a change of a path the caches hold nothing of
that reads as a file is judged an add), the failed-resolution re-ask on every
file event (review finding 4a, and a removed file read again before its return
was reported), and finding 4b (an empty event read waits for the text unless an
event already found the file empty at the same modification time:
RawFactsOptions.modifiedAt).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Property (b) on a virtual clock with (seed, stretch, jitter) rows; core rows for
a file back as a change, a removal and re-creation folded into one change, the
first in-place save of a file created empty; Vite dev rows (F6-1, 4b, F6-5,
F6-6, the route on the page saved broken, a marked module reported once);
Rsbuild dev: a file back while another environment compiles.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stored per cluster, what each declaration of a call chain touches is most
of the module: 6,400 declarations ran out of a 4 GB heap. Each rule walks
the touches it asks about and stops at the first violation; V, which no
round changes, is cached per cluster.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`placement/events.ts` owns the event table: what each cluster's
evaluation touches (its walk, cached once, and the bindings its generated
text names where it runs at load), V, the lazy-slot pair rules (written,
V and rule (c) in walk order), T and O. Each answers with the violated
pair (`Pin`: kind, the other event, the binding); kept.ts words its
records from it and the `ordered-effect` fallback carries the binding.
`settleRoots` is one solver body: slots, demotions, extraction. It is
bounded by the cluster count (past it, an error naming the file). V
applies to extraction candidates: an exported snapshot of state an
exported function writes stays (`eager-export:state`; F1-2: the oracle
pin, both core pins and the KNOWN-BUGS entry flip; the random test runs
the chunk time by default).
Deleted: `movableTo`, `effectStays`, `decideMovable`, `undecided`,
`readsKeptEagerly`, `stateReaders` (clusters.ts), the homes.ts
invariant and `staticOutputRead`; `checkPlacement` (R116 switch)
checks the final homes against the same time model instead.
`mutatedOutside` returns the write it observes (`observedWrite`).
`keptDeclarations` walks each cause's reach once (was each cause against
every reach set). The copy decision asks V only of what a copy reaches.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`visitRuns` follows a running name to its declarations and to the
top-level statements writing it when the module loads (the mutation
model's eager sites): a call reaching `handlers` may run what
`handlers.count = () => n` attached, so `x = run('count')` stays with
`eager-split:state` instead of moving and reading `n` late (review of
design 2 steps 0-1, finding 1). The kept-report reference (`evaluatedNames`)
reads those statements too.
`RegionTable.register` refuses a sub-region holding a unit (other than
one on exactly its range): it owned the statements' references, which
placement then read for no unit. The design 1 double-render test needed
that shape and goes; the random env-pieces test checks I2 for every seed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Failing first: a function a later statement attaches to an object (or
assigns to a `let`) and a load-time call reaches through another function
lets the caller move and read state late (review of design 2 steps 0-1,
finding 1; head and base). The direct spelling stays (control). A custom
region over whole statements is refused (steps 0-1 lane, finding 3).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack's RSC coordinator starts each client compilation from a server
compilation; one asked for on its own waits for a server compilation and
hung the dev server's next edit. StaleSetDrain.register takes the
environment whose compilations start this one's (startedBy): wake asks that
compiler, when idle, for the set of the other. The Rsbuild session registers
the client with the server under RSC (registerCompiler). Review of step 2,
finding 1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A route file created while the dev server is idle: the generator publishes
the route list from its own watcher, the route enters both environments'
stale sets, and wake() asked the client compiler for a compilation of its
own beside Rspack's RSC coordinator. At integration head (5b7ed17cf3) the
compiles of the creation never end (Rsbuild did not finish a compile of the
edit within 20 s); the review of step 2 predicted a client one save behind
(finding 1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The created-route scenarios through the router's webpack-family host, which
hands a created file to invalidate() as a change of an unknown path: router
plans read no resolution (the router host's resolver answers nothing), so no
plan waits for a created file. The webpack dev app's settle accepts a write
the generator reported, as the Rsbuild one does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
building() takes a compilation's modified paths out of the stale set into a
list of its own instead of deleting them; rebuild() builds again those whose
modules the compilation did not build (builtModules: webpack with
snapshot.module.hash skips a file written again unchanged). Review of step
2, finding 2.
compiled(env) at afterDone resets the compiler's count when its set is empty
(a wake that did its work), so only compilations that each end with the set
still full, without a cause between, count toward the bound of three; when
it trips, one warning names the files. Review of step 2, finding 3. Core:
StaleSets.paths(env) (read, for the warning).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With snapshot.module.hash webpack lists a file written again with the same
text in modifiedFiles and does not build it. The make-time drop removed that
path from the stale set on the premise that the bundler builds it: a route
whose id changed in the same edit keeps the groupings of its old id. Red
3/3 (review of step 2, finding 2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The drain moves to router-utils (hosts/rebuild.ts, StaleSetDrain), one owner
for Start's Rsbuild host and the router's webpack-family host: building (the
compilation's own changed files leave its set at make), rebuild (the set's
modules rebuilt in place at finishMake), wake (an idle compiler with a
non-empty set asked for a compilation at afterDone and after a registry
change, bounded). The Rsbuild host calls it where it drained before (in the
replay tap, between restored plans and import protection).
Router host: the loader rule matches every JS module outside node_modules
(the loader passes non-routes through), so a file stays one module when its
registry entry changes and rebuildModule keeps loaders; events of a batch go
to invalidate() at once; a registry change puts its files in the stale set
(the core), which the compilation that follows builds. Deleted: the router
host's compiled flag, invalidateFiles, invalidateWithChangesAndRemovals
(WatchingCompilerLike). Declared difference: webpack re-plans a route whose
id changed (F7-5a).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
webpack-dev-server joins the generator dev app's hosts. At head the webpack
row fails: the registry change falls back to watching.invalidate(), and
webpack rebuilds no module whose file is unchanged, so the route keeps the
groupings of its old id. Rsbuild (Rspack) and Vite pass. Also runs the
registry-change row (a file that becomes a route) on webpack: green at head
(webpack matches rules again for each compilation), the guard for a static
loader rule.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since the drain, a module edited to be marked is built in `make` while its
unchanged importer's plan still imports it: it was reported as its own
violation (no position; an error in `behavior: 'error'`) besides the
import at the importer, which the importer's rebuild reports. A module is
its own violation only when nothing explains its presence: an importer
whose plan is stale in that environment does (its rebuild reports or
allows the import). Import protection reads the stale sets through one
query (`StaleSets.holds`) when the host takes them (`takesStaleSets`:
Rsbuild; Vite takes them at design 3 step 4); the module is still served
as its mock, and enters the stale set itself so its rebuild, after the
importer's, reports it if something else still brings it (test: a context
module of the entry; red with that line removed).
Architect's ruling (option B of the step 2 report).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The env module's walk of a member's reads yields both products: the
symbols it reads and the references of the text it renders
(`MemberReads.refs`); `runs` reads those, with the unclaimed regions
nested in the member (its successors, whose text evaluates with it). The
second walk in references mode is gone. `bodyReads` was a second copy of
`symRefsOf`, which now pushes into the reads' list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`RegionTable.insertOwnerAt` gives an insert its one owner, the text
holding its position: the innermost node strictly holding it (its level
renders the insert) and that text's region, else the unit holding the
byte there (it reads what the insert names). The walk renders an insert
only at its owner's level (`RewriteSet.insertLevel`, once per version):
the level-end tests and `cover` are gone, and with them the second render
at a piece cut inside a node (finding 1). In the env module an insert at
the start of a statement placement rewrites is that statement's text: the
span before it no longer renders it (finding 2). An insert where no unit
holds the position is refused when added: nothing would read its names.
No real planner inserts outside a unit (all five stand in expressions).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Failing at the step 1 commit:
- an insert at a piece's position inside a node that renders as its
source renders twice (finding 1, on a statement whose unit starts at its
first byte: the review's input puts the insert at `const`, which no unit
holds);
- an insert naming a binding at the start of a statement placement drops
renders, and what it names is gone (finding 2), with its control (at a
kept declarator, the binding stays);
- an insert where no unit holds the position (a keyword, the module's end)
is refused. The test of the old rule (inserts at a dropped statement's
edges render) is deleted with the rule;
- random env pieces (finding 4): statements placement drops, regions over
statement edges, units anchored before and after units, inserts naming a
binding at unit and call edges. I5: each insert renders at most once; I2:
every binding name the env module renders is declared there (not checked
with a region over whole statements: placement reads their references for
no unit, a shape outside its model). At the step 1 commit: 1 double
render, 6 undeclared names in 1,000 seeds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dependent that also changed in the same save was built twice: in `make`
from its own event and again by the drain (design 3's risk 2; the
multi-file perf row: +6 client, +6 to +11 SSR modules over head). Rspack
builds the modules of a compilation's changed files in that `make`, from
their text, once every invalidation of its events ended: those paths leave
the environment's stale set there (`StaleSets.drop`); whatever makes them
stale later enters the set again and is drained.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`ReadIndex.runs(member)`: the references of the member's text in the env
module (the walk of `OutputView.walk` through reads.ts, read for its
references; a region nested in it that the env module does not claim is
its text), and when it calls something, the callbacks it passes and the
bodies of the module's declarations its running references name
(`visitRuns`, analysis.ts). Asked per evaluation, never per module.
On it: the readers of written state and the `ordered-effect` fallbacks
(`stateReaders`, after the reads index), the movable test's walk, the
TDZ read of an extracted export (`readsKeptEagerly`), the static-output
invariant and verify (e) (on the output's own analysis).
Deleted: `ClusterGraph.loadReads`/`atLoad`/`mutableReaders`/`fallbacks`,
`loadRefsOf`, `loadAtOf`, `inClaim`, `LoadReadStep`, the backward closure
(`readersOf`, `selfReaders`, `writtenLater`), the claimed-option scan,
`runsAtLoad`, `unitsRunBy`, `Unit.callsAtLoad`, `PurityContext.calls`.
Listed differences: F1-1 (pinned `state`), F1-3a (splits), the holder of
a function someone else calls (moves), Q2 (pinned `state`). One more on
the corpus: an exported server fn whose validator the client erases is
no longer cancelled `eager-export:reads` (the old TDZ walk read eager
references without asking whether the output renders them).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Failing first, through compileModule with the toy planners:
- F1-1: a declaration whose load calls a function assigning module state
moves to the chunk when a top-level `if`/`try` also assigns that state
(controls without them pass); oracle rows in the state-read-at-load
builds (Vite, Rspack, Rsbuild: `'b!'` against `'a!'` unsplit).
- F1-5a: a holder of a function another declaration calls at load is
pinned; F1-5b as a property over every kept report of placement.test.ts
(the binding a `state`/`reads` message names is one the declaration's
evaluation reads, by a reference written apart from the compiler).
- F1-3a: an inline option value passing an object with a method to a call
is refused (`ordered-effect`); its const spelling moves. Control:
`component: wrap(n)` with `n` written later keeps `ordered-effect`.
- Q2: an unclaimed region inside a declaration hides its reads.
- P2: seeded random route modules replayed in source order and in the
outputs' order (an extracted module at both of its times): red on F1-1
and F1-2.
Pins for later steps: F1-2 (step 2; core and the oracle row, which also
answers F1's Q1: the runtime differs on all three bundlers) and a server
fn on a const builder (step 4). Q3 (raw facts' erased imports are dropped
by the compile) holds on every Start input of facts.test.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each environment compiler forwards its own file events to invalidate()
(watchRun: edits and removals; make: creations and package.json), all of a
batch at once; the core's comparison makes another compiler's event of the
same change a repeat. At finishMake (stage -20, in the replay tap: restored
plans first, then the drain, then the replay) the compiler takes its
environment's stale set, held paths too, and rebuilds those modules in
place (rebuildModules, with the merged HACK(rspack#16567) batch); an empty
take returns before any module scan, and settled() is awaited only while an
invalidation runs. After every compilation (afterDone, when Rspack has
marked the compiler idle; in done a compilation asked for would start
inside it) and after a registry change, every idle compiler of the session
with a non-empty set is asked for a compilation, at most three in a row
without a cause of its own. The session listens to route changes once for
all its compilers (each compiler's listener got its own array, so the
WeakMap dedupe never matched: two registry invalidations per publication).
Deleted: the session's lastEvent, stampOf, the dedupe and done chain of
invalidateFileEvents, rebuildDependents, rebuilders, registryInvalidations,
compiledOnce; the host's `starting` and the compiler.modifiedFiles write;
the host's invalidateFiles call (the router's webpack host keeps it until
step 3).
Declared difference: the dependents of a created file or of a route-list
change are built in the compilation of the event, not the next one.
Fixes F3-1 / F7-1 (dev-checkout.test.ts) and F3-6a through Rsbuild
(dev-created-deleted-stats.test.ts: the baseline is taken after a first
round, whose server fns bring five modules compiled once).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`renderSpan` built a copy closure and a visitor of three closures for every
span it rendered; the env module's pieces make about 74 % more spans. The
visitor is now one per `Renderer`, the span's state (owner, substitution
environment, output, substituted references, `afterEdit`) in fields, saved
around a nested span (the bodies a span renders render spans of their own).
Outputs identical on the corpus (53,490 compiles: bytes, maps,
diagnostics, recipes).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the review of design 3 steps 0-1, before the Rsbuild host forwards
every compiler's events:
- The same text proves that no fact of the file moved, not that the file
was there all along. A change with the text the caches read is a repeat;
an add, or a removal of a file that reads back, still moves the file set
(fileSetVersion, failed and shadowed resolutions asked again) without
marking its facts. Fixes finding 1 (removed and created again with the
same text: an importer compiled in the gap kept its failed resolution;
Rspack reports the second event as a change) and step 2 item 3 (a
created file reaches each compiler's make separately; the second
environment's resolver answered the first add from before the file
existed). The `ADDED` mark of `seen` goes: `seen` is a revision or
UNKNOWN. `readChange` returns the text and whether it is the same.
- A compile of a newer text that ends without a plan (untouched, empty,
not parsed) drops the key's plan of the old text and its rows (finding
2: a later edit of what the old text read reported the file; Vite's
liveModules reads the plan at the path).
- `staleHits` counts plan hits that failed on a fact (a defect: invalidate()
checks every fact); hits that failed only on a resolution or a
route-registry digest, asked again at the next request by design (a
tsconfig edit), are `lazyHits` (finding 3).
- Property (b): a stash and pop (removed, modules requested, back with the
same text, reported as add or change). 240 seeds pass; with the rule
reverted, seed 24481 fails.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The env module was one walk of the module with the core's edits laid over
it (statement recipes, generated units at their anchors, glue), ordered by
edit bands. It is now assembled as the derived outputs are: the walk's text
between its pieces, which are the statements placement rewrites, the
generated units at their anchors, the glue imports after the header and the
export glue at the end. At one position a planner's insert renders first,
with the text before it (also when the statement there is dropped), then a
statement's line end, the glue imports, the generated units, a statement's
`;`, the statement. Whether a byte renders there (`sourceEdges`) is the
tree's answer, else the rewritten statement's.
Deleted: `EditBand`, `EditOrder`, `compareEditOrder`, `CoreEdit`,
`compareCoreEdits`, `WalkOptions.core` and the walk's third cursor,
`Renderer.core`, `renderEnv`'s `extra` and its sort, the `gen` field. A
span with `includeEnd` renders the inserts at its end at every level
(`skipAt` skips them in the next span).
Beside the walk, now through it: the derived outputs' pragma and directive
slices, and `findErasedParts`' own descent (the kept claims inside an
erased part are what the walk of it meets).
A planner node a piece's position cuts now fails with "the text … cuts …"
(before: a statement recipe on exactly its range failed as two bodies; a
unit anchored inside it was dropped silently). Toy shapes only.
Outputs identical on the corpus (53,490 compiles: bytes, maps,
diagnostics, recipes).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rsbuild dev (start-plugin-core):
- dev-checkout: F3-1 / F7-1 through a dev server. `l.ts` changes kind,
which makes `a.ts` stale; `a.ts` is written while the compilation of
`l.ts`'s batch starts (a plugin's `watchRun` tap, and an in-place save of
`l.ts` with `a.ts` saved 5 to 20 ms after the truncation). `page.ts`,
which reads `a.ts` only, must be re-planned. Fails at head (the stamp
dedupe skips `a.ts`'s own event); the control (edits one at a time)
passes.
- dev-created-deleted-stats (integration-alone): F3-6a, 200 created and
deleted server-fn modules; compilerStats() collections no larger than
before and the stale sets empty at rest. Fails at head (no host takes the
stale sets).
- dev-dependents: a handler module removed by its importer's rebuild does
not hang the compilation (guards the drain at finishMake; passes at
head, where Rspack builds dependents itself).
RSC Rsbuild dev (react-start-rsc): F7-6, an edit making a client module's
import a server fn builder hot-updates the page (latent row; passes at
head).
Core (router-utils freshness): a file removed and created again with the
same text re-plans what looked for it meanwhile (review finding 1, fails
at step 1); a created file's second event re-asks the resolutions of an
environment whose resolver answered from before it (step 2 item 3, fails);
a save to a text without a plan keeps no plan of the old text (finding 2,
fails).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Placement asked the tree where each member is, from the root, for every
member and output (`nodeOn`, `nodeAround`, `childrenOf`'s second descent),
and built a reader of closures per member read. Now, once per plan:
- the nesting: one pass over the sub-regions (`parentOf`), grouped;
`RegionTable.childrenOf` and its memo with three resets are deleted;
- where each unit is: one merge of the units with the module's nodes;
- what each region's text holds of the tree: one walk of the marked
nodes (the nodes whose edits and placeholders are its text's, the
claimed regions nested in it) and one pass over the inserts.
`sourceReads` is the owned references, that index and the children: its
own descent, `firstNodeFrom` and `firstInsertFrom` go.
The live reads use one visitor per index, with the member's state in the
index's variables (a region claimed only for other outputs swaps the
references being read), and bodies push their names without a list.
Outputs identical on the corpus (53,490 compiles: bytes, maps,
diagnostics, recipes).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Design 3 step 1. RawFactsCache keeps, per path, the revision of the text
the last file event read while every read since agrees (seen; a cold read
is not hashed, so a path's first event applies); one reader serves get(),
marker() and the file event (marker's own read in flight is gone), keeps
the empty-read retry (skipped once an event read the file empty), and the
text an event read feeds the next facts build. invalidate() reads the file
once and returns when it is unchanged (an echo, a touch, a second hook),
runs one call per path at a time (caches.settled()), and judges an event
by the file as it is; only an add vouches for the file set. A change no
longer evicts the file's own plans (they are keyed by its text; evicting
them dropped the rows of an environment whose bundler had built the new
text already); a removal stales every plan that read the file, unasked.
The plans found stale, a registry change's file, a hit that fails
validation (counted as staleHits) and an exhausted compile enter their
environment's stale set (caches.stale). The return value stays for one
more step.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Design 3 step 0 (core): the F3-1 sequence at the core (a dependent saved
while its dependency is invalidated), I1 (an echo through two hooks while
a compile is in flight changes nothing) and property (b) on the memory
host: saves, in-place saves, checkouts, deletions and re-adds, each event
delivered one to three times to each environment's hook in any order,
compiles interleaved; once the stale sets are taken and built, every
output equals a cold compile of the final files. Fails at head: the stale
sets do not exist (through head's API: lost answers and an overtaken
compile that never heals; with Rsbuild's stamp record, F3-1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every range a planner addresses has two answers per output: its text
(`edit`, every output) and its place (`placeholder` in some outputs, or a
claim's, now with a scope). The view reads them through `editOf` and
`placeholderOf`; the climb asks each node the same two questions (a place
without an owner erases the text, a claim's relocates it). "Claimed" is
asked per output (`OutputView.isClaimed`): a member reads a nested region
claimed only for other outputs as its own text, with no edge to the owner.
- start-env: handler stubs are placeholders (the client's through
`serverOnly`), so an env-only or isomorphic handler is compiled as its
text: in the RSC provider output too (F4-3, SPEC J4.9/J4.10). The nested
chain is claimed for the provider output only; its env module keeps the
chain in place with the handler's stub. `stubbedHandlers`, the override
and `serverCode` are deleted; the parameter diagnostic reads the
server-only text.
- router: the identifier placeholder is a `placeholder`; `claimOn` is the
env view's `placeholderAt`.
- hydrate: the edits inside the children are unscoped (their text).
- core: `insert`, `scopedEdit` (orphan cleanup only, not on `PlanContext`),
`serverOnly`, one region per range, an insert at a unit's start read by
the unit, structural reads follow the walk's insert rule and read
placeholders; `EditBand.planner`/`claim` and `nested` deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- F4-3 (SPEC J4.9, J4.10): a handler that is itself a client-only or
isomorphic call is compiled for the server in the RSC provider module
(start-env planner tier, and one react-start-rsc build row).
- Step 2 review, finding 1: the env module of a nested chain drops the
imports only a client-only fn in its validator or middleware reads.
- Step 2 review, finding 2: an insert at a unit's start keeps what it
names declared when an edit rewrites the unit.
- Step 1 review, item 6: a claimed region whose place holds other text in
one output still renders in its owner, with the claim inside it.
- The random trees generate the override shape (other text at a claimed
region's place in one output).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One walk per output (`OutputView.walk`) renders source text: a node renders
its place (a kept claim's placeholder, or the edit replacing it) or its text
(its edit's body, or its source with the nodes inside it); a node rendering
as its source is walked through; an insert belongs to the innermost node
strictly holding its position. The renderer (freeze), placement's reads and
the erased parts are its visitors; liveness climbs the tree with the same
text/place rules.
- Owners render their claimed region whole (`{ k: 'region', id }`); a
generated unit names no slice. Route options written as methods claim the
function and edit the property to `key: ` plus it (router split and HMR).
- A slice that cuts a node rewritten in the output, or that leaves the text
its edit rewrites, is a conflict in every mode (F2-1's keep-slice cases).
- `claim()` registers its node (a claim on a unit region too) and rejects a
second claim on one range (review of step 1, findings 1 and 2).
- Placement's region nesting is read on the tree (`parentOf`, `childrenOf`,
`innermostAt`); `Region.parent`/`children` are gone.
- Deleted: `RenderTree`, `TreeEdit`, `tree()`, `topLevelWithin`, the copy
guard (`editUnderCopy`, R127, and its error-severity diagnostics), the
`exclude` lookup, verify (c), `regionReads`' edit scan, `fragReads`,
`editRenders`, `placeholderRenders`, `overrideOf`, `decide`'s bound, the
erased parts' `topLevelWithin` emulation and `anyHidden`.
- Scaling: the statement-start guard indexes one top-level statement per
walk instead of walking the module per offset, and `isErasedRange` visits
only the nodes overlapping its range (a module of 1,600 hoisted server
functions compiled in 8.5 to 10 times one of 400; now about 4 times).
- Tests: the random trees register in shuffled order, check the derived
output and ranges, and claim kept slices (the shape step 1 left out now
holds); the scaling test hoists every handler; the copy-guard tests and
the erased-parts emulation test go with their mechanisms.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One build, then two phases of `nx run --excludeTaskDependencies` test
commands: start-plugin-core's fast tier (Vitest's 5 s default timeout) and
router-generator's tiers first, then the three slow tiers whole with more
workers and router-plugin's fast tier. On 32 threads: about 3.5 minutes
instead of 8, every test result the same as the sequential run's in 3 of
3 runs. Under the slow tiers' load, start-plugin-core's fast tier timed
out; Vitest `--shard` slices finished unevenly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
F2-1 keep-slice cases (an edit between an edit and the slice it keeps, an
edit straddling the slice's start) compile at head in users' runs and copy
the text the inner edit replaces; F2-3: an insert at the start of a claimed
region renders at the place and again inside the owner.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The units hold no edit of their own: a range is checked against their
sorted list instead of being a node per unit. Each node knows whether an
edit or claim sits in it, and the descents and walks skip the others.
Nodes are found by their start (small integers). `erasedParts` is found
once per version, and a node with one edit lists it as it is.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rollup and Rolldown name a map's sources by module id, so a split chunk,
shared module, extracted export or server-fn output named its route file
`route.tsx?tsr-split=…`: a second file to devtools (breakpoints set in the
route file did not bind in the chunk) and to error trackers. The router and
Start Vite plugins' outputOptions compose sourcemapPathTransform with
withOwnSourcesNamedByFile (core hosts/vite.ts): only the compiler's own query
keys go (identify), foreign queries stay, and an app's own transform runs
after, once. The webpack family (webpack, Rspack, Rsbuild) names the resource
path already, in production and development builds. SPEC G6 states it (R135).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite production maps name the split, shared and extracted-export outputs
src/routes/index.tsx?tsr-split=…; Rsbuild names the file. The map reader and
the check move to compiler-test-utils/source-maps (emittedMaps,
emittedSourcePath, expectNamesFileOnce), shared with the router test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite 8 (Rolldown) and Vite 7 (Rollup) production maps name the split
component's source routes/index.tsx?tsr-split=component; Rspack, webpack and
Rsbuild name the file (production and development builds).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plan owns its regions (`RegionTable` moves from the cached analysis to
`rewrite.ts`): each plan, fallback rounds included, starts from the units.
Every non-empty range a planner or the core addresses (units, sub-regions,
edit ranges) is a node of one tree shared by all outputs, so a range that
partly overlaps another conflicts when it is registered, whatever outputs
the edits are scoped to (I1).
What an output renders of the source (`OutputView`: `isErasedAt`,
`isErasedRange`, `erasedParts`, `editRenders`, the claims it keeps) is
read on that tree by climbing from a position's innermost range, O(depth),
instead of scanning the sorted edits of a per-output tree per question.
A claim's status is a memoised climb; the `hidden` set and the second tree
build go. The renderer's `RenderTree` keeps the sorted, nested edit list
and its conflict checks; verify (c) still cross-checks `erasedParts`.
`regionReads` starts its edit scan at the region (binary search) instead
of at the module's first edit.
Outputs are unchanged: oracle, corpus (53,490 compiles hashed) and fuzz.
A module of 1,600 server fns compiles in 3.5–4.5x the time of 400 (was
8.5–12x).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red when Rspack stops answering a tick of rebuildModule calls in one loop
after one pass, or calls every callback (rspack#16567 fixed: set
RSPACK_REBUILD_CALLBACKS_FIXED_IN, delete the batch).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Prototype, not for merge. rebuildModules issues every rebuild of an Rspack
compilation in one tick, led by an entry module, and settles at the lead's
callback: Rspack answers a tick in one loop after one pass and drops the
last callbacks when modules leave the graph or change rule match. A single
module, webpack and compilations without an entry module keep the one at a
time path; RSPACK_REBUILD_CALLBACKS_FIXED_IN switches to Promise.all once
the fix ships.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A loader function reading `this` named by a module const, a function
declaration, a const naming another, or a loader object a const holds was
split without the not-split:this-reference check the inline form gets, so
the lazy wrapper called it without `this`. codeSplitGroupings followed one
const and failed through two. One resolver, boundValueOf (declaratorOf
through const aliases, or the function declaration a name declares), feeds
both readers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A loader function reading `this` held in a module const, declared as a
function, named by shorthand or through a const alias is split (the lazy
wrapper calls it without `this`); codeSplitGroupings through two consts
fails with groupings-invalid.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The replacement that keeps an isomorphic, server-only or client-only
implementation decided its parentheses on the expression inside the
argument's wrappers while it keeps the argument's whole text, so
createIsomorphicFn().server(impl as any)() compiled to `impl as any()`.
Decide on the kept node; at a statement start, decide on its first token,
as orphans.ts does for a kept initialiser (one helper in the core).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
createIsomorphicFn().server(impl as any)() compiles to `impl as any()` on the
server, which does not parse; the same with .client(), createServerOnlyFn and
createClientOnlyFn in their own environment.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both HMR planners returned for createLazyFileRoute modules, so the module
exported only Route, no refresh boundary accepted it, and every edit
reloaded the page. A lazy route file now gets the route module's hoists and
dev block, with lazy: true in the block's meta; router-core's
applyRouteHmr hands such an evaluation to applyLazyRouteHmr, which points
the route's lazyFn at the new evaluation (the route tree's import() keeps
the first module) and, when the route loaded the earlier options, swaps
them in place with the keepUnsplit rule route modules use (a load in flight
is refreshed instead). SPEC J3.1 names lazy files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite and Rsbuild, React, Solid and Vue: every edit of routes/index.lazy.tsx
reloads the page (10 of 12; Solid's named component is kept by Solid
Refresh).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
watchAndRebuild waited for a build after the writes and then for 500 ms
without one: an edit that landed while a build ran returned that build's
output, the old text, whenever the next build took longer than 500 ms
(Rspack). It now records the files each build starts with
(compiler.modifiedFiles at watchRun) and describes the first build reported
after every written file was among them, reading its stats at once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test:integration:smoke chose its tests with a -t alternation over titles,
so a renamed title left the set on every non-Linux platform with a green
job. It is now an integration-smoke Vitest project whose include lists
whole files; Vitest's config fails while a listed file does not exist.
Whole files add 36 router-plugin tests (3.5 s -> 7.9 s on Linux) and 14
start-plugin-core tests to the set.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stale flag had five writers and the generic read failure was not one
of them: a batch that stored one file's new facts and then failed on
another file's read left the next batch on the fast path with nothing
changed, so the tree kept the old import. The drain's catch now sets it
for every failure; the scattered writers are gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The analysis filed a resolver's external answer as unresolved: never
memoised, indexed in the unresolved bucket, so every add/unlink re-asked
every package import of every plan. It is now recorded as its own answer
(EXTERNAL_RESOLUTION): memoised per file set, indexed in a bucket that a
package.json or tsconfig change re-asks. Planners still read null for it.
Vite's invalidation host now counts a string external as external, as the
transform host does (F6-N2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With TSR_COMPILER_NO_CACHE=plans the cache refused to publish, so the
dependents index held no rows and invalidate() reported no importer of an
edited module. The knob now keeps the plan by its dependencies only (the
existing restored record: never a hit, reported by invalidate).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TSR_COMPILER_NO_CACHE=plans|all publishes no dependency rows, so an edit
of a dependency reports no dependent. The knob test pinned that.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack resolves the imports of the RSC layer's modules with
`react-server` (rule `resolve` options); the compiler asked the
environment's resolver for every layer. The Rsbuild host now has a host
per (environment, layer): the RSC layer's resolver is
`withOptions(RSBUILD_RSC_LAYER_RESOLVE)`, the object the rules use.
Core: `HostServices.resolveScope` keeps each resolver's answers apart in
the environment's resolution memo (R35), and `invalidate`/`restorePlans`
take the host of each plan's key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rsbuild's RSC layer resolves with the react-server condition (rule
`resolve`); the compiler's resolver of the environment does not: a file
only the default condition names is reported (dev and build), a denied
file only react-server names is caught by the witness alone, as an import
another plugin added. The Vite twin (the `rsc` environment) passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite: the session (compiler session, raw facts, virtual loaders and
waits, client build state, invalidation memo, digests, dev warnings and
the route-registry subscription) belongs to one run: a builder's
buildApp (Start's own pre hook, before plugin-rsc/nitro/Cloudflare
build), a dev server (configureServer, released at its environments'
closeBundle on close or restart), or, outside buildApp, the
environments of a by-hand build. Hooks find it by this.environment.
The transform filters derive from the resolved config at
configResolved. Rsbuild: one session per created compiler (a second
build() configures a new one); the route listener ends at the
compiler's shutdown.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A second build with the same plugin objects (Vite createBuilder with the
same inline config, Rsbuild build() on the same instance) compiles
against the first build's facts, and the build-order guard no longer
fires; a restarted Vite dev server stops invalidating route modules on
route registry changes. Failing tests through the public flows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The code splitter and route HMR's hoist claimed an option value with its
cast (`as`, `satisfies`, `!`) but copied the value inside it, so
another compiler's edit at the value's edges (Start's client compile of
`createIsomorphicFn()`, `createServerOnlyFn()`, a server fn's stub) was
not carried into the copy: with the self-checks off the client chunk held
the server implementation. Both now claim the bare value; the cast stays
in place around the placeholder. The split's check for a value another
planner claims (R3-G7-4) sees a server fn in a cast through the same range.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Failing at base: route HMR's hoist claims the wrapped value but copies the
unwrapped one, so Start's client edits are lost (self-checks: the invariant;
users' dev servers: the server implementation on the client).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A split loader whose value is a type-wrapped value Start compiles per
environment (`createServerFn().handler(…) as any`, `satisfies`, `!`,
`{ handler: … as any }`, `createServerOnlyFn(…) as any`,
`createIsomorphicFn().server(…).client(…) as any`): failing at base. With
the self-checks off (users' builds), Vite and Rsbuild client builds
succeed and the split chunk holds the server's code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The nested async helper of the #fragment rule cost a promise and an await
tick per judged import target: +16 % per fileOrMarkerRule call in a paired
in-process A/B (95 % CI [12.6, 19.6]); one loop over the id and its #-cut
is +1.4 % [-0.8, 3.6] (A/A +2.9 % [0.8, 5.0]).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
assignedTo and import-edges' TRANSPARENT listed 5 of the core's 7
wrapper types; both now use isExpressionWrapper (and assignedTo unwraps
the assignment target: `(base as any) = …`, `base! = …`). The rendered
use's name drops `?.` (`<UI?.Widget />` is no JSX). Only messages
change: `Widget<P>` and `UI?.Widget` route options got
createClientOnlyFn, which throws while rendering on the server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rows for the two consumers of the wrapper list: a builder assigned to
`(base as any)` / `base!`, and a *.client.* component as a route option
through `Widget<P>` or `UI?.Widget`; plus the `<UI.Widget />` fix. Only
the messages change (not checked by wording): these pass before the fix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The #fragment rule's second id costs one includes() for every other id,
with no allocation on the compile path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R3-G5-3 (ruling F1, keeping LR-10): the hand-over to the compilation that
replaced an unprinted one skipped every module it built again, on the
ground that such a module reports for itself; with the session's
once-per-dev-session ledger it reports nothing. The unprinted record now
keeps each module's warnings (not just its resource), and the newer
compilation reports every one it does not report itself, deduped, built
again or kept (handOverWarnings, a pure helper).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R3-G5-3: a double save rebuilt the module in a compilation that replaced
the unprinted one; the session's ledger (once per dev session, LR-10) kept
it from reporting the warning again, and the hand-over skipped rebuilt
modules: printed zero times. Per the round-3 ruling (F1), tested through
the hand-over's own logic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R3-G5-2 (ruling F1): each host compiler decided "created" from its own
last compilation, but under RSC Rspack's coordinator tells the client the
server's changed files, so every server-only edit ran an add invalidation
(memo dropped, failed resolutions re-resolved, a published plan evicted).
One session-level record, CompilationFiles, holds every environment's last
fileDependencies and contextDependencies; the host asks it for a modified
file's event, and retain reads it (it replaces the host's knownFiles and
knownDirectories and the session's liveFiles).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start hoists a server fn written in place as a split loader (or an
object-form loader's handler); the code splitter claimed the same text,
and the server build threw the core's internal two-claims conflict with no
position. The router now asks the core for a claim on exactly the value
(RewriteSet.claimOn) and reports it, positioned, in the claim's own words
(RegionClaim.subject), telling the user to declare it as a module-level
const and pass it by name (the passing control).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R3-G5-2: under RSC the client compiler is told the server's changed files,
which its own compilation never read, and invalidated them as created.
Per the round-3 ruling (F1), tested through the session's own record.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Vite id keeps a specifier's #fragment (./db.server.ts#x loads
db.server.ts), which no id tells from a # of a path (C#/src). Per the
round-3 ruling (F1), the file and marker rules judge the id and the id cut
at its last #, and either denies (fails closed). One owner: judgedIds in
rules.ts, used by fileOrMarkerRule and ownFileRule; the marker reader takes
the id it judges. Flips the two Vite pins of fragment-specifier.test.ts and
removes the KNOWN-BUGS row; SPEC J6.1 says so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ruling of review round 3 (F1, R3-G6-5 remainder): a webpack inline-loader
prefix (`!!`, `-!`) on a server-fn module loads it uncompiled, like
`?raw` (M9). Server-functions guide and SPEC say so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers the runtime request of a module served as its own mock in a child
compiler (fails without the runtime branch of childCompilerRequest).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A child compiler (a worker or service-worker plugin's) takes the
environment compiler's hook taps but not its virtual files, so a request
of an import-protection module there could not resolve: the build failed
and Rsbuild printed nothing (child compilation errors are not in its
stats). Its normalModuleFactory now turns such a request into the
violations it stands for: reported to onViolation and as errors of the
environment's compilation, at the import, and the request resolves to
nothing. Removes the KNOWN-BUGS row; SPEC J6.3 and the guide say so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces the child-compiler pin with the round-3 ruling (F1): a module a
child compiler builds cannot get a mock, so the build fails, with an error
at the import naming the importer and the denied file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces the pin: the build fails with a positioned error instead of the
internal two-claims conflict; the const spelling stays the passing control.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite runs no hotUpdate hook with server.hmr false, which was the
compiler's only invalidation of a dev server; watchChange, which Vite
calls regardless, now applies the event's one invalidation to every
environment's module graph there, as in bundled dev.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every attempt overtaken: the last plan answers unpublished, and the key's
rows in flight left with the compile, so no later event reported the
module whose output the bundler keeps. The plan's dependencies are now
kept as a restored plan's (never a hit, found stale by invalidate,
replaced by the next publication).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Their paths decide what specifiers resolve to, and a resolver may follow
the edit (vite-tsconfig-paths reloads its project; Vite then transforms
every module again). The edit now bumps fileSetVersion like a package.json
edit: each plan asks its resolutions again at its next request, failed
ones at once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite runs a plugin's buildStart only for the client environment in dev, so
only the client had a virtual-module loader and the server environments
read another plugin's virtual module as missing. The dev loader is set in
configureServer per environment; buildStart sets the build one, now before
the provider's handler-reach walk reads through it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
remapping reads plain maps only: an index map (`sections`) is flattened
with trace-mapping's FlattenMap first (now a dependency; it already came
with remapping). The test's loader gives its map sourcesContent: the
harness's Oxc loader rejects a null entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The client rebuild a file event started was waited for only by the
server-fn resolver, and only until the client's buildEnd, before the
client's generateBundle captured its chunks; the start manifest module did
not wait at all. One gate (ClientRebuild) now follows the client watcher
Start's buildApp holds: begun at the client's watchChange, ended by the
watcher's BUNDLE_END or ERROR, awaited by both modules.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Failing at head: composeLoaderMap hands the sectioned map to remapping,
whose TraceMap throws, failing the module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Derived outputs broke the position tie the other way from the env module:
an after-unit unit (anchored where the next statement starts) sorted
after that statement. Items now sort after every unit anchored at their
start; before-unit and after-unit units keep the env module's order.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Failing at head on Rsbuild: the provider output renders the hoisted chain
after the statement that uses it (ReferenceError when the provider loads).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The declarator check looked for the first initialised `var` while the
value analysis takes the first declaration with a value, so a function
declaration of the same name decided the value and the builder was never
seen. The check now asks the value analysis itself. A parameter is no
function declaration's value (values.ts took a parameter of a function
declaration for the function).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One side's return lost (or two that do not join) made the call's result
unknown, so a builder it returned left the analysis without an escape.
The join is now unknown, and each branch is judged on its own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Failing at head on Vite and Rsbuild: the server build throws
`conflict: two claims on region N (by start-env and router)`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An exported declaration exports each binding under its own name: renameRefs
records only the renamed symbol's, and the env glue re-exports the other
bindings of the statement, the renamed declarator's included, under theirs.
exportedRenames loses its unused names/units fields.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- loadReads visits assignments (`x = v` like `x++`): a load that assigns
state the route module keeps pins the mover (R7's write half).
- runsAtLoad answers where a reference first runs at load; a read inside a
function the load calls is compared at that position, and the movable
test compares at the mover's own evaluation.
- Writes in code that evaluates with the module but runs later (async or
generator IIFE bodies, instance field initialisers) are unknown-time
(t1.runsLaterAt); their reads stay eager (safe).
- isPureDeclarator checks a pattern's defaults and computed keys.
- README: these rules, and that getters stay outside the model (R97, G1-1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As main's dead-code elimination did: what the initialiser does is not
asked, so a same-module helper's call (a middleware factory's
`const sql = connect()`) leaves the client with the helper and the
server-only imports only it read. A hook call still stays as a statement
with its import (hook order). Removes the orphaned-imports heuristic
(initReadsOnlyOrphanedImports) and the purity test; the tests that pinned
the kept statement are replaced (orphans) or removed (a shadowed factory's
orphan kept its effects, a case of the removed rule).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Failing at head: `export const { component, meta } = makeViews()` exports the
renamed component as `meta`; a declarator beside a destructuring exports
duplicate names.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A function-local declaration only the erased .server() reads keeps its
initialiser as a statement on the client, with the same-module helper and
the server-only package it imports. Fails on Vite and Rsbuild.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Failing at head: a function called at load assigning state the loader
reads, a read inside a function declared after a later write, writes after
an async IIFE's await / in a generator IIFE / in instance fields, and
destructuring defaults and computed keys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every entry was exempt from being its own violation, so a client module's
pattern import reaching the server entry `src/entry.server.ts` shipped it to
the client unreported. Only an entry's own marker is exempt there (it is
judged at its marker import).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack's Watching calls no `beforeRun`, so the ledger that reports a custom
server fn id's error once per run across environments was reset only before
the first build: a rebuild with the same invalid id emitted its assets. The
client's `watchRun` starts a run in `build --watch`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The allowed edge module re-exported the dependency's source entry (the path
facts are read from), which Vite serves as it is: a CommonJS package had no
named exports in the browser, an ESM one loaded a second copy. Its request
now resolves to the optimizer's bundle, as the importer's own import would.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A denied file is real for an exempt importer, decided from the importers'
indexed edges when it compiles. With a persistent cache the unchanged
importer is restored and its edges replayed at `finishMake`, after the
edited file compiled as its own mock: the exempt importer got the mock,
unreported. After the replay, a module compiled as its own violation that
an importer now allows is built again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack escapes a project path's `#` and leaves a fragment raw; the id
unescaped both, so `./secrets.ts#x` was a file without a language: never
compiled, and no file or marker rule judged it. The fragment is dropped
before the escapes are undone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`x.ts?inline` (Vite and Rsbuild) and, on Rsbuild, `x.ts?url` and
`x.ts?sharedworker` are the file's code, but one asset-query set made them
assets: never compiled, so server fn handlers and denied imports shipped.
A script's asset queries are now Vite's (`raw`, `url`, `worker`,
`sharedworker`; `isAssetId` for 'not code'), the Rsbuild host folds the
script queries Rspack ignores out of its ids, and its graph view and witness
look modules up by those ids.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A boundary inside a helper that two boundaries render lands in a chunk the
outer hydration chunks import statically; the route's manifest entry now
walks a hydration chunk's static imports for boundaries, as it walks the
route's own chunks (SPEC J5.7, R3-G11-3; Vite).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An unsplit component option records an import as <specifier>#<export> (a
same-named import from another module is another component), and an inline
value is hoisted and recorded, or a split chunk marked, only when React
Refresh registers it (a function or a higher-order call); a conditional or a
member is swapped. The split marker is written only on a value that can hold
it. SPEC J3.2/J3.3 (R3-G9-1, R3-G9-3).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every summary built hashed every export (canonical JSON + SHA-1), read
or not: a 2,000-icon barrel digested 2,000 exports for importers that
read a few. exportKeyOf() keys an export on its first read and keeps the
key in the summary; summaryDigest() keys them all, for a listing's
fingerprint only. A known package's synthetic summary stays eager.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A lookup that walks a module's export * list records it in the module's
exports record instead of a stars record of its own (it always looked the
name up there first); an empty list is one shared array. Publication
shares name lists only when the plan read more than one module, and
sizes each key list once (a pushed array keeps room it does not use).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Named and default imports, in dev and in Vite and Rsbuild production builds:
both options render, and the page's code ships once with the route module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The split children receive a capture's value when the boundary renders; a
function in them reading a let the component reassigns would read that
snapshot. The build fails at the read, naming the variable and suggesting
useRef (R123). Solid keeps its getter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ref={el!}, ref={el as T} and ref={(el)} on a captured let bind the parent's
variable, as ref={el} does (Solid's JSX transform unwraps them).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Solid <Hydrate> chunk rewrites a captured local called at a statement's
start to (0, props.x)(…); without a ; before it, code without semicolons
continued the previous statement. The ref cut now takes the guard edits take.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`!!./x.server.js` and `-!./x.server.js` failed to resolve as written, so no
file, marker or specifier rule judged them, and they disable the target's own
`pre` loaders: the real module shipped unreported. The Rsbuild host's import
rewrite gives the request's last segment, and the specifier rules judge the
rewritten specifiers too (as main judged the module Rspack loads).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A child compiler (a worker or service-worker plugin's) takes the module rules
of its environment's compiler but none of its plugins, so the loaders found no
implementation and passed every module through: server fn handlers and
`.server` modules shipped in the worker. The loaders read the implementation
from the compiler's `root`, and the server-fn replay includes the modules of
the child compilations, so the server serves the functions a worker calls.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A worker built by a child compiler of the client (a worker or service-worker
plugin) bundles its imports as written: no server fn compile, no import
protection. Pins the import protection outcome a child compiler cannot reach
today (its virtual files).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A route the tree creates for a lazy file alone has no recorded options
(props undefined: nothing read); discovery skipped it as having no component.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A batch that fails while writing route files or the tree no longer leaves
getTreeModel() (Start's client route tree) ahead of the tree on disk and the
route registry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A missing file named by virtualRouteConfig or a __virtual.ts subtree fails the
run naming it, as on main, instead of dropping the route and re-parenting its
children to the root.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Route pieces: router-generator's `routeOptionPieces` (and `routePieces`,
with `lazy`) is the one list; the generator's piece checks, the piece
regexp, the parent-candidate skip, the deprecation warning, the suffix
escapes, `isRootRouteFile`, `getRouteMeta`, `FsRouteType`/`RoutePieceName`
and the printed component order read it, router-plugin's
`splitRouteIdentNodes` is it, and route HMR's keys derive from the
splittable component options.
- `derivedIdOf(output)` (core) replaces four `slice('derived:'.length)`.
- `isExpressionWrapper` is the one seven-type wrapper list: `unwrapExpression`,
the units' member climb and start-env's server-fn chain hop use it.
- The router planner's "not created by a route factory call" warning is
built once (each site keeps its condition).
- start-plugin-core: one `escapeRegExp`; `ViteStartEnvironment` extends the
session's `StartCompilerEnvironment` (the Vite plugin's inline copy goes);
`NODE_MODULES_RE` for the normalised-path checks; the import-edges
planner's `isAppFile` is `isSourceModule` (no package, not virtual), apart
from the reports' `isAppFile` (under the root).
- router-generator: one rename loop in `bindConstructor`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- `TanStackStartCoreOptions.ssrIsProvider` (and its copy on the Vite core
options) goes: the Rsbuild host stopped reading it, and every framework
plugin set it to "the provider environment is `ssr`", which the Vite host's
compiler state already derives from `providerEnvironmentName`;
`buildStartViteEnvironments` derives it the same way. The framework plugins
stop passing it.
- The Vite host's `clientBuilt` flag folds into `clientFiles`: null until a
client build ended in this process, then the files of its module graph in
`build --watch` (none otherwise). The server-before-client check and the
watch-mode resolver read the one field.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- OutputBuilder.copy's nested edits (BuilderEdit, BuilderEditPart,
assertSortedEdits): no compile path passed them; the map test splices the
same output through copy/text as emit does.
- PlanCache.values() (one test read it; it now reads the plans through
keysAt/get), the dependents index's emptyPaths stat (0 by construction:
empty buckets are removed).
- Unit.importedName, DependencyLedger.generation, ExportFact.noSideEffects,
Roots.pins, EdgeRecord.typeOnly (always false; import-edges tested the
constant), RefContext 'importLocal' and the 'info' diagnostic severity
(never produced).
- SymbolTable's null-file branches (its one construction passes a file);
statementRecipe's default arm becomes the explicit 'single' case (one unit:
kept at all, it is kept whole).
- start-plugin-core: buildTrace (tests compose traceOf/cutTrace as
violationInfo does), ImportProtectionEnv.unchecked becomes a local of
surviving().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
invalidate() maps every fingerprint of every dependent it checks to a
path; identify() parsed the whole id for it. pathOf() cuts at the first
'?', which is identify()'s path for every id (splitQuery).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start builds (Vite, Rsbuild): an exported server fn next to one the route
module keeps, two split chunks each reading one, a Hydrate boundary of a
plain module reading two exported ones, an exported function creating one
(the chunk copies it). Red at 770d624a14 for the kept + exported route and
the Hydrate module (the same self-check failure). Core: the env module and
an extracted module, two chunks with no shared module, a copied function
export carrying the import, an unread generated import dropped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each export's module imports the server-fn stub's runtime itself. A guard
here; red with the server compile's builder-chain purity (the SSR caller's
tsrSsrRpc) without the placement fix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A planner's import-only generated unit (Start's client stub
createClientRpc) was a 'gen' cluster, never copyable: two extracted
modules reading it got it homed in the route module and imported it from
there, a read of the route module at their evaluation (verifier rule (e);
the server-functions e2e app's client build failed with the self-checks
on). It now clusters like a source import specifier: each output reading
it imports it from the package itself, and one nothing needs is dropped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red: each extracted module reads the client stub's createClientRpc from the
route module at its evaluation (the server-functions e2e app's client build
fails the compiler's self-checks on Vite and Rsbuild).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI's e2e apps now compile with TSR_COMPILER_VERIFY=1: the output verifier,
the internal asserts and the placement invariants throw instead of
warning, so a compiler bug an e2e app reaches fails the run.
- pr.yml sets it on the test job; .nx/ci-config.yaml forwards it to the
Nx Cloud workers (`workers.with-env-vars`: only NX_* variables are
forwarded otherwise). Playwright's webServer and the specs that spawn
their own servers inherit process.env, so dev servers get it too.
- A `compilerSelfChecks` env input on the e2e tasks and the e2e/example
app builds (nx.json target defaults, the Playwright plugin's inferred
targets, the streaming-ssr apps' own inputs), so a result from a run
without it is not replayed as verified. Package builds keep their hashes.
- compiler-platforms.yml's production builds of the e2e app run with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
formatUncheckedImporters printed "Denied by marker pattern: undefined"
for a module denied by its server-only/client-only marker. It now prints
the violation reports' own deniedBy line (the marker import and its line).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BuilderPurity.factories and .namespaces were keyed by local name, on the
premise that the checks only read module-level code. Since a client
compile's planners take the builder purity, orphan removal consults it in
function bodies too, where a parameter or local can shadow the factory: its
call was taken for a pure builder and dropped with its effects. A callee
named like an imported factory now counts only when it refers to that
import's binding (the name stays the cheap first test).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server compile now takes builder purity too, so each compile scanned the
module's imports twice (Yuku decodes a record's fields on every read) and built
both environments' contexts to keep one. The constructor notes the factory
imports with the pure-call imports; a compile builds its environment's context
only, `effects()` both from the same scan.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
unplugin's esbuild adapter calls esbuild.config and no watchChange, and the
generator plugin had no esbuild start hook, so the esbuild entry never
generated the route tree. It now runs session.build() from esbuild's
onStart (esbuild.setup: a shared buildStart would also run in Vite and in
every webpack/Rspack compilation). The docs say esbuild only rebuilds for
files of the bundle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Solid's ErrorBoundary wraps a thrown value that is no Error in one (its
cause), so hmrReloadAfterCatch's identity check missed a loader throwing a
string, a Response or a plain object, and the next route edit reloaded the
page. The check also accepts the caught error's cause, and ignores matches
without an error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RawFactsCache kept the prior facts of a file that held a module and read
empty after readSaved's retries, so a file emptied on purpose kept its
marker and exports for its importers until it held text again. The retries
cover the in-place save (truncate, then write). The marker read keeps
routing an empty read to get(): a file event checks importers' markers at
once, maybe while the file is still empty, and that read needs the retries.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ledger kept one export record per name read (an id string, a Map entry
and a path lookup each) and folded them at publication. It now records a
read into its module's name → key map, so a lookup through a barrel costs
one map entry per (module, name) and one path lookup per module. The
per-name fingerprint kind is gone; the snapshot validation checks the
published form.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A published plan kept one export fingerprint per name and module a lookup
read; through a barrel that is names × star targets (695 per plan on a
synthetic design-system app, 130 MB retained for 2,000 plans). The ledger
still records each name; publication folds a module's names into one
`exports` record: the sorted names (one list shared by the star targets
a lookup visited for them) and their export keys, or no keys when the
module exports none of them. Validation compares them with the current
summary's, so the same plans re-plan on every edit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`startCompilerPlugin` was one closure holding the per-environment compiler
plugins, the late pass, the server-function lookup, forward and resolver
plugins and the state they share. That state is now one explicit
`ViteCompilerState` (`compiler-state.ts`), and the plugins and helpers move
to `invalidation.ts`, `handler-reach.ts`, `late-pass-plugin.ts` and
`server-fn-plugins.ts`; `compiler-plugin.ts` keeps the environments'
compiler plugins. In `tanStackStartRsbuild`'s setup, the Rsbuild config
step moves to `rsbuild-config.ts` and the RSC steps (layer rules and native
plugins, the manifest placeholder replacement) to `rsc.ts`, their
plugin-lifetime state in an explicit `RscState`. Moves only; no logic
changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`index.ts` re-exported 20 modules whole, so the subpath also exported the
core's own helpers (218 names). It now lists the 127 names that the planner
packages, the hosts and their tests import, plus `PlannerData` and
`PlannerServices`, which planner packages augment. The hosts barrel it
re-exported is gone. Names only the core's own tests use are imported by
those tests from their files, as `cache.test.ts` and `rewrite.test.ts`
already did.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The planner contract passed four untyped bags (`CompileConfig.perPlanner`,
`PlanContext.prefetched`, `PlanFacts.planners`, `HostServices.services`),
read back through casts at each site. A planner-keyed `PlannerData`
interface (module augmentation, declared next to each planner) now gives
each planner's config, prefetch result and facts their types by name;
`Planner<TName>`/`PlanContext<TName>` carry them, and `PlannerServices`
types the host services (`importRewrite`). No runtime change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
React's default import is its CommonJS exports: `RecognizerTable.pureDefaultNamespaces`
(the router planners' table lists 'react') makes `React.memo`/`forwardRef`/`lazy`
of `import React from 'react'` pure calls, as for a namespace import. Vue and
Solid have no default export.
The planners' purity takes Start's builder chains in the server compile too
(`ModuleAnalysisOptions.env` replaces `clientBuilders`), so both environments
home a builder alike: an isomorphic fn only split code reads loads with the SSR
chunk (no `eager-split:order` from the SSR build), and a server fn nested in a
function may take a builder chain in its options in every environment. A
builder is one instance per environment (call results are never copied; the
provider copy is unchanged); a link on a `const` builder stays an effect.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Red before the fix: React.memo/forwardRef/lazy of `import React from 'react'`
keep the component in the route module; the SSR build keeps an isomorphic fn
only split code reads (eager-split:order) and refuses a nested server fn whose
options are a builder chain.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One case per edit kind (added, removed, changed and unread exports, a star
target gaining a name, stars added and removed, a body edit, a namespace
member): the importers each edit re-plans, compared with a fresh session.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The control aborted the page's first request outside the case
directories. When the file got a host an earlier file of the same test
process gave back (ten files share the default host), the page had
loaded the app's shared modules already: no such request came, the
route never fired and the test failed on `expect(failed).toHaveLength(1)`
(1 in 3 full test:unit runs on the integration branch). The cases now
share a module of a case of their own, which no earlier run requested.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server compile is unchanged by design (an isomorphic fn stays in order
there). Rspack copies a small module two async chunks import into both,
under one module id its runtime evaluates once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The planners' purity of a client compile takes the recognizer's builder
chains (the rule raw facts already use per environment): a page-only
createServerFn()…handler(…), createMiddleware(…).client(…) or
createIsomorphicFn() chain with pure arguments loads with the split chunk.
What the client compile erases does not count. A link on a const holding a
builder stays an effect (a middleware's links write the receiver's
options); the server compile is unchanged. A builder keeps one instance:
call results are never copied into client outputs. Also: memo(Inner) with
Inner.displayName splits (router-plugin test).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A page-only createServerFn()…handler(…), createMiddleware(…).client(…) and
createIsomorphicFn() chain above an inline validateSearch call should load
with the chunk, unreported, one instance (two split options reading one
middleware share one module). A link on a const builder and a chain with
an impure argument stay effects. Fails today: every chain stays eager.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The compiler's placement invariants (an effectful cluster homed in the env
module but not live there, an identity or state declared in two outputs, an
extracted module reading a kept binding at its evaluation) ran only when
NODE_ENV was not production, so a build shipped a violation silently and dev
crashed with an internal message.
They now always run. One switch, TSR_COMPILER_VERIFY=1 (already set by our
test setups, read once in self-checks.ts), makes a violation throw; otherwise
the module gets one [tanstack-router]/[tanstack-start] warning saying it is an
internal compiler error, what may be wrong, and to report it. The duplicate
scan counts holders in one pass and judges only clusters held twice. The
output-builder and symbol-table asserts, unreachable outside tests, run in
our tests only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The known-pure call table (RecognizerTable.pureCalls) moves to its own
planners module (knownPureCalls, shared by the router plugin's session and
Start's recognizer) and gains the frameworks' component wrappers, each read
in the framework's source (development builds included): no side effect, no
state, none of its arguments called. createContext, refs, React cache,
reactive state, markRaw, h and defineCustomElement stay out. The order rule
gets a comment on what relaxing it would gain and risk. Docs and changeset.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The isomorphic-through-helper pin and the Rsbuild first-server-fn pin
fail an explicit assertion on their bug's error; any other failure fails
the pin as an error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
waitForOutcome's problems and quiet-final-state failures are
expected-vs-actual checks: AssertionErrors with actual/expected (the
route HMR page helpers pass the page's text and the expected one). The
overall timeout stays a plain error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A decorator on a constructor or method parameter (TypeScript
experimentalDecorators, as dependency injection libraries use them) runs
when the class is defined, like one on the class or a member, which already
made the class effectful. The class counted as pure: only the split
component needing it, it moved to the chunk past the effects after it.
KNOWN-BUGS' parameter-decorator entry names the new test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`switch` compares by `===`, so a function used as a `case` label (or as
the switch value) is a sentinel like one compared with `===`: a chunk now
imports it instead of copying it, and an importer of the route file passing
its instance matches the split component's comparison.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The text heuristic read the characters around a function to tell whether it
is called where it is written. It missed callees through `as`/`!`/
`satisfies` followed by `.call`, and `.bind(…)()` (the body counted as
lazy: a read of module state moved to the chunk and saw a later value), and
took a block-bodied arrow followed by a line starting with `(` (two
statements without semicolons) for a call (its body counted as eager: the
function was pinned in the route module with a warning). One parent-based
check now covers every function scope: a call, `new` or tagged template
callee, through value wrappers and `.call`/`.apply`/`.bind(…)(…)`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
React memo/forwardRef/lazy, Vue defineComponent/defineAsyncComponent and
Solid lazy above an inline validateSearch call: the component they create
should load with the split component, unreported. An impure argument and a
local function of the same name keep the call an effect. Fails today: every
such declaration stays in the route module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps start-dev-route-error-recovery within the per-file budget; the
apps both files use live in route-error-apps.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rollup and esbuild read the annotation before a `const` statement (or
around its `export`) as its first declarator's when that declarator is a
function; the compiler read it only before the initialiser, so a route
annotated as the Rollup docs show kept its declaration eager and warned.
Same-file callees only, as before. Docs list the accepted placements.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- an IIFE through `.bind` or `as` + `.call` reads the state at load (wrong value today)
- a block-bodied arrow followed by a parenthesised statement (no semicolons) is not called at load
- `/* #__NO_SIDE_EFFECTS__ */` before `const`, `export const`, `export /*…*/ const`
- a function sentinel used as a `case` label keeps one instance
- a class with parameter decorators keeps its decorator before later effects
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In a Vite build the compiler reads a virtual module's raw text through
this.load, which settles once the module's transforms (Start's compile among
them) are done: a virtual module marked server-only (its own compile reads
its text) or virtual modules importing each other hung the build. Every wait
of a compile on a virtual module's raw facts now goes through an optional
HostServices.awaitVirtual; the Vite build host keeps the waits of compiles of
virtual modules per environment and fails the wait that closes a cycle,
naming the modules (a wait answered from the cache, as in build --watch,
settles before the check). Docs and KNOWN-BUGS updated; changeset for the
lane's fixes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The emitter counted generated and original lines at every ECMAScript line
terminator (lone CR, U+2028, U+2029 too); webpack-sources splits at LF only,
so after a raw U+2028 in a module every mapping was one line off on
webpack, Rspack and Rsbuild. CompileInput.lines picks the model of the map's
consumer; the router plugin's webpack/Rspack loader and Start's Rsbuild loader
pass 'lf'. Vite keeps the ECMAScript count.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
invalidateFileEvents keyed lastEvent by the path Rspack reports (native,
backslashes on Windows) while rebuildDependents records the plans' forward-slash
paths, so on Windows a synthesized change of a stale dependent was invalidated
again as a new event (plans evicted in every environment). Both sides now use
the path as compiler keys hold it, normalised once per event.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rule compiling a Vue SFC's script block under vue-loader's inline match
resource was added only when a plugin named VueLoaderPlugin was in the final
configuration and Start's late rule was found again by its first loader; a
subclass, a fork or a reordered config left the block uncompiled and its
server code in the client, silently. The rule now sits next to the late rule
in every environment's configuration: only vue-loader requests such a module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server's server-fn manifest lists the functions the client build
references, which only the client's compiles record: a server built first
(an app plugin's buildApp, a hand-written createBuilder().build(ssr), two
processes) built green and answered no client call. The resolver now fails
the build, saying to build the client first (plugin-rsc's write: false scans
excepted).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A loader or beforeLoad error the router holds on a current match no
longer arms _hmrReload (hmrReloadAfterCatch, called by the React and
Solid boundaries and Vue's route boundary): the boundary resets when the
match loads again. Vue's global boundary keeps reloading: Vue cannot
render a document shell again once the boundary replaced it (the test
expects that reload).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
relativeRoot matched pathe for the drive-letter case (57751bc294) but not
for a module on another drive than the root: main printed and hashed
`D:/lib/fns.ts`, the PR `../../D:/lib/fns.ts` (default id, serverFnMeta.filename,
generateFunctionId's filename). Use pathe's relative, main's own call.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- a Vite build of the server environment before the client (an app plugin's
buildApp) builds green and serves no client call
- a VueLoaderPlugin subclass leaves Rsbuild script blocks uncompiled (server
code in the client)
- webpack/Rspack: a throw below a raw U+2028 maps one line too low
- Vite build: a marked virtual module, or two importing each other, hang
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vitest inverts any failure of a .fails test, timeouts and harness errors
included: a finished-test hook clears the flag when no AssertionError was
recorded, so such a pin is reported as the failure it is.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The session refreshes the watcher's targets after every run, the first
one included: a dev server or tsr watch that starts with an up-to-date
route tree writes nothing, so no event used to add the mounts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An editor that truncates then writes may be reported once, while the
file is empty: re-read it for a moment (Vite's readModifiedFile), and
keep the last facts while it stays empty, like a file that stops parsing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Regression test: an editor that truncates then writes gets one watcher
event while the file is empty; the importer compiles against no exports
and the handler's imports reach the client.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- fix stale changesets: Rsbuild peer range (rspack falsy use), Rsbuild
now prints the custom-id deprecation warning, template-literal route
ids are rewritten (computed ones reported), routeTree.gen.ts formatting
is a one-time diff only when the file is formatter-ignored
- add behaviour changes: React <Hydrate> member hook calls refused, two
Vue <script setup> shapes newly refused (and <template src> in Vite
production), nested server fn capturing a local fails in every env,
deleteNodes without autoCodeSplitting, kits under dependencies excluded
from the Vite optimizer
- compiler README: planner gates run on the Tier 0 tables, after the parse
- TODO marker for the physical() mount watching wording
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Start host keeps a page's document from one run to the next, and
Chromium keeps a failed module fetch in the document's module map. One
net::ERR_NO_BUFFER_SPACE on the Windows x64 runner then failed every
later case of start-compiler-preserves-user-code.test.ts that imports the
same module (18 tests), without a request. The host now records a page's
transport failures (not aborts) and reruns a failed run on a new page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route generator writes its temporary files to .tanstack/tmp. Each
Start example now ignores the directory on its own, as a project copied
out of the monorepo (whose root ignores **/.tanstack). The five without a
.gitignore get start-basic's entries.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The temporary directory is created again when it is deleted under a
session, so a directory git does not ignore is harmless. Removes the
once-per-process `git check-ignore` at a watch session's start, its tests
and its mention in the docs and changeset.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A request whose server modules are still being evaluated when an edit
reloads the SSR environment renders a broken route tree: Vite's module
runner clears its evaluated modules under the import in flight, which then
takes its later route modules from the new generation, shared with the
requests after the reload; each route tree's update() re-parents them, and
the in-flight request's router has a route whose parent it never
initialised (404 here; "Duplicate routes found with id: undefined/$itemId"
in the burst research's F2). Upstream (Vite 8.3.4 to 8.3.7); main runs the
same request path.
The pin stalls the first request inside the route tree (a top-level await
gate), reloads SSR through an edit of a module only the server entry
imports, sends a second request, then opens the gate: both must render the
page. A control runs the same overlapping requests without a reload.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dev server or watch session in a git work tree checks, once per process,
whether git ignores tmpDir (.tanstack/tmp by default) with one
`git check-ignore`, and names the line to add to .gitignore.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A git operation that deletes a route and writes the committed route tree
made the generator print the last scan's routes before the delete's event
came (chokidar reports it ~100 ms later): the tree imported the deleted
file, and SSR failed for that window.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The check that skips following a namespace of an unreadable module read the
whole summary, so every importer reading members of a project namespace
depended on all of its exports again. `ExportResolver.readable` records the
module only when it has no summary; the member reads that follow record
what they read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coverage for the facts version: a registry change no invalidation reports
(Vite build --watch) makes the plan stale on its next hit, and a `retain`
drop moves the version.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coverage for A3 (an element before a fragment, two classic bindings), A2
(builder purity of a factory imported under another name) and A11 (a marker
scan overtaken by a change does not publish `markerless`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A lookup of an export records `{ kind: 'export', name, key }` (the digest of
that export's fact, `ModuleSummary.exportKeys`; null when absent), and the
`export *` list when it walks the stars. A listing of a namespace's exports
and a module without a summary keep the whole summary digest. Adding an
export to a widely imported module, or changing one an importer doesn't read,
no longer re-plans its importers (large app, `lib/format.ts` append: 3,617 +
3,683 dependents -> 0). The new kinds are raw-facts fingerprints, so they fall
under the facts-version skip. `RawFactsCache.digestOf`, now unused, is gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The soft invalidation of an unchanged dependent cascades to its importers;
done inside the worker pool, it reached dependents whose transforms were
still in flight, Vite dropped those results, and each was compiled again.
The invalidations now run once every dependent's transform ended.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dependents that import each other, compiled at the same time after a factory
re-export changes, were each compiled twice.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`FileState.content` held every route file's text for the whole session
(3.6 MB of 9 MB on a 1,485-route app); it was only read to tell an unchanged
file and to guard upkeep writes. The state now keeps a SHA-1, and the text an
upkeep write is guarded against only while that write waits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every batch listed the route tree's files and mapped every route file to an
async closure before knowing whether any write was pending.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host knew the optimizer's bundles only by `/node_modules/.vite/`. It now
takes the cache from Vite's resolved `cacheDir` (transform filters and the
session's opaque test) and asks the optimizer (`isOptimizedDepFile`) when
mapping a bundle back to its package entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With `cacheDir` outside `node_modules/.vite`, every optimizer bundle reached
Start's main transform and was compiled as an app module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`changedDependents` compiles a dependent again to compare its output; that
transform could hide another file's hot-update invalidation from Vite's SSR
module runner, which then kept its failed evaluation of a file that is back
(e.g. after `git stash pop` restored several files). An unchanged dependent is
now invalidated again, soft and non-HMR: its next request reuses the
transform, the page gets no update, and the runner evaluates it again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restoring several files at once after SSR failed to load one of them left
Vite dev's SSR runner on its failed load (the v2-edits.test.ts flake).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`changedDependents` compiled each dependent of a file change one after the
other; an export added to a widely imported module re-plans every importer,
and their file reads and resolution turns now overlap. The pool is bounded
(128) so the modules in flight stay few; the result keeps the dependents'
order.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a rebuild, the import-protection replay and the server-fn snapshot share
one pass over the compilation's modules.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The emitted-maps hook keys each map's fill on its chunk's hash (which covers
the module maps in Rspack and webpack) and the texts it used, so a map whose
chunk did not change is neither read nor compared. The fills no longer keep
every map's JSON.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`RawFactsCache.version` moves on every `markStale`, `forget` and dropped
`retain` entry. A plan validated at the current version (`factsAt`) is not
asked about its facts again; resolutions keep their `fileSetVersion` rule and
route-registry digests are always checked. The hit path and the snapshot
validation share one filter (`fingerprintsCurrent`).
A dependency missing when a plan read it is now seen again at the next facts
version move rather than on every hit, so Start's Rsbuild host also records a
missed read of its `.virtual/` modules, which `forgetMisses` marks stale at
the next compilation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- `Renderer` no longer builds `refByStart`, which nothing read; `renderDerived`
computes each item's included units once.
- Source edge records share one frozen `{ origin: 'source' }`.
- `buildItems` keeps a cursor into the comments instead of rescanning them
for every item (quadratic in a file with many commented items).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`RawFacts.rawRevision` had no reader outside tests, and `markerless` only
needs to be a boolean: two SHA-1s per raw read are gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The analysis constructor no longer classifies statement effects on every
compile; `ModuleAnalysis.effects()` does it, and only `RawFactsCache` calls it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A `.ts` module has no JSX, and when an element and a fragment read the same
binding (no pragma with a `React` binding, or classic without `@jsxFrag`),
the first one found answers. The result is the same set.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A namespace import of a module without a summary (an opaque package such as
`import * as React from 'react'`) has only unknown members, so prefetch no
longer climbs its references or asks for each member's value.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An import whose value is a finished server fn, middleware or env-only result
(also through a factory's return) no longer makes the module start-env's: a
call, member read or pass-on of such a value adds no chain, candidate or
escape. Outputs are identical.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A resolver that throws couldn't resolve the specifier (ruling "Resolver
errors in import protection"): the next compile no longer fails, the
bundler decides on the import, and this client drops it (only the handler
reads it). The dev server still survives the invalidation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite's resolver throws for a package with no export for the environment's
conditions (e.g. only `node`, on the client), and Start's compile failed
on it, even where the client keeps the import only as a type and the
TypeScript transform erases it. The Vite host now answers null for a
failed resolution, as the Rsbuild host already did: import protection
skips the file and marker rules for the import, specifier rules still
apply, and the bundler decides (it fails on its own if it keeps the
import). describeTarget's own catch is superseded and removed; the core
documents the host contract.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An app module importing a package with only a `node` export: a client
remainder used only as a type builds without the package, a kept import
fails in the bundler (whole, or with verbatimModuleSyntax), a specifier rule
still judges it, and a denied file behind a resolution the compile could not
make is still denied when the bundler loads it. Vite and Rsbuild builds,
Vite dev.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Vite rename flake (404 on /src/routes/renamed.tsx) was the test's, not
a stale route tree: the tree is published before any request needs it, and
every request after it gets the renamed route.
- A visit waited for the server-rendered text, not for hydration: the
page was still fetching its modules (under the old tree) when the test
renamed the file, and one came back 404. The visit now waits until the
page hydrated.
- A page Vite's client was told to reload keeps handling messages until
the next document commits; the update Vite sends ~100 ms later for the
deleted route module could 404 there. `errorsOutsideReloads`
(compiler-test-utils/hmr-sync) leaves out a document's errors after its
reload was announced; errors before it and in the next document count.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
start-build-builder-shapes (46 s at CI's shape) runs one file per bundler
(`start-build-builder-shapes-cases.ts`, as `hydrate-build-cases.ts`);
route-hmr-browser-kept-binding (56 s) one file per webpack-style host
(Rsbuild, webpack, webpack with source maps). Every test and full test name
is unchanged; the Rsbuild and webpack rows moved to the new files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The run-page pool and its browser context lived as long as the test process:
in router-plugin's pages files every renderer grew to ~850 MB and the browser
held 1.8 GB of shared memory by the last file (8.4 GB per process). The pool
and its context are now the test file's, closed once the file ended
(`onFileFinished` of `./test-scope`, run by `./test-scope-setup` after the
file's own hooks); the browser stays for the process.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`sourceEdges` dropped an import whose statement start the output erases.
An output that keeps only some specifiers of an import replaces the
statement with a DCE edit that prints `import ` as text around slices of
the kept specifiers and of the source's specifier, so the statement start
read as erased: the import's edge was dropped while the bundler still saw
it. Import protection judges and substitutes edges only, so a denied
specifier (`@tanstack/react-start/server`, a configured package) shipped to
the client unreplaced and unreported, in mock and error mode, dev and
builds. A `.server` file was still mocked as its own violation, but
reported with no importer on a Vite dev server.
An import or re-export is now an edge where its specifier renders, the
text the bundler resolves and a substitution replaces. A whole import
renders it as written, a partly kept one through the DCE edit's slice, a
pruned one not at all.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- router-utils `edges.test.ts`: a mixed `type` specifier, string-named,
commented and `assert`-attributed partly kept imports; a whole and a
partly kept statement of one specifier (one edge, both substituted); a
route module and its split chunk each keeping part of one import.
- start-plugin-core partial-prune: a second import of the binding the first
keeps (both get the one mock); a kept specifier used only as a type (no
report); a client-only file partly kept on the server (a control: the file
is its own violation), mock and error builds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An import whose other specifiers the client prunes (one read only in a
server fn handler, a route's `server` option, a `<Hydrate>` boundary's
children) ships to the client unjudged: no mock, no report, and
`behavior: 'error'` builds. With `@tanstack/react-start/server`, a Vite
build ships the real server runtime and an Rsbuild build fails to link.
- router-utils `edges.test.ts`: named, default + named, named + default and
default + namespace imports whose other specifier the output prunes stay
an edge, substituted.
- start-plugin-core `partial-prune-{build,dev}.test.ts`: Vite and Rsbuild,
builds and dev servers, `mock` and `error`. Cases: the review's repro
(`getCookie`/`setCookie`), a configured denied package with named,
default and namespace forms, a `.server` file, a `<Hydrate>` boundary, a
route module and a split chunk; a re-export next to a pruned import, the
`.server` file and the split chunk are controls.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One gate (annotationFrees / annotatable) for every annotation hint: a
call or `new` whose arguments are pure, the purity model's own rule for
an annotated call. Other initialisers get only the move.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R101 (openstory release check F1): a template-literal initialiser, or a
call whose argument has effects, gets no annotation hint for any kept
reason (needers, written, reads, exported effects, order); a call or
`new` with pure arguments still gets it, and applying it removes the
warning. Real builds: openstory's template-literal links are reported,
and their own-module fix is silent and loads with the chunk.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pins G3 / R29-R31 for top-level writes: `let calls = seed()` and
`let calls = 0; calls = seed()` (and `+=`) run once, at the same time,
with the same value and reports; a pure write runs nothing. Vite, Rspack,
webpack and Rsbuild builds, the Vite dev server, and Start handlers on
Vite and Rsbuild.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each manifest entry keeps main's key, functionName and importer (or
module) as a byte-identical prefix, then lists exportName. The file tag
and the provider wrapper's name move to server-fns/format.ts (fileTag,
providerExportBase); start-env.ts passes the tag to the wrapper names and
to the core's tagGlueExports.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Back out the hook-level `order: 'pre'` of the compiler transform: it also
put Start ahead of other `order: 'pre'` transforms such as devtools-vite's
source injection, which then stamped positions of Start's per-environment
output (React hydration attribute warnings in dev with `tanstackStart()`
listed before `devtools()`).
Instead, Start's Vite host refuses `vite-plugin-solid` listed before it,
with the order to use, as main did through router-plugin's code-splitter
check (which Start no longer installs). React's and Vue's plugins
transform after Start's in either order and need no check.
Tests: the refusal in Vite dev and build, the suggested order working
for Solid, Start last working for React and Vue (dev, build) and for
Solid on Rsbuild.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Another plugin added it" fired for an importer outside the scope, for a
real glob the tokenizer missed (a quote in JSX text or a regular
expression), for a require() with a variable path (a webpack context) and
for an importer behind a virtual module. It now needs a checked importer
that imports the file directly and whose raw text holds no pattern-like
call at all; an unchecked importer is named as such, with the fixes of an
unchecked importer. The suggested fix is one that applies: keep the plugin
from adding the file and import what is needed inside createServerFn /
createServerOnlyFn (createClientOnlyFn / <ClientOnly> on the server).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lazy handler module imports module state its handlers read back from
the user's module, which exported it under its own name (`store`): two
such modules behind one `export *` barrel exported it twice. The core
gains `tagGlueExports(tag)` (glue export names `<base>$<tag>`); Start
calls it with the file tag the wrapper names use, only for an in-place
provider whose handlers move to the handler module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lazy handler module imports such state back from the module, which
exports it under its own name: `store` behind one barrel fails the Rsbuild
build and warns on Vite, as the wrapper names did.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The changeset said 404; the server entry answers 500 with
`Server function info not found for <id>`. Say plainly which apps this
breaks, and that manifest entries now also list their export.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An in-place provider exported `<name>_createServerFn_handler` next to the
user's own exports, so two modules' server fns of the same name behind one
`export *` barrel exported one name twice: Rspack failed the build with
conflicting star exports, Rolldown warned and dropped both. The export now
carries a tag of the file (`$<8 hex of sha1(rootRel)>`). The manifest keeps
main's `functionName` (handlerFunctionName) and lists the export it reads
as `exportName`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
API objects with the same property names in two modules, and unexported
server fns of the same name, behind one barrel: the Rsbuild build fails
(conflicting star exports of the generated handler names) and Vite warns
(NAMESPACE_CONFLICT). Dev servers and RSC builds are covered as guards.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start's compiler transform is ordered `pre` at the hook level, so it reads
every module before the framework plugins' own `pre` transforms wherever
the app lists `tanstackStart()`. With Start after `vite-plugin-solid`,
Solid's dev hot-update wrapper turned each route component into a call
before the compiler saw it: the dev client kept components in the route
module while SSR split them (hydration mismatch, route edits reloading,
server fn calls failing). main refused that order through router-plugin's
code-splitter check, which Start no longer installs.
Tests: Start listed after the framework plugin, Vite dev (Solid, React,
Vue), Vite build (Solid, React) and Rsbuild dev (Solid): the route splits
in the client, the page hydrates, a route edit applies in place.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A late-pass module the compiler cannot parse fails the client build only
when the bundler's own parser takes it as its module type (a plugin
handing TypeScript over). Text no JavaScript parser accepts is another
plugin's input (Markdown a later plugin compiles) and stays the bundler's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Raw Markdown mentioning a router package fails the client build since a
late-pass parse failure is reported: a plugin after Start's late pass
compiles it, so the late pass sees text no JavaScript parser accepts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A type-only import of the module itself (`import type { Props } from
'./route.tsx'`) is erased by the bundler; check (b) read it as glue naming
an export the env module lacks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A manifest decides more than the files next to it: its `imports` may name a
target outside its directory. For a package.json add or change the shadow
pass asks again every resolution of the plans under that directory, as it
did before it asked only the resolutions the new file may take.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since an add asks again only the resolutions whose found path it may
shadow, a nearer manifest that changes what `#foo` names leaves the plan
in place: the target it found lies outside the new manifest's directory.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The config validation and the planner each had their own copy of
`splitRouteIdentNodes`; both read it now, and the component options derive
from it. The groupings shape message has one owner too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An add re-validated every resolution of each plan under a path the new
file may shadow; it now asks only the resolutions whose found path it may
shadow. Under Yarn PnP, Rspack's resolver answers nothing from Yarn's
global cache at a compile's start, so asking a package module's unrelated
imports made its plan stale (release check F1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nx Cloud DTE runs each slow tier on one 2-vCPU agent with one Vitest worker,
and start-plugin-core's tier is the PR run's critical path. `test:integration`
is now an `nx:noop` over `test:integration--shard-<i>-of-<n>` (Vitest
`--shard`, 4 for start-plugin-core, 3 for router-plugin), the pattern of the
Playwright shards: DTE spreads them over the agents it already starts.
`test:integration:whole` runs the tier in one Vitest run, for file filters and
budget measurements.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A denied file reached through an import a later plugin's transform added
(an auto-import) was reported as matched by a pattern import, with a
negative-pattern fix that does not apply. When the importer's source has no
pattern import, the report says another plugin added the import and to
configure it; the dev report without an importer and the mock runtime name
that cause too. Docs: imports other plugins add are not judged by import
protection (R92, R102.2); a .server file they reach is still mocked, which a
new Vite/Rsbuild build control checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As the Rsbuild late pass does: a module naming a Start or router package
fails the client build (a warning on the server); one naming none is left
to the bundler.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A plugin handing TypeScript to Rolldown (`moduleType: 'ts'`) for a custom
extension ships a server fn's handler to the client without a message.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A binding two options of one split group write goes to their chunk; only
writers in different outputs keep it in the route module (multi-writer).
A writer next to a route-module use falls back with every other writer of
its output in the same round.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both stay in the entry with a multi-writer and a shared-writer warning,
though nothing else of the route module uses the binding.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Own-file specifiers are absolute since the split-id format change; the
verifier still matched only `./name` specifiers, so checks (b), (e) and
(h) never ran outside paths with `!`. Resolve each specifier with
resolveSameFileSpecifier and key outputs by id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Checks (b), (e) and (h) fire only under a path with `!`, where own-file
specifiers are basenames; anywhere else they never run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A plugin adds src as a context dependency, as Tailwind CSS does: a route
component edit applies in place without building a package module, a
server fn edit reaches the next call, and a created file that shadows a
resolution still compiles its importer again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack reports a context dependency (a directory Tailwind CSS scans, such
as src) as modified with every edit below it. The host took it for a
created file and invalidated an add of src, which re-resolved package
modules' imports; under Yarn PnP that rebuilt start-client-core's
hydrateStart.js into a compile that could not resolve it (release check
F1). Created files a resolution may take are reported themselves.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An add re-validated every resolution of each plan under a path the new
file may shadow; it now asks only the resolutions whose found path it may
shadow. Under Yarn PnP, Rspack's resolver answers nothing from Yarn's
global cache at a compile's start, so asking a package module's unrelated
imports made its plan stale (release check F1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
substituteSpecifier skipped a location no slice held whole, which would
keep the original (denied) specifier. Throw instead, unless the edge's own
generated segments stand in for it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
disableLogging silenced the missing-Route warning on main; the rewrite printed
it, the not-a-literal route id report and the broken-file warning with
console.warn. Tests that check those warnings now turn logging on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Vite dev case polled the diagnostics with `expect.poll`'s default 1 s
bound, which started once the page loaded. The refusal only comes once the
page hydrates and the client compiles `src/part.tsx`, so under load (CI, or
the tier on two cores) it came later and the test failed. Both bundlers'
cases now wait with `waitForOutcome` for the error in `src/part.tsx`, within
one 30 s bound, and report the diagnostics and the page when it fails.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`relativeRoot` compared paths case-sensitively, so a root `c:/proj` and a
module `C:/proj/src/x.ts` gave `../../C:/proj/src/x.ts`: a different
default id and `filename` than main's (pathe upper-cases drive letters).
Compare drive letters in upper case, as pathe does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Windows the app's root (Vite's `root`, `process.cwd()`) can carry a
lowercase drive letter while module ids carry the file system's. Built with
the root configured with the drive letter's case flipped, a server fn's
default id must be the one of the root as spelled, on Vite and Rsbuild.
win32 only; in the Windows CI job's integration smoke set (its `-t`
pattern "of an app whose path" matches the describe name; checked by
running the smoke target with the platform gate forced on Linux, where
the flip is a no-op).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack 2.3.0 ported webpack#21686/#21826 (web-infra-dev/rspack#15336): an
unnamed package.json without `sideEffects` takes the `sideEffects` of the
package above it. The witness host wrote an unnamed `{"type":"module"}`
under the harness's stand-in of this package (`"sideEffects": false`), so
on Rspack 2.3.x every module of the app was side-effect free: an
effectful denied file and its mock were dropped, and C6a, C6c, C2d-js and
C6d reported nothing. Bisected: Rspack 2.3.0-rc.0 passes, 2.3.0 fails
(Rsbuild 2.3.1 with Rspack 2.2.9 passes). Start's own harness apps are
named (`"name": "app"`), which is a package boundary, and Start's real
plugin reports these shapes on 2.3.1. Assertions unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The TanStack compilers' errors carry their position in Rsbuild's File:
line, no longer repeated at the end of the message (R101); an error
without one keeps Rsbuild's :1:1 there and its position in the message
(SWC's code frame).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the dev manifest written into the server's module, RSC dev kept the
fallback manifest: the client and server compile concurrently, so the
write lands while the server compilation is already running (main's rsc
`test:e2e:dev:rsbuild`: 9 CSS tests failed). Run the RSC finishMake
manifest rebuild in dev too, only when the manifest was written since
this compiler last rebuilt it, as main does (#8892).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dev manifest lived on the build process's globalThis, which a server
environment running elsewhere (workerd with rsbuild-plugin-cloudflare)
never sees: SSR used the fallback manifest and pages rendered without
their stylesheets (main's css-modules `test:e2e:dev:rsbuild-cloudflare`:
6 of 8 failed on #8817). Write it into the server's manifest virtual
module, only when it changes, as main does (#8889).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dev-only hot-slot subscription read `React.useSyncExternalStore`
statically. React's react-server build has no such export, and Rspack
refuses the read in the RSC layer (ESModulesLinkingError through
index.rsc.js): in main's new rsc `test:e2e:dev:rsbuild` mode, 140 of the
first 152 tests failed on it before the run timed out; with the fix,
258 pass and 1 is skipped. Look it up by a dynamic key, as `reactUse`
does for `React.use`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The apps' parsers keyed on the 'Import denied in' header; R101 heads a
mock-mode report 'Import mocked in' (F13). They accept both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A configuration without `mode`: the control leaves it out too (Rspack's
own export code differs with `mode: 'production'`), so the two builds
differ in route HMR only. Fails without the webpack host's fix.
- The unsplit `hot` row: Vite numbers its CommonJS interop bindings by
import position, so the tool names are compared without the number.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Vite dev harness serves inline plugins, so `vite.restart()` keeps the
plugin instances and cannot stand in for a config reload. Rsbuild's
harness restarts with new plugin instances, and the entry lookup is
shared by both hosts. Fails with the lookup's exsolve cache back on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plugin reads `compiler.options.mode` when it is applied, before
webpack and Rspack fill in their default (`production`): a configuration
without `mode` compiled in dev mode, and the client bundle shipped route
HMR code with the route files' absolute paths. Treat a missing mode as
production, as main does (#8269).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A relative root (`root: '.'`) made vitefu walk up from `.` and stop at
the working directory, and a root through a symlink walked the link's
parents: a Start library hoisted above the app stayed external in SSR,
uncompiled. Resolve the root as Vite does, then take its realpath, as
main does (#8866).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rsbuild passes `root` to plugins as written, so `root: '.'` made the
entries' and virtual modules' paths relative: the build failed to find
the router entry. Take Rsbuild's resolved `rootPath` unless the root is
absolute, canonical, as main does (#8868).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rsbuild fills its defaults (`server.compress: true`) into the config
before `modifyRsbuildConfig`, so the check never saw it unset and dev
compressed every response. Read the app's own config, as main does
(#8863).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main c156097786: #8858, #8863, #8805, #8269, #8866, #8867, #8868, #8869,
#8870, #8871, #8876, #8888, #8889, #8890, #8892, Version Packages
(#8854, #8891) and docs.
- #8817's side and deletions throughout (Babel compilers, start-compiler,
add-hmr, start-app.ts, server-fn-id-check.ts, router-utils ast.ts).
The lines main changed for #8863, #8866, #8868, #8269 and #8889/#8892
stay #8817's here: their fixes follow as separate commits after the
tests that reproduce them.
- @rsbuild/core 2.3.1 (#8890) in the catalog, the examples and
benchmarks/compiler-perf; Start's peers keep #8817's ^2.2.13 floor.
Lockfile and e2e/react-start/basic's route tree regenerated.
- Tests: main's start-vite-root, start-rsbuild-root, rsbuild
server-compress and router-plugin production-warnings tests are
replaced by their ports in the harness (start-build-roots,
dev-server-config, production-bundle); main's start-dev-restart test
is ported to the dev-server harness and replaces resolve-entries.test.ts
(internals). #8817's Rsbuild SPA dev case gives way to main's
spa-shell e2e. The route HMR `hot` binding test gains main's unsplit
case (#8870).
- KNOWN-BUGS: main fixed decorators after `export` (#8867) and the
Rsbuild sibling-route manifest (#8780, #8876).
- Changesets: drop what main ships now (custom server-fn ids, the Rsbuild
manifest and SPA/compress items, exsolve, Vue store pre-bundling,
falsy `use` entries, `.ts` route HMR).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Through the compiler-test-utils harness, failing on #8817 (f90a6e5707):
- Rsbuild dev compresses responses when the app leaves server.compress
unset (#8863).
- A Vite root given relative or through a symbolic link misses a Start
library hoisted above the app: its server fn runs uncompiled in SSR
(#8866).
- An Rsbuild root of '.' fails the build (#8868).
- A webpack or Rspack configuration without mode builds the client with
route HMR code ($$tsrRefreshId with absolute paths) (#8269).
The Start build harness gains an app inside a temporary monorepo
(workspace) and the bundler root as the app configures it (root).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Rsbuild dev channel records compilation error objects: their loc is
webpack's { start: { line, column } } and their file is their module's
resource, which Rsbuild prints (File: ./src/fns.ts:4:58). The message
suffix used to carry both; messages no longer repeat them (R101).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A late compile without an input map (mdx-loader in a production Rsbuild
build) keeps the compiled code's positions only when that code is the
file's text; otherwise no position, never a line of the compiled JS.
- Vite bundled dev (Rolldown's hook context) does not re-map loc: it gets
the original position there.
- The option refusal names the innermost function (the enclosing function
when it has no name), and quotes no option holding a backtick.
- Only an assignment statement gets the const text (x = createServerFn()
inside a call is a flow escape).
- report() returns before building locators when there are no diagnostics.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- .mdx late pass: the refusal at its MDX line or at none, never a line of
the compiled JS (Rsbuild production builds give mdx-loader no map)
- Vue SFCs with the script below the template, builds with and without
source maps, a statement the template shows too (no position), a builder
in a <script> block next to <script setup> (dev)
- Solid: a same-file Route is not created again in the chunk; use* calls in
a nested boundary and declared in the component; a client navigation
updates Route.useParams() in split children
- vueHoists facts in every env, absent outside .vue modules
- react-start-rsc: the client stubs throw in development and production,
explaining only in development
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- mock-await: a mocked import reports its first use, so the use after the
await is now the mock's first one, and a report is checked by count (a
production build's report is one line, without the access path).
- known-bugs-rejections: the unchecked-importer warning's fix is worded anew
(it also says the file then ships); the pin matches the new words.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The runtime read process.env.NODE_ENV itself. The emitted chunks had it
replaced, but its code after the loaders still read 'process' free (G8's
dangling-name check, Rsbuild mock-mode builds). The session generates the
runtime with its own NODE_ENV: in production the report is one line and the
runtime holds none of the longer text; the runtime reads no process.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite's experimental bundledDev runs the hooks in Rolldown's context,
which does not map loc through earlier plugins' maps (from the Start
lane).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An extracted module another extracted module imports is one instance,
not a copy; the route tree is excluded by its real path too (symlinked
projects); the chunk-configuration text no longer claims only split code
imports it. Start's eager-export test expects no warning for a class the
router module imports (one instance the entry needs).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Source-map checks (expectMapsTo) accepted a wrong relative source since
the previous change; the tail rule now applies to diagnostics alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
console.error printed '[[tanstack-router] …] { name, detail }': detail
is no own enumerable field any more and the names sit on the prototypes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
webpack and Rspack print an error's file next to its module, which named
the path twice; Start's Rsbuild host opts in (fileOfDerived).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without loc, Vite dev lost the mapping of positions through the source
maps of the plugins that ran before (an MDX or Vue late pass, a pre
plugin rewriting a route file) and the overlay's click-to-open. In dev
viteLog passes loc as before (0-based by Rollup's contract, framed by
Vite); a build, which drops loc from warnings, keeps the 1-based suffix
and our frame (gutter as wide as the line numbers). A position mapped
elsewhere (a Vue SFC's) stays in the message in dev too. Start's log
names the file without its query.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- An export statement drops out of the env roots only when it re-exports
causes alone (export { plugin } of a kept wrapper no longer makes the
export it reads look split-only).
- An exported cause stays for its own effects or writes: it is no
cascade of another cause reading it (options = { base } and base are
both reported); each exported binding keeps its own reason.
- State readers: a write by the route module counts as a use (a reader
the route module also assigns is not reported); a reader of exported
state is reported; the read must be the live one ordered evaluation
merged it for; only clusters holding state written at load are
scanned.
- A declared shared writer falls back when the route module only writes
the binding too, with the shared-writer reason; the named binding is
one the region writes live; the object example names no operator.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Messages name files relative to the project root (R101); a check given
an absolute file and no root now accepts a mention of the end of its path
from one of its directories on, so Start's position checks read the
'(src/cases/c1/module.tsx:2:19)' a Vite message carries. Also the import
order of hosts/vite.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Which exported bindings warn and what to do for each cause, the one
position every host prints, module state written by split code, the
this-reading callbacks, where codeSplitGroupings must be written, and
generation errors failing tsr generate and builds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R101 R2: an export loaded with the entry was reported whatever kept it
there, with a hedged cause and fixes that changed nothing (moving an
object the entry imports, sideEffects for an importer that loads with
the entry). The route file's importers now decide: one a module of the
entry imports is expected (no warning, unless the chunk copies it: then
it ships twice, fixed by its own module); another route's split code
importing it through the route file on webpack/Rspack is fixed by its
own module or sideEffects: false; nobody but the route tree means the
chunk configuration. webpack-family importers are the modules before
concatenation. Files are named root-relative.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An object the entry imports through the route file is one instance the
entry needs (no warning); a function the chunk copies ships twice (one
warning); only chunk configuration holding an export with the entry is
reported as such. The chunk-group apps import the route through the
route tree, as apps do; the one whose entry imports the class itself now
expects no warning (R101 R2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
input-text-differs, compile-overtaken and fallback-rounds-exhausted had
no prefix (HostServices.tag: [tanstack-router], [tanstack-start]) and
named the module by its id. input-text-differs no longer suggests running
the plugin after the compiler (that silences it, the split code stays
untransformed): only the id filter that accepts queries. compile-overtaken
says the result may be stale and to save again, without internals.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The output-slice check dropped a route's component option, which the router
moves into the split module (the option's text is no slice of either output),
so 'component: Widget' lost its <ClientOnly> suggestion. A use is skipped when
an ancestor is an element of the router's <ClientOnly> (the server erases its
children), read on the violation path only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- onViolation's trace of a module that is its own violation is as before (the
report alone leaves out its own specifier).
- Traces: every step prints when no step is an app file; a root ending in '/';
node_modules judged under the root; a pattern import's importer is an app file.
- Pattern imports: a literal glob that misses the file is never named; matched
relative to the importer (directories like routes/(auth)) or the root; nested
type arguments; comments and strings skipped; import() with a magic comment
or a concatenation; aliases and base give no patterns to extend; dotfiles.
- Rendered uses: member tags and values (<UI.Chart />, component: UI.Chart),
casts, every statement of one import, only code the output keeps (a use
already inside <ClientOnly> is not the one named).
- Marker conflicts through re-exports, import() and require(); ownEntry lookups.
- Mock runtime: an unknown edge module (a restored importer) is no pattern
import; the specifier slot filled literally and escaped as the build report;
no unreachable JSON.parse guard.
- Rsbuild dev: one located record per report; the edge-module pass fails
without the loader wrapper and frames too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the coverage review of the R101 changes:
- mock runtime: one report per mocked import (two importers report twice), the
environment type, the production one-liner, a module that is its own
violation vs an unknown edge module, the Vue fix's specifier as written;
- printed traces: the app's first file, merged split modules, a lone importer,
cuts numbered as in the whole chain, no app file at all, a self violation's
steps; onViolation's trace unchanged (cut, framework steps included, a self
violation's own specifier);
- the dev error: every report, the first one's 1-based position, no loc, no frames;
- the planner's rendered facts (JSX elements and member tags, route options,
shorthand, casts, a second import statement), re-exports, the client env,
and a marker conflict through a re-export;
- findPatternImport: the matching glob, never a literal glob that misses,
nested type arguments, comments and strings, root and parent patterns,
directories with glob characters, aliases and base, contexts, import() with a
magic comment or concatenation; relativeSpecifier of dotfiles;
- Rsbuild dev: the failure's compilation location is the import's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R101 R7 and the no-fix rows: the this-reference warning said the
callback is called on the route options (the router calls it detached:
this is undefined); a writer fallback names the binding it writes and
says to keep the state in an object or its own module (the core records
the binding with the fallback); env-declared says to declare the value
on its own; loader-object and opaque options say what to write; an
unrecognised route says to write export const Route = …; deleted
options are 'not removed from the client code' (also in dev), with the
pronoun of one option.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R101 R6: invalid codeSplitGroupings threw 'Invalid input' (no key, no
allowed values; 'i.e. i.e.' for a duplicate) with a stack and no
position; an imported value was told 'You must provide an array of
arrays'. The route module now fails with an error at the value naming
the option that cannot be split (with the ones that can), the one listed
twice, or that an imported value cannot be read. A splitBehavior result
fails the same way, naming the route. Invalid plugin options fail with
one error listing each option path and problem instead of a raw
ZodError, its message as its stack.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They no longer recommend a route loader (refused by the compiler). The
explanation is development-only; production keeps a short throw.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Vue SFCs: refusals of Vue's output (main or late pass) are reported at the
SFC's line and column on every host (through the input map, refined to the
statement's column; without a map, the statement's unique line). The Vite
dev server maps loc itself: it gets the position in the compiled code.
A <script setup> server fn that cannot be hoisted says setup is a
function and gives the fix (a .ts module, one chain, the value in the
input). The recipe no longer suggests a builder in a <script> block.
Vite's late pass is labelled tanstack-start:compiler-late.
- Nested server fns: name the local builder, the local (with .validator()
and { data }), this/arguments, and the option call with its function.
- Escapes: a builder kept in an object gets the exported partial chain;
a builder assigned after its declaration gets const; computed keys and
.inputValidator() read without jargon or PR numbers.
- RSC outside a server fn suggests createServerOnlyFn for helpers.
- Argument checks name the method; the server-param warning says when it
is harmless; custom ids suggest hashing filename and what to return.
- Hydrate write refusals say what to move.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed generation (an unparsable route file, several files for one
route, conflicting paths, an empty path, a missing root route) throws a
RouteGenerationError: [tanstack-router] prefix, files relative to the
project root, its message as its stack (Vite printed the generator's
internal frames). A route file an edit breaks says the tree keeps its
last good route; a file without a Route export says to export it as
Route; the route-id warnings no longer repeat the file the position
names, and say what the generator does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vue <script setup> refusals at the SFC's line and column on Vite and
Rsbuild, build and dev; nested server fns and builders the compiler cannot
follow, with each fix built and called; a hashed filename id; an RSC
helper in createServerOnlyFn on Vite and Rsbuild.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Several route files for one route, conflicting paths, an empty path, a
gone root route, route-group config: a build that does not watch failed
only on an unparsable route file and otherwise went on with the tree on
disk, silently leaving the new file out. Every generation error now
fails it, as tsr generate does; dev and watch report it and keep the
last good tree.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The samples are a real build's output: the trace starts at the app's router,
the server-side suggestion is <ClientOnly> from how the import is used, the
fourth client suggestion splits the file. Adds the negative-pattern fix of a
pattern import and the Vue SFC form of a client-only component.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two route files for one route and two routes with one URL fail a build
naming the files, as an unparsable route file does; a dev run reports
them and keeps the last good tree. Replaces the test of main's 'reports
it and goes on'.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The loader threw the report: Rspack wrapped it as 'Module build failed (from
compiler-loader.js)' with the plugin's stack frames at file:1:1. It is now a
located-diagnostic record (1-based position) and the failure the host replaces
with it, as compile errors are.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A server render of client-only code: the planner reads how the importer uses
the import (a JSX element, a route component option) and the report suggests
<ClientOnly> from the app's router package, never createClientOnlyFn (it
throws while rendering on the server). A Vue SFC importer (templates are no
JSX) gets defineAsyncComponent(createClientOnlyFn(() => import(...))) inside
<ClientOnly>, the fix that builds there. Functions keep createClientOnlyFn,
qualified.
- Pattern imports: the report names the denied file and the import.meta.glob /
webpackContext / template import() that matched it, at its position (build:
onViolation's importerLoc too; dev: the importer the graph knows), and
suggests a negative pattern built from the call's own patterns.
- Traces start at the app's first file (the framework's entry modules left
out), name a route module and its split module once, tag (entry) only on a
real, uncut entry, say how many steps a cut left out, and are omitted when
they only repeat the importer.
- A marker violation names the marker and its line; a marker conflict is
reported at the second marker and names both.
- Mock mode says 'Import mocked'; a dev barrel report says to split the barrel;
the unchecked-importer warning says a static import ships the file.
- Mock runtime: one report per mocked import (React probing a mock made a
dozen), the environment type, the pattern-import importer; the report's text
is built only outside production.
- Dev 'error' failures carry no stack frames and no 0-based loc next to the
report's own 1-based position; their id is the importer's file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
generateBundle called this.error inside the loop over the reports: the first
error threw, and every later error and warning was dropped. Warnings are
printed first, then the build fails once with all of its errors (as Rsbuild).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PolicyContext.analysis: the ModuleAnalysis of the compile's input, for a
policy's rare paths (import protection: how an importer uses the bindings of a
reported import). Only while the policy runs; nothing of it enters facts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Builds (Vite, Rsbuild): every surviving violation is printed (Vite printed the
first only); a pattern import of a denied file is reported at the pattern
import; a negative glob pattern leaves the file out; a marker conflict fails at
the second marker; a server render of a *.client.* component (React, Solid)
fails at its import, and rendering it inside <ClientOnly> builds with nothing of
it on the server. Dev: an Rsbuild 'error' failure names the import's position
and none of the plugin's own files; the negative pattern reports nothing and
the page runs (Vite, Rsbuild).
Fail at f90a6e5707: the Vite build's second violation, the glob position and
the marker conflict position (both hosts), the Rsbuild dev failure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rsbuild printed File: ./src/routes/index.tsx?tsr-split=component:3:20
(the module id); a located error of a derived module now carries the
file without its query, which Rsbuild prints instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route module's own needs (webdevcody/tanstack-course-platform's
learn/$slug/_layout.tsx shape) are not reported; an export only the
split component reads, a declared component writing what the loader
reads and a reader of state the module writes at load are, at their
declaration, on Vite, Rspack, webpack and Rsbuild, and their fixes build
silent and lazy. The build harness rendered webpack-family stats items
without the loc the bundler prints (the message suffix carried it).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R101 R1: an exported declaration was reported whenever split code reached
it, also when the route module needs it anyway (its loader reads it,
split code reaches it through Route, it writes state the route module
keeps), as on webdevcody/tanstack-course-platform learn/$slug/_layout.tsx.
Exported and unexported declarations now share one rule: reported once,
at the cause, only when nothing else of the env module needs them; an
export the env module reads (live) is never reported. The warning names
the split code that uses it and gives a fix per cause (own module, or
/* @__PURE__ */ on a call initialiser).
R3: a component declared on its own that writes a binding the route
module also reads falls back like one written inline (shared-writer),
and a declaration reading state the module writes at load, merged into
that state's cluster the env module keeps, is reported (eager-split
state). The trigger rules are those of the inline and movable cases.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shared message format (R101), consumed by the router, Start and import
protection hosts:
- displayPath: files are named relative to the project root
(HostServices.root; PlanContext.displayPath for planners).
- viteLog: on Vite (router and Start, build, dev, overlay) the message
ends with its one 1-based position, with a code frame of the module,
and no 0-based loc. Router-only Vite builds printed no position at all
(Rolldown drops loc from warnings); Start printed two columns.
- locatedDiagnostic: the webpack-family records keep the message as
written; Rsbuild, Rspack and webpack print the 1-based loc (Rsbuild
printed the absolute path three times).
- Start on Rsbuild reports a custom server-fn id error or warning once
per run, not once per environment.
Router planner messages name the file the new way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite messages carry their position (Rollup's loc column is 0-based and a
Vite build drops loc from warnings) with a code frame; the webpack-family
loaders' records carry none in the text (the bundler prints the loc).
Vite builds now report positions too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Solid has no rules of hooks: a use* call in the split children runs under
the boundary's owner, with its context (R101 ruling 1). The refusal stays
on React.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Failing tests for R101 R1 and R3: an exported declaration the route
module needs anyway (its loader reads it, split code reaches it through
Route) is reported today; a declared component writing a binding the
route module reads, and a reader of state the module writes and keeps,
stay in the route module without a warning.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rows for: a root export extracted by a root `<Hydrate>` and imported by a
route (the page of an unknown path must link no route's code), exports
only boundaries render (one stateful, one another route imports), a
`component` that is the route's own export, a boundary in a component two
options share (J2.20), a layout export its child imports with a sibling
that does not, and an Rsbuild build whose shared lazy modules get chunks of
their own. identity.test: export names and value forms that must not read
as split groups.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start's manifest made a chunk a chunk of route X when any of its modules
carried the `tsr-split` key. Since extracted exports (`export---<name>`)
and shared modules (`shared---<keys>`) moved under that key, the chunk of
another route, of a lazy module or of a Hydrate boundary that holds one of
X's extracted exports or shared modules was attributed to X: X's page
preloaded that code and linked its CSS (Vite; Rsbuild with "sideEffects":
false), and a route whose Hydrate boundaries share a helper preloaded the
boundaries' code (J5.6).
A chunk is X's when it holds one of X's split groups, the modules X's route
module imports lazily (as on main, whose shared modules had their own key).
Shared modules and extracted exports reach X through its split chunks'
static imports. One owner reads the value: `isSplitGroupValue` in
identity.ts; Start's `isRouteSplitQuery` serves both client normalizers
(literal key, first value, as before).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Production builds (Vite, Rsbuild; with and without "sideEffects": false)
of an app whose route exports components other routes, a lazy module and
the root import through the route file, a route with a module two split
options share, and a route whose two Hydrate boundaries share a helper.
Each page must link the code and CSS its route renders and nothing only
another route or a lazy boundary needs (SPEC J2.22, J5.6, J5.7).
Fails at 3f1e9b0178: /exported links the chunks of `/`, `/third` and the
lazy widget that hold its extracted exports (Vite; Rsbuild with
"sideEffects": false), and /hyd preloads its boundaries' code (every host).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A component or plain helper read by component and errorComponent lives
in the shared split module in dev; edits of it, then of the route
component, apply in place with React Refresh on Vite and Rsbuild. Each
test first checks the page loaded the shared module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vitest's -t matches test names, not file paths: 'project-path' and
'unparsed' matched none, so the Windows job skipped the project-path
(#, %, non-ASCII, !) and unparsed-module builds. Match them by name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
customIdCheck reads an id holding '%' back as Start's server does
(decodeURI keeping %25 and %5C, unsafe characters encoded again, parsed
again; a throwing decode is the server's 400): an id it reads as another
(users%41get, x%c3%a9, %2E) or rejects (users%zz) never reached its handler
and fails the build. Checked against router-core getNormalizedURL on 400k
random ids: no difference.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
users%41get (read as usersAget), x%c3%a9 (re-encoded uppercase), %2E (a dot
segment) and users%zz (rejected with 400) never reached their handler;
users%20get does and stays a warning. Fails: they only warn.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The gate is filled in after the ids were patched, so it listed the
placeholders of a custom generateFunctionId and refused every client call.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both bundlers, with a deprecated id (':', "'") that builds with a warning.
The Rsbuild RSC harness also collects the compilations' warnings. Fails on
Rsbuild: the client-origin gate lists placeholders, so every client call of
a custom-id server function is refused (Server function info not found).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The harness names the entry by its absolute path, which a ! in the
directory turns into loader syntax on Rspack before the compiler runs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A ! separates loaders in a webpack-family request and has no escape: an
absolute own-file specifier under such a directory failed to resolve on
Rspack (main had the same bug; eb1a7841bb's relative form did not).
sameFileSpecifier prints ./<basename>?<query> there, and
resolveSameFileSpecifier resolves that form to the importer's own file
for the Vite hosts. Paths without ! keep main's absolute form.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- router project-path: the split component reads Route (its chunk
imports the route module itself); a directory with ! on Vite and
Rspack (webpack refuses a ! context); fails on Rspack: the absolute
specifier splits at the ! (loader syntax)
- golden split-module ids under a # path: requests carry \\0#, one
module per route file; a minified production client build names no
path of the checkout (Vite, Rspack, webpack); both in the smoke set
- Start # path: a lazy handler module reading a binding its module
writes sees the module's one instance
- identity: the ! form, a relative own-file specifier resolves
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apps name webpack/Rspack chunks from chunkGroup.origins[].request
(/routes/<file>.tsx?tsr-split=<a>---<b>) and Vite chunks from module ids;
the relative specifiers and '~' separator of the rewrite broke that
without an error.
identity.ts alone prints and parses the format:
- split groups: <path>?tsr-split=<options sorted, joined by '---'>, as main
- shared modules: tsr-split=shared---<options of the needing outputs>
- extracted exports: tsr-split=export---<name> (anything but [\w$]
percent-encoded), EXTRACTED_EXPORT_QUERY_RE for the hosts' sideEffects rule
- Hydrate: ?tss-hydrate=<id>, unchanged
- every output imports another output of its file, and the route module,
by the file's absolute path (sameFileSpecifier), a '#' of the path
escaped as \0# (webpack-family request escape); the Vite hosts resolve
it with resolveSameFileSpecifier, moved here from host.ts, only for the
importer's own file (a browser URL /src/... looks absolute too)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
server-fns/format.ts owns every server-fn format a build prints or
hashes, set to main's: the sha256-hex default id of <file>--<functionName>,
main's functionName for identifiers, serverFnMeta.name as the local
variable name, double-quoted metadata and rpc literals escaped as Babel
printed them, single-quoted manifest keys and functionName, and collisions
numbered by file, then source order (an ordinal on the registry's facts:
Rsbuild ServerFnBuildInfo 3 -> 4). The internal stable key keeps its jobs.
Custom ids: only characters that never worked over HTTP fail the build
(whitespace, control and non-ASCII characters, " # / < > ? \ ^ ` { },
'.' and '..'); other ASCII characters outside the unreserved set and $
build with a deprecation warning. A placeholder is patched escaped for
the literal it is in (an id may now hold "'"). An empty id falls back to
the default id, as on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ending its chain with .server() compiles, but the createClientOnlyFn call
that returns the list still throws on the server, where Start reads
middleware lists: every page answers 500. Listing the middleware directly
is the fix that works.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generic flow message said to keep builders in const bindings and call
.handler() / .server() on them directly, also for a builder that already is
a const. The message now says what escapes (a server fn builder without
.handler(), a factory, a function or isomorphic fn returning an open value,
a start instance) and the fix that compiles for it. The implementation
passed to createClientOnlyFn itself is not "returned from" it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apps name webpack/Rspack chunks from chunkGroup.origins[].request
(/routes/<file>.tsx?tsr-split=<a>---<b>) and Vite chunks from module ids.
The PR's relative specifiers and '~' separator broke that silently.
- golden integration test (Rspack, webpack, Vite; default groupings,
route codeSplitGroupings, plugin defaultBehavior), in the smoke set the
Windows CI job runs, one module per route file
- identity unit tests for the format, the own-file specifier with the
\0# escape and its resolver (Windows paths too)
- enhanced-resolve on a Windows-path file system: one module per file
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- function-id-url: only characters that never worked over HTTP fail the
build; '%', ':', "'", '+', '@', '|', '[]' build with a warning naming
the file and reach their handler (fails: they fail the build)
- build-options: the default id is 64 hex digits, also for an empty id
(fails: 22 base64url characters; '' fails the build)
- custom-ids: a non-ASCII name reaches the generator unchanged (fails:
caf__createServerFn_handler)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An isomorphic fn without .server() passed to code the compiler cannot see
(a QueryCache onError, setTimeout) suggested createClientOnlyFn. That turns
"returns undefined on the server" into "throws on the server": called
during SSR, the render fails. Where the fn goes the compiler cannot tell
whether it runs on the server, so the message suggests
.server(() => undefined), which keeps today's server behaviour.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An open middleware (no .server()) used where the compiler cannot follow it
suggested createClientOnlyFn, which is no replacement for a middleware: applied,
the build fails the same way, and at run time it throws on the server, where
Start reads middleware lists. The message now says the middleware has no
.server(), names an isomorphic or createClientOnlyFn implementation's return
when that is where it goes, and suggests passing it to Start directly or
ending its chain with .server(({ next }) => next()); other reasons suggest
the latter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Records main's output of a golden app (record.mjs, from real Vite and
Rsbuild builds of main) and compares a build of this checkout with it.
Fails: the default id, the Rsbuild manifest's quotes, serverFnMeta.name of
a renamed export and the ':' id differ from main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server-environment suggestion said a createClientOnlyFn function returns
undefined on the server; it throws there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On macOS and Windows, workers still writing their compile cache make the
removal fail with ENOTEMPTY, which failed the run; the removal at exit gets
what is left.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A client compile reaching .inputValidator() on a server fn or middleware
builder (user code, or a stale package such as authkit-tanstack-react-start
<0.9) reported the generic 'call the methods of a builder directly' error.
Name the rename (#7566) and the removal (#8694) instead, through the same
member-escape diagnostic, at the same file and position.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0.5.0 calls createServerFn().inputValidator(), which Start removed in #8694;
0.9.0+ uses .validator(). Adapt the example to the kit's current API, as in
its own example app: @workos-inc/node is now a peer dependency, sign-in goes
through a /api/auth/sign-in route that sets the per-flow PKCE verifier cookie
(0.7.0), and the custom requestMiddleware list restores createCsrfMiddleware.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The compiler test configs pointed NODE_COMPILE_CACHE at the shared
<tmpdir>/node-compile-cache, and every run's temp apps added entries to
it for good (14 GB on a 31 GB tmpfs, browser tests failing with
ERR_INSUFFICIENT_RESOURCES). The run-directory global setup now points it
at the run's own directory, for the workers and every process they start,
and removes it with the run; again at exit, since Vitest stops its
workers (which write their caches then) after the global teardown.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack and webpack keep no location of a loader's emitted warning or
error, so Rsbuild printed `File: …:1:1` and webpack no position. The
loader records each diagnostic with its position in the module's
`buildInfo` and the host replaces them after the seal with errors and
warnings located there. The helper moves from Start's Rsbuild host to the
compiler core's hosts code, shared by both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dead re-export of a denied module whose top level is a server fn
(createServerFn().handler(fn)) failed the build: import protection's
effect check took every call of an imported factory for an effect, while
with protection off both bundlers drop the module. The recognizer now
lists each builder kind's link methods and the environment keeping each
method's argument (builderLinks); raw facts classify the module's own
statements per environment type with them: a chain from a factory call
(or a module-level const holding an open one) through those methods with
pure arguments is no effect, and the first argument of a method the
environment's compile erases (validators, handlers and server
implementations on the client, a client implementation on the server;
env-only fns' arguments) is not evaluated there, nor is what only such
arguments read (an import only a handler uses, a schema const only a
validator reads: the compile orphans them). Only target facts change:
the planners' purity and summaries do not take builder chains. Real
effects, unknown methods, links after .handler(), top-level await and
live imports stay reported.
The removed .inputValidator() (#8694) is no longer recognised; an old
call fails the client compile at the member.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rsbuild prints each environment's last compilation once every environment
is done, and Rspack reports a module's warnings only in the compilation
that built it. A compilation replaced before that print (a cold start's
client compile, when the generator writes the route tree) lost its
warnings: import protection's mock-mode reports and the compiler's own.
The host plugin keeps what its last compilation reported until Rsbuild's
`onDevCompileDone` names it; otherwise the next compilation reports it:
the import-protection reports as written, and the warnings of the modules
it kept without compiling from their recorded diagnostics.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rsbuild applies `tools.rspack` after every plugin's `modifyRspackConfig`,
so a VueLoaderPlugin added there was not seen and the script blocks of
SFCs under vue-loader's inline match resource were not compiled: their
server fns shipped their handlers to the client. The script block rule
is added in `onBeforeCreateCompiler`, on the configs Rspack gets, at the
same place as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rsbuild prints a compilation error's file and `loc` (terminal and overlay)
and falls back to `:1:1`; Rspack keeps no location of a loader's thrown
error or emitted warning. The loader records each compile diagnostic with
its position in the module's `buildInfo`, and the host plugin replaces the
module's failure and warnings with errors located there after the seal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start's Vite plugin crawls the app's dependencies with vitefu to bundle
the packages that use Start on the server (ssr.noExternal). Its predicate
only read peerDependencies, so an installed kit listing Start under
dependencies stayed external: Node loaded it uncompiled, its server fns
threw on the server and client calls answered 500. The predicate reads
dependencies too, Start's own packages aside (the resolve.noExternal
patterns bundle them already). Docs: server fns in packages, with
peerDependencies recommended.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A <Hydrate> imported from an app module re-exporting it (a named
re-export, an imported binding exported again, export *, a namespace
import, chains) deferred hydration but never split: the children's code
loaded with the page. The recognizer now lists Hydrate as a kind of the
React and Solid Start packages (as ClientOnly is), so summaries and the
re-export walk recognise it; start-env ignores the kind. The hydrate
planner's prefetch reads its candidates through Start's value reader,
shared with start-env's prefetch, restricted to app modules (a Vite
server resolves no package it externalises). Boundary ids count every
element imported as Hydrate, so no per-environment resolution shifts
another boundary's id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
router-core's server route-tree cache is main's again (keyed on the route
tree). The compiler test harnesses run their dev servers under
`NODE_ENV=development`, as `vite dev` and `rsbuild dev` do. Since the
branch point the head gained dev servers that bypass the harness's
createDevServer/openServer: router-plugin's vite-versions, start-plugin-core's
hydrate restart and known-bugs-start-compiler-dev, router-generator's route
tree and consumer servers. Each now runs as a dev command too; router-generator
gets test-scope-setup so a file's environment comes back after it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
generateFunctionId receives main's generated handler name again, and a
custom id must be one URL path segment (unreserved characters plus `$`),
else the build fails. Merged without conflicts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#8817's side for the split-out PRs:
- #8861 (Start router options): the PR's generator-config, Vite and
Rsbuild wiring; main's start-router-wiring test and start-app helper
dropped (start-build-options, start-dev-route-tree-footer and
start-compose-project-path test the same four behaviours). Main's
changeset kept; the duplicated bullets leave start-compiler-yuku.md.
- #8860 (split route source maps): the PR's own loader; compilers.ts stays
deleted; main's source-maps test dropped (build-source-maps and
dev-source-maps test webpack, Rspack and Vite dev). unplugin ^3.5.0 kept
from main (no downgrade). Main's changeset kept; the PR's source map
clause leaves router-plugin-yuku.md.
- #8653 (visible() hooks): merged to the PR's file, test and changeset
unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The harness's Vite and Rsbuild dev servers run the process under
`NODE_ENV=development`, as `vite dev` and `rsbuild dev` do when it is unset,
instead of Vitest's `test`; a host kept from an earlier file sets it again.
The SSR route-edit test no longer needs a process of its own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dev server under a NODE_ENV other than `development` is not supported:
back to main's cache, keyed on the route tree object. Reverts e1188be2d0's
router-core part (R88), its changeset and its tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`test:unit` stays where main has it (#8849). Main's esbuild unit test
that the plugin refuses `autoCodeSplitting` duplicates the PR's J2.18
build test (integration/build-harness.test.ts); the splitter entry's
refusal and the generator-only entries have no other test and stay.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reverts 507fc1497b and 3ee403ebeb: the merge takes #8817's side for
the changes main split out of it, #8857 included, so the PR's own tests
of that change stay unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main regenerated them with its generator (#8841); the app builds write
them with this branch's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in `StartCompilerSession.report`: the fix list's client parse
error (a module the bundler would take untransformed) and the Vue late
report (diagnostics and sink mapped into the SFC) both apply; the Vue
sink wraps the reporting of both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two fixtures were split out as known type bugs; the rewrite fixed
them and main fixes them too (#8857). They join the other fixtures, and
the stale "Bug:" comments go.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`foo/_layout.tsx` without `foo.tsx` gets the path `/foo`. Next to
`(group)/foo.tsx` or `foo_.tsx` the generator wrote the tree, and the
router matched `/foo` to the empty layout instead of the page. The
full-path check now skips only the routes the tree gives no `path`, as
main's #8857 tests expect; a childless `_auth.tsx` next to the index
route stays valid (SPEC J1.15).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main landed parts of this PR separately against the old compiler
(#8851, #8852, #8853, #8855, #8856) and re-enabled the router-utils unit
tests (#8849): the PR already has each of them. The old-compiler files
main edited stay deleted; the entries keep the PR's implementation (same
esbuild error message). Main's changesets stay; the duplicated bullets
leave the PR's router-plugin, route generator and compiler core
changesets. The router plugin skill takes main's esbuild wording.
#8857 (route-group layouts typed with full path '/'): the PR's generator
already types them '/'. Main's test that a childless `_auth.tsx` next to
the index route conflicts is dropped: SPEC J1.15 makes that pair valid
here (route-paths.test.ts checks it through the router).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The client puts a server function's id after the server function base
unencoded and the server reads the path segment back, so an id from a
custom `generateFunctionId` with `/`, `#`, `?`, whitespace, a control or
non-ASCII character silently called another function of the file or
none. The build now fails for an id outside RFC 3986's unreserved
characters and `$` (or `.`/`..`), naming the file, the function and the
id; the docs say what an id may contain.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A custom generator received the compiler's internal key as `functionName`
(`twice#1` for a name a module repeats, `fn@outer/inner` for a nested
server function). An id that embeds it reached the URL unencoded: the
browser dropped `#1` as a fragment and the server cut the id at `/`, so a
call silently ran another server function of the module.
`functionName` is again the handler name earlier versions generated
(`<name>_createServerFn_handler`, `_1`, `_2`… in source order, with the
same increment rules), so custom ids survive the upgrade; characters
outside `[A-Za-z0-9_$]` become `_`. The e2e id maps return to the old keys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"the module changes they outside their declaration": the template used the
subject pronoun where the sentence needs the object. `them` now goes in
the object positions of every reason (written, needers, shared, order),
"to their own module" for several bindings, and the warning for several
exports of one binding says "The exports … stay". Bindings of several
declarations (tanstack.com's partner pages) get "their declarations" and
"their initialisers … if they have no side effects"; a destructuring
stays one declaration.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Must stay refused, on the Vite dev server and in a production build with
`vue({ features: { prodDevtools: true } })`: a `<script setup>` block (JS
and TS) whose template attaches a handler to a builder the block hands
it (`{{ base.handler(async () => …) }}`). A fix that ignores
compiler-sfc's `__returned__` object (the research prototype A, applied
to the built package) fails all four: the handler reaches the client.
Pass, dev and the devtools build: the recipe rows (a server fn and an
isomorphic fn of a `<script setup lang="ts">`, an unused imported
builder and a namespace in one, middleware and a server fn of a
module-scope `<script lang="ts">` called from `<script setup lang="ts">`).
The six `.fails` pins stay (they pin the limitation).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured (plugin-vue 6.0.5, real `vite build`): the template is not
inlined, so a JavaScript `<script setup>` importing a builder or factory
is refused, with `features.prodDevtools`, a true `__VUE_PROD_DEVTOOLS__`
define and `NODE_ENV=development`; a default build, `--mode development`
and a `'false'`/`false` define inline and build. Rsbuild (rspack-vue-loader
17.5.0) inlines in production mode whatever the devtools flags; a
`NODE_ENV=development rsbuild build` refuses, `--mode development` builds.
A `lang="ts"` block builds in every mode; a template attaching a handler
is refused in every mode.
KNOWN-BUGS, the changeset, the pin file's comment and the Vue Start skill
(the only Vue Start documentation: there is no docs/start/framework/vue)
say where it happens and the recipe: `lang="ts"`, builders and middleware
in a `.ts` module or a module-scope `<script lang="ts">`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In development (and in builds with Vue's devtools) compiler-sfc hands a
`<script setup>` block's bindings to its template through an object it
generates; a builder or factory there is refused, and the refusal pointed
into that object, which the SFC does not have (`Page.vue:13:70` in a
9-line file), talking about a getter the author never wrote.
The late pass records, for each refused escape of a binding (and each
namespace escape), the binding's name and declaration (start-env facts,
late pass only). For a `.vue` file, a Vue-only report step
(`compiler/vue.ts`, called by the session's report when the host passes a
late compile's input map) moves a refusal whose position the input map
does not map to the SFC to the binding's declaration in the SFC, names
it, and gives the recipe (`lang="ts"`, builders in a `.ts` module or a
module-scope `<script lang="ts">`). An escape the author wrote keeps its
report. A server fn that cannot be hoisted (`code: 'start-hoist'`) gets
what the module top level is in an SFC. Nothing else changes: other
modules never pass a late input map.
Tests: Vite dev (an imported factory, an imported builder, a namespace, a
TS local holding an open builder: refused at the declaration's line;
an author's escape still refused); Rsbuild dev (refused at the import).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With vue-loader's inline match resource (`@rsbuild/plugin-vue`'s default)
the script block is `x.vue.js?vue&type=script…`: Start's `pre` loader saw
the SFC's text before vue-loader, and the late rule (`.vue`) matched only
the glue module, so no Start pass compiled `<script setup>` or `<script>`:
server code shipped to the client and isomorphic fns ran their server
side in the browser, in dev and in production builds. Without the inline
match resource the late rule matched the block, but vue-loader's pitcher
copies the block's loaders into the request it generates and Rspack
applies the configured `post` rule again: the late pass compiled its own
output and server fns failed when called.
When vue-loader's plugin is in the configuration, a `post` rule runs the
late pass over the script block under its match resource (`rsbuild/vue.ts`),
and a late loader that runs again later in its chain passes through: one
late pass per module. Nothing changes for apps without vue-loader.
Tests: an Rsbuild integration test with `pluginVue`, inline match resource
on and off, build and dev (client without the server code, server with
it, calls by id and from a page, isomorphic client implementation, a JS
`<script setup>` refused in dev); a Vue SFC with a server fn and an
isomorphic fn in `e2e/vue-start/basic` (Vite modes get `@vitejs/plugin-vue`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Removing a function-local declaration only removed code read (orphans)
left the statement after it next to the one before: `let y = foo`,
`const local = 1;`, `(mk)()` rendered as `let y = foo(mk)()`. The
renderer's statement-start guard covered an edit's own text only; it now
also guards the source statement after an edit in a nested statement list
(the module's own list has freeze's guard): a `;` when its first token
could continue what renders before it (`(`, `[`, a template, `+`, `-`,
a regular expression, `<`), after the indentation and before a comment.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
router-plugin's Rsbuild integration tests (38 files, 918 passed + 23
expected failures, 0 failures) and a real Rsbuild 1.7.6 dev server and
build of a code-split Router app pass on Rsbuild 1.7.6 (Rspack 1.7.12):
restore `>=1.0.2 || ^2.0.0`. The Start packages keep the new floors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite 8.0.16 fails 28 tests of Start's suites, 8.1.0 and 8.2.0 pass them
all; Rspack before 2.2.9 fails the Rsbuild and RSC suites, and Rsbuild
2.2.13 is the first release requiring Rspack ~2.2.9. Peers: vite >=8.1.0,
@rsbuild/core ^2.2.13, @rspack/core >=2.2.9 (react-start-rsc).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`const labels = ['x'].map((k) => prefix + k)`, read only by split code, moved
to the chunk and evaluated there after `setPrefix('b')`: `bx` instead of the
unsplit `ax` (map, reduce, Array.from, new Map, an IIFE, a helper called at
load, a helper taking a callback, a callback defined apart, a callback after
a member read, `n++` in a helper, an option value built by a helper).
The movable test read `ref.eager` while other rules read `atLoad`, and
`atLoad` skipped effectful units. One definition now
(`ClusterGraph.loadReads`): what a unit that calls something reads may be
called, and a function it passes directly to a call (or calls) runs at
load; a method nested in an object argument (`defineComponent({ setup })`)
and the root of a member write do not. A cluster's load reads include those
of the declarations they reach. It drives the movable test, mutable readers
(also through a function updating its own state) and the static-output
check. `n++`, `n += 1` read `n`. Claimed text is not evaluated where it is
written; an option value that calls something reads what that call may run.
The unit walk that finds calls and callbacks runs only when placement asks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A module that defines server code through the app's own builder
(`import { base } from './lib/base'`) names no @tanstack/* package, so a
parse error in it was left to the bundler's parser. Where that parser is
more lenient (SWC: `let v!: T = x`, `function g<>(){}`, `import type T,
{ U }`; both bundlers: ES module syntax in a .cts file), the module shipped
to the client untransformed, handler included, with no message. A client
build now fails naming the module and the position, unless the file is no
JS/TS (an asset, the text a late pass sees before its loader) or a
CommonJS script (J4.16). Server builds are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`a; /* @__PURE__ */` with `mk()` on the next line moved the annotation with
`a`: Vite 8, Vite 7 and webpack then dropped the effect after `a` in its
chunk, and Rspack/Rsbuild ran the annotated call. An annotation or license
comment that is the last thing on its line (also before a line comment or a
multi-line comment) now stays with the code after it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack reports native paths, so the check for a package.json edit never
matched a Windows path: an edited package.json was treated as an ordinary
file change instead of a change that can redirect resolutions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The atomic rename replaced the link with a regular file and left the file
it named on the old content. The publisher now renames over the
destination's real path, so the link stays and the shared file gets the
update, with its mode and owner and the concurrent-edit check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dev server's client reloads after a failed compile only when it showed
the error; under load the fix can arrive first and apply in place.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
React and Solid Start apps on Rsbuild: the binding's shapes, a server fn
both read, component-only and loader-only edits, a syntax error then a fix,
an unmounted route, a route left then edited, nested splits and a Hydrate
child reading the binding. A Hydrate child edit and a component edit still
update the edited module alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 12 Rsbuild pins run as ordinary tests. A matrix of edits (second edit,
syntax error then fix, unmounted route, route left then edited, nested
splits, component-only, loader-only, exported constant, and the research's
other rows) on Rsbuild and webpack (with its own devtool and with source
maps), React and Solid: the page shows the edit without a reload, the
loader runs once per edit, React keeps its state with React Refresh. The
hot update of a component or shared-module edit holds that module alone.
New pin: an ordinary module importing a binding from the route file stays
stale on Rsbuild and webpack.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Rsbuild and webpack the route module self-accepts, so an update of it
stopped there: a split chunk importing a binding the route module keeps
went on reading the exports of its earlier evaluation, without a reload or
an error. Each module of the file that imports such a binding now hands its
hot handle to the route HMR runtime (placement decides which modules); the
route module's next evaluation invalidates them and refreshes the route
once the update is applied. Vite's update already holds every module of the
edited file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A planner can home a generated unit in every derived output that imports a
binding of the env module other than the ones it names (`env-readers`).
Placement decides it once inclusion is: the unit declares nothing, owns no
claim and reads only its own imports, so placing it changes nothing else.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rebuildModules scanned [...compilation.modules] before every rebuild after
the first, so a warm Rsbuild restart that rebuilt hundreds of modules spent
seconds in the scan. compilation.modules.has(m) answers the same question
(natively on Rspack, agreeing with the scan on 2.0.0, 2.2.9 and 2.3.0).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Destructuring only the callback keeps the client gzip of the deferred-hydration
scenario at main's (+6 B with both destructured after the reorder).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`hydrate-pages` had its own `settled`, with the race ceb54dca5e fixed: with a
late intersection it returned before the page requested a visible gate's code.
Callers clicked until a boundary answered, which hid it. One `settled` for both,
and `openPage` gives every page the in-flight count it asks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The effect sat below `if (!g.r) use(g.p)`. An intersection landing while React
waited to replay made the replay skip `use`, the only call that leaves the
replay's dispatcher, and the effect threw. React then dropped the server HTML.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`if (!g.r) use(g.p)` skips `use` on React's replay once the gate opened, so the
`useEffect` after it throws and the boundary's server HTML is discarded. Pinned
with `it.fails`; the fix is not part of this commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`settled` returned after 30 ms without a visible change, but a page that
hydrates the markup it already shows looks finished: 14 of 405 page runs under
pressure requested the split chunk after it returned, and failed with an empty
list. Wait for a frame's intersection observers and the tasks after them, and
only then ask what is in flight.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of the allowImport work. The allowed set is keyed by edge module, so an
edit that moves an import's target asks again instead of serving the old answer;
a restored edge module is rebuilt whether or not a sibling import already got its
answer; only a builtin and the framework's known packages count as having no
effects, so a virtual module or an external URL stays an effect; retain no longer
forgets answers, so an import leaving and rejoining the Rsbuild dev graph is not
asked twice.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The manifest's guard for a discarded pass is dead code, and the tests' words
follow the new behaviour.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The effect witness over-reported: a target graph over 256 modules counted as
effectful, and so did a target importing a builtin, the framework's server
runtime or anything in a sideEffects:false package outside node_modules (a
linked workspace). The code was gone from the bundle, confirmed with protection
off, and the build still failed. The walk now follows the whole graph, and those
imports have no effect. A real effect at any depth is still reported. Dev reads
no witness, so it no longer walks the graph at all.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Vite, reading a denied file's graph resolves its imports, and the resolver
throws on a package with only node exports: the build failed with
Errored while resolving, dead edge or not. What the environment cannot resolve
now counts as unknown, so effectful, and the normal denial appears.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mock's then resolved with the mock itself, a thenable, so await looped in
microtasks forever: a frozen tab, or a dead server when a loader awaited one.
then, catch and finally now settle with a mock that is not thenable, so await
gives a mock and mock.foo().then(cb) runs cb. Uses of it are still reported.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
allowImport(info) runs during the build, before an import is swapped for its
mock, in dev and build, once per import; true gives the real module, from the
only pass, and the import is no violation. The session owns the decision: the
edge module's state holds the answer, so plans and caches hold none. Hosts ask
at the edge's request (Vite resolveId, Rsbuild edge loader) and after a compile
(dev without an edge module, a module that is its own violation). An allowed
target counts in every environment of its type (RSC: ssr's unchecked importer
of a 'use client' file rsc allowed).
onViolation runs after the build for what survives tree-shaking and returns
nothing; returning false prints what to use instead.
Removed with the second pass: the builder.build patch (closeBundle releases the
environment), needAdditionalPass and its done guard, runToFixedPoint,
discardBundle, onStateChange and verdict.ts. Rsbuild's persistent cache rebuilds
restored edge modules with allowImport set, so a changed answer takes effect.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route module self-accepts and the chunk's text doesn't change, so the chunk
keeps the exports of the route module's first evaluation until a reload.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An Identifier's range holds its annotation, so `renameRefs` took
`const comp: FC` for a destructuring's sibling and skipped it: the references
were renamed and the declaration wasn't, and in React dev the route threw on
`TsrComponent`. Declaration name ranges now hold the name as written, and
siblings are told by the Identifier's name, which an escaped name also needs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`const list = []; /* @__PURE__ */ mk()` moved the annotation with `list`: `mk()`
shipped, and in the chunk the annotation landed before the next statement, so
Vite and webpack-family builds dropped `list.push(x)`, a silently lost effect.
Comments before code on the same line that apply to it (annotations, licenses)
are no longer trailing; everything else keeps its behaviour.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A lowercase React route component renamed for HMR read the wrong property from
`if (x) { var { comp = null } = o }` or `({ comp = null } = o)`: only the
declaration's own pattern kept the key, and the page rendered nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`createIsomorphicFn().server(() => { use(label) })()` and the env-only calls in
statement position lost what their kept implementation reads: placement took an
edit starting at the statement's first byte for its removal, so the statement was
no effect root and `use` and `label` went, and the module threw at load.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code manipulation in virtual modules isn't supported (R36), and the bundler-read
question ended with changing nothing. These paths behave as at de9f0dc452 again;
their docs, `vite/virtual-text.ts`, its tests and the changeset's wording go with
them. A Vite build can hang on `virtual:` modules that import each other or on one
with a server-only marker: listed in KNOWN-BUGS.
The comment on the Rsbuild session's `readFile` keeps what was measured about the
input file system.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every row of an exported dotted namespace now has its binding (yuku-toolchain/yuku#318),
so a row with no binding can't overwrite what another row of the name knows: the guard
and its tests are gone. The pins of the shape flipped; one plain test keeps it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A rebuild kept the raw facts of a virtual module a plugin answers from a watched
file: nothing names the id in a file event, so a builder it became stayed unseen
and its handler stayed in the client. A rebuild reads the module again. An asset
query of a virtual id looked for the marker of the id without its query, whose
load fails the build where a plugin answers only the queried id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The key went in at `modifyRspackConfig`, before `tools.rspack`, which can set the
cache or replace its version. It now goes on the compiler's options when the host
plugin applies. A package outside node_modules with no build, or a directory
named like a script in it, no longer breaks the key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A type namespace named `Route` or like the options variable counted as a second
declaration of the value, so the route wasn't read: unsplit where main splits,
a false build error under Start's server options, and with an options variable
those server options in the client. It declares no value: such a route splits.
A `Route` that really is no single variable keeps warning with the existing
wording, only in a file of the route tree.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With RSC on Rsbuild the provider role covered both layers of the server
environment, while only the RSC layer lacks the router planner. A server fn nested
in code that moves out of a route module (a split component, a class's extracted
module) left the SSR layer's chunk importing a hoisted binding from the provider
module, which the RSC layer's plan doesn't export: the build failed to link. Main
builds. The SSR layer now compiles as Vite's SSR environment does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Rsbuild session read `node_modules/.virtual/` files through the compilers'
input file systems, which can't see Rspack's VirtualModulesPlugin files: 394 of
394 reads across the Rsbuild and RSC suites missed. Those files are missing to
the raw facts either way. The comment now says what was measured about the
input file system, and the Yuku references name yuku-toolchain/yuku#318.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route module holding the hoisted fn and the class's extracted module import
each other; every read across them is lazy. A separate provider has no router
planner, so its provider module never meets an extracted module. Real Vite and
Rsbuild builds, served and called.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A `Route` export that isn't one variable (a type namespace of that name, plain,
dotted or declared) left the route unrecognised without a word. It warns once
at the export, as a route not bound to a factory call does (R78).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rsbuild's `buildCache` keys on the app's package.json, config and tsconfig. A
compiler upgraded in place (a flat node_modules, a lockfile-only upgrade) kept
restoring the previous compiler's outputs, whose placement may have kept server
code in the client. Rspack's cache version now holds a key of the compiler
packages' manifests, and of their built scripts outside node_modules, where a
rebuild doesn't change the version.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The restart tests went from plain to builder, or asserted only that the server
starts. Back and forth across restarts on the same cache, the handler is in
the client exactly while `base` is no builder.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In a Vite build the raw facts read a virtual module through `this.load`, which
settles after the module's transforms. A compile among them that asks for the
same text (a marked module's own violation), or for that of a module waiting on
it (virtual modules importing each other), joined that read and hung the build.
A read now starts the load and is answered from the first transform hook.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every eager warning got longer for a rare shape; none of tanstack.com's eight is in a cycle.
The warning of a shared module names the first export in the source, in the right file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
webpack reads `export { K as "" } from` as `export *` (upstream, listed); the compiler's
output is valid, so that name runs on the other bundlers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`E.__defineGetter__('A', f)` read as a member access: it can put a getter on the object,
and a read moved after it saw the getter's value. Every value use must now be a read of a
declared member.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the fallback gone, `export namespace base.X` (types only) after
`export const base = createServerFn()` gives a row of `base` with no binding. The
summary took its `unknown` over the builder, so an importer's `base.handler(...)` wasn't
recognised and the handler's text shipped in the client, with no diagnostic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The placement fix (a chunk reads what the env module evaluates through the env tree)
and the cycle merge (exports that read each other share a module) together, on the
core and on the Rsbuild RSC app, dev and build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Yuku 0.26 has no file.exports record for `export namespace A.B`. The fallback to
bindingOf was a dependency workaround; the compiler takes an export's binding from
that record alone again. An exported dotted namespace with no other export naming it
keeps working, in the route module. With another name (`export { A as Z }`,
`export default A`) and only split code reading it, the route file loses `A` in a
build: pinned, and listed in KNOWN-BUGS with its upstream.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`class Z { o() { return A } }` next to `class A extends Z`, both exported, crashed at
load on every bundler since the copy rule stopped copying classes: each went to its own
extracted module and they imported each other, so which evaluated first depended on
the bundler and on the export's name (a TDZ or `extends undefined`). Main keeps them
in one module, so this was a regression of the rewrite. Every candidate of a read
cycle, direct or through what it carries, now goes to the output of the first in the
source. Nothing in such a cycle could load without the others, so nothing gets less lazy.
TSR_COMPILER_VERIFY fails on an import cycle of extracted modules.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Rsbuild panic `should have module graph module` on a warm restart is ours:
rebuildModules walked a snapshot of the compilation's modules, and compiling a
restored importer again can remove its handler module (no longer a server fn), which
was on the list too. Whether the handler came after its importer hashes the module id,
so it depended on the directory name. Each rebuild now checks the module is still in
the graph.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The registry's `routerConstructor` answer stayed active under `all`, so "if `all` fixes
it, it's a stale cache" didn't cover it. A new `registry` knob, part of `all`, reads the
route file instead; the output is the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TSR_COMPILER_VERIFY was right: `namespace A.B` was a type unit declaring nothing,
and `export import R = N.v` an anonymous effect, so a split component read `A` or `R`
with no binding in its chunk (a ReferenceError in production). Both now are
declarations of their name, like a plain namespace and a plain import alias.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A file literally named `a&tsr-split=export~%.ts` crashed a client build: the eager
export scan matched its own regex anywhere in the id and decoded the name. It now
asks `identify`, the owner of the query syntax, as does the split-importer test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`export { internal as Public }` warned about `internal`: an extracted module was
keyed by its local binding. The core now names the output after the first name the
module exports the binding under (`extractExport`, the one place planners declare
it), so its id, the post-build warning and the kept-declaration wording all say
`Public`. Keys of renamed and default exports change; outputs don't otherwise.
Tests pinning the old key of a renamed export follow it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`export enum B { X = A.Y }` and `enum B { X = 1, Z = B.X + 1 }` stayed in the route
module with a side-effects warning since member initialisers count: the member
read counted as impure. An enum's member is a data property, and the binding's
enum flag says it's one; whether it was written is the mutation model's question.
A declared enum, an imported one and a const object's member stay effects.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The `{ segment }` location was written and never read: every reader only wanted
source ranges. Emit is unchanged; the map buffer stays (see the follow-up notes:
0.15 µs per output with no map asked for).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The order of a range's edits is (band, n, nested), compared field by field, and
a derived output's after-header units sort at importsEnd with order -1 instead of
a fractional position. No rule that numbers stay under the gaps remains. Every
output of the corpora hashes the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A cluster the env module evaluates and a chunk reaches through it (a server fn
only `Route`'s loader calls) was walked in the chunk's tree, where its handler is
not erased. What only that handler reads counted as needed by the chunk. Since a
provider output stopped counting (c2397221de), that made the chunk its home: dead
code and imports in the SSR chunk of an RSC app; on Rsbuild the route's CSS module
moved to the entry's stylesheet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An extracted module evaluates before the route module's body. The load-time check
followed only a direct call of a local function, so an alias, a method of a local
object, call(), a function passed as an argument or a returned function read a
binding the route module keeps before its initialisation (a TDZ, or undefined from
a pinned enum), in builds only, and neither the self-check nor the verifier saw it.
The purity check already visits every call of a unit, so the unit says it calls
something; what it reads then counts as run at load, transitively.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clusters.ts: describeCluster (the invariants' names) and isDuplicable (the copy rule).
homes.ts, inclusion.ts: both imports; the copy rule's self-check names its cluster the
way the other invariants do. reach.ts: the stage order states the two facts the copy rule
added (copied survives the dev fold; homes roots nothing).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README: the summary paragraph keeps the parse model of the factcheck docs and the
registry answer. host.ts: fileModifiedAt next to the documented RouteRegistry.
pipeline.ts: the publication goes with its API; its comment's fact is in the README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An importer through the route file imports the route module, not the
extracted module, so the extracted module's importers cannot tell that
cause from a chunk group: the chunk-import wording names both and gives
both fixes (tanstack.com's showcase route has both).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The paired micro-bench read +2.1 to +2.6 % per module after the review
fixes: two new fields on every classified reference, each computed with
its own parent walk. They are two values of the existing context now
(`newCallee`, `identity`), decided inside the classifier's parent switch
with the member-expression case inline; the load-time index is built on
first use and the one-holder self-check runs only when a module has a
duplicate. Residual within the harness's A/A floor.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The orphan check in homes tested the needers without provider outputs,
so an import read only by a server-fn handler (a stub in the env module,
the body in the provider) was removed and the provider read an import it
no longer had. Caught by the Start planner tests; a core row pins it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Reviewed with five independent read-only passes over the rule; every
finding has a regression row.
- The copy walk stops at other candidates, effectful clusters, eager
readers of state, what the route module's own roots keep alive and type
units: each exists once by construction. An exported component reading
`Route` is copied again; so is one reading an effectful binding or an
object the route module keeps.
- A reference inside a module-level function an eager reference calls
runs at load (`runsAtLoad`): `readsKeptEagerly`, the placement
self-check and verify (e) see a TDZ through `const config = build()`,
which the new env rooting had exposed for plain literals.
- A function used as a constructor, an `instanceof` or equality operand or
through `.prototype` has an identity (`identityUse`): not copied.
- A copied export another extracted module reads is imported there from
its own module; only chunks copy it.
- Provider outputs do not count as needers when homing; a value an
extracted module and a provider share lives in the export module.
- The env rooting of a shared identity or state is reported
(`eager-split:shared`). A primitive constant with a member write is no
state. The one-holder invariant lives with placement's self-checks.
- The build-time eager-export warning names its cause from the bundler's
module graph: split code importing the module under a chunk group that
lands with the entry, or an importer through the route file.
- Docs: guide, README, SPEC J2.4, KNOWN-BUGS, hydrate planner comment, test
comments. Tests: core rows for every finding; fact-check rows for
constructors, sentinels and sibling exports; the F5 build matrix gains an
exported class; a new matrix groups the route files with the entry on
Vite, Rspack, webpack and Rsbuild; Start build and planner rows for an
exported class.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Every raw-facts build of a route file existed only for `routeTree.gen.ts`, whose Start prefetch
summarised all of them (1490 parses before the tree could be served on the large app, 58-83% of all
raw builds in real bundler runs) and reduced every value to `unknown`. The generator already parses
each route file and checks its constructor's binding; the registry now carries that fact
(`routerConstructor`), the prefetch answers an import of `Route` from such a file from the entry and
records a `route-registry` dependency, and a constructor change republishes the registry (new
`changes.registry` path) so the tree re-plans.
Removed with it: the transform's summary publication (`RawFactsCache.publish`/`peekRevision` and the
branch after planning), which never saved a parse: in every bundler the importer's prefetch reads a
target before the target's own transform (measured 145 calls, 145 no-ops). Output identical (in-process
hashes over every module and derived output); whole-app compile −13% client / −12% ssr in process,
dev-compile peak RSS −13% on the large app.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A reader written in a session's constructor held that scope, and so the owner
its WeakRef was meant not to retain: with TSR_COMPILER_STATS=1 no session was
ever released, on the knob meant for diagnosing memory growth. Readers are now
module-level functions or static methods.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The start-plugin-core integration worker ran out of heap on CI. Native
bundler callbacks keep the async contexts they were created in, and a Vite 8
build keeps its plugins for good. Through those, a stopped console sink, a
closed channel's listeners, a finished test and the dangling-name evidence
kept every build's results alive. All of it held the Rspack compilers too,
which are otherwise collected.
Peak heap after GC at 1 worker with a 2 GB limit: from 1995 MB and an OOM in
hydrate-build.test.ts to 1506 MB with all 115 files finished. What is left is
mostly Vite 8's retention, to report upstream.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An invalidation counts a plan stale when a resolver throws, and hosts catch
fire-and-forget invalidations. A package.json change moves the file-set version
and re-validates what it may redirect. Forgetting a file touches its own records,
and an add tests dependency paths without comparing their common prefix. A
warning reports a file whose ids reach the compiler with different text while
the file stayed as it was (R11).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The copy decision looks at what the copy would carry: the export and
every cluster it reaches that no output keeps once. Each must be a
function or a primitive constant nothing writes (isDuplicable). A class,
an object or array literal, a call result however pure, a regex, an enum
or a written binding in that closure makes the export non-copyable: the
chunk imports its extracted module, one instance, as a stateful export
always did. A non-duplicable pure cluster an extracted module and another
output both need stays in the route module, one instance, decided inside
the settle fixed point so an eager reader is still cancelled. The
verifier checks that such a declaration is declared in at most one
non-provider output.
instanceof across a route's split options and its importers, a
@__PURE__ context's Provider and consumer, a sentinel, a subscriber list
behind exported functions and every form of member write now hold in
production builds as they do in dev and on main; the pinned fact-check
rows pass in Vite 8, Vite 7, Rspack, webpack and Rsbuild. SPEC J2.4,
KNOWN-BUGS, the README, the architecture doc and the build-time
eager-export warning describe the rule.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A save the watcher sees in the millisecond a compile starts is compiled
twice: Watchpack's `safeTime >= startTime` reports the file again when the
watcher attaches after the compile. Plain Rsbuild does the same, with the
same output. The test counted builds, so it failed 3 builds to 2 at random
(CI included). It now checks, per environment, that the edited module is
the only app module built.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fact-check of external review 2, findings 1–4, on real production builds
(Vite 8, Vite 7, Rspack, webpack, Rsbuild) with the output executed, and a
dev twin. Pinned where today's compiler fails: the private state a copied
exported function closes over is copied into every chunk and extracted
module in a build (one instance in dev and on main); a copied class,
annotated call or literal has another identity in the chunk and for an
importer; the mutation model's syntax does not stop the copy of an exported
object or class written through `this`. A probe records where a non-copied
export lands, plain and under a manualChunks group.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The router plugin and Start changesets still said such options fail the build (R92 amendment 3).
A route module that doesn't parse is no warning in a build (R86). The asset-query changeset names
what its pins still leave out.
A wrapper of another module passing its parameter to createServerOnlyFn: the build is the
guarantee (R84 amendment), and the pin asserted a dev-served consumer. Now a build row at the use.
The isomorphic fn through a helper is listed under Remaining pins, and a build error flips it (R92).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The registry's keys are /-separated on every platform and the uniqueness error names
files in the platform's own spelling, as on main; the assertions used path.join and a
literal /. Reproduced on Linux with node:path as path.win32: the same four failures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SPEC J2.8 changed: what the compiler can't read builds and warns. The pin that wanted it
removed or refused now wants the warning.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`const f = createFileRoute` is judged like the factory. A call other than the route's own with
options the compiler can't read warns, naming what ships. Options written to after their
declaration are options it can't read. Start's server environments leave the warning to the
client's compile, so a file warns once. Docs, SPEC J2.8, J2.11 and J4.12 and the changeset say
what holds now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route adopts the object it's given, so a second evaluation of the file finds an imported
or singleton options object already holding the route's id and path, and throws.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A call of the fn at the end of its chain carried on the chain past it, so the fn was never
compiled and its `.server` implementation shipped. The fn's chain ends at the call, and what
it returns starts a new segment. The client's implementation decides what the fn gives the
client, even an unknown; the server's speaks only for a fn without one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Not cheap: an exempt importer's `import(marker)` is refused where main builds, a vetoed one
loses its default export, and telling them apart takes per-output marking. A top-level
`import()` of a marker marks its module, as before.
This reverts commit 60ee8f6edd.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The profile's one client-only cost: every route file read its factory references'
nodes and parents to find calls it doesn't own, though the usual one has one call,
its own. The warning's option names are also built only for a warning.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fix needs a special case for plugin-vue's generated object, so it isn't taken for now
(R92 amendment 3): the block compiles in a build and is a compile error on the dev server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Instead of marking the module from the raw source, the edge is judged per output: a
dynamic import of a marker that survives in this output is refused at the import, and
one in erased code (a handler, a server-only fn) isn't there to judge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A spread, options from a call or an import, and a computed key refused a Start client
build. Some big users write these (R92 amendments 2 and 3): the build goes on and warns
with what isn't split or removed, that server code in it ships, and what to write
instead. Written properties behave as usual. A deleted option written after a spread or
a computed key stays as `undefined`, since removing it would let what those hold win.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In a development `<script setup>`, `@vitejs/plugin-vue` exposes the block's bindings to
the template through `const __returned__ = { base, get f() { return f } }`, so a module
importing a factory or holding a builder failed on the dev server while building fine.
That object is recognised narrowly (a `.vue` file, the generated name and `__isScriptSetup`,
a shorthand or a one-statement accessor); an object the block writes stays an escape.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`const clerk = createIsomorphicFn().server(() => serverMw).client(() => createMiddleware())`
was refused, and allowing it as data left `clerk().server(() => db.x())` shipping
its code. The value is followed now: a call gives what the client's implementation
returns (the server's when the client has none), so `clerk().server(fn)` has its
`.server(fn)` stripped like any other chain, `.middleware([clerk()])` compiles,
and the same for `createServerFn()` returned that way. Passed to unknown code, the
fn or its call's value are open and refused. `createClientOnlyFn` stays refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reading `r.node` of every import's references materialises them: +1.7 % per module
in the micro-bench. A namespace is rare, so its reads are mapped there. The check
that a binding is written reads the references' flags too, not the mutation model.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The check that a binding holds one server fn also counted a merged type-only
namespace as a declaration, so the corpus's `export namespace fn { … }` before
`export const fn = createServerFn()…` went through the nested path, which refuses
effects in its options. Only a written binding leaves it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The late pass compiles every late module with start-env (its gate decides from
imports): a text gate missed `base.handler?.(h)` and a re-exported factory. A
late module exporting an open builder fails the client build: an importer reads
the file, not this output, so it can't follow it.
- A project namespace read through another namespace is followed, and a namespace
only read (`console.log(ns)`, `!ns`, `'x' in ns`) is no escape; one rule for these
reads with the climb's, and a tagged template is no such read.
- A builder returned through an isomorphic or client-only fn, in an object or as a
factory given to it, is refused; an open middleware an implementation returns stays
data, since real apps return `createMiddleware()` there.
- An assignment's value is followed, a closed binding isn't reopened by a write, a
`var` holding a builder after any other value is refused, a TS namespace's exported
function is refused, a `const` list read twice compiles.
- A written binding holding a server fn no longer serves its RPC: the id of one fn ran
the other's handler.
- RSC primitives are open values: stored or passed, they fail the build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main fails a client build on `import * as m from '…/server-only'` and on named and
default imports. `import()` of a marker inside a function may be code an output
erases (a handler, a server-only fn): main builds those, so only a top-level one
marks the module. One test read a default import of a marker as no marker; it
now asks the marker there, and no marker of a plain string.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`index: export * from './a'; export * from './b'`, `a: export { base as x } from
'./index'`: asking `index` for `base` while resolving `x` is no cycle, as the
spec's ResolveExport has it. Cut on the module, `x` was unknown, and `.handler()`
shipped silently. Main compiles it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What the compiler follows, what it refuses and what it leaves alone: `import()`,
`require()` and globs of Start values and other plugins' modules aren't followed; a
`.server` file behind a neutral module outside the scope isn't caught.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main compiles it, and it costs a member transfer on the value domain: the factory's
`.call` is the factory. The env-only factories and `createStart` stay refused: their
first argument matters to the compiler.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`renderServerComponent(<Secret />)` outside a handler kept the component and its
imports on the client: only a surrounding server fn erases the argument.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A second `createFileRoute` call, a wrapped one or a stored factory kept `server`,
`ssr` and `headers` on the client. The generator takes one `Route` export per file,
so these aren't intended (R92 amendment): under `deleteNodes` the build fails at
the call when it carries one of them, and nothing changes otherwise.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main treats these as markers and fails the client build; head only read bare
imports, so a marked module shipped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only `virtual:` was analysed, so a builder module behind an alias or a plugin's
scheme (`app:b`) was unreadable, its export unknown, and `.handler()` shipped
silently. Main follows them. Runtimes' schemes stay unread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`resolverFactory.get('normal')` applied no `import` condition, so a package with
import-only `exports` (a workspace library, an alias or `#imports` of the Start
package) resolved for the bundler and not for the compiler: its export was unknown
and `.handler()` shipped silently. Vite was right.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`const common = [logging]; createServerFn().middleware(common)`: a list only read
by a Start call is followed to it, also through `?:`, `&&` and a spread. A
`.client()`-only value stays open (R92 amendment): an exported list, a `let`, a list
read otherwise and any other stored or passed use stay a build error, with the
`createClientOnlyFn` hint.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`console.log(base)` fails while debugging, and `typeof ns` reads no member of a
namespace. A `console` the module declares stays an unknown function.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`createIsomorphicFn().client(() => createServerFn())` and `createClientOnlyFn`:
a Start call's argument was data, but these hand back what the function returns,
so `.handler()` on the call's value shipped. An exported declarator in a `namespace`
is read by no reference, so nothing was followed. Both fail at the use now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`let base = createServerFn(); base = base.middleware([])`: a partial chain (R92),
compiled by main and head; R84 refused it as reassigned. A write of anything else
stays refused, and so does a builder written to a binding holding something else.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`createServerFn().handler(h).bind(null)`: the climb returned without recording
the chain, so the handler shipped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R92: the client erases a validator like a `.server()`, so what callers pass for
it ships on every call. It was a warning; it is now the same error at the argument.
The rows of the next commit's `.bind` shape are in the same test table.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R92: a build error is enough for a wrapper, and a build error that guarantees no
leak beats an `ok` with holes left. An identity helper that also stored its
argument (`reg.base = b; return b`) let the builder leave unseen. A builder passed
to any function is now a `flow` error at the argument; a finished server fn may
still go through one.
An isomorphic fn wrapped after its `.server()` is not refused (its server code is
gone) and throws at load, as on main: the pin goes back to `.fails`. SPEC J4.5 no
longer lists wrappers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A namespace object handed to unknown code fails the client build when its module
exports an open builder, so the build harness reads the start instance's options
as Start's runtime does, and the rows exporting a builder expose what the page reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A type, an interface, a type-only namespace, an overload signature or a
`declare var` before a declaration of the same name made a builder `unknown`:
no chain, no escape, and `.handler()` shipped its handler silently. Main
compiles these. A later `var` holding a builder under an earlier value is
refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A namespace of a project module that reached a module through an export
(`export * as`, `export { ns }`, `export default ns`) had no member read, so
`middle.authed.handler()` shipped its handler silently. Prefetch now names the
namespace by its module and reads its members in the importer.
A namespace object that goes anywhere else (an object, a call, a rest element,
another namespace) is judged in the importer's own compile, with a location:
if an export of its module takes server code, the client build fails there.
Reads through a cast are followed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R92: static analyzability is expected. `import()` and `require()` of a Start
package neither fail nor warn.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R92: `import()`, `require()` and `import.meta.glob` of Start objects neither
fail nor warn, so the check's main use goes, and its false positives with it
(a dynamic import of a module with a builder sibling, the text `require(`, a
virtual barrel). The escaping namespace it also judged comes back in the
importer's own compile, in a following commit.
A late-pass module that names no Start package and finishes a builder of
another module was compiled by nobody, and only this check refused it: the
late pass now compiles a module whose text calls a builder's method.
Test apps go back to their base form.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`createServerFn().handler(h).bind(null)`: the client analysis ends the
chain at the method of the finished server fn without keeping it, so the
handler is neither replaced by its client call nor reported, and ships to
the client with its server-only imports. The branch's base behaves the
same (not checked on main). Pinned with `.fails` (KNOWN-BUGS.md, Remaining
pins).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The changeset lists what Start now compiles and what fails the client build;
SPEC J4.5 gains the recognised forms and the failure rule (at the use, and at
the end of a client build for importers of a module exporting a builder).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The checker of the test runs (TSR_COMPILER_VERIFY) matched an output's
relative imports to the module's own outputs by file name, so
`api/cost.ts` importing `../../core/cost.ts` failed as importing names its
own env module does not export. Only `./<name>?<query>`, how glue imports
name the module's outputs, is one of them now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
createIsomorphicFn().server(f) as T, without .client(), compiled on the
client to `() => {} as T` (and an arrow implementation with a block body,
cast, likewise), which does not parse: the replacement's parentheses were
decided from the parent of the cast, while the edit replaces the call inside
it. Start's own createCsrfMiddleware has this shape.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A module another plugin compiles to JavaScript from a file that is not
JavaScript (.mdx, .vue, .svelte, .astro, .marko) reached the compiler only
through import protection's late pass, Tier 0: a Start builder there kept
its handler on the client. When its text names a Start package, the late
pass (on Vite and Rsbuild, with or without import protection) now runs
start-env on it too, in place: the provider keeps the handlers in the module
(no lazy handler module), and a server fn under a separate RSC provider is
refused (both would be derived modules, which load the file).
Core: CompileInput.inPlace lets a host plan such a module with Tier 1
planners; a plan of one that declares a derived output throws.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A client compile records the exports server code can still be attached to
(builders, factories, a start instance, a re-export of a Start package), the
namespace imports whose object it does not follow, and its import() and
require() specifiers. At the end of a client build (Vite buildEnd, Rsbuild
finishModules; Rsbuild replays the records from each module's buildInfo, so
a warm persistent cache stays checked) the Start session follows each such
module into its importers in the bundler's graph: each must be a module the
compiler compiled, importing it statically. A dynamic import, a require() or
import.meta.glob, an uncompiled (virtual or generated) module or a passed
namespace object fails the build naming both modules; an importer
re-exporting one of those exports (read from its summary) is followed the
same way. Start's own packages (by their package.json name) are not
followed, and their modules are trusted importers (the client runtime reads
the start instance's options); a dependency's exports are not followed. In
development the check runs when such a module compiles, over the importers
the dev server's graph already holds (best effort).
No importer resolves anything at compile time: the producer records, the
build checks.
Test apps that handed a module exporting a builder to page code adapt: the
build harness's client entry reads the start instance like Start's runtime
instead of exposing the start module; one build-inputs row exposes the
exports its page reads; an export-cache app keeps its builder chain out of
the harness page's glob; an env-separation entry no longer re-exports the
start instance; an import-protection row's client-only isomorphic fn gets a
server implementation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every place Start's analysis stops following a value is now classified: a
position it follows (a chain link, a binding, a join, a function's return,
an export), a use as data, or an escape. A value server code can still be
attached to (a factory, a builder, a start instance, a middleware or
isomorphic fn without .server(), a Start namespace, a function returning one)
escapes when it is passed to unknown code, stored in a container, a class
field or an assignment, awaited, read off as a method (.handler, .call,
.bind) or an unknown member, returned from a function the domain cannot
summarise (control flow, async, a generator, a method), held by a
reassigned binding, destructured other than as a namespace's factories, or
imported dynamically.
A parameter that reaches server code: every call keeps its argument on the
client, and nothing looks across modules. Passed directly as the server code
(`(fn) => createServerOnlyFn(fn)`, `.server(fn)`), its argument is certainly
server code, so the client fails at that use. Only read inside the server
code (`requireRole(role)`), it gets one warning at its definition. A server
fn handler's captures stay the existing J4.6 error.
The client reports each one as a located error, through a new core hook,
`PlanContext.liveDiagnostic`: reported only if the code ships, judged once
every planner erased what it erases, the orphan cleanup ran and placement
decided what each output holds (a use inside a handler, a server-only fn, a
route's server options or a declaration only they read is none). `at`
judges another range than the one reported (an argument the planner erases,
in a function that ships). Server environments report nothing. In dev the
module fails like any compile error.
Three pinned shapes now fail at the use; the wrapper of another module
stays pinned (a dev server serves its caller before the wrapper fails; the
build fails).
The bundle-size scenarios stop storing the Start factories as values (the
middleware and server fn of each scenario keep them imported).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The value domain (shared by summaries and the local analysis) reads a
binding destructured from a namespace or start instance as its member
(`const { createServerFn: csf } = Start`, `const { createMiddleware } =
createStart(…)`), a sequence as its last operand (`(0, createServerFn)()`),
a ternary or logical expression as the join of two values of the same kind
(kept symbolic in a summary until its imports are known), and a factory's
single return after statements that cannot return. An async or generator
function returns no Start value. Start's analysis climbs through sequences,
starts a new segment at a join (each branch keeps its links and edits), and
follows destructured bindings at any scope; its prefetch resolves the names
destructured from an app namespace.
Two pinned shapes (a namespace destructuring, a ternary-chosen builder) now
compile; a table of the builder shapes the client compiles pins the rest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review 1 claim #10: a namespace destructuring, a builder method read into a
variable, a ternary-chosen builder, a block-bodied factory and wrappers of
createServerOnlyFn are neither compiled nor reported (SPEC J4.5, J4.12, G5).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One file-or-marker verdict for edges, a module's own violation and asset queries
(excludeFiles skips both). A denied file exclude matches is judged too. A virtual
asset is never read back through the host. On Rsbuild only an asset that can be
denied meets the loader, on clients. Docs say what is covered; the asset-query
tests split at the file budget.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scope is about importers: a pattern reaching a file outside it, a plain glob of
a denied data file and Rsbuild's new URL of a text file are mocked and reported, as
main reports them. An app file outside the scope is indexed like an exempt
importer: it keeps the real module of a denied file outside the scope too (J6.7),
and the mock of one inside it (R89).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pitch-only loader on Rsbuild (an asset's bytes are never decoded), a virtual
id keeps its own marker, a rebuilt asset drops its stale verdict, excludeFiles
and marker conflicts as on a compile, a server keeps text and URLs, pure static
asset imports. A hash after an asset query is code (no bundler honours it there).
Pins for the forms still unreported.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Yuku's `declarations` getter builds its array and nodes on every read: the loop read it for every
module binding, +2-5 % per module with identical output.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A comment holding a statement's line break stays with what it leads (annotations, licenses); the
statement gets a line end of its own in the env module instead. Only `var`s declared again are
writes (a type of a const's name made it reassigned; a catch parameter's name is not the binding).
`erasedParts` ended in a loop on an edit on exactly a hidden claim. A statement after generated text
or a statement that went gets its `;` from what actually renders before it. A build fails on a file
it knows broken only while the file still holds that text, and names every broken file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every read of a batch settles and a file that does not parse outranks another failure, so neither a
deleted root route nor an unreadable file hides it; a build reads what it builds, whatever the stamps say.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`var x = 1; for (var x of [2]) {}` left the chunk a copy of the first declaration, and a read between
two declarations took the last value. The Rolldown case that remains is pinned (upstream).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`createClientOnlyFn`, an isomorphic fn's `.client()` and `<ClientOnly>` children run on the client,
which calls a server fn defined inside them; the server answered 500. The provider hoists it as any
nested server fn (a hidden claim).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A route file's last statement may end without `;` and without a final newline, or in a
line comment (the chunk then lost its export silently). A multi-line comment's line break may be
all that ends a statement. Pieces of a derived output start on their own line, a statement owns
the comment that ends it, and a generated unit in the env module starts on its own line. A
statement starting with a parenthesis gets its `;` after a generated unit above it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reverts the literal-leaf analysis of 4d8a5415a1 and 9115cf4405 and the parts
of e3a8dc5cfe that exist for it (R90 amendment): a plain server-side call in
a declaration the client also reads is not chased. Removed: the literal value
removal, its write and `__proto__` guards, the planner-owned element check,
`topLevelWithin` skipping an edit that starts with the range (only an erased
array element could do that), and `propertyKeyName` moves back to the router
planner.
`const [a, b] = [next(), next()]` with `a` read only by removed code gives
`b` the second value again. A destructuring default of a removed leaf still
goes, also next to a rest element.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Five reviewers over the lane's diff (bundle-size skill, coverage step); each
fix has a test that failed first.
Regressions of the lane:
- An array literal's element a planner rewrites at exactly its range (a
server-only fn, a hoisted server fn) failed the compile ("both rewrite") or
emptied the hoist: an edit or claim on exactly the element stays.
- `[createServerFn()… as any, 'T']`: `topLevelWithin` stopped at an erasure
starting where the claim does, so the hoist lost its edits and the server fn
returned undefined.
- A dropped literal value that writes (`{ a: ++n, b: n }`, `reg.push(1)`,
`window.x = 1`) changed what kept code reads: it stays. Calls' unknown
effects still go, as for a plain declarator (J4.12).
- A literal with `__proto__` (a getter of the prototype reads `this`) is left.
- `export default` above an overload signature or an interface lost the
function's extraction (`declarations[0]`).
- Generator: a failed non-structural build batch lost the route change it read
(`stale` was set only after the check).
Incomplete fixes completed:
- A server fn nested in another one inside a deleted option: a hidden claim
inside a hidden claim is live (its placeholder's reads count).
- `snapshotDiffers` reads every declaration: a later `var` above which another
`var` or a type declared the binding.
- An orphaned object rest element's literal values go with it.
Also: the `sameRange` guards under a hidden claim guarded nothing observable
(a test with and without them pins it): removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The micro-bench put solid-start ssr at +0.88 % ±0.27 and react-router client
at +0.74 % ±0.55 after 7f69ca9a87, with identical output (40 paired rounds; a
dist swap of `rewrite.js` alone made it neutral): `tree()` asked for the
claims read elsewhere on every rebuild, `placeholderRenders` looked for the
claim edit and whether it renders, and `isErasedAt` lost its early return.
Only a claim whose occurrence is erased can need that answer: `tree()` now
takes the old path until one is, computes the readers then (no cache), and
records the kept ones (`hidden`, relocated only), which `placeholderRenders`,
`isErasedAt` (only a hidden claim resets an enclosing erasure; without one it
returns at the first) and `erasedParts` read. Every other claim has exactly
its old semantics.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-up of the literal-value cleanup (c7709a1a13): `const { picked,
picked: kept } = { picked: secret() }` (or `{ picked, [name]: kept }`) with
only `picked` orphaned lost the property `kept` reads too. A key a pattern
property that stays reads keeps its value, and a staying computed key, which
may read any, keeps the whole literal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A run's outcome is its drain's last batch, but only the batch holding the
`build` event checked for route files that do not parse: an event arriving
while a build generated (its own batch, after the build's) kept the broken
file's last good route, published it and resolved the build (R86). No host
sends an event during a build's generation; the generator's own `run`
reaches it. The build flag is now the drain's: while a `build` run waits,
each batch is a build, so the last batch, which settles every waiter, is
one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`export default items; var items = ['a']`, the split component reading
`items`: the statement runs before the initialiser, so the default export
holds `undefined`, but the env module's glue reused `default` for the
binding (the chunk imported `undefined` and threw), and without another
reader the export became the extracted module's re-export of `items` (the
route's default export became the array). Main kept the component working
by moving `var items` to its shared module, which also changed the default
export to the array.
One predicate, `Tier1.snapshotDiffers`: `export default x` may not be the
binding when `x` is reassigned (the rule for `let`) or declared after the
statement by anything but a hoisted function. The glue name reuse
(`existingExportName`) and the extraction companions read it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start SSR with `router.codeSplittingOptions.deleteNodes: ['loader']` and a
server fn defined inside the loader: the client keeps the loader and calls
the server fn, but the server's RPC wrapper called `tsrServerFn$greet`, a
hoist the core had dropped (500, ReferenceError). The core killed every
claim whose occurrence a planner erased, owner included; the provider's
hoisted chain is a declaration its wrapper reads, as a top-level server fn
read only by the deleted loader stays (that case already worked). Main
never compiled a nested server fn (its handler shipped to the client).
A claim whose owner other generated code reads (another unit, another
claim's placeholder) is now always in the render tree: an erasure of its
occurrence removes only the placeholder there (`placeholderRenders` asks
whether the claim edit renders), and the owner stays while placement
reaches it. Liveness inside any claim is decided by the edits inside the
region (it renders inside its owner), unless an edit on exactly the region
replaces the placeholder in that output; `erasedParts` carves such a claim
out of an enclosing erased part. Other claims die with their occurrence,
as before (their owner is only reached through it).
TSR_COMPILER_VERIFY's unbound-read check (g) also covers generated names:
it now fails the compile of the old output.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`const { title, secret } = { title: 'Hi', secret: readSecret() }` (also
next to a rest element, and `const [title, secret] = ['Hi', readSecret()]`),
`secret` read only by a deleted `server` option (or any erased code), `title`
by the split component: the orphan cleanup pruned the `secret` leaf but the
literal kept `secret: readSecret()`, so the chunk imported and called the
server-only module (R84; main kept it in the route's shared chunk). The
literal a declarator destructures is a new value nothing else holds: the
property (one plain property per key, in a literal without accessors) or
array element (before any spread) of a pruned leaf goes with it, under the
declarator's rule for effects (module level: they go; function level: pure
or server-only, never a hook call). A pattern nested in another one is left
as written.
The router planner's `propertyKeyName` moves to the core (`source.ts`) so
both use one key helper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A removal's stale dependents were built by a second compilation; the one
in between re-resolved the old route tree's import of a renamed route and,
when Rspack's MultiCompiler held the next run back, reported "Can't
resolve './routes/renamed'" (route-edits-after-tree-rebuild, 4 in 10 runs).
A removal needs no resolver now: it is invalidated at watchRun with the
edits; only creations wait for make.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A bundler's resolver may still cache the removed file until its own next
compile (Rspack clears an environment's resolver cache when that
environment's compiler rebuilds): an unlink invalidated while another
environment compiled re-validated that environment's plans against the
stale answer, and the plan of the module importing the removed file stayed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack converts a structured custom buildInfo value field by field, into
the module at every build and back at every read: a warm start read every
restored module's plan that way (~40 ms for 1,100 modules).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack copies a module's custom buildInfo into the module at every build
while any cache is on (dev's memory cache too): persisting every compile's
plan cost ~90 ms on an edit that rebuilds 1,700 modules. Only Rspack's
persistent or filesystem cache restores modules in another process.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A file whose facts a plan read but no compiled output imports any more (the
end of a re-export chain an env-only factory comes from) was watched only
through the loader's file dependencies: `rsbuild build --watch` never saw its
edit. The plans' dependency files of the compilation's modules are added to
the compilation's file dependencies (no module depends on them: the
invalidation decides what is stale). Import protection's `mock` rows go
back to the original test with one assertion changed: the importer is not
built again; with `log: 'always'` the compile the edit causes reports again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The loader registers no fingerprint path as a file dependency and resolves
outside the loader context (the resolver `getResolve()` gives, got in a
compilation), so a module depends on its own file only. The core's
invalidation decides which modules are stale: edits are invalidated at
`watchRun` and their stale dependents join the starting compilation;
creations and removals at `make` (Rspack's resolver cache cleared), their
dependents built by the next compilation. Successful resolutions are kept
across compilations (no per-compilation `fileSetVersion` bump). Plans persist
in `buildInfo` and are checked at a compiler's first `finishMake`: a stale
restored module is built again, the others join the invalidation.
Import protection's two `mock` rows that relied on every importer of an
edited target being rebuilt now check that the importer is not.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`invalidate()` on an add also re-asks the resolutions the new file may take
(a file of the same name with another extension, or of a directory a
resolution went into, or a package.json there). `restorePlans()` checks plans
a host persisted with modules a bundler's persistent cache restored
(`CompileOutput.persisted`): current ones join the environment's plans as
restored plans (never a hit; `invalidate()` reports them; a compile
replaces them), stale ones are returned.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At f85217dbf0 a comment in a widely imported module rebuilds every importer
(28 modules instead of 2), an edit that makes an export a server fn builder
passes, and a file that shadows a resolution (`./lib` -> new `lib.ts`)
leaves the importer compiled against `lib/index.ts` (server fn handler
kept in the client). The delete/recreate and the three persistent-cache
restarts pass (pinned).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An edit may take more than one compile (a plugin tells the compiler that
more files changed); `rebuilt` lists the modules of each one since the
last edit began.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A glue export name differs from its binding's name only next to a value
`export *` (`tsr$x`) or when an export of the module takes the name
(`x$1`); the HMR ignore list asks the core for it only then (one set lookup
per module-level binding otherwise).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The `glueExportNames` fragment was a fifth Frag shape on the hot paths
that switch on a fragment's kind (rendering, reads), and the namespace-member
purity check ran on every member expression: together about +1 % per module
compiled in a React dev client (micro-bench, router planner alone). The core
now gives a planner the glue name a binding gets (`glueExportName`, through
the base rule freeze allocates with: `tsr$x` next to `export *`, `x$1`
when an export takes `x`), and route HMR prints it; the namespace check is
skipped, with no set allocated, in a module without namespace imports.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit listed only the route, the anchor and the glue: an
edit removing an export the user had just added (`export function Page`,
then `function Page`) reloaded, since `Page`, no export of the user's
anymore, was no longer ignored (route-hmr-after-split-change,
start-dev-route-split-change). The R41 amendment ignores the module-level
names the user does not export; the list is those names, as before this
lane, plus the glue export names (`glueExportNames`), so a glue export
renamed `x$1` or `tsr$x` is ignored too. User exports stay validated:
names come from the source, never from an export the glue reuses.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A route file whose text names no `Route` was taken for a file without a
route before it was parsed: `import { createFileRo` left the tree with a
warning in cold runs and builds (main rejected it). Every route file is
parsed; one that does not parse is handled as any other.
- The root route parse of the previous commit read a `.vue` root's whole
text: an SFC root failed every run. Single-file components are not parsed.
- A route file a failed read left out of the generator's files (a dev
start with a broken virtual root outside the routes directory) was no file
of the generator's for its events, so fixing it regenerated nothing. The
files of the last scan are known.
- The cold-run test asserts the rejection (it accepted keeping the route).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`const { secret = readSecret(), ...rest } = …`, `secret` read only by a
deleted `server` option (or any erased code), `rest` by the split
component: the property must stay so its key stays out of `rest`, and its
default stayed with it, so the chunk imported the server-only module (R84;
main leaked it to the route's shared chunk too). Once a round of the orphan
cleanup prunes nothing else (the rest element may go first, and the property
with it), such a property's default goes, with what only it reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With deleteNodes addressed to every output, a deleted component option
written as a method, the route's only option without a trailing comma, spans
exactly the region React route HMR claims to hoist it, and an every-output
edit on exactly a claimed region travels with the region: the option stayed,
reading an import its removal had dropped (dev, router plugin alone; Start
deletes no component option). The hoists skip deleted options; they are no
components of the route.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit listed every module-level binding through an
`exportName` ref, which rendered a binding's existing export name when the
glue reused it: an aliased or default user export the split component reads
(`export { label as navLabel }`) was ignored by plugin-react, so an edit of it
applied in place and the route file's importers kept the old value (R41
amendment: only the route, the anchor and the compiler's glue are ignored).
Names other bindings export (`export { y as x }`, `export { x } from`, an
`export *` target's) could be listed too.
The `exportName` SymRef context is replaced by a `glueExportNames` fragment:
the names the output exports as glue, decided by placement. The HMR block
lists the route's export names, the anchor and that fragment.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`Page.icon = Icons.Home` with `import * as Icons` counted as an effect of
its own (every member read was impure), so an exported component with such
an augmentation stayed in the route module with an `effects` warning. A
module namespace's [[Get]] reads the module's binding and runs no code (no
accessor, no proxy; ECMA-262 module namespace exotic objects), the same read
as an imported identifier, which the purity model already treats as pure.
`ns.x` and `ns['x']` are pure now; a property of an imported object or of
a namespace member's value may be a getter and stays impure. Main kept the
component in the route module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R86: a route file the generator cannot parse fails a cold run naming it.
The root route file was never parsed (only checked for emptiness), so an
unparsable root went through `tsr generate` and the build's generation; it
is parsed now (`routeFileErrors`, the analyzer's parse), with the same
handling as other route files. A generator that built or watched before kept
a broken file's last good route in a later build: the session's `build()`
now sends a `build` event, and such a batch fails, before it writes
anything, on every file whose content does not parse (`FileState.unparsable`,
recorded when its last good facts are kept). Dev and watch runs still warn
and keep the route.
Main read the root without parsing it (the bundler then failed on it) and
had no last good route.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A binding the route module keeps for its chunks is exported under a glue
name. In a module with `export * from …` that name could be one the star
target exports, and the route file's importers then got the route module's
binding instead (Vite, Rspack, webpack). Such modules now export glue under
the compiler's own names (`tsr$x`); main exported no glue from the route
module.
The React + Vite route HMR ignore list named module-level bindings by their
source name, so a glue export renamed `x$1` (a type export of the same
name) or `tsr$x` was validated by plugin-react and every edit reloaded the
page. A new `exportName` SymRef context renders the name an output exports a
binding under, without reading it; the HMR block lists the bindings through
it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`export default count` holds the value `count` has when it runs. A chunk
needing a `count` the route module keeps imported it by that existing name
(`import { default as count }`) and never saw `bump()` change it; an
extracted function writing `count` next to `export default count` now
re-exported the default as the live binding (since the previous commit).
The analysis marks such exports (`snapshot`); of a reassigned binding they
are no glue name (the binding gets an export of its own) and no export
companion (the statement stays in the route module). Main failed the build
(the shared module's `let` was assigned through an import).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An export list or `export default x` that reads only one extraction
candidate's cluster renders as the route module's re-export glue, but the
glue named only the bindings the planner offered that output (first one
wins per cluster) and the inline-exported declarators. `const { Page, Other }
= views; export { Page, Other }`, `export { Other }; export default Page`
and `let count; function bump() { count++ }; export { count, bump }` lost
`Other`, the default export and `count` (a build failed on the missing
export). A companion's bindings now join the candidate's. Main kept them in
the route module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An unexported cluster with an effect observable on its own (`Card.x =
track('card')`, `const Card = track('card')`) that only an extracted
export needs moved into that export's module. The webpack-family hosts mark
every such module side-effect free, so the effect ran when the split chunk
loaded, after the route module's later effects, or never. The movable test
now keeps such a cluster in the route module on every bundler; the extracted
module imports it from there. Main kept it in the route module.
Kept-export warnings now name the cause a candidate was cancelled for,
recorded at the cancellation: an export kept by the order rule or by an eager
read of a kept binding was reported as read by the route module itself
(`live`), since it had become an env root by the time the reason was
derived. The order wording names the effect before the export, with its line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A destructuring leaf only a deleted option (server, ssr, headers) read was
pruned in the env module only; when its declaration then moved to a split
chunk or an extracted module, that output kept the leaf with its server-only
default and import (R84). The deletion is now addressed to every output, so
the orphan cleanup removes the leaf wherever the declaration renders. Main
kept it in the route's shared chunk.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R89 amendment: when every importer of a mocked denied file in the build's
graph is exempt (exclude/ignoreImporters) or outside the scope, the build
prints one warning naming the file, its importers and the fix. Not a
violation: onViolation is not called and the error behaviour does not fail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An importer exempted by `exclude`/`ignoreImporters` that reaches a denied
file only through a pattern import, and an importer outside `srcDirectory`
importing an in-scope denied file, get the mock instead of the real module
(Vite build/dev/bundledDev, Rsbuild build/dev). Recorded in KNOWN-BUGS under
"Known incorrect rejections (accepted, R89)"; controls show the same exempt
importers' plain imports get the real module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Route factories are recognised by their import binding from a router
package, so a route file importing `createFileRoute` from an app module
that re-exports it was neither split nor hot-updated, silently; under
Start its `server` handler and what it imports shipped in the client.
A callee named like a route factory (`createFileRoute`, `createRootRoute`,
`createRootRouteWithContext`, `createLazyFileRoute`) bound to an import of
another module is now reported once per file, with the fix (import it from
the router package); where `deleteNodes` must remove options (Start's
client) it is an error, like route options the compiler cannot read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A denied file reached only through an import the compiler does not read
(`import.meta.glob`, a template literal `import()`, Rsbuild's
`import.meta.webpackContext`) ran in the client unreported on every host,
also with the `error` behaviour: the plan judges the imports it reads, and
the bundler expands these after the compile.
Judged from the target's side now: a module that a file rule or its own
marker denies in the environment it is compiled in is its own violation
(each import of it the plan reads is substituted, so an unread import
brought it there). The host serves its mock unless the module is allowed:
an import of it was vetoed, or an exempt importer (`exclude`,
`ignoreImporters`) imports it, whose imports the planner now indexes (it is
compiled before the module it imports). A dev compile reports it then,
naming the module itself; a build decides it on survival like every build
violation (mock first) and names each importer from the bundle's graph.
Rspack's graph view looks through context modules for that.
Main mocked these silently except in Vite builds, and mocked them for
exempt importers too, which keep the real module here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start's cross-module prefetch checked one `active` set shared by all of a
module's lookups before its memo, so a second concurrent lookup of the same
(module, export) read the first one's unfinished work as a cycle and got
`unknown`: with two builders derived from one imported builder, one handler
and what it imports shipped to the client, in dev and in production, on Vite
and Rsbuild.
The prefetch now uses the export resolver's model: each top-level lookup has
its own path, a key met again on its own path is a cycle, and only settled
results that no cut cycle touched are memoised (waiting on an unfinished
lookup deadlocks on a real cycle). Both use one guard, `LookupPath`, in
router-utils.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pinned .fails: the compile judges only the imports it reads, before the
bundler expands import.meta.glob / webpackContext / template import(); the
denied module ships and runs, unreported (Vite build/dev/bundledDev, Rsbuild
build/dev). main mocks all of them (reports them in vite build only).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review 1 claim #1: Start's prefetch reads a concurrent second lookup of one
(module, export) as a cycle, so one derived builder goes unrecognised and its
handler ships in the client (dev and both production builds).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A one-shot build cleared the registry at buildStart, so the sweep of the
module graph at the client's buildEnd (2.7 ms on react-start-deps) found
nothing to drop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The claim, glue-import and core bands of TreeEdit.seq (1e9 + region, 1.5e9,
2e9) and the nesting offset (+0.5) become documented constants in one place;
the derived outputs' after-imports position gets a name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both maps were bounded by the paths ever compiled, not by the live files:
a deleted or renamed file kept its text (webpack-family emitted maps) and
its output digests (Vite dev). The emitted-maps helper forgets the removed
files of each watch compilation; the Vite host forgets a deleted file's
digests where it forgets its server fns and import protection records.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Outside NODE_ENV=development, the first server router's processed route
tree is cached for the process, keyed by the route tree object. The route
tree export is the root route, an unchanged module's export: re-evaluating
the route tree module after an edit gives that same root new children, so a
dev server under another NODE_ENV (NODE_ENV=production vite dev, a dev
server under test) kept rendering the routes from before the edit. The
cache is now keyed by the root's children (new on every evaluation); a root
without children is never served from it (two such roots would match).
This made Start's in-process SSR-after-edit tests depend on which file ran
first in their process. The route-level SSR test of review 1's claim #7 runs
in a process of its own (integration-alone) and fails without the fix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Start compile hook's filter was by id only, so every node_modules
script crossed into JavaScript to be refused by the compile scope's text
test. The compile hook now excludes dependency ids, and a second hook per
environment takes dependency scripts behind that text test as a code
filter (the same handler). When import protection's scope may reach a
dependency by its path (an include, or a source directory holding the
root's node_modules), the second hook keeps no code filter: the scope
decides as before (new build test).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A watch rebuild keeps the registry and replaces a module's client snapshot
only when the client compiles it again, so a module the client no longer
bundles stayed client-referenced and its functions callable over HTTP (main
too). The client build now drops, at its buildEnd, the snapshots of modules
outside its module graph (as Rsbuild's replay replaces the env's), and the
server's resolver waits for the client rebuild a file event started (the
environments rebuild at once) and watches the client graph's files, so an
edit only the client bundles rebuilds the server too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pinned .fails on Vite: the watch rebuild keeps the client snapshot of a
module the client no longer compiles, so the resolver still lists it as
client-referenced (main fails on Vite and Rsbuild; Rsbuild passes here).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
watchChange normalised the id for forget() but passed Rolldown's native path
(backslashes on Windows) to invalidate(), whose keys are Vite's forward-slash
ids: on Windows a watch rebuild reused the edited file's facts and its
dependents' plans. Both file hooks now build their change once at the hook
boundary and use that path for every call (hotUpdate held the same
per-call-site normalisation).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per-key attempt state had no single owner: an overtaken attempt's discard
dropped the dependents row a newer overlapping attempt shared (a later
dependency edit no longer reached the importer after two quick saves), the
in-flight record went before validation and publication (a same-revision
request compiled again), waits on other requests counted as attempts (the
fourth concurrent request of an unparsable file threw "changed
repeatedly"), and a validated hit evicted the entry republished meanwhile.
Now a compile of a key at one revision is one flight from its first attempt
until it settled; requests of that text wait for it and emit their own
output from its outcome, and only the owner's attempts count. Rows in
flight live until the key's last compile ends, publication makes the
published rows exactly the plan's, and a hit evicts only itself.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claim #3: an overtaken attempt's discard drops the dependents-index row the
newer attempt shares (stale HMR after two quick saves); the in-flight record
goes before validation (no same-revision dedupe); waits count as attempts (a
fourth concurrent request of an unparsable file throws "changed repeatedly");
a validated hit deletes the entry another request republished meanwhile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R86: builds are cold runs, so a route file the generator cannot parse
fails them, naming the file. The generator session gets `build()` (hands
the registry over, then rethrows), used by the hooks of builds that do not
watch: Vite's `configResolved` for `vite build` without `--watch`, the
Rspack/webpack `beforeRun`, Start's Rsbuild `beforeRun`. Dev servers and
watch builds keep reporting the failure (`run()`). Before, the build went
on with an empty route registry: the Rspack/webpack hosts compile only the
registry's route files, so every route stayed unsplit with only the
generator's error said.
`code-splitter-unparsed-route.test.ts` asserted that a route file the
compiler cannot parse (an SWC-accepted grammar error) builds unsplit with
one warning on Rspack; under R86 the build fails naming the file, on Vite,
Rspack and webpack.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route module's React Refresh boundary ignored every module-level
export (R41), so plugin-react never invalidated it: a module importing a
route file's non-component value (a label, query options) kept the old
value after an edit. Main ignored only `Route`.
The ignored list is now the route's export names, the anchor and the
module-level bindings the user does not export (the compiler's glue for
the chunks, over-approximated). plugin-react validates the user's other
exports, as on main: a component updates in place, an edited value
invalidates the module and reaches its importers (a reload when no
importer accepts it).
Two tests that asserted in-place updates for an edit adding `export` to
the route component (router-plugin `route-hmr-after-split-change`, Start
`start-dev-route-split-change`) now allow that edit to reload: the export
list changed, and plugin-react reloads on a new export, as on main. The
edits after it (removing the export, a text edit) still apply in place.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- router-plugin: with `codeSplittingOptions.deleteNodes` (every Start
client build), options built by a call or imported, and a spread or
computed key that may hold a listed option, fail the build naming the
file (SPEC J2.8, J2.14), they do not stay unsplit with a warning.
- start: the same, as a client build error, with the fix.
- router-plugin: the six root exports of the Babel splitter removed
without mention (`unpluginRouterCodeSplitterFactory`,
`getObjectPropertyKeyName`, `CodeSplitCompilerPlugin`,
`ReferenceRouteCompilerPlugin`, `ReferenceRouteCompilerPluginContext`,
`VirtualRouteSplitNodeCompilerPluginContext`); a string export name next
to a split component builds.
- router-generator: `GeneratorPlugin.afterTransform` is removed.
- SPEC §2.2: factory-built options follow J2.8 (under Start removed, or a
build error).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R86: a route file the generator cannot parse never silently drops out of
a build. A file no earlier read of the generator knows (a cold
`tsr generate`, a build's generation, a dev server's first generation, a
file created broken) makes the run reject naming the file, and the route
tree on disk is left as it is, as on main: `tsr generate` exits 1 and a
build fails on the file the tree still imports. The bundler plugins' and
`tsr watch`'s session reports the failure (console.error, as main's
plugin did) and the dev server goes on. A file that was read before (dev,
watch) still keeps its last good route with a warning.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`Page.x = track('page')` with an imported `track`: the augmentation did
not count as a side effect of `Page`'s cluster, so `Page` left for a
side-effect-free extracted module only the chunk imported and
`track('page')` ran when the chunk loaded, after the route module's later
effects (Vite, Rspack and webpack). Main ran it in order.
Units record whether an augmentation does more than write what it
augments (a pure value, key or argument written to a member chain of the
binding); such a unit counts in the cluster's `sideEffects`, so the export
stays in the route module with the `effects` kept-export warning.
`Page.displayName = 'Page'` and other pure static props still leave with
their export.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`export default () => <Page />` next to an exported `Page` the split
component renders became an export companion of `Page` and left with it
for the extracted module; the route module's re-export lists only local
exports, so `default` was gone (MISSING_EXPORT for an importer, silent
otherwise). Main built it. Only `export default x` of an identifier is a
companion now; an expression default is an env root, and `Page` stays in
the route module with the `live` kept-export warning.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`const { Home, HomeSkeleton } = views` with `component: Home` split and
`HomeSkeleton` kept: the orphan cleanup pruned `Home` from the route
module's pattern (its only reader there was the moved option), while
placement kept the declarator in the route module and the chunk imported
`Home` from it. The build failed ("Export 'Home' is not defined", or
MISSING_EXPORT when the declaration is exported); main built both.
A module-level leaf now stays while it is exported (importers read it) or
another output takes it (one of its roots names it, or a claimed region
reads it); placement then keeps the declarator in place or moves it.
Leaves only deleted code read (deleteNodes, server-only handlers) are
still pruned.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`export { Page as 'page-view' }` next to a split component was re-exported
from its extracted module unquoted (`Page as page-view`), which does not
parse; a chunk importing a binding the route module exports under such a
name had the same problem. Main failed too ("Export 'Page' is not
defined").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack 2.1.6 (web-infra-dev/rspack#14921) prints SWC's code frame header as
`[line:col]`, without the file, which the overlay shows on its `File:` line.
Since 5ebce5532b moved the e2e apps to Rspack 2.2.9, the server entry's line
read as null.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A module the cache restores must be compiled again when a module it
imports changed what it is while no build ran (here: it became a server
fn builder, so the handler built on it leaves the client).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Like the router plugin's Vite host: a build without `build.sourcemap`
reads no map, and import protection locates violations through the input
map and the raw files, not through Start's output map.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rsbuild watch builds already let the first build fail (a test relies on
it) and described the rebuild; the Vite watch builds now do the same, and
`StartBuild.firstBuild` holds what the first build reported, so a test
can check that it succeeded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The `finishMake` passes looking for modules restored from Rspack's
persistent cache (unjudged importers, unconfirmed edge modules) walked
every module of every dev compilation. Rspack loads the cache's module
graph only in a compiler's first compilation: the persistent cache's
`before_build_module_graph` returns for `is_rebuild` compilations, and
every compilation after the first is a rebuild (Rspack 2.0.0 to 2.2.9).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After every dev compilation `retain` re-identified every plan, raw-facts
entry and import-protection record to drop state of files the compilation
no longer depends on; with the same files as the last compilation (every
plain edit) there is nothing to drop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server `router` cache group merges the router's chunk with the
server-function providers' to save production bytes; its `chunks` test
ran on every dev rebuild (~1,600 calls, ~6 ms per server compilation).
The dev server needs only the shared group (one instance per module).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three gaps of `vite build --watch` once the first build succeeds:
- the server environment built at the same time as the client, so its
server-function resolver listed what the client had compiled so far
(often none): Start's build loop now waits for the client's first
watch build, as a one-shot build does;
- every client rebuild emptied the server-function registry while the
server environment rebuilt from it: a watch rebuild keeps it (each
compile replaces its module's functions, a deleted file is forgotten);
- no invalidation ran on a file event, so an unchanged importer reused a
plan validated against stale raw facts (a module an edit marked
server-only stayed in the client): `watchChange` runs the one
invalidation operation in build mode too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`vite build --watch` of a Start app failed before any edit: `Could not
load \0%23tanstack-start-server-fn-resolver`. The raw facts read a
virtual module through every environment's loader in turn; in watch mode
the client and SSR builds run at once, so the live client build's
`this.load` of the SSR-only resolver registered a failed module.
The core's `loadVirtual` now receives the environment asking for the
facts (the one that resolved the id), and the Vite host loads through
that environment's loader only. The Start build harness builds Vite apps
in watch mode too (`watchEdits`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comments from before the one-router-planner merge said "route planners"
or "split planner"; pointers at reach.ts for rules that moved to
placement/ now name it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The .mdx page's warning is located in the page's source (the late
import-protection pass maps it through MDX's source map), as the next
test already requires: the first test asserts it too instead of
accepting a report without coordinates, and the comments stop calling
that a pinned bug.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AppInfo.env/.mode (plugin callbacks read root), BuildResult.bundler,
OriginalPosition.source, RsbuildPluginHost.dev and RunNodeResult.stderr.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StartRsbuildEnvironment was StartCompilerEnvironment field for field, a
leftover of the one Start session.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- EdgeRecord.output and the edge builder's output parameter: edges are
keyed by output already;
- Tier1.tail: its last reader went with erasedParts' range;
- the 'region' root kind: no planner roots a region;
- PlanContext.fallbacks: planners use fallbackAt; the toy planners do too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No gate reads GateContext.env and no prefetch reads PrefetchContext.env or
.config since the router planners merged and start-env stopped reading
its config: the planner contract drops them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ModuleSummary.rawRevision and hasImportOrExport had only test readers and
enter no digest; buildSummary loses its revision parameter. RawFacts'
rawRevision and ModuleAnalysis.hasImportOrExport stay.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PlanFacts.publishedSummaryDigest was written and never read; publish()
stays for its side effect. EmitPlan.sourceLength had only test readers,
which now check the published plan's revision.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
applyViteInvalidation, liveModules and loadDerivedSource are new in this
PR and only Start uses them besides the router host: they move to
router-utils' hosts/vite.ts, so @tanstack/router-plugin/vite gains no
public exports.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route HMR runtime kept, per route id, the evaluations, split chunks and
(React) the refresh-ignored exports of every route a dev session ever saw,
also after the route was removed or renamed. When it has the router read its
route tree again, it now forgets the ids the router held before and no longer
holds; ids the router never held stay (a route module evaluates before the
route tree module that adds it runs). React's ignored exports remember their
route id and are retired with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The registry only inserted or overwrote ids, so on Vite an edit that removed
a createServerFn left its id registered: the dev lookup re-exported a missing
wrapper (a TypeError instead of an unknown id). The registry now keeps, per
environment, the server functions each defining module's last compile
reported; every compile replaces its module's snapshot (with none too, an
untouched module included), and the entries are the aggregate. Rsbuild's
finishMake replay replaces its environment's snapshots in the same registry
instead of keeping its own copy; a deleted file is forgotten through one
session operation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite's pre-bundled dependencies were opaque twice over: the start-env
prefetch skipped a resolved `node_modules/.vite/` id (`StartEnvConfig
.isOpaque`) besides the raw facts' `opaque` rule. The Vite host now gives
the session its one extra rule for the raw facts (`opaque`); such a
module's summary is null, so its values are unknown to the prefetch as
before. `isOpaque` goes from the planner config and the prefetch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generator records each route file's real path when it reads it and
publishes the registry under both the scanned and the real path (a
symlinked file or root); a real path that is another scanned route file
stays that file's. The registry view no longer resolves symlinks per
registry, `changedRoutePaths` no longer resolves each changed path (it
could not for a deleted file: the previous registry names its real path
now), and the generator's per-root real-path mapping goes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`startGeneratorConfig` builds the generator configuration of both Start
plugins: the router options as the Start config parsed them (Rsbuild no
longer parses them again), the framework's target, one plugin list, and
Start's footer computed at every print. Start's Vite plugin printed the
first result of a function-form `routeTreeFileFooter` for the whole
session; it now gives the function's current lines like Rsbuild and a
router app's own footer (start-dev-route-tree-footer test: the Vite row
fails before). The Vite route tree plugin uses the shared `escapeRegExp`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`createGeneratorSession` (router-generator) is the one policy of the
Rspack/webpack plugins, Start's Rsbuild plugin and `tsr watch`: a build
runs once; a watch mode starts the generator's own watcher, waits until it
is ready, then runs (no event of the meantime is lost; concurrent first
watch compilations share that run); every later watch compilation hands the
generator its modified and removed files and waits for their run, so it
sees what its own events generate (Start reads the client route tree at its
`finishMake`). The registry is handed over after every run: a failed
batch leaves it as it was.
Start's Rsbuild plugin watched the route roots in development only, so
`rsbuild build --watch` never saw a route file created while watching
(not in the bundle, not reported by Rspack): the new
start-build-watch-routes test timed out waiting for the rebuild.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`loadDerivedSource` is the one `load` of a derived id of a project file
(router's and Start's copies), and `applyViteInvalidation` applies an
`invalidate()` result to an environment's module graph for both Vite hosts,
Start's refinements as opt-ins (the changed file's own modules left to
Vite's update; an `unlink`'s dependents held until the next `add`).
Start's `hotUpdate` keys its one invalidation per file event on the
event's `read` function, which Vite shares across the environments' hook
contexts, instead of a memo evicted by a 10 s timer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`compiler/session.ts` (`StartCompilerSession`) owns what a Start compile
is in both hosts: the raw facts, caches, import protection, server-fn
registry and id allocator, the warning ledger; the planners, configuration
and `EnvInfo` of an environment (and Rspack layer); `afterCompile`
(registry record, then import protection); the one reporting policy; the
custom-id ranking. `providerModuleId` moves beside the registry. The Vite
plugin and the Rsbuild loader keep their bundler wiring and their explicit
differences: Vite's provider environment vs Rsbuild's server environment
and RSC layer (`providerEnv`, `rscLayer`), Vite's pre-bundled
dependencies (`isOpaque`), the hot API style, edge-module ids.
A separate server-fn provider is RSC (no published adapter has another);
the configuration is computed once per (environment, layer) instead of per
Rsbuild compile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`router-utils/src/compiler/hosts/` holds what the router and Start hosts
share and the core model never uses: `isFinalBuild`, rebuilds and
invalidated files, eager extracted exports, emitted maps' text, and two
helpers that were copies: `composeLoaderMap` (a webpack-family loader's
output map, with `@jridgewell/remapping`, now a router-utils dependency
only) and `webpackResourceId` (a resource's id, `#` unescaped).
`normalizePath` has one definition beside `identify`; the copies in
router-plugin, Start's hosts, import protection and the start-env planner
use it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`warnEagerExports` words and dedupes the warning of an extracted export an
entry chunk loads (J2.8) for the four hosts: the router's Vite and webpack
hosts now warn once per (file, export) per run through the context's
ledger, as Start's hosts do (a webpack/Rspack watch build warned again on
every compilation).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The warning ledger builds its own (file, code, wording) key; the hosts'
three copies of the reporting policy (errors from every compile, warnings
once per file, reason and wording per run) become
`reportCompileDiagnostics`, with each compiler's parse-failure wording as
a hook and each host's sink for positions and messages.
Two alignments: the router's Vite host reports a compile's errors before
its warnings (as Start's hosts), and Start's server-side parse warning is
keyed by its wording like every other warning (R78).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lockfile resolved ^2.1.0 to Rsbuild 2.1.1 / Rspack 2.1.1, whose
persistent cache changes the dev build hash on a warm restart (fixed in
Rspack 2.1.3), so open tabs full-reload. The e2e apps take catalog:
(2.2.14 / Rspack 2.2.9); the examples, which stay copyable outside the
workspace, take the catalog's range. Peer ranges unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dev and build source-map tests of the router plugin and Start also
check the text the map holds for the source a throw maps to (what a
debugger shows), and the Rspack and webpack rows gain a development
build. SPEC G6 states it: the emitted map holds the file as written
unless the configuration leaves sources out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since the compiler's maps carry no sourcesContent (281a9967ea), Rspack,
webpack and Rsbuild had no text for the files the compilers transform:
devtools showed nothing for route files, split chunks, Start modules
and Hydrate chunks (main showed the transformed code). Vite was not
affected: its dev server reads the text from `sources`, Rollup and
Rolldown take the module's code.
These bundlers hash a module with its map, so the whole file's text in
every output's map hot-updates every output of an edited file. The
module maps carry the text only where no hot update can happen or the
maps are inside the code (production; eval/inline devtools). In
development with a devtool writing map files, the loader records the
text and a processAssets step after the devtool fills the emitted maps
(`emittedMapTexts`): the hashes, and so the hot updates, are unchanged.
Modules the persistent cache restored get their file's text read once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The core runs the function-scope cleanup whenever the env module erases
anything (a split identifier option already does), so its pass over every
binding now runs on most planned modules. It read each binding's
declarations (a Yuku getter) before asking whether the binding is orphaned
at all; it asks that first now (most bindings have a live reference).
Same removals; the micro-bench went from +2.2 % (react-start ssr) to
-1.5 % per module against b25a528bc4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In dev every resolution of an analysis waited for a macrotask, so a
pending server-fn request gets in between an update's resolutions as it
did while each was resolver I/O (+3.4 ms per server-fn edit without it;
one yield per compile did not restore it). A compile that follows a
barrel's `export *` chain resolves hundreds of specifiers of other modules
and paid one turn each (~909 per route module of a 2-level, 50-module
barrel), ~1 µs of scheduling apiece.
Only the module's own imports yield now. Every module of the compiler-perf
apps yields exactly as before (all their yields were own imports, the
server-fn probe module's one included), so the server-fn HMR latency is
unchanged; the barrel route modules yield 12 times instead of 909: dev
compile -23 % sequential, -29 % with all modules at once (in-process,
paired, identical outputs). Builds never yield.
Test: pipeline.test.ts "gives pending macrotasks a turn per own import in
dev, not per re-export it follows" (22 turns before).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
route-split's `deleteNodes` and Hydrate's server-side `fallback` removal
each had their own comma handling. Both use the core's `removeListItems`
now (route-split: −26 lines, same output).
Hydrate removed a spread object's `fallback` property by itself, leaving
`const props = { , }` (a syntax error in the server build) when it was the
only property and had a trailing comma, which Prettier writes by default.
Test: hydrate-boundary-forms.test.ts "a spread used once, holding only the
fallback, with a trailing comma".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`removeListItems` (each run of removed items with its separator, the whole
list with its trailing comma) and `listEnd` (where a list ends, after the
comma that may follow its last item) are shared with the planners that
remove object properties, instead of each keeping its own comma logic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
start-env, Hydrate (server fallbacks) and route-split (`deleteNodes`) no
longer call `cleanOrphanedDeclarations`: the core runs it after every
planner.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Function-local declarators and destructuring leaves only erased code read
were cleaned by each planner that erased code (start-env, Hydrate's
server fallbacks, route-split's `deleteNodes`), each with its own scope:
a new erasing planner had to remember the call, and a compile with three
of them walked the bindings three times. `AnalysisPlan.resolve()` now
runs `cleanOrphanedDeclarations` once, after every planner, when the env
module erases anything.
The scope of each removal follows from what orphaned it: every output
when edits addressed to every output alone erased its readers (and what
its run encloses that went before), else the env module, whose liveness
decides every orphan. That is the planners' choice in each case (start-env
with a separate provider and route-split erase in the env module only;
start-env without one and Hydrate's fallbacks everywhere), decided per
removal instead of per planner.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Tier 0 deduping too, an import of a specifier with type specifiers
only (`import { type T } from './x'`, which TypeScript erases) merged with
a later value import of it led the record's locations, so import
protection reported the violation at the erased import (start-plugin-core
`import-protection-core/planner.test.ts`, J6.5: a relevant import span,
never an erased type position). A binding record's locations now come
first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A module only Tier 0 planners read (its env output is its source) and a
planned output built their import edges in two places that disagreed: Tier
0 kept one record per statement and left out the implicit JSX factory, so
an import read only as the factory was an evaluation edge naming nothing.
Under Rsbuild's `source.transformImport` the file rule then judged the
library instead of the submodule the factory's import is rewritten to,
and a denied submodule shipped to the client with no error (Tier 1 caught
it). Both bundlers keep such an import (classic runtime, or a `React`
import next to JSX): it reads the binding.
`edges.ts` builds an output's edges from a view of what renders in it
(`wholeModule` for Tier 0) and both tiers dedupe, so `substitute` replaces
one record's locations. Tier 0 learns the implicit factory reads from a
`ModuleAnalysis.implicitJsxReads()` query (one walk, only in a module with
a factory binding, stopped once an element and a fragment were seen); the
runtime and factory bindings moved from `t1()` to `jsx()`, shared.
Test: start-plugin-core `importProtection/jsx-factory.test.ts` (the Rsbuild
build row failed before; the dev rows pin that both bundlers report a
factory import); router-utils `edges.test.ts` (both tiers alike).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route planner names its modules (`describeModule`: "route module",
tagged `[tanstack-router]`) and the Hydrate planner its chunks
(`describe: '`<Hydrate>` boundary'`), the words the core used to
hard-code. The warnings read as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`plan.ts` (2,025 lines) held the planner facade, the benign-call
judgement, the Router-worded warning for declarations only split code
needs, freeze/render/glue and the `Renderer`. Now:
- plan.ts: the planner facade, renames, `resolve()` (525 lines)
- kept-diagnostics.ts: `keptDiagnostic` and `firstImpure` (the benign
test placement asks, and the effect the warning names); `benignUnit`,
a one-line wrapper, is gone
- freeze.ts: freeze, env/derived rendering, glue, edges, `Renderer`
The core no longer words Router or Start concepts: the planner that
declares an output says how diagnostics name it (`OutputSpec.describe`,
default its key) and a planner names the module
(`PlanContext.describeModule({ name, tag })`). `setRouteModule` stays:
placement needs it for the route-module import rules (a value import used
only in type positions and TypeScript-only specifiers leave a route
module; plain modules keep imports as written).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`computePlacement` was one 2,075-line closure whose phases shared ~100
locals; the fixed point called helpers declared 300-500 lines below it and
invalidated lazy memos by hand. It is now the composition of seven stages
in `placement/`, each a function of the data the previous ones produced:
- clusters.ts: union-find, the write table, ordered evaluation, the
materialised clusters, the one mutation predicate (`mutatedOutside`) and
the readers of mutable state (computed with the `ordered-effect`
fallbacks in one pass over the eager reads, instead of a lazy memo)
- reads.ts: memoised reads and successors per output, `reach`
- roots.ts: the roots planners and the module declare, extraction
candidates, provenance
- settle.ts: the env-roots / movable / extraction fixed point, helpers
above the loop; the dev fold of extracted exports
- kept.ts: the kept declarations and their causes
- homes.ts: homes, the single-writer rule, env-declared roots
- inclusion.ts: inclusion, imports and exports
The union-find no longer leaves stage 1: a claimed region is in its
owner's cluster, so a writer's cluster is `clusterOfRegion` and every rule
compares cluster ids. The generated reads `importStays` asks about are
collected only in route modules, when asked.
No behaviour change: identical outputs, maps, edges and diagnostics over
the compiler-perf apps (14,216 outputs) and 5,000 fuzz-generated modules
(353,990 outputs). Micro-bench: -1.7 to -3.2 % per module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The framework routers' `lazyRouteComponent` imports router-core's dev-only
`/hmr` entry and drops it in production only by dead-code removal. The
production-bundle check compared the build with a control build that
bundles the same framework code, so a leak would not show: it now also
asserts the bundle carries none of the dev runtime's markers (the hot
slot's `__tsrHot`, the route HMR entry `__tsrRouteHmr`), for every
bundler and framework it builds. The cold-start check of Start's Vite dev
server gets a Solid row (the page hydrates in its first document).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After a hot import of a lazy route component failed, the wrapper held the
error; a later import the framework's refresh runtime keeps (React: same
`$$tsrRefreshId`; Solid: the same export) left it set and did not
re-render, so the route kept rendering the error until a reload. A
successful hot import settles in both cases now: keep holds the component,
swap takes the loaded one, and either clears the failure and re-renders
(a no-op render of the same component when nothing failed).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A real page, React with React Refresh: an edit that makes a route's split
chunk throw when it evaluates (the chunk holds the component and the
loader, so it is no refresh boundary of its own and the route module's
hot import of it fails) shows the error component; the edit that fixes it
must show the fixed component in place. On Rsbuild it does not: the
runtime keeps the held component (same refresh id) and never clears the
failure, so the page shows the error until a reload. Vite reloads the
page on the breaking edit (@vitejs/plugin-react makes the chunk import
itself; Vite reloads an update failing within a circular import), and the
fix then reaches a wrapper whose first load failed, which works.
Main does not have this failure: it keeps no split component across
updates (on main's Rsbuild the breaking edit does not show at all; on
Vite both edits apply in place).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the bundle-size skill's post-change review of the shared hot slot:
the default export when no export is named, the slot's creation-time
importer and export name (the bundled-dev fallback reads them), a kept
import resolving to the held component, keep not consulted when nothing is
held, a failing newest import winning over a stale success in both settle
orders, what a stale import resolves to. Solid and Vue get the never-loaded
wrapper test React had (the retargeted importer and export name reach the
first load). The helper's doc no longer claims an older import always
settles with the newest one: only while the newest is pending.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The marker reads the chunk declaration's name back through nameOf; outputs
unchanged (dump of the React dev client corpus, Start and router-only).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stateful-route rows skipped the routes whose loader is split on
Rsbuild with automatic code splitting, pointing at a known-bug pin that
is fixed (known-bugs-route-hmr "rsbuild: an edit of a split loader
(codeSplitGroupings: %s) shows its data in place" runs as a regression
test). They pass on Rsbuild now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Which name the core's allocator generates for glue is free, so the planner
tests read it from the output (`tests/generated-names.ts`: `shape`,
`namesIn`, `importedAs`) instead of spelling `TsrHydrate0`, `tsrLazy`,
`tsrArguments`, `tsrCap$…`, `tsrRef$…`, `props$1`, `tsrClientRpc`,
`tsrSsrRpc`, `tsrServerRpc`, `tsrLoadHandlers`, `tsrHandler$…`,
`tsrServerFn$…` or `*_createServerFn_handler`; whole-chunk `toBe`s are
checks of what the test is about. Kept as they were: diagnostics (code and
position), hydration and derived ids, source-map positions, edges, facts.
Deleted from planners/hydrate.test.ts, behaviour covered by the Hydrate
oracle (pages/ on a Vite dev server, hydrate-build*, hydrate-pages*):
- import forms are boundaries: hydrate-boundary-forms "a renamed import of
Hydrate is a boundary", hydrate-pages "a namespace-imported Start.Hydrate
loads its children when it hydrates", hydrate-split-modules "client:
modules and bindings only the split children use are not needed before
the chunk loads"
- split shorthand and dynamic split: hydrate-split-modules "client: the
split shorthand splits the children", hydrate-boundary-forms "a dynamic
split={flag} (%s) still splits the children"
- Solid loads through the Solid router: hydrate-boundary-forms "Solid: a
Hydrate of @tanstack/solid-start splits with the Solid packages"
- a single expression child: hydrate-split-modules "client: a single
expression child ($name) renders through the chunk"
- a self-closing boundary's children prop and boundaries nested in it:
hydrate-split-modules "client: the children prop ($name) of a
self-closing boundary is deferred", known-bugs-hydrate "client: a boundary
nested in a children prop hydrates with the id the server renders"
- generated names away from the file universe: hydrate-captures "client:
$scope bindings named like the generated bindings keep their values",
known-bugs-hydrate-module-level "client: module-level $name, named like
the generated bindings, do not collide"
- a chunk-first request: hydrate-build-dev "client: a chunk requested
before its parent module renders the children, and an edit reaches it"
- captured locals, JSX tags of locals, names bound inside, local enums,
own this/arguments of inner functions, nested placeholders: hydrate-
captures "client: the children read the locals of the component $name",
"client: a nested boundary reads the locals of the component around its
enclosing boundary"; known-bugs-hydrate "client: the split children render
a local component named %s", "… render a component bound inside them",
"… read a local enum", "client: split children may use the own `this` of
$name"
- Solid use: directives: hydrate-pages-solid "split children run a
directive declared in the $where"
- module-level code the children use, a let they only assign:
known-bugs-hydrate-module-level "client: an exported declaration the
children use has one instance, initialized once", "client: split
children reading Route $name use the one route", "client: $name that the
children rely on reaches the chunk", "client: $name used by the children
reaches the chunk"
- a hook in the boundary's own props: hydrate-boundary-forms "a hook call
in the props of the boundary runs in the parent render, and the children
still split"
- split={false}: hydrate-boundary-forms "$name with split={false} stays in
place in both environments"
- the server strips fallbacks: hydrate-boundary-forms "server: $name is
removed", hydrate-pages "$how shows, then the children"
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The framework route HMR tests and router-core's fake-router tests drove
the dev runtime with hand-built routes. Deleted where a real page covers
the behaviour (router-plugin route-hmr-browser*, known-bugs-route-hmr*,
start-plugin-core route-edits-after-tree-rebuild*, the e2e HMR suite),
or where the race now has one test against the shared hot slot
(router-core lazy-route-component-hot.test.ts):
- React: loader replacement and generated options; unsplit component
swapped / kept / renamed; the webpack/Rspack refresh call; lazy wrapper
kept and swapped; a marked split component kept (same refresh id) or
swapped (no refresh runtime); the newest-import race.
- Solid and Vue: loader replacement; lazy wrapper kept and swapped; Vue's
function component swapped; the newest-import race.
- router-core: a later evaluation updated after a route tree rebuild; an
edited root route.
Kept, no real page reaches them: a first load replaced by an update and
a wrapper that never loaded (the adapters' own load path), the bundled-dev
MissingFactoryError fallback, another router holding the route, a router
without the route, the server no-op without a hot slot, the ignored-exports
hook chaining, Solid/Vue keep rules (same export, same __hmrId,
solid-refresh names), another evaluation lineage, chunk HMR.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lazy wrapper's hot-update state machine (switch importer, never-loaded
guard, newest import wins, keep or swap, error, re-render) was written
three times, in the React, Solid and Vue `lazyRouteComponent`. It is
`lazyRouteComponentHot` in router-core's dev-only `/hmr` entry now; each
framework's existing dev block (client only, behind the same
`process.env.NODE_ENV` and `isServer` checks) builds a small port over its
wrapper's state and its own re-render (React's store subscription,
Solid's signal, Vue's ref). Production paths are unchanged: the dev block
and its import drop out. The race tests are written once, against the
helper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The React refresh marker (`$$tsrRefreshId`) was decided in four places:
the splitter's own copy of dev ∧ client ∧ `hmr` ∧ React, the route HMR
gate, and Start's `refreshMarkers` in both hosts. The builder's `hmr`
(null outside a development client) is the one decision now:
`routeRefreshMarkers(cfg)` derives the marker decision from it, the HMR
part of the router planner emits the markers of the split chunks (the
split part records which components each chunk exports), and Start's
hosts pass the same predicate to the Hydrate planner.
The marker now follows the chunk's export statement instead of preceding
it (a unit of its own, homed in the chunk); the corpus's React dev
client chunks differ by that line's position only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two rows the router planner's configuration builder unified, on both
Start hosts: with `addHmr: false` the client still has route HMR (an edit
shows in place without a full reload; Start on Rsbuild left the page on
the old loader), and the server build erases the user's `deleteNodes`
while the client erases `ssr`/`server`/`headers` instead (Start on
Rsbuild kept the options on the server, as main did). Both Rsbuild rows
fail on the previous head; changeset line for the Rsbuild server change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its one user, the route HMR planner, is now the HMR part of the router
planner, whose hoists run first inside its own `plan`. A planning round
runs each planner's `plan` in order. The README said the round ran
`route-hmr`'s `prepare` between `rsc-css` and `route-split`; it ran it
before every planner's `plan`, `start-env`'s included. Running the hoists
after `start-env` and `hydrate` changes nothing they decide: their names
have other bases, their anchors other units, claims nest by range. The
only visible effect is the order of the names in React's refresh
ignored-exports list, a set: the hoists' names are allocated after
start-env's now (4 of 338 modules of the corpus with splitting off).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`route-split` and `route-hmr` were one planner presented as two: they
shared one config object under two names, recorded the route-registry
fingerprint twice, read each other's prefetch and passed state through
WeakMaps keyed by the round's rewrite set (`round.ts`, the split plan and
recognition memos). They are now one `router` planner: one config entry,
one prefetch, one gate (`split || deleteNodes || hmr`), and per planning
round one recognition and one decision table (`RouterRound`) read by the
HMR hoists, the split part and the HMR block, in that order, inside its
`plan`. The planner no longer uses the core's `prepare` phase.
`routerPlannerConfigFrom(codeSplittingOptions, env)` builds the
configuration of one environment for every host (RouterCompiler and both
Start hosts), with `routerPlannerConfigDigest` for the config key and
`routerPlannerApplies` for the gate. The config's `hmr` is null outside a
development client, so the "route HMR is on" decision is the builder's;
`routeRefreshMarkers` derives the React refresh-marker decision from it
for the split chunks and Start's Hydrate chunks. Start's rules are one
rule on both bundlers, as Start on Vite on main: the client always has
route HMR (Start on Rsbuild honoured `addHmr: false`, new in this PR) and
erases `ssr`/`server`/`headers`; server environments erase the user's
`deleteNodes` (Start on Rsbuild dropped them, as on main).
Outputs are byte-identical to the previous head on the in-process corpus
(338 route modules: Start dev/build, router-only dev with and without
splitting and build, React and Solid, client and ssr).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Rsbuild: dev violations pend until the edge module is built (the
loader's edge pass), a cache hit re-emits from the plan, the resolver
module itself is rebuilt, the RSC layer runs no router planner
- router-plugin skill: two parts (generator, route compiler), esbuild
generates routes only
- code-splitting architecture: no root route option is split; the split
loader's refresh and the MissingFactoryError fallback live in the route
HMR runtime
- core README: every prepare runs before any plan; route-hmr's prepare
records unsplit names for every framework
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- route-hmr-browser-frameworks: every cell applies in place (checked with
COMPILER_TESTS_PINS=run), so the hotToday/brokenToday tables go, with
the two known-bugs-route-hmr tests they duplicated
- code-splitter-module-state-bindings: the two identical it.each of the
isKnownBug split are one
- react-refresh-route-components covers split and unsplit routes alike;
the copies in known-bugs-dev-server go
- the Start library CommonJS pin goes (accepted as is)
- KNOWN-BUGS.md: "Remaining pins" and "Fixed, kept as regression tests";
the known-bugs-* headers say which they hold; comments no longer cite
files of main's compilers as current
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
importerSource, resetLoadedModules, withoutRoot, offsetAt and
originalPositions (with their control tests), BuildResult.duration and
RunNodeOptions.maxBuffer; the pins doc no longer mentions tables of
today's behaviour (none is left).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- processBatch: no treeChanged flag (it equals a routes change); one
classify(path) for the event intake and the batch
- TreeModel: no isAnchor (file === undefined says it), no ModelRoute.filePath
or root filePath/routePath; no RouteProps/RoutePieceName re-exports
- FileDiagnostic.severity, lit()'s backtick quote and componentUpdate's
constant indent go
- an added constructor import goes after the directives and the license
or JSX pragma comments, and before the comment the first statement
starts with (a doc comment of the Route stayed above the import)
- the file-modification fixture's .gitignore, prettier ignore and cleanup
loop (the tests run on copies)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DecideResult.reports (the build's reports getter serves them),
Judged.from, ViolationType, useDevReporter's reachable and maxWait
parameters (no host passes them), buildReports' pending-pass check (every
host returns on needPass first); the orphaned inScope doc is back on it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- StartEnvConfig.alwaysDeriveProvider and the 'use client' trigger: a
separate provider (RSC) derives the provider module of every server-fn
module, in every host
- the Rsbuild session's ssrIsProvider: it is rsc === undefined
- Hydrate: its plan facts (tests read the chunks the outputs import), the
packages/routerPackages/rejectEverywhere config, the Vue gate (Vue Start
has no Hydrate)
- start analysis: ChainLink.result, UnsupportedUse.value, the cached
values/table, the prefetch-name parameter; ServerFnSite.call; hoist's
analysis parameter; diag's severity/code parameters
- Rsbuild: the late pass's import-protection check, the allocator null
checks, TransformImportRule.transformToDefaultImport; rsc-css's null
config; schema's ImportProtectionBehavior; the Vite copy of the RSC
options type; the unused Queue methods
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route module's evaluation owns the refresh: it clears its route's
evaluated chunks, so the chunk its refreshed loader re-imports is only
recorded instead of refreshing the route (and running the loader) again.
A chunk evaluating again before its route module (Rspack's
lazy-compilation proxy re-resolving it alone) still refreshes. The
docstrings no longer say the chunk accepts itself.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the hot slot's importer and export name are the ones it was created
with, so applyRouteHmr needs no WeakMap of first importers
- LazyRouteComponentHot, RouteHmrAdapter and RouteHmrMeta are exported
from @tanstack/router-core/hmr only (not a public API)
- React's __tsrRouteChunkHmr leaves the server check to router-core
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follows the single typed registry path: the planners still read the
removed services.routes through a cast, recorded no entry and never
validated a plan.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Vite entry emits Vite's hot API, the Rspack and webpack entries
webpack's: the undocumented option only switched Vite to webpack's API,
which turned route HMR off. Also: the router planners' handler-property
guards are typed once; the HMR hoist reuses methodPrefixOf.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- route-split and route-hmr facts (nothing reads them), SplitDecision.group,
SplitPlan.notSplit, splitTarget's container/prop, RouteRecognition.reason,
RouteModuleInfo.factory, RouteOption.propertyRange and
propertyRangeWithComma (deletion computes its own ranges; the
delete-nodes-dynamic error now points at the spread itself)
- the HMR planner's null split plan (a recognised route has one), the
loader's second appliesTo check, the Vite < 6 fallbacks (the peer range
is >= 6), loader/compiler type fields only the .cjs loader reads
- contextInternals' fallback for a hand-made context; the
RoutesChangedListener, HmrStyle and routeEntryDigest re-exports
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- summaries: no objectKeys walk, no isoImplExports/SummaryExtras hook (nothing
set or read them; objectKeys re-planned importers for nothing), no
canonicalId/marker copies
- RawFacts: no canonicalId, effectProvenance, has(), packageSideEffectFree
- the 'config' dependency fingerprint: the plan key and the plan
fingerprint already hold configKey
- EnvInfo: no bundler, conditions, framework, routerSplit; ExportResolver
memoises per resolver (ResolutionBatch gone). The Rsbuild RSC layer runs
no router planner, as Vite's provider environment
- HostServices: no readFile/loadVirtual/warnings; the route registry is
passed once, typed (RouteRegistry.lookup + digestFor)
- write-only fields: InFlight.key/generation/ledger, EmitPlan.key/fallbacks,
OutputRecipe.id, ImportEntry.phase, ImportSpecifierEntry.range,
DynamicEdge.callRange, Header.hashbang/comments, SourceIdentity.hostId,
Fallback/ExtractedExport.cluster, TreeEdit.internal,
PrefetchContext.summary/targetMarker, PolicyContext.config/ledger
- PlanContext.outputIdFor, OutputBuilder.length, PlanCache.size
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With `log: 'always'`, `onViolation` was asked when a plan was computed, so a
compile the plan cache answered did not ask again: a failed importer
(`behavior: 'error'`) rebuilt by Rspack or requested again from Vite threw
before asking, and Vite asked nothing when it compiled modules again (main
asks at every compile). The planner now decides only `log: 'once'` (its
session memo); with `'always'`, `ImportProtectionEnv.afterCompile` decides
every compile's violations through the same verdict as the edge-module
confirmation and the Rspack kept-module replay (`devVerdict`: a veto makes
the edge module serve the real module). This removes the Rsbuild loader's
cached-compile replay and its per-resource fingerprints. `log: 'once'` and
compiles without violations stay synchronous.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The v2-witness tsconfig-layout, transformer-option and veto rows also run in
Vite's full-bundle dev (`experimental.bundledDev`), where Rolldown requests
the edge module: the client bundle holds the denied file's code only under a
veto, and the import is reported iff oxc keeps it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An import whose survival depends on SWC is confirmed when Rspack builds its
edge module. A compilation that bundles the edge module without building it
(an edit of an unrelated module, or of the importer keeping the import) now
asks `onViolation` and reports it again with `log: 'always'`, like an import
the compiler keeps (main's behaviour). The edge-module loader records the
modules it built in the compilation; the `finishModules` replay that already
runs with `log: 'always'` confirms the edge modules it kept. `log: 'once'`
does no extra work.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server-fn resolver imports the modules that define server functions,
which the router's async chunk holds too, so the shared group split them
into a third chunk (react-start.rsbuild.full: 159.js + 154.js). A named
cache group now puts the router's chunk and the provider chunks into one
chunk when the resolver imports providers: -94 B raw / -248 B gzip on
react-start.rsbuild.full, one file fewer loaded; scenarios without server
functions are byte-identical. No chunk-name comment on the resolver's
imports, so it does not hit web-infra-dev/rspack#16289 on Rspack < 2.3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0.24 removed bindingIdentifiers (patternIdentifiers moves from analysis.ts to
source.ts and serves units/orphans), moved unwrap to yuku/utils; 0.26 renames
parse's semantic option to analyze.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(f) asserted that the edge-policy verdict was asked 5 ms after the compile
started; on a loaded or slow runner (CI Linux arm64) phase C is not reached
within that window (the dev resolution yields add macrotask turns), so the
check saw no call. Each test now awaits the point it suspends at (the
verdict asked, the planner's prefetch, the host's resolution); the
assertions are unchanged. Reproduced 3/80 with 16 concurrent runs on two
CPUs before, 0/208 after.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6e14f8610e dropped markSegment, which also skipped an edge whose specifier
no slice of the output held. Dynamic edges had no other check, so every
output recorded every `import()` of the file: a route's server module
judged the `lazy(() => import('./X.client'))` its split component holds
(or no output holds: `ssr: false`), and in dev `behavior: 'error'` failed
that route module, so every page of the app failed. The edge is recorded
again only where a slice of the output holds its specifier.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack/webpack hot-update a module only when its output changed. A
handler-only edit left the client stub `createClientRpc(id)` unchanged, so
the route kept its loader data from the old handler (Rsbuild dev-server
test "the next call runs the edited handler"); it passed before only
because every output's map held the whole file. In dev the stub now also
names its file's revision (an argument the runtime ignores): the client
module of a file declaring server fns changes with every edit of the file,
as Vite updates every module of the file; other outputs stay byte-stable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every output of a file carried the whole file text in its map, and
Rspack/webpack hash a module's map with its code: an edit anywhere in a
file hot-updated every output of it. A `<Hydrate>`-content edit on Rsbuild
re-emitted the unchanged route module and split chunks, whose route HMR
refreshed the route (loaders, server fns): +250 ms per edit on the
react-start medium app vs main. Main's Babel maps had no sourcesContent
either; Vite's dev server fills it in from `sources`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The verifier skipped `custom` outputs like a copying provider output when
counting effects, but the in-place provider's lazy handler module imports
from the env module: an effectful cluster only a handler reads moves there
(R29) and was reported as "emitted 0 times".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The env render tree decided claim liveness with the core's statement-level
DCE edits included. When placement drops the statement of a function that
holds a hoisted nested server fn (a route component moved to its chunk, or
dead code that would pull a chunk's dependency), the handler's claim died
with it while the hoisted chain still rendered: the SSR route module shipped
the raw handler (`.handler(rawFn)`, its reads unbound, the lazy loader
unused), and every call failed. Reach decided liveness on the planner tree,
so the handler module existed too. Claim liveness is now decided by planner
edits only.
The verifier gains check (g): no output reads a module binding of the
source it neither declares nor imports (it fired on this case).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers the order the coherence review suspected (the nested chain's import
binding declared first, so its site is enumerated before the outer one): the
client stubs the outer handler and registers the outer fn only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every freeze round-tripped the planner facts through JSON to keep cached plans to
plain data. Planners build fresh facts per plan; the verify pass
(TSR_COMPILER_VERIFY, on in every test run) now fails a compile whose facts are
not JSON data, so the rule is checked where it is broken instead of paid for in
every compile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Like the split and Hydrate planners: without an edit or claim of its own the
environment planner erased nothing, so no declaration became orphaned by it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A barrel's re-exports were deduplicated with Array.includes per specifier
(quadratic: 26 ms for a 2,000-module barrel).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
guardStatementStart took the '/' of a generated '/* @__PURE__ */' annotation for a
token that could continue the previous statement, so every lazyRouteComponent
replacement walked the AST from the root to find whether it starts a statement.
It now reads the first token past leading comments.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DependentsIndex.add is only ever called for in-flight rows: drop the parameter and
its dead branch. The ledger adds a path's row once, not once per fingerprint of it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Locating a violation asked Vite for the combined input map; in a pre
transform with an empty chain Vite builds an hires identity map over the
whole input (~70 us per module, 85 % of the cost of an erasable violation
nothing requests). The input is compared with the file as written first: a
match has no map to read. Edge-module code is computed only when a listener
takes it (Rspack's virtual files); Vite builds it at `load`.
IP-heavy fixture (48 erasable denied imports), paired 10 rounds: TS-erased
dev +0.6 +/- 1.7 %, build +0.7 +/- 3.9 % vs 6aee39014f (was +1.9 % dev).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An erasable edge is decided when Rspack builds its edge module. A dev
server started on its persistent cache restores that module without a
build, so the violation went unreported in the new session (and a previous
session's veto decided its code). At `finishMake`, after the restored
importers are compiled again, an edge module whose pending violations this
session never confirmed is rebuilt: the edge-module loader decides them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R80. Whether TypeScript erases a value import whose bindings are unused or
only used as types is the bundler's transform's decision (oxc reads the
nearest tsconfig through references/extends unless its options override
it; SWC never reads tsconfig). The root tsconfig reader guessed it, and was
wrong for the stock Vite template (solution-style root: the real server
module was bundled unreported) and for Rsbuild (false reports, or a leak
under `tools.swc` verbatim).
The rule verdict and the substitution stay in the pre-TS plan. In dev such
an edge is substituted in both behaviours and recorded pending; it is
decided (`onViolation`, report, or the error) when the bundler requests its
edge module, which only post-TS code does: Vite's edge `resolveId` (import
analysis, Rolldown), Rsbuild's edge-module rule loader. A veto serves the
allowed form; an `error` violation fails every request. Build is unchanged
(the R30 witness: an erased edge module is absent from the bundle).
Tests: v2-witness (the five tsconfig layouts x Vite/Rsbuild x build/dev,
the oxc/SWC option rows, error on every request, dev vetoes). Deleted: the
planner's tsconfig rows and the v2-type-only verbatim-through-extends rows
(the Rsbuild dev row pinned the over-report; the Vite rows duplicate the
v2-witness extends layout).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A bare import or a re-export evaluates before the module body wherever it
is written: `effectStays` no longer counts one after an effectful cluster a
chunk needs (it moved only when nothing followed it) or before an augmented
export (it stayed, `eager-split:order` / kept). Two placement tests.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Dead code (audit §3 and a symbol-occurrence sweep): RewriteSet.claimLive,
DependencyLedger.paths, WarningLedger.reset(path), unread fields of the
split decisions and route recognition, the HMR planners' second rename
table (PlanContext.nameOf replaces it), CompileRequest.env.routerSplit,
the `-start` alternative of ROUTER_PACKAGE_RE, the duplicated HmrStyle,
import-protection's old ImportGraph/buildTrace and unread members, Rsbuild
R72 remnants and copied rebuild/route-digest helpers, unused Queue and
generator helpers, FunctionIdAllocator.has/get, ServerFnRegistry.tokenOf,
StartEnvFacts.useClient, the duplicated provider self-accept unit.
Less work per compile: the route-registry fingerprint is the route id
(three canonicalJson+sha1 per compile gone); edge keys are a plain join
(sha1 only for edge-module ids); the specifier segment of a substituted
edge is cut at substitution instead of per edge per output at freeze
(markSegment and the Tier 0 marker deleted); the units of each import are
listed once per plan instead of filtered per import per output; the
dependency paths of a compile are computed on demand (only the Rspack and
webpack hosts read them).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- The eight `.fails` pins asserting that a split chunk renders the instance
importers get are deleted: the chunk copies a pure exported binding by rule
(R77, "Fix: none planned"); the rendering rows next to them stay, and the
`%s` errorComponent rows assert rendering and "split or reported" only.
- Warning assertions in the four new files check position and count, not
wording (harness rule); parse warnings are deduped like every other warning
(code and wording).
- Prose aligned with the code: KNOWN-BUGS (R77 entry), planners/hmr.ts,
core/config.ts `@default`, split.ts refresh identity, diagnostics.ts,
server-fns/ids.ts rank under RSC, generator comments, router-core hmr.ts.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Start Vite bundled dev: `watchChange` runs in one environment and applies the
one invalidation to every environment's module graph (no per-env eviction
that left the other environments' dependents stale).
- Start Rsbuild: the session dedupes a watch cycle's file events across the
environment compilers (path, kind, mtime, size).
- Registry changes: `changedRoutePaths` lists the real path of a symlinked
route file too; the webpack-family hosts (router Rspack/webpack, Start
Rsbuild) tell the watching compiler the files changed (`invalidateFiles`),
so modules whose rules or plan changed are built again; the Vite router host
hard-invalidates the changed file's own modules (a file that was no route has
no plan to evict). Start's Rsbuild generator reads the registry through the
shared `RouteRegistryView`.
- Both Start hosts read `verbatimModuleSyntax` through the tsconfig `extends`
chain (one reader, `src/tsconfig.ts`).
- Start's Rsbuild `finishMake` rebuilds (client tree, import-protection
re-judge) share one helper (`rebuildModules`).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- `#__NO_SIDE_EFFECTS__` on a callee the module declares counts whatever the
order of declaration and call (function declarations are hoisted) and in
Tier 0 too: one seeding (`seedNoSideEffectDeclarations`) before any statement
is classified; units.ts no longer marks callees as it goes.
- `codeSplittingOptions.defaultBehavior: []` splits nothing unless
`splitBehavior` or the route says so, as on main.
- The mutation model takes the output's liveness filter (R1): a write inside
code the environment erases imposes nothing; reach.ts and the route planner
read the env's live view (no spurious `eager-export:reassigned` on the client
for a server-only write).
- Server-fn sites are planned in source order, so a nested site inside a
stubbed handler is dead there whichever import binding declares it.
- An opaque package's facts keep a null summary after `getTarget` (its digest
never changes); `getTarget` never answers a read in flight.
- The fallback-rounds bound is the region count after the first round (regions
accumulate across rounds; the guard could not fire before).
- Prose: README, eager-exports.ts and the warning state one rule for what
chunks copy and what they import.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The value analysis of every module that imports from a barrel follows the
barrel's export-star chain, and nothing shared the resolver's answers across
compiles: a monorepo importing a workspace UI kit from ~1,100 modules made
58k host resolves for 13k unique (env, importer, specifier) triples, +9% build
wall and +13% peak RSS vs main. The environment's PlanCache now memoises the
resolver's answers, importer → specifier → canonical id (the pending answer
while it settles, so concurrent compiles share one call), for one
fileSetVersion: the same authority that already re-validates the plans'
recorded resolutions, dropped as one when a file appears or disappears and
released with the environment's plans. Unresolved pairs are not kept (the
file may be about to appear; the add event re-resolves them). The keys and
ids are strings the compiles already hold, so the memo costs its Map entries
only. In dev, each resolution still yields one event-loop turn, so a dev
server's pending requests get in between an update's resolutions as they did
while every resolution was resolver I/O. Host resolves equal the unique
resolved triples; the app builds at parity with main.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Maintainer decision: drop the phase-A re-export follower and everything it
needed: `seedPureImports`, the `noSideEffects` flag on known facts' pure
exports and on export resolution, the router plugin hosts' resolvers
(Vite plugin context / dev environment container, webpack and Rspack
loader `getResolve`): the router plugin resolves nothing again. Direct
imports from the router packages (renamed, namespace members) stay pure
callees in Tier 0. Tests of the removed behaviour deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One table (router planner, `routerPureCalls`), per framework package:
getRouteApi, linkOptions, createLink, createRouteMask, lazyRouteComponent,
lazyFn, retainSearchParams, stripSearchParams, parseSearchWith,
stringifySearchWith, createRouterConfig (React, Vue). Read in every
framework: each constructs and returns a value, reads no global state,
registers nothing and never throws. Excluded: redirect/notFound (mutate
their argument, throw on request), createSerializationAdapter (throws on
an invalid key in development), the route factories (route units).
The router plugin's session knows the router packages by specifier, and
its hosts pass the bundler's resolver (Vite plugin context / dev
environment container, webpack/Rspack loader `getResolve`), so an app
module re-exporting an API is followed. Start's recognizer reuses the
table.
Tests: tamery's shape (an effect, `const { useParams } = getRouteApi(…)`,
an inline `validateSearch` call that stays) loads the API with its chunk
and warns only of the effect, directly, renamed and through an app
re-export; an impure argument keeps the call an effect; an API the route
module keeps no longer pins an earlier effect; `Route.useParams()` in the
split component unchanged. Vite, Rspack, webpack, Rsbuild; Start Vite and
Rsbuild.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`RecognizerTable.pureCalls` lists exports of known packages whose call is
pure when its arguments are. Tier 0 recognises imports of them by binding
(renamed, or a namespace member) before any statement is classified; phase
A follows an import of a project module the module calls at its
evaluation through re-exports over summaries (a package is never read: a
third party's purity is never assumed). Known packages' summaries flag
those exports `noSideEffects` (no longer the factories', which nothing
read) and export resolution carries the flag.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Vite host called only pre-bundled dependencies opaque (nothing is
pre-bundled in a build) and the Rsbuild host nothing, so the start-env
prefetch's export resolution parsed and summarised every node_modules
module it walked (333 of kamino's 854 raw-facts entries, the large
library files among them). RawFactsOptions.opaque (scope.ts
opaquePackageModule): a node_modules module import protection does not
check, whose text names nothing the planners recognise and re-exports no
module, is read but not parsed: summary null (unknown to a resolver),
marker from the text, target facts parsed only when a mock asks for
them (getTarget). kamino allocation 1385 → 1108 MB; raw-facts build
300 → 109 MB.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- RawFactsCache.marker(id): an import edge asks only its target's marker,
and raw facts parsed and summarised the target for it (node_modules
targets included: raw-facts build was 300 MB of a kamino build's
allocation, more than the compiles). A text without a marker specifier
literal has no marker import and is not parsed; one with the literal
gets its full facts as before. The scanned revision lets a later compile
of the same text publish its analysis.
- importUses answers a non-namespace binding at its first live reference
(no parentOf per reference, so no node index for tier-0-only modules).
- ModuleAnalysis.declarations: the body scan records each top-level
name's declarator or function; ValueAnalysis and buildSummary read it
before parentOf. The Start analysis passes the map, not a closure over
the analysis: its cache is a WeakMap keyed by the analysis, and a value
referring to its key survives every scavenge until a mark-compact.
- The Vite host digests outputs only in dev, by revision (no JSON copy of
every output of a build).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Declare the kept declaration after the effect (after `Route` for a route
option), then create the option's value in a `const` before it, then
`#__NO_SIDE_EFFECTS__` on a callee the route file declares, then
`/* @__PURE__ */` at the call. Docs list every option a user has, verified
end to end, and what does not help (an imported callee's annotation,
`"sideEffects": false`, the bundler's pure-function lists).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every judged edge was located through the bundler's combined input map
(getCombinedSourcemap on every in-scope module: 158 ms of a mk-combos
build), for traces that are printed only when a violation is reported.
The planner now records the specifier's offset and the input's revision
with each indexed edge; a trace step is located in the raw file when the
trace is built, while the file is still the text the edge was judged in.
A violation's own location and code frame are still mapped through the
input map, during the hook (a Rolldown transform context is valid only
then). Rspack records carry the revision next to the edges.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Builds on Vite, Rspack, webpack and Rsbuild, the router Vite dev server
(an edit keeping the finding does not repeat it), Start Vite and Rsbuild
builds (one warning for client and server) and Start's Vite dev server.
Docs: the supported annotations (`/* @__PURE__ */` at the call,
`/* #__NO_SIDE_EFFECTS__ */` on a function declared in the route file; not
on an imported one).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Rsbuild session's ledger keyed a warning by file and code only, so a
second declaration kept for the same reason in one route file was never
reported; it now keys by code and wording, as the Vite hosts do.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`Placement.kept` now lists, next to F5's exported declarations, the
unexported clusters only split or Hydrate chunks need that the movable test
keeps in the env module (R78): a surviving effect after the first effect
(R31 (d) / R65), several split needers, a top-level write, a read of mutable
state, a read of an effectful or `let` binding the module keeps. The cause is
recorded where the decision is taken (`movableTo` returns why not,
`effectStays` the blocking unit) and reported once, at the cause of a
cascade. `AnalysisPlan` words both kinds in one formatter, naming the
pinning effect with its line and, inside a recognised route call, its
option value (`the call \`type(…)\` in \`validateSearch\``). No placement
decision changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An effectful declaration only split code reads moves into the chunk unless a
side effect written after it (an inline call in a non-split option such as
validateSearch) stays in the route file; the file's effects keep their order.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
383f1918fb exported identifier values directly. For an imported binding
(`component: Outlet`, a component the root imports too) the chunk became a
pure re-export, which Rollup (Vite <= 7) does not emit as a chunk: it
resolves the lazy import to the module owning the binding, usually the
entry, which grows by the export glue of every such route (large app on
Vite 7: +2.7 KB initial). An imported binding gets the chunk's own
declaration again, as on main; local identifiers keep the direct export.
Repro (3 such routes): Vite 6/7 entry -332 B, total -110 B; Rsbuild -3 B;
Vite 8 entry 0, each such lazy chunk +23 B (main's form).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39e70412cb made `componentKey` a `let` reassigned in the dev-only route HMR
branch. Rollup and esbuild cannot fold the declaration once the branch is
gone, so every Solid app on Vite <= 7 grew by ~10 B. The dev-only re-key now
branches the keyed `Show` itself (still before the JSX); production keeps the
plain `const` form (Vite 7: -10 B esbuild, -6 B terser; Rolldown unchanged).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`rootRoute('__root.tsx', [physical('', '.')])` failed with "A route file can
be used for one route only" naming `__root.tsx`: the mount's scan returns the
directory's own root route file, which the tree leaves out, but the
duplicate file check (and the file analysis) counted it as a route too. The
scan now drops root route files from its route files (one predicate, shared
with the physical scan's root choice), so the tree builder's and the file
list's own filters go. Found by the large-apps validation (tamery).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An exported pure component with a Hydrate boundary inside was copied into
the boundary's own chunk, which then carried the boundary's region next to
its own generated declaration ("Identifier 'TsrHydrate0' has already been
declared"). Such a cluster is one instance the chunk imports, as before.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A Start app whose routes import from a generated icon barrel (2,000
side-effect-free modules), a Start library (createServerFn, ClientOnly, a
2 MB `?url` asset, a 400-module utility chain), with tanstack.com's
`manualChunks` group of Start's runtime: dependency-scope regressions of
the compilers show in the matrix.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A build matrix (Vite plain, with a `manualChunks` group of the TanStack
packages, with an `advancedChunks` group; Rspack and webpack with and
without `"sideEffects": false` and with `splitChunks` cacheGroups; Rsbuild
default and with cacheGroups) asserts that exported page code and what it
imports load with the route's chunk and render, that importers of the route
file share one instance, and that the build warns exactly when a module the
entry loads imports a copied export through the route file. The shapes that
broke tanstack.com run in every configuration. The dev tests that observed
extraction assert it in a production build; a dev test asserts the binding
stays in the route module and the chunk carries its copy; a dev test
asserts the kept-export warning.
The identity rows that observe the chunk's copy of a pure exported binding
are pins (KNOWN-BUGS "The split chunk copies a pure exported binding",
SPEC J2.4 amended), with rendering controls kept.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The entry walk the router's Vite and webpack hosts carried moves to the
compiler core (`eagerExtractedExports`, `rollupEntryModuleIds`,
`initialChunkResources`, `eagerExportWarning`), reworded for R77 (the
route's own chunk carries its copy; another module imports the binding
through the route file), and Start's Vite host (`generateBundle`, client
builds, deduped by the session ledger across import protection's passes)
and Rspack host (`processAssets`, client builds) warn the same way.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
An exported binding only split code needs still leaves the route module for
its side-effect-free extracted module, which the route module re-exports for
other importers; but a chunk never imports that module: when the cluster is
pure, observes no mutable state and declares nothing anything assigns or
mutates, the chunk carries its own copy with what only they share, and what
has effects or state stays one instance the chunk imports. Nobody imports
the extracted module unless another file imports the binding, so a bundler
drops it when unused and the route's chunks never depend on where it places
a module the route module re-exports (Rolldown < 1.1.5 and a user
`manualChunks` group merging into the entry placed it with the entry).
R77 dev: in dev nothing is bundled and the static re-export would only load
the extracted module one request level deeper, so the same clusters stay in
the route module as written (`PlacementInput.extractedOutputs`), and chunks
copy or import them exactly as in a build. The decision set is the same in
both modes.
An exported declaration a chunk needs that stays in the route module is
reported once per export with the reason (`eager-export:<reason>`: side
effects, reassigned, read by the module, reading what it keeps, an effect
keeping its order). The route splitter keeps the route itself whatever
another planner offered (`ctx.keep`: Hydrate offers every export).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Start's Vite host compiled every JavaScript module it was handed: on
tanstack.com 24.8k modules, 22.6k of them from node_modules, each parsed and
its imports resolved and read (+30 % build time vs main). One rule now decides
for both hosts (`compiler/scope.ts`): the app's modules always; a dependency
when import protection checks it or when its text names what the planners
recognise (the recognizer table's exports, a builder terminal, `Hydrate`, an
import-protection marker), tested before any parse. It replaces the Rsbuild
session's hand-copied text gate. Vite hook filters exclude asset queries (Start
and router hosts).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- `ASSET_QUERY_RE` (`?raw`, `?url`, `?inline`, `?worker`): such an id has no
language; its module is not the file's code.
- Facts of a file without a language are never read: a prefetch of an import of
`esbuild-wasm/esbuild.wasm?url` read 13 MB and parsed it as TypeScript. They
keep the shape an unparseable module already had.
- An output ending where the source ends gets no final line feed, so an
unchanged module without one is its input itself and hosts return no
transform (2,507 dependency modules of tanstack.com came back changed by a
line feed, each with a source map over its whole text).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the server the props only `<ClientOnly>` children read leave the
parameter pattern. A pattern losing every property kept its trailing comma
(`({ , }: Props)`, a parse error of the server build: tanstack.com
`MobileNavbarAuthControls`). Declarator runs and pattern-property runs now
share one removal (`removeListItems`): a list losing every item is removed
up to its own closing bracket, found past a trailing comma and comments (the
pattern's range covers its type annotation, which stays).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Without a JSX pragma the classic runtime's factory `React` counts as a read
of every JSX element, resolved by name in the module scope. `import type
* as React from 'react'` (tanstack.com `ds.typography.tsx`) bound that read
to a type-only import: a split component with JSX imported `React` from the
route module, whose `export { React }` TypeScript erases (Rolldown:
MISSING_EXPORT). One predicate now decides every name-based lookup: a
binding without a runtime value (type-only import of any form, interface,
type alias, type-only namespace) is never the JSX factory or fragment, nor
the function of a Solid `use:` directive (core and Hydrate planner), and
`isTypeOnlyBinding` shares it. The verifier's glue-import check no longer
accepts an export of a binding without a runtime value.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
TypeScript allows `import type { Bar, Move }` next to a value `function Bar`.
Both declare one symbol, so the type specifier shares the value's cluster.
Since "one predicate per placement rule" the env module included a type unit
only when its cluster was included. When `Bar` moved to a chunk, or the
client erased its only reader, the specifier left with it, and the partial
statement was reprinted without `type`: `import { Move } from …`. With
`verbatimModuleSyntax` that is a runtime import of a type, so the build fails
with MISSING_EXPORT and dev fails with a SyntaxError. A lone `import type { Bar }`
or `import type * as` was dropped, and a co-clustered inline `type` specifier
stayed in a route module.
`importStays` now decides every type unit by its unit, not by its cluster. An
`import type` statement and the other type declarations stay in the env module
as written. Only the TypeScript-only forms (an inline `type` specifier, an
`export { X }` of a type-only binding) follow their statement's value
specifiers. Placement returns the dropped ones and the plan reads them. This is
the env-module behaviour from before the refactor.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Real app statelyai/jevspresso (diff corpus, final gate at b25984c166): with
`verbatimModuleSyntax`, `import type { Bar, … }` next to a component
`function Bar` that moves to the split chunk is re-emitted in the route module
as a value import (`import { Move } from '../lib/types'`), so the Vite build
fails with MISSING_EXPORT. Introduced by 6e28afea28 (consolidation 2, "one
predicate per placement rule"): passes at 6e28afea28^, fails at 6e28afea28 and
b25984c166 (verified in an isolated copy at b25984c166).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An extraction candidate no longer has to be pure: its augmentations
(`Page.displayName = …`, static props, `preload`) and an effectful
initialiser travel with it under the effect-order rule of every move. An
effectful candidate joins the moving set of the fixed point with its
extracted output as target, so `effectStays` decides it: for a static output
(evaluated before the route module's body) a surviving effect before the
cluster's last one pins it, one after keeps its order; the extracted modules
evaluate in source order among themselves (re-exported in that order), so
two augmented exports both leave. The extracted module stays flagged
side-effect free when its effects only augment its own declarations
(unobservable while nothing imports the binding), so bundlers drop the unused
re-export and the component loads with its chunk on every bundler.
Tests: core rows (augmentations, earlier/later effect, two exports in order,
effectful initialiser, a kept read), page rows through a real dev server,
a production-build row per bundler and hint, a Vite + Chromium HMR edit.
The toy split planner skips the route's own symbol like the real one.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Needers come from the reach sets (one pass over them) instead of a Set per
cluster, orphans from the erased set, the cluster kind from a predicate
instead of a Set of unit kinds, generated reads without intermediate arrays;
the extraction bookkeeping (what derived outputs need, the static-output
readers) runs only when an extraction candidate exists.
Micro-bench (8 paired rounds vs the previous step, identical outputs on 4/4
workloads): per module react client -1.9 %, react ssr -2.9 %, solid client
-1.5 %, solid ssr -1.6 %.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Per-output arrays indexed by member/cluster replace the string-keyed maps of
memberReads/clusterReads (the top line of computePlacement was building and
hashing those keys); the successor clusters of a cluster are cached per output
like its reads; the union-find lives in an Int32Array; regions by range are
indexed on the first retained slice with a numeric key.
Micro-bench (6 paired rounds, head 3bd46fdc2c vs this, identical outputs on
4/4 workloads): per module react client -2.6 %, react ssr -4.0 %, solid client
-4.2 %, solid ssr -3.7 % (every CI below 0).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The effect-count check probed the statement's first offset for a slice, which a renamed first token (route HMR renames `page` in `page = connect(page)`) replaces with generated text: the check reported the effect missing and the dev server answered 500 for the route. An output holds a unit when any of its segments comes from the unit's range (a slice, or text mapped there) outside the sub-regions other outputs claim.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`memberWrite` is always present on a classified reference (one object shape for every consumer); the clusters that read mutable state are computed once over the eager live reads of written bindings instead of by scanning every reference of every cluster asked about, and only in modules that write a module binding.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- `MutationModel` is a view over the reference index: no pass of its own, no
site objects; a binding's write sites are filtered on first ask.
- Whether a function is immediately invoked is read off the text in every
unambiguous case (a callee is followed by `(`, or is the whole content of
grouping parentheses followed by `(`/`.call(`/`.apply(`); only a `)`, `]`,
`}` or a comment before the opening parenthesis asks the parents (one
parent lookup per function scope cost ~3 µs per route module). Rows pin
the classification.
- The benign check of a named unit is a memoised predicate asked only when
a cluster could move past the unit; the function-scope test of the
orphans is built on first use; the planning round is a plain function;
the per-module maps allocate lazily; the writers loop of the movable test
is skipped in modules without writes.
Paired A/B of the in-process micro-bench (6 rounds, 20 iterations, mirrored
cores): react/solid × client/ssr from +2…+4.5 % per module to parity on
three workloads and +2 % on react/client (notes: impl-notes-structural.md).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Rspack 2.2.9's SWC rejects a class field with both `!` and an initializer,
so the Rspack row's input no longer reaches the compiler's unparsed path.
The same TypeScript error on a variable declaration is still accepted by SWC
and rejected by Yuku.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The benign check of a named unit looked each option value up by its innermost region; the claimed regions (few per module) are indexed by start offset instead. The per-cluster cache of the mutable-read predicate is allocated only in modules that write a module binding.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`TSR_COMPILER_VERIFY=1` (read once; every test run sets it through the shared
run-directory setup and the core's own config) re-parses each emitted output
and fails the compile when an output assigns a binding it imports, a glue
import names nothing its home exports, an output holds text its own edits
erase, a surviving effect statement is emitted other than once across the
outputs that import from the env module (none when placement removed its
cluster), or an extracted export's module reads a binding of the env module
at its evaluation. Unset, it costs one boolean per compile.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Fallbacks were applied for three planning rounds and then the plan was
frozen with whatever the third round reported left unapplied: a chain of
three components each writing a module binding the previous one reads
produced a chunk that assigns a binding it imports (`TypeError: Assignment
to constant variable` when the not-found component renders), silently.
Each round keeps at least one more region of the module in place, so the
rounds continue until no new range is reported and end within the module's
region count; past that bound every sub-region is kept in place (always
correct) and a warning (`fallback-rounds-exhausted`) says so.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The placement core answered "does something write this binding?" four ways
(ordered evaluation: eager writes only; the movable test: own augmentations,
eager writes from outside, member writes of kept consts; the server-fn
hoist: reassignable and any write; the split planner: any write of an
identifier option value) and none for a pure reader, and classified every
read inside a function as lazy, immediately invoked functions included.
Each gap was a wrong value: a pure initialiser of a binding a function
writes moved to the chunk and was recomputed after the write; a snapshot
taken by an IIFE or by a call reading a member of a mutated object moved;
the route unit was declared benign whatever its option values, so an impure
option ran before the declarations above it; a write-only server-only
initialiser shipped to the client; a provider env's env output kept
handler-only initialisers.
- `mutation.ts`: one `MutationModel` per module (`t1.mutation`), built in
one pass over the classified references: every assignment and member
write of a binding, eager or lazy. Planners ask `isReassigned` /
`isMutated`; `RefIndex.writesOf` and the planner-side write scans go.
- `reach.ts`: one table of module-level writes from the model (plus the
augmentation units) and one predicate, `mutatedOutside(sym, readAt,
cluster)`: a read observes mutable state when another cluster writes the
binding after it or at an unknown time. It decides the option-value
fallback (`ordered-effect`), the movable test's (b) and (c), and a new
gate for pure clusters (`readsMutableState` → `undecided`): such a reader
is an env root and chunks import it. `mutatedClusters`,
`externallyMutated` and `unwrittenConst` are deleted; R67's `let` clause
stays. Provenance seeds include writes inside erased ranges; a provider
output does not keep an orphan in the env module (it copies what it
reaches) and a cluster only providers need is homed in the provider.
- `analysis.ts`: `isLazyAt` follows evaluation (a function that is the
callee of a call, directly or through `.call`/`.apply`, is eager);
`inFunctionAt` keeps the scope question for the function-local orphans.
- `plan.ts`: a unit a planner names benign is benign only when every
argument of its call chain is pure, an object literal judged per property
with claimed and env-erased values counting as pure. The planner names,
the core checks.
- The nested server-fn hoist refuses a read of a binding something
mutates (its read moves to module load).
Tests: core placement rows for every counterexample (all failing before),
router-plugin page rows in a real browser (a chain of writers, a lazy write
of an array literal / static field, an IIFE and a member-reading call, an
impure option value), a Start row for the write-only initialiser and a
provider-env planner row.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Consolidation 2 moved the "pure, unwritten" filter of extracted exports
into the core, so the splitter declares an export output for every
exported binding. With the HMR fuzz fixes that broke two things once a
write (`Page.displayName = ...`) made the core keep an extracted
component in the route module: `liveModules` kept the stale
`?tsr-split=export~Page` (declared, so listed in `plan.outputs`), and the
refresh id named the extracted module while React Refresh registered the
component in the route module. Both left the page on the old text.
- plan.ts: a cancelled extracted-export output is no output of the plan
(a stale request still emits `export {}`).
- `SymRef` ctx `homeId`: a string literal of the id of the module the
output takes the binding from, decided by placement. The splitter's
refresh id uses it instead of guessing the home.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack 2.2.7's MultiCompiler could emit `done` with a child's stale Stats
while that child was compiling again: the RSC Coordinator invalidates the
client compiler from the server's watchRun, and a client compile restarted
by the run graph fired no `invalid` hook (rspack#15865, fixed in 2.2.9).
Rsbuild then saw the client's initial chunks change and sent `full-reload`,
which Start's RSC dev setup ignores (`liveReload: false`), so an edit of a
server component's CSS never reached the page (react-start-rsc
rsc-css-hmr-rsbuild: 4/50 alone, 6/25 under load; 0/125 after the bump).
Rspack 2.2.9's `RuleSetUseItem` admits falsy items: the RSC SWC setup
skips them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The importer-based rule missed a stale derived module while the chunk still
imported it (the graph's edges change only when the chunk re-imports): Vite
hot-updated the extracted-export module, plugin-react invalidated it
("export removed") against the route update, and the page kept the old text
(flaked in the full integration tier). `liveModules` now transforms the
file's own module first (Vite invalidated it before the hooks ran) and keeps
the derived modules the file's current plan declares; without a plan, one
without importers is stale.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The component chunk stamped `$$tsrRefreshId = "<chunk> Name"` on a component
it only re-exports from its extracted-export module, so after a component
became exported (in the same save as a text change) the route HMR runtime
kept the held component, expecting React Refresh to patch it, while
plugin-react had registered the new function in another module: the page
kept the old text. The id's module part is the extracted-export module for
an exported pure declaration (the extraction predicate, hoisted), else the
chunk.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Two full reloads the HMR consistency fuzzer found on Vite:
- A derived module of a layout the file no longer has (an extracted export
once the export went, a split chunk after a `codeSplitGroupings: []`
round trip) stays in Vite's module graph without importers; the next
edit of the file hot-updated it and Vite dead-ended into a page reload.
Both Vite hosts drop such modules from the file's update (`liveModules`).
- Start: a route file gaining an export changed its target facts, the route
tree re-planned as a dependent and was propagated as a hot module, which
nothing accepts. A dependent is propagated only when the compiler's
output changed (`outputDigests`, recorded by the transform hook).
Tests: router-plugin route-hmr-after-split-change.test.ts, start-plugin-core
start-dev-route-split-change.test.ts.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
An unparsable save (every keystroke mid-edit) gave the file unknown target
facts, which made its importers' plans stale dependents: Start's hotUpdate
hard-invalidated and propagated them, and the route tree (accepted by
nothing) dead-ended into a full reload onto the dev server's error page,
where the fix never showed. The facts the file last parsed to stay until it
parses again, as the generator already does for its own analysis.
Found by the HMR consistency fuzzer. Test: start-plugin-core
start-dev-route-syntax-error.test.ts (root route, another route).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The `start-env` planner addresses its nested-chain override to the env module
only: a chain inside a function that moves into a split chunk renders the
placeholder there, and the chunk imports the hoisted binding from the provider
module. The row shows why no environment observes it: a derived provider exists
only in the Vite `rsc` environment, whose build input is the rsc entry alone,
so route modules enter its graph as provider outputs (copies) and never as
their env module or split chunks. The page works (the handler runs in the
provider when the browser calls it, its body is in no client file) and the
rsc build holds none of the route's component code. The override's comment
says so; the Rsbuild architecture note no longer describes the deleted
separate provider environment.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The placement core had grown copies of its own rules: two "reads what the env
module keeps" predicates (one for an extraction candidate, one for what its
output reaches), two effect-order predicates (one per direction), an import
pin computed from pristine references next to an import drop computed from
final needers (each with a route-module clause, with the TypeScript-only
specifier rules in the plan on top), four scans of the references for the
writes each rule needs, and a planner pre-filter duplicating the core's
extraction-candidate filter.
- `readsKeptEagerly` is the one "reads kept" predicate; `extractable` is
built on it. The two copies disagreed on copyable targets: the merged
predicate skips them (the reading output gets its own copy, so there is no
read through the re-export cycle), which lets an exported declaration that
reads a copyable constant the route module keeps be extracted (test).
- `effectStays` is the one effect-order predicate: for a lazily imported
output, a surviving effect after the cluster's first effect that stays
behind; for a static output, any other surviving effect at all.
- `importStays`, next to the declaration orphans, owns the import rule:
provenance for value specifiers (an import the source never read stays; one
our edits orphaned, or read only by a dropped dead pure cluster, leaves;
type-only use leaves route modules), and the TypeScript-only forms (inline
`type` specifiers, `export { X }` of a type-only binding) after inclusion,
following their statement's value specifiers. The plan reads inclusion for
them instead of its own route-module branches; a vacuous branch of the
source-edge pass goes.
- One table of top-level writes (assignments, augmentations; live, eager,
owner) feeds clustering, ordered evaluation and the movable test's two
mutation checks. Both round caps become plain fixed points: every changed
round merges two clusters, or copies a cluster into an output, so they end.
- A dev-only check after inclusion: no cluster of an extracted export's
module reads a non-copyable env-module cluster at its evaluation.
- `sideEffectFree` is computed from the content: an output the planner opted
in is flagged only when no effectful cluster was placed in it (a cluster
that moved with its only needer keeps the flag off; test).
- The core's candidate filter is the only one (it gains the per-symbol write
check the planners had); the router and Hydrate planners allow every local
value export out.
- `Placement` loses the fields nothing read (`movable`, `orphaned`,
`needers`, `clusterOfSym`, `readsIn`); the claim sequence base is one
helper; `MUTATORS`/`isObjectMutator` are module-private; source comments
and the README state the rules instead of citing design notes; the route
registry's identity contract is on its type (a read-only snapshot).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Every scanned route file was kept up (scaffold, id and constructor fixes)
before the tree model decided which files are routes, so files the tree
leaves out were rewritten as routes: a `__root/route.tsx` beside
`__root.tsx` got the id `/__root` (an empty one was scaffolded), an empty
`__root.lazy.tsx` was scaffolded, an unused duplicate lazy file had its id
fixed. A file's analysis now records the upkeep it needs (`pending`), and
the upkeep is written only for files the built tree imports
(`importedFiles(model)`); a file that joins the tree later gets it then.
Found by the route generator differential fuzzer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route tree imports a route file by its path without the extension
(unless `addExtensions` keeps it). Two routes of a virtual route config on
`x.ts` and `x.tsx` passed the used-once check (two files), but the tree
imported both as `./routes/x`: one `Route` object updated with two ids, and
the router's duplicate route invariant at startup, naming no file. The check
now keys by the imported module and names every file of a module used for
several routes. Found by the route generator differential fuzzer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With `routes/__root.tsx` and a `routes/__root/route.tsx`, the root route was
the first node with the route path `/__root`. The scan lists entries by name
and the directory `__root` sorts before `__root.tsx`, so the directory's
route file became the tree's root and the app's `__root.tsx` was left out of
the tree without a diagnostic (an empty `__root/route.tsx` was even
scaffolded with the root template). The routes directory's own `__root` file
now wins. Found by the route generator differential fuzzer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An import specifier now follows the same provenance rule as declarations:
it leaves an output only when our edits orphaned it (its readers were
moved or erased). A specifier the source never reads stays in the route
module, so its module still evaluates there, as it does without the
plugin; a mixed statement keeps its unread specifiers when the others
move. A value import a route module only uses in type positions still
leaves it (TypeScript erases it). Split chunks still get only what they
read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every Rsbuild adapter serves server fns from ssr (RSC layers the provider
into the same environment), so the third environment, its compiler entry,
dependency wiring, provider overrides and the providerEnvironmentName
option were unreachable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Core planner-facing members with no caller anywhere and never executed by
the oracle, noncompiler tiers or the diff corpus: RefIndex.isSelfRef,
JsxInfo.hasJsx, Tier1.functionOwning, Tier1.orphanedLocals,
ModuleAnalysis.hasTier1, ValueAnalysis.valueOfBindingNode,
RenderTree.regionTable.
Start: the <Hydrate> `for await` check (a statement in the children always
sits in a function or class body, where it is allowed) and the
describeServerFn JSXAttribute case (an attribute's value is its expression
container, never the chain). Client bytes unchanged in all 18 scenarios.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The env module re-exports an extracted exported component's module statically, so that module and
what it imports evaluate before the env module's body. A declaration moved there because only that
export needed it read a binding the env module keeps through the cycle, before its initialisation
("Cannot access 'Model' before initialization"; an enum read `undefined.A`), and an effectful
declaration moved there ran before every effect of the env module.
Two rules in the placement fixed point: a declaration cluster an extracted-export output reaches
that reads, at its evaluation, a non-copyable cluster the env module keeps becomes an env root (the
extracted module imports it); an effectful cluster moves to an extracted-export output only when no
surviving effect precedes it in source order (the static counterpart of R31 (d)).
Found by differential fuzzing against main's compiler.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A let the loader reads and the split component reassigns, two split options
writing one binding (two chunks and one chunk), an option value reading a
binding later top-level code reassigns: one binding, unsplit values, split or
warned (J2.8). A route created through `Router.createFileRoute` splits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Public-API tests for branches neither the oracle nor the diff corpus reached:
the four hoist refusals of a nested server fn, the #n disambiguation and the
name paths of server-fn ids, the top-level `for await` that keeps handlers
eager, import protection's `sideEffects` list classification (reported only
for listed files), and the <Hydrate> new.target rejection.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Derived reach is recomputed only when a reached cluster became an env root
or a candidate was cancelled; the claim-nesting check compares against the
few claim ranges numerically; writesMember pre-filters call arguments and
the write-target table returns a shared empty list. Compile-all parity with
head (4 interleaved rounds).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Drops a page row whose runtime witness another page row and a core row
already give (first stays before second moving to another chunk).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
isFinalBuild (beside releaseEnvironment) decides for both Vite hosts when
an environment's production build is its last; the Rsbuild route generator
publishes through the router-plugin context instead of its own copy of the
dedupe guard and the changed-paths computation. The generator documents
the identity contract the guard relies on.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
An edit addressed to every output on exactly a claimed region now nests
inside the claim and travels with the region into its owner; only an edit
scoped to the output replaces the placeholder there. start-env no longer
buffers its isomorphic/env-only rewrites of lazy handlers to re-emit them
scoped to the handler module.
PlanContext.fallbackAt replaces three hand-written range matchers; one
writeTargets table defines which operand a construct writes for both the
R67 member-write classification and top-level augmentation units; one
needsLeadingSemicolon helper serves the env and derived render paths.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
An effectful cluster the env module keeps for a derived output (orphaned by
an env erasure, not movable) was rooted only after homes were assigned, so
R31 (d) had been decided against a moving set that no longer held: an
earlier initialiser could move to the chunk and evaluate after one the
fixup pulled back. The extraction decision ran after the env roots were
frozen, so a cluster two chunks reached only through a candidate could
never move into the extracted output.
One monotone loop now owns env roots, the moving set and the extraction
candidates; a cluster orphaned by us is skipped only when no derived output
needs it, and the post-home repair is a dev-only invariant check.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Route HMR (R70): after a render error reaches the global catch boundary, a
route update hot-updated and reset it, which re-renders the root match's
document (Solid cannot client-render a hydratable <html>: "template is not a
function"; React and Vue lose the root after an error during hydration); and
Solid's and Vue's route boundaries do not reset when the fixed component swaps
in. No route edit showed until a manual reload (diff corpus T1). The adapters'
development-only onCatch now marks the router (`_hmrReload`, @internal, not in
the published types) and applyRouteHmr / applyRouteChunkHmr reload the page
instead, as main does for Solid route edits. React's route boundaries recover
in place (React Refresh retries them) and stay unmarked.
The Solid-only known-bug test becomes start-dev-route-error-recovery.test.ts,
covering React, Solid and Vue.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What the page shows after the component threw is the router's business (the server's HTML, or an error component
once the global boundary renders inside the document), so the test no longer waits for the server-rendered text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by the real-app differential corpus (thomascarter613/bun-monorepo, Solid Start template; signature T1): a
component in the document shell throws in the browser, so the router's global catch boundary holds the error. On
main a route edit full-reloads and shows; with route HMR the edit hot-updates, the boundary resets and re-renders the
root match, whose shellComponent renders `<html>`, which Solid cannot render outside hydration ("template is not a
function"): no route edit shows until a manual reload. Fails at eedc638e42 (SPEC J3.3). Candidate: the architect
decides whether to fix in solid-router (shell outside the global boundary) or accept.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A minifier (Oxc via Rolldown) inlines a single-use `const` only when no
effectful statement separates it from its use. The importer was emitted
after the imports, so an effectful declaration the route module keeps
before `Route` (e.g. `const q = { a: apiQuery(…) }`, read by the loader and
the split component) kept it as a separate binding in minified bundles.
Anchor it before the statement holding its group's first placeholder.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite dev: concurrent first calls (direct and over HTTP) load a handler's
slow server-only module once; an edit of a module the server fn module and
its handler share reaches both without a full reload. Rsbuild dev: a
handler's server-only module loads on the first call and an edit of it
reaches the next call without a full reload. Vue: the server-only module of
a handler in a `<script lang="ts">` block is not loaded with the SFC.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An effectful cluster may read a module binding the route module keeps when it
is a const no code in the module writes a member of: it evaluated before the
chunk loads, and the chunk imports that one instance (main shares it through
a ?tsr-shared module). Member writes (assignment, update, delete, destructuring
and for-in/of targets, mutating methods, Object.assign-style calls) anywhere in
the module pin it, as does a let.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In the in-place provider (SSR), each server fn's handler moves into one
derived handler module per defining module (`?tss-serverfn-handler`),
loaded through one memoised loader on the first call, direct or over HTTP.
What only handlers read moves with them (route splitting's placement);
everything the module itself needs stays and is imported back, so nothing
evaluates twice. Handlers stay in place when they write state the module
reads, or when the module awaits at its top level. Nested (hoisted) server
fns move too. Derived ids keep a trailing `lang.*` query key last, so the
handler module of a Vue SFC block is still TypeScript.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by the real-app differential corpus (lbogerd/tictaak-start): with the handler kept in place in the SSR
output (DESIGN 3.10.4), the database module a route file's server fn handlers import loads with the route
tree; it throws without DATABASE_URL, so every page answers 500 on the PR while main renders (307 to login).
Fails at 861d7d7663 (before: true). Candidate: the architect decides whether this is a regression or an
accepted, documented behaviour change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
router-plugin: a component whose augmentations an effect separates stays with
the effect in source order; a declarator before a later one of its statement
that stays; a declaration another one reads stays with it; interleaved
declarations and augmentations move together in order; a chain of
declarations moving to two chunks keeps the earlier ones eager. Start: a
handler's declarations and augmentations next to a kept declaration calling
the same import run in source order on the server and the client; the handler
case records client effects before a call loads the module in the page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R64: an effectful cluster is no longer pinned in the route module because an
import it reads is also read by code that stays or by another chunk: the chunk
loads after the route module, so the import is initialised and reading it
lazily changes nothing (main moves it too). Reading a non-pure module binding
still keeps it eager.
R65: (d) looks at the surviving effects after the cluster's first effectful
unit, not after its last item: `Page.a = eff1(); log(); Page.b = eff2()` keeps
`Page` and its augmentations eager instead of running `log` before `eff1`. A
later declarator of the same statement now counts too. Moves are the greatest
fixed point (drop blocked clusters until none is dropped), and the env-roots
loop runs until no root is added instead of stopping after ten rounds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by the real-app differential corpus (thenishantsapkota/streamly, routes/index.tsx): SERIES_ROWS and
ANIME_ROWS (arrays of apiQuery(...) only the page reads) stay in the route module because apiQuery is also
called by declarations the loader keeps; main moves them (+981 B initial on the PR). DESIGN R31 (c) only allows
the move for import specifiers used by no other output. Fails at 861d7d7663 (rule (c) untouched there).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Function-local declarations only removed code read were cleaned one chain
link per round, at most 8 rounds: a longer chain kept its first declarations
and the module they read (a server-only import on the client).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Semicolon-free code writes `;(x as any).y = 1`: the `;` ends the previous
statement. Dropping that statement in the env module, or emitting the
statement after another one in a derived output, glued the two into a call.
Such a statement now gets a `;` of its own wherever its source predecessor
does not render intact before it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An exported declaration moved into its own module is re-exported by the route
module, so one eagerly reading a binding the route module keeps evaluated
before that binding existed (TDZ). The check read the env liveness from before
other candidates were cancelled and before effectful declarations a chunk
needs were rooted in the route module; it now repeats with the extracted
outputs, the moves and those roots until no candidate is cancelled.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extends the differential-corpus case: an effect staying in the route module, a
declaration the route module also reads, and a later declaration moving to
another chunk keep the earlier ones eager (their effects run in source order);
a server fn file's declarations only the handler reads run once, in order, on
the server and not on the client.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R31 (d) blocks an effectful cluster's move only on an effect that survives in the
route module after it. The movable test counted later clusters that move too, so
with N effectful declarations only the split component reads, the first N-1
stayed eager (exported, imported back by the chunk). Moves are now decided per
env-roots round from the final placement, last item first: a later effect moving
to the same output evaluates after it there in source order and does not block;
one staying in the env module or moving to another output still does. The set is
recomputed every round (and after the extracted-exports decision) instead of
accumulating stale entries.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by the real-app differential corpus (dmjkbrown-virtualstagingiom/virtualstagingiomNetlify,
routes/checkout.tsx and estate-agent-tool.tsx): with N such declarations the route module kept the
first N-1 (exported, imported back by the chunk), so the eager bundle grew vs main. Fails at
87df4006f9 for 2 and 3 declarations.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The release test reads the process-global compiler stats, summed over every
live session. In the `integration` project (`isolate: false`), an earlier
file of the same worker (rsbuild/dev-server.test.ts, which enables the same
stats knob) leaves its Rsbuild dev session alive after its server closed:
Rspack's native binding holds the closed compiler's last compilation
through a global handle (GC roots > global handles > JsCompilation >
Compilation > Compiler > Start's transformer > session), so the probe counted
that session's 107 plans and 2 import-protection environments on top of the
build's released client. Reproduced with one worker and that file order; the
host's release is not at fault.
The file now runs in project `integration-alone` (`isolate: true`, a new
process per file), which `test:integration` runs too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test imported `@tanstack/router-plugin/context` and `/vite`, the
package's own built entries, but `test:unit` depends only on its
dependencies' builds: on CI the test ran before the package's build (its
dist restored from the remote cache) had finished, and the self-reference
found no dist. Locally an earlier build's dist answered it. The unit tests
import the plugin from `src`, as the others do.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After a dev edit, the server sends the host's page a full reload, which
Vite's HMR client applies 20 ms later (debounced), after `settle()` has
returned. The fresh run's own `page.reload()` raced it: aborted
(net::ERR_ABORTED), detached ("Not attached to an active page"), or left a
document whose import never settled (the Alpine CI failure of "dev:
editing a factory module recompiles its importers"). Reproduced with
Alpine 3.22's Chromium 142 and musl Node 24.8 on 4 CPUs under load (4 of
24 runs; the full-reload frame arrived 24 ms before the harness's reload);
0 of 24 with a new page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route registry is keyed by the generator's posix-form paths (as the
subscribers' module ids are); the test expected `path.join`'s, which use
backslashes on Windows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every watcher event re-published the generator's registry, the same Map
when no route changed, and each `onRoutesChanged` subscriber compared the
whole registry with itself: O(routes) per edit of any file (~0.14 ms per
shared-module edit on the 1,485-route harness app). The generator replaces
its registry when a route changes, so the same registry again is no change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A build of several environments (client, ssr, then nitro or rsc) kept every
finished environment's plans and import-protection state until the whole
build ended (#8794). The environment's logical build owns the release:
Start's Vite builder.build wrapper after the import-protection fixed point
(a written, non-watch build; plugin-rsc's write:false scans build again),
the Rsbuild compiler's last done pass outside watch mode, and router-plugin's
Vite closeBundle. The core's releaseEnvironment drops the environment's
plan cache; what later environments read (raw facts, server-fn registry
and snapshots, id allocator, warnings) stays.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port of the type-annotation regression test of #8818: a loader typed
`(): Page.Props` reads no value, so the component stays in its chunk.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start pre-bundled `@tanstack/<framework>-router/hmr` on its own while the
framework plugins exclude the router package from optimization: every
compiled route module imported an optimized chunk deep in the client
entry's graph, and when a post-scan re-optimization committed before the
browser fetched it, the request got 504 "Outdated Optimize Dep", the graph
never evaluated, the dev client (imported by the dev client entry) never
connected, and Vite's buffered full reload was never delivered (Vue Start
medium: 12 of 14 cold starts stranded). The subpath is served from source
with the rest of the excluded package now (one instance of the HMR state).
Vue Start also re-optimized and reloaded on every cold start: the scanner
never sees `@tanstack/vue-store` behind the excluded router package, and
once discovered it re-chunks the pre-bundled `vue`. Declared through
`optimizeDeps.include` as React Start does for `@tanstack/react-store`.
Cold start: 10.5 s (main) / 19.4 s (before) -> 3.3 s, no reload. Adds a
cold-start integration test (Vue, with React as control) on a fresh
dependency cache, and `framework: 'vue'` to the Start dev-server harness.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`invalidate()` ran two linear scans per changed file and per environment:
`PlanCache.keysAt` over every plan and in-flight attempt, and
`RawFactsCache.markStale`/`forget` over every raw-facts entry, calling
`identify()` on each (~1.25 ms per shared-module edit in the large React
Start app, growing with the app). Both now keep a path index maintained
where entries are published, begun and retired. A plain change also no
longer re-resolves the dependents' resolution fingerprints through the
bundler: the file set is unchanged, so the resolver's answers stand, as
plan validation already assumes at an unchanged fileSetVersion.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The shows-component, shows-error and shows-not-found rows return to
known-bug pins on Vite and Rsbuild, as in the oracle; the Rsbuild
shares-module rows (#8780) keep passing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bare style imports of a route module stay in the route module whether or
not its components are split, as on main. Removes the route-split home
rule that moved them into the component chunks and the core's
isStyleImport unit flag it alone used.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The compiler reports an unsplit option once per (file, reason) and dev
server (J2.19); the shared hosts' routes share one route file, so another
test's earlier report on the same host hid this one's (failed in the full
integration tier, passes alone). As the imported-options route and this
file's errorComponent cases already do: fresh: true.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Full Chromium (Alpine's) requests /favicon.ico, which the test apps do not
serve; its console 404 failed serveCase's 'no page errors' check
(reproduced locally with Playwright's full Chromium, 1 run in 3). The
console filter matches the message's URL, so a module's 404 still counts.
The start-compiler-factories dev-edit tests timed out at 30 s on Alpine
once (1.3 s in the green run): a wait that never ended, not a slow
runner. Their page steps were raw Playwright calls with no bound below the
test's, so the failure named nothing. They now go through the host's page
runs (bounded, page errors and console reported, navigation retried after
the dev server is idle), and a fresh run's reload is bounded too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Windows failures of the start-plugin-core unit tier (Compiler Platforms
run 40324307091) were path-form assumptions of the tests and their harness:
- reporting: map files are host ids, absolute in the platform's form
(D:/app/... on Windows); the fixtures use such a root.
- edge-modules: Rspack edge-module ids are forward-slash paths; compared
with the native temp directory.
- planner: the in-memory host keyed package.json reads by forward-slash
paths while the product joins native ones.
- start-host/render graph walks: Vite's module graph keys files by
forward-slash paths; the native case file found no module, so
serverLoads() was empty (and client graph loads checked nothing).
Product fix: import protection decoded file:// map sources with the URL's
pathname (/D:/... on Windows); use fileURLToPath (test + changeset).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The compiler reports an unsplit route once per dev server; on the Alpine
runner the second test reused the host that compiled the route for the
first one, so its diagnostics window held no warning ("0 of 0").
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The consumer's resolve and transform hooks compared Vite's module ids
(forward slashes on every platform) with the recorded inputs' native paths
(backslashes on Windows), so no fixture module was ever recognised there:
every route's file was null and no import edge was recorded.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`cleanOrphanedDeclarations` asked `isPureExpression` about a class
declaration, which only knows class expressions, so such a class never
left with its erased reader; it now asks `isPureClass`. Adds unit tests
for `WarningLedger`, the string/identifier helpers, parse diagnostics and
expression wrappers, export summaries and their digest, and the orphan
cleanup's multi-declarator and lazy declaration paths.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The Rsbuild/webpack hosts ended their messages with `\n at file:line:col`,
which the Rsbuild error overlay spec (and its readers) could not position;
both now use the Vite host's `message (file:line:col)` form. The overlay
spec's line parser reads that form too, with the same assertions.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Vite's chokidar drops a second `change` of the same path within 50 ms of
the previous one, and the compiler is now fast enough that an HMR spec's
next edit landed inside that window (hmr "publishes a failed route refresh
and accepts the next HMR update", "multiple HMR saves"): the edit never
reached the bundler. The file editor spaces writes of one file by 100 ms.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Root routes are not split, as on main: their component, errorComponent and
notFoundComponent stay in the root route module in every env and bundler.
Splitting them added a lazy round trip to every not-found and error render on
the server, and the manifest preloaded the chunk on every page anyway. The
J2.7 goal pin goes back to a known-bug pin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pnpm links workspace packages on Windows with relative directory symbolic
links where it may create them (the CI runners). Windows resolves a
relative symbolic link reached through a junction against the junction's
own path, not its target's, so through the junctions the harnesses made
to the packages' `node_modules`, `@tanstack/react-router` led nowhere:
`existsSync` was false and Node's, Vite's and the optimizer's resolvers
all missed it ("Cannot find module '@tanstack/react-router'" in the
generator's consumer runs; the dev servers served the router package raw
with its CommonJS dependency, after "Failed to resolve dependency ...
present in optimizeDeps.include"). Verified in a diagnostic run of the
Compiler Platforms workflow: a directory symbolic link resolves, a
junction does not, on either drive. `linkDirectory` makes a symbolic
link and falls back to a junction where the process may not (where pnpm
falls back too, so its own links are absolute).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Main ran the plugin-order check in the code-splitter plugin, so only with
`autoCodeSplitting` on; the single compiler plugin ran it in every mode and
failed the router-monorepo example builds (`react()` before
`tanstackRouter()`, splitting off). Without splitting, route HMR works
whatever the order: the HMR block is appended to what the framework plugin
emitted. Verified on a real page (integration/route-hmr-browser-plugin-
order.test.ts): with the framework plugin first and splitting off, an edit
of a named or inline React component shows in place keeping its state, a
Solid edit shows in place, no warning; with splitting on, the dev server
refuses to start. The six example reorders are reverted: main's order builds
again, and the example builds of the PR workflow cover the restored gate.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Alpine's distribution Chromium (a full browser, not Playwright's headless shell) requests /favicon.ico, which no test app serves; the page harness reported it as a failed module. The generator's fast tier timed out at Vitest's default 5 s on the macOS arm64 runner (a generator run plus a Vite load per test): 15 s.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
On the Nx Cloud agents (--parallel=3) the router-plugin integration tier took 405-438 s at 4 workers against its 80 s hard limit and 47 tests hit their 30 s / 10 s timeouts; the fast tier took 62 s against 10 s. Each tier starts four Vitest workers with Vite dev servers and Chromium pages. Mark the tiers parallelism: false (as test:e2e is) and use min(4, max(1, cpus / 2)) workers.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A library build (build.lib, external dependencies) lists the external packages among a chunk's imports; the walk from the entry chunk dereferenced them as chunks and failed the build with "Cannot read properties of undefined (reading 'modules')" (the router-monorepo examples once their plugin order was fixed).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The branch's compiler plugin checks the plugin order in every mode (main only did with autoCodeSplitting on), so these six library builds failed with "Plugin order error: '@vitejs/plugin-react' is placed before '@tanstack/router-plugin'".
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
On the Windows runners os.tmpdir() is an 8.3 short name (C:\Users\RUNNER~1\...), while fs.promises.realpath reports long names (C:\Users\runneradmin\...): 225 generator tests failed with "No fixture inputs recorded for ...". The run directory now uses realpathSync.native, and the consumer-inputs registry canonicalises recorded roots and looked-up files the same way.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The fast tier runs its client checks in a headless Chromium (route-app.ts), which no runner had ("Executable doesn't exist" on Windows, macOS, Linux arm64 and Alpine); start-plugin-core's unit tier depends on the Solid and Vue Start builds, which the install filter left out ("Cannot find package 'vitest'" loading their vite.config.ts).
Install Playwright's Chromium (with its Linux dependencies) and the react/solid/vue Start packages. Alpine has no Playwright build: install the distribution's Chromium and name it through TANSTACK_COMPILER_TESTS_CHROMIUM, which the browser helper passes as executablePath.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
K2 made it module-private; K1's path-normalization test imports it to
compute the expected ids.
[final-head]
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: purity.ts keeps K1's empty-set guard on top of core
unwrapExpression; pipeline.ts takes K1's identity-recipe and plan
fingerprint helpers with K2's self-contained comments; import-protection
utils.ts keeps K2's removal of the unused clearNormalizeFilePathCache.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Start's Rsbuild dev server, an edit that adds `createServerFn` to a
code-split route whose page is open fails when the server fn is used by
the component: Rspack's `splitChunks` (its default cache groups on Start's
`chunks: 'async'` client) moves the gained `node_modules` modules into a
new async chunk, and the hot update of the already loaded component chunk
re-executes the route's component module before anything loads that chunk
(`Cannot read properties of undefined (reading 'call')`). Upstream
(Rspack's HMR runtime, web-infra-dev/rspack#11324, #11922): a plain
Rsbuild app without any TanStack code fails the same way, so the test is
a `.fails` pin. A loader-only edit works (the loader chunk loads only when
the loader runs), and so does the same component edit when the client
entry already imports a server fn (no new chunk): both are regular tests.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Same digest as digestOf of the record (unit test), without the generic
canonicalJson walk: edge keys, and so import protection's edge module ids,
stay identical to the previous ones.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The row failed only through the page harness's stale `?t=` snapshot; it
passes with the harness fix (10/10 whole-file runs under load, 5/5 with
COMPILER_TESTS_PINS=run), so it joins the ordinary rows.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The page harness snapshotted the `?t=` stamps of the app's files before the
page ran and `app(file)` preferred that snapshot. When the previous route's
reference module imported a file the new one imports only from a chunk, Vite
prunes the file while the page loads the new route module and gives it a new
HMR time, which the chunk then imports by: two URLs, two instances of the
file (the module-state rows of pages/known-bugs-code-splitter with
`calls === 0`). The page now asks the dev server for the current URL at
import time (`/__route-app__/stamped`), after the URL it already requested
the module by; the snapshot is gone.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Two generations of 4,096 ids instead of a Map that only grew (ids of
deleted files stayed for the session). A miss costs ~0.3 µs, a hit ~0.03 µs,
so the memo stays; it now holds at most 8,192 ids.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Lazy plan fingerprint (only the Rsbuild session reads it), edge keys as a
digest of the joined fields, process.env read once at module scope,
stringLiteral fast path, numeric clusterReads memo, revision() once per
request, canonicalJson in loops, identity env emission without a map
(every host passes an unchanged env module through), hit validation and
snapshot validation with Promise.all. Tier 0 reads import/export bindings
from Yuku's module records (no node index for Tier-0-only modules); purity
skips the callee reference lookup when no callee is declared pure.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Comments and test names cited design sections, rulings and notes that are not
in the repository; state the reason, point to the compiler README, or cite the
SPEC clause instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Core comments and test names cited design sections, rulings, lanes and review
ids that are not in the repository; state the reason, point to the compiler
README, or cite the SPEC clause instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comments in router-plugin, router-generator, react-start-rsc and the oracle
cited design sections, rulings and notes that are not in the repository; state
the reason instead, or point to the compiler README / SPEC. The oracle docs
describe the Babel/unplugin implementation in the past tense.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TSR_COMPILER_NO_CACHE and TSR_COMPILER_STATS(_BYTES): what they do, what they
cost when unset, and when to reach for them on a user report.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite 5 cannot be installed under the workspace's trust policy, so support for
it cannot be tested; the plugin is smoke-tested on Vite 6, 7 and 8.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- import protection: delete the unused debug/candidate helpers, the unused
constants module (with the TSR_IMPORT_PROTECTION_DEBUG(_FILTER) env reads)
and the unused adapter-config fields
- delete zero-reference exports (emitOutput, CompilerError, planCacheFor,
describeCluster, readStringLiteral, isComponentTagName, jsxText,
RegionTable.isWithin, HYDRATE_QUERY_KEY, PROVIDER_QUERY and the re-exports of
routerRouteId/EDGE_MODULE_PREFIX), and barrel re-exports nobody imports
- one unwrapExpression/isExpressionWrapper in the core instead of six copies
with different wrapper sets
- Start drops its copy of the import-attributes keyword rewrite (the core's
applies to every output)
- one OWNED_QUERY_RE (derived from OWNED_QUERY_KEYS) and one derived-sibling
resolver (resolveDerivedSibling) for both Vite hosts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The `assert` → `with` rewrite searched the text between the specifier and
the attributes for the word, so `/* assert */ assert { … }` rewrote the
comment and kept the keyword browsers reject. Skip whitespace and comments and
look at the first word.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
compiler-test-utils pins yuku 0.23.0 like the product packages; 0.23.0 is
older than the minimumReleaseAge window, so the exclusion is no longer needed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tree re-read check read `parentRoute.children` of the router's route,
which throws for the root route, so every root route edit failed to apply
and fell back to a full reload.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the resolution cache and the emitted-output memo (R54), with
fileSetVersion-gated re-validation of recorded resolutions; router-core
applyRouteHmr tracks every route evaluation; Rsbuild/Vite
route-edit-after-tree-rebuild integration tests. Merged cleanly on top of
the main merge and the DCE merge (no overlapping files).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A function-level initialiser calling a hook (useX, ns.useX) stays as a
statement with its imports whatever they are; a plain call whose imports
nothing else reads is server-only code and leaves with them (the oracle's
'drops vars nested in blocks only the server implementation reads').
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- an identifier option value naming a reassigned module binding stays in the
route module with a not-split:reassigned warning (the route holds the value
it had when it was created)
- an object-form loader passed by reference with options next to handler is
split inside its object (staleReloadMode stays with the route), or stays
with a not-split:loader-object warning when other code reads the object
- Hydrate's server-side orphan pass is the core cleanUp (R56)
- tests: nested server fns in the separate provider env keep what their
chains read; hook calls and their imports survive on the client and under
<ClientOnly> on the server; captures of the enclosing function are compile
errors in client, ssr and rsc (planner level, Vite host, Vite RSC, Rsbuild
RSC layer) and the non-capturing case is hoisted everywhere; isomorphic
and env-only replacements after an unterminated statement; the route
module re-exports an exported let with its setter
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The Vite hosts returned an absolute derived id (`?tsr-split=…`,
`?tss-hydrate=…`) verbatim from `resolveId`, meant for ids the compiler
itself constructed under a project path with a `#`. In dev, a browser's
root-relative URL (`/src/route.tsx?tsr-split=component`) is absolute too,
so it was never resolved to its file and failed to load. Derived ids are
resolved as the importer's sibling, as before; `load` serves them.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- an edit overriding a claimed placeholder counts as reads of the enclosing
region in that output (a nested server fn chain kept in place with its stub
lost every import and const it read in the separate-provider env)
- the renderer guards a statement start whose rendered first token could
continue the previous unterminated statement with a ';' (ASI hazard of
'(() => 1)()' replacements and orphaned initialisers)
- an extracted-export output re-exports every exported symbol of the moved
cluster (an exported let and the function writing it)
- regex literals are not copyable primitives (identity and lastIndex)
- an orphaned function-level call initialiser always stays as a statement
with the import it reads (hook calls never dropped)
- pre-existing dead pure cycles are kept like a dead self-recursive function
- compileModule serves the last overtaken attempt's plan (unpublished, with
a compile-overtaken warning) instead of throwing after 3 attempts, and
discards the dependency ledger when an attempt throws
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The Start Rsbuild host and the router webpack host reset their warning
ledger in every environment compiler's `beforeRun`, so a file's warning
(a route built by a helper call, an option that reads `this`) repeated
once per environment of a build. The client environment's run starts the
ledger, as in the Vite hosts (SPEC J2.19).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The Compiler Platforms workflow ran one integration test per project on
Windows, macOS arm64, Linux arm64 and Alpine. Its unit step now includes
the compiler core (router-utils), and the smoke step runs the production
bundle checks on Vite and Rspack, the project-path rows (`#`, `%`, spaces,
non-ASCII) and the unparsable-module rows on every bundler, and the
non-ASCII route file rows, all without a browser; Start's smoke adds its
project-path and unparsable-module builds on Vite and Rsbuild.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The peer range admits Vite 5 to 8 while the suite runs on 8. A new
private, test-only package, @tanstack/compiler-vite-versions, holds Vite 6
and 7 as aliased packages (vite6, vite7); each ships a `vite` binary, so
they live apart from any package that builds with Vite (installed as
devDependencies of router-plugin they shadowed its `vite` binary, and the
library build ran under Vite 7). The smoke builds a route app with each
version (the component is a lazy chunk and renders) and serves it to a
real page (the component is split; a route option edit hot-updates the
page's router in place). Vite 5's latest release fails the workspace's
no-downgrade trust policy and cannot be installed.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The route HMR runtime re-read the tree on every route update (two tree
processings per edit); now only when the parent's children no longer hold
the router's route, which is what a re-executed tree module leaves behind.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`yuku` is ESM-only and the CommonJS builds of router-utils, router-plugin
and router-generator (and the `tsr` binary) `require()` it: Node loads an
ES module through `require()` without a flag only from 20.19 and 22.12
(23 and later always). `engines` of those packages, and of router-cli,
now say `^20.19.0 || >=22.12.0` instead of `>=20.19`, which admitted
21 and 22.0–22.11, where a `webpack.config.js` requiring the plugin throws
ERR_REQUIRE_ESM. Loading yuku through a dynamic `import()` instead would
make the synchronous parse API asynchronous, so the range is the fix.
The Start and router-plugin changesets open with what changes for an app
that upgrades: every server function id changes, `generateFunctionId`
receives the stable name, production refuses HTTP calls to server
functions no client module imports, unparsable modules fail the client
build, esbuild refuses code splitting, the removed experimental hooks,
the one-time route tree formatting change, and the Node range.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A module Yuku could not parse was returned untouched by every host, on the
assumption that the bundler's own parser rejects it too. SWC and esbuild
accept TypeScript grammar errors Yuku (and tsc) reject, e.g. a definite
assignment assertion with an initializer, so a Start module defining a
server function could ship to the client untransformed.
Start (Vite and Rsbuild): a module that names a Start or Router package
and does not parse fails the client build with an error positioned in the
file; server environments warn once. Modules naming no such package keep
the safe pass-through (CommonJS scripts, J4.16). Router plugin: a route
module that does not parse stays unsplit and is reported once per file per
run, naming the file (J2.8, J2.19). The router Vite host resets its
warning ledger once per build run, not once per environment.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A `#` in the project path (`C#`, `project #2`) was read as a URL fragment
by the compiler's id parsing (`identify()`, the route split planner's
sibling specifier, import protection's path stripping), so every module of
such an app was passed through untouched: no route split, no HMR and, in
Start, no server-function, environment or import-protection transform. A
`#` is now a fragment only after the query.
Rspack and webpack escape a `#` of the path in the loader's `resource`
(`#`, `\0#`); both loaders now unescape it, so the path matches the
route registry and the file system. The Vite hosts load their own derived
ids (`?tsr-split=`, `?tss-hydrate=`, `?tss-serverfn-split`) and resolve
absolute ones verbatim, since Vite's load fallback and file resolution cut
an id at the `#`.
Tests: identity unit test; router builds under `#`, `%`, spaces and
non-ASCII directories on Vite, Rspack and webpack assert the split; a
Start build under a `#` directory asserts the handler is not in the client
bundle and the route is split, on Vite and Rsbuild.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A route option `deleteNodes` erases (Start's client `server` handlers) now
takes with it the destructuring leaves only it read, with the imports their
defaults or computed keys read, as babel-dead-code-elimination did on main.
The route-split planner runs the core's `cleanOrphanedDeclarations` after
its erasures (start-env's run happens before the router planners in Start).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start-env's cleanup of declarations only removed code read moves into the
compiler core (`cleanOrphanedDeclarations`) so that every planner that erases
code can run it. Found by running babel-dead-code-elimination's test suite
through the Start compiler:
- an orphaned object rest element is removed, so a sibling whose default
reads a server-only import can go too (the import no longer reaches the
client);
- a function-level pattern whose every binding is orphaned goes whole
(`const {} = serverConfig` kept the import);
- a removed trailing array element leaves a hole, so the iterator is
stepped as often as in the source;
- an impure initialiser kept for its effects parses when it starts with
`{`, `function` or `class`, and cannot continue the previous line;
- a bail-out no longer cancels the round's progress (the fixpoint could
stop early).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without the resolution cache every plan hit (derived ids included) asked the
bundler's resolver for each recorded resolution again: +7% Vite build, +18%
compile-all, +9% Rsbuild build in interleaved runs. A resolver's answer only
changes when a file appears or disappears, so the caches carry a file-set
version (bumped by invalidate on add/unlink, and per Rsbuild watch
compilation, which gets no event for files nothing imports) and validation
skips the resolutions of a plan validated at the current version. No
resolution is stored anywhere.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
After a route is added or renamed, the regenerated route tree module
re-executes and imports each route module's current export, so the router
can hold a later evaluation of a route than the first one the HMR runtime
recorded; every later edit of that route was ignored (found by the compiler
soak on Rsbuild: a loader edit after an inline server fn cycle never showed).
applyRouteHmr now records every evaluation of a route id, syncs the router
with the tree before choosing the live route, and updates that one.
Regression tests on Start's Rsbuild and Vite dev servers (a loader edit
after a route added and after a route renamed) and a router-core unit test.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Brings in Node 26.12.1, Version Packages (#8745), the TanStack Markdown
rendering guide (#8808) and the Nx 24 upgrade (#8807). Conflicts were
limited to a version bump in the Solid Rspack quickstart example and
pnpm-lock.yaml, which was regenerated with pnpm install.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolutions are recorded per compile in the dependency ledger (one answer
per attempt) and validated through the environment's own resolver; nothing
caches them across compiles, so add/unlink no longer clears anything and the
Rsbuild session's forgetMisses only marks missing files. Emission from a
frozen recipe is not memoised on the plan. The TSR_COMPILER_NO_CACHE knobs
'resolutions' and 'emitted', their counters and stats go with them.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Lane L: compiler cache stats and knobs, caches bounded by the live plans and
files (Vite and Rsbuild), marker-only target fingerprints, soak tooling in
benchmarks/compiler-perf. Its changeset is folded into the consolidated
compiler-core-yuku and start-compiler-yuku changesets.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The inlined probe saved ~1 ms per process start but diverged from exsolve on
edge cases (a srcDirectory that does not exist also looked in its parent,
unreadable candidates were skipped, percent-decoding and queries), so keep
exsolve. Pass cache: false instead: its process-wide cache kept misses, so a
dev server restart did not see an entry file created since. The plugin already
resolves the entries once per instance; a restart pays ~0.3 ms more.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
unplugin already imports @jridgewell/remapping at plugin startup, so loading it
lazily in the loaders saved nothing and only made composeMap async.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tanstack/router-core/tooling exports rootRouteId, the path helpers and the manifest
link helpers. The route generator and the Start plugin import them from it instead
of loading the router runtime through the root entry at startup.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The four entry lookups join the entry to srcDirectory and try the extensions in
order, returning the real path as exsolve did, without exsolve's process-wide cache:
a missing entry created later is found and memory no longer grows across builds.
exsolve stays a devDependency for the test helpers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jiti is only needed for virtual route configs, @jridgewell/remapping only when a
Rspack/webpack loader receives another loader's input map, and lightningcss only
for inline CSS with rewritable urls: none of them loads at plugin startup anymore.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
revision/digestOf (plan freshness, digests, edge keys), the default server function
id and the Hydrate file hash use crypto.hash instead of createHash().update().digest().
Same bytes; available since Node 20.12 (engines: >=20.19).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove the unused logDiff (with ansis and diff) and createIdentifier/decodeIdentifier
exports from router-utils, and router-plugin's redundant chokidar dependency: the
watcher lives in router-generator, which declares it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- router-utils/src/compiler/README.md: the model (one analysis per env and
module, rewrite tree, reachability = splitting = DCE by provenance,
OutputBuilder emit with source maps, summaries and values), the
pipeline phases, plan cache + dependency ledger + invalidate(), hosts,
where each planner lives, adding a planner, tests and perf harnesses
- router-plugin/ARCHITECTURE-CODE-SPLITTING.md: replaces the Babel-era
document with the planners' outputs, rules and route HMR
- AGENTS.md pointers (packages, router-utils, router-plugin,
start-plugin-core) and the Rsbuild architecture links; drops references
to handleRouteUpdate and to deleted INTERNALS.md files
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- esbuild: autoCodeSplitting is refused; the esbuild installation docs
and quickstart examples no longer enable it
- automatic code splitting: callbacks reading this stay unsplit; route
CSS moves with the split components only when all are split
- Start: server functions only server code calls are not HTTP-callable
in production (dev answers and warns); generateFunctionId arguments
and the default ids; onViolation timing in builds; route CSS loading
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the 15 lane changesets with six: compiler core (router-utils),
route generator, router plugin, route HMR runtime (framework routers),
Start, and React Start RSC. Adds what lanes C2/C3a left out: dev-only
/hmr subpaths, production HTTP gating of server-only server fns with
the dev warning, #8688 and #7943.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack's MultiCompiler runs a compiler again when a dependency was
invalidated while it compiled (running-outdated), from nodeDone on the
next tick after its done hooks; the MultiCompiler's done (onAfterBuild)
fires before that. The tracker settled the edit and closed the watcher
in between, so the SSR bundle kept pre-edit code (start-compiler-build-
inputs 'rsbuild build --watch > an edit of an aliased env-only
factory...'). A compiler now counts as compiling until a macrotask after
its afterDone, by which a re-run has announced itself (invalid).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A known package resolves to its own specifier (D4), and dependencyPaths
turned it into a file for the host's addDependency: Rspack watched
'@tanstack/react-start' as a missing path, reported it removed, and
rebuilt every environment once after the first watch-mode build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack reports a deleted file only while a module depends on it, so a module
the app stopped importing and then deleted got no unlink: its plans, raw
facts, import-protection records and per-resource fingerprints stayed for the
session (soak: plans +20, fingerprints +100 per 100 cycles). After each dev
compilation the session retains what the environment's fileDependencies
still contain (RawFactsCache.retain, ImportProtection.retain).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The compile that registers a plan's violations prints them; a compile the
plan cache answered again (an importer Rspack rebuilt for a dependency's
edit) still asks `onViolation`, as every compile does under `always`, but
no longer prints them a second time. The warning ledger keeps its
once-per-run contract (the oracle pins "warns once per file" across dev
rebuilds), so the `watchRun` reset is dropped.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Takes the oracle's deletion of react-start-rsc rsc-start-private.test.ts
(conflicted with our comment update on its pin) and the rsc-start-page.ts
trim; nothing else imports the removed `page` helper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With RSC the provider environment builds before the client (plugin-rsc:
rsc, client, ssr; Rsbuild: interleaved by the RSC coordinator), so its
manifest was generated before the client's references were known and
every registered server function was HTTP-callable in production (J4.2).
The manifest must still list every function: server-origin calls (the
SSR RPC stubs, a handler calling another function) resolve through it. The
gate is therefore by call origin, decided where the client build's
references are known:
- Vite: the caller (ssr) environment builds last; its resolver module is
now a gate over the set of client-referenced ids in front of its own
forward to the provider (served by a second virtual module).
- Rsbuild: the manifest carries a placeholder literal for the set, which
the server asset pass that already fills the Start manifest (after the
client build exists) replaces with the client-referenced ids.
- Rsbuild RSC also never listed a function reached only through a provider
module (the resolver's rebuild is what builds those modules, after the
manifest was generated): the resolver is now regenerated and rebuilt
while its content changes, bounded.
Tests: react-start-rsc `rsc-start-build` and `rsc-start-rsbuild-build` "a
server function only server code calls is not callable from the browser"
(the real request envelope sent to the private function's URL is refused,
to the exposed one answered; the handler's own call of it works).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
In dev, an HTTP call by id may run any server function: dev compiles
lazily, so it cannot know what the client references, and a page left
open across a restart must keep working (J4.4). The refusal of server
fns no client code references applies to production builds only.
SPEC J4.2 and G13 say so; the Vite dev RSC pin that asserted the
refusal (and its now unused page helper) is removed, and KNOWN-BUGS
lists the production pin only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The router calls a method or function-expression callback as a method of
the options object; a split chunk's `lazyFn` wrapper calls the chunk's
export detached, changing its `this`. Such a callback stays in the route
module with a `not-split:this-reference` warning naming the file (J2.8:
informed, never broken); `this` of nested functions and classes, and arrow
functions (the module's `this` wherever they evaluate), split as before.
Also enables route HMR in the frozen-import regression test, where the
development marker is written.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A `require()` edge carried no names, so import protection's mock of a
denied CommonJS or unknown target exported `default` only and
`const { secret } = require('./x.server')` read `undefined` instead of
the safe mock. The analysis records the keys the importer destructures,
the static member reads of the binding holding the result or of the call,
and `'*'` when the result escapes (`[]` for `import()`); the edge records
of both tiers carry them.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- dev `log: 'always'`: a compile the plan cache answered reported its
violations twice and asked `onViolation` again (`afterCompile` already
reports every compile; the extra `reportAgain` is gone).
- `needAdditionalPass` is a bail hook: answering `false` silenced later
taps asking for a pass; the tap now answers `undefined` when it has no
vote.
- the warning ledger resets on `watchRun` too, so a module a dev
compilation rebuilds reports its compiler warnings again.
- modules kept across a compilation report again under their canonical
resource (the RSC proxy query is dropped), the identity their edges
were registered under.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The dev refresh marker (`page.$$tsrRefreshId = …`) was written onto the
export of another module when a split option named an imported binding
(or a member of one): a frozen component threw "object is not
extensible". React Refresh registers a component where it is declared;
the marker is only written on this module's own declarations.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- A recursive component rendering itself inside its own boundary moved
into the chunk with the lazy const only it reads, next to the chunk
component of the same name (a SyntaxError). The lazy const gets a
distinct name when the children reach the unexported declaration
holding the boundary (a bounded walk over module-level declarations).
- The inserted `h`/`p` attributes go right after the last attribute or
the tag name, never inside a comment written before `>`.
- Solid: a capture that a `ref={x}` or a reassignment writes is passed
through a getter-inducing expression (`(() => x)()`), so the chunk reads
its current value instead of the value at render.
- React development with route HMR: the chunk component carries the
`$$tsrRefreshId` marker (R41), as split component chunks do, so an
update of a boundary's chunk is kept by React Refresh, not swapped
(`refreshMarkers` in the planner config, set by both hosts).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
With a derived provider module (Vite RSC `rsc` env), a nested site
(`export default createServerFn()…`, an object property, a class field)
was hoisted into the provider output and the env module imported the
hoisted binding from `?tss-serverfn-split`, so the rsc env evaluated the
provider module (and everything its handlers import) and called the
handler in-process, unlike its top-level siblings. The env module now
keeps the chain in place with its `createSsrRpc(id)` stub (an edit on
exactly the claimed region overrides the placeholder there).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`RegionTable.register` scanned every region to deduplicate a
registration and `buildUnits` searched every top-level item per hoisted
`var` declaration (quadratic in large route modules); a range+kind map
and a binary search over the source-ordered items replace them.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`invalidate()` checked every environment's resolution fingerprints with
the one host it was given (the Start hosts passed whichever environment's
hook ran first), and `resolveCached` stored that environment's answer in
the other environments' resolution caches: a per-environment alias or
condition (`browser` vs `node`, `react-server`) resolved to the wrong file
until the next add/unlink. `invalidate` takes one host or a host per
environment name; the Vite Start host passes each dev environment's own
resolver, the Rsbuild session each environment's registered resolver.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Placement (reach.ts): a cluster the env module roots (an exported `Route`)
that a derived output reaches is imported from the env module, so its live
reads are now evaluated in the env module's tree, not the requesting
output's: the splitter replaces `component: Page` in the env output only,
and a loader chunk importing `Route` no longer "needs" `Page` (which went
to a bogus `shared~component+loader` module: one more request per
navigation). A cluster pinned elsewhere reads in its pin; provider outputs
(self-contained copies) keep their own tree.
The `env-declared` fallback (J2.8 R-27) no longer fires for an exported
pure component the route module also reads: the exported pattern is a
value merged with an exported binding it writes; the value being the
export itself is the §3.5.2 import.
Rendering (plan.ts): when a renamed export drops a multi-declarator
statement's `export` keyword (R38), the other exported declarators of the
statement are re-exported by the same glue (`export const a = 1, page =
…` kept `a` exported).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Two neighbouring function-local declarators orphaned by one erasure
(`const a = 1, b = 2` read only by a removed `createServerOnlyFn` body)
got two overlapping removal ranges and the compile threw "partially
overlaps". The removals of a multi-declarator statement are now computed
per statement from its final kept set, as runs with their separators
(the whole statement with its line when every declarator is gone), so
neighbours never partially overlap and a later round's run encloses the
earlier one. Same for `let a, b` and blocks of the module level.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Rsbuild dev defines TSS_SHELL like Vite's dev server: with SPA mode the
dev server answers the shell instead of rendering routes and running
their loaders (#8543).
- server.compress is only defaulted to false, no longer forced over the
app's config (#8544).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Generator plugins given as router.plugins run next to Start's own (Vite
and Rsbuild), instead of being replaced by them (#7768).
- Start's route tree footer follows router.quoteStyle and
router.semicolons (#8437's footer half).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A createFileRoute('/id') call without the options call, or a constructor
imported as a type only, was reported as not created by createFileRoute.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A route tree event is a tree change only when the file on disk is no longer
the one published; the watcher echo of every publish rebuilt, printed and
notified the plugins for nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A virtual route config naming one file for two routes (two route()
entries, two physical() mounts of a directory, a __virtual.ts entry for a
file the directory scan routes too) is an error naming the file, instead
of a tree importing the file twice or an ENOENT from two concurrent
writes.
- Two routes with one id (posts.tsx + posts/route.tsx with a child) are an
error naming both files, instead of the router's startup invariant.
- AtomicPublisher numbers its temporary files: writes in flight never share
one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- DependentsIndex keeps each plan key's buckets (planKey -> paths): publishing,
discarding and evicting touch the key's rows only (was a scan of every
bucket per publication, quadratic in the session), publication replaces the
previous plan's rows (stale rows accumulated on import-target changes), and
empty buckets are removed.
- PlanCache retires a key's generation and latest revision once it has no
plan and no attempt in flight (begin/end around each attempt); they were
kept for every id ever compiled, deleted files included.
- RawFactsCache forgets a deleted file's facts on unlink and never stores a
missing file's facts (stale entries of deleted files were kept).
- Import protection forgets a deleted importer's edge index rows, violation
keys and scope-cache entry (Vite and Rsbuild hosts, on unlink).
Found by the compiler soak (500 edit cycles with unique file adds, deletes
and renames) and code review findings 1-2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A file whose implied route changed (virtual config route() path, physical()
prefix, __virtual.ts subtree) without a content change was skipped by the
stamp/content fast path and kept its old id. File state now records the
route it was analysed for.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A warm rsbuild dev restart restores importers whose import-protection
violations another session judged: the new session neither asked
onViolation nor reported them. In dev, a restored module whose record holds
violations this session has not registered is rebuilt (once per session)
before the finishMake replay.
compiler-test-utils: RsbuildDevServer.restart() starts a new dev server
(new plugin instances) on the same app directory.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ports upstream #8799's normalization tests: literal query keys, first value,
+/% decoding, lookalike keys, concatenateModules on and off.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A module Rspack restores from its persistent cache is not compiled, so the
edge index that gives trace steps their specifier and position knew nothing
of it: a warm build's violation traces lost those steps' locations. Each
compiled module's Rspack buildInfo record now carries its indexed edges,
replayed at finishMake for a module the index does not know (replayed by
its canonical resource, the compile's id).
Ports upstream #8798's e2e test (cold vs warm Rsbuild build with
performance.buildCache: no errors, identical warnings).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- TSR_COMPILER_STATS=1 registers cache-size readers (WeakRef, process-global)
for the compiler caches, host sessions and the route generator;
TSR_COMPILER_NO_CACHE=plans|facts|targets|resolutions|all disables a cache
(measurement knobs, inert otherwise, never in a bundle).
- Import protection's file/marker rule read a target's whole J6 target facts,
so an importer's plan depended on the target's import list: editing the
imports of a route module re-planned the route tree and Vite fully reloaded
every page. A 'target-marker' fingerprint (PolicyContext/PrefetchContext
targetMarker) records only the marker.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An importer Rspack restores from its persistent cache (performance.buildCache)
in a new process requests edge modules nothing registered: the warm build
failed with "Can't resolve .../edge.<key>.mjs" for every edge module. The
importer's request now carries the module's content (?tss-ip=<base64url>,
checked against the key that digests it); a normalModuleFactory beforeResolve
tap defines unknown edge modules and the runtime from it before they resolve.
The rewrite of every known edge module at thisCompilation is gone.
Tests: Rsbuild cold+warm builds with buildCache in error and mock mode and with
an onViolation veto; Rsbuild dev edits that add a .server import, add or remove
a server-only marker of an unchanged importer's dependency (upstream #8798,
#8801 scenarios).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An edit of an Rsbuild watch build or dev server was taken as applied at the
first end of the compiles that read it. Rspack can still owe a compile then:
a file written after a compile began is reported only by the next watcher,
and an environment that depends on another one runs again after the end is
reported. The edit now also waits, once the watchers are attached, until no
compile started and none is pending.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An import() of a route module the router's async chunk also holds made
Rspack copy it and its imports into the resolver's chunk; a shared cache
group traded the copy for one more chunk loaded at cold start. Rsbuild
bundles every provider module, so the production manifest imports them
statically: 6 chunks loaded like main, gzip below main. The cache group
of the server environments is dropped (superseded).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The /* @__PURE__ */ hint only serves the client's tree shaking; a server
bundle keeps every route. The manifest's unused access parameter keeps
its name (one byte shorter than the lint-style underscore).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
R44 as rewritten: a client-origin call of a server fn whose defining
module the client environment compiled is answered as before; one no
client module references is answered too, with one warning per function
naming it and saying a production build refuses it. The on-demand client
graph walk is gone (it proved nothing and cost a crawl of the app).
Vite's lookup warns through the plugin context; Rsbuild's dev manifest
carries the warning per unreferenced entry. Production stays the strict
manifest filter. The RSC dev pin asserting a refusal stays pinned.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Vite bundled dev without lazy compilation (TanStack Start sets
devMode.lazy: false) compiles an HMR patch's import() to
__rolldown_runtime__.initModule(id), which throws MissingFactoryError
synchronously when the split chunk never loaded on the page. The held lazy
wrapper now re-imports through a wrapper that falls back to the importer it
was created with (the initial bundle's import of the real chunk) for that
error only, matching main's behaviour of reusing the original importer.
Dev-only (inside applyRouteHmr's NODE_ENV gate), client-only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Start loader no longer reports a parse error itself (the compiler
returns the input untouched with its diagnostic), so SWC reports it with
a code frame. SPEC §5.7 leaves the wording and the channel free but the
file and the position must be shown: the overlay snapshot asserts the
file and the error line instead of the loader's message.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Builds decide violations after tree-shaking (SPEC J6.4): compiler-leak's
leakyReference is exported but imported by nobody, so its secret.server
edge is dead in the client build and is not reported. The build variants
of 'compiler leak violation includes line/col' and 'compiler-processed
module has code snippet' now assert that the dead edge is not reported;
the dev variants keep their assertions.
Traces follow the bundler graph from the real entry through framework
package modules (packages/*/dist, node_modules), whose steps may carry no
line (SPEC J6.5 optional fields): the line-number checks skip those steps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new compiler passes the stable key (export/variable name) as
functionName instead of main's generated handler name. SPEC C5/J4.4
leave the value unspecified, but apps keyed on the old
'_createServerFn_handler' names silently fall back to default ids, so
the release notes must say so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
enableRouteTreeFormatting now defaults to false: the e2e builds rewrote
their committed routeTree.gen.ts unformatted (prettier-normalised content
identical), and a pathless layout directly inside a root-level group
gets fullPath '/' (generator J1.13: the types use router-core's
Route.init formulas). Regenerated by the apps' builds, not edited.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
plugin-rsc builds the provider before the client, and the provider's graph
unfolds from its own manifest; the SSR scan deletes handlers with the
imports only they read, so a 'use client' component a handler renders and
the server-fn modules it imports were seen by no environment before the
client build (#7943). The provider's real build now starts by walking the
raw reach of every registered server-fn module (static and the new
TargetFacts.lazyImports) and compiling the candidate modules in the
provider environment, outside any transform, so the manifest lists them.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
R44 in development: a server fn is HTTP-callable once the client
environment compiled its defining module. Vite's dev resolver passes the
caller's origin to the lookup; a client-origin lookup of a module the
client has not compiled walks the client module graph on demand from the
client and router entries (each module transformed by the client
environment, outside any transform of the provider), then the registry
decides. Rsbuild's manifest is gated in development as in a build: its
client compiles whole and its replay rewrites the resolver before the dev
middleware answers.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The esbuild plugin refuses route code splitting with a clear error
(DECISIONS: esbuild generator works, autoCodeSplitting refuses, SPEC
J2.18), so the vue-router esbuild app failed to build. The react and
solid configs are unused by their builds (esbuild CLI) but are updated
alike.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Rsbuild session now tells import protection which paths are app
entries (as the Vite host does), so the planner's own-marker rule reports
a marked entry; the host's separate selfMarked bookkeeping and
selfMarkedReport are gone.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Rsbuild's server default is no chunk splitting, so Rspack copied every
route module the server-fn resolver imports (and their imports) into the
resolver's async chunk next to the router's (+16.6 KB on the full
scenario). The non-RSC server environments now put modules two async
chunks share into one shared chunk; Rspack's default groups stay off.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
applyRouteHmr and the frameworks' __tsrRouteHmr/__tsrRouteChunkHmr were
exported from the production index, so Node loaded hmr.js at server cold
start. They live on @tanstack/router-core/hmr and @tanstack/<fw>-router/hmr
now; only the compiler's dev-only HMR block imports them. Both Vite hosts
pre-bundle the subpath (no source file imports it: discovering it on the
first route module would re-optimize and reload).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The production manifest already lists only client-referenced server
functions (R44), so the per-entry isClientReferenced flag and the
never-throwing origin check only cost bytes in every server entry.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The core's cached resolution asks the host only for specifiers that can
name a project module or a package. A Node builtin or a URL-scheme
specifier (node:, bun:, cloudflare:, data:) resolved only for the analysis
made Vite's client resolver warn "has been externalized for browser
compatibility" about an import a deleted handler read (G16, J4.12).
`virtual:` passes: a bundler's virtual module may be a project module.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Dead-code shapes (a class and a const that read each other) through every
Start removal and the code splitter, the server twin of the class row,
Hydrate's diamond and cycle rows, and the JSX element parentheses pin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A route module that reads a member of a JSX element, `(<Tag />).props`,
is printed as `<Tag />.props`, which does not parse, so the route module
fails to load. Same upstream printer bug as the other S3 pins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests that left it open whether the server keeps neutral modules only
client-only code reads now require the drop, checked by outcome:
- `<ClientOnly>` children: the libraries only the children import throw
when they load, so the server render fails if it loads them.
- An aliased re-export of createClientOnlyFn: the SSR environment does not
load the neutral `./browser` module.
- The dead-code shape table runs the server-side removals over a neutral
module instead of a `*.client.*` file.
- The `<ClientOnly>` build adds a neutral module with a top-level effect:
it is absent from the server bundle.
All pass on main. Comments cite J4.11 instead of the removed §5.12.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
J4.11 now requires the server to drop what only client-only code reads
(`<ClientOnly>` children, `createClientOnlyFn` bodies, isomorphic
`.client()` implementations) for every imported module, not only
`*.client.*` and client-only-marked files: a neutral module or a package
left behind reaches the server just like a client-only file would. The
§5.12 freedom is removed, and G3, G16 and C15 follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The leak check passed edits without the dev server, so a failing edit crashed
while building its error message; name the cycle as well.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One list of shapes (@tanstack/compiler-test-utils/dead-code-shapes): a
chain, a diamond, mutual recursion, a class and a const that read each
other, a helper kept code reads too (through typeof, a shorthand, JSX and
export { a as b }), code already dead before the transform, a let a
function assigns, an object and an array holding the helper, a closure a
factory call returns, a default parameter, a namespace import and a
top-level await. Each shape runs through every removal: server fn
handlers, createServerOnlyFn and isomorphic .server() on the client,
createClientOnlyFn and isomorphic .client() on the server, <Hydrate>
children in the parent, split route options and deleteNodes options in
the route module. Each cell checks that the module loads and gives the
right values in both environments, that the module only the removed code
needed is not loaded, and that kept and already-dead code stay.
Main fails ten cells. New root cause S7: the const of a class and const
cycle is removed and the class kept, so the module throws when it loads
(every Start removal, split option, deleteNodes). New J5 entry: the
parent of a <Hydrate> keeps the shared end of a diamond and both halves
of a cycle, with their import.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Edits sort zero-width first, so an insert at an edit's own start is its
sibling, rendered before it; a slice of the edit's body starting there
rendered it again. The core's import recipe keeps the comment before an
import statement (slice from the item's start): with a leading comment
(`/// <reference types="vite/client" />`) and an import that loses a
name, the after-header units (lazy importers, glue imports) were
printed twice and the route module declared them twice (react-start and
solid-start basic e2e: root routes failed to build).
Tests: router-utils placement 'renders them once when the import
statement the core rewrites starts with a leading comment'; router-plugin
code-splitter-route-options 'are split when the route module starts with
a comment before an import the component shares' (both failed before).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
server.mjs builds the Start scenarios with their server environment and
reports server bytes, the chunks and modules a first request to / loads, and
process spawn → first SSR response on a quiet machine.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The React apps written for Solid (same seeded structure, probes and server
functions), Vite only. React workload hashes are unchanged. Run with
--variants solid-start,solid-router.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack gives a loader in a "type": "module" package type 'module' and
import()s it, so the require cache wrapper never saw Start's compiler loader
(the Rsbuild floor replayed 3 hooks and measured the real build). A load hook
now serves a wrapper module under the loader's URL; the loader request is
unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a server env, locals of one object pattern that only <ClientOnly>
children read are orphaned together; each property's removal took the
separator to its neighbour, so two neighbours gave partially overlapping
edits and the compile threw ('conflict: start-env ... partially
overlaps'): react-start/basic's root route failed to build (Vite and
Rsbuild). The properties a round prunes are now removed per pattern,
one range per run of removed properties.
Test: clientOnlyJSX 'a boundary with locals of one pattern only its
children read renders its fallback on the server...' (failed before).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A browser-only package (it reads window when it loads) that only a
createClientOnlyFn body and an isomorphic .client() read, through a
diamond and a cycle of helpers, never loads on the server: in dev (the
SSR environment) and in Vite and Rsbuild builds, where the server build
must neither bundle it nor warn about its importer, and SSR runs. A new
S2 pin covers the server twin of the class rows: a class only a
client-only fn uses keeps its client-only import on the server today.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The unresolvable-imports build now also fails when the Vite client build
swaps in a browser stub and warns about the importing module (checked by
file and severity), which it did not notice before. It adds a
createServerOnlyFn body and an isomorphic .server() reading node:buffer
through a helper. The server-only routes app gives a page route a server
handler over node:buffer, which deleteNodes removes on the client. The
side-effect hints app adds an unannotated initializer only the handler
reads, which must not reach the client.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Whatever a transform removes takes with it, in that module and before the
bundler, everything only the removed code used, through any shape; it keeps
what kept code reads and what was already dead. Per module only: J4.12 now
says a neutral module's export is the user's, and server-only helpers
belong in *.server.* files. A leftover import of a module the environment
cannot or must not load is not G8 dead code: no stub, no warning, no
polyfill. Cross-references in G8, J4.12 and §5.9.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PROPOSAL (contradicts DECISIONS D6 'derived provider modules only for
Rsbuild RSC and Vite RSC use-client modules'; architect's call).
With the route module itself as the rsc env's provider, the provider
evaluates the module's client-only module-level code under react-server:
a route defining a server fn next to React.createContext(...) failed
with 'createContext is not a function' (react-start/rsc e2e rsc-context,
Vite; main passes, Rsbuild passes since it always derives). The rsc env
now gets the ?tss-serverfn-split provider output (what the server fns
reach), as on Rsbuild.
Test: react-start-rsc rsc-start-build 'a server fn runs in the provider
next to its route module's client-only code' (failed before).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In production Rspack scope-hoists modules: connections from outside a
ConcatenatedModule move to it (their target stays resolvedModule), and
a connection from one names the ConcatenatedModule as origin (the
importing module is getParentModule(dependency)). The trace view read
neither, so mock-mode build traces of split route components stopped
at the route file (react-start/import-protection e2e, rsbuild).
Oracle: reported-location-trace 'the trace of a mock-mode build reaches
a split route component from the entry'.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Effectful clusters homed in the env module for their derived needers
become env roots after homes are decided; what they read in the env
module was homed as if the env module did not need it. A generated
import an env-scoped edit reads (the tsrSsrRpc stub glue of a server fn
that a split component and the Rsbuild RSC provider output need) was
removed as an orphan: the SSR build referenced tsrSsrRpc undeclared
and every page of the react-start/rsc e2e app (rsbuild-ssr) failed.
Such clusters are now homed like any env-needed cluster.
Tests: router-utils placement 'keeps a generated import an env-scoped
edit reads...'; react-start-rsc rsc-start-rsbuild-build (Rsbuild RSC
production build, a server fn only its route's component calls).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With behavior "error" a denied importer fails to build in dev (SPEC J6.3), so
the page throws that denial instead of running the real code: the harness's
client runner rejects on it, for an .mdx page exactly as for a JS importer
(verified). The two rows are plain tests; the custom-type rows stay pinned
(Rspack rules select by resource, not by module type). Also the changeset of
the lane and a typing fix of the resolver-warning unit test.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The route module's code does not change when only a split non-component
option does, so nothing re-ran it: the chunk's export was a React Refresh
boundary (a capitalised binding), its update stopped there and the route kept
its old data. Non-component split bindings are now lowercase (no boundary),
so the update bubbles to the importer, which re-imports the chunk; the chunk's
dev block (webpack style only) then asks the live route to refresh through a
new dev-only helper of the framework routers (__tsrRouteChunkHmr →
router-core applyRouteChunkHmr). Flips the two Rsbuild split-loader cells of
known-bugs-route-hmr; Rspack's default lazy-compilation proxies re-resolve the
module the same way.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The helper fetched a guessed Hydrate child id (?tss-hydrate=0_<hash>);
ids and which module holds the edited component are compiler-internal.
Follow the route module's derived modules from the route instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Playwright read whitelistErrors: [/mock/i, /…/i, /…/i] as a
[value, options] fixture tuple (its second item is an object), so the
whitelist never applied. Main logged nothing in builds; mock-access
diagnostics now log in production too (SPEC J6.3). Whitelist exactly
that diagnostic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SPEC J6.5 requires a code frame in the report; the import-edges planner
located violations but recorded no source text, so reports (and
onViolation's optional snippet) had none. The planner now records the
original lines around the location (the input text, or the input map's
sourcesContent) for each violation. Oracle: reported-location-trace
'the printed report shows the importer's original source at its
location' (Vite and Rsbuild).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
generateFunctionId receives the server fn's stable key as functionName
(DESIGN 3.13.1, SPEC J4.4/C5: greetUser, no longer the generated
greetUser_createServerFn_handler).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the SSR env as the server-fn provider, an SSR caller holds the
provider's extractedFn (createServerRpc with id, name and filename), so
client middleware run during SSR received the full ServerFnMeta while
its type (ClientFnMeta) and the browser give only { id }. Found by the
react-start server-functions e2e ('function middleware receives
serverFnMeta in options'). The client branch folds away.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the SSR environment as the provider, the resolver imports each server fn
module lazily and the server bundle imports the same module statically, so
every production build printed INEFFECTIVE_DYNAMIC_IMPORT for each of them.
The plugin's config composes the app's onwarn and drops that hint for the
resolver only. Flips the Vite row of "in mock mode, an unused denied module
leaves nothing in the client bundle and no warning" (its import-protection
part already passed; the hint was the last report on a channel).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A CommonJS dependency with a top-level `return` is no ES module: the core
reports a parse error and leaves the module as it is, and Vite's own parser
reports real syntax errors at the user's position (as the Rsbuild loader
already did). Flips the Vite row of "a CommonJS dependency with a top-level
return builds and keeps its meaning".
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Target facts counted `import '@tanstack/react-start/server-only'` as a bare
import that evaluates a module and as an own effect, so import protection
judged a marked module effectful whenever the marker specifier did not
resolve to a side-effect-free file (Rsbuild's resolver answers nothing for
it): the mock's effect witness kept the edge alive wherever a barrel
re-exporting the module evaluated, and an unused re-export failed the build.
Flips the Rsbuild barrel row of importProtection/build.test.ts.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
computeStaticDependencyChunks took the union of the chunks of every group a
shared chunk belongs to, so a module duplicated into each route's chunk made
the shared chunk depend on both routes' chunks and each route's page linked
the other route's CSS. The intersection over the groups (with their
ancestors) keeps a per-group dependency out of the shared chunk's imports.
Flips the four shares-module rows of known-bugs-route-css-rsbuild.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A cancelled extracted-export candidate (an exported component nothing extracted
needs) becomes an env root again, but orphans were computed from the env
liveness before that: an import the candidate reads was removed when an erased
range (server-only code) had read it too, so a <Hydrate> after erased server
code lost its Hydrate/idle imports on the client. Flips 3 known-bugs-hydrate
pins; the 5 other rows of the file were fixture problems (load() boundaries
render no id for the helper to find; isomorphic fns rendering different trees
per env are a hydration mismatch by construction) and are plain tests now.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Both Start hosts compile through the Yuku core now, so the interim modules
each lane kept for the other bundler are dead: hydrate-when-transform.ts,
start-compiler/{utils,babel-types}.ts, import-protection/{analysis,rewrite,
sourceLocation,virtualModules,extensionlessAbsoluteIdResolver}.ts and the
import-protection INTERNALS.md that described them; router-utils' Babel
helpers (ast.ts, compiler-helpers.ts) and their root exports, which no
package imports. Dependencies dropped: @babel/code-frame, @babel/core,
@babel/types, source-map, @types/babel__code-frame, @types/babel__core
(start-plugin-core); @babel/generator, @babel/parser, @babel/types,
babel-dead-code-elimination, @types/babel__generator (router-utils); the
unused `@babel/types` catalog entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: planners/edges.ts keeps lane V's own-marker rule for entries
(Vite passes `isEntry`) and lane B's R46 import-rewrite loop; the Hydrate
planner keeps one `extractExports` (lane V's, with the core's region-written
cluster rule in reach.ts instead of lane B's planner-side writer check).
Shared per-bundler pins that both lanes flipped are plain tests now
(hydrate pages/build cases, import protection build-markers, build-mock,
exemptions, known-bugs(-dev), reported-location(-trace)).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
React wraps a match in Suspense when its error component is lazy and Solid's
hydration keys follow the component tree, so an unsplit server (R24) renders
a tree the split client cannot hydrate: React regenerates the page and the
nested route never renders (perf app /s00 layout, HMR hydrate probe). Main
split both environments; the Start host does again.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A run of deleted properties that is the whole options object took no comma
(the last property takes its leading one, the first has none), so a server
route compiled in the client env became createFileRoute(...)({ , }): a parse
error in dev. The run now takes the trailing comma, as does a sole property
range for handler deletion.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The chunk component keeps its TsrHydrate<n> name but is exported as H<n>
(the parent's lazy wrapper reads 'H<n>'): the export name is production
bytes twice per boundary, and main used H<n>. The boundary id's prefix is
the boundary's ordinal in the pristine source, as on main, not the opening's
offset. A Solid chunk component takes its props parameter only when the
chunk reads it. The two deferred-hydration bundle scenarios were 10 to 12
gzip bytes over main; they are byte-identical now.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Keep the Vite route CSS flips (shows-component, shows-error,
shows-not-found pass) in the oracle's new routeCssSuite form.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route CSS rows (SPEC J2.22) now live in route-css-cases.ts and run
for each bundler from its own file: known-bugs-route-css.test.ts on Vite
dev and build, known-bugs-route-css-rsbuild.test.ts on the Rsbuild dev
server and an Rsbuild production build served as `rsbuild preview` does
(new StartBuild.preview() of the build harness).
New rows: two routes whose components import their own CSS and share a
module. On a route, the other route's styles must not apply, after a
client-side navigation and in the page the server renders there. Vite
passes; on Rsbuild, with the shared module in a chunk of its own, the
page links the other route's stylesheet (Start's Rsbuild manifest, #8780),
pinned as a separate known bug.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The exported writer of module state (export function bump() { clicks++ })
may leave for its extracted output with the state when only a chunk reads
it (an exported function over module state loads with its chunk). Only a
binding some sub-region writes (Hydrate children, a split option value) keeps
its cluster out of the candidates, so the single-writer rule still refuses a
chunk assigning an import. The Hydrate unit test that pinned the live
binding's home is adjusted (the extracted output, not the parent).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Vite's dependency optimizer resolves a bare import to its bundle before the
bundle is written, so target facts read through that path saw a missing
module and the edge module's mock lost the target's export names (a dev
page loading a mock without the names it re-exports, timing-dependent). The
host maps an optimizer id back to the dependency's source entry through the
optimizer metadata: deterministic facts, stable resolution fingerprints.
Pins flipped (normal mode: every pin ran as an ordinary test and passed):
hydrate pages and module-level pins (48), Solid and React page suites (6,
Rsbuild rows stay pinned), import protection build/dev/exemption/trace/
location/alias/policy pins (64), dev-server pins (2). Rsbuild rows keep
their .fails (the Rsbuild path is still on the previous compiler).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Solid's hydration keys follow the component tree: the client renders a
split route component under the lazy wrapper's Lazy and Dynamic components,
so Start's Solid server env splits like the client (what main did for every
framework); React and Vue keep R24. Every split route hydrated with a
mismatch before (hydrate-dev-solid).
Vite answers an empty sourcemap chain with an identity map over the input,
counted by LF only; the host passes no input map when the map's single
source content is the input text, so a lone CR is a line terminator again
(reported-location, R-11 probe), and the Locator counts a real map's
generated lines by LF.
A server-only-marked client entry compiled in the client is its own marker
violation (located at the marker; the mock keeps the effect witness although
the marker module is empty, so the build verdict sees whether the entry
survived). Only entries: a marked module is otherwise judged through its
importers, so an exempt importer gets it (J6.7). The session takes isEntry.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The client build capture of the manifest plugin skips a generateBundle whose
bundle import protection emptied (a non-final pass of the veto rebuild). Two
hydrate-build cases the Yuku Hydrate planner fixes stay pinned for Rsbuild,
still on the previous compiler.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A unit-level write (export function bump() { clicks++ }) unions the writer
with the written let into one declaration cluster, which passed the
extracted-export candidate check: state moved to ?tsr-split=export~bump, and
a Hydrate children region also writing the binding escaped the single-writer
rule (no hydrate-module-write, a chunk assigning an import). A cluster that
declares a module-level symbol with a live write is no candidate.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A production entry is a ConcatenatedModule without a resource of its own,
so the trace of a violation never recognised it as the entry when a module
imported the entry back. The pinned test is a plain test; its entry calls
its own start so the chain stays live on Rspack, which drops an entry's
unused exports.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The registry property name moves to its own module so that Rspack is the
first to load compiler-loader.js. Tooling that wraps loaders as they load
(the compiler-perf floor) could not see a file the plugin had already
imported.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A trace built from a loader read the module graph during make, which
Rspack aborts on; the import-protection graph view is set at finishModules.
The raw-facts cache no longer publishes a read in flight when the file is
marked stale meanwhile. The Rsbuild compile tracker of the test harness
counts the runs of dependent compilers (MultiCompiler dependencies) and
waits for them, so a watch edit's outcome includes the server compile.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The core copies what a provider output's roots reach instead of importing
the SSR stub from the env module (DESIGN §3.10.5, J4.14); Rspack's RSC
proxy query is no part of the source identity; the RSC layer does not split
routes; the manifest virtual path is read after the root is resolved. Flips
the Rsbuild RSC pins (CSS of helper modules, the diagnostics, the resolved
root) and the Vite 'use client' provider pin.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Edge modules keep the JavaScript module type under import attributes; the
dev reporter uses the current compilation's graph and no timers; failed
resolutions and missing-file facts are forgotten at watchRun (Rspack
reports no event for a recreated file nothing depended on); dependency
reads bypass Rspack's cached input file system; log 'always' reports again
on cache-hit compiles and kept modules; a marked entry reports itself;
server environments split routes too (Solid hydration keys); the Hydrate
planner extracts exported pure declarations only chunks need (DESIGN
§3.5.3) so they load lazily on Rspack.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Start's Vite compiler plugin now runs every planner in the core's fixed
order - start-env, hydrate, rsc-css, route-split, route-hmr, import-edges -
in one compileModule per (environment, module), serving the derived
?tsr-split= and ?tss-hydrate= ids from the same plan (R11), with the router
planners configured as Start wired them (client: split + HMR with deleteNodes
ssr/server/headers; servers: deleteNodes only, R24; never in a separate
provider env). The import-protection host side follows the lane E contract:
edge module resolveId/load, dev graph + reporter per env (flushed after each
compile), build witness in generateBundle with the fixed-point veto rebuild
wrapped around every builder.build of a Start environment (also when
plugin-rsc drives the builds), a post-order late pass for non-JS importers
(R48), and tsconfig verbatimModuleSyntax read for J6.2.
Deleted: the interim Babel Hydrate post-pass (vite/hydrate-interim.ts, the
chunk load plugin), today's Vite import-protection plugin
(vite/import-protection-plugin/*), vite/module-id.ts, the separate router
transform instances of Start's router plugin, and the constants only they
used. hydrate-when-transform.ts and import-protection/* stay for the Rsbuild
path (lane B).
The Hydrate planner extracts exported pure declarations only a chunk needs
into extracted-export outputs (3.5.3), as the Babel transform did for
"an export only the children use loads lazily".
Pins flipped: start-compiler-jsx-pragma (2), hydrate-build (2). Test
adjusted: reported-location-trace "imports the entry back" keeps the client
entry's code alive (SPEC J6.4: dead edges are not reported).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The Start Vite host runs the router planners inside its own compile, so it
needs what the standalone host had privately: a registry view by real path
(RouteRegistryView, now exported from /planners with routeEntryDigest) and
the registry change listeners (onRoutesChanged, changedRoutePaths, exported
from /context).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
One compile per (environment, layer, module) through a pre loader per Start
environment: start-env, hydrate, rsc-css (RSC layer), route-split/route-hmr
(client) and import-edges planners; buildInfo persistence and finishMake
replay of server-fn facts and import-protection records; witness verdicts
with needAdditionalPass; generator as a precondition of every compiler;
client route tree pruning; virtual modules under the resolved root. The
Babel Start compiler and the old Rsbuild import protection are removed.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- imported route options never ship server handlers silently (refused; Vite, Rsbuild)
- boundaries in split route options another option reads (Vite, Rsbuild)
- route CSS loads with the chunk of a split component (3 rows x dev/build;
the pending/no-component rows stay pinned)
- Rsbuild client source maps of split route components (2 rows)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A route factory called without options (`createRootRoute()`) has nothing
to remove: it failed every Start client build as "not an object literal".
A spread of a module object literal of static keys nothing else reads, or a
computed key naming a module string const, provably holds none of
`deleteNodes`: no error (start-plugin-core server-only-routes builds).
Other spreads and computed keys still refuse the build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`tanStackRouterCodeSplitter` and `TanStackRouterCodeSplitter{Rspack,Webpack}`
split whatever `autoCodeSplitting` says, as the Babel splitter plugin did
(`autoCodeSplitting` selects the splitter in the composed plugin; Start's
schema omits it and wires the splitter alone): Start's client builds kept
every route component eager.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Hydrate: the core now reads a Solid `use:x` directive as a value ref
(router lane, R39 by the core), so the planner's own module-binding
directive rewrite is gone; a captured local a directive names stays a
local (`const x = props.x`, no substitution into the attribute name,
which rendered `use:props.x`).
- Env: a `var` hoisted out of a nested block is now declared by the
effect unit holding it; the orphan cleanup still removes its declarator
when the planner erased every reference (J4.12), as before.
- Hydrate test: a component only the chunk reads moves with its own
property writes (R29 (b), now implemented as designed by the router
lane) instead of being imported from the parent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The router host answered every core-derived id of a non-route file with
`export {}` (J2.13), including Start's `?tss-hydrate=` chunks, which
Start's compile produces in its own pass before the router's transform:
the Hydrate chunk was emptied (start-compiler-jsx-pragma "a Hydrate chunk
keeps the file-level @jsxImportSource pragma"). The router now only
transforms plain ids and its own `?tsr-split=` outputs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts in router-utils core: plan.ts includedUnitsOf keeps Lane S's
rule (inline type specifiers of a statement with no included value
specifier are dropped, and the export { T } naming them) together with
Lane R's route-module rules (inline type specifiers and export { T } of a
type-only binding excluded everywhere, ambient value declarations copied
into derived outputs); reach.ts duplicate inclusion keeps Lane D's version
(copy where rooted, then follow readers), a superset of Lane R's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The exported-import row keeps its `$name` form (pinned on rspack, webpack and
rsbuild without a `sideEffects` field), the two-options row its template
name, so the oracle comparison sees no renames. The "type alias that reads
it" state row passes alone and in pins mode but fails in some whole-file
orders (two instances of `state.ts` in the page): kept as a pin with the
diagnosis next to it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`export { Page as component }` instead of `const TsrSplitComponent = Page`
and an aliased export: the alias cost 8 raw bytes per split route in every
production bundle against main (Rolldown keeps `var r=n`). The chunk's own
declaration remains for inline values, methods and `handlers.handler`.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Removes `.fails` from every integration pin the splitter now passes
(property writes, destructured call results, symlinked route files, object
loaders by reference, type-only re-exports, pragma leadingness, source maps,
app paths, exported bindings, server-only options through spreads and calls).
Still pinned: the Rsbuild split-loader HMR edit; an exported component another
route's chunk imports, on rspack/webpack/rsbuild without a `sideEffects`
field; the type-alias state row, which depends on this file's order.
Adjusted: the exported-let SSR row's entry re-exports `count` (the script read
it from the entry, which never exported it); partially passing tables are
split into a passing and a pinned table.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Identifier option values are symbol roots of their chunk; the core's
`env-declared` and `shared-writer` fallbacks (reported at the declaration
of the binding) keep the option in place with a `not-split` warning.
- With `deleteNodes`, opaque, spread or computed route options are an error
naming the file (never shipped silently; J2.8/J2.14). Errors bypass the
once-per-file warning ledger.
- `loader: handlers` naming a module const `{ handler }` splits like the
inline object form (the chunk exports the handler).
- The session resolves a registry miss through the real paths of the
registry's files (symlinked route files, DESIGN §3.5.1).
- The Vite and Rspack/webpack hosts warn once per (route file, export) when an
extracted-export output lands in an initial chunk (an entry module imports
it through the route file): the page code is eager whatever the splitter did.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- A cluster of pure declarations and the top-level augmentations of its own
bindings (`function Page(){}` + `Page.displayName = …`) is a declaration
cluster the R29 loop decides (movable with its chunk, else an effect root);
an effectful initialiser among the augmentations (A7) stays an effect root.
`isMovable` (b) rejects external mutation only, as DESIGN §3.4.2 and
DECISIONS R29 word it.
- R7 is position-aware for relocated reads: a claimed option value read after
every mutation of a cluster is no ordered-effect fallback.
- `RootRef { t: 'sym' }`: a derived output rooted in a module binding; when the
binding stays in the env module by its effects (a call result, a
destructuring) or with an exported binding it writes, the placement reports
`env-declared` at its declaration (J2.8 R-27).
- `export { X }` of a binding without a runtime value is a type unit, dropped
with the inline type specifier it names in route modules.
- A derived output never opens with a pragma comment the source wrote after
its first statement: `export {}` keeps it non-leading (J2.16, Oxc).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The in-place provider's dev self-accept glue uses import.meta.hot, which
Vite's SSR transform turns into __vite_ssr_import_meta__: Vite's name,
present in any module using import.meta whatever compiles it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The RSC provider environment builds before the client (plugin-rsc's
buildApp), so its production manifest cannot know which server functions
the client references: the origin check is emitted only for the SSR
provider, whose client builds first (R44). Rsbuild rows keep their pins.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- `unlink` events no longer hard-invalidate the dependents of the deleted
file at once: Vite propagates the deleted module's update to its importers
and a dependent transformed while the file is missing fails in
`vite:import-analysis`, which marks it not self-accepting, so its later
updates go through its importers (a route module whose split component is
never re-imported). They re-transform when a file appears (`add`), with
the R47 dependents of that event.
- Full integration tier green on the compiler host (1392 passed, 0 real
failures); the pins that now pass are plain tests: import-protection dev
rows (edit, warm-up, served-while-transforming, error-mode lookups, alias
report after Start), Start dev-server rows (factory edits through
re-exports, fresh-server lookups, pre-bundled top-level calls), Vite build
rows (call shapes, env separation, user code, export cache, determinism,
compose route module once, library server fns, class and type-only
imports, Vue SFC type assertions, RSC warnings). Rsbuild rows keep their
pins (previous compiler).
- Changeset and lane notes (16–19).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Import protection relied on the previous compiler's side effects: its
resolves of a module's imports recorded graph edges before the transform,
and its hotUpdate re-transformed every Vite importer of a changed module.
The host does neither (recognition-time resolves are marked and ignored,
dependents only). `ImportGraph.invalidate` now keeps a changed module's
incoming edges (its importers are not transformed again) and unreachable
pending violations stay pending until an importer records the edge (the
bundled-dev rule, for every dev mode). Flips the pinned "added by an edit"
/ warm-up / served-while-transforming rows.
- The compiler always emits a map in build mode: downstream positions go
through the combined map whatever `build.sourcemap` says.
- The dev self-accept glue starts with a newline (sources without a trailing
newline).
- The `invalidate()` resolves carry the compiler-resolve marker too.
- Lint fixes; smoke tests follow the export-named wrapper.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Every exported pure, unwritten declaration of a route module may leave for
an extracted-export output (one instance for importers, lazy when nothing
imports it); the 'exported' not-split warning is gone.
- Consecutive deleted properties form one erasure (their comma ranges
overlapped and failed the compile under Start's deleteNodes).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- PlanContext.extract(sym, output): an exported, pure, unwritten declaration
a planner allows out moves to a side-effect-free derived output when only
derived outputs need it and none of its eager reads is env-live; the env
module re-exports it under every public name; export companions
(specifiers, export default x) fold into that glue; chunks' reach stops at
extracted clusters.
- A declaration orphaned by an identifier replacement is still evaluated
for moving with the chunk that needs it; a pure unexported declaration
nobody needs is dropped when it would keep a chunk dependency eager.
- Inline type specifiers of a route module are dropped from the env output
(verbatimModuleSyntax would keep the bare import); ambient value
declarations are copied into derived outputs so TS transforms resolve them
the same way (Oxc inlines declare enum members).
- vars hoisted from nested blocks belong to the statement that holds them;
import assertions print as attributes; a React binding counts as the
implicit JSX factory when no pragma decides the runtime; Solid use:
directives read their function.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Pins now passing (.fails removed): esbuild refusal (2), rspack and webpack
production builds without splitting (6), route HMR in real pages: inline
component shapes, lowercase and renamed components, removed split options,
routes exported under another name, Solid and Vue split identity, .ts route
modules, apps without plugin-react, Rsbuild without React Refresh (33).
Adds the changeset for the router-plugin rewrite.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Lowercase local components are renamed whether split or not, so React
Refresh registers them in the chunk; identifier option values are replaced
by an env-only edit and read as a symbol from the chunk (no claim: the HMR
rename's ref edit would override the placeholder).
- Casts and parentheses around hoisted and chunk component values are dropped
so Refresh registers a bare function; the chunk refresh marker names the
registered binding, so a rename is a new family.
- Routes not created by a factory call bound to the Route export (helpers,
IIFEs) and second factory calls are reported once naming the file, from
the split planner or, with autoCodeSplitting off, from the HMR planner.
- Warnings are once per (file, reason, wording) per run and are not repeated
by an edit that leaves the finding as it is.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- renameRefs(sym, to, scope, by, except?) leaves references inside the given
ranges to their owner (the splitter replaces identifier option values with
its own edit and reads the symbol from the chunk).
- A cluster orphaned by an env erasure is removed only when no derived output
needs it; a chunk whose roots reach it gets it by the home table.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Core: concurrent export resolutions keep separate active stacks (a two-star
barrel is no cycle), inline type-only imports with no live value specifier
leave with their type re-exports, header pragmas may follow the directive
prologue, export default expressions are summarised. Planner: identity
helpers (wrap(x)) are climbed through, nested server fns are refused at the
capture in every env, unsupported computed members are left to the runtime
and reported where they may leak, import-alias cycles settle, orphaned
destructuring elements and server-only local declarators are pruned, assert
import attributes become with. Remove .fails from the 130 known-bug pins
the new compiler passes (COMPILER_TESTS_PINS=run confirmed).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
R47: a failed resolution has no path for the dependents index, so a plan
that could not resolve a specifier was never invalidated when the target
appeared (J6.13 delete/recreate). The ledger now indexes unresolved
resolution fingerprints under a reserved bucket of each env's dependents
index (same publish/discard/eviction lifecycle), and `invalidate()` re-resolves
that bucket on `add`/`unlink` events and returns plans whose resolution changed.
R48: `CompileInput.lang` gives the language of code the bundler hands us for
an id that is not JS/TS (`.vue`, `.mdx`, custom types); such ids run Tier 0
planners only (the late J6-only pass).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One pre plugin per Start env compiling every id through compileModule,
invalidation through the core's one operation on hotUpdate/watchChange,
a shared server-fn registry, dev lookup by id through a per-id virtual
module (compiling the defining module on a fresh server), the production
resolver from the client registry (HTTP-callable set, R44), custom-id
patching at renderChunk, library discovery from the Vite root. RSC
integrations pass rsc: { loadCssExpression, providerDirective }; the
Babel-typed compilerTransforms/StartCompilerPlugin options and
react-start-rsc's rscCssTransform export are removed (the Rsbuild host
keeps the previous compiler internally for now). The router splitter
and the Babel Hydrate transform keep running on this plugin's output in
the interim.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The recognizer table by specifier, phase A value prefetch through
summaries (re-exports, namespaces, aliases, user factories, stored and
callable builders, cycles), candidate chains climbed from Start-valued
bindings, the start-env planner (client stubs with createClientRpc, SSR
stubs, in-place provider handlers with a generated createServerRpc
export, validator and middleware link stripping, isomorphic and env-only
rewrites, ClientOnly children on server envs, nested server fns hoisted
or refused at the capture, orphaned local declarators and destructuring
elements), the rsc-css planner, server-fn ids (short default id, dev id,
custom-id placeholders and the global occupied-id allocator), the
registry and the resolver module generators.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Calls and members of unresolved imports stay symbolic terms a consumer
reduces once it knows the imports (applyMember/applyCall exported,
stampSites for adopted link sites). Known package specifiers of the
recognizer table never resolve: RawFactsCache answers synthetic summaries
and resolveCached returns the specifier (D4). A planner's prefetch may
return false to withdraw while its recorded dependencies keep the plan
cached, PrefetchContext gains resolveFrom, walk and the Yuku node types
are re-exported, and an import whose value specifiers were all orphaned
drops its type-only specifiers.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Pins now passing (.fails removed): imported route options split or
reported (2), JSX tags starting with _, $ or a non-ASCII letter (3),
pragma leadingness and the classic factory in the route module (3), exported
class / aliased / overloaded components (3), a user binding named Map (1),
route HMR generated code (10: options in a variable, a binding named hot,
lowercase function components, destructured and call-created bindings, an
export list).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Replaces the Babel code splitter, the stringified HMR handlers and the
unplugin transform wiring with planners on @tanstack/router-utils/compiler
and native hosts:
- planners/route.ts recognises the route by the factory's import binding
(aliases, type arguments, namespace members, TS wrappers) bound to the
binding exported as Route, resolves options inline or from a module-level
constant, reads codeSplitGroupings from a literal or a constant.
- planners/split.ts (route-split): one derived output per group, chunk units
declaring the exports from claimed option values (init, method, shorthand,
object-form loader handlers), lazyRouteComponent/lazyFn placeholders with
one importer per group, deleteNodes as env-only erasures, not-split
fallbacks with one warning per file and reason, route CSS moved into the
component chunks when every component option is split (R42), React
refresh markers in dev chunks.
- planners/hmr.ts (route-hmr): hoists/renames unsplit React component
options into registrable bindings before the options, then appends the
dev block with the literal import.meta.hot.accept( (or webpackHot),
__tsrRouteHmr(routeId, Route, meta) and the refresh anchor on Vite.
- hosts/vite.ts: native plugin with hook filters, derived ids compiled in
transform, owned-query resolveId, watchChange invalidation, warnings
through this.warn once per file per run, mode from the bundler command.
- hosts/webpack.ts + loader/index.cjs: our own loader for Rspack and webpack
(input maps composed with @jridgewell/remapping, absolute map sources,
this.sourceMap switch), route-file rule, sideEffects:false rule for
extracted-export ids, watchRun invalidation.
- esbuild: autoCodeSplitting refuses with an error; the generator works.
- @tanstack/router-plugin/planners exports the planners for Start's host.
- codeSplittingOptions.compilerPlugins is removed; @babel/* dependencies
dropped (Babel core stays a test devDependency).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Copyable clusters (import specifiers, primitive consts) homed 'duplicate'
are placed only where an included cluster reads them, not in every output
that reaches them through a cluster homed elsewhere (a chunk importing
Route no longer copies the loader's imports, J2.5).
- renameRefs records the rename: glue imports/exports and SymRef rendering
print the new name; only the renamed symbol's own declaration name of a
destructuring is rewritten, as 'key: NewName' for shorthand patterns; an
overloaded exported function gets one export specifier.
- End-anchored generated text starts on its own line when the source does
not end with a line terminator.
- License comments between items belong to no item: they stay in the env
module when the item below them moves or is removed (G12).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The J6 spike's case matrix (C1–C9, S1–S2) through minimal hosts that follow the
integration contract: reported iff the edge survives tree-shaking, onViolation
once per surviving edge, a veto gives the real module after one more pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Through compileModule and an in-memory host, client and server, React and
Solid: recognition by binding and look-alikes, ids and prefix symmetry,
chunk shapes (fragments, text, expression and children-prop children),
captures (shadowing, tags, enums, this/arguments, key/ref/children),
nested boundaries forwarding captures through substitution, Solid
callee/shorthand/ref setter/use: directives, module-level placement,
rejections, fallback stripping with its orphans, ancestor erasure with a
toy env planner, composition with a toy route splitter, source maps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The prefix (and p) attributes go right after the last attribute instead of
after the whitespace before `/>`; an enclosing boundary skips every nested
boundary the client extracts when it validates, also one that failed its
own validation; lazy consts and prefixes are emitted in source order.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The import-edges planner (phase C policy over every output's surviving edges),
the resolved config and rules, per-edge mock/allowed edge modules and the
mockAccess runtime, original positions through input maps, traces over the
bundler graph, the dev report queue, build verdicts with the fixed-point veto,
the Vite/Rolldown and Rspack survival witness readers, and the session facade
hosts call. Host-agnostic; not wired into the Start hosts yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The J6 effect classification follows evaluated imports itself (R36), so it needs
the effects of a module's own statements without its imports and re-exports.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Recognises boundaries by the Hydrate binding of a Start package (named,
renamed or a namespace member), gives each one the id of its pristine
offset and path hash and inserts it as the `h` prefix in every env (R10),
strips a statically visible fallback on the server (with the locals only it
read), and on the client claims the children for a fixed-home chunk unit of
`?tss-hydrate=<id>` with captures computed innermost first (R39): React
destructures them (key/ref/children renamed), Solid reads them through a
substitution environment (callee, shorthand, nested placeholders, ref
setters, use: directives). A /* @__PURE__ */ lazy const placed by needers
loads the chunk. Rejections (J5.5) are positioned at the boundary.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A copyable cluster (an import specifier, a primitive const) was copied into
every output that reached it, also through a cluster that output imports
from its home: a Hydrate chunk importing `Route` from the route module
copied `createFileRoute` and `Hydrate` imports it never reads (dead code,
and an import edge J6 would judge). A copy now goes where it is rooted and
follows the outputs whose included clusters read it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A region that assigns or updates a module binding (`x = 1`, `++x`) needs
the binding in its output: placement counted reads only, so the env module
rooted a binding only a split group or Hydrate chunk writes, and the
single-writer rule then refused the split. Symbols generated text reads
(a Solid `use:x` directive, which the semantic model does not see) no
longer pin a zero-value-ref import to a non-route env module, so a
child-only import moves into the chunk (R9).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- edge names: specifiers used as values (incl. export { x }), namespace member reads ('*' when opaque), in both tiers
- TargetFacts: evaluated imports, star re-exports, module format (digest covers them)
- PolicyContext: input text and lazily read input map (original positions)
- substituted specifiers go through the shared string-literal escaper
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merges t3/implement-route-hmr-runtime (router-core, react-router,
solid-router and vue-router HMR runtime). No conflicts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merges t3/yuku-route-generator-rewrite. pnpm-lock.yaml auto-merged and
passes a frozen install.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Engine-level coverage of the rewrite tree, reference rewrite contexts,
claims/substitution, statement-level cuts, clusters/provenance (A1, A6, A7,
R29/R31 N3), name allocation, and the DESIGN §6.1 core gates (a) direct,
(b) derived-first, (c) async denied edge, (d) overlapping save, (e)
consumer invalidation, (f) in-flight dependency edit, (g) foreign-query
identity, (k) ancestor erasure, (l) retained heap over the package corpus,
(m) map positions with a raw U+2028 and a lone-CR file. Planners are toys
living in the test helpers.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The shared core of the compiler rewrite (DESIGN §1.2/§2), alongside the
Babel helpers other packages still use:
- identity: canonical ids with foreign queries, deriveId over owned keys,
sibling glue specifiers, revisions/digests
- Tier 0/Tier 1 analysis over one Yuku parse: import/export tables and
evaluation edges, header/pragmas, purity and own effects, items, units,
regions, one symbol id space, classified references
- rewrite tree: edits with nested retained slices, structured text with
SymRefs, spec fragments, context-aware ref rewrites, claims with anchors,
auto/fixed homes, ancestor erasure, substitution environments, per-output
conflict checks, statement-level recipes
- placement: clusters from live writes, single-writer rule, provenance-based
orphans, R29/R31 movable effects, ordered evaluation, needers/homes for
{R, G_i, H_j} with lazy shared modules, glue imports/exports
- AnalysisPlan.freeze() -> plain EmitPlan, recipe renderer on the own
OutputBuilder (ECMAScript lines, word/punctuator segments, map:false)
- summaries with the export-facts digest, abstract values with the callable
builder transition, batch-memoised export resolver, RawFacts
- PlanCache with validated hits, DependencyLedger with in-flight
registration and snapshot validation, invalidate(), compileModule phases
A-D with the restart loop and the planner contract
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Pins yuku 0.23.0 exactly (D14), adds vitest and @jridgewell/trace-mapping as
dev dependencies for the core tests, declares the ./compiler entry and lets
the package build both entries.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The Rsbuild dev server now sees route files created under physical()
mounts and created before they parse: their scenario rows run like Vite's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a rescan, files whose modification time and size did not change are
not read again; the route tree is not read back when it is as published;
string literals without characters to escape are built directly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack and webpack watch the route roots (routes directory, physical()
mounts, the virtual route config and the route tree) with the generator's
own watcher for every event, instead of watching created files only. Vite
keeps its watcher and also watches the route roots outside its root. The
CLI uses the same watcher.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The client route tree (without server-only routes) is printed from the
generator's tree model and served for the exact route tree module: by
Vite's load hook (an escaped, anchored id filter instead of an unescaped
RegExp of the path) and by an Rsbuild transform of the client
environment, which had no pruning. Routes whose recorded options may hold
an unread key are never pruned.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Solid's JSX compiler wraps a ternary prop in a memo, which kept the dev
branch in production bundles; Vue's render function gained a local. Branch
before the JSX and move Vue's hot swap into a client-only watcher, so
production client bundles are byte-identical again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- route files are read by a Yuku-based analyser: the Route export through
the export table, its constructor by binding (aliases, namespace imports;
the app's own constructors are left alone), option keys with an unknown
flag, edits as offset splices, imports inserted after pragmas
- the tree is a pure model rebuilt every generation from the scan and
per-file facts; ids, full paths and `to` use router-core's formulas, and
the runtime tree and its types are printed from it
- a direct printer emits quoteStyle/semicolons; Prettier is only loaded
when enableRouteTreeFormatting is true (now false by default)
- one drain loop handles queued events; content-based change detection,
the tree compared with the disk, an unchanged-facts fast path
- atomic writes with an EXDEV fallback beside the destination; a bad
bracket escape throws instead of exiting the process
- deterministic scans, `.lazy.vue` as a component piece, pieces of
directory routes, unique route variables, escaped literals
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lazyRouteComponent keeps one client-only shallowRef per wrapper, shared by
all of its instances, so a hot swap re-renders every instance with the new
component. A held component is kept only when the loaded export has the same
plugin-vue-jsx __hmrId; function components are always swapped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lazyRouteComponent keeps a client-only signal read by its Dynamic, so a hot
swap renders in place without recreating the wrapper. MatchInner re-keys in
dev when route HMR replaced the live route's component. Split components are
kept only when the re-imported export is the same object; unsplit
solid-refresh proxies of the same binding are kept for solid-refresh to
patch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
applyRouteHmr updates the live route of window.__TSR_ROUTER__ from a new
evaluation of a route module, keeping lazy wrappers and asking each
framework adapter whether a held component is kept. React's __tsrRouteHmr
registers plugin-react's ignored exports, probes the Vite and webpack/Rspack
refresh runtimes, compares $$tsrRefreshId markers and kicks enqueueUpdate
after a keep. lazyRouteComponent gains a client-only __tsrHot slot whose
newest import is the only completion that counts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pre-run sample missed contention that slowed one series by ~10%. Each run
now records the cores other processes used while it ran (system busy time
minus the harness's process tree) and is flagged above --max-busy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generates deterministic large Start and Router apps, measures dev startup
(listen, first hydrated page, compile-everything), HMR save-to-DOM per edit
kind, and production builds (Vite, Rsbuild), with CPU-profile and plugin-hook
attribution and a compare command.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the strict-runner adapter (makeRunnerStrict) and its contract test.
With it switched off, every test of the oracle (router-generator,
router-plugin, start-plugin-core, react-start-rsc test:unit and
test:integration) kept its state, pins included.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README gives one command for the whole oracle and its time, says the
budgets only report unless COMPILER_TEST_BUDGETS=strict, describes the
COMPILER_TESTS_PINS=run switch and the three tables of today's behaviour it
covers, and no longer counts the harness's own tests as part of the
oracle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The footer Start adds to the route tree declares Register on the app's
framework package. A framework column adds a Solid row (with src/start.ts)
to the type check, next to the two React rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A client-rendered Solid app's __root.tsx edit hot-updates in place on
Vite, with and without automatic code splitting. On Rsbuild the page keeps
the old root component, like an unsplit Solid route there: pinned next to
that pin and listed under its cause in KNOWN-BUGS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The index route component of a Solid Start app holds a <Hydrate> itself,
so the route's split chunk is split again for the children. On the Vite
and Rsbuild dev servers the page hydrates, a click loads the boundary's
code, and the child counts, with no errors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A directive such as `<span use:tip>` names `tip` only in a JSX attribute;
Solid's JSX transform turns it into a call of `tip` wherever the JSX ends
up. A split Solid route component keeps working (router-plugin, passes).
Split Hydrate children throw "tip is not defined" for a directive declared
in the module or in the component: pinned on Vite and Rsbuild and listed
in KNOWN-BUGS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With `let input` in the component and `<input ref={input} />` inside a
<Hydrate>, the component's `let` must get the element, as it does with
split={false}. Today the chunk gets `input` as a prop and assigns its own
copy, so the component's `input` stays undefined. Pinned on Vite and
Rsbuild, listed in KNOWN-BUGS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A boundary inside a component whose children read that component's
reactive props (props.count) must keep reading them live after its code
is split. Runs on Vite and Rsbuild, with split={false} as the reference.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server fn and isomorphic fn rows of start-build-env-separation now run
for a Solid app too, on Vite and Rsbuild builds. Until now Solid's J4 was
only checked on the Vite dev server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seven checks asserted that the client output does not contain a piece of
handler code such as `db.inner()`, which depends on how the compiler
prints. The handlers now hold a `MARK_` string as a fallback they never
return, and the checks look for that string.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A setup file shared by the compiler test projects clears each pin's
`.fails` before it runs, and the shared reporter lists the pins that
passed. The two tables in router-plugin that leave out or loosen cells by
today's behaviour require every cell when the switch is on. Without the
switch nothing changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The comment said every boundary's id is compared. The test compares the
ids of the outermost boundaries only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Rsbuild RSC CSS rows ran for dev and for the production build in one
file, which took about 14 s against the 15 s per-file limit. The rows now
live in rsc-css-rsbuild-app.ts. rsc-css-rsbuild.test.ts runs them on the
dev server, and the new rsc-css-rsbuild-build.test.ts runs them in the
production build, so the two run in parallel. The rows are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A denied JSON package imported with `with { type: 'json' }` is a new
mock-shapes case: in Vite dev and in mock-mode Vite and Rsbuild builds,
the importer gets a safe mock and none of the package's data. This
passes on all three.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Vite RSC production build gets the helper-module row: a server fn calls
a module that renders a server component with its own CSS module, and the
page shows it styled. This passes.
The Rsbuild RSC CSS rows now also run in a production build, served by
`rsbuild preview` (a new small helper next to the Vite one). The rows in a
server fn module pass. The helper-module row fails as in dev and stays
pinned under the same cause.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lowercase component names, a root route with shellComponent, a root route
with context and an undefined component had lost their production check.
They now build for production on Vite and Rspack with the plugin's default
addHmr, and each bundle must equal the build with route HMR off, chunk for
chunk. All pass. The route shapes move to production-bundle.ts, so the
dev rows with addHmr off and the production rows share them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In mock-mode builds (Vite and Rsbuild, client and SSR) a violation was
checked only through onViolation. Each mocked row now also needs a printed
warning at the importer's line of the import or of its use, or at a marked
module's marker. The Rsbuild dev row of a server import of a .client file
checks the same. All pass. Only the warning, its file and its line are
checked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An exported route option that stays unsplit must be reported once, naming
the route file. The four "keep working" rows of exported options now check
this whenever the option is not lazy. A new row checks it with route HMR
on: an exported component that another route imports, after its split
modules are served, the route module is transformed again and the route
is served again. Both pass. Only the warning, its file and its count are
checked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With RSC on, the provider compiles server fn modules alongside the RSC CSS
transform. A server fn module that names only createServerFn calls
env-only fns re-exported under other names in a project module. In the
Vite RSC production build, the server-only fn runs and the client-only fn
throws, whether SSR or the browser calls the server fn, and the
server-only body is in no client file. This passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A server fn whose handler is a createServerOnlyFn call or a
createIsomorphicFn chain now has a build row on Vite and Rsbuild: it must
work, or the build must fail with an error naming the file. Today the
build succeeds, and the SSR server entry throws while it loads. The two
rows build on their own, so the other call shapes keep sharing one build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two dev edits of a module a factory comes from (the end of a re-export
chain, and a renamed env-only factory) now also run under
`rsbuild build --watch`, where the first build has filled the build's
resolution caches. After the rebuild, the importers run the edited code.
Both pass. The edits move to the shared inputs module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Start compiler resolves factories through build-only paths in a
production build. The dev rows for factories from other project modules,
export * chains, packages that re-export Start, a virtual module factory,
handler forms, builders called as factories and renamed or namespace
createServerFn imports now also run in a Vite and an Rsbuild build. Their
inputs move to a shared module, so both modes read the same rows.
Each build row checks that the client bundle has none of the row's
server-only code, that server fns are callable from the client and run on
the server in place and by id, and that the other exports behave per
environment. Three Rsbuild rows are pinned: an `export *` of the Start
package makes the build fail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With route HMR on, a plain const page = make() that the loader and the
split component read and that is also the pendingComponent is created
twice: the route module keeps the declaration React HMR renamed, and the
split component gets the shared one. The new expected-fail test expects
make() to run once and the page to render. The passing control next to
it (the same const as component and pendingComponent only) stays.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SPEC gets J2.22: the CSS a route module imports loads only when that route
matches, whatever it mounts (component, errorComponent, notFoundComponent,
pendingComponent, or no component).
New expected-fail test in start-plugin-core: a React Start app with one
route per case, each importing its own CSS, in a real page on Vite's dev
server and in a production build. At / the route's style must not apply;
after navigating to the route it must. Today the style already applies at
/, in dev and in the build.
The router-plugin test that expected a route's CSS import to load with
the route module no longer checks the CSS; it still checks that an import
whose specifiers all moved is not left behind as a side-effect import.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A server fn whose handler is a createServerOnlyFn call, or a
createIsomorphicFn chain, may either work or be reported: a compile error
naming the file, or in dev a warning naming it. Both pins now accept either
outcome. They still fail: today the module compiles without a report and
the server fn does not run its handler.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In Vite dev, the maps of the split component's module and of the shared
module name the route file with the code splitter's query
(index.tsx?tsr-split=component, index.tsx?tsr-shared=1), so a debugger sees
another file than the route file. The Vite test now runs one row per throw:
each still maps to its line in the route file, and its module must name
the route file as its source. The loader row passes; the shared and split
rows are expected to fail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A library that Start discovers through its peer dependency on
@tanstack/react-start is left out of Vite's dev pre-bundling, so a named
import it makes from a CommonJS dependency fails in the browser and the
client route using it does not run. The new expected-fail test opens such
a route in a real page and clicks a button that calls the library.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With route HMR on, a lowercase binding that a split option and an option
kept in the route module both read:
- a destructuring read by the loader, the split component and the unsplit
pendingComponent (the input of #8455) does not compile: pinned;
- a lowercase function component shared by the loader and the split
component fails to load its chunk: pinned, with the arrow form as a
passing control;
- a component created by a call and used as both the component and the
pendingComponent is created once: passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In a production RSC build, a server fn whose only importer is a 'use client'
component rendered by a server component answers 500 when clicked: the
build never registers it. The new expected-fail test clicks the button and
expects the handler's result.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rulings now cite SPEC clauses; pass, round and variant names and
documents outside the repository are gone. Comments only, plus internal
codes dropped from a few test titles.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README: what the suite is, how to run and read it, the implementer's
rules. KNOWN-BUGS: one entry per root cause with clause, pins and the
fix's goal, plus the upstream issues that affect the suite. AGENTS:
hard rules, helpers, running, budgets.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each decision is now a plain statement in the clause it affects. Clause
ids are unchanged; history, dates and justification prose are gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
route-hmr-page: routerOptions, plugins, readyTimeout and edit's timeout
(and both HMR pages count requests with hmr-sync's trackRequests instead
of a copy of it); generator-dev-scenarios: the pinVirtualConfigEdits
branch both callers turn off, and the never-passed bounds;
generator-dev-app: bundler, logs() and close(); route-app:
plugins.compilers; build-harness: extraPlugins and buildAndRun's
sideEffects; dev-server: the function form of plugins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plugin hosts' settleTimeout/eventTimeout/compileTimeout, build({ mode })
and describe(env, { env, entry }); the Vite dev server's eventTimeout (now
the constant it always was) and its copy of stripAnsi.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every channel records the console and the process streams: no caller
set anything but those defaults.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pluginNames (ctu build-harness) replaces five copies of the same
plugin-name scan in router-plugin, start-plugin-core and react-start-rsc;
startRuntimeLinks(framework) carries the Solid links the three Start
harnesses each added; the RSC apps load Start's plugin through
start-plugins and Vite's RSC plugin through one rscPluginFactory.
startRsbuildDevServer loses its never-passed generateFunctionId, and
startRscProtectedDevServer its never-passed importProtection and router.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
imports.ts (no importer since the final pass), the fast-tier copy of
expectSourceError (the integration one is the one in use), the unused
re-exports of regression-helpers, StartHostBuild, expectNoPageErrors,
and the function form of StartHostOptions.plugins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jsxImportSource (always react), DescribeBuildInput.minify (never read),
ParsedModules.resourceById (written, never read), the unreachable
no-evidence branch of countsAsDangling; webpack and Rspack builds create
their compiler and read their stats in one place.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RULINGS: "sensible, not paranoid", loaders after a hot edit, sibling
options next to an inline component, split groups and forwarding modules,
unused code is judged after the bundler, route tree quoteStyle and
semicolons. SPEC: J1.4 (quoteStyle, semicolons), J2.2 and §5.3 (forwarding
modules), J2.5 and §5.9 (unused code after tree-shaking; ideal goals, not
gates), J3.1 (loader at least once), J3.2 (sibling options).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- R17: split-mode-parity and the page-code / property-write entries find
routes by their public `id` / `fullPath` (a router over the route tree),
not by the `id` / `path` options the generator writes.
- R18: the whitespace precondition accepts any quote around the path.
- Vacuous check: the split-id directory pin reads directory-safe parts of
the split ids and reports itself (passes) when it has nothing to probe.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- V10: the source-map test finds the user's throw by its marker literal.
- V13 / ruling: a hot edit runs each changed loader at least once (not
exactly once); the obsolete loader still must not run again.
- R6 / ruling: an edit adding sibling options before an inline component
must show in place; its state need not survive.
- Vacuous checks: the "no route HMR code in SSR" check recognises the hot
API in either member spelling and needs the client to have it; the app's
deliberate "loader failed" error is told from reports quoting it
(isAppError); the HMR pins use the default bounds.
- R20: process output outside an app's context counts for an app when no
other app was open.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Pipeline (audit V6, V7, V8): no test imports an emitted module by its id
with a cache-busting query (Vite strips it from file ids; real requests
with it are covered by the edit tests); module labels do not depend on
request order; the directive check uses a unique marker and string
values skip module specifiers.
- groups() (ruling 2026-10-24, R2): a module that only imports and
re-exports does not split a group; a new file of the app does.
- Unused code (ruling 2026-10-24, R10): the dead-code page tests check the
production bundle (RouteApp.production(), markers) instead of import
specifiers of emitted modules.
- Vacuous checks: requested() lists app modules by path; servedImports
includes literal dynamic imports; readsImport sees default, namespace
and re-exported bindings; the bindings pin uses servedImports; servedGraph
follows virtual modules.
- R15: page tests that require no errors count uncaught ones only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Audit V9: the default build entries re-exported the whole route module
(`export *`), so an export a compiler adds (allowed, ruling P1) shipped.
They now import `Route`, as an app's route tree does; tests that need
another export re-export it by name. The Vite "without code splitting has
no dev-only code" React pin passes with such an entry (the refresh export
the HMR compile adds is not imported by the app) and becomes a passing row;
its KNOWN-BUGS entry goes. Also (vacuous checks) the symlink pin recognises a
refusal by the route file it names (`mentionsFile`), and the production
warning pin counts any page log of the production bundle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- generator-dev-app.ts expectRouteFile (audit V1): the import statements
are compared by what they bind, the rest of the file byte for byte
(ruling Q10), with the blank lines a removed import leaves.
- R5: on Vite, errors() counts what the dev server logged after the last
edit settled (SPEC §8: the state after the last write), as on Rsbuild.
- Vacuous checks: the generator-watching pins wait as long as the passing
scenarios do; the "generator stops with the server" check watches at
least three times as long as the running generator took to react.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vacuous checks of the outcomes-only audit, harness side:
- strict-runner.ts: the named-import check also covers virtual modules an
app module imports (a compiler's support module), with a contract test.
- build-harness.ts: MODULE_LEVEL_DIRECTIVE warnings of virtual modules are
kept (only linked files outside the app root are silenced).
- dev-server.ts: payloads sent on the server's WebSocket channel are
recorded too, where it is not the client environment's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- owned-edits.ts (audit V3): blank lines next to lines holding only import
statements, or at the start of the file, are not compared: a generator
that deletes exactly an import statement keeps every byte outside it
(J1.2, ruling Q10).
- determinism-app.ts (vacuous check): withListingOrder permutes
fs.promises.readdir, fs.readdir and fs.readdirSync, and fails when the
generation listed no directory through them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RULINGS: client middleware options, mock access diagnostics, Hydrate chunk
directives, child-only module evaluation, SSR route splitting, and the
clause readings applied without a new ruling; Q3 and Q8 updated. SPEC:
J4.8 (extra fields), J4.17, J5.6, J5.9, J6.3, §5.3 (SSR splitting a goal, not
a gate), §5.18, §8.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Mock access diagnostics: one row checks that calling a mocked import is
reported per mockAccess; the rows pinning string conversion, toString(),
new and property writes are deleted.
- Hydrate chunk directives: a client-only split chunk need not repeat
'use client'; the parent keeps its directives.
- Child-only module evaluation: a module only <Hydrate> children import is
not downloaded early (now checked for both boundaries); when its top-level
code runs is not checked.
- SSR route splitting: not required; the client placement is checked and
both builds still run the loader and render the page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Client middleware: check `type` and that no server implementation or
validator ships (`clientMiddlewareOf`), not the whole `.options` object:
extra fields are allowed (user ruling 2026-10-24, §5.19; Q3 is about stubs).
- Module directives: each user directive is kept; another one is not
forbidden (G12).
- Dev server fns: checked through the public `url` and the request sent,
not `serverFnMeta.id` or a RegExp built from the dev id (J4.4, §5.19).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The outcomes audit (B) found import-protection rows that a correct compiler
fails: a trace listed entry last (allowed by J6.5 and ruling "restructured
compilers", R10) and a specifier violation without `resolved` (optional,
J6.5, §5.14). `traceFromEntry` orients a trace from the entry to the
importer for every reader (`violationsOf`, build-markers' blamed importer);
`resolved` is checked only when given.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quick wins: checkDanglingNames reads each source once per build (dd95e2a0b8,
kept over the equivalent dd9b33bc9c from quickwins-spc), and scriptHolds
parses each loaded script once per marker (bb200e381a).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
exsolve 1.1.3 no longer retains callers through cached failed lookups,
which kept compilers alive across builds in one process.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
start-plugin-core resolves Start's entries and, in Rsbuild's import
protection, extensionless absolute ids with exsolve's
`resolveModulePath(..., { try: true })`. exsolve caches every failed
lookup as an `Error` in its process-wide `globalThis.__EXSOLVE_CACHE__`.
In 1.1.1 the error's not-yet-formatted stack keeps its call sites alive,
and with them the Rsbuild transform closure of that build: its `compilers`
map, every `StartCompiler` (Babel ASTs in `moduleCache`) and the Rspack
compilation. exsolve 1.1.3 (#63, "Don't keep callers alive through
cached errors"; 1.1.2 shipped without a rebuilt dist) reads `error.stack`
before caching the error, so only the formatted string is kept.
Measured on this machine (heap snapshots, V8 ephemeron-aware
reachability), 25 Start Rsbuild production builds in one process, each in
a fresh app directory, forced GC:
- 1.1.1: 50 `StartCompiler` objects alive (all builds), heap 426 MB,
RSS 2.3 GB; 75 cached errors.
- 1.1.3: 2 alive (the build still in scope), heap 175 MB, RSS 1.7 GB;
the same 75 cached errors retain no compiler.
start-plugin-core `test:integration`, 4 workers, same session (the
PERF-STUDY method: resource-profile sampler + tool hook):
- 1.1.1: peak PSS 17.3 GB, top worker 4.49 GB, 96.3 s, all pass.
- 1.1.3: peak PSS 13.0 GB, top worker 3.21 GB, 93.7 s, all pass.
(PERF-STUDY: 17.1 / 4.46 GB; its `cache: false` prototype 13.1 / 3.6.)
Only the lockfile changes (`pnpm update exsolve --recursive --no-save`):
exsolve 1.1.1 -> 1.1.3 for start-plugin-core, c12, env-runner and
pkg-types. exsolve's negative cache itself is unchanged: a Start entry
added after a failed lookup stays unresolved until the process restarts
(reproduced with 1.1.1 and 1.1.3; not addressed here).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
expectLoadedOnNavigation checks the page's scripts before and after the
navigation; the scripts loaded before were parsed again in the second check.
A loaded script's code does not change, so its answer per marker is kept for
that script record (a WeakMap on the test's own script objects).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The attribution of a dangling name read every module holding the name again
for each candidate name (2,961 reads of 230 distinct sources in router-plugin
test:integration). The reads are memoized per build: the same sources give the
same names, so the decisions are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The five compiler test packages (compiler-test-utils, router-generator,
router-plugin, start-plugin-core, react-start-rsc) now set
`test.maxWorkers: 4`; every project inherits it (`extends: true`), and
`--maxWorkers=<n>` or `VITEST_MAX_WORKERS` still override it.
Each worker runs real bundlers, dev servers and its own Chromium, and Nx
runs 5 tiers at once: at Vitest's default (cores - 1 = 15) the default
whole-set command started 54 workers and about 270 Chromium processes,
needed more than 27 GB and failed (78 failures, 35-53 GB of swap written;
PERF-STUDY 2026-10-23).
Measured locally (16 cores, 27 GB), `nx run-many -t
test:unit,test:integration,test:noncompiler -p <the five> --skip-nx-cache
--excludeTaskDependencies`, no flags: 166.5 s wall, 1,591 CPU-s, all 12
tasks pass, peak PSS 18.8 GB, 8.5 GB swapped out, at most 21 workers and
90 Chromium processes.
The compiler-test AGENTS.md no longer tells people to pass
`--maxWorkers=4`: the budgets are measured at the configs' default.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The user, on whether the generator may touch other import statements when it
adds a missing route constructor import: "I don't think we should specify
that. Let it." expectOnlyOwnedEdits no longer caps how many router package
imports change, nor keeps any import statement byte for byte. It still
checks the outcome: everything outside the import statements keeps its
bytes, and the imports bind the same names (imported and local name, source,
type/value meaning, attributes; side-effect imports stay), apart from the
route constructor's own binding.
Validated with a correct generator variant (temporary) that reprints every
import and merges same-source imports: the old helper failed 4 rows, the new
one passes. Records the ruling in RULINGS, SPEC J1.2 and the README (no
ruling pending).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Re-measured at c2161c4d14 (both rulings branches merged): counts (start-plugin-core
integration 1205 / 294, react-start-rsc integration 108 / 14), no #34 hit in 65
beetle jobs, R2 clean, the greens, the 17 reds the rulings touched, the sweep.
The #34 caveat goes; the Chromium shared-memory exhaustion (FINAL-PASS #40) is
recorded as an open caveat with its upstream draft.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RULINGS Q1, Q2, Q5, Q8, Q9, NEW-1 and NEW-2; SPEC J1.10, J1.13, J3.11,
2.2, 5.5, 5.20, 8 and 9; README pending table, counts and status;
KNOWN-BUGS counts and the moved K-19 pin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Q5: replace the jsdom updater test with a real page row (Vite and
Rsbuild): an app that creates a second router after its own keeps
working through a route edit. Q8: delete the two-router-plugins row and
the hand-built Start composition sharing a plugin context; the rest of
router-plugin-context.test.ts is code-splitter-edits.test.ts. Q9: delete
the immediate tsr.config.json reload pin. NEW-1: the decorator pin is a
real bug. jsdom is no longer used by router-plugin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Q1: delete concurrent-write.test.ts, whose tests inject an fs into the
generator; the K-19 pin keeps its real-filesystem part (tmpDir on
/dev/shm, files replaced by a rename) in generator-options.test.ts.
Q2: the nested type tests check InferFileRouteTypes<typeof routeTree>
instead of the generated FileRouteTypes name, and run on a copy of the
fixture (integration/fixture-types-nested.test.ts): the types project,
its tsconfig and the last write into the package are gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ruling Q4 (2026-10-23): a name re-exported with export * from a denied
module is a complete safe mock; otherwise a build fails and dev warns at
the export *; never the denied module's value or a crash. The dev pin now
accepts the warning and checks every resource the page loaded for the
secret (a denied package of its own, so a leak is visible); new build rows
on Vite and Rsbuild (pinned on Rsbuild for a denied specifier, whose build
succeeds with the name undefined).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite 8.3.4's optimizer keeps writing node_modules/.vite/deps_temp_* after
close() resolved (final-pass #34), so removing the app failed with
ENOTEMPTY, or the optimizer's write into the removed app was an unhandled
rejection. closeViteServer waits until each environment's optimizer has
initialized and scanned and no deps*_temp_* directory is left, then
closes. The ctu dev server harness and the raw Vite servers of
start-plugin-core's known-bugs-start-compiler-dev and hydrate-build-dev use
it. Authorized by the user's ruling of 2026-10-23.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rsbuild's RSC CSS transform only rewrites server function provider modules
(`serverFnProviderOnly: true`, react-start src/plugin/rsbuild.ts), so a
server component a helper module renders gets no CSS. The e2e spec
rsc-css-helper was the only pin of that; the Rsbuild oracle now holds it as a
test.fails row (red today, green when serverFnProviderOnly is dropped). The
Vite half is covered by rsc-css.test.ts. Restores e2e/react-start/rsc to main;
its route tree is what the app's build generates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pin "transforms a client module with a server fn and a top-level call
of a pre-bundled dependency" passed once under load (green-sol/17). Vite's
dependency optimizer ends its first crawl of static imports when no request
is in flight 50 ms after it starts. The harness made its first request after
createServer(), which had already started the optimizer, so a loaded machine
could delay the request past those 50 ms: the transform was then not in the
crawl, Vite optimized zod in a later run, and the deadlock did not happen.
The harness now creates a listening server, requests src/fn.ts, waits until
Vite loads it, and only then calls listen(), which starts the optimizer. The
transform is in flight when the optimizer starts, so it is always in the
crawl.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The R7 coupling, the watch-mode row and the run directory left in the
temporary directory are fixed; the re-measurement at 57addcc41e (3 unpatched
runs, R1-R11, the 34 valid greens, 18 reds) and its one open finding, a
dev-server deadlock pin that passed once under load, are in the status.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each test process removed its shared app directories when it exited, and
the last workers exit while Vitest runs the global teardown, which removes
the whole run directory. Node's fs.rmSync (24 and 26, not 22) returns
without an error and leaves the rest of a tree behind when another process
removes part of it meanwhile, so the run directory and its generator/ were
left in the system's temporary directory. With a run directory, the
teardown is now the only one to remove it; without one, the processes still
clean up on exit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The session's first build wrote the route tree, so webpack always rebuilt
right after it, and a route file the test created then could meet the
pinned generator bug (router-generator generator-dev.test.ts "events that
arrive together"). The app now gets its route tree from a real build first
and its files are a minute old, so nothing is pending when the test creates
the route file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generator.run ends a batch whose events all changed nothing with an early
break, without looking at the events queued meanwhile. A route file created
while webpack's rebuild runs the generator for the unchanged route tree is
then neither scaffolded nor routed. This is what made router-plugin's
generator-watch-mode row fail now and then (more often with /tmp on tmpfs).
Pinned deterministically through the public Generator, with a control that
sends the same events one after the other.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
expectNoOtherErrors took the importer's file as everything before its first
colon, so Rsbuild dev's `webpack:/src/a.tsx:2:1` (the F2 pin) gave `webpack`
and the row passed only because the bundler's error text contained that word.
Locations are now split at a trailing `:line(:column)` only (locationParts),
and the other-errors check asks whether an error names the importer's app file
(mentionsFile), so it depends on the file alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured at f16aae85ac (beetle, 3 trees x 4 workers; budgets locally): counts
confirmed in every tier and lane, R1-R11 (R2: only Q5; R7: one row that
depends on the bundler error's wording), V4 90/90 reds caught and 34/34
greens clean, stability (#34 only), the git-status sweep, strict budgets.
Also records the tmpfs-dependent router-plugin watch row and the run
directories left in the system temporary directory.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README (Diagnostics, G8, Status, counts re-run at F-L), RULINGS
(import-protection reports through onViolation) and SPEC G8 say what the
tests now check: each import-protection violation is printed, log is
judged on printed warnings, the typeof exemption is per module, and a
position counts after the file is named. The MDX dev row titled "logs a
warning at each importer" now checks the printed warnings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
router-generator's Vitest config uses the shared run-directory global
setup, like the other compiler-test packages: the generator's own
temporary files (TSR_TMP_DIR) and the harnesses' apps (runDirectory())
live in the run's directory, removed when the run ends, also after a
crash.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
expectCompileError passes the module's file (CompileFailure records it),
so a compile error at the right line of another module no longer passes.
The shared diagnostic matcher reads a line:column or :line only after the
text names the expected file (a code frame's highlighted line anywhere),
so a stack frame or a trace step before the file no longer stands in for
the position.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Function-valued Rspack rule fields must survive the RSC setup
(enableSwcReactServerComponents): Rsbuild configuration plumbing, not a
compiler. Restored unchanged from main and run by test:noncompiler.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The chunk's free names keep the names it also probes with typeof
(readNames keepProbed); each module decides for itself whether its read is
guarded. A module that probes the name explains the read; a module whose
rendered code in a Vite build lost the name (Rolldown's OutputChunk.modules)
is no reader. Start's Vite builds now record the same module evidence as
the other harnesses. A chunk Yuku reports a parse error for fails the check
instead of being half read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
settle (node, page prelude and the local page helpers) now takes the
function to call and gives back a value that is no function as it is, so
throwsError no longer accepts a compiler that replaces a wrong-environment
createServerOnlyFn/createClientOnlyFn with no function at all (J4.10).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
expectViolationsAt also asserts, for a run that records what it printed
(a dev server, a build), that each violation onViolation received is
printed as a warning or an error naming its importer and position (SPEC
J6.3). The log rows count the printed warnings naming the importer
instead of onViolation calls (J6.5: log governs printing).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: ctu build-harness.test.ts keeps simplify-b's deletion of the
dangling-name block (F-J's two .dependency- createAppDirectory sites were
inside it; the now-unused imports dropped). The implementation lane stays
deleted (F-J's comment edit of route-hmr-debug-output.test.ts dropped,
router-generator's implementationTests constant not restored; F-J's
JITI_FS_CACHE setting kept). ctu exports: ./app-directory and
./run-directory added, ./added-code stays removed. rp
generator-watch-session.ts imports createAppDirectory without the unused
expect. README: F-J's status paragraph says its counts were measured on its
own baseline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: the legacy helpers S-B edited (spc, rp outside-compiler-corpus,
already deleted here) stay deleted, and S-B's spc
outside-compiler-corpus/legacy/validate-module.ts is dropped (no user: the
implementation lane is gone). ctu validate-module.ts stays deleted. In rp
code-splitter-imports-exports neither side's removed import is kept.
Lockfile: S-B's; pnpm install --no-frozen-lockfile changes nothing, frozen
install passes. Also deleted: ctu knownGlobals (its last user was
validate-module), unused spc PageFixture and rsc NO_BACKGROUND. README and
SPEC G8 describe the free-name and production-bundle checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README counts, lanes (no implementation lane) and legacy note; RULINGS
'oracle tests only', F1 and real-requests entries; SPEC internal-controls
and C10 lines; KNOWN-BUGS without the F1 caret pin (362 pin sites in 100
files, J4 81); AGENTS without the implementation lane and the Node
stand-ins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- start-plugin-core: the legacy regression helpers, tests/start-runtime.ts,
importProtection/mock-modules.ts and compiler-transforms-seam.ts (their
last users were deleted by main-tests and nol-delete); the F1 caret pin
known-bugs-start-compiler-code-frame.test.ts with its code-frame reader
(printed message text, code frames included, is not tested); the unused
reactStartPackage and two unused importProtection option helpers.
- compiler-test-utils: the Node stand-ins module-linker, render and
lazy-probe, importBindings and keptDynamicImports, with their controls;
an unused escape helper. native-import.cjs stays: start-compose-app.ts
imports the real SSR build with it.
- router-plugin: the unused pageDiagnostics.
- The implementation lane is empty in every package: its Vitest projects,
test:implementation scripts and Nx targets, router-generator's
tsconfig.implementation.json, the root test:pr/test:ci/vite-ecosystem-ci
entries and the compiler-platforms step are removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: the import gate and its control (deleted by simplify-a) drop
main-tests' noncompiler-list edits; the tests/noncompiler-tests.json lists
stay for Vitest and ESLint. compiler.test.ts header takes main-tests'
wording. Files main-tests deleted stay deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: files nol-delete deleted stay deleted; the build harness keeps
simplify-a's onViolation recorder without the removed corePlugins option;
README counts are rewritten after the last merge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
router-generator's test:implementation type-checks with tsc 6, which
cannot infer the loop's `end` and `whole` (TS7022).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With behavior "error", onViolation may receive the other importer's
violation more than once (seen under V4 green-sol/19, which does not touch
import protection); assert that a violation is reported and that none is
at the exempt importer instead of counting the callback's calls.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An app's temporary directory now mirrors the path of the directory it
stands in for from the repository's root (the outermost node_modules),
with the node_modules links, tsconfig.json and package.json at their
mirrored places. Apps stay as deep as they were: router-plugin's
relocation test, which serves the same route from project roots at
different depths, still serves it from different depths, and no longer
creates those roots in the package.
The oracle README's #34 caveat names the other form of the race: the
optimizer's write into an app removed meanwhile, an unhandled rejection.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite prints a file relative to the working directory
(tests/integration/.plugin-host-x/src/label.ts): with a root, a longer path
ending with the project-relative path names the file when the absolute
path ends with it; a leading slash (webpack:/src/a.ts) counts like ./.
The router-plugin host control accepts a warning printed on more than one
channel, as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README "Lanes" and AGENTS.md: the corpus is the compilers' test suite;
main's tests of features that are not compilers stay at main's paths with
main's content and run in test:noncompiler (listed in
tests/noncompiler-tests.json); main's tests of compiler internals are
deleted because the corpus covers their behaviour. Implementation and
noncompiler counts updated; acceptance counts unchanged. Root AGENTS.md
lists test:noncompiler among the targets to run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The oracle (acceptance) is the compilers' test suite. Main's own tests split
in two:
- Tests of features that are not compilers (start-plugin-core: manifest,
sitemap, prerender, CSRF config, schema, entry planning, post-build,
output directory, watch-ignored, createVirtualModule, dev styles, utils,
Rsbuild normalized client build; react-start-rsc: ClientSlot,
ReplayableStream, ServerComponent, SlotContext, createRscProxy and the
three type tests) are restored to main's paths and content
(git checkout origin/main). Each package lists them in
tests/noncompiler-tests.json: the `noncompiler` Vitest project
(test:noncompiler) selects them, the corpus projects, the import gate and
start-plugin-core's ESLint leave them out. react-start-rsc type-checks and
lints tests/integration only, as main does not check these files.
- Tests of today's compiler internals that the branch had moved under
outside-compiler-corpus/ are deleted: router-generator config, transform,
param-name-warnings, virtual-routes; router-plugin config and the
handle-route-update controls (the Q5 control stays); start-plugin-core
compiler-instances, compiler-member-call-receivers, compiler-seams,
importProtection analysis/defaults/matchers/rewrite/sourceLocation/trace/
utils/virtualModules, Rsbuild server-fn-resolver-rebuild and swc-rsc,
server-fn-resolver-module, Vite module-id and start-compiler-utils. The
corpus covers their behaviour. No real-bug pin was in them.
Corpus comments that pointed at the deleted files now name main's sources.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The implementation lane now holds main's relocated tests of compiler
internals and the Q6/Q7 legacy harness only; its counts drop
(router-generator 114/2 -> 51/0, router-plugin 104/1 -> 17/0,
start-plugin-core 609/9 -> 468/0). Acceptance tiers and the noncompiler
lane keep their counts. The F-F gap about `corePlugins` is gone with the
option.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SPEC G5, J2.8, J2.19, J4.10, J6.12, §5.7 and the code-frame note now ask for
file and position only; RULINGS records the 2026-10-22 user rulings
(diagnostics: file and position only; import-protection reports through
onViolation; no import gate) and supersedes "explaining a diagnostic";
KNOWN-BUGS drops the deleted pins and renames the changed ones; README and
AGENTS describe the remaining checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
User rulings of 2026-10-22: a diagnostic is checked only for being reported,
at its severity where a test needs it, naming the file and the position; and
import-protection violations are read from Start's public onViolation
callback, never parsed from the printed report.
- compiler-test-utils diagnostics.ts keeps the collection (diagnosticsOf,
captureThrow, captureConsole), expectDiagnostic/findDiagnostics with
severity, file (absolute or project-relative as a whole path) and position
(line:column, or the line) only. Deleted: explains and its word lists,
causes, names, prose, distinctFrom, code-frame and prose parsing,
importLines, importedBindingUses/scopeBindings, the reported-location
oracle, expectFrameAt and the environment-restriction grammar. Its
controls are deleted with them; the real-channel controls stay.
- start-plugin-core: the violation-report reader, its 124 controls and
channels.ts are deleted; the harnesses record what onViolation receives
(dev servers, builds, StartBuildError) and tests compare it with literal
places (use, import line). Printed reports are checked for file and
position only (expectPrinted). original-location.ts takes literal places;
its 13 controls are deleted.
- J4.10 runtime errors are checked by the call throwing (throwsError).
- Callers in router-generator, router-plugin, react-start-rsc and
start-plugin-core drop names/explains/prose/distinctFrom/source.
- Pins whose only subject was message content are deleted (the warning
names the binding, not the option; the rejection of this/super names no
fix); the F1 column pins in createServerFn.test.ts check the line (F1
stays pinned in known-bugs-start-compiler-code-frame.test.ts); the
export * pin asks for the mock (today's warning already names the file
and line).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the pending-rulings files gone, delete the tests of test helpers
that only exercised the legacy in-process harness (start-plugin-core
legacy-regression-helpers, render-host, known-bugs-start-compiler
controls, known-bugs-hydrate controls, createServerFn controls, the
outside start-compiler-runtime-contract; router-plugin's fast-tier
regression-helpers controls), delete the legacy render and diagnostics
modules, trim the legacy helpers to what the remaining implementation
tests use, drop the Q6/Q7 entries of the import gate's allowlist, and
record the rulings in the oracle docs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A CommonJS package in node_modules whose code has the text .handler(
reaches the Start compiler in Vite's client build (and SSR with
noExternal), both Rsbuild builds and Rsbuild's dev server; the compiler
parses it as an ES module and fails on a top-level return that the same
package without that text builds and runs with. The in-process pin is
replaced by real-app pins (both builds, Rsbuild dev): red today for that
parse error, green under a correct fix (checked with a reverted
temporary fix). The octal escape and with forms break these apps
without Start too and carry no pin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ruling Q6 (2026-10-22): the rows that hand-write a fake
@tanstack/start-client-core and drive the internal StartCompiler are
deleted. What they meant is decided through the public Start host:
- Start's own built createCsrfMiddleware (an isomorphic fn whose server
implementation builds a middleware) is a no-op in the client and a
request middleware on the server (added);
- createMiddleware read as a member of a namespace import of a project
module that re-exports it (added next to the createServerFn and
createIsomorphicFn rows of the same form).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start's production client builds read process, Buffer, setImmediate, global
and __REACT_DEVTOOLS_GLOBAL_HOOK__ behind typeof checks; no globals set
holds them for a browser. One rule replaces the old guard analysis: a
module that probes a name with typeof reads it knowing it may not exist.
It also covers @vitejs/plugin-react's WorkerGlobalScope check, so the
client globals go back to the browser set alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deletes the user-approved out-of-scope files of `outside-compiler-corpus/`
(NON-ORACLE-LANES 2026-10-22): the tests of test helpers (H, 22; the
start-plugin-core `legacy-regression-helpers.test.ts` goes with Q6/Q7),
the new tests of today's compiler internals (I, 22; `mock-modules.ts`
stays while the relocated main tests `analysis.exports` and
`virtualModules` use it), the new non-compiler
tests (N, 6) and the router-plugin legacy harness (L, 3).
Also removes the helpers only they used: the `corePlugins` option of the
Start build, Vite dev and Rsbuild dev harnesses (and `CoreStartPlugins`),
`warnMeTransform`, the generator file-watcher inventories
(`expectGeneratorWatchersClosed`, `expectWatchSessionWatchersClosed`), and
the export of `stringValues`. Comments that pointed at the deleted files
now stand alone. The real bugs pinned only in the deleted files are
recorded outside the repo (FOLLOWUPS).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A `declare` binding has no runtime value: the route file reads it free.
Erasing TypeScript with Vite's Oxc transform says so without relying on
Yuku's binding flags (an ambient var merged with an interface of the same
name loses the Ambient flag in Yuku 0.22.1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ctu AGENTS.md says how tests get app directories (app-directory,
run-directory) and that they never write into the repository; the oracle
README's #34 caveat no longer describes the leftovers in the packages; the
.gitignore entry now covers only what older checkouts may hold.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A module's free names are now Yuku's unresolved references (free-names.ts):
no type positions, no `typeof x` operand, and `arguments` read where
Yuku's binder stops at a non-arrow function is that function's implicit
`arguments`. Client globals are the `globals` package's browser and
worker sets.
- compiler-test-utils: delete validate-module.ts (analyzeScopes, typeof
guards, declaredNames, the Rolldown module-alone mode for G8 decisions,
source-map attribution of shipped free names) and source-attribution.ts,
with their controls (validate-module unit and build tests, the 32
dangling-name rows of build-harness.test.ts). The build harness's
dangling-name check keeps its attribution policy and reads free names
from free-names.ts.
- router-plugin: expectValidModules = parse errors plus free names minus
browser/worker globals, the refresh globals and what the route file reads
free; when a module has one, the app's production build decides through
the build harness's dangling-name check (G8). The two page tests that
called getModuleErrors use expectValidModules. Legacy implementation
helpers drop their own expectValidModules and its control row.
- start-plugin-core: the legacy helpers (implementation lane and pending
rulings Q6/Q7) keep getModuleErrors/keptDynamicImports in
outside-compiler-corpus/legacy/validate-module.ts, on free-names.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Yuku 0.22 is the first release with the semantic API (scopes, bindings,
references); it was published 2026-10-22, inside the workspace's 24-hour
minimumReleaseAge window, so it is excluded from that window by name
(user-approved) until it ages past it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the statement-diff evidence (added-code), the dev-global trap and
the dev-API regex of production-bundle.ts with one outcome: the production
client bundle renders the route in a real browser and its chunks equal the
control build's (addHmr: false, NODE_ENV=production), chunk for chunk.
Delete compiler-test-utils' added-code.ts and its controls. global-trap.ts
stays: start-plugin-core's start-host (an acceptance user, with no control
build) still uses it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The user ruled to delete the static import gate entirely, with no
replacement: its script, its control, the test:import-gate* targets of
the five compiler packages, the nx target default, the root test:pr/test:ci
target and the compiler platform workflow step, and its documentation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The harnesses created their temporary apps as hidden directories of the
packages' tests/ so that Node resolution found the dependencies. What tools
wrote into an app after its removal (Vite's optimizer after close(), #34)
stayed in the package (about 1,900 directories per tree after 50 runs) and
broke start-plugin-core's test:eslint.
Every app now lives in a temporary directory that stands in for the
directory it was created in (`@tanstack/compiler-test-utils/app-directory`):
the node_modules directories above that directory are linked at the same
depth, so imports resolve to the same real paths; its tsconfig.json (class
fields, JSX, decorators) and the type/sideEffects of its package.json
apply as before; Vite dev servers allow what Vite allowed for an app in the
package and keep their dependency cache in the app. A global setup
(`run-directory`) gives each run a directory, removed when the run ends,
for the apps and for the route generator's temporary files (TSR_TMP_DIR,
on the apps' filesystem: K-19), which went to the packages' .tanstack/.
router-generator runs its fixtures on copies instead of the checked-in
directories (a correct generator may rewrite their route files); the tree
of the nested fixture is still written next to it for the types project
(Q2). Its Vite servers keep their dependency cache in the app, and jiti's
file cache is off under Vitest: both went to the package's node_modules.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R1–R11, V4 rounds 1+2, stability and strict budgets re-measured at 633a4c0917
(after F-F, F-G1, F-G2, F-G3, V-G1), and start-plugin-core again at
d07614d3b3 (after F-I). Counts at d07614d3b3. #34 is now frequent (single
rows, also in alone re-runs) and leaves app directories that fail
start-plugin-core's eslint; #42 did not occur. The two slow tiers are 2–5 s
under their hard budgets. red-astra-r2/15 is now caught by its own row only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
F-I stopped running the SSR-code half of the D6 control on Vite, because
whether the server fn is in the resolver there depends on the #7213 race.
After that change, no acceptance row caught a Vite compiler whose resolver
drops every server fn the client build did not find. A server fn that the
app's server entry defines is found when the SSR build compiles that
entry, before the build reaches any module the entry imports (the resolver
among them). So this control's order is fixed on both bundlers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A traced run of the start-plugin-core and react-start-rsc acceptance tiers
lists every Vite build whose resolver holds a server fn the SSR build found
in the same build step. Besides the #7213 block, only the D6 harness is one:
the server-only fn its control calls from SSR code reaches the resolver by
about 12 ms, and no app input orders the two.
Split the D6 control: the client-referenced HTTP call on both bundlers, the
call from SSR code on Rsbuild only. The D6 pin keeps asserting both and stays
red on Vite either way (for #7213 when the race is lost). React-start-rsc's
builds register their server fns in an earlier build step, and dev servers
have no generated resolver.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Vite row "a server fn that only a middleware .server() of another module
calls" passed only because the SSR build usually compiles the middleware's
module a few milliseconds before it loads the server fn resolver; under heavy
load it lost that race ("Server function info not found"). No app input
orders the two, so that Vite cell is no longer run (Rsbuild keeps it).
New rows build the same callers with the caller only client code imports.
The SSR build then reaches its handler and middleware only through the
resolver's generated imports, so on Vite the server fn is always missing
from the resolver: deterministic pins of #7213 for both callers (passing
rows on Rsbuild). KNOWN-BUGS and the oracle README follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fast-tier rows "leaves unrelated SSR middleware chains as written" and
"isomorphic, server-only and middleware implementations in one module" called a
middleware's .server() with a hand-written next. Each now calls a server fn
that uses the middleware (a user of the factory in another module, a
createServerFn().middleware([mw]) next to the case), from the client over HTTP
and from server code inside a real request, and reads what the middleware put
into the handler's context.
The env-separation pin "a function middleware validator on a builder variable"
called the validator directly. A server fn with that middleware now returns
the data the validator gave, called by id through Start's server entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page scripts clicked a deferred boundary every ~100 ms until its counter
read ":1", deciding on a 50 ms quiet period that cannot see a chunk still
loading. Under load the boundary's code takes longer than that, the repeated
clicks are replayed with the first once it hydrates, and the counter never
reads ":1" (seen: Solid "a boundary loads its children when it hydrates",
child:41). The prefetch rows read the prefetch before it finished loading
(prefetched: false).
`clickUntil` (in the page scope) does not click again after a click the
boundary took in (the page cancels it to redispatch it) until the page
changed and settled; the prefetch rows wait for the prefetch's request.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The harnesses imported outside-compiler-corpus/core-start-plugin.ts, so every
acceptance file using them statically reached tanStackStartVite /
tanStackStartRsbuild (68 files in the import gate's helper graph), and any
test passing `compilerTransforms` would silently get the core factory instead
of `tanstackStart()`. The implementation test now passes the plugins itself
(`corePlugins: coreStartPlugins(transforms)`); the harnesses only know the
type. No acceptance file reaches the core factory module any more.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ctu test:integration 171 (the invalidation control of hmr-sync), settlePage
covers invalidations, and the server-code claim is scoped to the build and
dev-server tiers: two fast-tier rows still call a middleware's .server() with
a stand-in next, listed under known gaps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
editOutOfOrder's stale page only makes the dev server compile the split
modules first; a stale module it asks for may fail as a stale request does
(e.g. a compiler that versions its split URLs). The fresh page judges.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An accept callback that calls import.meta.hot.invalidate() (React Refresh on a
route module it cannot refresh) sends vite:invalidate back to the server, which
answers with an update or a full reload. The sync token could reach the page
before that answer, so settlePage resolved before the reload: shown with a
400 ms client->server delay on the addHmr: false React row (reload after
settle) and by a new control that fails on the previous helper.
The page now answers each sync token over the same WebSocket
(import.meta.hot.send); Vite handles a page's messages in order and an
invalidation synchronously, so a page counts as settled once its answer came
back with nothing else sent to the client since the token went out;
otherwise another token follows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
route-hmr-dev-addhmr-off's Vite rows waited at most 3 s for the edit to
show and took a timeout for 'not shown', then waited for network idle:
an update applied in place late under load could be missed. They now
settle with settlePage: the page took in and handled everything the dev
server sent (Vite's client handles messages in order, an update once its
modules are fetched and accepted), waiting through a reload, then judge
reloaded vs applied in place; a row also requires the edit to have shown.
hmr-sync.ts moves to compiler-test-utils (./hmr-sync, shared by
start-plugin-core and router-plugin) with hmrSyncInitScript for pages
whose own code does not import it, and gets controls
(tests/integration/hmr-sync.test.ts, discriminating: slow modules make a
helper that does not wait fail). The Rsbuild and webpack rows of the file
already settle on the shown text with failWhenQuietFor, in both outcomes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fast-tier row 'a request middleware server implementation called
through a computed member' of known-bugs-start-compiler.test.ts checked
the server side with mw.options.server({ next: () => 'next' }), a
hand-written middleware chain. Its build twin in
integration/start-build-call-shapes.test.ts has the same input, the same
call site and names for a rejection, and the same outcome (no server-only
module in the client, the middleware runs on the server), and runs the
middleware as the app's request middleware in a real request. The
fast-tier host has no start entry per case, so the row is deleted rather
than kept with a stand-in chain. The other rows of the table keep the dev
path of the same root cause. KNOWN-BUGS.md is unchanged (the table is
one pin site; its entry does not list rows).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Known gaps: the webpack addHmr cell, the hand-written next rows and the
300 ms settle are fixed; one fast-tier pin with a hand next is left
(named). How tests reach the compilers: webpack dev server, middleware
through requests, page-judged reloads. Counts: rp integration +1, spc
integration +1, spc implementation +1, with reasons.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
probeMock's deepCall also called any.constructor.member() and
any.__proto__.member(): a mock that keeps its target's constructor and
prototype (SPEC §5.18 leaves the Proxy shape free) failed it. New harness
control: such a mock is safe; the rejecting controls still reject.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
known-bugs-hydrate expectNoUnusedChunks: the split modules are what Vite's
client module graph reaches from the case module (the case's code by
provenance), not import() specifiers parsed from the served code; the
page must have requested each. New passing control (JSX children).
known-bugs-dev-server editOutOfOrder: the dev server no longer gets
transform() calls in a test-chosen order; a real page whose HMR WebSocket
fails renders the route for the first time after the edit, so the browser
requests the split modules before the route module. Both pins stay red for
their stated reasons; controls pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
start-router-dev-server's quiet() (300 ms without HMR messages) and the
full-reload message counts of start-router-dev-server and v2-edits-page
are replaced by settlePage (integration/hmr-sync.ts): the server sends a
custom HMR event until the page holds its token (one WebSocket, in order),
waiting through a full reload the page announced (vite:beforeFullReload);
"no full reload" is then the page's load count.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rows that called .options.server({ next }) or .options.server.handlers.GET()
with a hand-written next now go through Start's server entry: a server fn
with the middleware called over HTTP (callById / callServerFn), the app's
request middleware registered in src/start.ts, route handlers by
startServerEntry.fetch. start-build-env-separation (6 rows),
known-bugs-start-compiler (integration), start-compiler-dev-server,
start-build-call-shapes. start-compiler-dev-server keeps the absence of a
full-reload payload for J3.6 (the server side has no page), now after the
outcome, with the reason.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The webpack cell of plugin-options "with addHmr: false, a development
build with the HMR plugin has no route HMR code" looked for
/\bhot\.accept\(/ in the build: today's local name. It is replaced by two
rows of route-hmr-dev-addhmr-off.test.ts on webpack-dev-server with
hot: true (the webpack quickstart example's setup, new devDependency
webpack-dev-server ^5.2.4, already in the lockfile) and a Chromium page
(tests/webpack-hmr-page.ts): with addHmr: false a loader edit reloads the
page; the control, with route HMR, applies it in place. Catch proof: with
addHmr ignored (addHmr = !isProduction) the row fails with
{ reloaded: false }.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Commit 3e3331caa3 swept in 299 fixture route files under
tests/generator/**/routes/** whose only change was ' to " around strings:
output of the V4 green-sol/01 variant (ids printed with double quotes),
which ran the generator fixtures in place (generator.test.ts runs a
fixture in its own directory). The commit's message names no fixture
change. The bytes equal main's again, so `pnpm format` leaves them alone
without an ignore pattern.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RULES-AUDIT §3 item 6 (hand-configured stand-ins).
- start-plugin-core: the build, Vite dev and Rsbuild dev harnesses create
Start's plugin with `tanstackStart()` of the built framework package
(`tests/start-plugins.ts`, shared with `start-host.ts`), so react-start's
config plugin (dedupe, externals, pre-bundling) and Solid Start's own
plugin apply; entries through the documented `client.entry`/`server.entry`
only where the app has none; React apps get `@vitejs/plugin-react` /
`@rsbuild/plugin-react` unless the test gives it; the harness's own
`ssr.noExternal` and start entry are gone. Vue hosts add
`@vitejs/plugin-vue-jsx` (new devDependency). `compilerTransforms`, which
no public option takes, stays for the one implementation-lane file through
`outside-compiler-corpus/core-start-plugin.ts`.
- router-plugin: Rsbuild builds use `pluginReact()` instead of a hand SWC
config; Vite builds add the framework's Vite plugin (`@vitejs/plugin-react`,
`@vitejs/plugin-vue-jsx`), not added again when a test gives it; webpack
and Rspack Vue builds compile JSX with Vue's Babel plugin.
- react-start-rsc and the spc RSC warning app: `pluginReact()` instead of a
hand SWC config.
No count or pin changed (beetle, every lane).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
V-F validation of 88720e56a0: `expectValidModules` excused a dev module's
free name whenever the production build did not read that exact name, so
a compiler whose production output reads a different dangling name (e.g.
one that depends on the mode) passed 27 of 28 rows of
code-splitter-route-options (temporary compiler patch, reverted). The
escalation now also runs the build harness's own dangling-name check on
that production build (`describe('client')`, `DanglingNameError`), minus
the names the route file itself reads free; with the patch 22 of 28 rows
fail (the 6 others do not check modules), a G8-legal unused export with a
dangling read still passes.
`expectValidModules` reads the modules with the route file's language, so
code-splitter-scope's `.ts` row uses it instead of a direct module-alone
`getModuleErrors` (now decided on the production build like the others).
README: G8 sentence corrected, the remaining module-alone sites named.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Counts after F-F (four cells changed, with the reason), what F-F changed in
how tests reach the compilers (server fns by public URL, dev module graph
from Vite, G8 on the production build), the gaps the F-F audit found and
left open (hand-configured Start/framework options in the build and dev
harnesses, the webpack addHmr:false cell, a few option-object middleware
calls, a quiet-period settle), and the merged variant runner (patch set,
extra lanes, V4 rows). router-generator AGENTS.md: no expected snapshots.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RULES-AUDIT §3 item 7 (R11(2)): router-plugin `expectValidModules` judged
G8 with the per-module approximation (the module bundled alone with every
export kept), which rejects a dangling read in an export the real graph
drops (§5.6, §5.9).
The module-alone check still runs first (no build for a correct
compiler); a module with a free name is checked again against a
`vite build` of the same app (the generated route tree as input, as the
app's router reads it), and the name counts only if the production client
chunks still read it free. A route compiled with route HMR keeps the
module-alone check: its HMR code runs in dev on an update, and production
drops it.
ctu `ShippedModule.module` is optional: without it a free name counts
wherever the build still ships it, so generated code without mappings
(§5.14) cannot hide a dangling read; control added.
Checked with temporary compiler patches (reverted): an unread export with
a dangling read (G8-legal) failed at least 20 of 28 rows of
code-splitter-route-options before and passes now; a shipped, unmapped
dangling read (`Route.options.x = () => undeclared`) is still caught.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Criterion 5 re-audit fixes (no re-implementation; client semantics in a browser):
- ctu dev server `load()` follows Vite's own module graph (`importedModules`
of each served module: static and lazy imports, `import.meta.glob`)
instead of parsing the served code for static imports; a marker leaked
into a lazily imported module is now seen. The deprecated Node stand-in
`evaluateServed` (no caller left but its own controls) is deleted with
its controls. The perEnvironmentStartEndDuringDev pin requests the eager
modules itself, so it keeps reproducing "the client loads late.ts after
the server rendered".
- start-plugin-core: server fns are identified by their public `url`
(SPEC J4.1), never by Start's own `serverFnMeta` field (§5.19):
`serverFnId()` in the SSR prelude and `callServerFn()` (dev) derive the
id from the URL and the base `createClientRpc('').url` gives; a value
without a server fn URL throws outside any `try`. The #42-held rows'
reads (start-compiler-dev-server :58, known-bugs-start-compiler-dev
:166) stay as they are.
- Diagnostics by content: `suggestedDirections` reads a direction from the
API named or from an explained suggestion naming one environment (no verb
list); `expectAliasFailure` uses `explains` and the resolver's name (no
wording regexes); `expectSourceError` requires `explains`; the imported
route options refusal or warning names the option and explains (J2.8).
- router-plugin: the Rspack entry's `addHmr: false` is decided by
behaviour on an Rsbuild dev page (the edit reloads, not applied in
place) instead of a regex on today's local name `hot`; the out-of-order
dev pins re-request every module the page loaded from the route on (no
path filter, #29 class); the inert `vi.mock('node:url')` leftover in
code-splitter-determinism is gone.
- Hydrate source-map row reads the case's split code (`client.chunks`),
not lazy URLs under the case directory (§5.3).
- Nx: start-plugin-core `test:integration` builds `@tanstack/vue-start`
(its Vue rows failed in a fresh worktree).
- FINAL-PASS #58: bundled-dev-styles listens and fetches on 127.0.0.1.
- Dead helper `start-plugin-core/tests/source-maps.ts` removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fill the F-E-b placeholders with the final measurements:
- restructure matrix R1-R11: no acceptance failures outside the 7 R2
rows held by Q5/Q6/Q7; expected pin flips R3 x6, R8 x6, R9 x3
- V4 rounds 1+2: 90/90 reds caught, 34/34 valid greens clean
- stability: 9 unpatched runs, identical counts except one #42 row
- strict local budgets for all five packages, and the counts per lane
- caveats: pending rulings, upstream flakes #42 and #34, repeat
test-aware adversarial rounds after major changes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- SPEC §5.5 stated that parentheses around component-defining expressions
are not free, citing a ruling that does not exist. It now records the
open question: "Pending user ruling NEW-2: whether redundant parentheses
around component-defining expressions are free; they break React Fast
Refresh registration under SWC/Rsbuild." RULINGS ("parentheses around
components (pending: NEW-2)") and the README's pending-rulings table say
the same.
- KNOWN-BUGS: the property-write pin was listed under a line of its body
("await entry.mount('/display-name')") instead of its title.
- README: the pin forms include the `{ fails: true }` option.
- AGENTS: the compiler platform workflow runs only `test:implementation:unit`;
root test:pr/test:ci run the whole implementation lane.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Final pass F-E-a: listening dev servers bind 127.0.0.1 (#56, no family
selection for in-process clients), the strict import gate with an explicit
pending-ruling allowlist wired into root test:pr/test:ci, nx.json and the
compiler platform workflow, the rewritten oracle docs (README, RULINGS,
KNOWN-BUGS regenerated, SPEC, AGENTS), and cleanup of merged fork branches.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ctu dev server (#56): a listening Vite dev server binds 127.0.0.1, as
every other harness server. Vite's `localhost` names ::1 and 127.0.0.1
while it listens on ::1 only; Node's address-family selection gives the
first address 500 ms on the event loop's clock, so a worker blocked past
that abandoned the connection the kernel made and was refused at
127.0.0.1 ("no HMR connection" at host start under load). Control in
tests/integration/plugin-host.test.ts (blocks the loop after each
connection attempt; red with `localhost`, green with the fix). No retry.
- Import gate (#17): strict mode is a CI target (root test:pr/test:ci,
Nx target default, compiler platform workflow; the target exists in
every compiler package so `nx affected` runs it). Its only exceptions are
`pendingRulingAllowlist` entries (Q5 control, spc pending-rulings Q6/Q7,
and the legacy helpers only they reach); each names its ruling, an
allowlisted helper another test reaches fails, a stale entry fails.
Controls on the fixture workspace.
- Docs (#18, #52): oracle README (measured status with TODO(F-E-b)
placeholders, entry points, hosts, browser, diagnostics and severity,
lanes, gate, variant runner, pending rulings), RULINGS (severity floor,
explains, restructure rulings incl. R10 entry-last and R3 flips,
budgets, export-* pins, real requests, F1, out-of-scope findings,
parentheses around components, 127.0.0.1), KNOWN-BUGS regenerated from
the corpus pins (367 sites in 102 files) with the upstream list and
harness locations, SPEC (G5 severity/explains, §5.5 component parens,
§5.7 severity, J6.5 trace order, §8 entry points), ctu AGENTS.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Final pass F-B: speed and browser resources. A bounded run-page pool whose
runs leave their document before returning, per-test scope and per-file
env/cwd restore, leased dev servers (rp) and pooled Start hosts (spc),
`failWhenQuietFor` for edit waits, isolate: false; 13 rp and 5 spc page
files moved to `integration-pages`, over-limit files split. No retry for
#34 and no navigation retry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ctu browser: `runInPage` returns once its page left the run's
document. The page used to leave it after the run returned; a full
reload the dev server sent then (after the test's edit) started a
reload that outlived the page's way to `about:blank` and interrupted
the next run's navigation under load. The navigation retry that hid it
is gone. Control in tests/integration/browser.test.ts (a message the
dev server sends right after a run reaches no page; fails on the old
parking).
- rp known-bugs-code-splitter-bindings: served imports are compared by
path. On a host that served an earlier route with a file of the same
name, the dev server imports it with its HMR timestamp (`?t=`), and the
exact match missed it: the pin then passed.
- ctu build-harness: app removal no longer retries ENOTEMPTY (#34 is an
upstream Vite bug pending a ruling; its failures stay visible).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The client checks of the fast tiers run in real Chromium pages and dev
servers; that made router-plugin and start-plugin-core `test:unit` take
26-39 s against hard limits of 10 s and 8 s (FINAL-PASS #13, #19), and
Chromium failed module requests under load (#40).
- ctu browser: `runInPage` runs on a bounded pool of pages per test
process (`runPageLimit`), each run holding its page alone and the page
leaving the run's document before another run gets it; `openPage`
keeps at most `openPageLimit` pages open.
- ctu test-scope: the test a piece of work belongs to, also in concurrent
files (an `aroundEach` setup file); per-test cleanups use it instead of
Vitest's global `onTestFinished`. The setup file also gives each test
file the environment and working directory it started with (a
`vite build` of an earlier file left `NODE_ENV=production` behind).
- ctu outcome: `failWhenQuietFor` ends an edit wait once every host stayed
quiet without the outcome; route HMR pins fail after 3 s quiet instead
of the 15 s bound.
- router-plugin route apps: hosts leased to one test at a time and kept
for the test process; the fast tier and the new `integration-pages`
project run the tests of a file concurrently, keep modules across files.
Twelve route-app files move to `tests/integration/pages/`.
- start-plugin-core: Start hosts kept across the files of a worker, each
host with a pool of pages for concurrent runs (in-flight requests reset
on a new document: a hydrate pin waited 10 s on stale counts); five
`<Hydrate>`/import-forms files move to `tests/integration/pages/`.
- Files over the 15 s slow-tier limit split in two or three.
- ctu import-gate control on a fixture workspace of its own (#51).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Final pass F-E1: SSR scripts and dev-server calls run inside a real
request that Start's own server entry serves (tests/request-probe.ts: a
real router over the generated tree plus a probe server route);
testRequestContext() and its helpers are gone; each environment's bundler
warnings go through the app's own resolved onwarn.
Conflict in start-plugin-core tests/build-harness.ts (F-A2 structured
warnings vs F-E1 app onwarn): kept F-E1's onwarn routing, recording each
warning as F-A2's structured diagnostic (bundlerReports, 'warning').
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Final pass F-A2: structured build diagnostics (severity kept end to end;
rp rows that must warn ask for 'warning'), one shared global trap in ctu
(own-property probes, definitions, deletions; the `in` limitation
documented), the Hydrate chunk rule's empty-map fallback limited to case
modules, provenance observing Promise and per-environment plugins, the
isKnownBug class row and the G6 split-text map pin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ctu: BuildResult.warnings/consoleMessages and BuildError.warnings are
channel diagnostics with a severity (bundlerReports, statsDiagnostics);
a Vite logger error of a build that succeeds is reported as an error;
diagnosticsOf keeps a captured diagnostic's severity. Controls.
- rp build sites that must warn ask for severity 'warning'.
- ctu global-trap: shared G7 trap (reads, writes, own-property probes,
definitions, deletions) used by rp production-bundle and spc start-host;
rp asserts the no-router premise on the control page. Controls.
- rp route-app: provenance observes plugins given as Promises and returned
by applyToEnvironment. Controls.
- spc render: the Hydrate chunk rule's empty-map fallback walks the case
module's own graph only, and a module the dev server fails to serve is
never case code. Controls.
- Pins: a class only the unsplit loader reads, next to a split component
(isKnownBug row); the empty source map of a split text-only Hydrate
child (with control).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The build harness no longer hand-builds Start's request context
(`testRequestContext()`, Start's internal field names): every build's
server bundle is Start's own server entry over a real router whose route
tree has a probe server route, and `ssr.run` scripts run inside a request
for that route, which the server entry serves. The dev-server harness gets
the same (`startRequestFiles`, `inDevRequest`), and start-host shares the
probe (`request-probe.ts`).
React Vite builds get `@vitejs/plugin-react`, as in every React Start app,
and the build's warnings go through the app's own `onwarn` chain (its
"use client" silencing). Test apps whose `getRouter` returned a stand-in
object get a real router.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- integration/code-splitter-dead-code: `ping` held its marker as
`'MARK_PING_END'.length`, which every minifier folds, so "ping: nowhere"
passed even with ping kept (probe: ping kept through a global
assignment, the row stayed green on Vite, Rspack and webpack). The marker
is now `('MARK_PING_END' + Math.random()).length`; the same probe fails
on all three bundlers, the row is green on the compiler.
- code-splitter-imports-exports "are not copied into another option's
chunk": the presence check looked only in the notFoundComponent's split
code when it is lazy, rejecting a valid compiler whose chunk imports the
exported `NotFound` back from the route module. It now reads the eager
modules and the lazy ones together.
- oracle/RULINGS.md D9 said `assert` "comes out as `with`", contradicting
the reworded SPEC J2.17: the printed keyword is free.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Final pass F-D: router-plugin and router-generator severity floors, G7
production traps with a name-free globals comparison, route-app module
identity by provenance (wrapped load/transform of the public plugins), a
public webpack/Rspack server HMR host, D5 presence checks next to every
absence check, and SPEC J2.17/J4.17 reworded (printed keyword free).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"a module compiled under an id with another query keeps the server
boundary ids" rendered the route's lazy component, so the router code
splitter's `?tsr-split=component` module (whose map names the route file)
loaded after hydration started and satisfied the case-code chunk rule on
its own: with both boundaries `split={false}` the row still passed. Preload
the route component before rendering, as the router does; the same probe
now fails ("the case code the page requested once it hydrated: expected []
to not deeply equal []"), the row stays green on the compiler.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Final pass F-C (with F-A): start-plugin-core concepts restored (unresolvable
star export, Vue ClientOnly render, HTTP call by id), F1 pins for the six
location rows, #33a/#35 pins, G7 production traps, per-gate renderClient and
the case-code chunk rule, @vitejs/plugin-vue as a test devDependency (one
vite copy); F-A: actionable `explains`, the severity floor, exact carets,
idle HMR client, evaluate timeout, optional maps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Severity floor (#11, rg and rp side): the missing-Route warning (rg
known-bugs, generator-options logging, determinism) must be a warning
(the run goes on); the route-file upkeep reports must be a warning or an
error (refusal allowed); rp "left unsplit, reported" helpers and the
reported-fallback HMR helper must be warnings (the route works).
- J2.17 (#22): SPEC reworded: an `assert` import keeps working, the printed
keyword is free (no public host observes it); the behaviour rows stay.
- G7 outcome (#28): production pages trap the React Refresh globals, the
plugin-react ignored-exports hook and the router HMR globals before any app
module evaluates, assert none is touched, and compare the page's globals
with the control's; `addedCode` stays evidence only.
- route-app (#29): compiler-emitted modules are told by provenance (the
router plugin's own load/transform hooks, answered to the page by the dev
server), no longer by `/@fs/` or `/node_modules/` paths; controls for both
locations. The duplicate idle HMR client is gone (ctu hosts keep one).
- route-hmr (#30): the "webpack style, hot API present, no window" cell is
reached through a webpack/Rspack server build with HotModuleReplacement.
- D5 (#31): every absence check is paired with a presence check where the
code belongs; foldable markers replaced; the bindings table's loader-only
check is no longer vacuous; `stringValues` throws on parse errors;
generator-dev `scriptHolds` reads every script.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- factories: the unresolvable star export is a data: URL the bundler resolver gives no id for
- import-forms: Vue <ClientOnly> rows render on the server and the client (Vue's own JSX runtime)
- runtime-contract: HTTP call by id without client context (progressive-enhancement form post)
- hydrate pages: nested boundary behind its own gate (Vite and Rsbuild, source-loaded split)
- handler-scope isomorphic pin comment matches its red outcome
- drop the .cts dev pin and the # directory build pin (Vite upstream)
- @vitejs/plugin-vue test-only devDependency; Vue SFC pin on the public host
- production page trap for development-only globals (G7 behaviour)
- severity floor for array-shaped channel diagnostics and failed-build text
- render.ts: case-owned chunks, per-gate control; start-host warm-up on outcome
- excludeFiles dependency contrast (two pins), silent mock side effects, export-cache pins made deterministic
- the three flagged unit files moved out of the corpus; outside-root server fn row
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- explains: require an actionable cause: the category in the diagnostic's
own words (internal-representation words and internal-error reports do
not count), plus the API it names or guidance (#3)
- merged-channel matchers: severity floor by default, warning or error; an
info line meets only an expectation that asks for info (#11)
- positions: no ±1 caret tolerance; a caret one column left is the
character before (#12, F1)
- plugin host: client hosts keep an idle HMR client connected, so a full
reload sent between runs is not handed to the next run's page (#21)
- runInPage: the import and script are bounded by the run's timeout (#21)
- describeBuild: a chunk without a source map file is described without a
map (#21)
- openPage: document that a given document is not for HMR checks (#16)
- git-ignore packages/*/tests/**/.start-*/ (#26)
Each change has a control that fails on the old behaviour.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repair B3: Start integration and import-protection tests on the built,
whole public Start plugin (Rsbuild loader shim deleted; integration and
implementation targets depend on the package's own build), a semantic
import-protection report reader over the merged channel, the internal IP
unit tests moved to outside-compiler-corpus with their concepts rerouted
into five public-plugin corpus files, the F2 importer-file pin and the
skipped-RSC-warning delivery pins. No conflicts with B1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- code-splitter-imports-exports "splits default, named and namespace
specifiers between the modules": the old import inventory was the only
check that the helpers only a split component reads (and the default,
named and namespace imports they read) leave the route module. The D5
markers sat on the components' JSX only. Markers in getDefault,
getTarget and getNamespaced: absent from every module that loads with
the route, present in what loading their component loads.
- known-bugs-route-hmr-bindings (G15 Map pin): the injected bookkeeping is
built by the first route module the page evaluates, which in an app is
the root route (the route tree imports it first). The pin's route was an
index route, red only because the harness imports it before the tree.
The route file is now the app's root; the stub is a map widget's class
named Map (immutable's Map has `set`, so it would not throw). Still red:
"tsrReactRefresh.ignoredExportsById.set is not a function"; control
green.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repair B1: router-plugin tests on the public route app (composed
tanstackRouter + the framework's Vite plugin on the A2 host, routes
registered by the real generator, client checks in Chromium); D5 marker and
request checks instead of declaration/import inventories; addedCode as
evidence (N18); updater concepts on a live page
(integration/route-hmr-browser-updates); the old Node harness in
outside-compiler-corpus/legacy; the G15 Map pin. The Q5 control is
unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- hydrate-split-modules: SPEC J5.2, a nested boundary has split code of
its own behind its own gate. The reroute dropped the chunk-count proxy
(old :613/:632) with nothing in its place. New row: outer load() gate,
inner never() gate; the outer children's module loads lazily, the inner
one does not. Green on the compiler; a probe with the inner boundary
unsplit (split={false}) fails it. The two old rows' titles no longer
claim "loaded from the source code alone".
- start-host serverLoads(): a module the SSR environment cannot compile
gave an empty graph, so not.toContain checks passed vacuously (e.g.
known-bugs-start-compiler "ssr: a declaration only a client-only fn
reads is not loaded"). It now transforms the module first and rejects on
a failure, as loads() does.
- start-compiler-factories "calls .handler() on an object that is not a
server fn": back to importing './secret.server' (the old input; import
protection is off on this host), so a compiler that strips server-only
file imports from the client is caught again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repair B2: the start-plugin-core compiler and <Hydrate> tests run on the
public Start host (built tanstackStart() in real Vite, client code in
Chromium, calls through Start's server entry, production build + preview);
render.ts hydrates in Chromium against the uncompiled source on a plain
Vite host; the legacy internal helpers live in outside-compiler-corpus/legacy
for implementation tests and pending-ruling rows; F1 code-frame and R8
outcome pins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: known-bugs-start-compiler-dev.test.ts keeps B3's rewrite (no
regression-helpers import); analysis.survival.test.ts (B3 moved
analysis.usage out of the corpus) imports the legacy helpers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the spc build harness records through withBuildEnvironment's channel
(its async scope and claimed app root), Rsbuild's logger through
rsbuildLogger, each compilation report once at an early done stage
- the violation reader reads only warnings and errors of a channel
(ruling 2026-10-21, diagnostic severity)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes the R10 (dev.test factory re-export trace) and R7 (extra generic
frame, short compile error naming the importer) rows of the beetle matrix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fixed-name pins (createClientRpc/createSsrRpc/createServerRpc, opts) stay
(valid user input, N14) but a compiler that only renames its generated
bindings passes them (R3); the adaptive pin keeps that bug class red.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
B5 (RSC oracle repair, noncompiler lanes for react-start-rsc and
start-plugin-core, scoped capture) with the capture redesign: Rsbuild's
logger read through its public customLogger, the page's HMR client silent
again, native-callback output attributed by claimed app root (else shared,
marked), and each compilation report recorded once. No conflicts with B4;
the import gate's selection equals the acceptance lanes of every package
(213 files, compared with the Vitest file lists).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- delete the Rsbuild loader shim; test:integration builds the package and
imports its built public entries (externalized: one module instance with
the loaders Rspack loads)
- harnesses: whole public Start plugin only (no internal compiler/IP
registrations), explicit documented entries, public runWithStartContext,
configured entry names, one merged diagnostic channel (StartBuild /
StartBuildError diagnostics)
- violation-report: semantic reader of the J6.5 content (no label grammar,
order, numbering or entry marker; entry-last allowed)
- unit import-protection internals tests moved out; their concepts rerouted
into new public-plugin corpus files
- S6/S7 move-outs, splits and watch-list pins; F2 pinned; skipped-RSC
warning delivery pinned (Vite and Rsbuild dev)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
B5 raised the Rsbuild hosts' logLevel to 'warn' so Rsbuild-logger warnings
reached the merged channel. That also raised the HMR client's log level
(Rsbuild ties dev.client.logLevel to logLevel), so pages logged Rsbuild's
own messages. And with output printed outside any async scope sent to every
open sink (b2857ec92e), Rsbuild's logger re-printed each compile's errors
and warnings ("Build errors: ...", "build failed in 0.12s") next to the
compilation's own report: 1 ctu and 19 spc integration failures.
- Rsbuild hosts: logLevel and dev.client.logLevel are 'silent' again (the
terminal and the page stay quiet); a customLogger (rsbuildLogger, from
Rsbuild's public createLogger) records Rsbuild's and the plugins'
warnings and errors in the channel, source 'rsbuild'.
- Compilation reports are recorded once, from the compilation, at an early
`done` stage (the build host moved off onAfterBuild). reportLogged drops a
logger message that quotes a recorded compilation message, and the
status line of a compile that failed (a one-line error naming no file,
in the same turn as that compile's report). Anything else is recorded.
- Output printed outside any async scope (Rolldown and Rspack native
callbacks) goes to the channel whose claimed app root it names (hosts,
dev servers and bundleApp claim theirs), else to all open sinks when they
are one line of nested work, else to every open sink marked `shared`
(expectNoProblems says so).
- budget-reporter.test.ts: concurrent tests clean up through their own
context's onTestFinished (the global one may delete another running
test's fixture).
Controls (each red on the old behaviour named):
- native-hook-capture.test.ts: native-callback console.warn on Vite build,
withBuildEnvironment, Rsbuild dev and build, and "nothing reported" fails
for it (red on B5's capture); concurrent Vite builds, Rsbuild dev servers
and builds keep output naming their app and share unattributed output
marked `shared` (red on B5's capture and on b2857ec92e's send-to-all).
- rsbuild-plugin-host.test.ts: a compilation warning and error appear once
on dev and build hosts (red without the dedup; the error rows also
without the status-line rule).
- browser.test.ts: Rsbuild's HMR client prints nothing in the page, a
compile warning included (red with the client at B5's 'warn').
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
B4 replaced the singleton import set of "the route tree imports its runtime
from @tanstack/<target>-router" with runtime checks that only read user
files (the root route, the lazy route file). A generator that imports the
tree's own `createFileRoute` from another framework's router then passed
the whole fast tier (mutant: solid target with react-router's package;
only integration route-types caught it). Assert that the route the tree
creates for a lazy-only route is an instance of the target package's
`Route`: red on that mutant, green on the generator.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repair B4: a public generator consumer host (Vite's module runner with the
real router/renderer packages, Chromium for client behaviour), the mixed
router-generator tests split (concept kept, layout/spelling dropped), ten
fixed-input controls moved to outside-compiler-corpus, and the `types`
project's program limited to acceptance tests (implementation files are
typechecked by test:implementation).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
render.ts renders <Hydrate> modules through the dev Start host: server
render in the SSR environment (react-dom/static), real hydrateRoot of that
HTML in Chromium with every gate opened, the uncompiled source rendered by a
plain Vite + React host as the reference, and semantic (normalized DOM)
comparison instead of byte HTML. Loads come from the page's resource timing;
chunk counts and ids are no longer asserted (N13). The rejection matcher
control moves outside the corpus.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
B5 scoped console capture with AsyncLocalStorage and dropped output printed
outside any scope. Rolldown calls a Vite build's plugin hooks, and Rspack
its compiler/compilation hooks (other than loaders, which B5 re-enters),
from native code without Node's async context, so a compiler's
console.warn there was printed to the real console and lost to every
channel: plugin-host Vite builds, Rsbuild dev and build hosts, and
withBuildEnvironment (also Vite's default-logger warnings), which makes
"nothing reported" checks such as rsc-start-build's "production ... without
development warnings" vacuous for build-time output. The 00317474fd
capture recorded all of these.
Output printed in a scope still goes to that scope's sinks only; output
printed outside any scope now goes to every sink, as before B5.
New controls in tests/integration/native-hook-capture.test.ts: 4/4 red on
B5's console-hook, green now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repair B5: rsc-css-diagnostics through the real Start/RSC dev servers
(Vite, Rsbuild) and the merged channel; the private-server-fn pin through
the public `.url` and caller; the 49 RSC runtime tests and 17 Start
B-other files in a separately selected `test:noncompiler` lane (root
test:pr/test:ci, compiler platform workflow); async-scoped console
capture; the Rsbuild hosts' logger reaches the channel; the two
SYNTHESIS-listed duplicates deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Corpus rows run on tanstackStart() in a real dev server, a Chromium page and
Start's real server entry: real case files instead of stubs, client RPC and
in-request SSR calls instead of the provider/report harness, explains instead
of closed cause lists, an outcome R8 pin. Harness controls and internal-compiler
rows moved to outside-compiler-corpus/, Q6/Q7 and the Vue SFC pin moved
unchanged to pending-rulings/, build-mode export-cache rows to integration
(regression tests: a real build does not reproduce the pin). New pin: a dev
edit of a re-export chain's factory module leaves its importer stale.
Start host: links option, optimized-deps package names in loads, navigation
detection on page runs, build-mode case globs that skip denied files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reroute createServerFn/** through tanstackStart() in a real dev server
(client in Chromium, by-id calls through Start's server entry, server calls
in real requests); build-only rows to integration/start-compiler-build-ids
(vite build + Start's preview server); matcher controls out of the corpus;
the Q6 row moved unchanged to pending-rulings. New pins: a virtual factory
module served by exact id fails in dev; a .cts server fn fails in dev; a
server fn under a '#' directory fails to build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Capture all reporting channels and validate diagnostic determinism by a real missing-export probe. Wait for visible browser output through the shared outcome helper, with a public Vue async-component regression.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Route modules run where a dev server runs them: a real page (Vite's hot
API, React Refresh, the real router) or the SSR module runner, plus
Rsbuild hosts for webpack's hot API and a page without one. addHmr: false
is judged by the edit's outcome on a live router; production rows are
decided on the bundle (build-production*). The hot-collision pins probe
the names the HMR compile introduces, not one spelling. Route module
export helpers run in the page with the dev server's TypeScript defaults.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the public Start plugins for RSC acceptance tests and exercise CSS
warnings through real dev servers and merged diagnostics. Retain runtime
and build-plumbing tests in a separately selected CI lane.
Scope diagnostic captures to each app's async work, including native
Rspack loaders, and retain Rsbuild logger warnings. Add regression controls
for capture ownership, warning transport, lane selection, and budgets.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Takes B1's route-app (stamped app() URLs, package stubs in the host key,
frameworkPluginOptions); keeps F3's additive pageScript and pageDiagnostics.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
route-app: additive options framework, config, pageScript; an app with
node_modules files gets its own host; app(file) goes through the route's
entry module (a stub edited for an earlier route is imported with its HMR
timestamp by the route); pageDiagnostics reads the page's console.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- route-hmr-page: public getConfig, app-scoped process warnings (async
context of the app's dev server), app-owned router reference
- production bundles: purpose-based dev-only absence (public dev APIs,
route module exports vs the control); addedCode as inspection evidence
- dev source maps: executed throws mapped through served maps
- build-frameworks: framework isolation by resolved package provenance
- generator dev app: outcome-based page settle, merged channel,
binding-aware createFileRoute, decoded markers; watcher handle
inventories moved out of the corpus
- moves: lazyFn this (runtime), harness and tool controls
- fix-agnostic split-id directory pin; R7/R9 couplings rerouted
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use public router and renderer imports, fixture-owned source identity, and Chromium consumer coverage. Separate implementation controls and typechecking, preserve source-edit assertions, and repair mixed checks and pin fixtures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WIP base of workstream B2: tests/start-host.ts drives tanstackStart() of the
built framework package in a real Vite dev server with a Chromium page and
Start's real server entry; regression-helpers.ts and diagnostics.ts rebuilt on
it; the old StartCompiler-based helpers moved to outside-compiler-corpus/legacy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
recordViteModules keyed each module by its file (query stripped), so one
file served as several modules (a split route, `a.js` and `a.js?split`)
kept only the last module's code. A dangling read in the reference module
was then attributed to nothing and excused by the binding the split module
keeps: the shipped client code `var e=()=>lostFoo` passed the Vite check,
which the 1c4c5218dc harness (every free read counts) rejected. Key by the
module id, query included, as webpack/Rspack's `module.resource` does; a
module with a query has no file of its own and counts as virtual.
New control in the Vite block of build-harness.test.ts; red on the
query-stripping recorder, green now. Also: the deprecation note of
`evaluateServed` points to `runClient` (`./plugin-host`) / `runInPage`
(`./browser`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repair A2: public in-process plugin hosts (Vite, Rsbuild), a strict
module runner for named imports, one merged diagnostic channel, dangling-name
attribution from recorded module code, and outcome-bounded settling (incl.
router-plugin's route-hmr-page). No textual conflicts; ctu AGENTS.md keeps
both A1's import gate and A2's helper guide.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repair workstream A2, the shared foundation of the compiler oracle repair:
- plugin-host / rsbuild-plugin-host: the public plugin array a user
configures, driven in process through real Vite (middleware dev server,
module runner, vite build) and Rsbuild's JavaScript API; no hook
recorder, module id, query or route registration.
- strict-runner: Vite's own module runner with ES named-import linking for
the app's modules (a missing import throws instead of reading undefined).
- browser runInPage: one Chromium page per test process for fast client
checks on served modules, with the real Vite client.
- diagnostic-channel + console-hook: console, process streams, Vite logger
and bundler compilations merged and scoped; the Vite and Rsbuild dev
harnesses expose it; expectNoProblems reads every channel.
- diagnostics: per-spelling column bases, positions tied to the named
file, semantic env-restriction reading, content-based explains (the
closed causes list is deprecated).
- build-harness dangling-name check: attribution by the build's recorded
module code (any transform, built-ins included), not by printed module
headers; works minified.
- validate-module: env-aware globals and real-build evidence.
- outcome / dev harnesses: edits settle on their bounded outcome; no
compile, round or update counts, no dependency-membership rule, no grace
period (router-plugin route-hmr-page moved to it).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The status now also names the diagnostics read through today's report
format (289 cases fail on rewording alone) and the selected tests that do
not test a compiler (about a quarter of the declarations), so "the
exceptions the status describes" is complete. The restructures were meant
to keep behaviour; the 1,893 count excludes the few that changed it. The
gate's header cites the README section by its current name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Repair A1: the oracle README and ctu AGENTS.md state that the suite is not
yet an oracle, give the implementer rule, and add the mechanical import gate
(test:import-gate report mode, test:import-gate:strict) with its control.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The oracle README and the package AGENTS.md claimed the suite uses no
copies of tools and is a validated oracle. Neither holds today: many
acceptance tests reach the compilers through internal modules, ids and
helpers (44% of test cases failed under behaviour-preserving
restructures), several helpers re-implement tool or runtime behaviour,
and some client checks run in Node. The docs now say so, say a repair is
in progress, and tell implementers to adapt only the harness entry points
until it lands.
src/import-gate.ts lists every import of a router-generator,
router-plugin, start-plugin-core, react-start-rsc or router-utils
internal (anything not reachable through the package's exports map) in
the acceptance test files and the helpers they reach. test:import-gate
reports and exits 0; test:import-gate:strict exits 1. Its control plants
files in memory next to router-plugin's real tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
packages/compiler-test-utils/oracle/ explains the compiler test oracle to
whoever replaces or rewrites a compiler:
- SPEC.md: the spec the tests cite (G rules, J1-J7 clauses, §5 freedoms,
§8 checking rules), with the maintainers' rulings folded in.
- RULINGS.md: the decisions behind the clauses, and the authorized test
workarounds for upstream bugs with when to remove them.
- KNOWN-BUGS.md: the .fails pins by compiler job, generated from the
tests, and the upstream issues.
- README.md: the goal, where each job's tests live, corpus vs
implementation tests, pins, and how the suite was validated.
The package AGENTS.md files point to it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A project module re-exports createServerOnlyFn and createClientOnlyFn under
new names, and a module calls them as members of a namespace import of it
(SPEC J4.5, J4.10, J4.12). Outcome rows, in process for React, Solid and
Vue, and in real Vite and Rsbuild builds: the other environment neither
loads nor runs the implementation, and the owning one runs it.
- Next to a server fn: passing. Before these rows, no corpus test caught a
compiler that skips namespace receivers.
- Alone in its module: pinned. The bundler plugins pick modules by their
text, so a module that names no factory is left untransformed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's #8758 no longer treats `receiver.method()` on a named import as a
Start factory candidate, so the Vite dev client compiler no longer loads
`zod` from inside the transform for `z.object({})` with an empty dependency
cache. That row passes now and becomes a regression test.
The bug the pin described remains for a call of the import itself
(`import { object } from 'zod'; object({})`), which #8758 does not skip.
It is pinned in its place, verified red without .fails: "expected 'hang'
not to be 'hang'". zod 4.5.4 exports `object` by name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in #8748, #8750, #8758 (start-plugin-core) and two CI changes.
No textual conflicts; product source is main's.
Main's new tests are implementation tests, so they move under
outside-compiler-corpus/ (packages/compiler-test-utils/AGENTS.md):
- compiler.test.ts "top-level member calls" (#8758) counts resolved and
loaded modules and reads printed code. It moves unchanged to
tests/outside-compiler-corpus/compiler-member-call-receivers.test.ts with
main's getDefaultTestOptions helper, which this branch's compiler.test.ts
no longer has (the auto-merged file did not type-check).
- tests/rsbuild/server-fn-resolver-rebuild.test.ts (#8750) counts resolver
rebuilds through internal helpers and a stand-in compiler. It moves to
tests/outside-compiler-corpus/rsbuild/.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W6-restore (DECISIONS 2026-10-20 "restore the two borderline corpus
removals"): the top-level block placement (J4.6) and the unrecognised
call shapes `['handler']` / `['server']` / `.bind(null)` (J4.5/J4.12)
are back as fix-agnostic pins (work, or fail clearly at the call; never
a silent leak or broken output) at unit and build level, plus the
createServerOnlyFn local-alias block row; string export names are
required to work (J4.5 re-exports). Tests only; no conflicts.
Validated (Nx, --skip-nx-cache, --maxWorkers=4): spc types/eslint
pass, unit 932/196 (1128), integration 850/212 (1062) x2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W6-flakes, the two spc integration flakes that aborted W6-scope's
first merge: runViteClient reads the Vite fixture's entry, uncaught
load errors and the script result in one evaluation of the current
document (a buffered full-reload landing between the wait and a
separate evaluate ran the script in a loading document); the I09
marker-exemption pin opens with the orders where the other importer is
nearer the entry, red on Vite and Rsbuild in every build, then the
racy orders. Tests only; no conflicts.
Validated (Nx, --skip-nx-cache, --maxWorkers=4; load 6-18, no
unhandled error): spc types/eslint pass, unit 931/189, integration
848/202 x3 clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coordinator follow-ups 2026-10-20:
- String export names (U047/U048) are a re-export form SPEC J4.5 lists
as recognised: the factories row and the build rows (Vite, Rsbuild)
now require support, with no rejection branch. Green on main; the
Start-compiler green V4 patches (green-sol 05/10/11/12, r2 08/09/10)
stay clean.
- KB "a createServerOnlyFn local alias called in a top-level block works
in each environment, or is rejected at the call" restores the row
deleted in a945fe4563 (J4.6 "block"). Either outcome: client throws the
server-only error without loading ./db.server and SSR runs it, or a
positioned compile error naming createServerOnlyFn/so with a placement
or call-shape cause. Pin, red on main: forbidden module ./db.server
loaded on the client (left untransformed). Control: the same check
passes for a top-level createServerOnlyFn. tsc 7.0.2 accepts the input.
The call-shape check is now a shared function (expectWorksOrRejectedAtCall).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mock-mode marker-exemption pin (V1R ip I09) passed on Vite in roughly
one run in 12: Vite mocks the other importer's import of a server-only-
marked module only when the marked module's marker import was resolved
first, which the exempt importer can cause, so the outcome is a race of
the build. Measured (loaded, 40 builds each): importers side by side leak
in 56/80, the exempt importer nearer the entry in 2/40, the other importer
nearer the entry in 80/80. Rsbuild mocks the exempt importer in every
order (50/50).
The pin now starts with the other importer nearer the entry (through
`src/mid-ignored.ts`, both export orders), so it is red on both bundlers
in every build, and keeps the racy orders after it, so it passes only once
no order leaks. No passing control for the other order: it leaks too in a
few Vite builds. The assertion is unchanged.
Red without `.fails`: Vite `other: 'MARK_SECRET'` (leak), Rsbuild
`ignored: 'a safe mock'`. 30/30 loaded runs (load 18-23): 2 expected fail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`runViteClient` waited for `__ipEntry`, waited a turn (`settled`), then
read `window.__ipEntry` and ran the script in a separate evaluation. Vite
keeps a `full-reload` sent while no page is connected (an edit between two
runs, the dependency optimizer) and delivers it to the next page on
connect; when that reload landed after `settled` and before the evaluation,
the script ran in the new, still loading document: `globalThis.app` was
undefined and the v2-edits Vite dev rows failed with
"Cannot read properties of undefined (reading 'clientSide')".
Reproduced by waiting for a late navigation before the evaluation (3 of 8
runs failed with that error).
The fixture page now signals when its entry settled (`ip-entry` event), and
one evaluation waits for the current document's entry, waits a turn, checks
the errors the page did not catch while it loaded, runs the script and
returns its logs: every value comes from one document, and a reload during
it destroys the context, which alone is retried. Load errors, uncaught
load-time errors and script errors still fail immediately. No timers.
v2-edits.test.ts: 30/30 loaded runs (load 11-29) pass; with an injected
wait for a late reload before the evaluation, 8/8 pass (17 late reloads).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
User ruling 2026-10-20 ("restore the two borderline corpus removals"):
- U082/U086 (SPEC J4.6 "block"): placement "a block at the module top
level" in createServerFn/placements.ts (a declarator below the top
level). It joins the KB pins "with $head imported, a createServerFn in
$name does not ship its handler to the client" (expectNoClientHandler:
works through an RPC that reaches the handler, or a positioned compile
error naming createServerFn with a placement cause). Red on main:
createServerFn alone -> the client loads ./db.server (left
untransformed); another factory -> the provider exports
`inner_createServerFn_handler`, which it never declares. The loosened
declaration-sites regression and the KB "rejected at the call" pin now
leave declarators out (same set as before; the block's bug is the
declarator one, pinned above).
- U078-U081 (SPEC J4.5/J4.12): KB unit pin "$name: the client holds no
server code, or the module is rejected at the call" for
createServerFn()['handler'], createMiddleware()['server'],
createIsomorphicFn()['server'] and createServerOnlyFn(...).bind(null).
Each output rejects at the call (expectCompileError + callShapeCauses)
or follows its contract (no ./db.server load, no server code, RPC
reaches the handler / client impl / env restriction, SSR runs it).
Red on main for all four: forbidden module ./db.server loaded (every
output left untransformed). Control: the static-member forms pass the
same check.
- U047/U048 string export names: factories "builders re-exported under
string export names are recognised, or rejected clearly" (green).
- Build level: integration/start-build-call-shapes.test.ts, Vite and
Rsbuild, one shared build per bundler (each shape rebuilt alone if the
shared build fails). Works (client bundle 'nowhere', client behaviour,
SSR call by id) or a build error naming the shape's file and line
(expectSourceError). 5 pins per bundler red on main: server-only module
'eager' in the client bundle; string export names green. Controls:
static forms pass all 12; a position-less compile error is refused.
tsc 7.0.2 against the real start-client-core declarations accepts every
restored input (computed members, .bind(null), string export names, the
top-level block).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W6-scope: runtime bugs are out of the compiler corpus (DECISIONS
2026-10-20): the visible() HydrationBoundary pin (react-start-client
runtime) and its fixture are dropped; the Rsbuild unsplit Solid route
HMR pin now names its compiler cause (router-plugin
src/core/hmr/webpack-adapter.ts:71, `hot.data ??= {}` before
solid-refresh's $$refresh). Tests only; no conflicts.
Validated on the identical staged merge (Nx, --skip-nx-cache,
--maxWorkers=4): spc unit 931/189; rp integration 355/193; spc
integration 848/202 apart from two pre-existing flakes in untouched
files (ip build marker-exemption pin; v2-edits runViteClient race),
tracked and fixed separately (coordinator ruling: not blocking).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The webpack-style route HMR code runs before Solid Refresh's $$refresh in
the route module and assigns `hot.data ??= {}` on the first run; Solid
Refresh 0.6.3 reads a truthy hot.data as a previous run, so its dispose
saves no registry and the next update cannot patch the live component.
A probe that reads hot.data without assigning it (webpack-adapter.ts:71,
reverted) makes the pin pass; a plain Solid component module on Rsbuild
and the same route on Vite already apply in place. The pin stays: the
cause is in router-plugin's emitted HMR code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pin "a visible boundary next to a slow effect shows its fallback, then
the children, without an error" fails because of react-start-client's
HydrationBoundary (src/hydration/visible.tsx: use() only while the gate is
closed, then a hook), a runtime component the compilers do not emit. Per
the ruling that bugs outside the compilers do not belong in the corpus,
the test and its fixture are removed; the bug is tracked as a runtime
follow-up. The client-mount fallback rows keep their J5.3 assertions; their
comment now names the runtime bug instead of the pin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W5-flakes, the three V4 round-3 flakes: a ctu Vite build ends once
every plugin hook it started has settled (the route generator's late
configResolved rename raced dispose()); the rp generator dev app also
waits for the page's HMR client (vite:afterUpdate, as route-hmr-page)
and no longer reads failed script responses (Playwright's refetch was a
late report of the broken version); a new spc product-bug pin for
react-start-client's visible() boundary (conditional use() vs React's
replay), on Vite and Rsbuild, with the 13 client-mount rows mounting
below the fold and scrolling once idle (assertions unchanged).
Validated (Nx, --skip-nx-cache, --maxWorkers=4; no unhandled error):
ctu 250, 111 x2; rp 445/179, 355/193 x2; spc 931/189, 848/204 x2;
rsc 108/11; rg 60/3; types and eslint pass for ctu, rp, spc.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The V4 round-3 flake of "a direct fallback with split={false} shows, then
the children" (React: "There was an error during concurrent rendering but
React was able to recover…") is a product bug, not a harness race. The
cause is "Update hook called on initial render" in react-start-client's
visible.tsx HydrationBoundary: use() is called only while the gate is
closed, then useEffect. When the IntersectionObserver opens the gate
between a concurrent render that suspended there and React's replay, the
replay skips use() (react.dev/errors/607). Reproduced with CDP CPU
throttling 20x (each run had 1-4 of the client-mount rows failing), and
deterministically from user code with an effect of 40 ms next to the
boundary.
- New pin (Vite + Rsbuild): "a visible boundary next to a slow effect shows
its fallback, then the children, without an error". The page mounts the
boundary nine times. Verified red without .fails (18/18 mounts report the
error), green with a probe fix (hook above the conditional use(),
reverted), and red in 30/30 runs at load ~31 with 6x throttling, 6/6 at
20x.
- The client-mount rows (J5.3, the compiler keeps the fallback) mount the
page below the fold and scroll to the boundary once the page is idle
(requestIdleCallback), so they no longer race that bug. All assertions
are unchanged. 30/30 clean at 20x throttling and 10/10 at load ~30.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"a route file broken by an edit is reported, and fixing it brings the
route back" (Vite) failed once at load ~37 with an error after the fixing
edit's mark. The error is Vite's transform error for the broken content
(`export const Route = (`): a stale report of the earlier version, not an
error about the fixed file. Two harness causes, both reproduced (a timing
probe made the test fail 3/3 before, pass 3/3 after):
- settle() returned once Vite handled the file event, before the page's
HMR client fetched the updated module; that fetch's transform error could
be logged after the next mark. On Vite, settle() now also waits until the
page handled every update the server sent (vite:afterUpdate, which Vite's
client emits after the fetch, failed or not), received invalidations
were answered, or a full reload loaded the page (same signals as
route-hmr-page.ts).
- The record of loaded scripts read every script response's body; for a
500 response Chromium keeps no body and Playwright refetches it
(Network.loadNetworkResource), a late request of the harness's own that
Vite transformed and reported again. Error responses are now skipped
(they ran no code).
30 loaded runs of dev-server-new-routes.test.ts (load ~31): 0 failures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite runs the plugins' configResolved hooks with Promise.all. In the
plugin-order rows of router-plugin's code-splitter-pragmas integration test
(a framework JSX plugin before the router plugin), the code splitter's hook
throws while the route generator's still runs: the build rejects, the
harness disposes the app, and the generator then renames routeTree.gen.ts
into the directory being removed (ENOTEMPTY when it lands between rm's
readdir and rmdir; ENOENT, printed to stderr, when it lands after). Before:
2 late renames in every run of the file (3/3 checked); after: none in 30
loaded runs.
buildWithVite now wraps each hook of the plain plugin objects it is given
to record the promise it returns, and waits for them all (also when the
build failed) before it returns or throws. The late write also no longer
prints into a later build's console capture.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W5-fixup: react-start-rsc test:unit depends on
@tanstack/react-start-client:build (no Nx cycle); the budget reporter
treats a run with a failed or unloaded file, an unhandled error or an
interruption as no measurement (strict mode exits 1, report-only says
so), with a real-Vitest-CLI control. Tests and test config only.
Validated (Nx, --skip-nx-cache, --maxWorkers=4): ctu types/eslint pass,
unit 250, integration 111; rsc unit 50/1, integration 108/11;
rp unit 445/179 and spc unit 931/189 (no "not a measurement" misfire).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A run in which a test file failed (a failed test or a file that did not
load), an error escaped the tests, or the run was interrupted leaves out
or cuts short the failed work, so its time is not a measurement. Strict
mode now fails it as an invalid measurement instead of printing "passed";
report-only mode says its times are not a measurement. Control:
tests/integration/budget-reporter.test.ts drives the real Vitest CLI on a
fixture tier (verified red against the previous reporter).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/rsc-css-diagnostics.test.ts imports start-plugin-core's
tests/regression-helpers, which renders with the built
@tanstack/react-start-client. react-start-rsc's test:unit only had ^build,
so it failed in a fresh checkout. Declare the build like start-plugin-core
does for its own test:unit. test:integration already reaches it through
@tanstack/react-start:build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W5-final: ctu waits for Vite's full-bundle initialBuildCompleted before
closing a bundledDev server (user-authorized harness wait, FOLLOWUPS
"UPSTREAM (W5-ip)", remove once Vite handles the rejection);
importedBindingUses counts only runtime, unshadowed references; pin
Source lines name product file:lines; the MDX control's genuine use is
7:27 (`secret`), not 7:24 (`=>`); the ctu Rsbuild harness starts on
predated initial files and attributes compiles to an edit by file state
(DECISIONS 2026-10-20 "Rsbuild first-edit harness fixes", A/B); the
resolve-elsewhere row asserts per ruling C. Tests only; no conflicts.
Final validation of the whole corpus (Nx, --skip-nx-cache,
--maxWorkers=4, integration gate; load 1-8; no unhandled error):
ctu 250, 108 x2; spc 931/189, 848/202 x2, impl 246/7; rsc 50/1,
108/11 x2; rp 445/179, 355/193 x2, impl 53; rg 270/30, 60/3,
impl 81/2; types and eslint pass for ctu, spc, rsc, rp.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ruling DECISIONS 2026-10-20 "Rsbuild first-edit harness fixes" (C): moving
src/lib.ts to src/lib/index.ts in one edit passes through a state where
./lib resolves nowhere, which Rsbuild (aggregateTimeout 0) may compile and
report with no resolved path. The row now asserts that the new target is
reported last, that only undefined reports precede it since the edit, and
that no report from then on names src/lib.ts. A resolve cache serving the
old target (the R4 mutation) still fails it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ruling DECISIONS 2026-10-20 "Rsbuild first-edit harness fixes" (A, B):
- The app's initial files are dated 10 s back before the dev server starts,
as files on a user's disk are. Written a moment before the first compile,
they fell within watchpack's mtime accuracy, its first scan reported them
changed and Rspack started a second compile by itself, during a test's
first edit: a removal landing then was lost (FOLLOWUPS "UPSTREAM
(W3-harness2)"), and the edit's wait counted that compile.
- trackCompiles counts a compile toward an edited file only if, when it
started, the file was no longer as before the edit (contents or mtime).
A compile that started before the write no longer ends the wait. (Per
file, not "after the edit's last write": a compile the edit's first write
starts mid-edit legitimately compiles that write.)
Controls (ctu integration), each failing on the old harness: the initial
files predate the first compile by more than 2 s; a compile held in
watchRun from before the edit's write does not end its wait (also fails
with only the mtime fix).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`inPage` named the use of `secret` in `export const read = () => secret() +
leak()` as 7:24, which is `=>`; `secret` starts at column 27. A temporary
probe that let the import-protection transform cache record `.mdx` (reverted)
made the plugin report src/page.mdx:7:27, which the passing control rejected:
the corpus would have failed a correct fix. The control now passes under the
probe. The MDX location pin's Source also notes that, once located, the report
is logged twice (as written and as the resolved path): the pinned "'once' logs
one warning for one import" bug, which that pin also needs fixed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rsc "dev explains the CSS limitation once per source file…" and "a false
ternary stream carries its selected badge CSS" pins and the Vite MDX location
pin cited decisions or SYNTH items; their Source now names the product
file:line of the cause. Comments only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SPEC J6.5 never accepts an erased type position, and a same-name local is
another binding. importedBindingUses (used by spc locatedImporters) now walks
the Oxc AST with scopes: it skips type-only code (TS type nodes, type keys,
declare, type-only exports), names a local binding shadows (params, let/const,
var, catch, function/class expression names), names that are not references
(keys, members, labels, exported names, re-exports from another module, JSX
attribute and intrinsic element names). Uses in removed boundary bodies are
not told apart; tests of those name the genuine use.
Controls: three ctu tests and two spc locatedImporters rows; all five fail on
the old helper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite 8.3.4's BundledDev ends its initial build with a getBundleState() call
nothing awaits; closing the server while it is in flight makes Rolldown
reject it, unhandled ("Failed to get bundle state"). User-authorized harness
workaround (FOLLOWUPS "UPSTREAM (W5-ip)"): before vite.close() of a
bundledDev server, wait one turn at a time for BundledDev.initialBuildCompleted
(an internal; no public API, vitejs/vite#22991), with eventTimeout as a guard.
Evidence (temporary probe, create -> clientBundle() -> close at load ~10-17):
before 2/400 and 1/1000 unhandled rejections; after 0/3000. 32 loaded Nx
runs of importProtection/dev.test.ts afterwards (load 15.9-18.9): 0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W5-ip: ctu mentionsFile names files absolute or project-relative only
(DECISIONS 2026-10-20 "file names in diagnostics"), and the location
oracle rejects lines/columns below 1, so the ip adapter keeps no rule of
its own; expectMapsTo resolves map-relative sources against mapUrl; new
rg pin (the (group).tsx error names a routes-relative path); the
remaining exact, file-only and any-column ip location checks on the
shared oracle (locatedImporters, importedBindingUses); one Chromium
client runner core (withRecordedPage). Tests only; no conflicts.
Validated (Nx, --skip-nx-cache, --maxWorkers=4): ctu 247, 106 x2;
rg 270/30, 60/3 x2, impl 81/2; rp 445/179, 355/193 x2, impl 53;
spc 928/189, 848/202 x2, impl 246/7; rsc 50/1, 108/11 (consumer check);
types and eslint pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W4-ip's `client-pages.ts` and W4-shared's `runInClient` in
`rsbuild-dev-server.ts` both drove Chromium. Now one core,
`withRecordedPage` (rsbuild-dev-server.ts): a page recording console calls
and uncaught errors from its first statement on.
- Rsbuild: `runInClient`/`runRsbuildClient` are W4-shared's (page of the
recorded client entry files; a failed script load or an error thrown
while loading fails). client-pages re-exports them; its own Rsbuild page
path, the generated-HTML entry tweak and the favicon route are gone, and
its `startBrowserRsbuild*` use `clientPage`.
- Vite: `runViteClient` keeps the fixture page through Vite's HTML
pipeline and the optimizer-reload retry, now on the same core: an error
the page's code does not catch while the entry loads fails (new), as do a
failed entry import and a thrown script.
- No assertion changed; all ip pins fail for the same reason as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
J6.5 never accepts compiled coordinates: the remaining exact `file:line:col`
checks and the file-only/any-column checks of the ip tests now go through the
shared location oracle.
- Exact sites (merge W4-ip list): build-options 87/403/416/429/582,
build 730/1055, dev 1843, rsbuild 269/292/312/572, known-bugs 480, plus
dev MDX 733/760/831, marker reports (markerReport, 1324), 1362,
v2-alias 92, build "split route component" (file-name only).
- Which-importer helpers (build-options `outcome`, exemptions
`reportedFiles`, v2-hosts `reportedImporters`, known-bugs `loadOutcome`
and the custom-type pin, rule-outcomes) use `locatedImporters`: the
importer's file only at its import of the reported specifier or at a
reference to a binding it introduces (ctu `importedBindingUses`), or a
marked module's marker import (ASK-1); anything else stays visible with
its coordinates.
- `ExpectedViolation.otherUses`, `originalLocation(…, { unavailable,
others })`.
- Controls: ctu `importedBindingUses`, column 0 and basename locations;
spc `locatedImporters` (use, import, other line/column, compiled
coordinates, no coordinates, unknown source, marker origin, the dev
duplicate naming the resolved path).
- rsbuild "the file rule … naming the importer" keeps its file check: the
adjacent pin asserts the (wrong) location.
- All 123 ip pins fail for the same reason as on e0070dae57 (run without
`.fails` on both trees, failure messages compared).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W5 polish: rg prepareFixture clears leftover generated route files of
the file-modification fixture (with an outside-corpus control); rp
HMR-06 rows gain the window-defined variation (8 -> 16); three pins name
their user-visible impact and source; spc takes Miniflare from a
test-only devDependency (miniflare@4.20260317.0, the copy wrangler
already resolves; lockfile +3 lines, importer only); H10: spc render.ts
dispatches through createCompilerVirtualModuleIdPattern /
loadCompilerVirtualModule (control red on the old pre-query path check).
Validated (Nx, --skip-nx-cache, --maxWorkers=4; frozen install clean):
rg 274/26, 60/3 x2, impl 81/2; rp 445/179, 355/193 x2, impl 53;
spc 919/189, 848/202 x2, impl 246/7; types and eslint pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per DECISIONS 2026-10-20 "file names in diagnostics (§5.7)", ctu
`mentionsFile` accepts an absolute path or a relative path holding the whole
project-relative path, and rejects a part of it alone (`other.ts` for
`src/other.ts`). The location oracle also requires 1-based lines and
columns, so W4-ip's `originalLocation` adapter keeps no rule of its own.
- ctu controls for the new rule; each fails on the old behaviour (15).
- `expectMapsTo({ mapUrl })` resolves a map's relative source against the
module it belongs to, as the source map spec does; the Vite dev
source-map tests (rp, spc) pass the served module.
- rg: the route-group error names `(group).tsx` relative to the routes
directory: now a pin (verified red: "does not name
src/routes/(group).tsx unambiguously").
- The dev pin `other.ts:2:24` stays red through the shared oracle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W4-ip import-protection acceptance fixes (ip-SYNTH I01-I15; I16 kept
closed): suggestion sections, attributable added code, MDX coordinates,
mockAccess defaults, settled Rsbuild windows, public rule outcomes, real
Node SSR and Chromium client hosts. Tests only.
Resolution onto W4-shared (one location mechanism):
- Conflicted call sites take W4-shared's expectViolationsAt /
relevantViolations / expectReportFrame / expectMarkerViolation; W4-ip's
duplicate originalLocation assertions there are dropped.
- importProtection/original-location.ts is now a thin adapter over ctu
isRelevantLocation + expectFrameAt for W4-ip's remaining call sites,
keeping two J6.5/§5.7 constraints the shared mentionsFile lacks: a
1-based column, and an absolute or project-relative file name (without
the latter the dev.test pin "re-exports is reported ... with its path"
passed while the bug, `other.ts:2:24` for `src/other.ts`, is on main).
- W4-ip's copy of the added-code oracle replaced by
@tanstack/compiler-test-utils/added-code (identical code).
- Rsbuild/Vite client runners: files W4-ip moved to its Chromium
client-pages.ts keep it; the clientPage spreads W4-shared added for its
rsbuild-dev-server runner are dropped there.
Validated (Nx, --skip-nx-cache, --maxWorkers=4): spc types/eslint pass,
unit 913/189 (1102), integration 840/202 (1042) x2, implementation
245/7 (252).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
render.ts's client host only loaded ids whose path before the query was
the parent's, which constrained how a compiler may spell its virtual
module ids. It now hands the plugin the ids its virtualModuleIdPattern
matches and loads them through loadCompilerVirtualModule, as the Vite and
Rsbuild hosts do (the real host functions of src/start-compiler/host.ts,
no copied resolver); every other id the linker asks for is declined.
New harness control (outside the corpus): a relocated virtual id loads
and renders like the original; './unrelated-module' and its extension
probes never reach the plugin. Red on the old check ("No stub for import
/elsewhere/relocated-module.tsx?...") and on an ungated host (the probes
reach the loader).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cloudflare:workers contract test reached Miniflare through the e2e
Cloudflare app's wrangler, which only resolves after a full root install.
miniflare is now a devDependency at 4.20260317.0, the version wrangler
4.75.0 already resolves (one copy; lockfile regenerated with
pnpm install --no-frozen-lockfile: importer entry only). Coordinator-
approved test-only devDep (DECISIONS 2026-10-20).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- rp known-bugs-route-hmr: the split Solid/Vue identity pin names the
remount and lost local state (Vite: full reload).
- rp known-bugs-code-splitter: the look-alike createFileRoute pin gets its
Source line.
- spc start-build-determinism: the S03 fresh-build mapping pin no longer
claims unchanged app input; the entries differ in import order.
Comments only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The W4-hmr rewrite of HMR-06 dropped the browser-like evaluation with
`window = {}`. Each style/route now evaluates with and without a hot API,
with and without `window`. Probe: dropping the optional chaining on
`window.__TSR_ROUTER__` in the Vite adapter fails only the new
window-defined, hot-present rows (reverted).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A gitignored route file left in routes/(test) by an earlier run (e.g.
template-literal.tsx of the old harness) became one more route of the
fixture and failed generator.test.ts in that checkout only. The new
harness control (outside the corpus) fails on the old helper with
template-literal.tsx left over.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Check runtime conditional selection and effects, plain-model shape, and
look-alike argument values. Isolate two helpers in one module so one payload's
CSS cannot hide another's missing delivery, and cover JavaScript providers.
Add client-only CSS controls on Rsbuild dev and Vite production, strengthen
stream diagnostics, and use public server-function URLs for the D6 goal.
Split independent real app sessions and scope concurrent browser cleanup.
Validation twice: types, eslint, 51 unit cases and 119 integration cases.
New and changed pins are verified red with their expected-failure markers removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cover eleven literal boundaries, inline edge spaces, shared fallback values,
digit-bearing hooks, below-JSX function declarations and computed-key module
dependencies. Observe independent child requests and HMR loading separately
from mounted-instance gauges, while allowing equivalent chunk layouts and
framework refresh replacement. Split independent host sessions for file budgets.
TypeScript 6.0.2 over real Hydrate declarations: the original string-returning
prefetch reports TS2322; the void-returning replacement passes.
Validation twice: types, eslint, 1298 unit cases and 1027 integration cases.
All 22 J5/J7 red variants are caught; all eight green variants pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Accept relevant original import/use locations and context-free source frames,
require mapped MDX positions, and scope suggestions and edit diagnostics to
their public outcomes. Use real browser client execution and Node SSR output;
exercise actual default mockAccess, exemption blame, and resolver guidance.
Add public rule outcomes for the V4 matcher and inherited mock-property gaps.
Move sourceLocation helper-preference controls outside compiler acceptance
(V1R I08 / SPEC section 8); retain public report shapes and add missing nested
middleware/server-isomorphic cases. No test was changed on a claim of invalid
TypeScript input. The isolated I11 edit row now passes without an expected-
failure marker and retains its exact empty final violation set.
Validation: types and ESLint pass; full unit (1308 tests) and integration
(1046 tests) pass twice with identical counts, including existing goal pins.
Verified 121 touched pins red; all 16 relevant red mutations are caught and
all 5 green rewrites have zero compiler-corpus failures. Detailed evidence
is in validation/waves/W4-ip.md under the compiler-test-intent cache.
No product or dependency changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W4-shared cross-slice harness fixes (lazy probe, effective-artifact
validator with the amended dangling-name attribution, host graph and
logger channel, semantic determinism, location oracle, prose/causes,
warning fallbacks, Chromium client runs, added-code oracle, kept dynamic
imports, stop()) and the outside-compiler-corpus selection convention
(test:implementation). Tests and test infrastructure only.
Conflicts with the merged W4 slice branches, resolved keeping both sides:
- rg determinism: both sides wrote determinism-app.ts. Kept W4-shared's
structure (expectDeterministic project option) with W4-gen's semantics
(logging enabled, diagnostics sorted, cwd variants compare routes only);
W4-gen's outside-compiler-corpus/tree-bytes.test.ts deleted as a
duplicate of W4-shared's route-tree-bytes.test.ts (same byte assertions
over listing order and cwd).
- rp generator-dev-app/scenarios: W4-shared's mark()/diagnostics(since)
capture replaces W4-gen's reportMark/reportsSince (same outcome, more
channels); W4-gen's close() kept beside diagnostics().
- rp integration regression-helpers: W4-shared's moved file under
outside-compiler-corpus/ plus W4-hmr's delayed-observation control and
W4-split's page-console warning row (W4-shared's bundler-channel rows kept).
- rp known-bugs-route-hmr / route-hmr-browser-plugin: shared
expectEditShownOrReportedFallback (same rule as W4-hmr's inline check).
- rp known-bugs-dev-server: HMR-27 block as moved to the integration tier.
- rp production-bundle: ctu addedCode (all frameworks) instead of
W4-split's react-only bundleAtoms oracle.
- rp dev-source-maps: isServedAppModule; route-hmr: W4-hmr comment kept.
- spc createServerFn: shared missingHandler matcher; W4-start's matcher
controls kept on top of it; resolver block as moved outside the corpus.
- spc rsbuild/dev-server: W4-start's hydrated-page rows kept (they already
replace the VM runner that W4-shared migrated to runInClient).
Validated (Nx, --skip-nx-cache, --maxWorkers=4): ctu 232 / 106 x2;
rp 437/179, 355/193 x2, implementation 53; spc 919/189, 814/201 x2,
implementation 223/7; rg 274/26, 60/3 x2, implementation 80/2;
rsc 49, 87/10 x2; types and eslint pass for all five.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W4-start acceptance fixes for the Start slice (start-SYNTH S03/S13/S17,
N02-N06, N08, N10-N12; S07/S49/N13/N14 left to their owners; V4 r2
escapes astra-r2/06-09 and fable-r2/13). Tests only.
Validated on the identical staged merge (Nx, --skip-nx-cache,
--maxWorkers=4): spc types/eslint pass, spc unit 1108/195 (1303),
spc integration 826/202 (1028) x2. Run 1 also reported the known
Rolldown "Failed to get bundle state" unhandled rejection in the
untouched importProtection/dev.test.ts (tracked separately; coordinator
ruling: does not block this merge).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Amended ruling "dangling-name attribution" (2026-10-20): the check
covers the app's modules (user and route code, split chunks), modules
without a file (virtual and support modules) and the dependency modules a
transform hook (a loader other than the bundler's built-in ones) saw in
that build. In such a dependency a free read counts only when the module
as the transforms left it reads the name free while its original source
does not; a dependency no transform saw is out of scope, whatever the
bundler does inside it (Rspack dropping import bindings). Controls,
each verified red by a mutation of the attribution: an untouched
dependency whose binding Rspack drops passes; a transform dropping a
dependency's binding fails; a transformed dependency's own free read
(seroval's shape) passes and the same code in the app fails; the dead
notDeclaredAnywhere in app code still fails.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ruling "dangling-name attribution" (2026-10-20): a dangling read in a
production client chunk counts unless it lies in a dependency's module
(outside the app or under node_modules) whose original source on disk
reads the name and binds it nowhere (e.g. seroval's
const RETURN = () => T, used through RETURN.toString()). A binding the
original source has, lost by a compiler or the bundler, counts, and so
does every read in the app's own and virtual modules. The bundler-lost
exemption is gone. Controls (each verified red by a mutation of the
attribution): a dependency's own free read passes and the same code in
the app fails; Rspack dropping a dependency's import binding fails (webpack
declares it); a transform dropping it fails on both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W4-split acceptance fixes for the split slice (split-SYNTH S02-S35 local
parts; S01/S03 host/S05/S21/S28/S36 left to W4-shared; V4 r2 escapes
astra-r2/04 and fable-r2/06). Tests only.
Conflicts with W4-hmr resolved keeping both sides:
- integration/regression-helpers.test.ts: W4-hmr's delayed-observation
control plus W4-split's app-logged warning control (both replaced the
same compiler-warning row; the W4-split row asserts its own marker).
- integration/route-hmr-browser-plugin.test.ts: no warning-excuses-failure
branch (both), and W4-hmr's in-place requirement when no warning names
the file (findDiagnostics import kept); comment updated.
Validated (Nx, --skip-nx-cache, --maxWorkers=4): rp types/eslint pass,
rp unit 460/181 (641), rp integration 365/191 (556, 45 files) x2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Exercise async isomorphic promises, both environment-only call receivers,
provider default-export effects over HTTP, browser RPC cancellation, and
a validator schema also consumed by a hydrated form. Preserve module-load
checks while allowing harmless identifier spellings in dead code.
All five assigned round-two patches were applied independently, caught by
the relevant Start outcomes, and reverted. No product or dependency changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Check fresh collision mappings, nested RPC safety, independent capture
outcomes, actionable handler diagnostics, and consumed fixture exports.
Use srvx for HTTP/static hosting and real hydrated Start pages for global
middleware and Rsbuild factory/id workloads. Contract-test the retained
Cloudflare resolve hook against workerd and builtin delegation.
No input was deleted or reclassified as unsupported. Existing parsing,
transport, module-load and successful-build controls remain; new bug pins
were verified red without .fails. Test-only changes; shared helpers and
import-protection/hydrate files remain with their assigned owners.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W4-hmr acceptance fixes for the HMR slice (hmr-SYNTH HMR-06/07/31/34,
H08-H12; HMR-08/10/27 shared parts deferred to W4-shared). Tests only.
Validated (Nx, --skip-nx-cache, --maxWorkers=4): rp types/eslint pass,
rp unit 456/180 (636), rp integration 367/181 (548, 44 files) x2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps build-production-webpack within its budget: each chunk's atoms are
counted once (the oracle control adds its code as a module of its own
instead of editing the entry chunk, so the build's chunks are not
re-parsed).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rsbuild dev harness waits until the watchers (union of all compilers'
watchpack entries) know every app file before start/edit/settle resolve,
with two control tests; the ctu Vite self-test's generator writes
atomically. Re-merge after the aborted 89f5401d60 (RSC client compiler
ignores all watching; fixed by 1356241f94).
Validated (Nx, --skip-nx-cache, --maxWorkers=4): ctu types/eslint pass,
ctu unit 201, ctu integration 92 x2, rsc integration 87/10 x2,
spc integration 819/200 x3, rp integration 359/179.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The regression-helpers controls (both tiers: openRouteHmrPage, the
in-process host, loadRoute) check the test helpers, not the compiler, so
they move under outside-compiler-corpus/ (test:implementation); no V4 red
is caught by them alone. The out-of-order dev edit pins no longer require
more than one module and tolerate a pre-edit URL that no longer compiles:
the page loads the current graph from the route module (V1R hmr HMR-27).
Both pins verified red without .fails (Export 'CardB' is not defined;
B1/B1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They are the only corpus test catching a mutant that loses the lazy options
the route tree gave an edited route (V4 red-astra/08), so they decide a
user-visible outcome; the header names their category instead (hmr H12).
The corpus convention says so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Link emitted route graphs to the real router and renderer, observe exported
component identity through eager importers, and keep reload/error results
live through final assertions. Require working factory edits even after a
warning. Cover metadata edits/removals and the fresh index Route.to on real
Vite/Rsbuild pages; add the Rsbuild Solid/Vue wrapper-preservation goals.
Remove component-key presence and private URL spelling assertions under
OQ14 and SPEC section 5.3. Existing nested Outlet and resolver-order controls
retain the behavior; no deletion claims type-invalid input.
Validation: types, eslint, unit (636), and integration (542) twice with
identical counts. Ten HMR red variants caught, four greens clean, and new
or affected goal pins verified red without .fails. Timing overruns and the
three W4-shared handoffs are recorded in the W4-hmr report.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both dev-server harnesses get stop(): it closes the server and its watcher
and keeps the app directory, so an edit after the server stopped can be
observed; close() (what registerCleanup gets) still removes it. The
generator dev app reads every console method and direct stdout/stderr
writes, not only console.error/warn (W4-gen items 1 and 2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Files under tests/**/outside-compiler-corpus/ are implementation tests:
test:unit and test:integration leave them out, test:implementation (and
test:implementation:unit) run them, and the root CI scripts and the
compiler platform workflow run those targets too. The budget reporter
ignores the implementation projects. The internal resolver tests (start
N08) and the stringified handleRouteUpdate tests (hmr H12) move there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Production client bundles were compared with their route-HMR-off control as
sets of identifier tokens (split S14): a harmless private renaming failed,
and a development-only call built from names the bundle already had passed.
addedCode (compiler-test-utils/added-code) compares the two builds' statements
as multisets of shallow, alpha-equivalent, printer- and placement-independent
shapes: what the build ships that the control lacks is attributed to the
setting, whatever it is named. production-bundle.ts uses it for every
framework (the control is the same for all). Controls: fixed chunks and real
Vite/Rspack builds where a renamed helper adds nothing and one more
console.warn of existing names is added.
Route HMR in the environment plugin.vite.environmentName excludes (HMR-10)
and Start's server environment in dev (HMR-08) are now checked over every
module the environment serves from the route module, the router packages
and any compiler support module included; only Vite's client and
externalized packages are left out. The route-local literal positive scan
is gone; the real-page loader edit is the positive control.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
V1R split S03 (slice-local part): the out-of-order dev-edit walk kept only
imports resolving to the route file's own path, so a compiler emitting a
separate support module or another virtual scheme would not be compiled
and reloaded. The plugin-host graph part stays with W4-shared.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dev-server harness self-test "reports created, renamed and deleted
files to the plugins, and the files they write meanwhile" failed 3 times
in the V4 variant phase (load ~30): once with an extra `update
generated.ts` after `create generated.ts`, twice with "the file watcher
did not report generated.ts". Its generator plugin wrote with a plain
`writeFile`: a truncation and a write. Under load the watcher reports
the two steps of a new file as an `add` and a `change` (the extra
update), and for an existing file the harness can read the empty file
at the first event while the content lands in the same millisecond, so
chokidar's mtime check never reports the second step (the timeout). A
generator writes atomically (the router generator's `safeFileWrite`);
the self-test now does too, through the harness's `saveAppFile`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
moduleLoads unioned real module requests with every syntactic dynamic
import, so a correct compiler leaving an uncalled function with an import()
of a server-only module for the bundler to delete failed expectNotLoaded
(start N14). Real requests (static links, imports run while evaluating) stay
strict; a dynamic import counts when Rolldown, bundling the compiled module
alone with tree-shaking on and its exports kept, keeps it
(keptDynamicImports in compiler-test-utils, the same deciding bundler as
getModuleErrors' dead references). The new control lists imports in live
code (an exported caller, a top-level call) and not in dead code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
V1R split S16/S17:
- split-mode-parity: five splittable options per route, each importing a
load marker; routes in forward/reverse activation pairs; route groupings,
splitBehavior and defaultBehavior precedence; loader data and the route
rendered by the real router; the deleted headers code in no client
chunk. Expected groups are computed from the configured groupings. Vite
and Rsbuild, dev and build, all pass.
- the seven displayName host/hint cells removed by speedup 7 are restored
(with the Vite no-hint cell) in their own file, built concurrently
(7.4 s); every cell verified red (DanglingNameError: Page).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
generatorDevApp gains mark()/diagnostics(since): the generator's console
output plus the dev server's own errors and warnings (Vite's logger,
Rsbuild's compile diagnostics), as diagnostics. A broken route file must be
reported (naming the file, through any channel) by the edit that breaks it;
after the fixing edit, the route must come back and no error be reported
from then on, so a permitted report of the broken file no longer fails the
recovery (V1R gen G13, also for the created-broken-file Rsbuild pin).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The check skipped unminified webpack and Rspack client builds, the artifacts
those configurations ship (split S36, gen G02, GEN-38). It now reads every
production client chunk. A dangling read is the bundler's only on evidence:
it lies in the bundler's region of a module, and that module, as the bundler
parsed it after its loaders and plugins (recorded by recordParsedModules),
binds every read of the name. Two bundler mechanisms produce such reads in
unminified output: Rspack 2.2.7 drops import bindings of unused code it keeps
(webpack declares them), and both remove declarations after a return they
computed while keeping function declarations that read them. The control now
rejects the unminified build's surviving dead dangling name, and new controls
prove both bundler mechanisms are attributed and a module that loses its own
binding is still rejected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- astra-r2/01: a routeToken /\p{L}+-layout/u makes posts/écran-layout.tsx
the /posts layout.
- astra-r2/02: a route file missing its constructor import next to
import { Link as Primary, Link as Secondary } keeps both aliases
(expectOnlyOwnedEdits bindings).
- astra-r2/03: with routeFileIgnorePrefix '', -health.tsx routes to
/-health.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- a binding whose only reader is a private method (#read) shared by the
eager loader and the split component: valid modules, one instance, one
init. red-astra-r2/04 applied: CAUGHT (the chunk loses the binding).
- component: memo(Page) / withAuth(Page) of a const arrow component renders
when the chunk loads. red-fable-r2/06 applied: CAUGHT (ReferenceError:
Cannot access 'Page' before initialization).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
G27 (V1R gen), with the scenarios added to generator-dev-scenarios.ts in
the previous commit:
- Vite and Rsbuild dev servers on a real page: an edit of the
virtualRouteConfig file (path form) and of a __virtual.ts file must
change the live routes. Both are new pins on both bundlers: the tree is
not regenerated (Vite: checked with the tree file, no 'contact' route
4 s after the edit; the generator-level pin already in router-generator
generator-dev.test.ts names the path comparison and jiti cache; the
__virtual.ts source is suspected, a product probe was not permitted).
- Closing the Vite / Rsbuild dev server closes every file watcher it
held, the generator's included (positive control: a created route file
is scaffolded while it runs, and watchers exist). The harness removes
the app on close, so an edit after close is not observable here.
- router-generator: a createFileRoute declared in the file or imported
from an app module (a wrapper of the router's) must keep its meaning:
new pin (the generator recognises the constructor by name: it adds a
second binding or rebinds the import to the router package; red without
.fails); an inner-scope shadowing createFileRoute is left alone while
the Route is kept up (passes).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
G13 (V1R gen): the broken-route-file scenarios read the report from the
plugins' console only, and recovery required no dev server error at all,
though the permitted report of the broken file may stay among them. Now
the report is any diagnostic (console or dev server error) naming the
file through the shared diagnostics oracle, marked from the breaking edit,
and only errors after the fixing edit must be absent; the recovered route
and navigation stay required. This also applies to the created-broken-file
Rsbuild pin (re-checked red without .fails: Rsbuild does not settle on the
fix, after the report check).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
expectEditShownOrReportedFallback (route-hmr-page.ts): an edit of a route
the compiler may leave to a reported fallback (R-09, D11) must show its new
loader data and component without errors; without a warning naming the
file it must also apply in place, with one a reload is allowed. Replaces the
catch-and-return of the factory-route rows and their helper-function pin
(V1R hmr H08, split S11). The warning-capture control now uses a synthetic
plugin warning through each bundler's own channel (Vite this.warn, an Rspack
compilation warning), positive and negative, instead of requiring the
compiler to warn about a split it may perform (H09, S09); openRouteHmrPage
takes extra test plugins. Controls of the helper's decision.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
V1R split S09/S10/S11/S12:
- the page-warning harness control logs a deliberate warning from the app
instead of requiring the compiler to warn about an exported page;
- exported errorComponent (as any): an entry importing it, the route's
error path rendered through the real router, the function rendered is the
imported one and its module state is created once (pin verified red:
labels 3, not one instance); placement stays a separate obligation;
- same-file route factories: the edit must show v2; a warning no longer
turns a stale page into a pass (all 10 cells pass today);
- the client-output source-names inventory is deleted (virtual source names
are free); executed throw maps now also cover route-module and shared
code on Rspack and webpack (new .fails rows, same unplugin map drop:
verified red on the line).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The readiness wait checked each compiler's own watcher, which can never
hold for Rspack's RSC client compiler: the RSC coordinator sets
`watchOptions.ignored = () => true` on it and has the server compiler
watch its files (merge validator: all 4 Rsbuild RSC dev starts in
react-start-rsc timed out). Now every app file any compile read or
looked for must be known to the union of the attached compilers'
watchers.
Control tests (ctu integration): after the start, the watcher knows
every app file the compile read; and a two-environment server whose
`node` compiler ignores every file (0 entries) still starts, with its
files known to the `web` compiler's watcher.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The out-of-order edit pins followed only imports whose query-stripped path
was the route file and evaluated the client output in Node with the SSR
router and this process's React (V1R hmr HMR-27, split S03). They now move
to the slow tier: a real Vite dev server with a browser page; the walk
follows every served module of the app or of a plugin (isServedAppModule:
not a dependency, not Vite's client), the page loads the route before the
edit and leaves, the test re-requests the modules in the forced order, and
a new page imports the route as the server serves it now and renders its
components with React, reporting render and link errors. The pins stay red
for their own reasons without .fails: 'Export CardB is not defined' and
B1/B1 (two module states). The dev source-map walk drops its /routes/
filter the same way. Control: isServedAppModule follows a plugin-served
module and another app module (red with the /routes/ rule).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runInClient and runRsbuildClient ran the dev server's client output in a Node
VM with copied web APIs (V1R start N03; hmr/start theme "client code run in
Node"): a client path that misbehaves only in a browser passed. They now open
a page of the dev server in Chromium (a server started with `clientPage`),
whose document loads the client entry's initial files from the dev server
(found in Rspack's stats; Start's dev server renders its HTML with the app's
server entry, which the harness apps do not have), record what the page's
code logs and throws from its first statement on, and run the script in the
page. webGlobals/webApis are gone; the same-named ids row runs on the page
too.
Control (integration/build-harness.test.ts): the entry reads document,
customElements and location (the VM run threw on document), the script runs
on the page after load, logs come with their levels, and a throw while the
page loads rejects both runs. Re-checked red without .fails, failing for
their stated reason: known-bugs custom-type and .mdx pins (not reported; a
denied specifier's real code runs), v2-policy permitted rows (a safe mock).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
openPage takes the document of its URL (a page of a dev server that serves
no HTML, whose other requests still reach the server) and a script that runs
before the page's own code (to record what it logs and throws from its first
statement on). Control: a page shows the given document at its URL, and the
init script ran first, on every load.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
V1R split S07/S22:
- JSX plugin before the router plugin: a working build may also keep the
component in the route with an actionable warning (naming the route file
or both plugins); an error must name both plugins by package, factory or
Vite plugin name, not literal package prose. Supported order unchanged.
- // @refresh reload rows: after the same click and edit, the split app must
show exactly what the unsplit app shows (count reset), not any count.
Probe (both Vite rows, 4 pages each): the count is 0 with and without the
pragma; the pragma's only other effect is a reload, which G10 forbids
requiring.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reports may name the importer at a genuine use or at any line of its
original import of the denied module (SPEC J6.5; V1R ip I01):
expectViolationsAt/relevantViolations match distinct reports to expected
violations with the shared isRelevantLocation, expectReportFrame checks the
highlighted original line and caret without requiring context, and
expectMarkerViolation also accepts the importer's import of the marked
module. Migrated: build.test default-rule rows, the chain build report,
reported-location's predicate, dev.test denied-file/marker/route-frame rows,
dev-page rows and the transformImport rows (no coordinates allowed there
only, §5.14). Controls on real formatViolation reports.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
V1R split S19/S20/S29 (+ the slice-local S03 walk):
- autoCodeSplitting false/undefined: the generated tree exists and the real
router over it renders the index route at /, instead of a literal
"from './routes/index'" import spelling;
- the React Compiler transform-placement check moves to
outside-compiler-corpus/ (DECISIONS OQ16: third-party transforms on split
chunks are out of scope); ordinary split/render rows stay in the corpus;
- dev source maps assert the original column too; the Vite served-module
walk follows every app module and Vite-served virtual module, not only
/routes/. The Rsbuild pin is still red on the line (3 vs 6).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The (bar)/_layout.about and lazy _layout.xyz files had no (bar)/_layout
route while the other groups have identically named layouts; their root
parent in the table characterized today's choice between candidates the
docs do not rank (V1R gen G23). The fixture now has
(foo)/asdf/(bar)/_layout.tsx: the table nests about and xyz under it, and
their pages render inside it (/asdf/about, /asdf/xyz).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
routeTypeChecks indexed the tree's generated FileRoutesById interface and
one row indexed FileRoutesByFullPath: those names are not promised (SPEC
§5.1; the docs promise FileRoutesByTo through a consuming example), so an
equivalent linkage through typeof routeTree failed (V1R gen G21). Now
RouteIds / RouteById<typeof routeTree, id> (fullPath, parentRoute.id)
and RouteByPath<typeof routeTree, '/'> from @tanstack/router-core. The
documented FileRoutesByTo rows stay. Re-checked the three type pins red
without .fails: same fullPath '' vs '/' mismatches.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SPEC G4 frees emitted code across project roots and printing everywhere
(§5.5); the determinism tests compared normalized emitted modules (split
F10/S05), built files byte for byte, and the generator's raw tree text
(gen G07).
- ctu `expectDeterministic` takes a `project`ion and documents the
semantic projection every determinism/relocation check uses: executed
values, lazy groups, user modules loading on demand, relevant
diagnostics, contract ids; never bytes, generated names or complete
lazy inventories. Control: two outputs differing only in private names
and printing pass, another value or a broken shared identity fails (real
ESM through the module linker).
- router-plugin fast tier: each module id (other roots, Windows ids) must
give the reference lazy groups, loader data and rendered components, via
`expectRelocatable`.
- router-plugin slow tier: the app built in two directories (files written
in another order at the second) must run in a browser with the same
data, page and eager/lazy placement; each build checked on its own.
- router-generator: listing order and working directory must not change
the routes the real router builds (path, parent, file, the app's lazy
route files) nor the generation's warnings and errors.
The byte-equality checks stay as labelled implementation controls under
`outside-compiler-corpus/` (rp fast and slow tier, rg).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host followed only imports resolving to the route file with a query,
so a compiler emitting virtual or other-id modules failed every fast test
(V1R split S03). It now resolves every import through the host and tells
the route's modules by hook evidence: a module a host plugin loads, or one
the router plugin's transform changes. Untouched app files and packages
are not followed. The build host records importer-keyed resolutions (the
map was keyed by specifier only) and externalises packages and what
nothing resolves instead of everything off the route path.
Vite ran silent, so a plugin's this.warn never reached the diagnostic
capture (V1R split S21): the host logger now forwards warnings and errors
to the console.
Controls: a plugin serving a chunk and a support module under its own id
scheme (followed and evaluated; red with the old same-path filter in dev
and build), an untouched user file (not owned; red when every resolved file
counts), and a plugin's this.warn through the host (red with the silent
host).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
V1R split S14 (P1): the paired-build G7 oracle compared sets of identifier-
like tokens, which fails on harmless private renaming and misses dev-only
code built from tokens already present. It now compares, on the real
parser's syntax tree, counts of each node kind and of free-name reads,
property names and strings (chunk file names normalised). An inline oracle
control appends console.error("MARK_PAGE") (token set unchanged) and
requires the comparison to see it. Public hot-API checks unchanged. The
vite/react unsplit pin is verified red for the extra Refresh anchor.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
withoutQuotedSource now uses the shared diagnosticProse, which also drops
cropped and highlighted frame lines (V1R start N13). A misplaced server fn
rejection must explain the placement (placementCauses), a capture rejection
the capture (captureCauses), and a missing handler may be reported by the
API or its handler call with a missing-function cause (N04). Synthetic
controls: cropped-frame and positioned internal-crash negatives, clear
messages in varied layouts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
piecesOf loaded every route before rendering its pieces, so a generator
importing the ordinary .component.vue pieces eagerly passed the lazy-piece
rows (V1R gen G18). piecesOf now requires no .vue file to be loaded once
the fresh tree is loaded, before any route is demanded; the pieces still
render with real Vue after loading (a probe confirmed the observation
channel lists the .vue files after loading).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
G14: the footer is compared with the tree's last non-blank lines, not
from a literal 'export const routeTree'.
G15: addExtensions checks every static and dynamic import of the app's
route files (extension, resolution) and no longer counts imports, so
generated support imports are exempt.
G16: importRoutesUsingAbsolutePaths checks the static route file imports
without a count, and a new pin requires the lazy route file imports to be
absolute too: today they stay relative (red without .fails:
'./routes/posts.lazy' is not absolute).
G17: with disableLogging, every captured console message (any severity)
must be an actionable one naming the route file without a Route export.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
V1R split S04/S08/S15/S25/S30/S33/S34/S35:
- loadRoute control on real output keeps effects and on-demand evaluation,
not exact evaluated-module inventories (exact bookkeeping stays on fixed
graphs);
- shared state in a .jsx route: once-only creation and one instance across
options; no import-versus-init deadline;
- flat codeSplitGroupings labelled a type-invalid diagnostic control
(TS2322 under the real types, arbiter probe /tmp/v1rs-type-check.ts):
named error, reported working route, or safe interpretation;
- exported loader: the function the route runs is the one an importer gets;
- import attributes: nothing loading with the route requests the macro
module (complete eager requests), attributes on every import of it;
- imported options: real on-disk options/admin-helper source in a real Vite
dev server; an error naming the route file is accepted; deleteNodes pin
also requires the helper not to reach the client graph; the local control
checks the helper does not load eagerly. Pins verified red (no warning).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
diagnosticProse drops numbered frame lines (whole, cropped, highlighted,
boxed), caret markers and quoted source lines, so source tokens cannot
impersonate a diagnostic's own words (V1R start N13). Names accept
alternatives (N04) and causes require a semantic reason in prose (S07).
locationMismatch/expectRelevantLocation accept a genuine use, any line of
the original import of the specifier, caller-given other places (marker
origin) and, opt-in only, no coordinates (J6.5, §5.14; V1R ip I01);
expectFrameAt checks the highlighted line and caret, not context.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
G09: a template literal id may be replaced or reported (SPEC J1.1); the
upkeep row moves into the repaired-or-reported table and the
file-modification fixture drops its template-literal file (the fixture
cannot accept a failed run).
G10: expectRouteFile no longer requires one local import literally named
createFileRoute; the evaluated Route must be the router package's Route
(LazyRoute for the lazy constructor) and routeCallOf still checks the
callee's provenance, so reusing an alias or namespace binding passes.
G11: the direct-object constructor calls (type-invalid, TS2345 per the
V1R synth tsc probe) are labelled never-fail-silently controls and accept
a repaired curried call keeping the options and registering /new, or a
diagnostic naming the file.
G12: -posts-route / -make-route now exist and supply the Route; the entry
must stay unchanged with /new registered and rendered, or be reported.
G25: the file-modification lazy constructor-switch input is a
component-only createFileRoute route (the full template kept a loader,
TS2353 under createLazyFileRoute); the page must render at /bar.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lazy probe started each trigger synchronously, rejected the imports it
started and loaded their targets itself. A valid wrapper that first awaits
something (`await Promise.resolve(); return import(chunk)`) was classified
eager, and a dynamic facade's continuation (the facade importing the real
chunk) was never observed (V1R split S01 = gen G08, SPEC J2.6/§8).
The probe now awaits the public trigger to completion in a fresh fork of
the graph (its rejection ignored), lets imports it started without awaiting
them settle, and counts the owned modules that evaluated. Groups observe
each pair in its own fork, so what one name loads never makes another look
available. Controls: delayed trigger, dynamic facade, unawaited import,
pair independence; the first is red on the old probe, the pair control is
red on a shared-fork variant.
`probeDynamicImports` had no other consumer and is removed with its tests.
The deprecated `runtime`/`jsxPragma` JSX stand-in of the linker had no
consumer left either and is removed (V1R gen G22).
One consumer read a stub's access log after `isLazy('loader')`, which now
loads the loader's module in a fork with the same stubs; it reads the log
first (`code-splitter-route-options.test.ts`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
V1R split S02/S13/S23/S24/S27:
- extra cache-busting parameters: load and render the route with the module
served under the busted id (no emitted-text equality, no required query);
- route reuse across routes and recompiles (PP, CTX): ids, groups, values and
diagnostics instead of raw emitted text;
- directive prologue: directives compared as a set;
- route HMR without splitting: Vue routes created by the real vue-router;
Solid is syntax-only here (real page: route-hmr-browser-frameworks);
- unowned modules: an unregistered genuine createFileRoute module and a
registered route file using a foreign look-alike. A local shadowing
factory in a route file is split today: new pin in known-bugs (verified
red: the look-alike's component becomes lazy).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The determinism observation included the raw route tree text, whose
names, printing and comments are free (SPEC §5.1/§5.5), so a semantically
deterministic tree with a cwd-bearing comment failed (V1R gen G07). Now
the observation is the routes the router builds (lazy files limited to
the app's own) and, across listing orders, the generator's warnings and
errors. Byte identity of the tree stays as an implementation control in
outside-compiler-corpus/tree-bytes.test.ts. The app and listing-order
seam move to determinism-app.ts, shared by both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
G05 (V1R gen): the fault of the publication tests matched every write and
rename, so the first (route file) publication failed and the route tree's
failure path was never exercised; now the fault targets one destination
(its writes by content, its rename by target), the test checks the
faulted publication was attempted, the faulted destination keeps its
complete old content and the other one is old or complete new (readers
see only those). The tmpDir-on-another-device pin now makes its baseline
run on the app's filesystem and switches tmpDir for the observed run
(the EXDEV failure was in the baseline, before the reader boundary).
Re-checked red without .fails: EXDEV on the observed rename.
G06 / moot pin: J1.6/J1.16 promise atomic destinations, not a project
free of other files, and no ruling adopts a cleanup contract. The
acceptance test keeps the saved source and the usable tree; the cleanup
pin moves to outside-compiler-corpus/abandoned-staging.test.ts and checks
for a staged copy of the abandoned fix rather than the whole file list.
Re-checked red without .fails (the tmp copy).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
V1R split S06/S26/S31/S32: the classic-pragma pins render through the real
@emotion/react and React (compared with the untouched file) instead of
string factories labelled Emotion/Preact; the application factory row is an
application module. The D5 Fragment check no longer fixes the chunk's import
inventory. The re-export/default-class pin looks for a marker in the class
body across every module the lazy options load. The Solid deleteNodes row
validates bindings and checks no emitted object literal keeps ssr/server/headers.
All changed pins verified red without .fails for their stated reason.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A standalone (group).tsx is an undocumented extension (SPEC §2.2): the
test required a diagnostic even on success, so a generator routing the
group's children correctly without a warning failed (V1R gen G01). Now a
failed run naming the file, a reported fallback with a loadable tree, or
no diagnostic with correct routing (no full path names the group, the
group index and /about render at their URLs) all pass. No parent
interpretation of (group).tsx is required. The apps are temporary apps
with real route files (the old fixture files were placeholders); a control
runs the routing check on the documented group directory.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fixture table compared every file newly evaluated by each route's
loadRouteChunk, in route id order: a generated lazy facade or support
module failed the exact inventory, and a shared dependency was attributed
to the first route loaded (V1R gen G03). Now: ids, full paths, parents and
route files stay exact; each listed lazy file is absent before its route
is loaded, present after, and its lazy Route's options are the route's.
Checked red on a wrong attachment (lazy file listed under /posts/).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The helper masked every router package import, so a separate import's
comment could be dropped and an edited import's bindings could change
package unnoticed (V1R gen G04). Only the imports that bind a route
constructor (plus one other router import when the file lacked the
constructor it now uses) may change; their other bindings keep imported
name, local name, type/value meaning and source package. New controls:
an untouched router import's comment, its package, a merge into the
constructor import, a missing constructor import joining an import.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under load (local load 18-35; beetle 17-44), a file deleted right after
the Rsbuild dev server started was never reported and the edit hung:
Rspack attaches its watcher on the tick after the first compile's
`done`, and watchpack then scans the watched directories; a file the
scan's listing had but whose stat then fails (deleted meanwhile) ends
up neither known nor missing, so neither the scan's end nor the watch
event reports it (watchpack 2.5.2 DirectoryWatcher.doScan; traced with
harness instrumentation, reverted: `watch:attach` 0.014 s, `rm` 0.015 s,
no watcher event, 0 compiles in 60 s).
The tracker's `watching(root, timeout)` waits, a turn of the event loop
at a time, until every compiler's watcher is attached and watchpack's
`getTimeInfoEntries()` has an entry (a time, or `null` once the scan
ended) for every app file the last compile read or looked for. The
start, `edit()` and `settle()` wait for it; `timeout` only guards.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test-budgets.json now holds local-iteration budgets (DECISIONS 2026-10-19):
per package a [target, hard] for the fast and slow tier at --maxWorkers=4,
15 s for any slow-tier file, 10 s edit to result for a fast-tier slice.
Numbers come from three quiet-machine runs per tier (load < 4) with
headroom. CI / one-worker runs are reported only.
The reporter stays report-only in normal runs. COMPILER_TEST_BUDGETS=strict
fails a run over a hard limit or the per-file limit, or not at 4 workers,
and says it is meant for a quiet machine. Partial runs (file or -t
filters) get no tier verdict; a partial fast-tier run reports the Vitest
part of edit to result.
compiler-test-utils/AGENTS.md documents running one file or -t filter
through Nx, the `|` caveat, the slow-tier load gate and strict mode; the
other compiler packages' AGENTS.md point to it (react-start-rsc gets one).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the user saves a route file with the right id while the generator
is fixing it, safeFileWrite throws `rerun` after writing its temporary
file, the rerun has nothing to write, and the file stays in tmpDir
(default .tanstack/tmp). The save is scheduled through the generator's
`fs` option, like the other race tests in the file; the assertion is that
only the app's files remain under the app. Red without `.fails`
(tmp/<session>-<hash> left); a probe removing the temporary file before
`throw rerun` makes it pass (reverted).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Rsbuild row of rsc-start-hmr.test.ts now runs the Vite twin's sequence:
a handler edit reaches the next call with no reload and the client output
never has the handler, then a component edit hot-updates the page keeping
its state. The call button shows the page text with the answer, so the
call after the component edit is told apart from the kept state (both rows
now check that the server fn still answers after the component edit).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W3-harness2 (with W3-ip-v2): Rsbuild dev diagnostics of every compile
(ctu `RsbuildDevServer.diagnostics`), the import-protection v2-* rows,
the V2-14 Rsbuild page row, and one file per Rsbuild delete/recreate edit
(user-authorized workaround of the Rspack/watchpack 2.5.2 lost-removal
bug, FOLLOWUPS "UPSTREAM (W3-harness2)").
The merge drops the temporary eslint ignore of the import-protection test
files (W3-speed-spc): their lint errors are fixed on this branch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Traced (harness instrumentation, reverted): Rspack's MultiCompiler starts
the compile of a dependent environment (Start's `ssr` after `client`)
through its queue on the tick after its parent's compile ended
(`Watching.invalidate()` from `processQueueWorker`), which the harness's
`settle()` cannot see yet; the next write landed while that compile
paused the watcher, and a removal is then lost (2 of 20 solo runs after
the previous step). `settledAcrossTurn` (v2-hosts.ts): `settle()`, a
`setImmediate` turn, `settle()` again. Used by the v2-edits Rsbuild
sequence and the Rsbuild page row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 9 errors W3-speed-spc's temporary eslint ignore hides: unused
imports, import order and sorted members (eslint --fix), an unnecessary
`?.`, and the CommonJS `module` object of a VM context renamed to `cjs`
(import/no-commonjs). Lint fixes only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A compile the start or the previous step still has pending (a redundant
compile after an edit, the Start plugin's invalidations) pauses the
watcher while the first removal of the step lands, and the removal is
lost (3 of 20 solo runs of v2-edits). `settle()` first: the harness's
event-based wait for no running or pending compile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restores the two plugin-options "autoCodeSplitting: undefined splits
nothing and still generates the route tree (rspack, webpack)" cells: each
entry (Vite, Rspack, webpack) takes the user's options through its own code
before the default applies, and the harness turns splitting on by default,
so these cells are the only per-entry checks of the default. The other 13
removals stand (see merge-b-c.md "merge W3-speed-rp").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
User ruling 2026-10-19 (DECISIONS): the Rsbuild sequences delete and
recreate one file per `edit()`, settled before the next write, with a
comment citing FOLLOWUPS "UPSTREAM (W3-harness2)" (Rspack's vendored
watchpack 2.5.2 loses a removal landing while a compile runs; merge the
steps back once Rspack bundles watchpack >= 2.6): v2-edits.test.ts
(both targets, deleted then recreated separately again, as the rows
describe) and rsbuild/dev-server.test.ts "deleting a module with a
server fn" (the deletion before the entry's edit, each on its own).
V2-14's page half on Rsbuild: v2-edits-page-rsbuild.test.ts, the same
page app and steps as the Vite twin (shared from v2-hosts.ts) on
Start's whole Rsbuild plugin with @rsbuild/plugin-react, as the
hydrate-dev Rsbuild rows; checks the hot update (no page load), no
secret in the client's chunks or hot updates, the live use's safe
mock, and the last compile's reports. Rsbuild reports the violation
the edit adds to the page's component, which the Vite twin pins.
v2-edits Vite rows: the recreated state is loaded in both environments
before the step's edit, so the handling of the recreations ends by
the loads' completion and the logs since the mark are the step's edit
alone. The stale report the step-2 pin targets is logged inside the
edit's settle, from processPendingViolations through resolveId while
the Start compiler resolves the denied import in the SSR transform of
the edited file (traced with a temporary probe, reverted).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit put the generator's tmpDir in the app's root, which
races with the app's removal: Vite runs the plugins' configResolved hooks
concurrently (Promise.all in vite 8.3.4), so a build that fails while the
generator's hook still runs (code-splitter-pragmas' plugin-order rows)
returns before the generator's last write, and that write into the app
during dispose() failed the removal (ENOTEMPTY, once in a 1-worker run).
Those late writes were the two never-renamed files the default tmpDir
(.tanstack/tmp in the package) kept after every run.
A Vitest global setup now creates one directory per run under the
package's ignored .tanstack (same filesystem as the apps: the generator
renames its temporary files into them; os.tmpdir() is another filesystem
here and breaks every generator write) and removes it when the run ends.
The harness builds get it through inject().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The files of one edit are written one by one and Rsbuild
(`aggregateTimeout: 0`) may compile in between; that compile reports
the transient state (targets back, live uses not removed yet) under
`log: 'always'`, which `diagnostics.slice(since)` then showed as a
stale report of step 2 (1 of 6 full-tier runs, 1 of 10 solo runs). The
last compile reports every violation of the step's state.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W3 speed pass for start-plugin-core and react-start-rsc: spc tests linted,
Hydrate rejection checks on the shared diagnostic helpers
(compileErrorMessage deleted), hydrate-dev split per bundler,
known-bugs-start-compiler dev block split out with a shared client-access
build, class build pin on Vite only, rsc V2-13 Rsbuild component edit with
@rsbuild/plugin-react.
Counts: spc unit 1101/191 (1292), spc integration 754/190 (944), rsc unit
49, rsc integration 87/10 (97); integration tiers twice, identical.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shared non-ASCII / .jsx app reads generation, placement of live code
and rendering, none of which webpack's minifier decides (as in
build-frameworks and plugin-options): its webpack build skips terser
(2.25 s -> 0.64 s). The cached-rebuild rows stay minified.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Vite harness's settle-round limit (10) is the `settleRounds`
option. The control test of a plugin that rewrites a file on every
event uses 3 rounds: the loop shows after the first, and 10 rounds cost
~1.4 s of the fast tier's 2.8 s file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nothing in src or tests imports it. Lockfile regenerated with
`pnpm install --no-frozen-lockfile`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Rsbuild dev reads of import-protection reports and compiler
warnings go through the harness's `diagnostics` (every compile since
start) with `findDiagnostics` by severity, instead of the last
compile's `warnings`/`errors`: rsbuild/import-protection.test.ts (the
Start server read right after start, the behavior rows, the reports
across rebuilds, which now compare the set of reports since a mark),
reported-location.test.ts, known-bugs.test.ts, and the
start-build-warnings.test.ts Rsbuild dev pin (re-verified red for its
stated bug: no warning in any compile). The violation-report adapter
accepts anything `diagnosticsOf` reads (`ReportOutput`).
The W3-ip-v2 Rsbuild rows are back on the default `log` (`'once'`);
`rsbuildDevLog` (`'always'` as a harness workaround) is gone. v2-edits
keeps `log: 'always'` explicitly (its rows test stale reports), reads
the reports since its mark, loses the `DEBUGLOGS` print, and names the
upstream cause of its Rsbuild delete flake (FOLLOWUPS: Rspack loses a
file removal that lands while a compile runs; watchpack 2.6.0 fixes it,
Rspack vendors 2.5.2).
router-plugin's route-hmr-page.ts no longer accumulates the Rsbuild
warnings itself.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`RsbuildDevServer.diagnostics` holds the errors and warnings of every
compile of every environment since the server started, as A9
diagnostics, read at each environment compiler's `done` (where the
compilation is still accessible; `onDevCompileDone` cannot read a
compilation Rspack has dropped). A dev server compiles again on its own
(a file a plugin wrote, a file found outdated when the watcher attaches
after a compile), and Start's import protection reports a violation
once by default, so the last compile's `warnings`/`errors` could lose a
report. Tests mark a point with `server.diagnostics.length` and read
`slice(since)`, as with the Vite harness's `logs`. `errors`/`warnings`
stay the last compile's.
Control test: a plugin reporting in the first compile only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds the approved `@rsbuild/plugin-react` devDependency (DECISIONS
2026-10-19; lockfile regenerated with `pnpm install --no-frozen-lockfile`:
one importer entry, same @rsbuild/core 2.2.5 variant as the other
packages, no new vite copy).
rsc-start-hmr.test.ts gets the Rsbuild half next to the Vite one: on
Start's Rsbuild RSC dev server with `pluginReact()`, a real page counts to
2, the route module (which also declares the server fn its loader and page
call) gets a component edit; the page shows the edit with the count kept,
the server fn still answers, no full reload (`loads() === 1`), no error.
The handler half on Rsbuild stays in rsc-start-rsbuild.test.ts. Note: the
row also passes without `pluginReact()` (TanStack's route HMR keeps the
state); the plugin stays because a React app on Rsbuild has it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured first (spc test:integration, idle box): hydrate-dev 11.4 s and
known-bugs-start-compiler 11.4 s at 1 worker, the two slowest files
(13.4-17 s at 4 workers under load, against the 15 s per-file limit).
- hydrate-dev.test.ts split per bundler: the Vite rows stay (React edit,
split route composition, Solid edit), the Rsbuild rows move to
hydrate-dev-rsbuild.test.ts, the shared apps and edit scenario to
hydrate-dev-edits.ts. Every row edits its app, so no server is shared.
No assertion changed.
- known-bugs-start-compiler: the Vite dev server block moves to
known-bugs-start-compiler-dev.test.ts (unchanged, plus two lint fixes:
the settled flag is read through a function, `isRunnableDevEnvironment`
alone guards the SSR environment).
- The control "SSR: a server fn the client references is callable over
HTTP ..." and the D6 pin "... only server code references is not
callable over HTTP" read one build and run per bundler
(`callClientAccess`, memoised): one build less per bundler.
- The build pin "client: the server-only module of a class only server
code uses is not bundled" runs on Vite only. The compiler decides it
(the import it leaves in the client module loads the server-only module
in any bundler); the in-process pin "client: a class used by a server fn
handler does not load its server-only import"
(../known-bugs-start-compiler.test.ts) decides it, and the Vite cell
stays its build canary. Removed: the Rsbuild cell (1 xfail).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`compileErrorMessage` parsed Babel's printed code frame (` 12 | code`,
` | ^^^ message`) to drop the quoted source. Its users now go through the
shared diagnostic helpers, which ignore the frame in any layout:
- known-bugs-hydrate: the `arguments` / `await` rejection branches of two
pins use `expectCompileError` (names in the error's own words, position
free as before); `await` accepts `await` or `async`, as the regex did.
The harness control checks that each rejection fails on an unrelated
error whose frame quotes `arguments`, `Route` and `await`.
- hydrate-boundary-forms: `expectExtractionRejected` matches the pattern
and the documented fix in `withoutQuotedSource(...)`; the `this`/`super`
control uses `expectCompileError` (names the read, at the boundary line).
Also drops the unused `expectDiagnostic` import.
- hydrate-split-modules: the empty-boundary row reads errors through
`withoutQuotedSource` (also an import-order lint fix).
- regression-helpers.ts: `handler.serverFnMeta?.id` (lint).
`compileErrorMessage` and its self-test are deleted. Re-checked red without
`.fails`: arguments pin (renders `<p></p>`), await pin (chunk SyntaxError),
this/super pins (no documented fix in the message).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`test:eslint` now lints `./src ./tests`, as react-start-rsc and
compiler-test-utils do (the test files and harnesses were never linted).
Lint fixes only:
- build-harness.ts: `watching.close()` (unnecessary `?.`).
- known-bugs-start-compiler.test.ts: the CommonJS rows' local `module`
variable renamed `cjs` (import/no-commonjs read it as CommonJS).
- import order / sorted members: createIsomorphicFn, entry-planning,
rsbuild/post-build.
The import-protection test files (tests/**/importProtection/**,
tests/integration/rsbuild/import-protection.test.ts) are being reworked on
the W3-harness2 branch: eslint.config.js ignores them TEMPORARILY; the
coordinator removes that block once W3-harness2 merges (they report 9
errors today, listed in the W3-speed-spc report).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test:eslint now lints ./src ./tests (precedent: compiler-test-utils,
react-start-rsc, router-devtools-core). Per-package ignores for fixtures
outside the TypeScript project, as tsconfig.json excludes them: rp
tests/**/test-files/**; rg the generator's fixture apps
(tests/generator/**, their *.test-d.ts type tests still linted).
Lint fixes only, no assertion changes: unnecessary `!` on Vite's client
environment (dev-server.ts, route-hmr-page.ts) and `as string`
(route-id.ts), import order, a for-of over a growing list, an unused
helper (rp plugin-options.test.ts `read`, shadowed), `async` without
`await` (callbacks that must return a promise now return one; React's
async act() calls keep `async` with a disable comment), a type parameter
name, and type-only router constants in nested/tests.test-d.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The non-ASCII route file and the .jsx route file rows built the same
kind of app per bundler: one app per bundler now holds both route files
(distinct markers), built and run once per route; each test reads its own
route's placement and rendering.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- page-code "a component the route file writes a property of loads with
its chunk and renders the property": one cell (Vite, no sideEffects
hint) of eight. The route module reading the undeclared `Page` is the
transform's output for every bundler and hint (in process: "top-level
writes to the split component (property assignment) stay with the
binding they write"); where a fixed route's component lands is the
bundler's, decided by the controls in every bundler and hint.
- build-harness.test "router plugin with vite/rspack loads a split
component lazily and renders it (ssr/client)": the same harness call
and outcome as build-frameworks' "vite/rspack react ssr/client build the
split component loads lazily and renders". The minified webpack rows
stay (build-frameworks builds webpack unminified).
- plugin-options "autoCodeSplitting: undefined splits nothing … (rspack,
webpack)": the default is resolved by the shared config schema after
the entries, which pass an absent option on as they pass `false`
(decided by the Vite `undefined` cell and the `false` cells per entry).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each pin waits its full settle timeout (6 s) for the outcome of a correct
generator, so the file of both took 13 s at 1 worker. The physical()
mount pin moves to known-bugs-rsbuild-generator-physical.test.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
integration/known-bugs-route-hmr.test.ts took 13.1 s at 1 worker (over
the 12 s watch line). The pins of component shapes React Refresh does not
register (inline wrapped components, lowercase split components, their
memo/forwardRef controls) move to known-bugs-route-hmr-components.test.ts;
`inPlace` and `editRoute` to tests/route-hmr-edit.ts. Same tests, same
names; references to the moved pins updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build-production.test.ts took 15.4 s at 1 worker (per-file limit 15 s),
two thirds of it webpack. Its checks move to tests/production-bundle.ts;
build-production.test.ts keeps Vite, Rspack and Rsbuild, and
build-production-webpack.test.ts has webpack. Same tests, same names.
known-bugs-route-hmr-production.test.ts "a production client bundle has
no route HMR code when NODE_ENV is unset (rspack/webpack)" built the same
app as build-production's "rspack/webpack a production react client
bundle without code splitting has no dev-only code" pins (React,
autoCodeSplitting off, addHmr default, NODE_ENV unset), whose hot-API
check includes theirs: deleted, cited from the control they pinned.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each rp test:integration run left two route trees in
packages/router-plugin/.tanstack/tmp: the generator writes its temporary
files under the working directory unless told otherwise, and a write
that is never renamed stays there. Traced to
integration/code-splitter-pragmas.test.ts ("a framework JSX plugin
registered before the router plugin", React and Solid rows), through
the build harness. Harness builds now give the generator a tmpDir in the
app's own root, which the harness removes with the app.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Recreated alone after the compile that failed to resolve them, no compile
included them under load (full tier, 60 s timeout): Rspack's watcher of
missing files, outside import protection.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W3-solid-rsbuild: @rsbuild/plugin-solid ^1.2.2 in all 7 manifests
(DECISIONS 2026-10-19, solid-refresh back to 0.6.3), Solid Rsbuild page
app in development mode, V2-20 Solid row on Start's Rsbuild dev server.
No conflicts; the lockfile is the branch's (frozen install passes).
spc unit 1102/191, spc integration 754/191 (753+1),
rp unit 450/180, rp integration 361/184.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W3-compose: cross-feature compositions (FIX-PLAN §G V2-01, V2-03, V2-06,
V2-10, V2-16, V2-27). No conflicts; build-harness.ts gains the `prefix`
option next to W3-start-v2's `symlinks` and W3-hydrate's `framework`.
spc unit 1102/191, spc integration 753/191 (719+34 / 180+11),
rp unit 450/180 (447+3 / 178+2), rp integration 361/184 (357+4).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Allowed -> denied -> allowed edits with targets deleted and recreated, both
directions, Vite and Rsbuild dev, plus a real page on Vite. Pins: Vite
log 'always' logs a removed server violation again on the fixing edit; the
page misses the violation an edit adds (incoming edges dropped).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pins: Rsbuild dev gives exempt and allowed importers the mock (self-denial in
the loader); Vite dev Promise<false> twin of the sync pin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
import type, inline type, export type, export type * and a mixed import, on
Vite and Rsbuild builds and dev servers; plus a mixed import whose value only
a server fn handler uses under verbatimModuleSyntax (catches V4 red-fable/12).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vite-tsconfig-paths before and after Start, Vite's resolve.tsconfigPaths and
Rsbuild's tsconfig paths: build failure report, dev safe mock, dev error
mode. Pins: with vite-tsconfig-paths the report names the nested
re-resolution's specifier (src/secret.server) instead of ~/secret.server.
vite-tsconfig-paths was already a devDependency of start-plugin-core
(one vite copy in its closure).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TS 5.6 and 5.9 reject the direct conversion of node:stream/web's
ReadableStream to the DOM one (TS2352); test:types passes on 5.6–7.0.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`startRsbuildStartDevServer` takes `framework` (Start's plugin gets it;
`solid` links the built @tanstack/solid-start and @tanstack/solid-router,
like the Vite dev harness). The Solid edit row runs on it with the
user-level Solid Rsbuild config (`solidAppConfig`: plugin-babel +
per-environment plugin-solid) and the same oracle as React/Vite: the
page hydrates, the loaded child shows each edit, the sibling opened
later shows the edited version, one page load, no errors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With @rsbuild/plugin-solid ^1.2.2 (solid-refresh 0.6), a development-mode
Rsbuild build of a Solid app hydrates, so the production-only exception
goes: every page app is a development build. Same results as the
production baseline: 17 passed + 2 expected fail; both pins re-checked
red without `.fails` in development mode (namespace Start.Hydrate:
loadedByClick false; page-module context: "no-provider").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rsbuild/plugin-solid 1.1.1 injects solid-refresh 0.7 (granular `jsx`
HMR on by default) into the client only, so hydration keys diverge from
the server's and Solid apps throw "Hydration Mismatch" in `rsbuild dev`
and `rsbuild build --mode development`. 1.2.2 (rsbuild #7832) reverts to
solid-refresh ^0.6.3. Approved by the user (DECISIONS 2026-10-19).
Lockfile regenerated with `pnpm install --no-frozen-lockfile`;
solid-refresh 0.7.8 is gone, one solid-js, vite variants unchanged.
plugin-solid 1.2.2 brings its own @rsbuild/plugin-babel@1.2.1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- tests/code-splitter-imported-options.test.ts (fast tier): a local
options object (control: split, deleteNodes applied, nothing reported)
and an options object imported from another module: the route keeps
working through the real router; two .fails pins (new main bug: the
splitter resolves only local object literals, so the route is neither
split nor reported, and Start's client deleteNodes leave `server` in
place). Stubs are created per load: the real router updates the options
object a route is created with.
- tests/integration/split-mode-parity.test.ts: one app (default
groupings, a `codeSplitGroupings` route, a `splitBehavior` route, a
route with the options Start deletes) observed through the real
router's public lazy contract in a real page, in Vite dev, Vite build,
Rsbuild dev and Rsbuild build: each build matches the configuration and
each dev server matches its build. Dev servers start one at a time and
before the builds (a build sets NODE_ENV=production while it runs, and
a dev server configured meanwhile reads it).
tsc (TS 7, @tanstack/react-router declarations with a generated
routeTree.gen.ts): the fixtures type-check — `ssr: false`, `headers`,
the `codeSplitGroupings` route option, and `createFileRoute('/x')(options)`
with imported and local options. `server` is a Start-only option, so the
plain-router parity app uses `ssr` and `headers`. Exit 0.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
New `tests/integration/start-compose-app.ts`: Start's default page entries
(StartClient hydration, the server entry), a production host serving the
client output and handing other requests to the server entry's `fetch`
in-process (Node's own `import()` through ctu's native-import helper), a
page helper recording server fn and script requests, and a tsc helper.
New files:
- start-compose-server-fn-route.test.ts (V2-01): route file with a server
fn read by the loader and the split component; Vite + Rsbuild served
builds and a Vite dev page. The SSR init-count row is .fails (the
pinned provider double initialisation, known-bugs-start-compiler).
- start-compose-client-only.test.ts (V2-06): <ClientOnly> children
importing chart.client.tsx in a default-config build; passes.
- start-compose-server-only-routes.test.ts (V2-03): server-only
ancestor, server-only subtree, spread route; real client router
navigation, server handlers, generated types (tsc). Rsbuild pruning and
Vite spread rows cite the known-bugs-route-options pins.
- start-compose-project-path.test.ts (V2-27): project path with
`(2)+`, and a `src/routeTree-gen.ts` sibling; pins (new main bug: the
unescaped `new RegExp(<route tree path>)` filter).
- start-compose-imported-options.test.ts (V2-10, build half): pin (new
main bug: imported route options ship `server.handlers` silently).
`build-harness.ts`: `StartBuildOptions.prefix` (passed to createApp), for
the project-path app.
tsc (TS 7, real declarations of @tanstack/react-start and
@tanstack/react-router with a generated routeTree.gen.ts): every fixture
shape type-checks — `createFileRoute('/x')(options)` with options
imported from x.options.tsx (component, loader, server.handlers), the
spread route, server-only routes, the <ClientOnly> route, the posts route
with createServerFn and Route.useLoaderData(). Exit 0.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Start's Vite and Rsbuild builds: server code under sideEffects true/false/
array and PURE hints, dynamic imports in handlers and of server fn
modules, unresolvable platform imports with an external server build,
global createStart middleware, .jsx modules and routes, a builder reused
as middleware, libraries (start-client-core peer, explicitly bundled,
symlinked), build and dev source maps of server fn modules. One build per
bundler is shared where the rows allow. Fixtures type-checked (tsc 6.0.2)
against the built declarations: the V2-05 validator returns a
serializable input and the V2-09 handler casts the global middleware
context (as the e2e apps do); no other change.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Unresolvable server-only imports (cloudflare:workers, node:fs) compile
for the client and are read by the server outputs; a validator schema a
client form also uses keeps its behaviour while a validator-only schema
is not loaded; .jsx modules get the stub and render; a server fn builder
reused as middleware contributes its middleware; options by identifier
and spread keep the method. Every fixture type-checked against the built
@tanstack/react-start declarations (TypeScript 6.0.2): no errors.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A test app of the Start build harness can link a workspace package its
library depends on, or a package directory of the app, into node_modules
(StartBuildOptions.symlinks, merged over Start's runtime links).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Both red for the same reason without `.fails`: the `let` the loader assigns
moves to the shared module and the route module assigns the import
(code-splitter-scope: "Assignment to constant variable" at the loader;
ssr-builds row 1: Vite "[ASSIGN_TO_IMPORT] Cannot assign to import 'count'"
in routes/index.tsx). The real-build pin stays; the scope file cites it.
The in-process linker has live bindings, so the old "snapshots" reason was
stale.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The createServerOnlyFn(...).bind() pin it pointed to was deleted (E1 audit,
a945fe4563) in favour of this one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Route file names hold `()[]{}` (`(group).tsx`, `[id].tsx`, `{-$lang}.tsx`).
Tokens may now hold bracketed groups without separators, commas or colons
(position suffixes and bracket-quoted paths stay out); bracket-free tokens
are still read. New rows fail on the old reader (7), controls pass on both.
router-generator's `(group).tsx` test uses the oracle instead of matching
the path itself.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`test:unit` was two commands, so `-- --maxWorkers=N` only reached the
second. Vitest runs type tests in a group after the runtime groups, so one
run of both projects keeps the order: 336 passed + 24 expected fail, 24
files, before and after.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Temporary files of atomic saves go to a per-app `<root>.saving` directory
next to the app, removed by the app's dispose, instead of a shared
`.harness-tmp/` left next to the apps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Rsbuild harness probed a free port, closed it, and Rsbuild bound it
after the first compile; Vite's `listen(0)` / `port: 0` (8.3.4) probes,
closes and binds too. Under load another process takes the port
(EADDRINUSE / "Port … is already in use").
- Rsbuild (page): Rsbuild's custom server API (`middlewareMode`,
`middlewares`, `connectWebSocket`, `afterListen`) on an HTTP server that
binds port 0; the HMR client connects to the page's port.
- Vite: `listen()` on Vite's default port with `strictPort` off: the real
server binds and moves to the next port while one is in use; `url` reads
the bound port. Same for start-plugin-core's bundled dev styles test and
the react-start-rsc preview server.
Under a port-churn load: route-hmr-browser 2/15 runs failed before, 0/30
after; real Rsbuild starts 40/1000 failed before, 0/1000 after; real Vite
listen(0) 19/5000 vs listen() 0/5000.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mdx-js/rollup always passes source-map's SourceMapGenerator (its options
type omits it: TS2353 under test:types); the rows are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Solid's hot update remounts the edited module's components one after the
other; one validation run read b's section while it was re-rendering.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
V4 red-astra/19 (catch parameters no longer shadow the import in the usage
lookup) escaped the acceptance corpus once the internal lookup tests moved
out: the ported rows used a call for the real use, which the lookup
prefers over the shadow's read. The real use is now a read too; the four
catch-clause rows go red under the variant (reported at 3:49, the catch
body), green on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Solid page suite (hydrate-pages-solid.ts) runs per bundler:
hydrate-pages-solid.test.ts (Vite) and the new
hydrate-pages-solid-rsbuild.test.ts (Rsbuild with @rsbuild/plugin-babel
and per-environment @rsbuild/plugin-solid presets, solid condition).
The Solid Rsbuild app is a production build: a development-mode
Rsbuild build of a Solid app mismatches at the root even for a page
without <Hydrate>. Both pins (namespace, page-module context) verified
red on Rsbuild without .fails.
- V2-20 on Start's Rsbuild dev server for React with
@rsbuild/plugin-react (React Refresh). The Solid Rsbuild dev row is not
added: a plain Solid Start page (no <Hydrate>) served by Start's Rsbuild
dev server does not hydrate ('template is not a function'), also with
@tanstack/solid-start's own preset configuration.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DECISIONS 2026-10-19 (coordinator): same ranges as router-plugin. Lockfile
+9 lines; frozen install passes; one vite copy, one solid-js@1.9.12.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SPEC J6.10 (V1 F note for W3-ip): a client import of a dependency that
marks itself server-only and is not pre-bundled (optimizeDeps.exclude);
by default the client gets the real module unlogged, with excludeFiles: []
it is logged and mocked. Both are pinned: Vite dev checks the marker
anyway and then fails to load the dependency with an internal error
("The "code" property of ModuleInfo is not supported").
SPEC J6.11 (V1 F note for W3-ip): a module both environments load logs
each environment's violation whichever environment transforms it first
(passes).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IP-S19: the client-entry, server-entry and split-component rows no longer
load Start's generated virtual ids or parse `import("...")`: a real
browser page served by Start's dev middleware runs the app's client entry
(control: its denied import is a safe mock; pin: not logged) and renders a
split route (`ssr: false`) with the mock; the app's server entry runs for
an HTTP request (control + pin). New file dev-page.test.ts.
IP-S09: the tsconfig reload rows no longer require Vite's full-reload
message; the 'always' row is the control that the modules were
transformed again.
IP-S22: the MDX rows run @mdx-js/rollup with its SourceMapGenerator; a
reported location in the page must be the original import or use (main
names the page without a location, which SPEC §5 item 14 allows). The
denied-specifier pin asks for the same.
IP-S23: the `.page` rows are named as the custom module type they are; the
same pins through the real @mdx-js/loader on Rsbuild dev (control passes),
asking for the page located in its MDX source if at all.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IP-S07: a trace is any real import chain from the entry to the importer
(dev and build rows accept both chains of the fixture). IP-S08: a reported
location is the original import (any column of its line) or a genuine
surviving use, in any file spelling that names the file (mentionsFile);
the marker rows also accept the marked module (audit F ASK-1). Wrong
places (db.eq, type positions, removed boundaries, compiled coordinates)
still fail.
IP-S24/S14/S26: the Unicode/CRLF, catch-clause and scope-shadowing shapes
of the internal usage lookup, a wrapped createServerOnlyFn argument, a
dynamic import with attributes and a re-export are ported to real reports
on Vite/Rsbuild dev and build. New pins (Rsbuild): the wrapped boundary use
is reported (5:48), a dynamic import is reported off its line (dev 1:1,
build 1:33). The internal pin they replace and the any-offset/any-caret
rows are deleted; the remaining internal helper tests (usage lookup,
location index/cache/snippet, matcher arrays, utils, dedupe keys, import
sources) move to outside-compiler-corpus/importProtection as internal
controls. The original-usage table and the real source-map rows stay
(compiler-level, V1 ip R01).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DECISIONS 2026-10-18 (server-side *.client.* imports): the hydrated page
renders the children, the default-config build reports no
import-protection violation, and the server bundle has none of the
module's code. Control: the same module used outside ClientOnly fails the
build with 'Import denied in server environment'.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- New integration/hydrate-dev.test.ts on Start's Vite dev server with SSR
and StartClient hydration in Chromium:
- V2-20: a loaded child hot-updates in place (children JSX, then a
capture) without reload, effects not duplicated, and a sibling whose
code had not loaded shows the edited version once opened; React
(React Refresh) and Solid (vite-plugin-solid). This is also the real
Solid <Hydrate> dev row (DECISIONS 2026-10-19) replacing the stand-in
deleted in wave 2.
- Splitter composition: a split route component's boundaries hydrate
the server HTML; the deferred child's code loads on its interaction.
- dev-server.ts: minimal framework option (Solid core options, linked
solid-start/solid-router, noExternal).
- hydrate-build: HYD-07 file + line of the rejection in real Vite and
Rsbuild builds (function child, hook call).
Rsbuild dev edit rows are not added: a React Start app on Rsbuild needs
@rsbuild/plugin-react for React Refresh, not a start-plugin-core devDep.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack prints a loader's error inside a miette box whose lines start with
a vertical bar, so the Babel frame the Start compiler throws (which marks
the boundary's line with >) was not recognised as a position. Control row
added; it is red without the change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IP-S06: the rows denying the rewritten specifier `ui-lib/button` are
deleted (SPEC J6.1: a specifier rule matches what the user wrote); the
`ui-lib` pin stays and now also asks for the importer at the import or the
use. New: the file rule and a server-only marker apply to the module the
rewritten import resolves to (pass), and the location of a file-rule
violation on a rewritten import is pinned (reported at 2:25, neither the
import nor the use; the cause of the deleted 2:16 pin).
IP-S21: a module that fails to compile fails the build naming the broken
file and line through the diagnostic oracle, other diagnostics allowed; a
missing module ends the Rsbuild dev compile with errors that name it (file
or specifier), not one exact transcript.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IP-S11/S12: the license rows are deleted (OQ12, 2026-10-18: comment
placement is free for the import-protection rewrite). The JSX pragma pin
needed a JSX plugin that runs after the rewrite; on real apps Vite (Oxc)
and Rsbuild (SWC) compile JSX first, so the app twins pass: a pragma
leading a denied file, a denied specifier (rewritten in the importer) and
a pragma after a directive (the Yuku regression the control guarded), on
Vite dev and Vite/Rsbuild mock-mode builds. No reachable failing order was
found with the available plugins, so the internal pin is removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
trace.test.ts calls exported internals (ImportGraph, buildTrace,
formatViolation): it moves to outside-compiler-corpus/ as an internal
control (SPEC §8, V1 ip S14/S24). Its prose checks (specifier pattern,
file pattern, Suggestions:, the suggestion sentences, the JSX example)
become the rule named through the diagnostic oracle and the direction of
the suggestions; the weak maxDepth/cycle rows are deleted (covered by
build-options maxTraceDepth and reported-location's cycle row), as is the
absolute-vs-relative specifier spelling row (SPEC §5.7 frees it). Dev
reports suggest a server-side fix for a client violation and a client-side
fix for a server one; suggestedDirections has its own adapter rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- HYD-07: unsafe children (function child, hook call) must be rejected by
the client compilation itself, naming the pattern and a documented fix
at a line of the boundary (shared A9 diagnostics); dynamic split={flag}
rows; literal split={false} controls for function/hook/this/super.
New pin: the this/super rejection names no fix (docs: wrap in a
function component or split={false}); React.useId pin now asks for the
rejection (SPEC J5.5). Both verified red without .fails for that reason.
- HYD-09: split="false" row deleted (tsc: TS2322 'string' is not
assignable to 'boolean | undefined'); split={false} rows cover the
supported opt-out.
- HYD-10: shared-object fallback goal deleted (SPEC J5.3 / docs allow
keeping it); the render row stays.
- HYD-11: module-level fallback rows keep validity and child output, no
whole-module marker check.
- HYD-13: children={null}/{null} control (tsc: accepted); the childless
row (tsc: rejected, children required) is labelled a JS mistake.
- HYD-20: directive membership in the prologue, order free.
- HYD-21: source maps checked on parsed string tokens of parent and
child throws through the shared consumer; hand needles removed.
- HYD-22: generated-name fixtures always include fixed names; no
nonempty requirement.
- §D: namespace negatives (another package's namespace, a shadowing
local) are left alone; the in-process namespace goal and the B row
moved to real hydration (integration/hydrate-pages-*).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- hydrate-pages.ts builds React apps with Vite or Rsbuild and Solid apps
with Vite + vite-plugin-solid (Solid's hydrate after its hydration
script); build-harness gets a minimal framework option (core options +
linked @tanstack/solid-start and solid-router).
- The React page suite (hydrate-pages-react.ts) runs per bundler:
hydrate-pages.test.ts (Vite) and hydrate-pages-rsbuild.test.ts.
- New hydrate-pages-solid.test.ts: identity rows, prefetch, fallback of a
boundary appearing after hydration, namespace and destructured Hydrate.
- V2-19: split children follow parent updates, context, callbacks and a
keyed reorder like the split={false} reference (React Vite/Rsbuild,
Solid).
- §D namespace goal moves to real hydration (.fails, React per bundler
and Solid): its children's code must load when it hydrates. Verified
red without .fails: nothing loads on the click.
- New Solid pin: a context declared in the page module is re-created in
the chunk (Solid twin of the known-bugs-hydrate context pin).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Approved in DECISIONS 2026-10-19 (start-plugin-core Solid devDeps). The
integration tier also builds @tanstack/solid-start (task-level dependsOn,
no package dependency, so no Nx cycle). One vite copy: spc and ctu resolve
the same vite@8.3.4 variant; one solid-js@1.9.12 for spc, solid-router and
solid-start.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The runtime diagnostic of a used mock (mockAccess) is now identified by
severity and the denied import (as written or its resolved file) through
@tanstack/compiler-test-utils/diagnostics, never by its sentences
(Mocked import used in dev client, Denied import:, Access:). Build reports
name the rule and suggest a fix in the right direction (an API that keeps
code on the server or on the client), whatever the wording; the
both-markers error names the file and both markers.
Mock mode always logs (user ruling 2026-10-19): server rows for mock-mode
builds (report + access pins, Vite and Rsbuild) and Rsbuild dev SSR
mockAccess rows (pass on main). The spc Rsbuild harness gains a start
option for Start's whole plugin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- S47: router.codeSplittingOptions placement and grouping observed at run
time (modules recording when they load; the loader call loading the
component's code), not by chunk file names.
- S48: the bundled-dev client label may be in any number of chunks.
- S35: delete the negative dev generateFunctionId row (dev ids are free,
SPEC J4.4); production customisation and dev agreement stay covered.
- New integration/start-build-user-code.test.ts: S28 __NO_SIDE_EFFECTS__
through real builds (with a no-Start control module); V2-23 decorated
classes and an assert import attribute build and run on Vite and Rsbuild,
plus a pin: the decorated class only a handler uses stays in the client
(class DCE root cause); S18 case 2: an ssr: false route with browser-only
code in its component and a server fn renders and answers by id.
- V2-23 fast rows: assert import attribute in every output; decorated
classes compile to valid modules.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
route-hmr.test.ts's 'serving a route prints nothing to the console' moves to
outside-compiler-corpus/route-hmr-debug-output.test.ts (React and Solid
rows). Instead of forbidding any log, the tests compare what serving the
same route prints (captureConsole) with and without TSR_VITE_DEBUG: with
default options nothing of what TSR_VITE_DEBUG=router-plugin adds is
printed, and TSR_VITE_DEBUG=start-plugin-core prints what the default does.
Mutation (debug on by default, reverted): the three tests fail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dev controls no longer look for route HMR spellings in served code
(they passed on any bundler HMR). They open the route file on a real page:
Vite dev with Start's whole Vite plugin and @vitejs/plugin-react, and
Rsbuild dev with Start's Rsbuild plugin and HMR; an edit of the loader shows
the new data without a reload, which needs route HMR (otherwise no module
accepts the edit). The Vite row also checks that the server environment's
route module uses no HMR API (J3.7).
The production rows drop the private names (tsr-route-id,
tsr-split-component, $RefreshReg$, TSRFastRefreshAnchor, ...) and check
the bundlers' HMR APIs in every client and server chunk (partial checks:
how route HMR is written is free). Start offers no option to turn route HMR
off, so no paired HMR-off build is possible through its public options.
Mutation checks (src, reverted): Start's client addHmr false fails both dev
controls; the server environment's addHmr true fails the Vite row with
__vite_ssr_import_meta__.hot in the served server route module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The in-process checks of which names React Refresh's transform registers
and which hook signatures it computes are replaced by edits on a real page
(Vite + @vitejs/plugin-react, real browser): the edit shows its new code in
place, without a reload or errors, and the edited component is not mounted
anew (countMounts: a state initializer).
- integration/route-hmr-browser-names.test.ts: lowercase function
components of component/errorComponent/pendingComponent with the default
and per-option groupings (each shown by its own route state); lowercase
function, overloaded, exported, default-exported declarations (split and
unsplit); unsplit const arrow, self-naming function expression, export
list; a reassigned declaration in a .jsx route.
- integration/route-hmr-browser-options.test.ts: inline anonymous function
and parenthesized arrow (split and unsplit); root route components inline,
as lowercase functions and with context type arguments (shell, root,
not-found shown together, root keeps its state); component options added
before a stateful inline component (the app router has default pending
and error components, so the route's boundaries do not change: adding a
boundary makes React mount the component anew, which is the router's
rendering, not the compiler's); a body edit of a custom hook keeps the
component, a change of its hooks shows without errors.
- known-bugs-route-hmr (integration): page pins for split lowercase
variables (red: applied without showing page v2), the lowercase function
that is also the unsplit pendingComponent (red: Export 'SplitComponent'
is not defined) and a split component exported by an export list (red:
Export 'page' is not defined, checked by importing the module in the
page).
- known-bugs-route-hmr (unit): the registration describe is deleted; the
pendingComponent and export-list pins keep their validity and render
checks, the export-list pin reads the export through a real importer
(importFromRoute) instead of the namespace.
- react-refresh-route-components: registration and signature tests
deleted; exported lowercase components are read through a real importer
module in the dev server (importFromRouteModule); the inner-binding and
imported-component rows keep their results.
- regression-helpers: expectRegisteredRouteOption and reactRefresh and
their controls deleted (no consumer left).
- route-hmr-page: countMounts/mountsOf, routerOptions for the app's router.
Mutation checks (product src, reverted): skipping the lowercase rename and
the split-chunk rename fails all 14 names rows; not hoisting inline
components fails 9 options rows; order-dependent hoisted names fail the
option-insertion row (unsplit).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HMR-27: the out-of-order edit tests no longer start a second dev server at
another root and compare export and import inventories with it. After the
edit, the route file's modules are requested in the tested order (Vite
keeps each result until the next edit), then the served route module is
loaded as a page loads it (evaluateServed, client environment: what the
server last compiled for each module, split chunks imported by the real
router's lazy components) and its split components are rendered. CardB
now counts its renders in module state, so the 'adding' pin observes two
module states (B1, B1 instead of B1, B2). Verified red without .fails:
removing -> SyntaxError: Export 'CardB' is not defined in module; adding ->
second render B1. Controls (route module first) and the exported-helper
row pass.
HMR-29: the tsr.config.json tests import the generated route tree into
the real router (SSR environment) and assert what /about matches instead
of searching the tree text for fullPath: '/about'. Pin red without .fails:
expected '/' to be '/about'.
HMR-18: expectExportedRouteOptions and expectSharedOverloads read the
route module's exports through a real second module of the app
(importerSource, imported in the SSR environment) instead of the route
module's namespace; the lazy-option preload probe is gone (renders
compared), the pinned cases render markers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- S01/A11: compiler and build ids are compared at the same root (repeated
and reordered: build-harness StartBuild.rebuild builds the same app dir
again); relocated roots are checked for correctness only.
- S02: a custom generateFunctionId's returned id is what clients and the
provider use; the filename spelling is free.
- S03: colliding custom ids must de-duplicate (same-id, same-id_1) and stay
paired in both discovery orders (passes on Vite and Rsbuild).
- S23/S31: the resolver is evaluated (id -> handler, client/server access,
unknown id), deterministic over discovery orders; no prose, no source text.
- S30: pragma rows assert the runtime Oxc selects, not comment text.
- S32: the error-envelope control resolves the handler by the reported id.
- S26 helper control: map checked through trace-mapping; null convention
labelled internal.
- G.3 :1783: #7213 rows for a middleware .server() caller (passes on both
bundlers) and HTTP calls by id, each with the app files written in both
orders; the server-fn caller stays a Vite pin (red: 'Server function info
not found').
- Library-wrapper pin: a build error must name createServerFn at the
library or the user's call (expectSourceError), no prose regex.
- startRuntimeLinks: the dead 'app brings its own react-start' branch is
gone (call sites in dev-server.ts and rsbuild-dev-server.ts updated).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- S06: client/SSR outputs are checked by what evaluating them loads
(moduleLoads + expectNotLoaded), never by exact import lists; type-only
syntax is no load.
- S08: callerRpcId reads serverFnMeta.id whatever other fields it carries.
- S05/S07/sol-10 (H.2): compile errors through the shared diagnostics oracle
(expectCompileError: API named in the diagnostic's own words, position);
misplacedServerFnRejection and the returned-builder regex are gone.
- S13/S14/S15/S16/S17: declaration-site goals split (nested no-capture =
support goals; other positions = works or rejected at the call);
rejection branches removed from required-support wrappers; capture pin
accepts a clear capture diagnostic or correct per-instance calls.
- New pin: next to another Start factory, a misplaced createServerFn is
rejected without a position (handleCreateServerFn.ts:232, SPEC G5).
- S18 (cases with unconditional window reads), S19, S20, S21 (compile-level
directive pin; real pin in react-start-rsc rsc-start-dev), S26, S29, S33,
S46 deletions; S38 real middleware row; S41/S42 moved to
outside-compiler-corpus/compiler-seams.test.ts as internal controls.
- S04: unchanged-input repeatability and per-version agreement.
- S22: tsc against the real declarations (packages/react-start, tsc 7):
.validator() TS2554, env fns without impl TS2554, destructured server fn
TS2339 -> labelled malformed-input controls; .handler() type-checks ->
G5 diagnostics tests (S23/S24 line endings, position and column).
- H.5: jsxToText deleted; evaluated modules link the real React/router.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HMR-24: the index-route tests no longer read routesByPath or compare it with
buildRouteTree(). They navigate to the paths and route templates
(/livestock/$farmId/medicine, its pathless 'new' child, /path) before and
after the update and assert the deepest match and the routes the router
resolves the destination to (the index route's search middleware runs).
Verified: re-adding main's old bug (routesByPath[oldRoute.fullPath] =
oldRoute after the rebuild, #7422) fails both tests; dropping the
generated id/path preservation fails 11 tests.
HMR-25: every test uses the client router with a real memory history and
the right initial URL; the server router with a hand-written inert history
is gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page's edit() waits for the server with the dev-server harnesses'
event-based settle() (Vite: watcher report, handling of each event, plugin
writes; Rsbuild: compiles read the edit, nothing pending) instead of its
own hotUpdate-hook counter, and replaces the 100 ms quiet time with events:
the server received every invalidation the page's HMR client sent (Vite's
vite:invalidate, counted on both sides), the client applied every update
the server sent, and a full reload loaded.
warnings() returns diagnostics: the server process's console is captured
with the shared captureConsole while the page opens, edits or clicks
(filtered by the app root, as concurrent pages share the process), the dev
server's logger and the page's console warnings through diagnosticsOf.
Consumers match the file with findDiagnostics. captureConsole now allows
overlapping captures (concurrent tests), with a control.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
startRscPreviewServer (rsc-app.ts): `createBuilder().buildApp()` of the
client/ssr/rsc environments in a ctu `createApp` directory (built
@tanstack/react-start linked), then `vite preview` (Start's preview
server runs the built server entry), NODE_ENV=production while it serves.
rsc-start-build.test.ts (2.4 s): V2-12 (c) at the build level (SSR's own
code runs `default`, the provider `react-server` once for the SSR and the
browser call, the browser `browser`; no file of dist/client has a server
entry, and the check sees the browser entry), and the three RSC helpers
style their server components in production.
Finding (upstream, not pinned): like dev (W2-j finding 2), the `rsc`
production build leaves a node_modules dependency external, so Node
imports it at run time without the `react-server` condition (the provider
ran `default`); the app bundles it with environments.rsc.resolve.noExternal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- rsc-start-dev.test.ts: the provider test now covers V2-12 (c): with a
package exporting react-server/browser/default entries, the loader's own
code runs `default` during SSR, the provider runs `react-server` for the
SSR-forwarded and the browser call and initialises the package once
(`MARK_REACT_SERVER:1` after both), the browser runs `browser`, and no
script the browser loaded has another environment's entry (the check
covers the package's pre-bundled browser entry).
- The 'use client' pin (S21) waits for the answer or a settled network
instead of a 5 s timeout; re-checked red without .fails ("widget " - no
data). D6 pin unchanged, still red ({ result: 'MARK_INTERNAL' }).
- rsc-start-hmr.test.ts: the J3.6 / V2-13 Vite edit test moved out of
rsc-start-dev.test.ts (per-file time), unchanged.
- rsc-start-rsbuild.test.ts (new): the same V2-12 (c) outcomes on Start's
Rsbuild RSC layer, and V2-13's handler half on Rsbuild (the loader and
the next call run the edited handler, no full reload, the client hot
update has no handler). The component-edit half needs React Refresh
(`@rsbuild/plugin-react`), which react-start-rsc cannot resolve.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FIX-PLAN S20 / D "namespace RSC helpers": SPEC J7.2 (V0.3) makes project
re-exports of the RSC helpers not a recognised form; the goal pin required
a configured transform to reach calls imported through a project
re-export. The behaviour that remains required (the call still works) is
covered through the real transport by react-start-rsc
tests/integration/rsc-css.test.ts "renderServerComponent through a
project re-export still renders". Minimal edit in W3-start's file (the
describe held only this pin).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rsc-css.test.ts (40 tests, 42 s at 1 worker: one page per row, every page
loading all 40 route modules) becomes three files on a shared harness
(rsc-css-app.ts):
- rsc-css-matrix.test.ts: helper x import form x module name (18 rows +
per-row client control), 3.7 s at 1 worker.
- rsc-css.test.ts: argument shapes, helper module, undocumented inputs,
look-alikes, unrecognised forms, pins (22 rows + controls), 3.9 s.
- rsc-css-hmr.test.ts: J7.5 CSS edits (unchanged), ~3 s.
Each file serves one page whose loader calls every row's server fn; each
row is its own module with its own CSS module (content differs per row:
Vite's scoped class names hash the stylesheet content, so identical
stylesheets shared class names and styled each other's rows), its own
error boundary, Suspense boundary and settled loader result. Flight rows
fetch once per row (a remount re-ran the effect and exhausted Chromium's
request resources).
Negative style checks no longer wait out a 3 s timeout: settledValue
(rsc-app.ts) returns the expected value as soon as it shows, or the value
once the page has had no request in flight for 500 ms.
New rows (SPEC J7.2, G15; FIX-PLAN D "namespace RSC helpers"): a local
shadowing the namespace import gets exactly its arguments; a project
wrapper and a variable alias of renderServerComponent still render (CSS
not required). The 7 pins were re-checked without .fails: ternary/&& and
chained unstyled (rgba(0, 0, 0, 0)), no warning diagnostic, comments
rendered as text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vitest's workers do not run process 'exit' listeners, so the temporary
projects stayed in the OS temp directory. They are removed in an afterAll
hook registered when the test file imports the host.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The settle() flake of the merged tier ("the file watcher did not report
src/base.css / src/a.ts") is a write the watcher saw half done. fs.writeFile
truncates and then writes. Vite's chokidar can stat the file in between,
report it empty, and drop the final write's event. A probe on Vite 8.3.4
shows this deterministically: chokidar reported size 0, while 19 bytes were
on disk, and nothing followed.
Both harnesses now save as editors that save atomically do (save-file.ts).
The contents go to a temporary file in `.harness-tmp/` next to the app
root, on the same filesystem but outside the app, then a rename replaces
the target in one step. Nothing in that directory is watched by Vite (root
only) or by Rspack, nothing in it is resolved or imported, and no route
generator scans it. Probes showed the effects. Vite reports a rename-over
as one `change` (and a new file as `add`) with the whole contents. Rspack
reports it in `modifiedFiles`. Rolldown's dev engine reports it as a
creation, so the bundledDev contract test now asserts the reported file,
not the event kind. A first try put the temporary directory under the
app's node_modules. Rspack watches that directory for resolution, so each
save started an extra compile that raced the real one, and the location
was rejected.
The Vite harness also fixes a race in what settle() returns. Vite can handle
a write's event (e.g. the synchronous full reload of a tsconfig.json change)
before settle() is called. The returned HMR payloads now count from the
first write since the last settle(), not from the call. This showed up as
"'once' does not log a violation again when the dev server reloads every
module" with an empty reload list.
No retries, waits or chokidar logic are added.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite dev: the served route module and every module derived from it (found
by following its imports) carry an inline map resolving each throw to the
route file's line; Rsbuild dev is pinned (unplugin drops the plugin's map).
webpack, Rspack and Rsbuild persistent caches: cold, cached and
unrelated-edit rebuilds of one app keep one instance of the shared state.
Harness hooks: `configure` (webpack/Rspack options) in compiler-test-utils,
`root`/`rsbuildConfig` in buildWithRsbuild.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
build-production: the public dev APIs are always scanned and React bundles
are compared, identifier by identifier, with a control build with route HMR
off (no private names, no dev-server marker collection, no workspace-path
ban). The console transcript test moves to outside-compiler-corpus.
build-source-maps: columns for unminified rows, a composed-maps row with
Babel before the router plugin, no `names` requirement. Production
warnings: the page's console is the outcome; the build warns only when a
permitted fallback stays eager. `this` in a split loader runs through the
real router and must match the unsplit result. esbuild: a refusal is a
build error naming esbuild and the option.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diagnostics go through the compiler-test-utils oracle: file, option name,
position, count; never prose. J2.8 now requires the option name (binding
allowed in addition): main names the export only, pinned in imports-exports,
known-bugs (errorComponent) and a real dev-server row (once per file, in
the terminal). J2.10/J2.11 keep file-only.
Plugin order: only the supported order in process; the other order is a
real-build row. The syntax-error row accepts structured fields or a frame.
Deleted (one route per file): the code-route rows of imports-exports,
known-bugs groupings and plugin-pipeline. F29: `tsc` against the real route
types rejects `[['loader'], ['component']]` (TS2322, string[][]); the
annotated form passes. F11: the unsplit control is an empty grouping, not a
root component. F17: no position of movable initialisers in effect logs.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The untouched file and the split route render through the project's real
JSX transform and real Emotion, in process (Vite's Oxc, leading pragmas
only) and in real builds (Rspack's SWC reads a pragma above any top-level
statement; Vite does not); the computed colour of the styled element is the
outcome in the browser. No runtime-import or `jsx(` spelling, no comment
position. D-04 is pinned: a non-leading pragma becomes effective in the
split component's module on Vite 8.
License comments above moved or deleted code stay in the route module
(R-14; main passes). Refresh pragmas run in a real Solid page; React's
`/* @refresh reset */` has no observable effect under Vite 8's
`@vitejs/plugin-react`, split or not, so there is no React row.
`loadRoute` takes the project's JSX settings (`jsx`) and
`expectValidModules` passes them to the validator, for classic-runtime
projects.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Closes the astra/24 hole (a free-reference walk that skips object keys): the
split component reads a module-level `let` only through `{ [kind]: true }`
and must see the loader's reassignment, rendered through the real router.
With the astra/24 patch applied the test fails on the module validator.
Pins a bug found on the way: a `let` that only the loader assigns moves to
the shared module, so the route module assigns an import ("Assignment to
constant variable").
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- tests/tsconfig.json (extends the package tsconfig, adds src/*.d.ts):
every test:types:tsXX script also runs `tsc -p tests`; test:eslint
lints ./src ./tests (the typed parser finds tests/tsconfig.json).
- The type tests (*.test-d.tsx) leave the unit runtime run: they assert
nothing at runtime; test:types checks them.
- HYD-33: createServerComponent.test-d.tsx and
renderServerComponent.types.test-d.tsx rewritten on the public entry
(src/index): types inferred from real createCompositeComponent /
renderServerComponent calls as in guide/server-components.md (slots,
render prop args, component props, nested composites, renderables).
Before: renderServerComponent.types.test-d.tsx imported two types that
no longer exist (TS2724) and createServerComponent.test-d.tsx:86 failed
(TS2344) - never noticed because nothing type-checked them; the other
rows compared `null as unknown as JSX.Element` with JSX.Element.
Verified: tsc 5.6-5.9, 6.0 and 7.0 pass; a wrong inference
(`title` as number, ReactNode as number) and three neutralised
@ts-expect-error inputs each make `tsc -p tests` fail.
- HYD-32: the two createRscProxy tests that probed React with a hand-made
Proxy (and pinned the list of props React reads) replaced with real
createRscProxy rendering (inline, nested selection, composite).
- Lint fixes in the runtime tests (imports, for(;;), nullable casts).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fixture-types.test.ts took 18.8 s under load (limit 15 s per file): the
checks move to a helper (integration/fixture-types.ts) and run in
fixture-types-physical.test.ts (with the two group-layout pins) and
fixture-types-virtual.test.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Vitest projects, '--typecheck.only' on the command line did not reach
the unit project, so test:unit ran the runtime tests twice. The fast tier
is now two projects: unit (runtime) and types (the route tree type tests
the unit run generated), run one after the other by test:unit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by re-applying V4 green-sol/01 (ids printed with double quotes):
generator-dev 'a route file broken by an edit ...' and concurrent-write
'is processed before run() resolves' compared a repaired file's exact
bytes, pinning the quote of the edited id (free, SPEC J1.2). Both now use
expectOnlyOwnedEdits plus the parsed id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The look-alike createFileRoute now comes from an installed package
(node_modules/other-router of the app) instead of a local module, as G15's
'same name exported by an unrelated package' reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- code-splitter-dead-code (integration): one production client app per
bundler holds the unused-functions route and the #__NO_SIDE_EFFECTS__
routes (annotated and plain control), built once, one run per route:
6 builds -> 3. Which code is dropped stays decided per bundler.
- known-bugs client-builds: the exported errorComponent 'as any' pin keeps
its Vite cell; the Rspack and webpack cells are decided by the same router
transform (lazy or reported).
- known-bugs client-output: the ssr property control and the ssr() method
canary keep their Vite cells (the transform decides whether a server-only
option stays referenced); Rspack and webpack cells dropped.
Builds for these tests: 12 at the base, 9 now while covering 6 new rows
(F38 x3, F35 x3).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps the fast tier at its baseline time with the GEN-02 real-router checks:
- integration/route-types.test.ts: the J1.13 type checks of the
real-router apps (cases now in real-router-cases.ts), the group layout
types pin, and the FileRoutesByTo/ByFullPath tests of route-paths.test.ts
(moved unchanged). The unit tests check the same apps' runtime.
- route-tree.ts: the generator fixtures (all rooted at this package) share
one Vite server per frameworks set, forgetting the app's modules before
each load (as the Solid server already did): generator.test.ts 1.75-1.95 s
-> 1.19-1.46 s at 1 worker.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oneChunk compared the file names of the first lazy chunks holding the loader
and component markers (chunk shape, free per SPEC 5.3). The loader and the
component now each read a module that records when it loads (ctu
importers loadMarker); in each real build (client in Chromium, SSR in Node)
the script checks whether the loader's code is not loaded with the route but
loads once the router preloads the component, i.e. one group. Placement
(where) and the router render checks stay. Minimal edit in W3-start's file
(FIX-PLAN H.5 hands S47 to W3-split-*).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The in-process Solid route of code-splitter-plugin-pipeline is checked at
compile level only (the Solid router cannot run in Node). A Vite client build
in Chromium now covers its runtime outcome: with codeSplitGroupings
[['loader'], ['component']] the loader gives its data without loading the
component's code, and the component renders.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New integration test: Vite dev with experimental.bundledDev (Rolldown's dev
engine bundles the client from index.html), the real router plugin and
@vitejs/plugin-react, a headless Chromium page with Vite's HMR client. The
home page renders; the split /about component's chunk is not among the
page's loaded scripts until the router navigates there; an edit of the
split component shows without a page reload and without page errors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- GEN-03: utils.test.ts (111 tests of internal helpers, incl. the unused
multiSortBy branch and a mandated sibling sort) is deleted (no contract
tests for helpers, ruling 2026-10-17). Its unique scenarios are ported to
full generation + the real router (route-paths.test.ts): [_][_]foo,
un-nested bar_/index, [_]baz[_]/index, [_]a/bar[_]/[_baz_]/index and
[_]auth/_admin/dashboard under pathless layouts; dots and [.] in virtual
route paths. The rest is covered by fixtures (escaped underscores,
pathless-to-index-preference, dot-escaped, custom tokens) and the
FileRoutesByTo/ByFullPath type tests; generated names and import merging
are free (5.1, 5.5).
- determinism.test.ts (J1.5 with ctu expectDeterministic): the filesystem
listing order (readdir permuted at the fs boundary; writing files in
another order changes nothing on tmpfs/ext4) and the working directory
change neither the tree nor the routes. Probe: dropping the routePath
tie-breakers of both sorts (src, reverted) fails the listing test.
- GEN-31: a standalone (group).tsx may fail the run or warn, naming the
file; no channel required (SPEC 2.2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Real Vite client build in Chromium: lazyRouteComponent(() => import('../page'))
as the component; after the router preloaded and loaded '/', the first render
must show the page (no pending fallback) and request nothing (resource
entries). Control with autoCodeSplitting off passes; with splitting on the
splitter wraps the lazy value in its own chunk and the first render suspends
and requests page.mjs: new .fails pin (accepts leaving the value unsplit or
chaining the inner preload).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Next to the object-key scope test: the split component reads a binding the
loader shares only through a computed object key; both see the one value and
its initializer runs once. (A loader-only writer of a shared let hits the
known read-only-import bug pinned in known-bugs-code-splitter-ssr-builds, so
the row uses a stateful initializer instead.)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- GEN-33: a running generator's tree must give the real router the same
routes (ids, full paths, parents, files, lazy files) as a fresh run's;
hand-edited, corrupted and deleted trees must regenerate and give the
routes of the original tree. Tree text is free (J1.5, 5.5).
- GEN-15: a route file broken by an edit may fail the run or warn, if the
diagnostic names the file and the line of the problem (G5); main throws
'Error transforming route file <abs>: SyntaxError: Unexpected token
(3:22)'. The repaired-file check stays.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- regression-helpers.test: the harness labels are checked on a fixed graph;
the compileRouteModules control no longer requires exactly one lazy (or a
shared) module from the real compiler, only that every module it returns
is reached by an import of another (SPEC 5.3).
- Unused inventory helpers deleted: eagerModuleIds, eagerImportSources,
countAcrossModules, routeModuleSources.
- V2-30: createRootRoute() without options, through the host with and
without HMR: valid modules, and the real router renders a child through
the default Outlet (tsc: the fixture type-checks).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The unit test required the annotation comment right before `function
makeLabel(` in every module declaring that name (an emitted-name and
printing requirement). Replaced by Vite and Rspack production client builds
of a route with a pragma and an annotated, effectful helper the split
component calls once unused: the unused call is gone and the used one still
renders; control without the annotation keeps the call. webpack is left
out: its minifier keeps the call even with autoCodeSplitting off, in every
spelling of the annotation (not a router plugin outcome). The deleted unit
test is covered by these builds (comment in code-splitter-dead-code.test.ts).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- loadRoute gains importBindings(names) (ctu importers: another module of
the app importing the route file) and eagerModules (code of what loads
with the route). Direct route.exports reads in IE, MS and KB (exported
bindings, shared helpers, split-binding readers) now go through a real
importer and compare with what the route uses (F16).
- KB useTitle pin: the title lives in staticData (tsc: the old top-level
title is TS2353/TS2339 against the real declarations; the new fixture
type-checks with the StaticDataRouteOption augmentation) and the hook's
identity is compared with a real importer (F28). Re-checked red: the
component calls another instance.
- MS .jsx store test: the assertion key renamed to what it checks (route
module loads ./init without using it); real consumers and one init stay
(F19, done by W2-b in substance).
- IE specifier split: absence checked on everything that loads with the
route module, not the route module alone (F30).
- KB server-only options: options wrapped in as never / as any / satisfies
object are statically visible and must be removed (refusal no longer
accepted; tsc: valid under Start's route option types), new strict pin +
a Vite build canary (one bundler: the transform decides) (F35). Opaque
spread/computed/call rows keep their removal-or-refusal outcome.
Re-checked red: serverImports 1 / server code eager.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- GEN-41 (J1.6): a reader of the route file and the route tree during
every write and rename of a run (writes made in two halves through the
generator's fs option) sees only the complete old or new contents; after
a write failing half-way (ENOSPC) or a failing rename, both hold their
complete old contents. Probe: publishing by writing over the destination
(src change, reverted) fails the reader test.
- K-19 (J1.16): with tmpDir on another filesystem (real devices when the
host has them: here /dev/shm vs /tmp; otherwise a fault failing renames
across directories with EXDEV) the files are replaced atomically
(new inode, reader sees complete contents). .fails pin, red without
.fails: 'EXDEV: cross-device link not permitted, rename'. Probe: temp
files beside the destination (the ruled fix, src change, reverted) pass.
- GEN-16/GEN-17: mode, owner and chown policy tests move to
outside-compiler-corpus/file-metadata.test.ts (metadata is outside J1.2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GEN-02: the 59 route tree snapshots (and the edited/scaffolded source
snapshots of file-modification and custom-scaffolding) are replaced:
- generator.test.ts: every fixture's tree is loaded by the real router;
its routes (id, full path, parent, route file, files loaded lazily with
the route) must equal generator-fixtures.ts, reviewed against the file
naming and virtual route docs. Edited route files: expectOnlyOwnedEdits +
constructor/id; custom scaffolds: the template's statements, and their
pages render 'Hello <path>!'; header/footer lines of append-and-prepend.
- integration/fixture-types.test.ts (new slow tier, test:integration):
J1.13, each tree types the same ids, full paths and parents. One
TypeScript program per tree (each augments the router types globally;
one shared program mixes them up), 9.9 s at 1 worker, so not in the fast
tier. Two fixtures are .fails pins for the group layout types bug
(inferFullPath, same as the real-router.test.ts pin).
- generator-fixture.ts: the fixtures' configuration and preparation,
shared by both, runnable on a copy.
- Fixture inputs made valid modules: 13 root files called
createFileRoute/createRootRoute without importing it or exported no
Route; 4 virtual roots were createFileRoute('/') (types: a root route
must be createRootRoute, which also made the parity check fail).
- The virtual-physical-empty-path-conflict-root fixture is deleted: its
case is the outside-corpus characterisation
outside-compiler-corpus/virtual-routes.test.ts (GEN-30, W2-e).
- The virtualGetRouteNodes test is deleted (unused exported helper, ruling
2026-10-17; physical mounts are covered through the generator and the
real watcher in router-plugin integration tests).
- GEN-29: conflict errors through the diagnostics oracle.
- CRLF: LF and CRLF sources give the same routes (not tree bytes).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
W2-f deleted the harness's file-event replay; createDevServer without
`browser` runs Vite's watcher and settle() waits for its reports. Doc
comment only, no behaviour change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The in-process plugin host replayed hook filters, plugin order, resolveId/load
dispatch and refused asynchronous hooks (sync()). It is replaced by the
router plugin's public Vite adapters (tanStackRouterCodeSplitter with a
@tanstack/router-plugin/context context, or the composed tanstackRouter for
route HMR) in a real Vite dev server: Vite resolves the config, orders the
plugins, applies the hook filters, awaits the hooks and resolves and loads the
emitted modules; a recorder right after the router plugin observes each
module at the router transform boundary. command: 'build' compiles in a real
Vite production build. Compile helpers are async now (call sites awaited).
Deleted with the old host: createCodeSplitterTransforms (private plugin-name
dispatch), the webpack compiler stub and generatedRouteId (no consumers).
code-splitter-plugin-pipeline: query ids, route reuse, splitBehavior errors
(A9 diagnostics), plugin order with real @vitejs/plugin-react and
vite-plugin-solid configs, factory-route reporting all go through the host.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- SPEC J1.14 (PIN-A): a pathless layout under a lazy-only route nests under
its virtual anchor. The docs shape (posts.lazy.tsx + posts/_layout.tsx)
passes on main (control); a layout one directory below the lazy-only route
(app/posts.lazy.tsx + app/posts/drafts/_layout.tsx) is attached to /app:
.fails pin, red without .fails (parent '/app' instead of '/app/posts').
- SPEC J1.15: a childless _auth.tsx / _auth.lazy.tsx next to index.tsx is a
valid route: two .fails pins, red without .fails ('Conflicting
configuration paths were found for the following routes: "/", "/"').
- GEN-29: conflict errors are checked with the diagnostics oracle (absolute
or project-relative names, same-named files told apart).
- GEN-11/GEN-12: param name warnings are neither required nor forbidden
(J1.12): the policy test moves to outside-compiler-corpus/
param-name-warnings.test.ts with its own temporary app (the deleted
validate-route-params.test.ts wrote into the shared generator fixture;
its deletion landed in the previous commit), matching names, not prose.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- template.test.ts: the stub router, JSX runtime and Vue h (evaluateScaffold)
are gone. Scaffolded React, Solid and Vue routes load through the real
router and render with the target's own server renderer; the root route
renders its child route's page (it has an Outlet).
- H.2 green-sol/01: the quote of the route id argument is the generator's
edit (SPEC J1.2: free), so the quoteStyle check skips it; every other
literal still follows quoteStyle (file-based-routing.md quoteStyle).
- route-tree.ts: loadedFiles() and observeRouteTree() (routes with full
path, parent, file and the files that load lazily with them).
- route-pieces.test.ts: GEN-19, empty pieces: no inventory of empty
options; the routes load and render. .lazy.vue pin (J1.17): the SFC is
not loaded before the route renders.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GEN-05: one helper, expectOnlyOwnedEdits (owned-edits.ts, with controls):
exact bytes outside the route id argument, the constructor callee and the
router package imports; inside those imports the other bindings keep their
imported name, local name and type/value meaning. Replaces withoutImports,
which dropped every import (an unrelated import could vanish unnoticed).
- GEN-06: the second createFileRoute call becomes an ordinary call (one
route per route file).
- GEN-07/GEN-09: no semicolon or quote assertions on edits; the id is
checked on its parsed value.
- GEN-08: the now unused createFileRoute import may stay or go.
- GEN-10/GEN-12: the logging test no longer requires a scaffold message or
param warnings; it requires the helpers.tsx warning naming the file
(diagnostics oracle), plus a real disableLogging check (no info logs).
- GEN-28: BOM rows and the BOM pin move to outside-compiler-corpus/bom.test.ts
(SPEC 2.1 is BOM-free); CRLF and astral rows stay BOM-free.
- GEN-40: the lazy template uses component (tsc: 'staticData' does not
exist in type 'LazyRouteOptions'); checked through the real router page.
- GEN-42: an id from a variable or an interpolated template may be repaired
to the literal or reported naming the file.
- Route tree quote check skips literals holding quote characters.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generator tests use the shared oracles of @tanstack/compiler-test-utils
(diagnostics, determinism). It has no workspace dependencies, so the Nx graph
gets no cycle; the lockfile changes only in the router-generator importer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
react-start-rsc: an Rsbuild dev-server harness (the built
@tanstack/react-start/plugin/rsbuild with RSC enabled, run in the app
directory as rsbuild dev does) and rsc-css-rsbuild.test.ts: the three RSC
helpers style a local server component through the Rsbuild transport, a
CSS edit updates the page without a full reload (J7.5), and a pin: Start's
Rsbuild virtual modules live under the process working directory, so the
app fails to compile when the process runs elsewhere (J4.16). The
fake-stream unit file rscCssTransform.test.tsx is deleted: every row it
had now runs through the real transport (rsc-css.test.ts,
rsc-css-rsbuild.test.ts).
start-plugin-core: start-router-dev-server HMR-33 runs on a real page
served by Start's dev middleware, navigating to the route after each
change (server-only -> page -> page without handlers -> server-only, and
the cold-start case); rsbuild/dev-server S12 opens a real page on Start's
Rsbuild dev server with its HMR client (next call runs the edited handler,
no full reload, the hot update carries no handler); the fake-forwarder
S11 block of start-compiler-dev-server is deleted (covered by
rsc-start-dev.test.ts with the real provider); createServerFn.test.ts
loses the compiler-level D6 pin (S36, now a page pin in
rsc-start-dev.test.ts) and the provider 'no react import' assertion (S40).
rsc-start-dev.test.ts: a handler runs in the provider environment with its
react-server conditions whether SSR or the browser calls it (S11, S18 case
3, S40); a handler edit reaches the next call and a component edit
hot-updates a route module that also declares a server function, with no
full reload (J3.6, S12 on Vite); two pins red through the real page: a
server function only server code calls is callable by id from the browser
(D6, S36), and a server function of a 'use client' module is a client
reference on the server (#7943, S21).
A new integration tier (tests/integration, Vitest project 'integration',
Nx target test:integration depending on @tanstack/react-start:build) runs a
real React Start app with RSC enabled on a Vite dev server, built from the
linked @tanstack/react-start, @vitejs/plugin-rsc and @vitejs/plugin-react,
and reads a real page: the server component's content and the computed
styles of its CSS modules.
rsc-css.test.ts covers every RSC helper through named, renamed and
namespace imports of both module names, fragment roots (V4 red-astra/21),
a helper module with a global stylesheet, parenthesised and asserted
arguments, the options and plain-data model pass-through, look-alikes, a
project re-export, the client never loading a row's stylesheet, and the
J7.5 CSS hot updates (edit, double edit, rule removal, import removal,
no full reload). The pins (conditional arguments, dev warnings, comments,
chained call) keep their outcome through the real transport.
The integration project runs with NODE_ENV=development: the dev server
bakes the test process's NODE_ENV into the served client code, and
Start's RSC HMR client is set up under development only.
hydrate-pages.ts builds one app with Start's Vite plugin (development
build, real @tanstack/react-start), renders each fixture in the SSR build
and hydrates it in Chromium with onRecoverableError and console.error
recorded; scripts click children, observe requested scripts, mount
without SSR, or call a server fn by id through Start's server entry.
hydrate-pages.test.ts: HYD-04 identities (nested + sibling, repeated
instances, conditionals/callbacks, renamed, namespace, split={false},
dynamic split, astra/14 let), S37 branch switching after hydration,
HYD-06 prefetch rows (+ control, function prefetch state, split={false}),
HYD-12 function when (not called on SSR), HYD-14 server fn from split
children (request id executed by the SSR server entry), client-mount
fallback for the 13 fallback forms, onHydrated/prefetch callbacks,
interaction events option, click handler with return.
clientOnlyJSX.test.ts: fallback on SSR, children after hydration.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All custom JSX runtimes, recording Hydrate stubs and fake react/router/
createServerFn stubs are gone. Id-agreement fixtures use idle() (load()
and visible() render no id with the real runtime). HYD-05 prefix
assertions removed. HYD-08 goals deleted (SPEC J5.5 requires rejection;
B:577/616/692 cover it). Prefetch rows (HYD-06), server-fn clicks
(HYD-14), client fallback receipt and when-function timing (HYD-12) move
to integration/hydrate-pages.test.ts. `when={() => 'custom'}` (TS2322)
becomes `when={() => idle()}`; tsc against the real types: no error.
Function-as-children with split={false} is TS2322 (children: ReactNode):
kept only as "compiled renders like the source". Every pin re-checked red
for its named bug without .fails. Solid rows: compile-level (solid-router
cannot link in process).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hydrate-captures: client output, server output and uncompiled source render
the same markup. New table row for V4 hole astra/14 (a let reassigned
before the boundary): red with the astra/14 patch applied, green without.
Two fixtures captured a local named `key` (React strips it; pinned in
known-bugs-hydrate): renamed to `field`.
clientOnlyJSX: real ClientOnly of @tanstack/react-router, server output
renders what the source renders while the children's libraries throw.
The Link-as-ClientOnly row uses CatchBoundary (real Link needs a router);
tsc against the real types: no error. Client half moves to
integration/clientOnlyJSX.test.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
render.ts drops the stand-ins of A3b-1 (FIX-PLAN S09, HYD-01, HYD-04):
the fake Hydrate/hydrateStubs, the recording Hydrate that kept only
props.h (renderBoundaries), the fake lazyRouteComponent (chunkExportName,
renderChunk, loadClientModule) and the copy of the compiler's Hydrate
recognition used to order chunks. Graphs now link the real React,
react-dom/static, @tanstack/react-router and @tanstack/react-start-client
(Hydrate, strategies); test:unit depends on react-start-client:build (no
cycle with this package). New oracles: renderSource / renderServer /
renderClient, expectClientRendersLikeServer (markup incl. hydration ids),
expectRendersLikeSource (ids blanked vs the source, SPEC 5.17).
regression-helpers.ts: graphs that link real packages compile JSX with
React's automatic runtime; the text JSX stand-in stays the default only
for graphs without packages (24 tests in W3-start files).
Helper controls: S37 cross-branch id inequality removed; agreement and
distinct simultaneous ids kept; negative control for a client rendering
other children; fixtures gain the required `when` prop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FIX-PLAN A5 rows on rg/generator-dev.test.ts:
- GEN-14: "getRoutesByFileMap maps each route file ... after a rerun"
deleted. It asserted the plugins' internal handshake map; the outcome (a
created or renamed route, and the root route, hot-update on the page) is
tested in router-plugin integration dev-server-new-routes.test.ts and
rsbuild-dev-server-new-routes.test.ts ("an edit of a created/renamed route
the page shows is a hot update", "an edit of the root route after a route
was created is a hot update").
- GEN-13: "a new generator on an up-to-date app does not rewrite the route
tree" (an mtime check of unchanged-write suppression) moved unchanged to
outside-compiler-corpus/write-suppression.test.ts as an implementation
test (package AGENTS.md keeps the suppression; SPEC J1.10 leaves the
mechanism free).
- GEN-04: the injected-event physical() test stays, labelled a supplement
of router-plugin's real-watcher physical() scenario; the file header says
injected events are not watcher coverage.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FIX-PLAN A5 (GEN-04, 13, 14, 21-26, 34, 35). The generator dev scenarios run
on a real dev server with the real router and React on a Chromium page, with
the dev servers' own watchers (and the generator's on Rspack), for Vite and
Rsbuild alike (generator-dev-scenarios.ts, harness generator-dev-app.ts):
- routes and parents from the live router (GEN-21), not the route tree text;
- a route's component loads on navigation: no script the page loaded before
contains its marker, one after does (GEN-34; intermediate modules free);
- createFileRoute's path parsed, the rest of the file unchanged (GEN-22);
the empty-file case uses a custom route template with its own marker;
- edits of shown, created, renamed and root routes are hot updates with no
page load (GEN-13, GEN-14, GEN-23); the write-suppression and event-list
checks are gone (implementation coverage);
- the created-route race (DV1/DV17) on the page, without injected events
(GEN-26);
- a physical() mount outside the routes directory: create, edit, delete
(GEN-04).
Rsbuild bundles the real @tanstack/react-router (router stub and alias
deleted, GEN-35) and waits with the harness's event-based settle() instead of
750 ms quiet times (speedup 4).
Moved to the slow tier (page): dev-server-generator, dev-server-new-routes.
New: rsbuild-dev-server-new-routes, known-bugs-rsbuild-generator,
generator-watch-mode (from rsbuild-dev-server-generator).
Watch mode (GEN-24, GEN-25): every build's callback error and
stats.hasErrors() are asserted, the bundle's route tree runs through the real
router in Node and renders the scaffold; closing the session must release
every file watcher it opened (SPEC J1.10), waited on Node's handles, not on
sleeps. Checked: with the generator's watcher left open (temporary src
change, reverted) the test fails ("still holds 3 file watcher(s)"). The old
test ignored the errors of every build: its .js app could not resolve the
generated extensionless imports (ESM package); the app now has its own
package.json.
Pins (Rsbuild, verified red without .fails):
- a created route file the generator cannot parse, fixed later, never joins
("no compile read routes/posts.tsx"); the "no Route export" twin is the
same source line and stays a Vite control only;
- NEW: a route file created under a physical() mount outside the routes
directory never joins ("no compile read features/b.tsx");
router-generator-plugin.ts:93-97 (webpack :121-125).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
write(), rename() and settle() on the Rsbuild harness (FIX-PLAN A5, speedup
4): settle() waits, on the compiles' own hooks only, until no compile runs or
is pending (watchRun/done/failed, Rspack's `invalid`), Rsbuild recorded the
last compile, every app file the last compile read is as it was when that
compile started (before the plugins' own watchRun taps, whose writes the next
compile reads), and every written file is read by a compile or taken by the
caller's accept(). More than 10 compiles in one settle() is a rewrite loop.
This replaces the router-plugin harness's 750 ms quiet time.
Vite harness: `server.forwardConsole: false`. Vite 8 forwards a page's
console to the server log when it detects a coding agent running it, so
`logs` depended on who ran the tests; a page's console stays the page's.
Contract tests: a plugin writing a file in a compile, an unread written file
with and without accept(), a plugin rewriting a file on each compile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FIX-PLAN A3b-2 (HYD-02, HYD-04, HYD-05, HYD-15, HYD-24).
- Delete `hydrateRuntimeFiles` (stand-in `@tanstack/react-start`,
`@tanstack/react-router` and React JSX runtime), its names-only contract
test, and `renderThroughChunks` (which preloaded lazy components itself).
Apps link the built `@tanstack/react-start` (startRuntimeLinks) and
resolve the real router and React.
- Hydration oracle: the SSR build renders each page with
`renderToReadableStream` (allReady); a Chromium page of the client build
hydrates that HTML with `hydrateRoot`, records `onRecoverableError` and
`console.error`, and clicks every child until it shows it was clicked.
Identity rows use `interaction()` boundaries, whose runtime finds the gate
by the server-rendered id (probe: an altered id leaves the child
unhydrated). Boundary-id equality and prefix presence are no longer
asserted (J5.4, §5).
- One shared production build per bundler for all pages (plus the
unminified source-map build and the dangling-name pin build).
- Split route options: per-route `codeSplitGroupings` (documented,
docs/router/guide/automatic-code-splitting.md:166), explicit separate
groups, one group, and the default (component split, pendingComponent
eager) as a named mixed row (HYD-15); the three routes hydrate in one page.
- Exported widget initialized by an impure call: the goal "lazy or
reported" becomes the real outcome (initializer runs once, renders,
boundary children lazy, no warning required); red on both bundlers
(count 2), pinned with the same root cause as the known-bugs-hydrate
compiler pin (HYD-24).
- A package without side-effect hints: the chart placement is the
bundler's call (eager with the real React on both bundlers; it was lazy
only with the stand-in React).
- Vite dev: a real page (index.html, @vitejs/plugin-react, Vite's HMR
client) requests the chunk before its parent module, renders it, and
shows the edit.
- Rsbuild dev: the real packages instead of the stand-ins.
- Delete the Solid dev row: it rendered stand-in Solid packages through a
string JSX runtime; real Solid needs solid-js, vite-plugin-solid and a
linked @tanstack/solid-start, none of which resolve from
start-plugin-core (no approved dependency). Solid compile coverage stays
in hydrate-boundary-forms.test.ts (framework: 'solid').
Pins re-checked red without .fails: the head-reads-Page pin
(DanglingNameError `_H2`, both bundlers), the unused exported boundary
(`lazy`, both), the impure exported initializer (count 2, both).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dev-server harness no longer replays file events from a filesystem
diff (FIX-PLAN A5, GEN-26). Vite's own chokidar watcher runs in every
mode; write() writes files and settle() waits, by events only, for:
- the watcher's report of each written file (a test writes like a user,
after chokidar's per-file change throttle passed: it drops a second
change within that moment),
- the end of Vite's handling of each reported event (hotUpdateEnvironments,
or the error Vite logs; AsyncLocalStorage ties both to the event),
- files plugins wrote meanwhile: a barrier file change, then every app file
as the watcher last saw it; until a round sees no new event (a plugin
that keeps writing never settles: error after 10 rounds).
Full-bundle dev (bundledDev) waits for the dev engine's watcher, the
plugins' watchChange hooks of each environment and the dev engine output,
instead of forcing a full rebuild.
Removed with the replay: FileEventOptions (order, batch) and their tests.
The same-contents write test (H.3 load flake) now waits for the watcher's
own change event.
start-plugin-core (W2-j's file, minimal): the bundledDev factory edit test
passed only because the replay forced a full rebuild. Split into a passing
#8062 control (bundles again without errors) and a .fails pin: the
importer of an edited factory is not recompiled in full-bundle dev
(start-compiler-plugin/plugin.ts:412-424). Verified red without .fails:
"expected [ 'assets/a.js' ] to deeply equal []".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build.test.ts (IP-S02, S20): mock-mode rows describe the import (a safe
mock, no initializer run, no real code) with mockAccess 'off' for the
silence; new rows pin mockAccess error/warn/default in a production
mock-mode build (silent self-contained mocks today). The ignored-importer
marker rows read the blamed importer from onViolation (Rsbuild blames the
exempt importer through its BFS chain), split the no-report and
real-module outcomes (the latter pinned on both bundlers), and add a
mixed mock-mode row (exempt real, other mocked, pinned).
dev.test.ts (IP-S03, S17, S18, S27, V4 timing pin): the React stand-in
is gone (real React from the package's dependencies); the MDX stand-in
is the real @mdx-js/rollup; mockAccess error/warn rows for an SSR import
of a .client file (silent server mocks today, pinned); a wiring row
through startDevServer({ start }) for onViolation and mockAccess; the
marker-add pin split into a report pin and a mock pin (FOLLOWUPS H5); the
pre-transform false-warning pin reproduced deterministically with an
ordering plugin that holds the factory's client transform until the
helper's landed.
known-bugs.test.ts (IP-S13, S15, S25): the unused-mock pin compares the
client bundle with the one import protection disabled gives; twins for
eval/arguments export names and ns[key]() of a denied file and specifier
(the latter pinned on Vite). exemptions, build-options, reported-location
(an SSR/provider case, IP-S16), rsbuild (one server for the seven
importer types, compile waits no shorter than the test timeout) follow.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Conflicts resolved:
- hmr-model.ts, vite-hot-update.ts: take W2-g's deletion (W2-b/W2-c only
kept the in-process model alive; nothing to port).
- known-bugs-route-hmr, react-refresh-route-components, router-plugin-context:
take W2-g's deletions (tests moved to the real page or out of scope);
keep W2-b's real rendering in the surviving tests.
- code-splitter-plugin-pipeline: W2-g's `hot: undefined` (no accept count)
with W2-b's `framework` and real render.
- route-hmr: W2-g's version, on the real router package (W2-c): no
routerPackageStub, the SSR graph scan skips the router package as /@fs/.
- regression-helpers.ts: union of the type imports.
Ruling R-09 / D11 (DECISIONS.md 2026-10-17): a route created inside a
function of its file is unsupported but user-fixable; tests accept either a
correct result (here: the edit takes effect, in place or after a reload,
per the function-call ruling) or a warning naming the file in every mode.
Silent wrong output fails.
`openRouteHmrPage` gains `warnings()`: the dev server's logger (Vite
`logs`, Rsbuild compile warnings), what the server's process logged with
`console.warn` about a file of the app (one shared wrapper, listeners per
page, so concurrent pages do not race on restores), and what the page
logged as a warning (the compiler puts its warning into the served
module). A harness control shows the channel on both bundlers with the
compiler's real exported-component warning.
The known-bugs D11 pin ("an edit of a route a helper function creates
shows its new component, or the file is reported") and the loose
route-factory rows of route-hmr-browser-plugin.test.ts pass when the edit
takes effect without errors or a warning names `routes/index.tsx`. Main
does neither on Vite and Rsbuild (stale `helper v1 data v2`, no warning):
the pin stays `.fails`, verified red in a run without it. The Rsbuild
unsplit Solid pin is untouched (no ruling covers it).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The mock oracle (A6, IP-S01/S10/S25): mock-helpers.ts probes what a
consumer does with a mocked binding (member reads, calls and construction
to depth, primitive conversions, no secret) instead of comparing its label;
the same probe is serialised for scripts run in another process. The unit
rows of the mock modules use it; the pins they duplicated on internals
(reserved names, namespace re-exports, enums, a read before the import)
live on as app-level twins (integration/importProtection/known-bugs.test.ts).
The report adapter (IP-S05): violation-report.ts reads reports by their
documented sections (environment type, Importer, Import, Trace, Code with
the >/^ convention), per log entry or paragraph, and fails on a diagnostic
that announces import protection without them; a unit test feeds it other
headers, numbering, quotes, spacing, boxing and plugin tags.
IP-S16: usage-location.ts (a copy of the Vite adapter's location fallback
order) is deleted; analysis.usage.test.ts checks only whether the Start
compiler's output keeps the denied import. IP-S03: the unit row that
expected a server-environment mock to stay silent is gone (SPEC J6.3 has
no server exemption); the real-adapter rows follow in dev.test.ts.
known-bugs-dev-server.test.ts (W3-hmr's file): the oracle import renamed.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
route-hmr-browser.test.ts: every edit also requires no unexpected page error
(HMR-14; the deliberate loader error is filtered); the memo/forwardRef split
rows and an inline-arrow row count mounts through a state initializer
(HMR-13); the options the edits add are cumulative, and the removal of a
loaded option (the pinned bug) is the last, loose step; the rows creating
a second route in a route module are gone (one route per file, HMR-12).
route-hmr-browser-frameworks.test.ts (new): Solid and Vue on Vite and
Rsbuild; `{ reloaded: false }` where it holds today, the rest pinned.
route-hmr-browser-plugin.test.ts (new): plugin configurations (hmr.style,
environmentName, function options, tsr.config.json, Rsbuild with
hmr.style vite), root route call shapes, routes created inside a function,
`.ts` routes and an app without @vitejs/plugin-react (loose controls).
known-bugs-route-hmr.test.ts: pins wait on the client's applied signal, not
3 s; new output and `{ reloaded: false, errors: [] }` everywhere (HMR-21);
the memo(Page) control edits the body and keeps state, next to a
forwardRef(Page) control (HMR-20, G.3); per-variant controls of the
removal pin (HMR-15); new pins: alias export (Vite, Rsbuild), unsplit Vue,
`.ts` route, Vite without plugin-react, the hoisted inline component with
the real react-error-boundary (HMR-19), an unsplit Solid route on Rsbuild
and a helper-created route without code splitting (both NEW, FOLLOWUPS).
Every pin verified red for its stated reason in a run without `.fails`.
The production-build pins move to known-bugs-route-hmr-production.test.ts
(per-file budget).
regression-helpers.test.ts: the reload detector control uses the browser's
own reload (HMR-30); a control that an applied-but-not-shown edit fails
without its timeout on both bundlers.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`hotUpdate` (tests/hmr-model.ts) created hot contexts and hot data, ran
disposers, re-executed modules and ordered accept callbacks itself;
`editRouteFile` (tests/vite-hot-update.ts) used Vite's boundary analysis
with a fake router and no browser client. Both copied bundler/HMR dispatch
(ruling 2026-10-18; FIX-PLAN A1). Every consumer is ported to
`openRouteHmrPage` or deleted:
- route-hmr.test.ts: the Solid/Vue, factory and stale-id model tests go
(HMR-01/02/04/05; the page suites cover Solid/Vue on Vite and Rsbuild,
factory options in route-hmr-browser.test.ts; stale-id reachability is
evidence work, SPEC §9). The React-import exclusion stays as a compile
check (HMR-03: no window-key assertion). The no-HMR scan includes
`module.hot` (HMR-08). The dev-server tests that looked for the hot API
in the served code (.ts, environmentName, hmr.style alone, tsr.config.json
target, function options: HMR-10/11) are page rows in
route-hmr-browser-plugin.test.ts; the excluded environment is checked on
its whole served graph.
- known-bugs-route-hmr.test.ts (fast tier): the `hotUpdate` alias pin and
the `editRouteFile` boundary tests (HMR-22/23) are page pins; the fake
`ErrorBoundary` control/pin (HMR-19) is a page control/pin with the real
`react-error-boundary`; the staticData identity control stays.
- regression-helpers.test.ts: the four `hotUpdate` controls go with the helper.
- react-refresh-route-components.test.ts: the root module creating another
route is unsupported (one route per file, HMR-12): deleted; root edits are
covered by route-hmr-browser.test.ts.
- code-splitter-plugin-pipeline.test.ts: the webpack-style Solid update and
the factory-route HMR matrix (F07/F09/F33) are page rows; the accept
count goes (the route evaluates without a hot API).
- code-splitter-route-options.test.ts: root route call shapes are page rows.
- router-plugin-context.test.ts: the internal-plugin HMR test (F08) goes;
every page test's first edit goes through the public plugin setup.
- integration/plugin-options.test.ts: the hot-API scan of the rspack/webpack
entries (F08) becomes a page row on Rsbuild; the `addHmr: false` control stays.
- handle-route-update.test.ts calls the emitted `handleRouteUpdate` with
explicit inputs and a real router, no hot context (AGENTS.md sentence,
P3); the absent-route test navigates the live tree (HMR-26).
AGENTS.md carries the approved sentence (DECISIONS.md, P3).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`openRouteHmrPage` (tests/route-hmr-page.ts) now observes instead of sleeping:
the dev server's own `hotUpdate` plugin hook (Vite) or the compile tracker
(Rsbuild) tells when the server handled the written files; the HMR client's
public API (`vite:afterUpdate`, the webpack-style `addStatusHandler`) counts
the updates the page applied; document loads, HMR messages and the page's
own text decide the outcome. An edit the client applied without showing
fails after a short grace instead of a timeout (the pins of
known-bugs-route-hmr no longer wait 3 s each), and a reload or update that
arrives after the text showed is still attributed (HMR-34). `edit()` also
returns the page's errors since the edit (HMR-14) and the page exposes
`loads()`.
Rsbuild apps now run Solid (`@rsbuild/plugin-solid` + `@rsbuild/plugin-babel`)
and Vue (`@rsbuild/plugin-vue` + `@rsbuild/plugin-vue-jsx`) with their real
HMR support (FIX-PLAN A1 harness work 1). New options: `pluginOptions: null`
(the plugin reads tsr.config.json), `pluginOptionsAsFunction`, `readyTimeout`.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
typeErrorsOf passes the previous program as `oldProgram` to
ts.createProgram, so the compiler reuses what it can (the router packages'
type definitions are the same files in every app). Same compiler options,
same diagnostics; real-router.test.ts went from 4.8 s to 3.2 s in a
back-to-back run on the same load.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
route-tree.ts:
- The app's Vite config is read from its sources: @vitejs/plugin-vue for
.vue files, vite-plugin-solid ({ ssr: true }) when modules import Solid;
Solid apps let the plugin bundle the Solid router's sources for the
server (otherwise Node loads the packages).
- Solid apps share one Vite server per worker (compiling the Solid router's
sources takes ~0.7 s); before each load it forgets every module of the
app, so edited or regenerated files are transformed again. React and Vue
apps keep a fresh server per load.
- The router package is the loaded entry module (react/solid/vue-router
dist index) the app's modules use; pages render with react-dom/server,
solid-js/web (as the router package loaded it) or vue/server-renderer.
Tests:
- The Solid rows of generator-options.test.ts and template.test.ts load
their trees again (guards removed).
- real-router.test.ts is split: route shapes and pins stay there; React,
Solid and Vue page apps move to real-router-frameworks.test.ts; shared
helpers to real-router.ts. New React and Solid apps render their pages
(root layout, index, lazy component, lazy-only route, child route,
pathless layout); the Solid app's types are checked too.
- Route group layout (`(marketing)/route.tsx`): the runtime half (ids,
parents, matching, rendering) is a passing test; only the types mismatch
stays pinned. The pin now cites the docs (file-naming-conventions.md:15
`(folder)` route groups, :18 `route.tsx`) and #4629, which made it a
maintained shape.
- Lazy-only pathless layout (`settings/_layout.lazy.tsx`): restored as a
`.fails` pin with matching, rendering and types (types already say
/settings/profile; the router gives /profile). Lazy-only route files are
documented (guide/code-splitting.md:222-224, SPEC J1.8); same bug as the
G1 pin in route-paths.test.ts. Verified red without `.fails`.
All 21 router-generator pins re-run without `.fails`: red for their
stated reasons.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coordinator-approved test-only devDependencies (same kind as the approved
P1 ones), so the generator tests can load Solid route trees with the real
Solid router and render React pages:
@tanstack/solid-router (workspace:*), solid-js, vite-plugin-solid,
react-dom (+ @types/react-dom for the type-checked tests), all catalog.
Nx graph: neither @tanstack/solid-router, @tanstack/react-router nor
@tanstack/vue-router reaches @tanstack/router-generator (no cycle).
Lockfile regenerated with `pnpm install --no-frozen-lockfile` (importer
entries only); `CI=1 pnpm install --frozen-lockfile` passes; the set of
vite@8.3.4 variants in the lockfile is unchanged from 5057dad449.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Speedup 5: build-frameworks and plugin-options build webpack cells with
minify: false; their outcomes (placement of live code, rendering, init
counts, framework runtimes present, route tree) do not depend on terser.
Speedup 10: expectHydratesLikeServer and callInBoth run the SSR process
and the client page side by side; the shared-build block of
start-build-env-separation runs its rows concurrently.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A8 / GEN-36: client build output runs in a page of headless Chromium
(browser.ts openPage) served over HTTP from the output directory, instead
of jsdom globals copied onto Node. SSR output stays in a Node child
process. The guarded setImmediate probe now returns 'none'.
A8 / GEN-38: the dangling-name check reads the emitted chunks, never a
separately minified copy. Unminified webpack/Rspack builds are not
checked: their own output keeps dead code with dangling names for the
minifier (Rspack's unminified build of @tanstack/react-router alone reads
useRouter, jsx... without a binding). The control pairs the minified build
(dead code gone, passes) with the unminified one (kept, unchecked).
Removed control "a dangling name in code the minifier keeps fails" for
unminified builds: covered by "a chunk that reads a dangling name fails
the build description" (minified, every bundler).
A8 / GEN-37: every real browser/Node global is allowed; a lost local is
found from binding evidence (getModuleErrors `source` option), adopted by
rp plugin-host expectValidModules and spc render.ts in place of the
source-derived `globals`.
A7 / GEN-27: getModuleErrors/freeIdentifiers take the project's JSX
settings (`jsx`, default React automatic) and pass them to Oxc, which
interprets the pragmas and their position itself; no comment scanning.
Controls: the same non-leading pragma under a classic and an automatic
project.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
serverOnlyError/clientOnlyError are now asymmetric matchers: the call
threw (settle returns Thrown with the real error) a deliberate error
naming the owning environment, whatever its prose (SPEC J4.10, §5.7).
Consumers compare with toEqual instead of toBe; the nested-handler pin
fixture and the client-only-imports build return the error's name and
message instead of a "throws: " string.
source-maps.ts reads maps through the shared trace-mapping consumer
instead of a hand VLQ decoder (HYD-31).
V4 green-sol/10 (reworded error): 48 failures -> 0. A message naming no
environment still fails the same 48 tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FIX-PLAN A9-A12 helpers, outcome-only (SPEC §5.7, §5.14, G4, G9):
- diagnostics: read the real channel (thrown errors, aggregated build
errors and warnings, console) and assert severity, the file named
(absolute, relative or trailing segments, unambiguous among others),
the original position (any frame layout, 0- or 1-based column) and
API/option names; never prose. expectEnvRestrictionThrow and
envRestrictionError for J4.10: a deliberate error naming the owning
environment, any wording.
- importers: a real second module importing named/default/odd-name
exports as live bindings; load markers instead of import inventories.
- determinism: reorderings, expectDeterministic (same root) versus
expectRelocatable (per-root checks, portable projections only).
- source-maps: @jridgewell/trace-mapping, parsed token offsets, stack
tracing, CRLF-aware positions.
Integration control (tests/integration/oracles.test.ts): every bundler's
real build error names file, line and column; a throw in a built chunk
resolves through its stack. The build harness now keeps esbuild's
line:column (it dropped the location the real channel carries).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Minimal edits in W2-g's files (FIX-PLAN A1 rewrites them on real pages):
components render with real React (`renderComponent`, `render`), `isLazy`
is awaited, compile-only checks of Solid routes use `compileRouteModules`
(the Solid router cannot be linked in process), and "React Refresh
registers the split component" compares what a registered component
renders with what the route renders (the component a lazy option loads is
not reachable through the router's public API). All 16 pins of
known-bugs-route-hmr were run without `.fails`: each fails for its own bug.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FIX-PLAN A3a/A4 consumers (W2-b): F01, F02, F06, F30, F36.
- Components render with real React (`render`, or `renderRoute` through the
real router where they use route hooks); expected HTML is what React
renders. Stubs of the router packages and of React are gone.
- Laziness via `await isLazy`, groupings via `groups()` instead of module or
evaluation counts (F06: route options, plugin pipeline, pragmas; F36:
router-plugin-context checks that the requested group loads and an
independently configured one stays unrequested).
- "Not loaded with the route" via `eager`, the whole eager graph, instead of
the route module's direct imports (F30: dead code, imports/exports, module
state, scope); the compiler-level D5 checks stay on the split modules
(`loadedBy`, one or more modules).
- One-instance checks through real consumers (`importFromRoute`, a
component recording what it sees), never the identity of a lazy wrapper.
- Every `.fails` pin touched was run once without `.fails`: each fails for
its own bug. The `@jsxFrag` pin's fixture now says `@jsxRuntime classic`
(Vite 8's React transform ignores a lone `@jsx`, so the old fixture never
used its factory).
- New pin (code-splitter-pragmas, "in the route module, when the code
calling the factory is split"): the route module emitted for a file with
leading JSX pragmas starts with the splitter's own imports and drops the
classic factory import, so JSX left in the route module compiles with
React's default runtime under Vite 8. Hidden by the old JSX stand-in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FIX-PLAN A3a/A4, F01/F02/F06 (W2-b). `loadRoute` links the compiled route
with the real @tanstack/react-router (or vue-router) and React instead of a
router stub whose `lazyRouteComponent`/`lazyFn` were recognised by identity:
- `isLazy`, `loadedBy` (one or more modules: facades allowed) and
`groups()` observe loading through the router's lazy contract
(`preload()`, a loader call) and the modules requested (ctu lazy-probe);
- `render` / `renderRoute` render with react-dom/server, the latter through
a real router (`router.load()`, `RouterProvider`), so route hooks run;
- `eager` lists everything the route module's load requested (F30);
- `loadRouteGraph` loads fixed graphs: the harness controls now run on fixed
graphs of several valid shapes (an equivalent wrapper, an intermediate
module) and one wrong one (a group pulling another), not on the
splitter's output (F06).
`evaluateModule` and `evaluateRouteModule` use the real packages too. The
router stub and the JSX-as-text stand-in that hmr-model.ts (deleted by A1)
still needs moved into that file. Solid's router ships JSX source for
bundlers and cannot be linked in process; Solid runtime stays with the real
builds (integration/build-frameworks).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FIX-PLAN A3a/A4 (W2-b). The linker no longer renders JSX with a string
stand-in: JSX compiles with React's automatic runtime (Vite's Oxc
transform, what @vitejs/plugin-react configures) and graphs link real
installed packages (`packages`), so a test renders with the real React the
modules use (`importPackage`). New load observers: `requested` (every
module a graph's modules requested), `fork()` (fresh instances, same
modules and stubs) and `has(id)`.
- `render.ts`: real framework transforms (Vite's React transform,
vite-plugin-solid, @vitejs/plugin-vue-jsx, driven as Vite drives them) and
server renderers (react-dom/server, solid-js/web, vue/server-renderer),
all from the consumer's own packages.
- `lazy-probe.ts`: laziness, loaded modules and groups observed by the
modules a trigger requests, in forks, never by recognising a lazy helper
(SPEC J2.6, §5.3, §5.8).
- The linker control GEN-39 uses a plain exported object instead of JSX.
- react-start-rsc keeps its JSX-as-text through the deprecated `runtime`
option until FIX-PLAN A3c (W2-j) replaces that harness.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Loading generated trees through Vite and the real router packages costs
~150-250 ms of imports per test file under isolation (10 files load trees),
which took the fast tier from 9.9 s to 12.3 s on 1 worker. Test files do
not depend on module state: each test uses its own temporary app, restores
its spies/env stubs, and the tree helpers create a fresh Vite server (fresh
transform and module caches) per load. Runs with --sequence.shuffle (seeds
1 and 7, 1 and 2 workers) pass with identical counts.
1 worker: 9.9 s (baseline) -> 5.2 s; 4 workers: 3.1 s -> 2.5 s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"a route file that resolves to an empty path fails the generator" pinned
an error for physical('', 'merged') with merged/route.tsx as if any
empty-prefix mount were a conflict. J1.7 (V0.3): only genuinely conflicting
routes require the error.
- New: the docs' "Merging Physical Routes at Current Level" example, with
physical('features') and physical('', 'features'): /about, / and /contact
through the real router.
- New: a virtual /about next to features/about.tsx merged at the same level
fails the generator with an error naming both files (the docs' note).
- The root-layout case (merged/route.tsx) moves, unchanged, to
outside-compiler-corpus/virtual-routes.test.ts as a characterisation
outside acceptance.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shared route tree helper evaluated the tree against a stub of the router
packages and re-derived route ids and full paths with copies of router-core's
cleanPath/trimPathLeft and Route.init (route-tree.ts), and described lazy
options by recognising lazyRouteComponent/lazyFn; route-id.ts ran route files
against stub constructors and a stub JSX runtime. Both were copies of our own
runtime (FIX-PLAN A2a, GEN-01).
Now (tests/route-tree.ts):
- withRouteTree() loads the tree and the modules it imports with a real Vite
server (module runner, packages loaded by Node, @vitejs/plugin-vue for apps
with .vue files) and builds the router with the app's own router package
(createRouter + createMemoryHistory). routesOf/urlsOf read routesById and
fullPath; the file of a route is the evaluated module whose Route export is
that route. matchesOf() uses router.matchRoutes. Vue apps render with
vue/server-renderer: render() for a route option (after its preload),
renderAt(url) for a page (router.load + RouterProvider).
- evaluateModule() runs a module in a temporary app with the real packages.
- routeOptionsOf/loadLazyRoute/routePathsOf are gone. Route pieces are
checked by rendering each component option once the router loaded the
route (route-pieces.test.ts, GEN-18/20/32); the pathless-layout check reads
what the router matches at / (route-paths.test.ts; red when the layout gets
path '/', checked by mutating the generated tree).
- route-id.ts: routeCallOf() reads the constructor (bound through the router
package import, aliases and namespaces) and the id literal of the Route
call with Oxc. The id argument of createFileRoute is types-only at runtime
(react/solid/vue fileRoute.ts ignore it), so literal upkeep is checked on
the parsed value; evaluation is real (evaluateModule) where it was checked.
real-router.test.ts now asserts literal ids/full paths/parents, matching of
URLs, Vue pages rendering their single-file components, and that the tree's
types (FileRoutesById ids, fullPath, parentRoute id) equal the router's
(J1.13). New pin: a route group layout ((marketing)/route.tsx) is typed
fullPath '' while the router gives '/' (utils.ts:929-950 inferFullPath).
The settings/_layout.lazy.tsx row became settings/_layout.tsx: the lazy-only
variant is the G1 bug pinned in route-paths.test.ts.
.lazy.vue pin (J1.17, GEN-20): drops the "or the generator warns" branch;
/about must render the SFC through the real router. Empty .lazy.vue pin
(GEN-32): unchanged empty, or an SFC the Vue plugin compiles and Vue renders.
Deleted:
- route-tree.test.ts (10 controls of the stub evaluator); loading is now
Vite + the router, exercised by real-router.test.ts and every consumer.
- route-id.test.ts evaluateRouteFile controls (helper removed); routeCallOf
controls replace them.
- transform.test.ts row "adds the missing constructor next to a default
import": tsc accepts `import Router from '@tanstack/react-router'` only via
allowSyntheticDefaultImports (bundler resolution, no error), but Vite
rejects it ("does not provide an export named 'default'"), so the input
never runs in an app. The aliased and namespace rows still cover the
binding.
Solid: this package has no @tanstack/solid-router (not an approved
devDependency), so Solid route trees are not loaded; the Solid rows keep
their upkeep checks and skip the tree load with a comment
(generator-options.test.ts, template.test.ts).
Every .fails pin of router-generator was re-run without .fails: all 20 red
for their stated reasons.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`routerPackageStub` (a fake `@tanstack/{react,solid,vue}-router` with an
invented `.load()`) and `loadRouteOption` are gone (split F03): the
apps resolve the real built router packages, dependencies of this
package. New helpers of tests/dev-server.ts:
- `renderRoutePath(server, pathname)`: the real router over the generated
tree, `router.load()`, `<RouterProvider>` to HTML (SSR environment).
- `renderRouteComponent(component)`: React renders a component option
(after the real `preload()` when split).
- `servedRouterPackageUrl(server, target)`: the URL the client
environment serves the router package at (Vite's own resolver), the key
of its stub for `evaluateServed`.
- `importRouteModule` returns `{ server, routeModule }`.
`expectExportedRouteOptions` asserts outcomes: the export exists and is a
component; a split option is the real router's lazy component of it
(`preload`) rendering the same HTML; the page renders through the real
router. The pins that use it (known-bugs-dev-server: class and aliased
exports lost, shared overloads) fail without `.fails` on the missing
export (checked). `expectSharedOverloads` calls the real options.
Consumers (minimal edits in other owners' files): plugin-options.test.ts
(PO), router-plugin-context.test.ts (CTX), route-hmr.test.ts (W2-g:
Solid cases get `vite-plugin-solid` with `ssr: true`, which a Solid app's
SSR environment needs for the router's Solid build; the client evaluation
stubs the router with the SSR-loaded real package), dev-server-new-routes
(W2-f) and vite-hot-update.ts (W2-g deletes it): the router is served
from `/@fs/`, so the page-load skip patterns include it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`routerRuntimeFiles`, the stand-in `@tanstack/react-router` of apps with
routes (route creation, child linking, lazy loading, `sideEffects: false`),
is gone: the apps resolve the real built `@tanstack/react-router` (a
dependency of this package, built by `^build`) like any dependency, as
the `realRouter` dev servers already did. `realRouter` is gone with it
(always on). `startRuntimeLinks`/`linkStartRuntime` use the
compiler-test-utils workspace-packages helper.
Scripts that called a split component as a function render through the
real router and React instead: every app gets `harness/render.ts`
(`renderPath(routeTree, pathname)`: `createRouter`, `router.load()`,
`<RouterProvider>` to HTML; plus React's `createElement`/`renderToString`
for a loaded component on its own), which a test entry re-exports.
Rows: S10 (build-harness, start-build-options, start-build-route-hmr),
S47's runtime observation half (page HTML, not a component call), the
source-map stack now comes from React rendering the loaded component.
start-build-options: the hand-written router `index.d.ts` is deleted;
the Register checks type-check against the real router declarations
(verified: the test passes with them, and `Equal<any, 'ROUTER'>` would
fail if the import did not resolve).
hydrate-build.test.ts (A3b's file): its stand-in router no longer
derives from the harness's; the route creation moved into its own
stand-in block (W2-h replaces the hydrate stand-ins with the real
packages).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`@tanstack/compiler-test-utils/workspace-packages` generalises the
`startRuntimeLinks()` of the Start build harness: `workspacePackage(name)`
is the root of the built workspace package (packages/*, checked for its
built entry; the error names the Nx build target to depend on),
`workspacePackageLinks(names)` gives `AppOptions.symlinks` entries for an
app's node_modules, and `linkWorkspacePackages(root, names)` creates them
for an app made without the harnesses. A test app under a package's tests
directory resolves that package's own dependencies (e.g. the routers)
without links; the helper is for packages the owner cannot depend on
(`@tanstack/react-start` from start-plugin-core).
Contract test in tests/integration (links `@tanstack/history`, which the
package's `test:integration` target now builds, and imports it through the
link like an installed app).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
known-bugs-code-splitter-client-builds.test.ts took 21 s at one worker,
over the 15 s per-file limit of the slow tier. Its server-code, symlink,
source-map and production describes move unchanged to
known-bugs-code-splitter-client-output.test.ts (now 10 s and 12 s).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Unit tests step now runs the fast tier only (test:unit no longer
includes the Chromium tests, which these runners cannot launch). A new
Integration smoke step runs test:integration:smoke of router-plugin (a Vite
and an Rsbuild production build of a split route) and start-plugin-core (a
Vite and an Rsbuild import-protection build). The browser tests stay in
test:integration on Linux x64 in the main PR workflow. The workflow also
runs on compiler-test-utils changes, which both suites import.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under Vitest, the compiler packages set NODE_COMPILE_CACHE for their test
workers and the child Node runs those start (no outcome change).
compiler-test-utils gets a Vitest reporter that compares a tier's run with
its budget (test-budgets.json, the B3 table: target and hard limit per
package and tier, dev at default workers, ci at one worker; at one worker,
each slow-tier file against the 15 s per-file limit). It only reports for
now. router-plugin, start-plugin-core, compiler-test-utils and
react-start-rsc use it; router-generator does not depend on
compiler-test-utils.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mechanical moves, so that the owners of the next harness changes do not
edit one shared file: router-plugin's regression-helpers.ts keeps the
evaluation helpers and buildAndRun and re-exports plugin-host.ts (the
in-process host of the code-splitter, generator and route HMR plugins),
lazy-tracking.ts (loadRoute and its router stubs) and hmr-model.ts
(hotUpdate); start-plugin-core's keeps the compiler and runtime helpers and
re-exports imports.ts, diagnostics.ts, source-maps.ts and render.ts (the
<Hydrate> chunk helpers). Every name the old modules exported is still
exported from them (checked with the TypeScript checker; start-plugin-core
now also exports createTestModuleGraph and moduleId, which render.ts
imports). No code changed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each compiler package with real-tool tests (router-plugin,
start-plugin-core, compiler-test-utils) gets two Vitest projects: `unit`
(`test:unit`, in process; a Vite dev server in middleware mode is allowed)
and `integration` (`test:integration`, files under tests/integration/
that start real builds, Rsbuild dev servers, child Node runs or browsers).
Files that only start real tools move to tests/integration/ unchanged
(apart from relative paths). Mixed files are split by test: the in-process
tests stay in place, the real-tool tests move to a file of the same name
under tests/integration/ (known-bugs-code-splitter into three integration
files). No assertion changed; every test keeps its name and outcome
(vitest outcome per test compared with the baseline: 0 differences).
start-plugin-core: the Vite dev-server tests that link the built
@tanstack/react-start package move to the slow tier with the builds, so
test:unit depends on ^build only and the react-start build dependency
moves to test:integration.
Nx: test:integration (and test:integration:smoke) in targetDefaults like
test:unit; test:unit inputs exclude tests/integration; test:integration
joins test:pr, test:ci and vite-ecosystem-ci:test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vite's optional peers `sass` and `sass-embedded` are resolved from whatever
versions exist anywhere in the lockfile graph. Two sass versions were in the
graph: 1.97.2 (the `^1.97.2` devDependency of the three Start css-modules
e2e apps) and 1.105.1 (pulled by `sass-embedded`, which
`@rsbuild/plugin-sass` brings into e2e/react-start/css-modules). Importers
resolved at different times got different vite peer variants: compiler-test-
utils, react-start-rsc and eslint-plugin-start got vite(sass@1.105.1), the
rest vite(sass@1.97.2). Two copies of vite break Start's
`isRunnableDevEnvironment` (instanceof) check, so Start's dev server
middleware never ran in the compiler test dev servers.
The css-modules e2e apps now ask for sass ^1.105.1, the version sass-embedded
already uses; the graph has one sass and one vite@8.3.4 (esbuild 0.28.2)
variant.
With Start's dev middleware working, the client-rendered route HMR test
turns it off explicitly (it serves index.html, not Start's SSR); the Start
dev-server harness accepts the Vite plugin options for that.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`files` of the shared construct build has no index signature (TS7053 under
TypeScript 5.7 to 5.9).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Start's real runtime (real-start-build) the Rsbuild dev tests of
start-plugin-core became flaky (baseline ac3f8d5ac9: 8 of 8 runs of
tests/rsbuild/dev-server.test.ts green; real-start-build 953b24f622: 1
failure in 6; the merge: 1 in 11). Two causes, both in the shared harness:
- "Rsbuild failed to compile the app: Unable to access compilation with
id = CompilationId(5) now": `onDevCompileDone` runs after the compile
ended; when a later compile already started (Start rewrites its server
fn resolver module, which the watcher reports), Rspack has dropped the
compilation and reading `builtModules` throws. The harness now skips
such a report: the running compile's end reports instead.
- "the client's hot update has the edited client code ...": `label` never
showed up within 10 s. `hotUpdates()` read the hot-update chunks from
disk, skipping those a later compile removed. It now keeps their code,
read in each environment compiler's `done` hook while the compilation
is alive.
`hotUpdates()` keeps its contract (the hot-update chunks of the compiles
since the last `edit()` began). 8 of 8 runs green afterwards.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
User ruling 2026-10-18 (test infrastructure must not re-implement other
tools or packages). The by-id helpers mirrored Start's server-fn HTTP
handler (`handleServerAction`): resolve the id with `getServerFnById`, call
it with `{ data, method }`, unwrap `{ result }` / `{ error }`. They now send
the request a page sends to Start's own server entry:
- builds: the SSR entry exports Start's default server entry
(`@tanstack/react-start/server-entry`) and client RPC
(`@tanstack/react-start/client-rpc`) (`callByIdExports`); `callById` calls
the client RPC with a `fetch` that hands a real `Request` to the server
entry's `fetch` (`callByIdPrelude`). `handleServerAction` is not exported
by `@tanstack/start-server-core`; `createStartHandler` (the default server
entry) is its public way in.
- dev: `callServerFnById(server, id)` (dev-server.ts) does the same with
the dev server's SSR environment (the server entry Start's dev middleware
imports, `virtual:tanstack-start-server-entry`). The dev servers mount
Start's whole Vite plugin (`start`, `realRouter`, `startServerEntryFiles`).
The harness cannot go over HTTP: Start's dev middleware is not installed
because compiler-test-utils and start-plugin-core resolve two copies of
vite 8.3.4 (different sass peers), so `isRunnableDevEnvironment` fails.
Glue only: a page's browser adds `Sec-Fetch-Site: same-origin`, which
Start's CSRF middleware requires (without it every call is "Forbidden"),
and the caller throws `error` / returns `result` like the client's server
fn. The old copy (`callServerFnById(getServerFnById, id)` in
build-harness.ts) is deleted. Contract test build-harness.test.ts "a
server fn is Start's RPC on the client ..." now checks the real round trip
(by id, and an unknown id rejects with "not found").
Changes needed by the real server entry:
- It renders with the real `@tanstack/react-router`, so an app with the
router stand-in cannot load it (Vite SSR: "does not provide an export
named 'RouterProvider'"). start-build-env-separation "each server fn of
the client runs by its id in the SSR build" gets its own build of the
server fn files (no routes) instead of the shared routed build.
- bundledDev tests: Start's plugin needs React Refresh
(`@vitejs/plugin-react`), and its client entry replaces the harness's
bundle entry, so `harness/client-entry.ts` re-exports `src/entry.ts`.
- known-bugs-start-compiler "calls a server fn id on a fresh dev server":
the raw dev servers use Start's whole plugin (`startPlugin`,
`startPluginFiles` now exported). Start logs the failed call's Vite
plugin error with `console.error`; Vitest's console forwarding then ends
the run without a report, so the test silences `console.error` during
the call.
- Not converted: start-compiler-dev-server "a server fn provider
environment other than SSR" (compiler plugin alone with an `rsc`
provider; the server entry for such a setup is the framework's). It
calls the provider's resolved server fn directly and checks
`{ result }`, without claiming to be the HTTP handler.
Pins re-verified red for the same reason (run once without `.fails`):
- D6 "SSR: a server fn only server code references is not callable over
HTTP" (vite, rsbuild): serverOnlyFnOverHttp is 'server-only fn' (now a
real HTTP request), as before.
- known-bugs-dev-server "SSR: a module importing an edited factory module
through a re-export" (2 rows): same diff as before (id 'undefined',
byId "Invalid server function ID: undefined").
- known-bugs-start-compiler "calls a server fn id on a fresh dev server
that has not compiled its module": same message as before ("Invalid
server function ID: eyJ...").
Also drops a stale reason from a start-router-dev-server comment (the
real `@tanstack/react-start` is linked now).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in packages/start-plugin-core/tests/dev-server.ts: keep both
sides. The app links the real @tanstack/react-start (startRuntimeLinks,
real-start-build) and gets the router stand-in only with `start` and
without `realRouter` (baseline).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
User ruling 2026-10-18 (test infrastructure must not re-implement other
tools or packages). The build harness no longer writes a hand-written
`@tanstack/react-start` into the app: `node_modules/@tanstack/react-start`
links the built workspace package (`startRuntimeLinks`), and its
dependencies (start-client-core, start-server-core, start-storage-context,
router-core, ...) resolve from its real path. The `test:unit` target now
depends on `@tanstack/react-start:build` (task-level dependsOn, no project
dependency, so no cycle). The Vite and Rsbuild dev harnesses link it too.
Stand-ins kept, only where the test process cannot run the real piece,
each checked against the real runtime:
- request context: SSR scripts and in-process server calls run in a
`StartStorageContext` (typed against the real one) of a request to `/`
(`inRequestContext`, `runInRequestContext`); contract test
build-harness.test.ts "SSR scripts run in a request context that Start's
runtime reads".
- the network: a client call's requests are observed through the call's
public `fetch` option (`requestsOf`); contract test "a server fn is
Start's RPC on the client ...".
- the server-fn HTTP handler: by-id calls resolve, call with
`{ data, method }` and unwrap `{ result }`/`{ error }` like
`handleServerAction` (`callByIdPrelude`, `callServerFnById`).
- Vite dev client evaluation loads start-client-core through Node
(`servedStartRuntime`): the root entry imports React (CommonJS), which only
Vite's dependency optimizer (off in the harness) serves to a browser.
- Rsbuild compiler-only dev server defines `TSS_SERVER_FN_BASE` like
Start's plugin; its VM gets the WinterTC web APIs a browser has.
- hydrate-build keeps its own `@tanstack/react-start` (Hydrate rendered by
a string JSX runtime); new contract test: its names are the real
package's.
Harness realism: Vite builds run in the app's directory, as `vite build`
does (Start's plugin crawls the working directory's package.json for Start
libraries to bundle in SSR); the build harness records Rsbuild's
`output.module` for the dangling-name check.
Status changes, each investigated:
- Tests that relied on the fake (`functionId`, client RPCs throwing
"client RPC <id>", `getServerFnById(id)({})` returning the bare result,
middleware `.server()` stubs, uncompiled `handler(rpc)` returning `rpc`):
rewritten to Start's real API (`serverFnMeta.id`, `url`, requests the call
sends, `{ result }` unwrapping). The library-server-fn tests passed
vacuously on Vite: the library stayed external and uncompiled in SSR,
and the stand-in's uncompiled `handler(fn)` returned `fn`. The apps now
depend on their library, as installed ones.
- Route-tree type test: the `@tanstack/react-start` d.ts stand-in is
replaced by the real package's types.
- Pins re-verified red for the same reason (with `.fails` removed, failure
messages compared to baseline 5d35383f02): 123 pin rows across the build,
dev and import-protection files are unchanged. Import-protection dev pins
load only the app's modules (Start's server package imports Start's
entries, which only Start's whole plugin provides). Library-function
pin (D13): SSR now also shows the uncompiled server fn (`undefined`
instead of the stand-in's handler result).
- NEW pin (Vite): a build run from another directory leaves a Start
library external and uncompiled in SSR (src/vite/plugin.ts:143 crawls
`process.cwd()`, not Vite's root); verified red: the SSR call returns
undefined. Rsbuild row passes.
Cheap stand-ins replaced as well: createMiddleware.test.ts
`middlewareFactoryStub`, known-bugs-start-compiler `middlewareStub` and the
string stubs of its dev servers, start-compiler-factories' middleware stub
now use Start's real builder (keeping a `.server()` trap where the test
needs one).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Additive harness changes for Start builds that bundle Start's real runtime:
- createApp `symlinks` may point to an absolute path (a workspace package
linked into the app's node_modules). Relative targets resolve as before.
- describeBuild `esModules`: the chunks are ES modules (the bundler's
`output.module`), even a chunk without import or export. The dangling-name
check of an unminified Rspack/webpack client build minifies such a chunk
as a module, like the bundler's own minimizer does. Before, a module chunk
without import/export was minified as a script, so its unused top-level
code (here seroval's `const RETURN = () => T`) stayed and was reported.
- known globals: `Temporal` (browsers and Node.js 26 define it; the
`globals` package 16.x does not list it yet). Start's serializer
(seroval) revives Temporal values with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
User ruling 2026-10-18: no copies of React HMR logic in tests.
Deleted (copies of React Refresh / plugin-react behaviour):
- regression-helpers `isRefreshable` / `expectRefreshableRouteOption`:
modelled how React Refresh's runtime resolves memo / forwardRef to a
registered family.
- react-refresh-route-components "a React route module compiled for Vite
stays a Fast Refresh boundary" (6 tests): evaluated the module twice
with one hot context and called plugin-react's
validateRefreshBoundaryAndEnqueueUpdate by hand, as its accept glue does.
- react-refresh-route-components "React Refresh registers split route
components" (memo / forwardRef rows) and "hoists the components of the
module's Route when another route is created first".
- known-bugs-route-hmr "React Refresh registration": the memo(Page)
control, the "registers an inline component written as $name" pins and
"registers a method-shorthand component of a split route".
Replacements on the real page harness (route-hmr-page.ts, Vite +
@vitejs/plugin-react, headless Chromium):
- route-hmr-browser: a route without a component and a root route with an
inline stateful component apply their edits in place (state kept, no
reload), autoCodeSplitting on and off; split components written inline
in memo / forwardRef calls, and inline components after another route
the module creates (unsplit component, and the route module's
pendingComponent when split), show their edits without a reload.
`extra` is no longer exported there: an exported route object makes
plugin-react reload the page (React Refresh boundary rule), which was
not what the source test was about.
- known-bugs-route-hmr "route HMR in a real page": control memo(Page)
unsplit; pins (each verified red by one run without .fails: the page
keeps "inline v1" / "root v1", no reload) for `as any`, `satisfies`,
memo(() => ...), forwardRef(function ...), method shorthand (unsplit and
split) and React.memo(forwardRef(...)) on a root route.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
User ruling 2026-10-18: tests must not re-implement other tools. The
start-router-dev-server "client route module takes part in HMR" test
(spc:6046) applied the hot update "the way Vite's HMR client does": a
copied createHotContext, accept callbacks called by hand, a stub
`__TSR_ROUTER__`. Deleted.
Replacement: a real Vite dev server with Start's whole Vite plugin and
@vitejs/plugin-react (`browser: true` of the shared harness) serves an
app with the real @tanstack/react-router to headless Chromium
(`@tanstack/compiler-test-utils/browser`). Vite's own watcher reports
the edits; Vite's HMR client, React Refresh and the route HMR code Start
adds apply them. After a loader-only edit and then a component edit of
the split page route, the page shows the new loader data and component,
the split component keeps its click count (no remount), there is one page
load, no full-reload message and no page error.
The page is the app's index.html, rendered on the client: Start's SSR
document needs the real @tanstack/react-start, which depends on
start-plugin-core (a workspace cycle). Start SSR + HMR in a real app stays
in e2e/react-start/hmr.
Scratch control (reverted): with `addHmr: false` in Start's client code
splitter (vite/start-router-plugin/plugin.ts), the test fails: the page
reloads (2 loads) and shows "count 0".
Harness: tests/dev-server.ts `realRouter` (with `start`) leaves out the
stand-in router package. New devDependencies: @tanstack/react-router
(workspace), @vitejs/plugin-react, react, react-dom (catalog); lockfile
regenerated with pnpm install --no-frozen-lockfile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in packages/compiler-test-utils/src/rsbuild-dev-server.ts: kept
both sides. The returned server has hmr-real's `url` (browser mode) and
w2-builddev's `edit()`, which clears the hot-update chunks collected
since the previous edit before writing. `hotUpdates()` keeps w2-builddev's
behaviour (`.js`/`.mjs`/`.cjs` chunks of every compile since the last
edit); browser mode, HMR-on default with `browser`, live reload and the
HTML page come from hmr-real.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
User ruling 2026-10-18 ("absolutely insane"): no copies of Vite / webpack /
Rspack / React HMR or update-propagation logic in tests.
Deleted:
- tests/react-refresh-model.ts (port of @pmmmwh/react-refresh-webpack-plugin's
executeRuntime, React's resolveFunctionForHotReloading, plugin-react's
boundary check) and the propagation / refresh parts of `hotUpdate` in
regression-helpers.ts (boundaries, invalidation, refresh families,
render/remounted). `hotUpdate` keeps only our route HMR code running against
the bundler's hot API contract (Vite accept callback gets the new module;
webpack re-runs the module with its dispose data), as before w2-hmr.
- the react-refresh devDependency (lockfile regenerated).
- the w2-hmr pin "vite: applies route options a factory call builds" (ruling
2026-10-18: reloading is fine); the edit now must show in the real page.
- model-only tests: route-hmr hot updates of split / root / unsplit routes and
their React Refresh assertions, regression-helpers "with React Refresh"
controls and "reloads the page exactly when a Vite dev server does",
react-refresh-route-components "route HMR code next to user bindings", the
two editRouteFile tests of route-hmr (covered by the page steps below).
New real harness (tests/route-hmr-page.ts, on compiler-test-utils `browser`):
a Vite dev server with the router plugin and @vitejs/plugin-react /
vite-plugin-solid / @vitejs/plugin-vue-jsx, or an Rsbuild dev server with the
router plugin's Rspack entry and @rsbuild/plugin-react (new devDependency,
^2.0.0 as in the e2e apps), serves a file-based app with the real router
package to headless Chromium; edits go through the dev server's own watcher;
the test reads the DOM, clicks counters (state), and gets `reloaded` (page
loads, plus Vite full-reload messages).
Ported (tests/route-hmr-browser.test.ts, Vite and Rsbuild, autoCodeSplitting
on and off, several edits per server, concurrent):
- edited component body + loader + `Route` read: new text, new loader data,
`useState` count kept, no reload;
- a hook added: remount (count 0), no reload;
- errorComponent added / edited / removed, pendingComponent and
notFoundComponent edited: new text, no reload (removal: text only, see pin);
- arrow component, two split components, quoted keys, loader in its own chunk,
loader in the component chunk (Vite; Rsbuild pinned), a value loader and
component share, user bindings named hotData / handleRouteUpdate: state kept,
new text, no reload;
- root route: body + loader in place with state, shellComponent added /
edited (state kept) / removed, no reload; factory-built options: the edit
shows (reload allowed);
- Solid / Vue in Vite: the edit shows; Solid unsplit without a reload.
regression-helpers.test.ts controls (Vite and Rsbuild): a body edit keeps
state, a renamed child component loses it, an edit of a module no boundary
accepts reloads the page.
Scratch control (not committed): with the route HMR code removed
(codeSplittingOptions.addHmr: false for split routes; the route HMR plugin
patched out of router-composed-plugin.ts for unsplit routes, reverted), a
loader + component edit reloads the page and loses state on both bundlers.
Pins (known-bugs-route-hmr.test.ts "route HMR in a real page", each verified
red for the right reason by one run without .fails):
- moved: D10 Solid / Vue split (red: reloaded true); without React Refresh,
now Rsbuild with pluginReact({ fastRefresh: false }) (red: page stays v1).
- NEW: renaming the route component keeps the old one (Vite, Rsbuild x split,
unsplit; red: page stays "Page v1").
- NEW: Rsbuild: an edit of a split loader never shows (red: "loader v1").
- NEW: Vite: removing a split option the page loaded logs "require is not
defined" / "Failed to reload ...?tsr-split=errorComponent" (red: those two
page errors).
Kept on the slim hotUpdate (our code only): regression-helpers hotUpdate
controls, route-hmr "the route a hot update applies to", Solid / Vue route HMR
code (now also unsplit and the new component), webpack factory options,
known-bugs "route updates", code-splitter-plugin-pipeline (dropped
`refresh: true`), code-splitter-route-options root staticData.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
User ruling 2026-10-18: test infrastructure must not re-implement other tools;
route HMR tests drive the real tools. Shared, plugin-agnostic, additive:
- browser.ts (new export `./browser`): `openPage(url)` opens the page in
Playwright's headless Chromium (one browser per test process, one context per
page), counts page loads (a full reload loads it again), records page errors
and console messages, and `waitForText(expected)` waits for the DOM with a
bounded timeout and a diagnostic error. New dependency: @playwright/test
(catalog, already a root devDependency; chromium-1243 is installed);
lockfile regenerated with pnpm install --no-frozen-lockfile.
- dev-server.ts: `browser: true` serves the app as `vite dev` does: listens on
a free port (`url`), Vite's HMR WebSocket on, Vite's own file watcher
reports edits (`write()`; `settle()`/`edit()` throw), dependency optimizer on
with its cache in the app directory, `appType: 'spa'` (index.html). The
defaults are unchanged (no watcher, no WebSocket, no dep discovery).
- rsbuild-dev-server.ts: `browser: true` listens on a free port (`url`), emits
the HTML page, HMR (default on in this mode) and live reload. The harness
default `hmr` stays off without `browser`.
- tests/browser.test.ts: controls for both bundlers: an update a module
accepts applies in place (one page load), an update nothing accepts reloads
the page (two loads).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The prerendered-pages helper comment (moved from known-bugs-route-options
by the E1 audit) still said start-build-prerender.test.ts runs the
prerender step. That file was deleted in f3c5ae0575 (prerendering is out
of scope); nothing runs the step now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- start-compiler-runtime-contract.test.ts (audit E1 missing coverage 1):
the stand-ins the harness keeps carry exactly what Start's own
createClientRpc / createSsrRpc create (now built from them), and one
module with a server fn, a function middleware (validator, client,
server) and an isomorphic fn runs on Start's runtime from the client
(callFromClient), the SSR caller and an HTTP call by id; a failing
handler answers { error }, which the caller rethrows.
- The SSR RPC stand-ins reuse the real createSsrRpc metadata.
- factories: the first env-separation test runs in build and dev mode
(missing coverage 4).
- Formatting and type annotations of the new harness module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"the client route tree follows the edits" still failed 4 of 16 repeats
after the bounded wait: at the server-only -> page step no message ever
came and the client route tree stayed without the route. Cause: the
router generator tells route file edits apart by modification time only
(router-generator generator.ts `didFileChangeComparedToCache`), and the
kernel updates mtimes once per clock tick; the harness wrote the second
edit within the tick of the first, so the generator never saw it. A
person's saves are not that close: the test now waits 50 ms before each
save. 40 repeats green. The generator behaviour is recorded in FOLLOWUPS
(NEW, unpinned: reachability needs two saves of one route file within one
tick).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new "Rsbuild dev with HMR" test failed once in two full runs (and 1 of
11 repeats): the client's hot update did not have the edited code when
read. An edit can cause more than one compile (Start rewrites its server
fn resolver module, which the watcher reports), and the client's compile
can end after `edit()` returned.
- Shared harness (packages/compiler-test-utils/src/rsbuild-dev-server.ts):
`hotUpdates()` returns the hot-update chunks of every compile since the
last `edit()` began, not only the last compile's (a chunk a later compile
removed is skipped). compiler-test-utils suite unchanged.
- The test waits (bounded, 10 s) for the client hot update with the edited
client code, then checks that no hot update since the edit has the
edited handler. 44 repeats green after the harness change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
User ruling 2026-10-18: the second `options` argument and a plain-data
model are outside React Start's public type (`renderToReadableStream(node:
React.ReactNode)`, src/flight.stub.ts) and must not break: the compiled
call still runs, the options / model reach the runtime unchanged and a
stream is produced. CSS for them and a dev warning are not required either
way.
- The D8(a) goal pin for `renderToReadableStream(<Card />, options)` becomes
a passing test, neutral on CSS (stream with or without it).
- rsc:450 plain-data model: checks the call and its model in dev and build,
neutral on CSS and warnings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
User ruling 2026-10-18 (E1 ASK-1): a default-config Start build (Vite and
Rsbuild) of a module whose `*.client.*` and client-only-marked imports are
used only by createClientOnlyFn / an isomorphic .client() reports no
import-protection violation, the server bundle holds none of their code,
and each environment runs its implementation. Negative control checked by
hand: adding a top-level use of the .client import fails the build with an
import-protection error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- createIsomorphicFn: named exports read explicitly (P1), the client has
no server implementation (SERVER_IMPL marker), declaredNames assertion on
the neutral name dropped (ruling 2026-10-17); SSR keeps asserting it drops
`./x.client` (ruling 2026-10-18: import-protection-denied names must go),
client asserts it drops `./x.server`. Real runtime instead of a stub.
- clientOnlyJSX: SSR import-absence loop on neutral names dropped; the
libraries the children use throw when called during SSR, so the test
proves the server never evaluates the children (missing coverage 2).
- compiler.test: empty-module test in dev ("a file the user just
emptied"); the client-only result is read inside a function;
invalidateModule tests in dev mode; `var a = b; var b = a` row deleted
(cycle rows at "re-export chain resolution" cover it).
- caller-dead-code: own-name local pin uses `function session() { const
session = ... }`; label and for-init rows dropped.
- known-bugs-start-compiler: computed-member chain pins, top-level-block
alias row, `.bind(null)` pin (rsc renderServerComponent().then() pin
covers the root cause), parameter-shadowing pins (dup of the
every-factory shadowing pin), `fn_createServerFn_handler` row (generated
name), redeclared-var row and computed-member transform pin deleted;
re-export alias pin imports from @tanstack/react-start; Vue pin uses a
plain `<script lang="ts">` block, id `Page.vue?vue&type=script&lang.ts`
(checked in @vitejs/plugin-vue 6.0.5 genScriptCode/attrsToQuery: lang is
in the ignore list and appended as `&lang.ts`).
- preserves-user-code: empty destructuring pin and N3 parenthesized-JSX
pins (incl. the Hydrate fallback one) deleted; the parenthesized-JSX
control stays.
- factories: wrapped-chain table rewritten to valid chains (tsc:
`.server().client()` is TS2339) with parentheses / as any / as unknown as
T / satisfies (16 rows -> 13 passing + wrapped validator rows moved into
the validator pin, same bug, verified red: ./check.server kept); builder
variable control uses `.client()` then `.server()`; isomorphic
wrapped-link pin checks client and SSR only (no provider for a module
without a server fn); callee pin keeps `as any` only; aliased re-export
of createClientOnlyFn checked by behaviour on the server; string export
name row deleted. Links read from Start's real createMiddleware options.
- known-bugs-route-options: prerender pins and their controls moved to
tests/outside-compiler-corpus/prerender-route-options.test.ts (ruling
E1 ASK-2).
ASK-1 (ruling 2026-10-18): SSR import assertions on `.client` names kept
(factories, import-forms, KB ssr declaration control and typeof pin).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The build harness builds for `esnext`; apps use Vite's default client
target (`baseline-widely-available`), which lowers syntax after Start's
compilers ran. With that target (through `viteConfig`):
- start-build-env-separation: a server fn handler (and its dependency) is
only in the SSR build, which runs it; the client keeps its other code and
calls the server (client RPC).
- start-build-source-maps: a throw in a split route component maps to its
line in the route file (minified).
Both pass on main.
Audit: E2 missing coverage #5 (brief item 3).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New rsbuild/dev-server test "Rsbuild dev with HMR: editing a server fn
module" on Start's whole Rsbuild plugin with `hmr: true`: after an edit of
a module with a server fn and a client function, the client's hot-update
chunk has the edited client code (MARK_LABEL_V2) and not the edited
handler (MARK_HANDLER_V2), which the SSR output has. Passes on main.
Shared harness (packages/compiler-test-utils/src/rsbuild-dev-server.ts):
`hotUpdates()` only kept `*.hot-update.js`; Start's client environment
emits ES module output (`*.hot-update.mjs`), so it returned nothing. It
now keeps `*.hot-update.{js,mjs,cjs}` chunks (manifests still excluded).
compiler-test-utils suite unchanged (167 pass).
Audit: E2 missing coverage #4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start forces `addHmr: true` in its client code splitting
(vite/start-router-plugin/plugin.ts, rsbuild/start-router-plugin.ts), but
only router-plugin's build-production.test.ts checked that production
client output has no route HMR code. New start-build-route-hmr.test.ts:
- controls: the Vite dev client route module and the Rsbuild dev client
output (Start's whole plugin) contain route HMR names (HMR APIs, route
HMR data keys, React Refresh support);
- Vite and Rsbuild production builds through Start's plugins: no client
chunk contains any of them, and the page's loader and component run.
Passes on main. Mutation check (router-plugin
router-code-splitter-plugin.ts, `addHmr` ignoring production, reverted):
the Rsbuild row fails with import.meta.webpackHot / tsr-route-id /
tsr-split-component in the client output; Vite deletes that code itself
(dead `import.meta.hot` branches), so its row passes, which is the right
outcome for users.
Audit: E2 missing coverage #1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
start-compiler-dev-server "the client never gets the edited .server(), and
SSR runs the new one" now mounts Start's whole Vite plugin
(`startDevServer({ start: {} })`: Start's environments, import protection,
router plugins) instead of the compiler plugin alone, as an env-separation
dev row with the real wiring. Passes on main.
Audit: E2 harness ("most dev tests do not use the full Start plugin").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The planned D8 warning (React's RSC CSS transform) is dev-only, but only
builds tested the warning channel. With Start's whole plugin and the
`warnMe` test transform (server environment):
- Vite dev (`startDevServer({ start, compilerTransforms })`): loading
`src/entry.ts` in the client and the server logs exactly one warning,
naming src/warned.ts; the server runs the module. Passes on main.
- Rsbuild dev (`startRsbuildStartDevServer({ compilerTransforms })`):
`.fails` pin, same bug as the Rsbuild build pin in this file. Verified
red for the right reason with a temporary probe in
rsbuild/start-compiler-host.ts `warnTransformContext` (reverted): the
transform warns on src/warned.ts, `ctx.emitWarning` is undefined, so the
warning is dropped and `server.warnings` has none.
The build tests stay (secondary).
Harness (additive): `compilerTransforms` option on `startDevServer` (with
`start`) and `startRsbuildStartDevServer`.
Audit: E2 start-build-warnings:140 (FIX), missing coverage #2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Harness (E1 H1-H3, H7; 2026-10-18 ruling "test infrastructure must not
re-implement other tools"): evaluated modules now link
`@tanstack/<framework>-start` to the real `@tanstack/start-client-core`
(createServerFn, createMiddleware, createStart, env-only and isomorphic
factories) and `/server-rpc` to the real `createServerRpc`
(tests/start-runtime.ts). The hand-written runtime stub is gone: handlers
now run as Start runs them (`options.serverFn(ctx)`, ctx with data,
context, method and serverFnMeta, async middleware `next` passing context
on, middleware and server fn validators), provider handlers answer
`{ result }` / `{ error }` (helpers unwrap with `serverFnResult`), and
`serverFnMeta` replaces the stub's `meta`.
Stand-ins kept (Start cannot run them in-process): the request context
(storage falls back to an empty request), the client RPC (Start's own
metadata, no fetch), the SSR RPC's server-fn resolver (createServerGraph).
`callerRpcId` reads a caller's RPC id; `callFromClient` runs a client
caller through the real client middleware into the provider handler.
Hand-built builder stubs in tests are replaced by the real builder.
E1 findings applied here (tsc checks against start-client-core types):
- createMiddleware:53/185/202/243/255/288: rewritten to valid chains.
tsc: createMiddleware().client / .validator -> TS2339; .server().client
-> TS2339 (FunctionMiddlewareAfterServer); createMiddleware({ id }) ->
TS2353; createStart(() => {}) -> TS2345.
- exports-and-directives:42 per-name checks, `named` instead of a string
export name; :139 export-list line deleted (:158 covers); :276/:283/:305
redeclared-var tests deleted (D13 goal pin added in declaration-sites);
:398/:418 directive tests deleted (compiler.test.ts module-directive test
covers the configured directive).
- handler-scope:83 `typeof this` dropped (Start calls the handler as a
method of its options; tsc accepts `this: unknown`); :107 object method
through a named object; :150 `as unknown as` cast (tsc ok).
- declaration-sites:36 clear-rejection regex; :134 top-level switch/block
placements deleted (+ their KB pins); :169 result toMatch
function|object; :203 SERVER_SECRET marker; :227 optional-chain pin
accepts a clear error or the RPC path; new D13 goal pin: two functions
each declaring `const fn`.
- createServerFn:172 finds the provider handler by id and runs it.
- caller-dead-code: client middleware observed by calling from the client.
- Missing coverage 3: a valid full middleware chain on client and SSR.
hydrate-split-modules.test.ts: its click stub reads the RPC id from
Start's caller metadata (one line; the client RPC is now Start's own).
Pins: every remaining .fails pin re-run as a normal test before/after;
failure reasons unchanged except the RPC-shape wording (same root cause)
and KB "ssr: a createServerOnlyFn handler still produces an RPC caller"
(now the real runtime rejects the id string the SSR output passes, was
"ssr.fn is not a function"; same compiler bug). New pins verified red:
optional chain (client left untransformed), two `const fn` functions
(client gets no RPC / provider export missing).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- rsbuild/dev-server "every module importing a factory from %s that
stops being one keeps its handler" (2 rows): instead of counting
`db.x()` in printed output, the client calls both fns (entry
`globalThis.run`) and gets ['MARK_DB_SECRET', 'MARK_DB_SECRET'].
- "... that becomes one loads no server code" (2 rows): also checks that
calling the fns in the client goes to the server (client RPC).
- Both now run on Start's whole Rsbuild plugin
(`startRsbuildStartDevServer`: client and SSR environments, import
protection) instead of the compiler transforms on the client alone. The
dependency is `src/db.ts`, not `src/db.server.ts`: import protection
mocks a `.server` file in the client (and awaiting the mock, a thenable
that resolves to itself, blocks the process).
- "the server fn ids do not come from generateFunctionId": drops the
`generated` calls check (whether the dev server calls the generator is a
mechanism); keeps "no id is custom-".
- New helper `runInClient(server, script)` in rsbuild-dev-server.ts
(additive).
Audit: E2 rsbuild/dev-server:66 (FIX), :151 (FIX), harness note
(startRsbuildDevServer is not Start's plugin).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Missing coverage 1 (audit F): each pin that only existed on an internal
function (rewriteDeniedImports, mock-module generators) gets a real-app
twin on a Vite dev server (mock mode) and in Vite and Rsbuild mock-mode
builds. Outcome: what `entry.read()` returns, and no real code in the
client bundle. Pins verified red by one run without .fails:
- `export * as secrets from './secret.server'` in an importer: Vite dev
(SyntaxError: no export 'secrets'); builds pass.
- a denied file with `export * as helpers`: Vite and Rsbuild builds
(MISSING_EXPORT / ESModulesLinkingError); Vite dev passes.
- a denied file exporting `delete` used as `api.delete()`: all three
(parse errors on `export const delete`).
- a namespace member read in a function declared before the import (denied
specifier): Vite dev and build (`db.query is not a function`); Rsbuild
passes.
- enum + namespace exports of a denied file: NEW Rsbuild bug, the real enum
value ships in a mock-mode production build (Rsbuild's
collectTypeScriptInfo.exportedEnum inlines `Color.Red`; verified by a
scratch build with exportedEnum: false, which mocks it). Vite passes.
- a JSX pragma leading a denied import passes everywhere (default JSX is
compiled before the rewrite); kept as passing coverage.
`delete` stands for the reserved-name bug (eval/arguments are not
realistic export names).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- analysis.exports:50 empty export name "" pin: deleted (fuzzer-only input;
tsc accepts `export { x as "" }`, but no realistic module exports it).
- analysis.exports:320 `import(('denied'))`: deleted (the literal dynamic
import is covered by utils.test.ts getImportSources "import('./lazy')").
- analysis.exports:139 re-exports: no Object.keys equality (P1); the
per-name mock check proves presence. :175: `'value' in module`.
- rewrite:132 weak `export * as ns` pin (toBeDefined): deleted, covered by
known-bugs.test.ts "a denied namespace re-export keeps its exported name".
- rewrite:281 `__tss_deny_0` declared by the module: deleted (generated
name, not user input).
- rewrite:90/:145/:216: toMatchObject on the module; loaded/mocksLoaded
stay exact.
- sourceLocation:426 `createServerFn()[handler]` row: deleted (valid TS,
unrealistic).
- virtualModules:245 Rsbuild mock-runtime payload: deleted, covered by
rsbuild/import-protection.test.ts "Rsbuild dev: mockAccess" (real dev
server, error/warn/off).
- rsbuild/import-protection:16/:30/:48 getRsbuildResolvedImportProtectionCheck
unit tests: deleted, covered by the build-options excludeFiles table and
the build marker rows on Rsbuild (and the new default-markers row).
- rsbuild/import-protection:122: drop the undocumented info.behavior; the
warnings-vs-errors channel is the outcome.
- F-H4: Rsbuild dev with Start's whole plugin reports and mocks a server
import of a .client file (passes on main).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- known-bugs-dev-server "a server fn module calling a function of a denied
file/specifier at the top level": instead of "transform resolves to a
string", the client loads `src/a.ts` as the browser does: no served
module has the denied file's code (MARK_REQUEST_SECRET), and the client's
server fn has a string `functionId`. The control passes; the pin stays
red for #8554 (run without `.fails`: "[vite] The "code" property of
ModuleInfo is not supported.").
- "names imported from a denied specifier are mocks": the import
`"get-headers" as getHeaders` names no export of the real
`@tanstack/react-start/server` (verified in the source:
start-server-core/src/request-response.ts exports getRequest,
getRequestHeader, setCookie; no "get-headers" anywhere); it is now
`getRequestHeader as getHeader`, with `server.setCookie` kept. Its
`export *` pin row is unchanged and still red.
Audit: E2 known-bugs-dev-server:251/:274 (FIX), :384 (FIX).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- F-H3: the realistic analysis.usage rows run in the reported-location
four-channel harness (Vite dev, Rsbuild dev, Vite and Rsbuild builds):
a middleware variable's .server and a builder variable's .handler are
not reported; a look-alike `myServerFn.handler` and
createIsomorphicFn().client on the client are reported at the use.
Deleted from analysis.usage (covered by those rows): "the handler of a
server fn builder variable", "the server of a middleware variable",
"createIsomorphicFn().client" (client), and the look-alike test.
The harness now returns [] for a build without violations and fails on
unrelated build/compile errors.
- NEW Rsbuild pin: a look-alike `*ServerFn.handler` callback is skipped by
name (/ServerFn$/ in isCompilerSafeBoundaryCall), reported at compiled
coordinates (red: dev 'webpack:/src/a.tsx:3:1', build 'src/a.tsx:5:42').
- analysis.usage:263/:282: any real use is a correct location ([2, 3]).
- analysis.usage:301: realistic forms instead of an IIFE argument (tsc:
TS2345, a string is not a server fn) and parenthesized callees (valid TS,
unrealistic): handler(withAuth(async () => ...)), handler((...) as any),
createClientOnlyFn((...) satisfies () => unknown) (all type-check).
- reported-location:274: middle trace steps on their line, any column.
- reported-location:407: the module imports the app's own client entry
src/client.tsx back (not the harness file); Rsbuild pin still red
(one-step trace ['src/b.ts']).
- exemptions: the "gets the mock" controls require the mock's text, not
any non-real string (a 'throws: ...' passed).
- known-bugs:394: same-config control for the Rsbuild dev .page pins.
- build-options perf-report test moved to
tests/outside-compiler-corpus/import-protection-perf.test.ts (debug
output, per the coordinator ruling on debug tests).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- "the client route tree follows the edits": each change of the client
route tree may reach the client as a full reload or as a hot update the
route tree (`/src/routeTree.gen.ts`) takes part in (user ruling
2026-10-18: never require a full reload). The router generator handles
the edit in the background, so its message can arrive after `edit()`
returned (the wave-2 flake "expects a full reload that did not arrive"
at the server-only -> page step): the test now waits, bounded at 10 s,
for the change among all client messages since the edit. The route tree
contents and "server-only edit sends nothing to the client" checks stay.
- "the client route module of a split page route takes part in HMR":
instead of matching `import.meta.hot` in printed code, the test applies
the hot update of an edited page route the way Vite's HMR client does
(new module evaluated with the old hot data, old accept callback called)
and checks that the live route runs the new loader and keeps its split
component. The audit's proposal (a client `update` with
/src/routes/page.tsx and no full reload) is not reachable in this
harness: without a framework refresh plugin Vite does not see the
route's `hot.accept` alias and full-reloads (audit claim "expected to
pass on main" not reproduced; React apps get the boundary from
@vitejs/plugin-react, which start-plugin-core does not depend on).
Kills: client `addHmr: false` in vite/start-router-plugin/plugin.ts
(verified, reverted).
Audit: E2 start-router-dev-server:31 (FIX + robustness), :121 (FIX).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- build:108 both markers: assert the error names src/both.ts, server-only
and client-only (not the undocumented phrase).
- build:174/:195 (ASK-1 (a)): the one report names the marked module and
its importer (src/entry.ts / src/server.ts), located at the marker line
(Vite 1:8, Rsbuild 1:9) or at the importer's use.
- build:556: the Vite marked-module row is a passing "client gets the real
module" row; the build-succeeds control covers the pinned rows only.
- build-options:229: assert the printed "Denied by" line names /^db-lib$/
(not the undocumented info.pattern).
- build-options:329: runs on both bundlers, ASK-1 location; Rsbuild pin
(red: the build succeeds, "expected the promise to reject").
- build-options: replacement of rsbuild/import-protection.test.ts:16, "by
default, the server-only marker of a dependency is not checked" (docs:
node_modules skip file-pattern + marker checks). Passes on Rsbuild; NEW
Vite pin (red: reports 'client node_modules/db-lib/index.js').
- build-options:353 marker row: marker line or importer use (ASK-1), report
names both modules.
- build-options:565: drop not.toContain('src/entry.ts') (cut unspecified).
- build-options:610 TSR_IMPORT_PROTECTION_PERF: deleted (perf plumbing,
INTERNALS-only, nothing a user sees in the compiler corpus).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- "client: a module importing a factory that stops being one keeps its
handler": instead of looking for `db.x()` in printed code, the client
first loads no server code (MARK_DB_SECRET in no served module) and its
`fn` is a client RPC (throws "client RPC"); after `src/b.ts` becomes a
plain object, the client's `fn` runs and resolves 'MARK_DB_SECRET'.
- "SSR: an edit of a module only the handler reads": keeps the no
full-reload assertion and the new handler result; drops the requirement
of an `ssr: update` payload (user ruling 2026-10-18: no full reload where
feasible, no server-state requirement; how Vite avoids the reload is its
business).
Audit: E2 start-compiler-dev-server:23 (FIX), :203 (ASK, ruled).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
start-build-prerender "prerender.enabled prerenders every static page":
prerendering is out of scope for the compiler corpus (user ruling
2026-10-18) and the test mocks `../src/prerender` internals, so it guards
nothing through a public entry. Remnant for a possible router-generator
test: route props detection (`createFileRouteProps.has('component')`).
Audit: E2 start-build-prerender:82 (DELETE).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- start-build-manifest: the two start manifest tests (component chunk
preloads, page stylesheet links) move to
tests/outside-compiler-corpus/start-build-manifest.test.ts with the same
app; the client route tree tests (route-tree pruning) stay.
- start-build-options: serverFns.base + router.basepath (2 rows) and both
server.build.staticNodeEnv tests (with the Rsbuild `.fails` pin, bug
recorded in FOLLOWUPS "Product issues") move to
tests/outside-compiler-corpus/start-build-options.test.ts. They guard
build-time defines (TSS_SERVER_FN_BASE, NODE_ENV), no compiler job.
- start-build-options router.codeSplittingOptions (2 rows): besides the
placement, the client and SSR builds run the route's loader
('MARK_LOADER') and preloaded component ('MARK_COMPONENT').
Audit: E2 start-build-manifest:215/:231, start-build-options:121/:220/:236
(MOVE-OUT), start-build-options:268 (FIX).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
start-build-determinism "with colliding custom ids": a `generateFunctionId`
that gives two server fns the same id may fail the build with an error
naming the id, or keep today's behaviour (distinct ids, each client id runs
its own handler in the SSR build, SSR ids equal client ids). Silently
running the wrong handler still fails. Passes on main (Vite and Rsbuild).
Audit: E2 start-build-determinism:91 (coordinator ruling 2026-10-18).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- start-apps (F-H1): pass the provider environment to the Start compiler
(environments/providerEnvName), so rsc modules are Start-compiled. Adds
violationTexts/expectMarkerViolation (ASK-1 ruling: either location,
report names both modules).
- dev:754 onViolation false: drop the mock assertion (locked in the bug);
NEW dev pin "returning false allows the import: the client gets the real
module" (red: expected [] to equal ['/src/secret.server.ts']).
- dev:776: behavior "error" + onViolation false stays a control; NEW pin
for the denied file getting the real module (same red reason).
- dev:990: ASK-1 (a): require 'server src/a.ts:2:27'; any other report at
the marker.
- dev:1510/:1577: same-path controls (Start's dev client entry reaches
src/client.tsx; a request runs the app's server entry).
- dev:1823: no timer; the router entry is released when the bundle loads
the denied file. Still kills spc:4670 (verified).
- dev:1966 marker row: a report in src/a.tsx must be at the marker; a
report at the importer is accepted (ASK-1).
- dev:2150 maxTraceDepth pin: drop not.toContain('src/entry.ts') (cut
strategy unspecified); still red (expected 3 to be <= 2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Drop `inputValidator` from the stand-in `createServerFn` builder: the
runtime has no such method (grep of start-client-core/src: only
`validator`), so a test calling it would pass against a removed API.
- The client (`browser` export condition) gets a `createMiddleware` whose
`.server()` throws, so a client build that keeps a middleware's server
side fails at runtime instead of recording it. Verified with a scratch
build (Vite and Rsbuild): client throws, SSR records. Full package suite
unchanged (1537 pass / 368 xfail).
Audit: E2 harness, E1-H4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Audit C, handle-route-update:349: the edited route file called
`.lazy(newImporter)` itself, which a route file never does (the generated
route tree applies `.lazy(() => import('./x.lazy'))`). Now the route tree
gives the route its lazy options, the route's file is edited (new loader),
and once the lazy chunk loads the live route has both the new loader and
the lazy component. Each edited route file now creates its route with the
route's own id instead of always `createFileRoute('/hot')`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Audit C, react-refresh-route-components and router-plugin-context findings.
- "declared lowercase as ..." rows: the reassigned function declaration is
compiled as a .jsx route file (tsc: TS2630 "Cannot assign to 'page'
because it is a function", audit claim reproduced); the overloaded
declaration uses React.JSX.Element (tsc: TS2503 "Cannot find namespace
'JSX'", reproduced) and an optional prop (the required `title` overload
was not assignable to a route component either, TS2322).
- deleted the `$page` test (the lowercase renaming rows cover it).
- A3: deleted the TSRComponent / TSRPendingComponent collision tests (they
fed today's generated names as user code); added "route HMR code next to
user bindings with common names": a route file's hotData and
handleRouteUpdate keep their values and the route hot-updates (code
splitting on/off x vite/webpack). A user `hot` stays pinned in
known-bugs-route-hmr.test.ts.
- deleted "declares hoisted components before the route that uses them"
(`export const page = ..., Route = createRootRoute(...)`; covered by "for
every inline component option of a root route" (hoisting) and the
lowercase renaming rows).
- router-plugin-context: deleted "splits parenthesized route factories,
option values, and grouping arrays" (tsc accepts it, but nobody writes
`(createFileRoute('/x'))({ component: (C) ... })`; separate groupings are
covered by code-splitter-route-options.test.ts, a parenthesized option
value by react-refresh-route-components "a parenthesized arrow function").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Audit C, harness H1 (Proposal A + B), and the route-hmr / known-bugs-route-hmr
findings.
Harness (H1, H2, H3, H5):
- hotUpdate runs the real react-refresh/runtime (fresh per update, new
router-plugin devDependency react-refresh ^0.18.0, already in the lockfile
through @rspack/plugin-react-refresh; lockfile regenerated with pnpm install
--no-frozen-lockfile). Each module registers its components under its id
($RefreshReg$ / $RefreshSig$ per module), Vite boundaries follow Vite (a
literal import.meta.hot.accept( or @vitejs/plugin-react's accept on modules
that register components; plugin-react's real
validateRefreshBoundaryAndEnqueueUpdate check), webpack/Rspack boundaries
follow the refresh plugins' executeRuntime, a self-invalidating module
passes the update to its importers, then performReactRefresh.
update.render(option) renders as React does after the refresh
(resolveForRender), update.remounted(option) reports remounts (replaced
component or stale hook signature). The page loads the route's lazy
component before the edit; a lazy module first loaded after the edit is
the edited one. refresh defaults to true for React routes (explicit
refresh: false for the webpack-without-React-Refresh pin). Vite + Solid/Vue
throws (their refresh plugins only run in a real dev server). Router is a
client router (H3).
- Controls (regression-helpers.test.ts): an edited component renders its
new body without a remount (vite/webpack x split/unsplit), adding a hook
remounts, a renamed component is not a new version (negative control),
webpack without React Refresh renders the first body, and the Vite model
agrees with a real Vite dev server + @vitejs/plugin-react on hot update vs
reload (split, unsplit, .ts, factory-built options).
- Proposal B: vite-hot-update.ts editRouteFile (real dev server with the
framework plugin; messages, update boundaries, reimports). New dev deps:
@vitejs/plugin-vue-jsx (catalog).
route-hmr.test.ts:
- split routes: bodies per version; live === previous, new body renders, no
remount; new row with loader and component in one chunk; add/remove a split
option; component reading Route renders "/posts new".
- Solid/Vue split + unsplit rows: webpack style, new text renders.
- D10 pins: real Vite with vite-plugin-solid / @vitejs/plugin-vue-jsx (no
full reload, the update re-imports the split chunk) + identity kept.
Verified red without .fails: "client: full-reload *" (both).
- root route: renders new body without remount; shellComponent removed from
the file-route list (tsc: TS2353 'shellComponent' does not exist on
createFileRoute options, audit claim reproduced); the file-route "adds a
shell component" test is replaced by root-route rows that add / edit /
remove shellComponent (decision rp:1304).
- unsplit routes: every component option renders its new body in place.
- factory-built options: webpack row passes; vite row is a NEW pin (route
module without registered components is no Vite boundary, same root cause
as the .ts pin; real Vite agrees, see control). Verified red: invalidated.
- real Vite (missing coverage 2): a split component edit is a hot update
that re-imports ?tsr-split=component; editing a value the loader and the
component share is a hot update.
- tsr.config.json (P1): evaluated in the page; Solid installs no React
Refresh hooks on window, React does (control row).
- A1: one "no debug output by default" dev test kept; the Solid row and the
TSR_VITE_DEBUG=start-plugin-core test moved to
tests/outside-compiler-corpus/route-hmr-debug-output.test.ts.
known-bugs-route-hmr.test.ts:
- deleted the `(() => <p>hi</p>)!` row (tsc accepts it: valid TS; deleted as
fuzzer-shaped per coordinator decision, as any / satisfies rows cover it).
- hot pin: loadRoute + render; rows for a constant and an exported constant
(importFromRoute gets 'hot'). Verified red: Duplicate declaration "hot".
- lowercase shared component: component + notFoundComponent (two chunks)
share page. Verified the function pin still red: Export 'SplitComponent'
is not defined.
- hoisting pin and controls: lowercase errorFallback passed to
ErrorBoundary FallbackComponent and errorComponent; staticData control.
Verified red: ReferenceError: errorFallback is not defined.
- A2: deleted the getter component option pin.
- webpack without React Refresh pin: refresh: false, render. Verified red.
- Vite HMR boundaries: editRouteFile with framework plugins. Solid unsplit
now passes with vite-plugin-solid -> control; Solid split, Vue split and
unsplit stay pins (verified red: no hot update).
utils.test.ts: deleted (normalizePath, an internal helper; covered by
code-splitter-determinism.test.ts "a route compiled under %s splits the same
way into the same modules": Windows and backslash module ids).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Missing coverage from audit B (ranked 1 and 2):
- build-frameworks: React joins Solid and Vue on Vite, Rspack and webpack
(SSR and client): the split component loads lazily and renders, the
bundle holds only React, and module state is initialised once. The
route now also declares state of its own that its options and the
split component read (created once, one value), next to the imported
module's state.
- robustness: a .jsx route file is generated, split and rendered in Vite,
Rspack and webpack client builds, with a binding the loader and the
split component share.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
H10: the "rspack" rows build with raw Rspack, not Rsbuild. buildWithRsbuild
(router-plugin tests/build-harness.ts) builds a React client app for
production with createRsbuild() and its defaults, the router plugin of
Rspack added through tools.rspack.plugins as an Rsbuild app does. Only
differences: React's automatic JSX runtime is set as pluginReact() sets it
(@rsbuild/plugin-react is not installed), no HTML page, and ES module
output so run() can load the app in Node (an entry assigns the test
entry's exports to a global, like Start's harness).
Rows added:
- build-harness.test: control, a split component loads lazily and renders.
- build-production: no dev-only code and no absolute path, with and
without code splitting, NODE_ENV unset (both pass: Rsbuild is not hit by
the Rspack/webpack NODE_ENV pin).
- known-bugs "page code in client builds": Rsbuild next to Vite, Rspack and
webpack, both side-effect hints. Controls pass (placement lazy, page
renders); every pin run once without .fails is red for its bug on
Rsbuild too (placement eager / eager+lazy with the page rendering,
DanglingNameError for the displayName case, root error/notFound eager,
unread export in the chunk, destructured options neither lazy nor
reported).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Audit D missing coverage 3 (generated types never type-checked): the two
real-router apps also type-check as a whole with the real TypeScript
compiler and @tanstack/react-router types (route files' ids against the
tree's FileRoutesByPath augmentation), and the keys of the tree's
FileRoutesById are the ids of router.routesById.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pin was run once without .fails: red with "';' expected" in the
generated route tree (unescaped import specifier and route id).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Audit B (audit-final/B.md), B-H4/B-H5 and the coordinator decisions.
Deleted (checked):
- code-splitter-idempotence.test.ts (:98, :111, router plugin registered
twice): Wave B ruling, compiling Start/router output again is
unsupported (coordinator decision). The harness `instances` option it
alone used is removed.
- dead-code:173 (ReferenceError of a let read before its declaration):
tsc TS2448/TS2454 reproduced; dead-code:120 covers initializers running.
- route-options:67 (repeated split key): tsc TS1117 reproduced.
- route-options:125 (var Route in a block), scope:448 (a < b > (c)),
scope:492 (printer edge cases), robustness:9 (hashbang route file):
valid syntax but fuzzer-shaped, no route file is written so. scope:448
is replaced by "splits a route file with JSX" for .js/.jsx/.mjs.
Fixed:
- dead-code:267: no longer requires the route module to keep importing
`bar` (Babel DCE rule); still requires `used` to leave it.
- imports-exports:172: D9 comment (assert support can be dropped).
- imports-exports:234/:252: a real importer gets the re-exported import /
destructured export (P1); getStuff is a declared import. Run-once of the
destructuring is the existing kb pin ("a destructuring with one exported
binding"), which this test found red again, so it is not repeated here.
- imports-exports:317: getParentRoute returns an imported root route.
- imports-exports:944: legacy decorators from tsyringe/mobx field
decorators; every emitted module must parse with Babel
decorators-legacy (instead of a regex on the printed code).
- module-state:78: both chunks see one A and one B; :358: realistic
self-replacing lazy getter, created once, one identity (the old input
assigned to a function declaration, TS2630); :994: no initialiser timing
(atLoad dropped); the route module imports ./init only if it creates the
store; :1023: loading the notFoundComponent chunk creates nothing (D5),
whatever the route module does.
- plugin-pipeline:156: the error names splitBehavior and the route id.
- plugin-pipeline:185/:199 (B-H4): real @vitejs/plugin-react 6 instances
before the router plugin are refused naming the package, after it are
accepted; the unreachable "router plugin not in config" half is gone.
swc/oxc rows stay name-only (packages not installed).
- plugin-pipeline:264: Vue's Route.useLoaderData returns a Ref (checked in
vue-router/src/useLoaderData.tsx), so the Vue row reads `.value`.
- plugin-pipeline:311: non-route modules: one module, same imports, valid,
same evaluated exports, instead of identical text.
- plugin-pipeline:388: no stray trailing 'use server'; :428: only the loc.
- route-options:79/:101: pendingComponent: null is a type error (TS2322
reproduced) -> undefined; errorComponent: null (accepted by the types)
added. :508: methods only (no getter/setter). :954: registerRoute(Route)
from a module of the app. :985: 'use no memo' on a component.
- scope:231: valid intrinsic attributes; <A /> reaches a component prop,
so the test sees it rendered.
- build-harness.test:107 (esbuild, D3 (c)): split and rendered, or a
build error / warning naming esbuild and autoCodeSplitting. Run without
.fails: red for placement (component eager).
- build-source-maps:214: the rspack/webpack rows fail with line 3 instead
of 5 (unplugin drops the map); with a loader passing an identity map in
front of unplugin's (what an upstream fix gives), all four pass. Kept as
pins, comment updated.
- B-H5/A-H6: router-plugin tests/build-harness.ts header no longer claims
apps inherit "sideEffects": false.
Kept: build-production:233 is the one "default build prints no debug
output" test. pragmas:50 untouched (D-04).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Audit D missing coverage 1: two generated apps (file-based: flat,
directory, layout, pathless, group, lazy, lazy-only, optional param, splat,
escaped and non-nested routes; and a virtual route config with layouts, an
index and a physical mount) are loaded with the real @tanstack/react-router
(createRouter): the ids, full paths and `path` options of
router.routesById equal what the shared route tree helpers read from the
tree with their router stub (urlsOf, routePathsOf). This validates the
helpers (H1-H3) the other tests rely on. Vue's router is not a dependency
of the package, so only React is checked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Audit D missing coverage 2: a rename or move reaches a running generator
as a delete and a create event, in either order, queued before the first
run completes (Generator.run events). Three renames (top-level file,
child route to another param name, file moved into a directory under its
layout), each with the delete or the create event first: the route tree
is the one a fresh run writes, its routes are the expected ones, and the
moved file gets the id of its new path. All pass on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Audit D H6: transform.test.ts drives the internal ../src/transform module
with hand-built RouteNodes, so a rewrite with no user-visible difference
fails it. It moves to tests/outside-compiler-corpus/transform.test.ts (header
"Not part of the compiler test corpus"), and the route file upkeep it
covers is re-expressed in tests/route-file-upkeep.test.ts through full
generator runs, reading the file back and evaluating it: id fixed through
cast options, double-quoted and template-literal ids, aliased Route export,
export lists, a second non-exported route call, .ts angle-bracket
assertions (#7341); root route files (createRootRoute,
createRootRouteWithContext, export list) left byte for byte; constructor
switches both ways (semicolon import, type specifier, multi-line import);
the right constructor when the id is already right (5 rows); missing
constructor import added on its own line (LF, CRLF, single line, next to
another package's import, next to an aliased or a namespace import,
semicolon style); type imports stay type-only; stale imports of the other
constructor (CRLF, BOM + astral characters, trailing whitespace, same-line
import, semicolons, untouched declaration, aliased constructor); Route
re-exports / app route factories left as they are; ids the generator
cannot rewrite and malformed route calls reported by file name (failed run,
or a warning with the file untouched).
Coordinator ruling on D ASK-1 (removing an unused import of the other
route constructor is allowed, not required): every stale-import test, in
the corpus file and in the moved unit suite (transform:203 CRLF, :625 BOM,
:772 rows 2-4, :916, :932, :946, :984, :997), accepts the import kept or
dropped, and always checks that the file evaluates, has the right id,
binds the right constructor once and keeps its non-import code.
Audit D rows applied to the moved unit suite:
- transform:50 through parentheses: deleted (0 of ~50k corpus files wrap
the constructor or the id in parentheses).
- transform:511 redeclared `var Route` twice: deleted (0 corpus files with
two `var Route = create...Route(` declarations).
- transform:823 export-list helper `no-route-export`: deleted (internal
result code); known-bugs "a route file without a Route export is left
out with a warning" row 2 covers it through a run.
- transform:829 `export let Route` without initializer: row dropped (0
corpus files); the Route-from-another-binding row stays.
Not re-expressed in the corpus (kept in the unit suite only): the
parenthesized call `((createFileRoute('/old'))({}))` and the
multi-declarator export (0 corpus files each), the default import of the
router package (the package has no default export), and two exported
Route bindings (not a valid module).
Also: literal BOM characters typed into generator-options.test.ts and the
new file are written as escapes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apply audit G (RSC CSS slice).
- rsc:322 rows `<Card />!` and `(<><Card /></>) satisfies unknown` dropped.
tsc: `renderToReadableStream(<Card />!)` is a TSX parse error (TS1005);
the satisfies row type-checks but is a fuzzer shape (coordinator decision
N3). `(<Card />)` and `<Card /> as any` stay.
- rsc:343 the `renderServerComponent(<Card />, { alreadyConfigured: true })`
part removed: the second argument is internal (tsc: TS2554 "Expected 1
arguments, but got 2" against @tanstack/react-start/rsc). Identifier,
conditional and spread arguments stay.
- rsc:450 plain-data model made neutral (user ruling 2026-10-18: TO BE
DECIDED): keeps the `{ card: 'card' }` payload assertion, drops the
no-warning requirement.
- rsc:508 Rsbuild dev: the card is a .tsx module rendering
`renderServerComponent(<p>OLD_CARD</p>)` (React JSX runtime stand-in added),
not a string.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apply audit G (Hydrate slice).
Systemic `when` fix: every Start `<Hydrate>` in the five Hydrate files now
passes the required `when` (`when={load()}`, `load` imported from
`@tanstack/react-start/hydration` in the shared heads; Solid pages from
`@tanstack/solid-start/hydration`; the hydrate-build stand-ins export `load`).
tsc (react-start dist, strict): `<Hydrate><p/></Hydrate>` -> TS2322 "Property
'when' is missing ... required in type 'HydrateCommonOptions'"; docs say
"Required". Not touched: spreads that already carry `when`, globals, the
local/foreign `Hydrate` controls.
Harness:
- G-H1: getChunkComponent (chunk must export exactly one function) is
removed. renderChunk(parent, chunkId, chunk) renders the export the parent
names in lazyRouteComponent(load, name) (new chunkExportName);
loadClientModule's `preloaded` entries carry that `component`; the Vite dev
tests render through the served page module and the stand-in
lazyRouteComponent (which records `exportName`).
- G-H2: the default jsxToText runtime renders intrinsic props (not
children/key) as JSON with sorted keys, functions as "<function>". Whole
package still green; two expectations now show the attributes (input
value/onChange, use xlink:href).
- G-H3: compileHydrate also returns `chunkIds`; sm "directive prologue" and
"chunk does not import what only a server fn handler uses" assert on the
chunk as the bundler compiles it (compileFirstChunk).
- G-H4: the generated-names probes (hydrate-captures, known-bugs-hydrate)
read a captured local, so capture names are collision-tested too.
Findings:
- sm:99 stale `h` deleted (tsc: TS2322 'h' does not exist on HydrateProps);
covered by sm conditionals/callbacks, bf nested boundaries, sm split={false}
nested ids.
- sm:110 split="true" row dropped (tsc: TS2322 string not assignable to
boolean); the `split` shorthand row stays.
- sm:179 computed key from a binding named fallback deleted (mutant shape);
covered by sm computed-key prefetch row and bf "a computed fallback key".
- sm:273 reassigned spread: `let opts: HydrateOptions = { when: idle() }`,
reassigned under `props.eager` (tsc: accepted).
- sm:641+651 merged: children are required (tsc: TS2322 on the empty forms),
so the boundaries render nothing and keep `when`, or a compile error names
Hydrate.
- bf forms: when="visible" / when: 'visible' -> visible() (tsc: TS2322
string not assignable to HydrateWhen).
- bf split="false": kept in place or rejected clearly (tsc: TS2322).
- bf `false satisfies/as boolean` pins deleted (fuzzer shapes).
- bf Solid function child goal deleted (solid-js 1.9 JSX.Element has no
function member; shared docs list function-as-children as rejected).
- bf useId?.() row dropped; React.useId() pin kept.
- bf `Link as Hydrate` row dropped (react-start/start-client-core export no
Link).
- bf "chunk loaded after its source module was invalidated" deleted; covered
by hydrate-build "Vite dev server: a chunk requested before its parent
module renders the children, and an edit reaches it".
- cap/kb bare `<Hydrate prefetch>` -> prefetch={idle()} (tsc: TS2322 true not
assignable).
- kb `<Hydrate {...props}></Hydrate>` -> self-closing; the comment-only body
next to a children prop row deleted (tsc accepts it, contrived; the
children-prop rows cover the bug).
- kb own `this` of a function expression typed `this: { prefix: string }`
(tsc: TS2683 implicit any this).
- kb Route exported as default / under a string name rows and the unexported
Route pin deleted (a route module exports Route by name); the "unexported
component named Route" pin covers the removal.
- kb nested var: `try { var label = JSON.parse('"nested"') } catch {}`.
- kb let only assigned: `renders = 1` (tsc: TS2322 string to number).
- kb JSX pragma: `/** @jsx jsx */` from an @emotion/react stub.
- kb rejection-matcher and await fixtures import `loadData` (no clash with
the `load` strategy).
Pins: every pin of the five files was run without .fails before and after
this change; all 66 remaining still fail, with the same first error (code
frame line numbers shift by one). The spread-children row now shows the
unused chunk (html renders), its Impact comment says so.
Missing coverage 1 (compiled Hydrate through real React): already covered by
e2e/react-start/deferred-hydration (real Vite/Rsbuild builds, real Hydrate
and react-dom, dev and prod, console errors fail the test); no unit test
added.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Audit D, template.test.ts:
- :86 / :103 route files whose paths contain `"`: deleted (the React/Solid
test and the Vue pin). `"` is not allowed in Windows file names, so a
cross-platform app cannot have such a route file.
- :184 scaffolded routes render: no greeting text; asserts each scaffolded
file evaluates to a Route with the right id, created with the right
constructor (createLazyFileRoute for .lazy files), whose component
renders something, and the root route renders an Outlet. H8: the
evaluation doc says Solid JSX is compiled with a React-like runtime, so
only the structure is meaningful.
- Missing coverage 5: scaffolded root, route and lazy route files follow
quoteStyle and semicolons for each target (docs file-based-routing.md:
"when you first create a new route, those files will be formatted with
the quote style you specify" / "with semicolons"). String literals that
contain a quote character may use either quote (prettier picks the one
that avoids escapes).
NEW main bug, pinned in route-paths.test.ts (found writing the optional
`what's-new.tsx` replacement): a route file name with an apostrophe makes
the generated route tree unparseable (utils.ts:1196 buildImportString
writes `from '${source}'` unescaped), so the run fails with "';'
expected". Verified red for that reason.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Audit D, known-bugs.test.ts:
- :71 route option keys (read the internal createFileRouteProps): deleted
here. The identifier-keys row is covered by start-plugin-core
known-bugs-route-options.test.ts (page.tsx stays, api.tsx is pruned);
the string-keys and aliased-Route-export rows move there as build rows
(a route with server handlers and a component stays in the client route
tree; one with only server handlers is pruned on Vite, Rsbuild parity
pin as for api.tsx). The parentheses row is deleted (0 corpus files of
~50k wrap the constructor or the id in parentheses).
- :120 TypeScript wrappers (3 pins): deleted. The id rows (`as const`,
`satisfies`) have 0 corpus files and the id wrapper already fails with a
clear error. The cast-constructor row: audit claim "unrealistic" not
reproduced (2 user route files call `(createFileRoute as any)(...)`), but
the id string only feeds the route types, which the cast turns off
(react-router fileRoute.ts createFileRoute ignores its path at runtime),
so a stale id there has no user-visible effect: deleted.
- :161 type-only Route exports (3 pins): deleted (0 corpus files with
`export type { X as Route }`, `export { type X as Route }` or
`export declare const Route`); the control stays and now reads the route
tree (routesOf) instead of the plugin route nodes.
- :192 constructor import pin: the type-only import row is invalid TS
(tsc: TS1361 "'createFileRoute' cannot be used as a value because it was
imported using 'import type'"), deleted; the aliased-import row stays.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Audit A (audit-final/A.md) and the coordinator decisions (SUMMARY.md).
Harness (A-H1): eagerModuleIds/eagerImportSources in regression-helpers.ts
give the static closure of the route module (what loads with the entry,
whichever emitted module imports it). importKinds 'static' also counts
imports from lazy chunks, so it is no eager signal. Used by the "page code
left in the route module" pins, the object-form loader pins (handler
placement, the ./api row), the class static-field pin and the classic JSX
factory pin.
Weak tests (check 4):
- export * pin: a real importer gets the re-exported name (P1) instead of
requiring the route module to keep `export *`.
- classic factory pin: the library does not load with the entry (rows 1-2,
Emotion as real apps write it), the chunk imports only `h` (row 3), and the
component renders.
- client-build placement suite: controls, exported/unsplit pins and the
two-option case also mount each route in the built app and require the
marker in the rendered HTML (one jsdom run per app).
- `this` pin, server-only refusal, symlink refusal: a report or refusal must
name the route file (server-only stub renamed ./secret-db so `server`
in the module name cannot match).
- two-file-routes and options-by-call pins: reports must name what they
report (reportsNotSplit / createFileRoute|Legacy).
- production warning tests: only "no app path in the bundle" is required;
"the build warns" is a labelled precondition of the control.
Unrealistic inputs (check 2), verified with tsc (strict, react-jsx,
@tanstack/react-router types):
- function reassignment rows: TS2630 reproduced -> route.jsx.
- object-form loader spread: TS2322 reproduced (staleReloadMode: string)
-> 'blocking' as const typechecks.
- groupings constant: TS2322 reproduced -> typed constant typechecks.
- Pages.Missing || / ?? fallback: TS2339 reproduced -> typed overrides
object typechecks.
- class expression / class Page as component: TS2322 reproduced -> route.jsx
with `class extends Component` (real class components); the unexported
class must be split (D11), the exported one split or reported.
- memo(<p>page</p>): TS2769 reproduced -> withFallback(Page, <p>loading</p>)
typechecks.
- Bar(props): TS7006 reproduced -> typed props.
- `export @observable class` (mobx decorates fields only): TS1238 with
mobx 6's field-decorator signature (mobx not installed; signature
declared locally) -> `export @injectable() class` (tsyringe signature)
typechecks.
- deleted as fuzzer-shaped (valid TS, no user writes them; root causes kept
by other rows): var in a for head (if/try rows), Object.assign onto
enum/namespace and the dotted namespace (displayName, push, lets rows),
computed-key row (duplicate of the computed-key pin), empty destructuring
(type-alias row), non-null assertions on the factory call/component
(as any / satisfies rows), IIFE and memo(Page!) rows (JSX/TS rows),
literal-array destructurings (createPair() rows), getter option (method
row), exported pragma factory (kb "factory the route module creates").
- generated-name collisions: $$split*Importer rows deleted; local
lazyRouteComponent/lazyFn rows replaced by a passing test where the route
imports them from the router package next to split options.
- destructuring next to a Route reader: realistic
createRouteHelpers(() => Route) shape; helpers created once.
- tsr-split pin: the app directory is named tsr-split-* (prefix), no
synthetic module name.
- N3 rows `(<p/>)!`, `(<><i/></>)!`, `.valueOf()`, `?.valueOf()` deleted
(coordinator); update-operand pin keeps only `(count as number)++`.
Every changed pin was run once without .fails: each fails for its bug
(placement eager / eager+lazy with rendersPage true, "Unexpected splitNode
type", "Duplicate declaration", "array of arrays", Babel JSX parse error,
PARSE_ERROR, assignment to an import, "split value ... not found" for
entry.ts, chunk requests ./lib, library loads eagerly, chunk imports
Fragment, server option kept, symlink placement eager, app path eager).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- generator-options:182 lazy file gets createLazyFileRoute: no exact
text; the BOM is kept, non-import code changes only in the constructor
call, Link and createLazyFileRoute are each imported once, and the file
evaluates to /posts created with createLazyFileRoute.
- generator-options:331 hashbang route file: deleted, and the hashbang row
of the :362 pin dropped (BOM row kept). tsc accepts a hashbang, but no
route file has one: the 11 corpus files (of ~50k) with a hashbang and a
Route export line are scaffolding scripts holding route templates in
strings. The BOM rows of :91 cover prefix handling.
- generator-options:723 token acceptance (getConfig only), :889-929
temporary directory, :938/:987 invalid configuration, the :852
disableLogging true row, and route-paths:491 (token regex that does not
compile): moved to tests/outside-compiler-corpus/config-options.test.ts.
The two "differing only in flags" token rows are deleted.
- generator-options:796: the routeToken example of the docs
(file-based-routing.md:120,124: /[a-z]+-layout/, main-layout.tsx)
instead of /.*layout.*/ with mylayouts.tsx.
- generator-options:821 disableTypes extension under gen.tsr/: deleted
(getConfig only, unrealistic directory name); :572 covers disableTypes by
evaluating the JavaScript route tree.
- generator.test:406 routeTree directory creation: deleted with its
snapshot; generator-options "the directories of a nested route tree
path are created" covers it by evaluating the tree.
- route-paths:342/:356, deny-route-group-config:58 and generator.test
shouldThrow: the run rejects and the error names the file(s); no
wording.
- route-paths:375: @me.tsx / me.tsx instead of @B.tsx / B.tsx.
- route-paths:434: the /layout/gy row becomes /layout/g (no sticky flag).
- H7: the FileRoutesByTo / FileRoutesByFullPath tests run the real
TypeScript compiler on the app (real @tanstack/react-router types), with
a type-level assertion on the route's id, instead of reading `typeof`
members of the parsed tree (new helper tests/type-check.ts). The app
must type-check as a whole.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Audit D:
- H5 / concurrent-write:85: the "temporary file stat" row completed the
racing save only when the generator stat'ed a file under its tmpDir (an
internal step of safeFileWrite). The save now completes before the
generator's next file operation of any kind after the racing read (row
renamed "generator's next file operation"), and only the final file
content is asserted.
- generator-dev:419 getRoutesByFileMap: no longer pins the root route's id
('/__root', an internal handshake with router-plugin's HMR adapter);
asserts the mapped files and the /posts route id, before and after a
rerun.
- generator-dev:377 afterTransform prevNode: deleted (internal plugin
hook); covered by start-plugin-core
tests/start-router-dev-server.test.ts:28 (the client route tree follows
page <-> server-only edits in Vite dev).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Audit D harness items H1-H4:
- H1: ids and URL paths derive from each route's getParentRoute() the way
router-core's Route.init does; the evaluation fails when getParentRoute
is missing or disagrees with the _addFileChildren nesting, and on two
routes with the same id (router-core's duplicate-id invariant).
- H2: lazyRouteComponent / lazyFn without an export name take `default`
(router-core / react|solid|vue-router lazyRouteComponent default).
- H3: the router stub also provides createLazyFileRoute, createLazyRoute
(a lazy route is { options: { id, ...options } } like LazyRoute) and
createRoute.
- H4: the file a lazy importer loads is found by running the importer
through the instrumented import(), not by a regex on its source.
route-id.ts: the evaluated Route records the constructor that created it
(createdWith), for constructor assertions.
Controls added in route-tree.test.ts and route-id.test.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
H7: `createRsbuildDevServer({ hmr })` sets Rsbuild's `dev.hmr`;
`hotUpdates()` returns the hot-update chunks of the last compile, and
`outputs()` leaves hot-update files out. The default stays off (Rsbuild's
is on): with it on, 15 tests of router-plugin and start-plugin-core fail,
because the emitted chunks carry Rsbuild's HMR client, which throws when a
test evaluates the output outside a browser, and tests that look for a
module's chunk miss it. Control: with `hmr: true` an edit emits a
hot-update chunk with the new marker; with `hmr: false` none.
No status change in the five packages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Webpack harness loader (build-harness-oxc-loader.mjs): takes the incoming
map, transforms with `sourcemap: true` composing it, and passes the map
on, like a real loader. The control in tests/build-harness.test.ts now has
TypeScript-only lines before the throw: red on webpack with the old loader
(line 3 instead of 8), green with the new one. router-plugin
build-source-maps webpack pins stay red for the unplugin reason
(line 3 instead of 5); comment updated.
H9: Vite SSR production builds are no longer minified by default, like
`vite build --ssr`. Control: Vite SSR keeps a local name, the client
build does not.
H10: the raw Rspack row parses `.ts` without JSX and `.tsx` with it.
Rspack's SWC already picks JSX from the file extension, so the old
`tsx: true` had no effect (audit claim not reproduced); the config is now
explicit, with a control that builds `<T>(x: T) => x` and `<number>x` in a
`.ts` module on every bundler.
No status change in the five packages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
H5: `settle()` compares modification times as well as contents, so a
write that leaves a file as it was is reported as a `change`, as chokidar
reports it. Controls: an identical rewrite is reported; a plugin that
rewrites a file on every event never settles (reload loop detected).
H6: `fileEvents` (createDevServer) and `settle(options)` / `edit(files,
options)`: `order: 'creations-first'` reports a rename as add then unlink;
`batch: true` emits all events of a round before the server handled the
first. Defaults unchanged. Controls for both orders and for batch mode.
Status change: start-plugin-core importProtection/dev.test.ts pin "is
mocked after an edit adds the marker, and the violation is logged" passed:
the test rewrote the whole app (identical importers included), which a
real watcher reports as edits of the importers. The test now edits only
the marked module; red again for its baseline reason (no violation
logged).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
H3: the linker's default transform (and router-plugin's React Refresh
transform) now erase TypeScript with `onlyRemoveTypeImports`, as Vite does
in a project with `verbatimModuleSyntax`: an unused value import still
loads its module, `import { type X }` loads it as `import './x'`, only
`import type` goes. New option `verbatimModuleSyntax: false` (linker and
router-plugin `loadRoute`) erases like a project without it. Controls in
module-linker.test.ts.
Status changes:
- router-plugin code-splitter-imports-exports "reads an ambient var merged
with an interface ...": NEW main bug, exposed. The split chunk and the
route module import the ambient var from the shared module, which has no
runtime binding; real Vite + verbatimModuleSyntax fails the build with
MISSING_EXPORT. Split into a passing row without verbatimModuleSyntax
and a `.fails` pin with it (red: "does not provide an export named
'readVersion'").
- router-plugin known-bugs-code-splitter overload pin (#8505) flipped: the
bug only shows without verbatimModuleSyntax. The pin now runs that way
(red: "Export 'helper' is not defined"); a passing control runs with it.
- start-plugin-core start-compiler-factories "isomorphic, server-only and
middleware implementations in one module ...": the test's package stub
lacked factories the real package exports and `head` imports; add them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
H4: a fallback stub is now one instance per specifier (like one module of
a bundle), not one per importer: later importers get the same values, and
`fallbackStub` is called again only for names earlier importers did not
import. Control: two importers of a stubbed package get the same object.
H11: delete the dead `lenient` and `idOf` options of the linker.
Add the linker controls the file header claims: a cycle links with live
bindings and hoisted functions, and a read in the TDZ throws a
ReferenceError.
No status change in the five packages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
H1: `unboundNames` (validator and production dangling-name check) no
longer exempts every read of a name the module checks with `typeof`
anywhere. A read counts as guarded only in the code the check selects:
the right side of `&&`/`||`, the branch of `?:`/`if`, the statements
after an early return, and functions only guarded code reads. Minified
forms (`typeof x<`u``, swapped operands, comma sequences) are understood.
H2: production client chunks may only read browser globals
(`clientGlobals`): Node-only globals (process, Buffer, global,
setImmediate, clearImmediate) pass only when a typeof check guards them.
Vue's feature flags join the framework globals (Vue assigns them to
globalThis itself).
Controls: guarded reads accepted, unguarded reads next to a guard (other
function, wrong branch, before the check) rejected; client builds reading
Buffer/global/setImmediate raise DanglingNameError on Vite, Rspack and
webpack; guarded Node globals and process.env.NODE_ENV pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite's background pre-transforms can serve src/s.ts before src/c.ts, so
the module graph lacked one chain when the violation was reported and
spc:4072 survived about one run in four. Opt out for this test (comment
says why); 9 of 9 mutant runs now fail it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Rsbuild dev harness turned source maps off, unlike an app in
development (`cheap-module-source-map` for JS), which can hide how
diagnostics are located. No status change in the five suites.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
N9: with default options, a Vite build (split, unsplit and shared-binding
routes) and serving a React or Solid route with route HMR print nothing
to the console. Borderline rp:1938: TSR_VITE_DEBUG=start-plugin-core
(Start's own debug scope) prints nothing of the router plugin.
N12: the generator's unplugin factory from the package root generates
the route tree (rp:1935). The code frame of a denied import in a route
module shows the route file's source in Start dev (rp:532-534, the route
module's sourcesContent; verified on router-plugin dist: rp:533, 534
fail it; rp:532 does not type-check for a dist build and is the same
runtime change as rp:533).
Borderline spc:4025/7038: with TSR_IMPORT_PROTECTION_PERF=1 and no report
file, Vite and Rsbuild builds succeed and log the perf report
(INTERNALS.md).
Kills: rp:1420, 1442, 1455, 1543, 1592, 1597, 1605, 1619, 1738, 1743,
1936, 1938, 1935, 533, 534 (532 by equivalence); spc:4025, 7038
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
N4: a route with a `.lazy` file next to a route with a component piece
both get their lazy parts (the lazy route the router loads is the file's
Route). N5: a pathless layout with only a Vue piece in a route group has
no path option (router-core would match it as a page). N11: a routeToken
regex matching names that contain a word makes such a file a layout.
Helpers (route-tree.ts, additive): `routePathsOf` and `loadLazyRoute`
(runs a route's `lazy()` with the dynamic imports stubbed).
Pins (red for the right reason):
- G1: a pathless layout with only a lazy file or a Vue piece under a path
drops the path from its children's URLs (`/bar` instead of
`/foo/bar`; the types say `/foo/bar`). Not PIN-A: different shape
and cause (the virtual node is typed `static`). Control: a route file.
- G2: `posts/route.component.vue` becomes a route `/posts/route`.
- G3: a `.lazy.vue` file is wired as a lazy route that cannot load (the
SFC has no lazy route options); an empty `.lazy.vue` is scaffolded with
TypeScript route code.
Kills: rg:414, 455 (also flips G1), 2723
Not killed: rg:2725, 2729 (need a file name with a single bracket).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
N8: a `vite build` with `experimental.bundledDev` in the Vite config (as
apps that enable full-bundle dev keep it) traces a violation under a
route module from the entry through it. The Vite build harness takes a
`viteConfig` (additive).
N13: in Rsbuild dev, server fn ids do not come from
`serverFns.generateFunctionId`, which the docs scope to production
builds. The Rsbuild compiler harness passes the option through.
N10: the trace starts at the entry when a module imports the entry back.
Vite passes; Rsbuild is pinned (NEW, low): production builds
concatenate the entry module, which has no resourceResolveData, so the
adapter registers the first loader's path as the entry and the trace
collapses to the importer. spc:7260/7261 only remove that wrong
registration and stay equivalent until it is fixed (a scratch fix with
the concatenated module's rootModule flips the pin).
Kills: spc:4988, 4989, 6812
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
N1: an edit of a module, then of its importer, updates without an error.
N2: an edit of a CSS file another CSS module @imports updates without an
error. N3: a denied import of a module a server fn factory re-exports is
logged, with a trace to the use. N6: full-bundle dev logs a violation of a
module the bundle input reaches before the router entry does. N7: a
factory calling a denied file at the top level is logged at that use only;
a module without exports is located on its source line; full-bundle dev
mocks a server fn built with a factory of a denied file. N8: dev traces
start at the router entry when something imports it, are the shortest
chain, keep the importer while it is still transforming, and full-bundle
client and SSR traces lead from the router entry.
Pins (red for the right reason):
- M2: full-bundle dev with mockAccess 'off' fails the client bundle
(UNLOADABLE_DEPENDENCY ...mock?server-fn-module-lookup).
- M3: a client-only import reached only from a custom src/server.ts is
mocked on the server without a warning (control: via the router entry).
- M4: the full-bundle client trace under a route module stops at the route.
- NEW: the Importer of a module a factory re-exports is `other.ts:2:24`
(source map source taken as is, sourceLocation.ts).
Kills: spc:1680, 4916, 5428, 4641, 4144, 2154, 4060, 4062, 4072, 4073,
4216, 4218, 4219, 4664, 4669, 4670, 4672, 4674, 4675, 4676, 4697, 4698,
4991, 4992, 4997, 4998, 5511, 5516, 4984, 4990, 4993, 4995, 4996, 4999,
5000, 5001
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Vite's default pre-transform requests, the Start compiler's lookup
of a server fn factory module pre-transforms a helper the factory uses
only inside `.server()`, and dev import protection logs the helper's
denied import as a client violation (the 'unknown' reachability
fallback). The client never loads the helper.
Pin (red for the right reason: `client src/helper.ts:3:34` logged, 10 of
10 runs with `idle()`), plus a passing control with pre-transform
requests off.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Vite dev-server harness turned `server.preTransformRequests` off for
every test, unlike a real app, where the client environment transforms
the static imports of each served module in the background. That hid
r5 M1 (a false import-protection warning). The harness now keeps Vite's
default; a test can still turn it off through `config`.
Adds `idle()`, which waits until no environment has a transform in
flight (background pre-transforms included), so tests can read what
those transforms log deterministically.
No status change in router-plugin, start-plugin-core, react-start-rsc,
router-generator or compiler-test-utils with the default on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
F3 (MED): an isomorphic fn whose `.server()` or `.client()` link is stored
in a variable loses that implementation. Compiler level (both directions,
evaluated with the Start runtime of each environment) next to the N4
builder-variable pins, control: the inline chain. Build rows on Vite and
Rsbuild in the shared env-separation build (new module
src/iso-builders.ts), control: the existing inline isomorphic fn. Red:
SSR or client returns undefined.
Variants (all `.fails`, red on main):
- `applyStep(createServerFn().validator(schema)).handler(...)`: module left
untransformed, client imports the schema;
- `withBuilder(createIsomorphicFn().server(f)).client(g)`: module throws
"withBuilder(...).client is not a function";
- V1 mirror: SSR keeps a client-only declaration a `typeof` type alias
reads, with its import (control without the alias);
- a class with a call in its extends clause used by a handler keeps its
server-only import in the client (dce-keeps-class row; the server-only
stub now also exports TaggedError);
- `((flag) as any) ? -x : y` loses its parentheses in the client output
(upstream @babel/generator 7.29.8, no workaround);
- N3 row `(<p>page</p>)?.valueOf()`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
F4 (HIGH): split route options with boundaries that another option reads
(`head` reads `Page.name`) go to a shared module without the lazy
component of the boundary. Vite and Rsbuild Start builds, `.fails`;
control: the existing default-groupings route test (same route, now
built from a shared fixture helper). Red: the build harness rejects the
client output (dangling generated name in the entry chunk).
F2 (LOW): an unused exported component's boundary still ships (its
module-level lazyRouteComponent call is kept). One shared build per
bundler; control without a boundary passes. Red: marker `lazy`, not
`nowhere`.
Variant: a boundary nested in a `children` prop hydrates without the id
the server renders (hydrate-children-prop family). Red: client id
undefined.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
F1 (MED): an exported component named by a split option written as
`X as any`, `X as typeof X`, `withAuth(X)` or `memo(X)` is copied into the
option's chunk, so the route renders another instance than its importers
get. Compiler-level `.fails.each` over the four shapes (through a real
importer, ruling P1) with the bare identifier as passing control; build
pin per client bundler (Vite, Rspack, webpack): the component is in the
client once, split or reported (decision D11). Red: other instance;
`eager+lazy` on all three bundlers.
Variants (all `.fails`, red on main):
- an unsplit option that reads a Route-reading split component with
`typeof` sees 'undefined' (split-binding-declaration-deleted-while-read);
- `((flag) as any) ? -x : y` loses its parentheses in a split chunk
(upstream @babel/generator 7.29.8, no workaround): PARSE_ERROR;
- N3 row `(<p>page</p>)?.valueOf()`: PARSE_ERROR.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Rsbuild dev-server harness read its compile counter after writing the
edited files. When the watcher started the compile of the edit before the
writes were seen as done (a loaded machine), the harness waited for a later
compile that never came: "Rsbuild did not compile src/page.tsx within
20000 ms" (start-plugin-core hydrate-build, rsbuild/dev-server,
compiler-test-utils rsbuild-dev-server).
- trackCompiles() (rsbuild-dev-server.ts) listens before writing and ends
the wait at the end of the compile whose changed files
(compiler.modifiedFiles / removedFiles) include the edit: every compiler
that read an edited file reported it, and new files were read (or are
looked for by no compile). A compile Rspack gives up on fails the wait
with its error. The timeout is only a hang guard, with a message naming
what no compile included.
- Start's Rsbuild watch build (tests/build-harness.ts watchEdits) uses it
too, instead of 'the next onAfterBuild after the writes'.
- known-bugs onViolation test: compile guard 3 s -> 10 s (the failed
compile ends the wait; a slow first compile must not fail it).
- Control: an edit whose compile starts while a large unrelated file is
still being written (fails on the old harness with the flake's message).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- One allowlist (src/known-globals.ts) for the module validator and the
production client chunk check: language globals, Node.js ES module
globals, a curated list of browser APIs plus the element and event
constructors, and Solid's _$HY. Generic window properties (name, status,
event, top, parent...) no longer count as globals; the validator no
longer accepts whatever the test process put on globalThis.
- Unminified (source map) production client builds of Rspack and webpack
are checked on a copy of each chunk minified as the bundler's production
minifier does (SWC minify / webpack's terser, compress passes 2, mangle,
module output as a module).
- Controls: name/status read by a chunk is rejected (Vite, Rspack,
webpack) and by the validator; unminified Rspack and webpack builds reject
a dangling name in kept code and pass one in code the minifier deletes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
describeBuild now checks every production client build of Vite, Rspack and
webpack (webpack/Rspack when minified; esbuild is not checked): a chunk name
that is neither declared, imported nor a global throws DanglingNameError.
Globals: the `globals` package (builtin + browser + nodeBuiltin), new
dependency of compiler-test-utils (already in the lockfile, 16.4.0), plus
Solid's hydration global `_$HY`. Applies to the router build harness and
Start's buildStart.
KB "page code in client builds": the display-name route (known bug, the
route module keeps `Page.displayName = ...` without `Page`) now builds alone
for its .fails pin, red on all bundlers with `entry.mjs: Page`; its
placement-only control rows (6) are removed. The Vite "unused object names
the split component" pin now fails at the harness check, same bug.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
User ruling 2026-10-17 (dead-code references, widened): code the bundlers
delete from a production build may read undeclared names. getModuleErrors
now replaces the hand-rolled "unreferenced non-exported function" rule with
real tree-shaking: when the plain check finds a free name, the compiled
module is bundled alone with Vite's own Rolldown (treeshake on, exports as
roots, imports external and side-effectful, platform neutral) and only the
free names of what survives are errors. No test changed status.
Controls: an unused function, an unused variable with a pure initializer,
dead `if (false)` branches, an unused class pass; exported code, code
reachable from an export, module-level calls and writes fail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers the excludeFiles part of the 2026-10-17 import-protection exemption
ruling, in mock mode:
- Vite and Rsbuild builds: `client.excludeFiles` (client) and
`server.excludeFiles` (SSR) matching `src/vendor/**`: the importer gets the
real module, the denied file runs, nothing is reported.
- Controls, same builds with the default patterns: the same files are mocked
and their importers reported.
- Default patterns: a `*.server.*` entry of a local `node_modules`
dependency is real and not reported.
- Vite dev: the client rows (custom, control, dependency).
All pass on main (no pin). A scratch mutation that ignores excludeFiles
(import-protection/utils.ts `isFileExcluded`) fails the 9 "real module" rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The module validator compiled JSX with React's automatic runtime unless the
module set `@jsxRuntime`. Oxc then ignores a lone `@jsx`/`@jsxFrag` pragma,
so a module that names a factory it never declares passed validation.
Under the automatic runtime such a pragma is ignored (Oxc, TypeScript,
esbuild with a warning) or rejected (SWC, Babel), so the module only works as
written in a classic-runtime project. The validator now uses the classic
runtime for a module with `@jsx`/`@jsxFrag` and no `@jsxRuntime`/
`@jsxImportSource` pragma; Oxc still reads the module's own leading pragmas.
Controls: classic pragma with the factory declared or imported (accepted),
factory or fragment missing (rejected), a pragma below an import (default
factory, rejected), automatic runtime unchanged (no pragma, explicit
`@jsxRuntime automatic`, `@jsxImportSource`).
No test changed status in router-plugin, start-plugin-core,
react-start-rsc or router-generator. One pin now fails earlier for the same
bug: known-bugs-hydrate "client: a module with a classic JSX pragma renders
through its factory" (the validator reports `React`; comment updated).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
renderThingTransform (regression-helpers.ts) and the warning transform
(start-build-warnings.test.ts) move to tests/compiler-transforms-seam.ts,
the only test file that binds to the AST shape of the `compilerTransforms`
hook. Behaviour unchanged; regression-helpers re-exports renderThingTransform.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Y-names: a minified Vite client chunk's map names a renamed split
component parameter at its original position (namedSegments helper in
compiler-test-utils, with a control).
- Dev race (known-bugs-dev-server): rows split; the hybrid shape (removing
a helper of an exported component) is a plain test, main passes it; the
removing/adding rows stay `.fails`.
- Cached rebuild: webpack/Rspack watch builds (new `rebuildAfter` harness
option, memory cache, with a control) keep an exported component that a
split component renders lazy after an edit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dev server tests (tests/importProtection/dev.test.ts):
- onViolation that returns nothing keeps the warning; with behavior
"error", an onViolation that does not return false does not allow the
import (denied file and specifier).
- A denied import reached only from the start entry (src/start.ts) is
mocked and logged.
- A split route component using a denied file, directly or through a module
only the split module imports, is mocked and logged at each use (Start's
whole plugin).
- An .mdx module (stand-in compiler plugin) importing a denied file, directly
or through a module, is mocked and logged at each importer.
- A denied specifier added to an importer by an edit is a mock the edited
module can import.
- An edit of a CSS module and a JSON module updates without an HMR error.
- A use of a specifier denied by a custom pattern rule in a JSX module is
located on its source line.
- Full-bundle dev (bundledDev): denied imports are mocked in the client
bundle and logged (no import-protection test covered bundledDev).
- With maxTraceDepth, the trace ends at the importer, each step naming the
import of the next.
- Control: a module the client loads after the server rendered is logged.
start-apps.ts: startProtectedDevServer gains an additive `bundledDev` option.
Pins (test.fails, NEW main bugs):
- Dev ignores maxTraceDepth: the module graph trace replaces the cut trace
(vite/import-protection-plugin/plugin.ts rebuildAndAnnotateTrace).
- Dev: an .mdx (non-JS) module importing a denied specifier fails to load
with "[vite] The "code" property of ModuleInfo is not supported."
(resolveExportsForDeniedSpecifier falls back to getModuleInfo().code).
- With server.perEnvironmentStartEndDuringDev, the first request of another
environment clears every environment's state (buildStart clearEnvState),
so violations of modules the client loads afterwards are discarded.
Kills: spc:4741, 4763, 4524, 4639, 4579, 4609, 4611, 4174, 4182, 4529,
4530, 4536, 4542, 4510, 4551, 4552, 4553, 4556, 4497, 4494, 4474, 4484,
4037, 4043, 4045, 4047, 4049, 4052, 4054, 4056, 4059, 4070, 4071, 4076,
4077, 4078, 4081, 4085, 4086, 4088, 4089, 4090, 4094, 4098, 4099, 4103,
4107, 4110, 4114, 4115, 4213, 4035, 4036, 4039, 4040, 4042, 4048, 4061,
4063, 4065, 4074, 4075, 4092, 4096, 4100, 4111, 4212, 4214, 4215, 4217,
4221, 4222 (module graph trace and clearEnvState keys by pin flip).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- R-11: findPostCompileUsagePos reports the same line and column for LF,
CRLF and lone CR; the reported importer location for a lone-CR file on
Vite/Rsbuild dev and build (main passes both).
- R-13: `@jsx` only row on the KB "factory the route module creates ...
created once" pin (main: "jsx is not defined").
- Import-protection exemptions (ruling 2026-10-17), new exemptions.test.ts:
exempt importers (ignoreImporters, exclude, outside include) get the real
module and are not reported; non-exempt importers get the mock and are
reported. Vite and Rsbuild builds, Vite dev.
Pins: exempt importers get the mock (ignoreImporters, exclude).
NEW pin: with `include`, a denied file outside the patterns is never
mocked (build ships the real module; Vite dev page fails to load).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pin (test.fails, NEW): when the Start compiler's lookup of a server fn
factory module resolves its imports, Vite import protection records each
imported module as a lookup module by its path ("Propagate pre-transform
status transitively" in resolveId), so the client's own transform of that
module is silenced in dev with behavior "error": a module the factory
imports that calls getRequest() at the top level loads the real
@tanstack/react-start/server without any error. Same root cause as the B3
pin above, wider trigger. Red reason: "expected 'loaded' to deeply equal
[ 'client src/other.ts' ]"; the test passes with propagation removed.
Kills: spc:5168, spc:5169
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A server-only-marked module re-exported by a mixed barrel whose other
exports the client uses is tree-shaken: the build succeeds without a
report (guide "False Positives: Dev vs Build"). Rsbuild is pinned
test.fails: same root cause as the IP6b pins in known-bugs.test.ts (its
report step walks every module of the graph).
- Mock mode: a denied import of a route used by its loader and its split
component (two bundle modules, one source import) is warned once.
- onViolation gets type 'specifier' for an import of a denied specifier.
Kills: spc:5266, spc:5268, spc:5275, spc:5296, spc:5299, spc:5137
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Behaviours of the Vite import-protection plugin hooks in dev:
- mockAccess 'warn' / 'off' change how the dev client mocks report their use
(console.warn / nothing instead of console.error).
- The importers of each of several server-only-marked modules are logged when
the client loads the importers first (retroactive marker check per module).
- A warning's trace leads from the router entry through a module of
src/routes (route modules are not entries in unbundled dev).
- With behavior "error", the trace of an import added by an edit still leads
from the router entry (the dev server's module graph).
- Full-bundle dev (experimental.bundledDev): a denied file is mocked in the
client bundle and logged at the use (coverage of the bundledDev path; the
harness gains an additive `bundledDev` option).
Pin (test.fails, NEW): in a JSX module, a denied file imported through an
alias (package.json `imports`) is reported at a location read from the
compiled code (4:77 of a two-line module): resolveId reports the violation
before the transform-cache loop captures the module's source map
('devViolation'); a scratch run that always captures the map passes it.
Kills: spc:4859, spc:5089, spc:4986, spc:4987, spc:4899
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- validate-module: free names inside module-level functions that are not
exported and that nothing reads (transitively) are no module error;
everything else stays strict. Controls for both sides.
- dead-code:196 and the KB `as any` controls: the dead code (marker) is
absent from production client builds on Vite, Rspack and webpack, and the
page renders.
- KB:2197 comment states the one-instance requirement.
- R-09 route factories: split (and hot-updated keeping identity), or
unsplit with a warning naming the file in every mode; the five factory
pins accept the same two outcomes. hotUpdate returns the file id.
- L3: a module imported only for a type specifier with
verbatimModuleSyntax does not load in a Vite client build (with a
control proving the tsconfig is in effect).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds startRsbuildStartDevServer (additive): an Rsbuild dev server with
Start's whole Rsbuild plugin (client and SSR, the generated server fn
resolver). Deleting a module that defines a server fn must drop it from the
resolver; otherwise the next compile never completes.
Kills: spc:6802
Survive (no observable difference found): spc:6980-6983 (invalidating
deleted files in the compiler cache; a re-created file is reported as
modified and invalidated then).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rspack may compile the client more than once for the edit under load
(seen once in a full-suite run); assert each distinct violation.
Kills: spc:7680, spc:7685 (re-verified)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Behaviours pinned through the evaluated route tree and the generator's
errors and warnings:
- virtual route paths and physical() prefixes without a leading slash
(`docs/intro`, `api/v1`) get the same URLs as with one;
- virtual route files written with Windows separators (`docs\\intro.tsx`,
as `path.join` gives on Windows) are imported;
- the "Conflicting configuration paths" and 'Invalid route path ""' errors
name the offending route files;
- a route file name with a space gets a route (with a valid route tree);
- an indexToken regex with the `i` flag (JSON or RegExp) matches index
files whatever their case;
- a token regex that does not compile fails the generator with an error
naming the pattern (instead of a TypeError later);
- no param warning for a route without `$` or with a `$` inside a static
segment (`usd-$`);
- `FileRoutesByFullPath['/']` is the index route, not a pathless layout
defined only by a `.lazy.tsx` file.
Kills: rg:2236, rg:2501, rg:3002, rg:3022, rg:2528, rg:2658, rg:2712,
rg:3200, rg:3168, rg:2886, rg:2888, rg:2895, rg:2932, rg:2934, rg:2937,
rg:2938
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A `posts.component.vue` piece next to `posts.ts` must not take over the
children of `/posts`: `/posts/$postId` and `/posts/$postId/edit` stay in the
route tree under `/posts`, and the piece becomes the lazy `component` of
`/posts`. The existing Vue piece test had a component piece only on routes
without children.
Kills: rg:2113, rg:2115
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A denied import that Rsbuild's source.transformImport rewrote
(ui-lib -> ui-lib/button) is reported on the line of its use: the
location is only found in the rewritten code, through the mock
module's path.
- Pin (NEW, low): the report points at src/entry.ts:2:16 instead of the
use at 2:27.
- Pin (NEW): a specifier denied as written ('ui-lib') is not denied once
transformImport rewrote it; the build succeeds without any report
(the loader matches the post-SWC specifiers).
Kills: spc:7425, spc:7426, spc:7432, spc:7817
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In watch mode, a rebuild for an unrelated edit still fails on a
violation the first build reported (the 'once' dedupe state of a build
does not carry over to the next build). buildStart gains an additive
Rsbuild-only watchEdits option: build in watch mode, apply edits after
the first build, describe the rebuild (bounded waits).
Kills: spc:7680, spc:7685
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A virtual module of a user plugin placed after the Start compiler loads in
dev (the server-fn id validator must only claim its own virtual id).
- A route that becomes a page before the browser loaded the client route
tree shows up in the client route tree (the invalidation must cope with a
route tree not in the client module graph yet).
- The client route module of a split page route takes part in HMR (Start
forces route HMR on in its client code splitter).
Kills: spc:5579, spc:5972, spc:6046
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dev compile in which the entry module (or an imported module) is
missing reports the missing module, and import protection does not fail
the compile on the entry without a module.
Kills: spc:7250
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A callback that returns nothing does not allow a denied specifier: the
build fails and the callback gets a 'specifier' violation (the existing
table had file and marker rows only).
- A RegExp client.specifiers pattern is reported as the rule that matched.
Both bundlers.
Kills: spc:7818, spc:7056, spc:7057, spc:7059
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A client .mts or .cts module importing a .server file is reported and
mocked in Rsbuild dev (the host skipped importers by extension).
- Rsbuild dev honours behavior: { dev: 'error' } (compile error) and the
dev default (warning); onViolation gets the effective behavior.
- Rsbuild dev honours mockAccess: the mock reports a use with
console.error by default, console.warn for 'warn', nothing for 'off'.
runRsbuildClient gains an additive levels option.
Kills: spc:7154, spc:7155, spc:7630, spc:7632, spc:7639
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds three constructs to the shared "server code of each construct" build
of start-build-env-separation.test.ts (one build per bundler, no new
build): a server fn validator on a builder variable, a middleware
validator on a builder variable (N4), and a validator schema that a type
alias reads with `typeof` (V1, upstream root cause in
babel-dead-code-elimination). Each pin asserts that the validator module's
marker is `nowhere` in the client and that the SSR build still applies the
validator. Red on both bundlers: the marker is `eager`; the SSR half
passes. Control row: a middleware `.server()` on a builder variable is
stripped and runs in the SSR build.
The middleware builders live in a module without a server fn factory:
with one, the Rsbuild SSR build fails to resolve `createMiddleware`
(already pinned as "a module with a middleware and an isomorphic fn
builds ...", BS-6/K-13; a server fn triggers it too).
The harness's stand-in `createServerFn` gains `.validator()`, which the
real runtime has: the server runs the validator (a function) on the input
before the handler. Additive; no existing build used it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each pin was run once as a normal test and failed for the bug.
- N3 (upstream root cause): parenthesized JSX under `!` or a member call
loses its parentheses in the client output, and in a Hydrate `fallback`
(start-compiler-preserves-user-code.test.ts). Red: the module does not
parse. Root cause in @babel/generator 7.29.8; no workaround. Control:
parenthesized JSX alone.
- N4 (new main bug): a `.validator()` on a builder stored in a variable
is not stripped from the client. Server fn rows in
createServerFn/caller-dead-code.test.ts (one and two handlers; red: the
client imports ./schema; the provider still applies the validator) and a
middleware row in start-compiler-factories.test.ts (red: the client
imports ./check.server). Control: the `.server()` link of a middleware
builder variable is stripped.
- N5 (new main bug): a component bound inside the `<Hydrate>` children
(`const Icon = icons[id]` in a map callback) is passed as a capture
(known-bugs-hydrate.test.ts). Red: the client parent references an
undeclared `Icon`. Control: `Icon` bound outside the boundary renders
the same on client and server.
- V1 (upstream root cause): a validator schema that a type alias reads
with `typeof` stays in the client (known-bugs-start-compiler.test.ts).
Red: the client still imports zod. Root cause in
babel-dead-code-elimination 1.0.12; no workaround. Control: the schema
without the type alias leaves.
- Classic JSX runtime: under `/** @jsxRuntime classic */`, the SSR output
drops `import * as React` once the `<ClientOnly>` children are removed.
Red: "`React` is referenced but never declared or imported". Control:
the import stays when other kept code reads React.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A route file that imports createFileRoute from a module of the app
(`@/lib/router`) gets a second createFileRoute import from the router
package, so the written file no longer parses. The pin runs the real
generator on a moved route and asserts that the written file is a valid
module (known-bugs.test.ts, "route constructor imports"). Red: "Identifier
`createFileRoute` has already been declared".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Turns the oracle-mode fuzzing findings for the code splitter into tests
(known-bugs-code-splitter.test.ts). Each pin was run once as a normal
test and failed for the bug.
- N1 (new main bug): an imported split component that other code still
reads loses its import. Pins: head() reads PostsPage.title (loadRoute),
an exported component renders the imported errorComponent, read through
a real importer (adapted from examples/solid/start-supabase-basic
posts.$postId.tsx), a pendingComponent split by custom groupings that an
unsplit errorComponent renders, and real SSR builds on Vite and Rspack.
Red: "PostsPage/ErrorComponent/Spinner is not defined". Control: the same
head() route with the component declared in the route file passes.
- N2 (new main bug): a top-level call reading a module-level binding runs
again in every split chunk. Two rows in the "unreferenced top-level side
effect" table (red: 3 calls instead of 1); the table's Bug comment now
covers these calls. Control: calls reading only imports or literals run
once. The harness body moved into expectEffectRunsOnce.
- N3 (new main bug, upstream root cause): parenthesized JSX under `!` or a
member call is printed without parentheses. Red: the split chunk does
not parse. Root cause in @babel/generator 7.29.8; no workaround.
Control: parenthesized JSX alone.
- V3 (variant): rows for the split-option re-parse pin: an immediately
invoked function, a typed arrow, `as any`, `!` and a type argument
(the last one parses as comparisons and yields `false`). Red: Babel
"Unexpected token" / "component is not a function".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
startProtectedDevServer's new `config` option used the package's own Vite
`InlineConfig` and `mergeConfig`; the dev harness types its config with
compiler-test-utils' Vite copy, so test:types failed. It now takes
`StartDevServerOptions['config']` and adds the provider environment by
spreading.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pin "an onViolation that throws ends the compile with its error"
(c079f2e351, REPORT §6 #23) said the Rsbuild dev compile never finishes and
the error is never reported. With the Rsbuild dev harness now failing its
compile wait on `compiler.hooks.failed` (835b7b72a3), the test passes on
main: Rspack fails the compile with the thrown error, and Rsbuild's dev
watcher marks the build failed and logs the error (@rsbuild/core 2.2.5
dist/626.js, `compiler.watch` callback: `logger.error(error)`). The harness
only waited for `done` and runs with `logLevel: 'silent'`, so the error
looked lost. The pin becomes a normal test; no claimed kills depended on it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mutation run r3b gaps (ip-analysis, location only, low impact).
Rows of `findOriginalUsageLocation`: an immediately invoked function, a
computed `[handler]` member of a server fn builder, a private method's
callback, `.handler`/`.server` of callees whose names only contain
ServerFn/Middleware, a look-alike `.client` method on the server, loops
inside createServerOnlyFn, and a type-only import specifier.
Pin (ip-analysis P2, main bug, location only): the client compile replaces a
whole `createServerOnlyFn(...)` call whatever its argument is, but the
lookup only skips functions passed to it directly, so
`createServerOnlyFn(wrap(() => getSecret()))` is reported instead of the
real leak after it. Fix-agnostic: asserts the leak's line. Red: reports
line 3 (the wrapped use) instead of 4.
Kills: spc:503, 520, 521, 523, 529, 546, 565, 574, 877, 901, 326, 328;
pin flips: spc:798, 799
Equivalent (the cluster range was over-included): spc:527, 528 (a
non-computed member always has an Identifier or PrivateName property, and
a PrivateName has no `name`), 543, 545 (`/ServerFn$/` matches
createServerFn), 559, 561 (`/Middleware$/` matches createMiddleware),
548, 567 (the `?? ''` fallback never matches either regex).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mutation run r3b: the Vite dev 'unknown'-reachability fallback
(vite/import-protection-plugin/plugin.ts, `processPendingViolations`) lost
all coverage once the dev harness registered Start's entries (20c891a337).
Reachability: real dev reaches it. Some edge to the module then lacks
transform data: the module is served while its only importer is still being
transformed (overlapping requests: Vite's `server.warmup`, parallel
requests, a slow resolver). The new test holds the importer's resolution of
another import with a resolver plugin, serves the module, then lets the
importer finish; a probe confirmed six passes through the branch with the
router entry registered. Outcome: the module's denied imports are mocked
and logged at their uses.
Also: V7 (spc:5415), a server fn factory module (whose violations wait for
its compiled imports) calling a denied file and then a denied specifier at
the top level is logged at both uses.
Pins (NEW main bugs, each verified red for the right reason):
- a module transformed before any importer of it is known (`server.warmup`,
or any request that comes first) has its violations discarded as
unreachable, and its transform is cached: never logged, even once the app
loads it (red: mocked, nothing logged).
- a denied import reached from the app's client entry (`src/client.tsx`) is
not logged: the client entry is not a registered entry and the browser
loads it from Start's dev client entry, a virtual module whose imports are
not recorded (red: loaded through the dev client entry and mocked, nothing
logged). Control: the same leak through the router entry is logged.
- with log 'always', one import of a denied file is logged three times per
load: twice as written (resolveId and the transform-cache check both find
it) and once as the resolved path (red: 3 reports instead of 1).
Kills: spc:4727, spc:5415
Survive (outcome-equivalent): spc:4704, 4706, 4723 (only when the warning
appears: as the module is served, or when its importer finishes; same
logs); spc:4725, 4747 (only add more copies of one 'always' report before
the importer finishes; main already logs one import three times, pinned).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Regressions of mutation run r3b: the only test that told `log: 'always'`
from `'once'` became a `.fails` pin in 20c891a337 (an edit drops the import
graph edges, a main bug). The new tests reach the same violation again
without an edit: Vite reloads every module when `tsconfig.json` changes
(as when it re-optimizes dependencies), without changing any module, and
the client loads the app again. With 'once' nothing is logged again; with
'always' the violation is logged again, at its use. The edit pin stays.
`startProtectedDevServer` takes extra plugins and Vite config (additive).
Kills: spc:4462, spc:4463, spc:4464, spc:4465, spc:4469, spc:4856
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The watch-mode test (d9dad4804b) waited for the created route file to be
scaffolded and for the route tree to list it with a helper that throws
"timed out waiting for ..." after 15 s, so a missing scaffold only showed as
a time limit. It now polls for at most 10 s and then asserts the file
contents, so the test fails with what was read. Same assertions.
Kills (now on an AssertionError, about 10 s): rp:1912, rp:1913, rp:1918,
rp:1919, rp:1920.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Harness hygiene (mutation run r3b follow-up 1): a built entry run by the
build harness (`run()`, e.g. the server of an Rsbuild Start build) ran in a
`node --eval` child with no time limit and nothing tying it to the test
worker. When a vitest worker was killed on a timeout, a child stuck in a
loop was reparented to init and spun at 100% CPU for hours.
- New `run-node.ts` (`runNodeProgram`): runs the program with a time limit
(default 30 s, SIGKILL, clear error) and a watchdog thread (`--import`)
that SIGKILLs the child once its parent process is gone, which works even
while the program's thread spins in a synchronous loop. Used by the build
harness's `run()` and router-plugin's code-splitter runtime test.
- `withBuildEnvironment`: an error no one handles while a build runs fails
the build (a throw in a sync Rspack `compile` hook leaves `rsbuild.build()`
pending forever).
- Rsbuild dev harness: a compile Rspack gives up on (`compiler.hooks.failed`,
e.g. a throw in `processAssets`) rejects the compile wait with its error at
once instead of after `compileTimeout`.
Verified: SIGKILLing the vitest worker while an Rsbuild Start build's
server spins leaves no process (with the watchdog disabled, the child is
reparented to systemd and keeps spinning). Control tests in run-node.test.ts
and rsbuild-dev-server.test.ts.
Fail fast instead of a time limit: spc:6793 (Rsbuild builds failed after the
60 s test timeout, now at once on an assertion), spc:7471 (Rsbuild dev
compile wait of 20 s, now the real TypeError at once).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The webpack branch of the route generator host had no coverage, and nothing
checked that closing the compiler's watcher stops the generator's own
chokidar watcher (route-tree hosts, round-3 mutation testing item G).
In `compiler.watch` mode, per bundler: a created empty route file is
scaffolded and added to the route tree; after `watching.close()`, a route
file created later is left alone. The negative check needs a fixed wait
(the generator's watcher closes asynchronously and nothing signals it);
the test waits for the compiles to settle before closing, and cleans up
only after the watcher closed. Passed on base in every run (5 runs).
Mutants verified killed (through Nx): rp:1903 rp:1905 rp:1906 rp:1912
rp:1913 rp:1914 rp:1918 rp:1920 rp:1923 rp:1925 rp:1926; rp:1919 killed in
1 of 2 runs (webpack sometimes reports the created file through its own
watcher too).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round-3 mutation testing (FIX-PLAN R3-router: ranked items 22-24, medium
and low-tier Route HMR proposals).
- route-hmr: every kept split component still renders its own component
after an update (not only `component`); unsplit routes drop a removed
component option and render an added one (Vite, webpack); Solid/Vue
unsplit routes render the new component; options built by a factory call
are hot-updated; root route tests take the generator's root route id.
New dev-server section (autoCodeSplitting off): `.ts` route files get
route HMR, `plugin.vite.environmentName` limits it to that environment,
`plugin.hmr.style` alone works, `tsr.config.json` in the Vite root sets
the target, function plugin options work, and served React/Solid/Vue
route modules map throws to their route-file line.
- known-bugs-route-hmr: controls for an inline-components React route edit
being a hot update with @vitejs/plugin-react, a lowercase function loader
shared with the split component, and an inline loader reading a renamed
lowercase component. New pin (verified red: the edit sends
`full-reload`): an edit of a React `.ts` route module with
autoCodeSplitting off is not a hot update (same root cause as the pinned
Vite HMR boundaries bug).
- handle-route-update: an update of a route the live router does not have
leaves the router as is (no throw); root route test takes the generated
root route id.
- react-refresh-route-components: a `$`-prefixed lowercase function
component is renamed and registered.
Mutants verified killed (through Nx): rp:1299 rp:1428 rp:1408 rp:1346
rp:1348 rp:1287 rp:1413 rp:1453 rp:1454 rp:1403 rp:1405 rp:1425 rp:1467
rp:1325 rp:1326 rp:1439 rp:1466 rp:1469 rp:1470 rp:1471 rp:1472 rp:1462
rp:1463 rp:1199 rp:1203 rp:1206 rp:1212 rp:1214.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix-agnostic .fails pins (REPORT section 6, bugs 6-9, plus low-tier pin
rows), each verified red on main for the stated reason by a scratch run
without .fails:
- exported option component reading Route rendered by a split component
(export function / export const): ReferenceError "NotFound is not defined".
- split option values outside the virtual compiler's allowlist (namespace
member, local member loader, `||`, `??`, tagged template, class
expression): "Unexpected splitNode type ☝️: MemberExpression /
LogicalExpression / TaggedTemplateExpression / ClassExpression".
- `export default function` called by the loader and a split component:
TypeError "Duplicate declaration \"bump\"".
- `createFileRoute<'/'>('/')` is never split (code filter misses type
arguments): component not lazy.
- a module whose path contains `tsr-split`: build fails with "The split
value for the virtual route ... was not found".
- split loader also exported through `export { load }`: "Export 'load' is
not defined".
- binding read by a computed-key option and a split option: created twice.
- `export @dec class` (TS 5 decorators): "Decorators must be placed
*before* the 'export' keyword".
Controls (passing): `{...} as any`, `(createFileRoute('/') as any)(...)` and
`createFileRoute('/')(makeOptions())` routes still render.
Mutants verified: control rows kill rp:80 rp:83; pins flip (killed) under
rp:1068 rp:1069 rp:1071 rp:1073 rp:1074 rp:1076 rp:1077 rp:1079 rp:1080
rp:1081 rp:1082 rp:426 rp:427 rp:428 rp:137 rp:1636 ru:13. rp:1613 and
rp:1614 do not flip the tsr-split pin: they only change how the bug fails.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round-3 mutation testing (FIX-PLAN R3-router: ranked items 15-18, medium and
cheap low-tier Splitting proposals). Outcome assertions only: rendered
output, loader values, init counts, identity, real-build stack frames.
- plugin-options: two code splitters scoped to the client and SSR
environments of one dev server (Start's wiring, shared router plugin
context) split a route whose loader and component share a binding;
a non-function splitBehavior is refused.
- module-state: shared binding stays one instance when the component calls
a hook with an options object; exported classes keep identity next to
shared state; class dependency, array destructurings, JSX member object
and partly shadowed module names reach the shared code; a local named
like a Route-reading helper (21 forms) or component (3 forms) does not
tie the shared binding to Route; destructured sibling of a split
component; exported object destructuring created once; .jsx route files:
state only split options read is created lazily, once, and the shared
module does not pull in component-only imports.
- imports-exports: the route module keeps the other specifiers of a split
component's import; `export default Page` row in the exported-options
table; a default export of another binding or an exported destructuring
does not stop splitting; exported helpers next to an exported option
component; an exported option component is not copied into another
option's chunk; auto-accessor fields compile.
- route-options: literal/method options grouped with a split option stay
as written; a split loader's module loads with the loader only; a local
function loader is split without a warning; root route id from the
generator.
- plugin-pipeline: an edited route recompiled by the same instance works
after a version whose loader and component shared a binding; plugin
order errors for SWC, OXC, vite:react-refresh and vite-plugin-solid.
- build-source-maps: throws in the route module and in shared code map to
their route-file line (Vite).
Mutants verified killed (applied to src, test run through Nx; router-utils
mutants through the source-aliased vitest config because their dist build
fails type-checking):
rp:79 rp:187 rp:189 rp:190 rp:191 rp:192 rp:222 rp:963 rp:965 rp:967
rp:973 rp:975 rp:976 rp:977 rp:980 rp:984 rp:985 rp:986 rp:989 rp:990
rp:992 rp:751 rp:752 rp:753 rp:492 rp:493 rp:495 rp:498 rp:499 rp:500
rp:501 rp:787 rp:788 rp:790 rp:793 rp:794 rp:795 rp:796 rp:851
rp:473 rp:1041-1047 rp:1024 rp:1078 rp:1099
rp:584 rp:585 rp:591 rp:1059 rp:1094 rp:1100 rp:1110 rp:1122 (sample of 34)
rp:566 rp:576 rp:580 rp:581 rp:714 rp:715 rp:717 rp:718
rp:417 rp:418 rp:419 rp:420
rp:1709 rp:1712 rp:1715 rp:1716 rp:1758 rp:1759 rp:1826
rp:1580 rp:1581 rp:1481 rp:1485 rp:1486 rp:1487 rp:1491 rp:1492 rp:1493
rp:1496 rp:1498 rp:1499
rp:529 rp:530 rp:857 rp:858
ru:585 ru:587 ru:588 ru:641 ru:434 ru:435
ru:208 ru:210 ru:328 ru:329 ru:398 ru:402 ru:403 ru:404 ru:194 ru:196
ru:352 ru:300 ru:303
ru:178 ru:180 ru:315 ru:336 ru:359 ru:361 ru:364 ru:367 ru:389 (sample of
the 78-key shadow table) ru:15
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The root route HMR tests registered the root route file under '/__root' by
hand, and hotUpdate decided root-ness from that literal, so a generator that
registered the root file under another id (or none) went unnoticed by the
route HMR suites (round-3 mutation testing harness gap).
- regression-helpers: `generatedRouteId(file, files)` runs the router
plugin's own route generator plugin (configResolved, as the Vite plugin
does) on a temporary routes directory and returns the id it registered
the file under; hotUpdate treats a route created by `createRootRoute` as
the tree's root and reads the live route by the id the route tree gave it.
- regression-helpers.test.ts uses the generated id for its root route row.
Mutants verified killed through the converted root tests (route-hmr,
handle-route-update; source-aliased vitest because generator dist builds
fail type-checking under these mutants): rg:941, rg:942, rg:954.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test:types rejected the inferred union of the row objects (optional
undefined file keys) as Record<string, string>.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 3 mutation gap ip-misc P11 (start-build-source-maps.test.ts, both
bundlers): in a mock-mode build, a throw in a module whose denied import
import protection rewrote maps to its line in the source file.
Kills: spc:7985, 8002, 8004
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pins (known-bugs.test.ts, appended):
- REPORT #1 / ip-misc P1 (Rsbuild): a client dynamic import('db-lib') of a
denied specifier builds without a report (red: the build succeeds).
Vite row is a normal test (the build fails with one client violation).
- REPORT #3 / ip-vite B1 (both bundlers): in mock mode a denied
.server.json ships its real content (red: hasRealCode true, read
MARK_SECRET, warned); a denied .server.cjs fails the build (red: Vite
PARSE_ERROR on the ESM mock, Rspack ESModulesLinkingError for the named
import). Intended: build succeeds, client gets the mock, warning.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 3 mutation gaps (reported-location.test.ts, Vite and Rsbuild builds):
- ip-location P2 + ip-rsbuild R9: the trace lists each import from the
entry (only the first step tagged entry), located at its specifier.
- ip-location P3: the code frame shows the import and the use, its caret
under the reported column, and the location under it.
- ip-location P6: the trace is the shortest import chain (diamond).
- ip-rsbuild R8: with source maps, Rsbuild locates a trace import on its
line after compiling moved it (comment, blank line, type-only import).
Pins (#21, build part):
- ip-location B1: without a captured source map, trace steps use
compiled-code lines (Vite: every row; Rsbuild without source maps:
blank line and type-only import rows). Red: line 2 reported for an
import on line 3.
- ip-location B2 (Vite): the trace stops at modules outside src. Red: the
trace is only the importer.
Kills: spc:1317, 1319, 1321, 1323, 1328, 1331, 1334, 1752, 1754, 1755,
1815, 1816, 1821, 1822, 1826, 1649, 1650, 1653, 7236, 7237, 7405, 7435,
7436, 7441, 7444, 7447, 7462, 7465, 7473, 7474, 7490, 7491, 1723, 7216
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 3 mutation gaps (build-options.test.ts, both bundlers unless noted):
- ip-rsbuild R1: an onViolation that returns nothing does not allow the
import (denied file and marker rows).
- ip-rsbuild R5: the marker violation is typed marker and located at the
marker import (line; the two bundlers differ by one column).
- ip-misc P4: in mock mode, onViolation gets info.resolved for each
import of several denied specifiers (resolve cache hit), and the
production mocks are silent.
- ip-rsbuild R6: log 'always' reports each violation of a build once.
- ip-misc P5: excludeFiles with several patterns (table row).
- ip-vite V6: client.excludeFiles [] with a server-only-marked dependency
fails the Vite build (Vite row only: Rsbuild awaits a ruling).
- ip-location P5 + ip-rsbuild R10: maxTraceDepth cuts a deeper trace and
keeps one within the limit complete.
Adds violation-report.ts, a reader of the trace and code frame of the
reports a build prints.
Kills: spc:7564, 7825, 7418, 7278, 7280, 7353, 1886, 5260, 7838, 7845,
7846, 7849, 7851, 7857, 7863, 7864, 7865, 7874, 7878, 7972, 7963, 7964,
7965, 1685, 1686, 1709, 1710, 1712, 1725, 1737, 7642
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 3 mutation gaps (both bundlers, build.test.ts):
- ip-location P1: re-exports from a denied specifier are mocked in mock
mode; other re-exports keep their values.
- ip-vite V1: a denied .server.mts/.server.mjs file is mocked.
- ip-vite V10: mock mode with a CSS import builds and mocks.
- ip-vite V11: the mocks of a build are silent when used.
- ip-misc P2: a server import of a client-only-marked module fails the
build; in mock mode it is mocked (Vite: new row of the existing
markerMockTest pin, same bug).
- ip-misc P3 + ip-vite V5: the client (server) build may import a
client-only (server-only) marked module from several modules; replaces
the single-importer server test.
- ip-vite V16 + ip-rsbuild R11: such a clean build prints no
import-protection output (no perf report by default).
- ip-location P4: a .server file in a dot directory is denied.
Kills: spc:1254, 1282, 1292, 5319, 5243, 5349, 7910, 7911, 7927, 7929,
7930, 7931, 7935, 1173, 1174, 4299, 4307, 5466, 3990, 7002
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`onViolation` receives `unknown` in Start's options type: cast it to
`ViolationInfo` like the neighbouring tests; type the Rsbuild config and
the rows of the module-type pin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pins (each verified red for the bug as a plain test):
- REPORT §6 #4 (ip-vite B3): in Vite dev with behavior "error", a server fn
factory module calling a denied import at the top level loads silently
(`serverFnLookupModules` keys by path without the lookup query). Red:
the load resolves ('loaded'). Control: the same call in another module
fails to load. The mock-mode counterpart passes (dev.test.ts V4(b)).
- #2 (ip-rsbuild R2): Rsbuild dev never checks importers of non-JS module
types (`.mdx`-like): a denied file is mocked but not reported, a denied
specifier's real code runs. Red: reported [] (and ranRealCode true).
Flipped by spc:7307 and 7168 (denied-file row).
- #23: an `onViolation` that throws hangs the Rsbuild dev compile. Bounded
wait (compileTimeout 3 s); red: "Rsbuild did not compile the app within
3000 ms"; the harness closes the server afterwards.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Harness gap H1: `startProtectedDevServer` and the known-bugs dev config now
register Start's router entry (and `src/start.ts` when present) the way
`tanStackStart()` does, so the dev reachability check runs. Apps in
dev.test.ts are loaded from their router entry `src/entry.ts`, like a
browser loads a Start app. The provider environment can be `rsc`.
Re-running the suite with the entries registered turned two passing tests
red; investigated, a real main bug (not a harness artefact), now pinned:
- Bug (new): an edit drops the import graph edges to the edited module
(`ImportGraph.invalidate` removes the edges where the file is the
target), so a violation found when it is transformed again is discarded
as unreachable: a denied import added by an edit is mocked without a
warning, and `log: 'always'` does not log again after an edit. Pins:
"added by an edit of the importer is logged at the use, with a trace from
the entry", "'always' logs a violation again after an edit" (both flip
with a scratch fix keeping incoming edges). The mocking half stays a
passing test.
Items:
- ip-vite V2: the logging half of the "importer first" pin is a normal test.
- V3: SSR import of a client-only-marked module (already transformed, and
through its importer) is mocked and logged.
- V4 (a) only the leak is logged, not a server fn factory's .server()
imports; (b) a factory module calling a denied import at the top level
is logged (the H1 control: fails without the entry).
- V7 denied specifier logged at its use; V8 dev onViolation; V9 rsc
provider env; V12 runtime mock reports; V14 JSX locations; V15 'always'
does not re-log on other loads.
Kills: spc:5091, 5094, 5103, 5106, 5109, 5113, 4305, 4312, 5070, 5077,
4547, 4560, 4561, 4584, 4586, 4588 (hang), 4594, 4597, 4604, 4607, 4613,
4626, 4631, 4642, 4643, 4644, 4656, 4657, 4662, 5011, 5141, 5143, 5146,
4533, 4581, 4520, 4900, 4902, 4678, 4685, 4687, 5014, 5017, 5021, 5446,
4744, 4761, 4764, 4326, 4794, 5351, 4169, 4170, 4173, 4187, 4189, 4731
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Harness gap H2: the Rsbuild dev-server harness now exposes the warnings of
each compile (compiler-test-utils, additive) and closes the dev server when
its first compile fails (e.g. times out), so a hung compile does not leak a
watcher into later tests. `runRsbuildClient()` runs the emitted client code
and returns what it logged.
Items:
- ip-rsbuild R3 (H2 control): `log: 'once'` reports a violation once across
rebuilds, `'always'` again.
- ip-rsbuild R4: after an edit, `info.resolved` names the new target.
- ip-rsbuild R7 + ip-misc P10: each client mock (two denied files, one
denied specifier) reports its own import at runtime.
Kills: spc:7076, 7548, 7553, 7692, 7698, 7131, 7944, 7962, 7966
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
start-router H: the router.codeSplittingOptions rows also assert the SSR
build places the loader and component like the client build, on Vite
and Rsbuild.
Kills: spc:6051, 8034, 8035.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-hosts 9: buildStart gets two additive options, builds (rebuild the
same app directory with a new plugin instance, describe the last build)
and rsbuildConfig (merged over the harness's). A second Rsbuild build
with performance.buildCache restores the modules from the cache, and
each client RPC id still runs its handler through the SSR resolver.
Kills: spc:6799, 6956, 6960, 6968. Survives: spc:6959 (restore tap at
stage +20 instead of -20, after the SSR resolver rebuild at -10): the
client environment's restore already filled the shared registry, so the
order within the SSR compiler is not observable here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Harness gap H1: dev-server.ts can mount Start's whole Vite plugin
(tanStackStartVite with the options @tanstack/react-start passes) through
the new opt-in start option, with stand-in entries, router and root route;
existing callers are unchanged. Control: the new test fails with the old
harness (no route tree is generated).
start-router D: new start-router-dev-server.test.ts edits a route from
server-only to page, to page without handlers, back to server-only; the
client route tree follows, page/server-only switches send a full reload,
and a handler edit of a server-only route sends nothing to the client.
Kills: spc:5953, 5955, 5960-5964, 5967, 5969, 5973-5975, 5977-5979,
5983-5988, 6002.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-hosts 5: dev-server.ts takes the compiler's environments and
providerEnvName (optional, defaults unchanged; extra environments are
created as server environments). With an rsc provider, SSR resolves the
client's id through its configured getServerFnById module, and rsc runs
the handler.
Kills: spc:5677, 5679, 5681, 5932, 5934, 5936, 5937, 5938, 5939, 5941,
5942. Survive: spc:5935, 5940 (every environment the resolver applies
to is in the list, so the lookup always finds one).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-hosts 4: a Vite builder builds the SSR environment twice (like the
@vitejs/plugin-rsc scan build) through the Start compiler plugin; the
second build's server fn, whose builder the compiler loads from another
module, is compiled and runs.
Kills: spc:5762, 5763, 5764.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-hosts 8: on Vite and Rsbuild, the build fails naming the missing
module; the wait is bounded (20 s) so a hanging build fails the test
fast.
Kills: spc:6906 (the mutant hangs the Rsbuild build; the bounded wait
reports it).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-hosts 6: on Vite and Rsbuild, the client RPC calls the id
serverFns.generateFunctionId returns, and the SSR resolver runs the
handler under it.
Kills: spc:5799, 5801.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
start-router F: Vite and Rsbuild builds with and without src/start.ts;
the SSR route tree keeps the user's router.routeTreeFileFooter, and
ts.createProgram on routeTree.gen.ts plus a check file proves the
Register interface carries ssr, the app's router and (with src/start.ts
only) the app's Start config, with @ts-expect-error negatives.
Kills: spc:3941, 3942, 3944, 3946-3952, 3955, 3957, 3958, 3961, 3962,
3965, 3967, 3968, 3970, 3976-3978, 3980, 3984-3986, 3988, 5993.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
start-router E: the prerendered-pages control runs Start's prerender
plugin on a whole app (index, nested, layout, group, lazy-only, dynamic,
server-only and cast routes) and gets exactly the static pages.
New pin (known bug class): a page whose options are wrapped in a cast
(as never, as any, satisfies) is not prerendered; the route generator
records no option keys for them. Verified red: the page is missing from
the prerendered paths.
Kills: spc:3882, 3887.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
start-router C: a Vite and an Rsbuild build with
prerender: { enabled: true, crawlLinks: false } request exactly the
static pages (/, /about), not the dynamic page or the server-only
route, from a stand-in request handler (Start's own prerender step runs).
Kills: spc:6032, 6033, 6035, 6036, 6037, 8020, 8022, 8023, 8025, 8026,
3882.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
start-router A: a Vite and an Rsbuild build whose SSR entry exports
tanstack-start-manifest:v; the manifest preloads each page's component
chunk and links the stylesheet its component imports.
start-router B: the client route tree keeps a server-only route with a
page under it, the root stays a root, and (Vite) the server-only subtree
is pruned. Rsbuild row is a .fails pin of the known parity bug (only the
Vite plugin prunes; same bug as known-bugs-route-options.test.ts).
Kills: spc:3893, 3895, 3896, 3897, 3900, 3901, 3903, 3912, 3926.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-hosts 3: SSR calls a server fn by id, then imports another module and
calls its server fn by id through the same resolver.
Kills: spc:5946, 5949.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-hosts 2: two modules export a server fn of the same name; the client
bundle of an Rsbuild dev server, run in a bare context, gets two
different RPC ids.
Kills: spc:6764.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-hosts 1: the shared env-separation build gets a server fn built with
a builder imported from src/base.ts (its handler code stays out of the
client and runs in SSR), and every client RPC id runs through the SSR
server fn resolver (origin client), on Vite and Rsbuild.
Kills: spc:6933.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Harness gap H3: tests/rsbuild-test-loaders.ts ran a hand-written copy of
src/rsbuild/start-compiler-metadata-loader.ts; the app loader now
delegates to the TypeScript source through a global, like the
import-protection test loader.
Kills: spc:8047, 8049, 8050 (existing Rsbuild builds of
start-build-options.test.ts). spc:8048 survives (the compiler host always
sets the build-info callback before the loader runs).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-core P14: two rows on the pin "client: a createServerOnlyFn called
through $name is compiled": a local alias in a function-local const and
in a top-level block (both flip under the mutants, which fix main).
Pins (REPORT section 6), each verified red for the right reason:
- #15: the provider keeps `export * from './browser'` (the browser-only
module is evaluated by a server fn call) and `export default Page` with
the browser-only state it reads (`window is not defined`).
- #17: an external transform does not reach a call imported through a
project re-export when the call is nested, or when the module has no
built-in factory (the transform's argument is missing).
Kills: spc:2368, spc:2372 (pin rows flip)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-handlers 4: the server-fn resolver module is the same whatever order
the server fns were discovered in.
sc-core P10: the SSR output's source map carries the original source
(the client is left out: D1, client maps and stripped server code, is
out of scope).
sc-core P13: a renamed `<ClientOnly>` imported next to other specifiers,
or written without spaces, still drops its children on the server.
Kills: spc:3811, spc:3817, spc:2983, spc:2984, spc:2985, spc:2236,
spc:2238
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-handlers 2: an object-literal (or other expression) default export
next to a server fn keeps every output a valid module, the client its
value and the provider its handler.
sc-handlers 7: three redeclared `var` server fns, named with `_`, `$` and
non-ASCII characters too, get distinct ids, each served by the provider.
spc:3677 (and 3676/3678 by analysis) turns the fresh-name loop into a
synchronous infinite loop: the run hangs (no in-process bound can fire),
so it is not counted as killed.
Kills: spc:3690, spc:3672
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-handlers 5: compile the narrow re-export shape with the compiler the
hosts create (`createStartCompiler` of host.ts), which forwards
`compilerTransforms` to the lookup configurations, so dropping them there
fails the test too (a compile-level stand-in for the Vite build case).
Kills: spc:3765 (and still spc:3417, 3418, 3419, 3421)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-core P6: IIFEs and curried calls compile in a module calling a
configured external transform.
sc-core P7: unrelated virtual runtime imports next to a server fn (top
level) or a server-only fn (nested) are left alone and the module still
compiles, with a host that cannot load them.
sc-core P8: a provider with external transforms configured compiles
aliased env-only calls of a server fn module.
sc-core P11: compiling a self-referencing binding settles (bounded race).
Under 3029/3030/3032 the recursion never yields to the event loop, so
the race cannot fire: the worker runs out of memory (~35 s) and the file
fails; killed, but not within the race.
sc-handlers 3: the provider drops export lists (`export { Page }`,
`export { Page as component }`) and named re-exports of a browser-only
module (the latter a separate test: the shared rows' unused top-level
`window` read is user code the provider rightly keeps).
sc-handlers 5: an external transform reaches a top-level call imported
through a project re-export next to a built-in factory (the narrow shape
main supports; the others are pinned).
Kills: spc:2413, spc:2737, spc:2389, spc:2390, spc:2392, spc:2393,
spc:2327, spc:2271, spc:3029, spc:3030, spc:3032 (worker OOM),
spc:3705, spc:3707, spc:3417, spc:3418, spc:3419, spc:3421
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-core P3: a top-level server fn wrapped in two calls never ships its
handler to the client, with createServerFn alone or next to another
factory (a standalone test: as a `placements` row it would also feed the
createServerFn-alone placement pins, which it passes); a createServerOnlyFn
wrapped in two calls runs only on the server.
sc-core P12: in dev, a server fn imported through `export *` of the Start
package still compiles after an unrelated module is invalidated.
Kills: spc:2792, spc:2820, spc:2649
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-core P2: a top-level call of an isomorphic fn next to a server fn
returns each environment's value.
sc-core P4: a createIsomorphicFn() builder kept in a variable keeps the
server implementation and its import off the client.
sc-core P9: a `.client()` call on a global object next to an isomorphic
fn compiles and keeps its meaning.
Kills: spc:2374, spc:3198, spc:3332, spc:3333
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-handlers 1 (High): a server fn the client and a server caller both
report, merged in either order the way the hosts merge reports, stays
callable from the client through the resolver's client-origin check.
spc:3769 (merge drops the existing entry) survives: every caller report
is client-referenced today (D6), so overwriting changes nothing; the
test kills it once server callers report server-only fns (D6 fix).
sc-handlers 6: a diagnostic on line 12 names that line and does not
quote the whole module.
Kills: spc:3773, spc:3844
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sc-core P1 (High): a module with several server fns, compiled for the
client then the provider through the hosts' shared registry, calls each
handler by the id its client RPC carries, with default ids and with one
custom id for all (deduplicated ids stay distinct).
sc-core P5: a unique custom generateFunctionId id is the id clients call.
Kills: spc:2473, spc:2486, spc:2497
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ip-analysis P8-P11 (low, location only): shadowing and loop/catch rows
for the post-compile usage lookup, the preferred use (call/new/member
read over a read, object keys vs values, re-exports), compiler-safe
boundaries vs look-alikes in the original-source lookup, and the lookups
of two denied sources of one module.
Kills (sampled): spc:829, spc:965, spc:970, spc:974, spc:976, spc:978,
spc:982, spc:923, spc:935, spc:952, spc:866, spc:880, spc:883, spc:888,
spc:904, spc:905, spc:511, spc:515, spc:540, spc:549, spc:555, spc:562,
spc:570, spc:586, spc:810
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ip-misc P6-P9: `new` on a member of the silent and build mocks returns a
mock; the dev mock reports a string conversion, toString(), `new` and a
property write; the dev mock edge of a denied import reports through the
violation's runtime; the Rsbuild mock runtime (payload encoded as
ensureRuntimeMockModule does) is silent for mockAccess 'off' and reports
for 'error'.
Kills: spc:2078, spc:2071, spc:2073, spc:2077, spc:2079, spc:2141,
spc:2144, spc:2145, spc:2148, spc:2161, spc:2162, spc:2163
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ip-location P7 (REPORT 6 #21): `rewriteDeniedImports` drops
`export * as ns from '<denied>'` without exporting a mock as `ns`
(rewrite.ts:140-195 only rewrites ExportSpecifiers), so an importer of
`ns` gets a missing export / undefined in a mock-mode build. Pinned
`.fails` (fix-agnostic: `ns` defined, denied module not loaded), plus a
passing companion: the module evaluates without loading the denied module.
Kills: spc:1262 (companion)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ip-analysis P5-P7: a denied file exporting an enum still mocks its other
exports; mock modules expose non-identifier names ('~lead', 'a~b', 'a:b',
'|x', 'a^b'); an array-rest export of a denied file is mocked.
ip-analysis pin P3: split the combined "namespace re-export, enum and
namespace" pin so `export * as ns from` in a denied file is pinned on its
own (bug: the self-contained/dev mock of the file has no `ns`;
analysis.ts:270-275 only collects ExportSpecifier names). The enum and
namespace part stays a separate pin.
Kills: spc:377, spc:191, spc:193, spc:199, spc:229, spc:231, spc:237,
spc:245, spc:247, spc:158, spc:163, spc:164, spc:165, spc:385 (pin flips)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ip-analysis P1-P4: import discovery survives array holes; a string
argument of an ordinary call and a computed `import(name)` are not import
sources; `export {} from '...'` still imports its source.
Kills: spc:445, spc:447, spc:448, spc:449, spc:409, spc:411, spc:120, spc:124
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- P1 (REPORT 6 #20): spaces around a single child on one line render on
the server but are dropped by the client chunk (hydration mismatch).
Pin: both environments render the JSX text.
- P2: the member-expression tag pin is split into <ui.Home /> and
<Model.Item /> rows.
Pins flipped by: spc:6410, spc:6414, spc:6418, spc:6419 (P1); spc:6372
(capitalized row only)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Item 4: the server keeps the bindings the children read when stripping
the fallback (sibling declarator, module-level destructuring).
- Item 6: the server module does not import a client-only module the
fallback reaches through components, classes, spreads or a namespace.
- Item 8: a hook call in the boundary's own props runs in the parent
render and the children still split.
- Items 10, 11: forms rows for quoted spread keys and split={false} with a
single-use spread.
- Item 12: after the source module is invalidated, a chunk loaded the way
the Vite host loads it renders the edited children.
Kills: spc:6191, spc:6213, spc:6215, spc:6216, spc:6217, spc:6220, spc:6233, spc:6198, spc:6199, spc:6201, spc:6203, spc:6205, spc:6206, spc:6207, spc:6209, spc:6140, spc:6141, spc:6277, spc:6190, spc:6299, spc:6300, spc:6302, spc:6304, spc:6305, spc:6135, spc:6136, spc:6480, spc:6481, spc:6711, spc:6760, spc:6761
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Item 2: the children read locals through a non-shorthand property value
and a computed member.
- Item 9: member names and object keys are no reads of a local declared
after the boundary.
- Item 13: a boundary spreading a global splits children rendering a
global component.
Kills: spc:6351, spc:6357, spc:6341, spc:6342, spc:6343, spc:6344, spc:6347, spc:6353, spc:6354, spc:6358, spc:6382, spc:6240
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Item 1: a single {expression} child (captured prop, forwarded children)
renders through the chunk.
- Item 3: neither the client parent nor the chunk imports a module only a
server fn handler uses.
- Item 5: boundaries spreading the props param, a props member or a
reassigned object get the preload of their own chunk.
- Item 7: the chunksFromSource test runs for React and Solid.
Kills: spc:6648, spc:6649, spc:6686, spc:6239, spc:6533, spc:6534, spc:6747, spc:6749
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Verified red for the same reason as the other pairs ("Identifier
`AbRouteImport` has already been declared" when the tree is parsed).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round-3 mutation gaps (gen-transform.md items 1-11):
- transform.test.ts: the constructor import is fixed when the route id is
already right (no import, stale other constructor, only the other one,
lazy route called as createFileRoute); a module exporting only
`export { helper }` is not a route; `export let Route` and
`export const Route = postsRoute` are left as they are; an interpolated
template-literal id is an error; type imports stay type-only; a prepended
import keeps the file's line ending and its own line (LF, CRLF, single
line); removing a stale import leaves clean, valid code (trailing
whitespace, two imports on one line); semicolons kept; an unrelated or
multi-line import declaration stays byte for byte; a stale import next to
an aliased constructor import.
- known-bugs.test.ts: the "no Route export" control also covers
`export { helper }` at the generator level.
Mutants verified killed (rg set): 1261, 1271, 1469, 1549, 1551, 1566,
1303, 1304, 1306, 1309, 1351, 1355, 1370, 1371, 1373, 1433, 1435, 1451,
1666, 1668, 1669, 1685-1689, 1695, 1697, 1700, 1702, 1706, 1708, 1709,
1711, 1712, 1714, 1716, 1719, 1720, 1729, 1736, 1440, 1452, 1682, 1531,
1559, 1564, 1541, 1542, 1625, 1627, 1632, 1634, 1639, 1641, 1643, 1476,
1477, 1486, 1487, 1631, 1633, 1388. 1715 hangs (synchronous loop) on the
trailing-whitespace case: detected as a timeout, not a test failure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round-3 mutation gaps (medium/low generator tiers), read from the evaluated
route tree through a new `urlsOf` helper (route-tree.ts: the URL each route
matches, joining `path` options like router-core):
- route-paths.test.ts (new): escaped `[_]` segments of flat files; literal
`_` after the first segment of virtual routes and physical() mounts;
escaped underscores in a physical mount under a virtual `/_foo` route;
virtual layouts and index under it; a pathless layout under `[_]api`;
`(group)` layouts at the root and nested add no segment; a childless
pathless layout does not crash; an unformatted tree with grandchildren;
`@B` next to `B`; `g`/`y` token flags behave like unflagged ones; only
invalid brace params warn; FileRoutesByTo picks the navigable route.
Pin (main bug, REPORT section 6 #14), verified red for the stated reason
("Identifier ... has already been declared" when the tree is parsed):
route variable-name collisions (about-us/aboutUs, _layout/layout, $id/id).
Mutants verified killed (rg set): 16, 20, 2469, 2470, 2479, 2484, 2487,
2488, 2499, 72, 1009, 3039, 2660, 3166, 3181, 3182, 3184, 3186, 3188, 3189,
3191, 2896, 2911, 2913, 2916, 2517, 2519.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round-3 mutation gaps (ranked 28 and the dev-related medium/low tiers):
- generator-dev.test.ts (new): a long-lived generator fed watcher events.
Adding/deleting a nested route gives a fresh run's tree; a route deleted
after a no-op edit leaves the tree; a broken edit fails the run and the fix
is processed; a hand-edited or corrupted routeTree.gen.ts is regenerated
on its update event; a new generator on an up-to-date app does not
rewrite the tree; a missing root route fails naming __root.tsx; route
files in physical() mounts and virtual routes outside the routes directory
are watched; afterTransform receives the previous node (Start's
server-only toggle detection); getRoutesByFileMap maps the root file to
/__root, also after a rerun.
- concurrent-write.test.ts: a save while the generator fixes the file is
processed before run() resolves; an in-place save on a filesystem with
1 s timestamps is not overwritten; rewritten route files keep their mode
and owner (EPERM warns, other chown errors fail the run and leave the
file).
Pins (main bugs, REPORT section 6), each verified red for the stated reason:
- deleting a layout route drops its child routes in a running generator
(tree has only __root__);
- a deleted routeTree.gen.ts is not written again on its delete event (file
missing), and the next route change fails with ENOENT;
- editing the virtualRouteConfig file has no effect in a running generator
(tree keeps the old route).
Mutants verified killed (rg set): 280, 337, 298, 299, 301-305, 307-310, 312,
313, 315, 316, 771, 784, 1170-1173, 756, 758, 876, 884, 918, 925, 941, 942,
954, 343, 1190-1192, 1198-1203, 192, 194, 196, 198-200, 205, 167, 182, 838,
45, 795-797, 799-810, 812, 814, 816, 817, 819-825, 827. Pin flips checked:
639 (layout pin), 354 (deleted tree pin).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round-3 mutation gaps (ranked 25-27, 29; medium generator tiers):
- route-pieces.test.ts: Vue SFC piece files of routes and of the root route
become lazy components of their default export, left untouched; a child
route under a route with pieces stays in the tree; disableTypes variant;
empty piece files stay empty and unused; an empty `_auth.tsx` is
scaffolded. Pin: root-only Vue pieces crash (lazyRouteComponent is not
defined), verified red for that reason.
- generator-options.test.ts: default `-` routeFileIgnorePrefix; the Solid/Vue
tree imports only its own router package; customScaffolding from
tsr.config.json (route and lazy templates); valid token combinations;
same flagless JSON regex tokens and `'_ '` prefix rejected; disableTypes
changes only the trailing extension; nested route tree directories.
- template.test.ts: empty root/route/lazy files (and ones under `{-$locale}`)
scaffold into routes that evaluate and render, for react/solid/vue, with
only the target's router package and framework importable.
- Shared helpers: tests/app.ts (temporary apps, save with later mtimes);
route-tree.ts gains routeOptionsOf (lazy options by file and export).
Mutants verified killed (rg set, applied in the worktree, then reverted):
pieces: 236-240, 397, 399, 400, 402-409, 418-422, 424, 425, 427, 428, 435,
466-476, 478-480, 491, 498-505, 507-517, 519-521, 523, 591, 592, 715, 718,
1060-1063, 1072, 1081, 1083, 2116, 2118, 2119, 2124, 686, 688, 694,
696-707, 714 (473/514 fail to load).
options: 1748, 1983, 2033, 2034, 1792, 1884, 1886, 1887, 1889, 1891, 1893,
1894, 1897, 1898, 1902, 1912, 1916-1918, 1813, 1861, 103, 104.
scaffolds: 2007, 2022, 2052-2055, 2058-2061, 2064-2071, 2074-2077,
2080-2083, 1985-1987, 1989, 1991-2000, 2036-2040, 2042-2051, 684, 685, 712,
713.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Rsbuild keeping server-only routes in the client route tree is a parity
bug (.fails), no longer a skipped row.
- Compiling Start output a second time is unsupported: its test is deleted.
- enableRouteGeneration is experimental: the pin on code splitting with
generation off is deleted; the passing test that it leaves the user's
files untouched stays.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
originalFrameOf (compiler-test-utils) maps the first stack frame in a chunk
through the chunk's emitted source map; buildStart gets a sourcemap option.
A throw in a split route component, a server fn handler (SSR) and Hydrate
children map to their line in the user's file. Split route components on
Rspack, webpack and Rsbuild are pinned: unplugin's transform loaders drop
the code splitter's source map when no earlier loader passed one in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A client that never splits no longer satisfies the pins, except where
leaving the children in place is accepted (runtime children, plain text),
which the comments now say. The string attributes test renders through the
page instead of rendering the chunk alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tanstack/solid-router is now installed for the real-build tests, so the
dev-server control's stub must run before Vite resolves the package.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A route file starting with a hashbang splits into valid modules that
behave like the source; a route file named with non-ASCII characters is
generated, split and rendered on Vite, Rspack and webpack. The module
linker keeps a module's hashbang first when it adds its prologue.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the plugin registered twice (each instance transforming every module
in turn), a production compile gives the route a single instance gives:
same lazy options and modules, same rendering, module state created once.
In dev, the second instance's HMR code collides with the first
("Duplicate declaration hot", reproduced on a Vite dev server with
tanstackRouter registered twice): pinned, fix-agnostic (same route or an
error saying the plugin is registered twice). The compile helpers take an
instances option.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Vite client build with @vitejs/plugin-react and the React Compiler preset
after the router plugin compiles the split component with the compiler
(control: not without it), keeps it lazy and renders it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The same route compiles to the same modules (route file id aside) and
behaves the same under other project roots and with Windows module ids in
Vite's and webpack/Rspack's spelling (Node's file URL helpers behave as on
Windows for drive-letter paths). Building the same app twice, in two
directories with files written in another order, emits identical files on
Vite, Rspack and webpack. The compile helpers accept a raw moduleId.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
enableRouteGeneration false leaves the user's tree and route files alone
(and the silent loss of code splitting is pinned, fix-agnostic: split or
tell the user); autoCodeSplitting false/undefined split nothing;
plugin.vite.environmentName limits splitting to that environment;
repeated options in defaultBehavior or a route's codeSplitGroupings are
refused naming the option; the Rspack/webpack entries wire route HMR
through the bundler's hot API even with plugin.hmr.style 'vite'; the
separate generator/code-splitter entries of each bundler and the deprecated
TanStackRouterVite behave like the combined plugin. The router build
harness can now take other router entry points and several plugins for
webpack/Rspack.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A virtual route config object in tsr.config.json, quoteStyle and
semicolons in the route tree, addExtensions (true, "js", ".js"),
disableTypes with the .js route tree rename, importRoutesUsingAbsolutePaths,
routeTreeFileFooter as a function or an array, disableLogging, the
temporary directory (TSR_TMP_DIR, tmpDir, default) and rejected
configurations, asserted through generated files and evaluated route trees.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Route files whose id is fixed keep every other byte (CRLF, BOM, quotes,
semicolons, solid and vue targets, .js and .jsx files, lazy constructor
renames, added constructor imports), empty route files are scaffolded,
and non-ASCII and hashbang route files generate. Pins: an added import goes
before a hashbang or BOM, and an empty .ts route file breaks generation
(#8480).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Links compiled JSX to a stub JSX runtime, so the route id of route files
with components can be read by evaluation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Evaluates a generated route tree with stub route modules and returns its
route ids and the route files they come from; fails on imports that do not
resolve to a file, like a bundler.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DV4 on Vite: a route file the generator cannot handle is reported and
the route comes back once fixed (control of the Rsbuild pins). DV17: an
edit of a route created while the server runs, once a page loaded it,
is a hot update with @vitejs/plugin-react.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the Vite dev-server generator cases (create, wrong path, rename,
move into folder/index, delete, unchanged edit) to a real Rsbuild dev
server running the Rspack entry, asserting compile errors, route files,
the route tree and the emitted chunks. Add DV4 recovery cases and pin
the Rspack generator missing edits of created route files it left out
of the route tree.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per bundler (Vite, Rspack, webpack) and framework (React, Solid, Vue), a
production client build with NODE_ENV unset and the default addHmr has none
of the HMR and React Refresh names the dev server's output of the same
route contains, and no absolute path of the project. Without code
splitting, the NODE_ENV-at-creation bug is pinned for Rspack/webpack (all
frameworks) and, through Vite's JavaScript API, for React on Vite (the
refresh anchor export stays).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The router build harness gets a framework option (Solid: vite-plugin-solid
or babel-preset-solid with the solid condition; Vue: the vue automatic JSX
runtime). The shared build harness gains additive jsxImportSource,
sourceRules and conditions options. New builds per bundler (Vite, Rspack,
webpack), framework (Solid, Vue) and environment check that the split
component loads lazily and renders, shared module state is initialised
once, and no other framework ends up in the bundle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rubric-start item 7: the pin builds the resolver itself with the
client-reference check on, so it only flips for a fix in what the compiler
reports. No build harness has an RSC provider environment yet; the
SSR-provider build pin is the host-level oracle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oracle-gaps M4 at compiler-unit level: compiling the client and SSR output
of a module with a middleware, an isomorphic fn, server-only and
client-only fns and a <ClientOnly> boundary again gives a valid module that
evaluates the same (checked against literal expectations, not printed
code). Passes on main.
Server fns are not idempotent on main (recompiling any output of a server
fn module throws "Duplicate declaration" / cannot load server-rpc); no path
from real user code to the compiler seeing its own output was found, so
that case is reported, not pinned.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oracle-gaps H3 at compiler-unit level, through the hosts' shared
createStartCompiler factory and a registry shared like the Vite and Rsbuild
plugins share it:
- the same module under `/a/app`, `/x/y/app`, `C:\app` with backslash ids
(Rsbuild) and `C:/app` with slash ids (Vite) gets the same client RPC id,
its provider handler answers to it, and calling it by the reported id runs
the handler;
- a custom generateFunctionId gets the root-relative filename with `/`
separators under every layout (the generated function name is not
asserted);
- a generateFunctionId returning undefined falls back to a working id;
- two server fns given the same custom id, compiled client A,B then server
B,A, each keep the id the client gave them (provider handler and SSR
caller of each module run that module's handler).
All pass on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds the fourth shape of the wrapped middleware matrix (lost-cases-campaign
W-2, fuzz M4 link:2): `(createMiddleware({ type: 'function' })
.middleware([]).validator(v).client(c) <wrapper>).server(s)`, crossed with
the 8 wrappers (parentheses included). The client keeps
[middleware, client], SSR the full chain. Passes on main; it crashed the
Yuku migration.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rubric-start tier 2 (items 9, 10, 12-22; item 11 is the lead's):
- compiler.test.ts: provider route exports (:490) run the handler without
evaluating browser-only code; parenthesized namespace server fn (:1012)
is an RPC by the reported id; #6643 (:566, :590) calls the provider /
evaluates the client with a stubbed window; same kind twice (:153),
deeper re-export chain (:782), parenthesized chains (:993) and namespace
builtins (:1038) evaluate through createStartCompiler/compileFor instead
of hand-built configurations; shadowed external transform (:261) and
unrelated SSR middleware (:964) evaluate `result ?? code` instead of the
null-return protocol; circular re-export chains (:828) only need to
settle. Dead `createCompilerWithVirtualModules` and `createFullCompiler`
removed.
- createServerFn.test.ts: line-ending diagnostics (:78) via compileFor;
query-bearing virtual ids (:160) and the start-client-core root binding
(:255) check the client RPC by the reported id (and the provider by id).
- createMiddleware.test.ts: start-client-core CSRF middleware (:48) and the
namespace import (:106, now createStartCompiler) evaluate the client.
- factories: untouched modules (:543) evaluate client/SSR (no provider:
never requested without server fns); missing implementations (:575) get
the client rows; project-module factories (:609) and export * chains
(:720) call the server fn through the callers and evaluate serverOnly;
dev invalidation (:819) evaluates both compiles.
- declaration-sites .ts in a # directory (:228) calls the server fn through
the callers; the @jsxImportSource count (jsx:121) is dropped.
- known-bugs: capturing placement pin (:722) requires the callers to reject
(provider unreachable once they do); CommonJS pin (:1309) asserts
compile + same evaluation instead of `toBe(code)`. Both re-verified red
for the original reason (no rejection; strict-mode parse errors).
Deleted, with covering tests:
- createServerFn.test.ts "should compile server functions wrapped in
TypeScript as expressions" / "... satisfies expressions": covered by
start-compiler-import-forms.test.ts "{react,solid,vue} > createServerFn >
through a call result wrapped in as / satisfies" (client keeps no server
import, RPC, provider runs the handler).
- envOnly/envOnly.test.ts "should error if implementation not provided":
covered by start-compiler-factories.test.ts "a missing implementation is
rejected where it runs: export const none = createClientOnlyFn()" (new
client row) and "... createServerOnlyFn()".
- createIsomorphicFn.test.ts "should error if implementation not
provided": covered by the same table's rows "createIsomorphicFn()
.client()" (new client row) and "createIsomorphicFn().server()
.client(() => 1)".
Helpers: evaluateModule links project modules (`files`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
User ruling P2: only the client must be free of server-fn handler code; the
SSR caller may keep the handler in place or call it through the provider.
The SSR side of the server-fn suites now asserts behaviour instead of the
absence of the handler body or of handler-only imports:
- regression-helpers: the server runtime stub calls a server fn given a
function alone (an SSR RPC by id, or a handler kept in place) and runs a
handler after its middleware `.server()` and its validator;
createServerGraph serves `createSsrRpc(id)` like the server-fn resolver
(reported server fns -> provider module export) and links project
modules (`files`); callServerFnThroughCallers checks the client RPC id,
the provider handler of that id, and that calling the server fn from the
SSR caller returns the handler's result; expectOutputsFreeOfHandler only
requires the client to be free of the handler; compileAll takes an id.
- SSR-side loosening: handler-scope callHandler and the .ts row,
caller-dead-code mixed imports / Report / cycles / repeated elimination /
nested vars, exports-and-directives export forms and import attributes,
factories env-specific functions (SSR keeps no client-only import),
import-forms createServerFn, declaration-sites nested goal pin, the
createServerOnlyFn-handler pin, dedupe of custom ids, harness controls.
Provider content no longer pinned (rubric-start tier 1, blocks the SF17
fix): the provider rows of preserves-user-code (empty destructuring
initializers, typeof type query) call the handler by id in the server
graph and count initializer runs; caller-dead-code drops the provider
import lists (:24, :390, :417) and provider text checks (:353, :640,
:661) for handler results, recorded validator/middleware runs and two
calls on one instance; factories :525 drops the exact provider import
list (keeps: no client-only import).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
virtualModules.test.ts kept "supports primitive conversion for called
mocks" and "... for named export calls" (the latter now evaluates the build
mock with nothing to link to: it imports nothing), and asserts the
dev-vs-build distinction by evaluation: the dev mock of a client violation
reports each use through console.error / console.warn (mockAccess), naming
the import, the importer and the trace; with mockAccess off or in a server
environment it reports nothing. The purity-annotation text check of the
silent mock is now: it links on its own, and evaluating and using it
changes no globals and logs nothing (the build-level effect is pinned in
known-bugs.test.ts).
Deleted printed-text tests, covered by analysis.exports.test.ts
"$kind exposes \"$name\"" (:27) and "%s exposes several names at once"
(:36), which evaluate each kind of mock (self-contained, mock edge, dev
self-denial) for valid, string-keyed and `default` names:
- loadMockEdgeModule: generates named exports from payload, handles empty
exports array, handles string-keyed export names; handles malformed
base64 and falls back to MOCK_MODULE_ID when runtimeId missing (ids the
plugin never generates)
- makeMockEdgeModuleId: encodes exports into module ID payload, handles
empty exports (payload encoding)
- generateSelfContainedMockModule: generates module with named exports,
handles empty exports, filters out default export, handles string-keyed
export names; is self-contained -> "supports primitive conversion for
named export calls" (standalone evaluation)
- generateDevSelfDenialModule: generates module with named exports and
mock-runtime import, handles empty exports, filters out default export;
imports mock-runtime -> "the dev mock of a denied file" rows
- loadMockRuntimeModule (error mode, warn mode, malformed payload) and
mockRuntimeModuleIdFromViolation (mode off, non-client env, client error
mode, relative trace paths, line numbers in trace) -> "the dev mock of a
denied file" rows
- loadMarkerModule returns empty module -> build.test.ts "the server build
may import a server-only-marked module" (evaluates the marker import)
- loadSilentMockModule returns mock code -> "links on its own, and
evaluating and using it has no side effects"
rewrite.test.ts: the four `toBeUndefined()` "no rewrite" tests (type-only
import, no denied imports, type-only export, type-only export *) now
evaluate the module after the rewrite step and assert it evaluates
unchanged: same values, neither the denied module nor a mock loaded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pin returned early (passed) on any build failure other than the
import-protection error, so once the bug is fixed and `.fails` removed, an
unrelated failure would pass silently. It now asserts the outcome directly
(the build succeeds without the module's code), and a new control builds
the same files with import protection on in mock mode, proving the harness
builds them.
The bug comment now names the Vite root cause found with a scratch change:
the mock that replaces the module is never tree-shaken (its exports read
members of the mock); with side-effect-free exports the Vite pin passes.
New pin for the same root cause in mock mode: an unused denied module
leaves a mock in the client bundle and a warning (the behaviour the
virtualModules purity-annotation text checks stood for).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Passing rows: a denied client import is mocked and the dev server logs a
warning naming the importer at the use (warning channel); an edit adding a
denied import to the importer is mocked and logged without a restart;
behavior 'error' / { dev: 'error' } fails the load naming the importer;
{ build: 'error' } keeps the dev default (mock); log 'once' does not log
again after an edit, 'always' does.
New pins: one import of a denied file is logged twice in dev (log 'once');
a server-only-marked module whose importer the client loads first is
served for real; an edit adding a server-only marker to a loaded module
keeps the real module in the client (DV37, adding direction).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
reported-location.test.ts reads the importer location import protection
reports (Importer: file:line:column) from a Vite dev server's warnings and
from the errors of an Rsbuild dev server and of Vite and Rsbuild builds, so
both adapters' lookup orders (Vite: compiled code first; Rsbuild: original
source first) are covered.
Moved the analysis.usage `.fails` pins on the internal
findPostCompileUsagePos to these rows, asserting the reported location:
- "ignores a member property named like the import" -> "a use after a
member property named like the import" (red on all four)
- "ignores type positions" -> "a use after a type position" (red on
Rsbuild dev and build; Vite erases types before its lookup, and a
type-only use leaves no import to report)
- "finds $name usage" (JSX element, JSX member element) -> "a JSX element"
(red on Rsbuild dev and build, which report compiled-code coordinates)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Builds real Start apps (Vite and Rsbuild) with Start's default import
protection: a client import of a *.server.* file, of
@tanstack/react-start/server or of a server-only-marked module fails the
build naming the importer; enabled: false checks nothing; mock mode keeps
the real code out of the client. New pins: a Vite mock-mode build ships the
real code of a server-only-marked module; onViolation returning false does
not allow the import (the client still gets a mock); on Vite,
ignoreImporters does not exempt importers of a marked module.
build-options.test.ts exercises behavior { dev, build }, include/exclude,
ignoreImporters, client.specifiers (additive) and server.specifiers, and
excludeFiles (replaces the node_modules default) by their build outcome.
Deleted the Rsbuild "registerImportProtection marker scope" tests, which
ran on a hand-built fake of the Rspack compilation; covered by
build.test.ts "server-only marker" rows on both bundlers:
- skips marker violations imported only by an ignored importer ->
"imported only by an ignored importer does not fail the build"
- reports a marker shared with a non-ignored importer -> "imported by an
ignored importer and another importer fails the build"
- reports a marker imported by a resource-query module -> "imported by a
split route component fails the build"
- skips marker violations from an errored importer module -> "imported by
a module that fails to compile: the build reports the compile error only"
- reports a marker violation when the marked module is an entry ->
"marking the client entry fails the build"
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The real runtime (start-client-core createServerFn) copies the extracted
fn's properties (url, serverFnMeta) onto the server fn, and
createServerRpc gives the provider's extracted fn its id. The stand-in now
does the same (functionId), so a compiler that keeps an SSR caller's
handler in place, passing an extracted fn with an id like the provider
does (allowed by user ruling P2), gets a server fn with an id there too.
Only adds properties; every test passes as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Start's Vite and Rsbuild plugins:
- serverFns.base and router.basepath: the client calls <base><id> (a
stand-in client RPC building the URL like start-client-core's) and the
SSR build routes the same base.
- serverFns.generateFunctionId returning undefined: the default id, which
the SSR resolver runs.
- server.build.staticNodeEnv: the server build has the build-time
NODE_ENV by default, and reads it at runtime with false.
- router.codeSplittingOptions reaches the code splitter: by default the
loader stays with the route and the component is lazy; a defaultBehavior
grouping both puts them in one lazy chunk.
Pin (Rsbuild): staticNodeEnv: false has no effect (red: 'production'
instead of the runtime 'staging'); only the Vite plugin reads the option,
the docs promise it for both.
Source: oracle-gaps "Start options never exercised".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
buildStart() takes the framework's compilerTransforms (as
@tanstack/react-start passes React's RSC CSS transform). With a transform
that warns about one call: on Vite the warning is a warning of the SSR
build only, naming the module, once.
Pin (Rsbuild): the compiler host warns through the transform context's
emitWarning, which Rsbuild's api.transform context does not have, so
every Start compiler warning is dropped (red: nothing reported in any
channel). Fix-agnostic: bundler warnings or the console.
Source: oracle-gaps M2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Start's Vite and Rsbuild plugins: the same app (server fns, a split
route, a lazy module) built in two directories with its files written in
the opposite order gives byte-identical client and SSR chunks and the
same server fn ids; with a generateFunctionId that collides and the SSR
build compiling the modules in the opposite order, each client id runs
its own handler through the SSR resolver. Both pass on main.
Source: oracle-gaps H3 (no two-roots / build-twice / collision-order
comparison at build level).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Passing, both bundlers: a library exporting a top-level server fn gives
the client an RPC without the handler, and the SSR build runs it, called
directly and by that id through the resolver.
Pin, both bundlers (red: marker eager in the client bundle): a library
function that creates a server fn for its users
(createLoggedServerFn(handler)) leaves the user's handler and its imports
in the client bundle, silently. Fix-agnostic: the handler is not in the
client bundle (and SSR runs it), or the build fails with a createServerFn
error (D13).
Source: lost-cases-campaign item 13 (a) and (b).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the Rsbuild provider-only test kept only its provider half; the caller
half asserted bug C9 (no CSS for a render call in a helper module) and
is now a .fails goal with React Start's Rsbuild options (ssr env)
- streams may carry the CSS before or after the node (no order pinned)
- dropped a duplicate of the import-forms table and a redundant null check
- new: an Rsbuild dev server with React Start's Rsbuild RSC options: the
client environment never loads CSS, the provider module in the ssr
environment does, also after an edit (gaps C7/C14, M7)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vite dev (unbundled): editing a middleware's .server() never reaches the
client and SSR runs the new one (DV31); editing an isomorphic fn runs the
new branch in each environment, the client never getting the server one
(DV32).
Vite full-bundle dev (bundledDev, new harness option): the client bundle
has client code and no handler while SSR runs it by id; a server fn
module calling a dependency at the top level bundles (#8407); SSR runs an
edited handler directly and by id (#7535); a factory edit drops the
handler from the client bundle without errors (#8062). All pass on main,
so they are regression tests.
Source: oracle-gaps H4 (DV29, DV31, DV32).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces the check that the chunk's map names the source file with
positions: a child element in the chunk and an element outside the
boundary in the parent map back to their original line and column
(gap M1 for Hydrate chunks).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Vite and Rsbuild builds now render the client through its lazy chunks
(every lazy component loads, then the page renders again) and compare
HTML and boundary ids with the SSR build
- the parent's module-level initializer may run eagerly or lazily (not
both); only the children's imports must be lazy
- the N20 goal accepts lazy or eager (eager only when reported), so the
pin stays red on the duplicate only
- new: module-level code only the children use is not duplicated
- new: boundaries in two split route options (component, pendingComponent)
hydrate with the ids the server renders (gap H10)
- new: Vite dev server serving a Solid boundary with the Solid packages
only; its chunk renders through the nested chunk and an edit reaches it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`createDevServer({ bundledDev: { entry } })` turns on Vite's
experimental.bundledDev for the client (Rolldown's dev engine, eager
chunks) from that entry; `clientBundle()` returns the latest client
bundle (rejecting with the bundling error), and `settle()` has the dev
engine rebuild from the edited files. In this mode Vite sends no hot
updates, so an event counts as handled once every environment's
watchChange hooks have run. Controls: the bundle follows an edit and
keeps unimported modules out; a failing bundle rejects.
Source: oracle-gaps H4 / DV29 (no harness support for bundledDev).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The global, user-binding and collision fixtures first compile the page to
collect the binding names the compiler introduces (generatedNames in the
new tests/hydrate-helpers.ts), then declare exactly those names as globals,
module-level or local user bindings. The collision pin now also covers a
module-level binding the children shadow with a local of the same name
(also red on main: the chunk keeps it by name and its export collides).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The client route tree pins read the route generator's crawl through
Start internals (pruneServerOnlySubtrees). They now build an app with
Start's Vite and Rsbuild plugins (one build per bundler, a route file per
row) and read the client build's route tree, so a fix anywhere in Start's
wiring flips them (rubric-start item 8). Rsbuild does not prune the client
route tree at all, so the pruning control is Vite-only and the page rows
pass on Rsbuild.
New pins (lost-cases-campaign item 1): route options wrapped in
`as never`, `as any` or `satisfies` keep their server handler code
in the client bundle with both bundlers (red: marker eager).
The prerender rows stay at generator level: the build harness has no
preview server, which Start's prerender step needs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- pipeline's out-of-order .fails pin: same root cause and stronger dev
server pin in known-bugs-dev-server.test.ts (DV8, 'compiles the shared
module and chunks requested before the route module'); its precondition
also required a shared module, so it was not fix-agnostic.
- route-hmr 'leave a module that creates no route as it is': merged into
pipeline 'modules that are not route files' (now with and without HMR).
- router-plugin-context 'does not add HMR code in $mode': merged into
route-hmr 'route modules compiled without HMR' (both modes, every route).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- a module-level element passed as fallback (with and without
split={false}) is stripped on the server and reaches the client boundary
- the when prop (strategy calls with options, a prop, a local, a
conditional, a custom function) reaches the boundary in both
environments, children rendered through their chunk
- a dynamic split={flag} still splits and hydrates like the server renders
- the this/super rejection only has to name what the children read
- the vacuous invalidation test is replaced by the reachable edge: Rsbuild
loading a chunk with the edited source before the parent recompiles
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Error-fixture tests now fail when the generator does not throw
(rejects.toThrow); the route-tree directory test runs once instead of once
per fixture folder; option keys are asserted through what generator
plugins receive after a full run instead of transform() internals; the
template tests scaffold empty route files with quotes in their paths (pins
the Vue template breaking on them); adds a CRLF generator run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- handle-route-update runs each update through a route file compiled by
the route HMR plugin instead of the internal getHandleRouteUpdateCode([])
(AGENTS.md line updated).
- Parenthesized route factories and two router plugins in one dev server
are asserted through loading the routes, not plugin internals.
- The shared JSX component test checks identity and covers non-ASCII
names; pins _Widget/$Widget/éWidget being duplicated per chunk (main bug).
- Drops the vacuous esbuild row of the HMR production check; low-severity
rewrites (run counts instead of text search).
- Lost cases from the #8504 campaign: enum/namespace direct reads, merged
namespace, type-only readers and reassigned lets copied into chunks, F-06
in the route HMR plugin, aliased createFileRoute, options from a call, two
file routes in one module, classic factory imports, two-space @jsx,
'export { Page as default }', exported const component, component shared
by two split options (hint-dependent), exported component another route
renders, cast route options with server handlers, parameter decorators
(pins); type arguments, side-effect initializer shapes, duplicate Route
refusal, exported component next to a shared helper (passing).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The known-bug pins on captured values and module-level code (and the
hooks goal) now also require every lazy chunk to render, so a fix that
silently leaves the boundary unsplit cannot flip them. Re-verified the
id-shift pins (each row red on a shifted id or the removed boundary's
children) and added the row the gap analysis found missing: a component
with a boundary that only a removed server fn handler renders.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SSR factory-edit control and pins asserted "calls the handler through
its RPC" as the absence of db.x() in the SSR transform. User ruling P2
allows SSR to keep the handler in place, so they now assert what SSR code
and HTTP calls observe: after the edit, the SSR export is a server fn with
an id, calling it runs the handler, and the server fn resolver runs it for
that id. The pins stay red for the stale transform (no id; the resolver
rejects "Invalid server function ID: undefined") (rubric-start item 11).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pin and its control waited a fixed 15 s for the client transform. The
harness now reports a hang once the transform has made no progress for
1.5 s (no plugin hook ran and the main thread stayed idle; a dependency
optimizer bundling keeps it busy), capped at 15 s. Checked both ways: red
with 'hang' on main, and green with a scratch fix that skips loading
pre-bundled dependencies.
Both tests now assert the outcome instead of the printed createClientRpc:
no handler body in the client transform, and the served module evaluates
with fn as an RPC carrying its id (rubric-start item 6).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hydrate split-module tests now load the page with its chunks
(loadClientModule) and require the children to render through them,
instead of rendering a chunk alone or reading strings of the output.
Initialiser timing is no longer pinned (only that the chunk's imports are
not linked before the chunks load, and the initialiser runs once). The
server fn chunk test calls the RPC from the rendered chunk and runs it on
the server by that id. Removes helpers no test needs anymore
(getBoundaryIds, evaluateHydrateParent, parentImportSources) and harness
controls for an unreachable config and a deleted optimisation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Harness: loadRoute labels each lazy module by the route options whose
loader imports it (found by probing the import, not by export names) and
gives chunkOf(option) and importFromRoute(source); compileRouteModules no
longer guesses roles; tests use declaredNames instead of the declarationOf
regex; buildAndRun apps no longer inherit this package's
"sideEffects": false (a sideEffects option sets the hint).
Tests: placement and exact-import assertions of the dead-code, scope,
imports-exports, module-state and route-options suites become rendered
outputs, loader values and init counts, keeping only negative 'module does
not import/declare X' checks; split chunks are no longer evaluated alone;
route module exports are checked through an importing module (P1 ruling);
the D5 and NODE_ENV pins no longer depend on export lists or warning text;
the build-harness warning control no longer relies on an unsplittable
export; same-file route factories and IIFEs are asserted split and
hot-updated (main does), with fix-agnostic pins for factory routes main
breaks; the stale hot-data test runs the real flow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
probeDynamicImports names the module each dynamic import a function starts
targets without loading it, so a harness can tell which module a lazy value
loads. declaredNames lists runtime declarations from the syntax tree (every
declarator, destructured bindings, enums, namespaces), where the
declarationOf regex misses later declarators and destructuring.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In the SSR build, the Start compiler resolves the module's createMiddleware
import through the Rsbuild loader context, which does not match the
import-only exports of @tanstack/react-start: PackagePathNotExported.
.fails on Rsbuild, passing on Vite (lost-cases item 3, BS-6 / K-13).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One app per bundler (Vite and Rsbuild, through Start's plugins), built once
for all rows: a server fn handler, a function middleware's .server() and
validator, an isomorphic fn's .server(), a server-only fn, route
server.handlers / headers / ssr (Start's own router plugin wiring), a
server fn of a split route file, a server route, and a request middleware
of src/start.ts each import a module carrying a marker. The marker is
nowhere in the client output and the SSR build runs the code. All rows
pass on main for both bundlers (holes C1, C2, C3).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Start build harness now builds through Start's own plugin of each
bundler (tanStackStartVite / tanStackStartRsbuild with React Start's
options) instead of the Vite compiler plugin alone: Start's environments,
compiler, import protection, router generator and code splitter, and
generated server fn resolver. buildStart({ bundler: 'vite' | 'rsbuild' })
describes each environment (where(), run(), warnings) like before; the
stand-in react-start package uses the real package's import-only exports.
Rsbuild's loader paths for the TypeScript sources are shared with the
Rsbuild dev-server harness.
build-harness.test.ts now holds control tests of the harness (where/run,
server fn RPC ids and the generated resolver, route generation and
splitting, warnings, build errors) for both bundlers; its two absence
checks move to start-build-env-separation.test.ts.
Existing build tests get an Rsbuild row: known-bugs-start-compiler (D2, D4,
SF17, D6, #7213), hydrate-build (N19, N20), import protection (#8101 and
its controls, IP5, IP6b). Pins red on Rsbuild for the same reason stay
.fails (D2, SF17, D6, N20, #8101); D4 and #7213 pass on Rsbuild. Import
protection fixtures move under src/ (protection only checks the source
directory), and the N20 fixture's initializer gets a real side effect
(Start's Vite client build inlines and drops an identity call).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Export describeBuild (and the helpers reading Vite bundles and Rspack
stats) so a framework's multi-environment build can be described and run
per environment, with run() reading the entry's exports from a global
for application entries that export nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The `onViolation` option receives `unknown` under the older TypeScript
versions the package is checked with.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds `split={false as boolean}` without parentheses to the split-cast
pin; like the parenthesized casts, main splits the boundary and rejects
its function child ("Hydrate cannot code-split function-as-children").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The invalidation test (compiler) and the Vite dev-server edit test
required the chunk id / URL to stay the same after the children
changed. Content-addressed ids are as valid, so both now take the chunk
the recompiled (or re-served) parent imports and require it to render
the new children.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`/\bthis\b/` also matched the function-as-children advice ("Use
split={false} for this boundary"), so an unrelated rejection satisfied
the `this` row. Both rows now require the message to say the children
capture `this` / `super`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds the N19 row the memo asked for: the chart comes from a barrel
package without "sideEffects": false, which the page imports eagerly.
The bundler finds no side effect in the chart module, so the chart
code is still only in the lazy chunk; the server drops the fallback.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Vite build of a page with two boundaries, each rendering a component
of its own module: neither component is in the eager code, each is in
one lazy chunk, the two chunks differ, and the SSR build renders both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`<Hydrate children={<Chart />} />` was only exercised by the goal pins
that require its children to be deferred. A passing test now checks
both environments render it the same (`<section>[chart]</section>`,
same boundary ids).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
renderPage (hydrate-captures) and the split-chunk render tests only
compared the rendered HTML, which an unsplit boundary renders the same.
They now also require at least one lazy chunk, every one rendered
(new helper expectRenderedThroughChunks). With splitting disabled in
loadClientModule (scratch, removed), 40 of these tests fail instead of
15.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every row of the server and client fallback tables now passes `when`,
and both environments must hand it to <Hydrate> unchanged. A new
direct-attribute row also passes `prefetch` and `onHydrated`, which must
reach the boundary in both environments.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nothing in the package references prettier since the snapshot formatter
that used it was deleted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Rsbuild dev-server harness can now run Start's import protection on
the client environment (its loader runs through a JavaScript stand-in
that delegates to the TypeScript loader). A client module of each
JavaScript extension (and a .ts control) that imports a .server file is
reported as a file violation, and the server value stays out of the
client output. This replaces the coverage of the deleted loader-rule
test (`test: /\.[cm]?[tj]sx?$/`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
evaluateCompiled gave the compiled module both `import.meta.viteRsc` and
`import.meta.rspackRsc`, so a transform that ignored `loadCssExpression`
still passed the Rsbuild provider-only test. Only the provider the
configured expression names is defined now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The usage-location harness now follows the Vite plugin's lookup
(resolveImporterLocation): no violation when the compiled module no
longer imports the denied source, else the use found in the compiled
code through its source map, then the unsafe use in the original code,
then the import statement. It used to call only the original-code
fallback, so the compiled output was never consulted.
Through it, the namespace-import (`Start.createServerFn().handler`,
`Start.createServerOnlyFn`) and immediately-invoked-handler cases report
no violation, so they become rows of the safe-boundary table and their
pins, the loosened test and the namespace control are deleted. The
`myServerFn` object case is reported at the real use and becomes a
passing test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Rsbuild half of N18: Rsbuild serves bundles, so a chunk is only built
through its parent's import; an edit of the file reaches the chunk.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It read the names of the props a chunk component reads. Its only users,
the captures tests, now render the parent with its chunks
(hydrate-captures.test.ts).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
known-bugs-hydrate.test.ts 'a hook called through a namespace in the
children is rejected' accepted only a rejection. It is now a row of
hydrate-boundary-forms.test.ts 'hooks called by the children' ('a hook
called through a namespace in the children runs in the parent render, or
is rejected clearly'), which also accepts the hook running in the
parent's render.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 'a self-closing Hydrate with a children prop renders nothing next to
its boundary': its regex accepted main's bug; covered strictly by
known-bugs-hydrate.test.ts 'children passed through a children prop of a
self-closing element render without unused chunks'
- 'split="false" keeps function-as-children in place': moved into
hydrate-boundary-forms.test.ts 'split={false}' (row 'the string
"false"', both environments)
- 'invalidating a module in an environment without Hydrate sources is a
no-op': an internal return value, no behaviour
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its last users, the hydrateWhen snapshots, are gone (the other snapshot
suites were deleted with the Start compiler tests).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It ran the Hydrate transform directly with Babel types and snapshotted the
printed output. What each fixture and test is for is covered by an outcome
test:
- Basic -> hydrate-split-modules.test.ts 'modules and bindings only the
split children use are not needed before the chunk loads', 'server:
bindings only the stripped fallback uses are removed', 'a boundary with
a direct prefetch prop preloads its own chunk'
- Multiple -> hydrate-split-modules.test.ts 'boundaries in conditionals and
callbacks hydrate like the server renders them', regression-helpers.test.ts
'compileHydrate orders chunks like their boundaries in the source'
- Nested (and its virtual-module snapshots), 'should extract virtual
modules and keep nested ids stable' -> hydrate-boundary-forms.test.ts 'a
nested boundary and a later sibling hydrate with the ids the server
renders'
- Never -> hydrate-split-modules.test.ts 'split / split="true" splits the
children' (the transform ignores when)
- NoImport, NotFromTanstack, WrongImportName -> hydrate-boundary-forms.test.ts
'elements that are not the Start Hydrate'
- ObjectFallback -> hydrate-boundary-forms.test.ts 'the server strips the
client-only fallback'
- PrefetchState -> hydrate-split-modules.test.ts 'a prefetch callback
updates the state of the parent component'
- Renamed -> hydrate-boundary-forms.test.ts 'a renamed import of Hydrate is
a boundary'
- SplitFalse -> hydrate-split-modules.test.ts 'a split={false} boundary
loses a fallback passed through a spread too', hydrate-boundary-forms.test.ts
fallback row 'a direct fallback with split={false}' and 'split={false}'
- SplitFalseFunctionChild -> hydrate-boundary-forms.test.ts 'split={false}'
- generated lazy names next to globals -> hydrate-captures.test.ts 'a
global named like a generated binding keeps its value'
- captured local components and values -> hydrate-captures.test.ts 'the
children render a local component and read a local value'
- client extraction errors -> hydrate-boundary-forms.test.ts 'children that
cannot be split', 'hooks called by the children', 'this and super in the
children' (the super fixture read a class field; the new one reads a
getter)
- server extraction errors -> deleted: which environment reports is
mechanism; the tests above compile both and accept a rejection from
either
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It ran the Hydrate transform directly with Babel types, bypassing the
Start compiler, and asserted printed output. Each test is covered by an
outcome test:
- spread declared after its function -> hydrate-boundary-forms.test.ts
'the server strips the client-only fallback' (row 'declared after the
component', server and client)
- parenthesized split={(false)} -> hydrate-boundary-forms.test.ts
'split={false}' row 'a parenthesized false'
- parenthesized spreads, computed ['fallback'], server strips fallback ->
hydrate-boundary-forms.test.ts 'the server strips the client-only
fallback'
- no preload callback for known props -> deleted (optimisation); preload
wiring is hydrate-split-modules.test.ts 'a boundary with … preloads its
own chunk'
- parenthesized function child / hook call, function-as-children, hook
calls -> hydrate-boundary-forms.test.ts 'children that cannot be split'
and 'hooks called by the children'
- splits behind a lazy import -> hydrate-split-modules.test.ts 'modules
and bindings only the split children use are not needed before the
chunk loads', 'boundaries in conditionals and callbacks hydrate like the
server renders them', known-bugs-hydrate.test.ts harness controls
- Solid import source -> hydrate-boundary-forms.test.ts 'Solid: a Hydrate
of @tanstack/solid-start splits with the Solid packages'
- nested boundaries, sibling ids after nested -> hydrate-boundary-forms.test.ts
'a nested boundary and a later sibling hydrate with the ids the server
renders'
- supplied bundler code -> hydrate-split-modules.test.ts 'a Solid chunk
loads from the code the bundler supplies'
- shorthand and computed captures -> hydrate-captures.test.ts 'the
children read locals through a shorthand property and a computed member'
- exported declarations -> hydrate-split-modules.test.ts 'exported
declarations of every form used by the children render', 'an exported
component of a route file renders in the chunk, and the route is created
once'; goals in known-bugs-hydrate.test.ts and hydrate-build.test.ts
- invalidated source -> hydrate-boundary-forms.test.ts 'after the module is
invalidated and compiled again, its chunk ids render the new children',
hydrate-build.test.ts 'a chunk requested before its parent module…'
- mismatched source hash -> hydrate-split-modules.test.ts 'the chunks of a
module stay loadable after another module is compiled'
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- build: the children's modules load lazily and the server build drops the
fallback, with the chart in a project module or a sideEffects-free
package (N19)
- build: an export only the children use loads lazily when its
initializer can be dropped; goal pin that a side-effectful one is
reported (N20)
- dev: a chunk requested before its parent renders, and an edit of the
file reaches it (N18)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Server fallback removal in every form (N2), split={false} forms (N3),
function children rejection (N4, optional Solid goal), hooks / this /
super loosened tests with goal pins (N5, N6), nested boundary parity with
a later sibling (N7), renamed import (N9), elements that are not the
Start Hydrate (N10), Solid (N11) and recompiling after invalidation
(N17). They replace hydrate-when-transform.test.ts and
hydrateWhen.test.ts, which call the transform directly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- recursive boundaries: client ids and output equal the server's
(renderBoundaries with concrete data) instead of counting printed ids
- match by binding: the local-Hydrate bug pin stays, the namespace row
becomes a goal pin next to a passing regression test
- await: valid output that renders the awaited value is accepted too
- Route: table of the #8504 rows (one route created), the unexported
Route pin (clear error or one route)
- boundary-id shift: isomorphic .client() and createClientOnlyFn rows (N16)
- exported declaration initialized once (goal of the copied exports)
- the rejection-matcher control uses a function child
- new pins for #8504 ports red on main: local component names, member
tags, property-name TDZ, local enum, multi-line JSX text, string
children prop, default export, module enums/namespaces, written-only let
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- children-only modules are not linked before the chunk loads (instead of
declaration placement and import lists)
- conditionals and callbacks: client ids and output equal the server's
- preload wiring by calling the preload a boundary receives (N8, with the
hydrateWhen Basic and PrefetchState fixtures)
- server fn called from the chunk: run through the reported server fns
instead of the generated handler name
- shared and call-returned spreads loosened to render checks, with the
shared-spread fallback goal (N14)
- recompiled chunk ids render instead of matching id formats
- ports of #8504: directive prologue, exact JSX text, return statements in
handlers and IIFEs, self-closing rows, children prop goal, chunk source
map, exported declarations, the loosened route-file export test (N13)
Rows red on main are pinned in known-bugs-hydrate.test.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every captures test renders the parent once its chunks have loaded and
compares with the original output, instead of reading the chunk props by
name. Adds the rows of hydrate-when-transform.test.ts (shorthand and
computed members), hydrateWhen.test.ts (local component, generated names
next to globals) and the #8504 label row. The #8504 rows red on main are
pinned in known-bugs-hydrate.test.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
loadClientModule validates the parent and the chunks against the globals
the source itself reads, and no longer asks the Hydrate plugin for the
extension-probe ids of the module linker. The hydration stubs export every
strategy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"registers a post loader instead of an Rsbuild transform" pinned the Rspack
rule shape. The behaviour it serves (on Rsbuild, only imports that survive the
Start compiler are flagged) is covered by
e2e/react-start/import-protection/tests/import-protection.spec.ts "compiler
leak violation includes line/col in importer", "no false positive for
boundary-safe pattern" and "no false positive for factory-safe middleware
pattern", run in the rsbuild-ssr mode (11 passed locally).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deleted, with the tests covering their results:
- reuses cached per-result index without changing results: the cache field
is internal; sourceLocation.test.ts "finds first matching import location
across static and dynamic forms".
- reuses a lazily created original transform result: identity caching;
sourceLocation.test.ts "prefers original usage site over import site when
original code is available".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deleted (they matched generated names such as __tss_deny_0 and
__tss_reexport_foo): named, default, namespace, aliased and mixed imports,
type-only specifiers next to value specifiers, `export { x } from`, aliased
re-export, string-literal import and re-export names. All are covered by
rewrite.test.ts "rewritten modules evaluate with mock values for every
specifier form", which evaluates value, def, ns, `value as renamed`,
`type T, value`, reexported, `reexported as aliased`,
`reexported as "string export"`, `"kebab-name" as kebab` and
`"a-b" as ab` in one module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deleted, with the tests covering their behaviour:
- prefers call usage over earlier non-preferred identifier usage: any real
use is a correct location; analysis.usage.test.ts "finds preferred call
usage for named import" and "falls back to non-binding identifier usage
if no preferred usage exists".
- repeated lookups on one transform result return the cached position:
caching is not behaviour; results are covered by the findPostCompileUsagePos
rows and sourceLocation.test.ts "prefers original usage site over import
site when original code is available".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deleted, with the tests covering their behaviour:
- ignores type-only imports: a type-only import is not an import edge,
importProtection/utils.test.ts "skips type-only static import sources".
- ignores type-only re-exports: utils.test.ts "skips type-only re-export
sources".
- sorts output alphabetically: no user-visible behaviour (mock-edge ids are
internal); validity of the mocks: analysis.exports.test.ts "an importer
evaluates with mocks for what it uses".
- returns empty map for code with no relevant imports: utils.test.ts
"returns empty array for code with no imports".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A route's server fn calls a helper module (not the server fn file) that
renders a server component with a CSS module through renderServerComponent
(R-E1, C9). Its styles apply on Vite. On Rsbuild the CSS transform only
rewrites server fn provider modules, so the card renders unstyled: pinned with
test.fail for the rsbuild toolchain. routeTree.gen.ts regenerated by the build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
evaluateCompiled now links compiled modules with the module linker
(@tanstack/compiler-test-utils, new devDependency; lockfile regenerated) in
place of a regex specifier swap, and every test asserts evaluated values: the
CSS envelope the runtime receives, the streamed payload, recorded render
calls. Inline snapshots and kind labels are gone.
- Import forms (named, renamed, namespace) x both specifiers x the three APIs
(R-N1); the client compile loads no CSS; provider-only Rsbuild transforms
evaluated; wrapped JSX streams the CSS.
- Dev server (R-N2): with the Start compiler plugin set up like the RSC
integration, only the rsc environment loads CSS.
- Loosened: calls outside the transform constraints keep their arguments.
- D8 goal pins (.fails): renderToReadableStream(<JSX/>, options) streams the
CSS and keeps the options; all-JSX conditional and logical arguments stream
the CSS; in dev, an identifier or spread argument warns naming
renderToReadableStream. Passing: no warning in a build, and none for a
plain-data model.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New importProtection/build.test.ts (Vite Start build): the #8102 re-export
barrel test moves here from known-bugs.test.ts (it passes: no false negative
on Rolldown), and a file with both a server-only and a client-only marker
fails the build (gap IP5, N11).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a Vite dev server with import protection, a client module evaluated as the
browser loads it gets mocks for the names it imports from a denied file or
specifier (control, N7). Goal pin (IP12, N6): a name another module
re-exports with `export *` from a denied module is a mock too, or the server
warns about the `export *`; today the importer fails to link, for denied
files and specifiers alike.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- export * as ns: the pin now requires ns.secret to be the mock, not only a
defined ns.
- Start namespace boundaries: moved onto real Start compiler output and the
plugins' usage lookup (with a control), so any fix is accepted.
- delete: evaluated through the mock helpers; asserts the name is exported,
not mock identity; the prescribed fix is dropped.
- #8101: control that the client bundle drops the module without import
protection (N8), and a build failure other than the import-protection
error no longer satisfies the pin.
- New passing rows: a JSX pragma or legal comment after a directive stays in
effect (ported from #8504).
- New build test (N9, #8102): a denied re-export barrel the client uses fails
the build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rewrite.test.ts evaluates rewritten modules with the module linker, so
project imports resolve: a non-denied import keeps its real value, each denied
source gets its own mock, and code after a rewritten import maps back through
the source map. The every-form evaluation test gains an identifier-alias import
and re-export.
Loosened: `export * from` a denied module only has to evaluate without
loading it (goal pin: dev server). New .fails pin, ported from #8504: a module
declaring the name of the mock import.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The safe-boundary rows of analysis.usage now compile the module with the
real Start compiler for the environment and look the use up the way the
plugins do (findOriginalUsageLocation), so a compiled-output implementation
passes as well as today's name heuristic (N4). Real server fn and middleware
values replace the name-only rows.
Loosened: the immediately invoked handler argument (reported at most at a
denied reference), with a .fails goal (no use reported). New .fails pins: an
object named like a server fn, a member property named like the import, type
positions, JSX element uses (the last three ported from #8504).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the name-list assertions of analysis.exports with evaluated mocks:
every importable name is exposed by each generated mock module (N1, replaces
the isValidExportName tests), an importer of a denied module links and gets
mocks for what it uses (N2), and the self mock of a denied file exposes the
exports of the evaluated file (N3).
New .fails pins: the empty export name, reserved names (delete/eval/
arguments), a namespace member read before its import, and namespace
re-exports, enums and namespaces in the self mock (ported from #8504).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Callers get an RPC of the outer server fn and the provider runs its
handler; red on main (the provider exports an undeclared handler).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pin a createMiddleware alias declared in another module (red on main).
The export * cache, namespace import and re-exported Start namespace pins
now also require the client to call an RPC and the provider to run the
handler; the builder-in-another-module rows check what the evaluated
client does. Each tightened pin has a passing control in the same harness.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run the client and SSR transitive-importer pins through a module that
re-exports the factory with an import and an export, next to export *.
Both rows are red on main for the same bug.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The existing handler-edit test passes without the provider's HMR accept
code (the caller module reloads the server either way). Editing a module
only the handler reads must hot-update the provider without a full reload
and the handler must run the new code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The factory and inline isomorphic fn tests now read ./x.server in server
implementations and ./x.client in client ones; each output imports only
its own. Add an isomorphic fn called at the module top level.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A createClientOnlyFn returned by a function or an arrow function runs on
the client and throws on the server, whose output does not import the
client-only module. Replace the vacuous toHaveProperty('server') check of
the default-exported middleware with its recorded options.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The createServerFn construct of the import-forms table now passes
{ method: 'GET' }: the evaluated client and SSR server fns keep it as their
options. Add a 'call result wrapped in satisfies' form.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
router-plugin no longer uses prettier. router-utils has no tests: remove
its test:unit script, the vitest test config and devDependency, the tests
entries of its tsconfig, and its row in the compiler platforms unit test
run. Lockfile regenerated with pnpm install.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With verbatimModuleSyntax, 'import { type Db } from ./db.server' is kept as a
side-effect import; the client output of a file the compiler transforms
must not load the server-only module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add 'import type * as' and 'export type * as' to the TypeScript-only rows
of the code splitter and the Start compiler.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Delete the Vite rows of the production 'no route HMR code' tests (Vite
replaces import.meta.hot in builds and drops the guarded code) and the
window assertion of the router plugin context no-HMR test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add hotUpdate rows for an unsplit route with all five component options
(each keeps its identity) and for an update that adds a shellComponent
(the live component is the new module's). Drop the root route's
isLazy('component') assertion, which pinned the root-never-split
limitation, the unused ./posts stub and the vacuous window assertion of
the no-HMR rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Load the compiled route module twice with a Vite hot context and run
plugin-react's validateRefreshBoundaryAndEnqueueUpdate on the two export
sets, for a route, an undefined component and a root route, with the code
splitter and the route HMR plugin. Every export the runtime does not ignore
must be a registered component.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- start-compiler-factories.test.ts "dev: modules reaching a factory through
imports and export * are its transitive importers" (REPLACE, internal
getTransitiveImporters and `?v=1` handling): the user-visible outcome is
known-bugs-dev-server.test.ts "SSR: a module importing an edited factory
module through a re-export calls the handler through its RPC" (N15, red
on main: pinned) with its direct-importer control, and the client pin
"client: a module importing an edited factory module through a
re-export loads no server code" (kbd:102)
- server-fn-resolver-module.test.ts "imports on every call by default" and
"keeps the imported module when memoizeModules is set" (REPLACE,
generated source text): start-compiler-dev-server.test.ts "SSR: the
server fn resolver runs the edited handler under the same id, without a
restart" (N16); memoization in builds is a performance detail
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Snapshot fixtures -> covering tests:
createMiddleware (client):
- create-function-middleware: "a function middleware keeps .client() and
drops .server() and its imports" (N3)
- createMiddlewareDestructured: N3 ".server() given a function expression,
an arrow, an identifier or a wrapper call ..."
- createMiddlewareDestructuredRename / createMiddlewareStarImport:
start-compiler-import-forms.test.ts (N1) "createMiddleware through a
renamed import / a namespace member"
- createMiddlewareValidator: N3 "the validator and its module leave the
client"
- createStart: N3 "middleware of a createStart instance ..."
- middleware-factory: N3 "a middleware built inside a function ..."
createIsomorphicFn (client, server):
- call-at-module-level: start-compiler-factories.test.ts "a
default-exported function" iso row (fac:60) and "isomorphic, server-only
and middleware implementations in one module" (fac:143)
- createIsomorphicFnDestructured: N2 "one implementation, both orders and
function references"
- createIsomorphicFnDestructuredRename / StarImport: N1
- createIsomorphicFnFactory: N2 "isomorphic fns returned by factories"
- createIsomorphicFnInline: N2 "isomorphic fns created and called inside
functions"
envOnly (client, server):
- envOnlyDestructured: fac:28 "each output keeps the implementation of its
environment"
- envOnlyDestructuredRename: fac:28 (`createClientOnlyFn as clientOnly`) and
kb "expectServerOnlyRead accepts a top-level renamed createServerOnlyFn"
(kb:244 control row 2)
- envOnlyStarImport / envOnlyExportedAlias: N1 (namespace member; renamed
import with the call result wrapped in `as`)
- envOnlyFactory: fac:123 (in a class method) and kb:244 control row 1 (in
a function body)
clientOnlyJSX (server): the five TanStack fixtures -> N4 "a boundary with
$name renders its fallback on the server and its children on the client";
clientOnlyNotFromTanstack / clientOnlyWrongImportName -> N4 "the server
renders the children of $name"
Deleted tests:
- createMiddleware "should compile validator method" (inline snapshot,
REPLACE): N3 validator test
- createMiddleware fast path / slow path (resolveId calls): performance
mechanism; a middleware builder finished in another module is pinned at
kb:338, the module-level case is fac:253 row 1
- ClientOnlyJSX "should not be detected on client" (REPLACE) / "should be
detected on server": N4 client and server renders
Kept: createMiddleware "requires an argument for validator()" (now compiled
with the production configuration), the start-client-core middleware
resolution tests, the "implementation not provided" errors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Snapshot fixtures (client, server-caller, server-provider) -> covering tests:
- createServerFnDestructured: handler-scope.test.ts "the handler can be
$name" (named function expression, wrapper call, function declared after
the server fn), caller-dead-code.test.ts "when the handler only reads it
through a validator or a middleware" (cdc:334), exports-and-directives
"callers keep every export form ..." (id parity, ead:27)
- createServerFnDestructuredRename: start-compiler-import-forms.test.ts
(N1) "createServerFn through a renamed import"
- createServerFnStarImport: N1 "createServerFn through a namespace member";
its 'use server' handler directive: "handler directives stay in the
provider" (ead:206)
- createServerFnValidator: cdc:334 (client drops the validator module, the
provider keeps it)
- factory: "a server fn builder with middleware is callable as a factory"
(N5)
- isomorphic-fns: "a route file: the provider runs the server fns, each
output runs its isomorphic branch" (N6)
Deleted tests -> covering tests:
- "should compile validator method" (inline snapshot): cdc:334
- "should work with identifiers of functions": hs:41 row "a function
declared after the server fn" (identifier handler run by the provider,
callers evaluate to RPCs); id parity ead:27
- "should remove imports used only as caller handler identifiers"
(REPLACE): hs:41 row "an imported function" (N10)
- "should use dce by default": cdc:498 "callers drop handler-only cycles",
cdc:540, hs:41 (provider runs each fn); whether an unused unexported
server fn is extracted is left open
- "fast path / slow path (resolveId calls)": performance mechanism; the
factory alias behaviour is start-compiler-factories.test.ts row "a server
fn factory const-aliased in another module" (N9)
- "should resolve local named re-exports": fac:253 row "renamed re-exports
next to a type-only re-export"
- "should resolve export-star re-export chains": fac:347 "an export * chain
with $name" and fac:253
- exports-and-directives "dev ids encode the provider module and the
handler export" (internal id format): known-bugs-start-compiler.test.ts
"calls a server fn id on the dev server that compiled its module" (kb:1417
control, id -> getServerFnById -> handler) and
start-compiler-dev-server.test.ts "the server fn resolver runs the edited
handler under the same id" (N16)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deleted, each with its covering test (memo start-compiler, compiler.test.ts):
- detectKindsInCode unit tests (12 DELETE): per-kind detection and multiple
kinds are covered by start-compiler-factories.test.ts "each output keeps
the implementation of its environment" (fac:28), "isomorphic, server-only
and middleware implementations in one module" (fac:143), "compiles a
server function through a parenthesized namespace receiver" (cmp:1430),
"removes server-only code through a parenthesized namespace" (cmp:1441),
"a module that $name is left untouched" (fac:197 rows) and the builder
module rows of fac:253 / kb:284; the text pre-filter they pinned is the
root cause of the kb:338 pin
- "resets external transform regex state between detections" (REPLACE):
"a transform whose detect pattern has the g flag runs for every module it
detects" (N8)
- ".handler whitespace variations" / "whitespace between . and handler"
(REPLACE): createServerFn.test.ts "a handler called with $name is
extracted" (N7)
- "server environment excludes Middleware from detected kinds": fac:143
(SSR keeps the middleware and evaluates it)
- "edge cases for detectedKinds" (3): internal host parameter, no
user-visible behaviour
- "compile caches modules without detected candidates for transitive
importer traversal" (getTransitiveImporters return value): the
user-visible outcome is known-bugs-dev-server.test.ts "SSR: a module
importing an edited factory module through a re-export ..." (N15 pin,
with its direct-importer control) and the client pin kbd:102
- "ingestModule populates module metadata": "re-exported
createServerOnlyFn still resolves correctly" (same start-client-core ->
start-fn-stubs chain, evaluated) and the fac:253 rows
- "invalidateModule preserves root lookup metadata": merged into
"invalidateModule clears cached module resolution state" (production
lookup configuration)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- N16 (start-compiler-dev-server.test.ts): an edited server fn handler runs
through the dev resolver under the same id without a restart (replaces
the resolver module source checks and the HMR half of ead:291; gap DV24)
- N17: a module importing a factory that stops being one keeps its handler
in the client (mirrors rsbuild/dev-server.test.ts)
- N15 (known-bugs-dev-server.test.ts): the SSR variant of DV26 is red on
main (transitive importers through export * keep their old transform);
pinned next to the client pin, with an SSR direct-importer control
- bh:11 REWRITE: the handler is nowhere in the client build and somewhere
in the SSR build; whether it loads eagerly or on demand is left open (the
SF17 fix may make it eager)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- kb:414 FIX PIN: the support branch also requires the evaluated client
`fn` to be an RPC and the provider (through the reported server fn) to run
the handler; the rejection branch stays
- kb:454 FIX PIN: a clear compile error naming the computed call is a valid
outcome; otherwise each construct follows its contract (server fn RPC,
middleware evaluates without .server(), isomorphic fn returns 'client'),
not only "no server import"
- #8504 cmp:1605 (shadowed parenthesized namespace receiver, server fn
variant): passes on main with the kind detection the bundler plugins run,
so it is a passing test in compiler.test.ts, not a pin
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- N1 (start-compiler-import-forms.test.ts): createServerFn,
createMiddleware, createIsomorphicFn, createServerOnlyFn,
createClientOnlyFn through a renamed import, a namespace member and an
`as`-wrapped call result, and <ClientOnly> through a renamed import and a
namespace member, for React, Solid and Vue: the client keeps no server
import and each output follows its runtime contract (RPC + provider,
branch, throwing stub, fallback). Pinned (red on main): <Router.ClientOnly>
through a namespace import is never compiled (SSR runs the children).
- N5: a callable builder chain with middleware (factory fixture): client
RPCs keep their middleware chain, the provider runs both handlers, a
look-alike `.handler` is untouched
- N6: a route file (isomorphic-fns fixture): the provider runs both server
fns (validator chain included) without React, each output's loader runs
its isomorphic branch
- N7: `.handler(` spacing/newline/tab/comment variants, with the builder in
the module and in another module (#7280 class). Pinned (red on main): a
comment after the dot hides an imported builder's server fn.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- N3 (createMiddleware.test.ts): the client keeps .client() (recorded by
the runtime stub) and drops .server() / .validator() and what only they
read: function middleware, the four .server() argument forms, validator
module (MW2), middleware built in functions, createStart().createMiddleware
(MW5); mw:116 rewritten to evaluate the recorded .client()
- N2 (createIsomorphicFn.test.ts): one implementation / both orders /
function references / noImpl, factories, created and called inside
functions; client and SSR evaluated, the other environment's referenced
function absent
- N4 (clientOnlyJSX.test.ts): SSR renders the fallback and drops the
modules only the children import, the client renders the children;
ClientOnly of another package and another router component imported as
ClientOnly keep their children
Runtime stub: a server runtime (createServerGraph, evaluateModule
`env: 'server'`) records middleware .server(); createStart(...).
createMiddleware is stubbed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
createServerFn.test.ts:
- cfn:129: diagnostic location matched frame-agnostically (line 2 and the
quoted source on one line)
- cfn:266: the client keeps a handler identifier it still reads (evaluated
`ref`), the provider runs the handler
- cfn:539: query-bearing virtual module ids resolve the factory (client has
no handler body, one server fn reported); loadedIds no longer pinned
- cfn:711: a constant generateFunctionId (ignores functionName) still gives
distinct ids, the same ones in a second compiler instance, and client RPC,
SSR RPC and provider meta.id agree
- cfn:879 -> N14: compile, generate the production resolver from what the
callers reported (client-referenced check on), link it to the provider:
a client-compiled server fn is callable from the client. The former
server-environment row asserted that every server-env caller reports its
server fns as client-referenced, the D6 bug; it becomes the RSC-provider
goal pin below.
D6 (user ruling: only server fns client code references are HTTP-callable):
- build pin (kb, Vite build, SSR provider): a server fn only server code
references resolves with origin 'client' (red: "server-only fn" instead of
rejected); control: the client fn is HTTP-callable and the server-only fn
callable from SSR code
- RSC-provider pin (createServerFn.test.ts): a server fn only a server
environment compiles passes the resolver's client-origin check
Harness: buildStart takes per-build entries; the stand-in createSsrRpc
exposes functionId; createServerGraph().add().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Server fns are found by runtime metadata (meta.name / meta.id) and reported
ids, never by generated export names:
- ead:27: callers' exports evaluate to RPCs carrying the id of the provider
handler whose meta.name is the local; one handler export per reported
server fn; callReportedServerFns runs a..f
- ead:190: redeclared var server fns get distinct ids (passing) and each
run their own handler (red on main: both run the last handler; pinned)
- ead:291: dev provider runs the handler (HMR strings dropped; dev HMR is
covered by N16, its absence in builds by N12)
- N12: build providers have no import.meta.hot / webpackHot code
- ead:314: id sets compared (old ids still reported, 3 in total)
- ead:346 / ead:363: handlers looked up by meta.name; 6 server fns reported
ead:180 LOOSEN: callers keep the side-effect import and statement (both run
on evaluation); the provider, linked with the SSR caller, runs the handler
and the polyfill was loaded. Whether the provider repeats the top-level
code is left to the SF17 goal pin (kb "initialised once").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
handler-scope.test.ts:
- hs:41: callers evaluate to an RPC (#8504 shared assertion); new row N10
"an imported function" (replaces createServerFn.test.ts "should remove
imports used only as caller handler identifiers")
- hs:384 renamed: exported helpers are callable from the handler (the
provider may import them from the SSR caller)
- pin (#8504 hs:124, #8446): a createIsomorphicFn chain as the handler
never becomes an RPC
caller-dead-code.test.ts:
- cdc:498 REWRITE: the provider runs the handler-only cycles
(callProvider returns [0, 0, 'id']) instead of declarationOf checks;
keeping unused code is no longer required
- #8504 ports pinned (red on main): enum member / overload parameter /
parameter property named like the import keep the server import; a
validator link wrapped in satisfies / as stays in the callers; a
handler-only function declaring a local of its own name keeps its server
import
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shared table createServerFn/placements.ts: 16 placements (the 10 of the
review plus the #8504 ds:34 extra placements: return value, call argument,
JSX attribute, conditional initializer, object/array destructuring, nested
in another handler) and the capturing placement.
declaration-sites.test.ts:
- ds:30 REWRITE: no-crash guard (valid module or clear rejection), checks
the top-level server fn through callProvider instead of the generated
handler name; the top-level switch row moved to the placement pins
- ds:94 LOOSEN: next to another factory, every non-declarator placement
never ships the handler (expectNoClientHandler; rejection or extraction)
- ds:115: the validator row is its own test (user error, exact message)
- N13 + D13 goal pins (.fails, both import heads): a server fn in each
placement the callers can reach is supported: client and SSR RPCs share
the id the provider handler carries, and the handler runs
- ports: optional call chain (red on main: pinned), .ts module in a #
directory
known-bugs-start-compiler.test.ts (kb:538 FIX PIN): describe.each over both
import heads (kb:602 folded in: declarator placements next to another
factory), the placement rows of the shared table, and the D13 rejection pin
(a nested handler reading a local of its function must be rejected in every
output).
Helpers: expectNoClientHandler moved to regression-helpers.ts;
callServerFnThroughCallers (with self-tests); compileErrorMessage self-test
ported from #8504 ds:168.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rewrites (memo: puc:14, puc:50): side effects checked by evaluating the
client/provider with recording stubs (each initializer runs once on import),
instead of text and declarationOf checks; adds the three #8504 puc:18 rows.
Ports (pass on main): leading legal comment kept (client, Hydrate chunk),
__NO_SIDE_EFFECTS__ annotation (loosened: it leads makeLabel in every output
that declares it), JSX attribute source map column (client, SSR), the
pragma comment of a Hydrate parent in both import orders.
Pinned main bugs (red #8504 ports):
- server fn runtime imports inserted above a leading @jsxImportSource pragma
(client, SSR, provider) and Hydrate chunk loaders above it (Vite 8 picks
the default JSX runtime)
- empty destructuring initializers dropped (client, provider)
- asserted update operands printed without parentheses (parse error)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- missing implementation (fac:225, LOOSEN): SSR and provider reject it; the
client may reject it too or compile to a module that never runs it
- dev invalidation (fac:464, REWRITE): no longer pins the internal
invalidateModules return list
- N9: a server fn factory const-aliased in another module (replaces
createServerFn.test.ts "slow path for factory pattern")
- #8504 port (B): vars nested in top-level and function blocks (extends
fac:177, now evaluated), middleware chains with a wrapped link (3 x 8)
Pinned main bugs (red #8504 ports):
- a validator link wrapped in satisfies / as stays in the client
- an isomorphic chain link wrapped in satisfies / as loses its
implementation
- a factory callee wrapped in `as any` / `!` is left uncompiled (server
implementation ships to the client)
- env-specific fns inside a server fn handler are not compiled in the
provider (client-only fn runs on the server, client module imported)
- parameters and locals shadowing every factory, all outputs (kb, next to
the kb:620 parameter pins)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rewrites (memo start-compiler, compiler.test.ts table):
- multiple kinds in one compiler: each output evaluated (RPC, iso branch,
serverOnlyError, middleware .server() gone)
- external transforms (:462, :482, :518): compiled through the shared
harness with host-like kind detection, the injected argument checked by
evaluating the call
- provider directives (:638, :650): directivePrologue
- ingestModule on empty code (:727): a module importing an empty module
- re-exported / aliased createServerOnlyFn (:848, :886), re-export chain
table (:1004): client and server outputs evaluated
- invalidateModule (:1176) and the aliased provider recompile (:1307):
production lookup configuration, evaluated before and after the edit
- transform phase order (:1459): idle transform may run with no candidates
New: N8 (a g-flag detect transform runs for two modules in a row).
Section-4 ports (#8504): direct calls only (.bind/.call/parameter rows),
unrelated virtual runtime imports (loosened: a throwing host loadModule does
not fail the compile), configured aliases next to an unrelated call.
Pinned main bugs (red ports, known-bugs-start-compiler.test.ts):
- a computed namespace call named by a local variable is transformed
- distinct re-export aliases of two factories conflated (server-only code
runs on the client)
- kb text-detection row: a renamed createServerOnlyFn re-export is never
compiled
Helpers: createStartCompiler accepts compilerTransforms and host overrides;
renderThingTransform and settleAsync.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`test:types` rejected the inferred union of the case tables passed to
`expectExportedRouteOptions`; `ExportedRouteOptionsCase` types them.
`loadRouteOption` returns its promise without `async`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The package's tests exercised internal Babel helpers and parse checks that
compiler-level tests cover (memo hmr-generator, section 2):
- compiler-helpers.test.ts `collectIdentifiersFromNode` / shadowing:
router-plugin code-splitter-scope.test.ts (free identifiers and catch /
var / parameter / import shadowing rows) and start-plugin-core
hydrate-captures.test.ts; `collectLocalBindingsFromStatement` /
`buildDeclarationMap` (named default function / class):
code-splitter-runtime.test.ts "preserves executable route contracts with
shared named-default declarations" and start-plugin-core
createServerFn/handler-scope.test.ts; `extractModuleInfoFromAst`
snapshot: start-plugin-core start-compiler-factories.test.ts (builders
across modules, renamed re-exports, `export *`).
- stripTypeExports.test.ts: `with` attributes: start-plugin-core
exports-and-directives "import attributes are kept on the imports and
re-exports each output keeps"; deprecated `assert` attributes (D9):
router-plugin code-splitter-imports-exports "compiles an import assertion
of a route file into an import attribute"; `.ts` angle-bracket casts:
router-generator transform "parses a .ts route file with angle-bracket
type assertions", router-plugin code-splitter-scope "keeps angle-bracket
type assertions in every module", start-plugin-core importProtection
rewrite "rewrites a .ts module with angle-bracket type assertions"; type
alias / interface removal (no behaviour after type erasure); type-only
imports, exports and mixed specifiers: router-plugin
code-splitter-imports-exports "erases type-only imports and exports from
the split modules", start-plugin-core exports-and-directives
"TypeScript-only exports and an enum next to a server fn" and the
type-only re-export pins of both packages; the #6480 scenario:
code-splitter-imports-exports "drops an import that only an exported type
and a split component read from the route module" and exports-and-directives
"an exported type reading a schema the handler uses keeps its imports out
of the client".
`test:unit` passes with no test files so that tests added later run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The control "the route node of ... is server-only" and the pin "a route with
server handlers and a spread / computed key / method is not server-only"
copied Start's server-only rule onto the generator's option keys, so a fix
reporting unknown keys another way would still fail them. Replaced by
start-plugin-core known-bugs-route-options.test.ts, which runs the generator
with Start's prerender plugin and `pruneServerOnlySubtrees`: "a route with
{ server: { handlers: {} }, component: Page } / { server: { handlers: {} } }
is in the client route tree and prerendered: ..." (controls) and "a route
with server handlers and a spread / a computed key / a method / an async
method / an accessor is in the client route tree" (pins), plus the
prerender pins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- handle-route-update "clears lazy ownership and delegates rematerialization
to the router" (internal `_lazy` / `_refreshRoute`): covered by "uses a
fresh source lazy importer without erasing an omitted one" (the lazy
options load from the fresh importer after each update) and, for the
refresh, "removes stale loader data when a hot route removes its loader",
"observes hot parser and route-context changes on the active route" and
"rematerializes descendants when a parent route definition changes".
- react-refresh-route-components "does not keep a split loader in the HMR
data" (hot-data key strings): replaced by route-hmr.test.ts "a hot update
of a split route > vite|webpack > keeps the split components and applies
the new options (a split loader in its own chunk)", where the live loader
returns the new module's data.
- router-plugin-context "does not install the standalone route HMR plugin in
production" (by plugin name): replaced by known-bugs-route-hmr "a
production client bundle has no route HMR code (vite)".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`tests/format-snapshot.ts` (and its two controls in
regression-helpers.test.ts) and `tests/constants.ts` were only used by the
add-hmr snapshot suite, deleted in the previous commit; no test compares
output with a snapshot anymore.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every point of the suite has an outcome test (route-hmr.test.ts unless
noted):
- `@true` fixtures arrow-function, function-declaration, multi-component,
string-literal-keys and the `@webpack-hot` snapshot: "a hot update of a
split route > vite|webpack > keeps the split components and applies the
new options" (+ "split options under quoted keys like the others");
- solid/arrow-function: "solid|vue: applies the new options with the router
package of the framework" (identity: the D10 pins next to it);
- createRootRoute: "a hot update of a root route > vite|webpack: reaches the
root route, keeps its component and applies the new loader";
- createRootRoute-inline-component: react-refresh-route-components "for
every inline component option of a root route, under distinct names";
- createRootRoute-lowercase-components: react-refresh-route-components "for
every lowercase function component of a root route, under distinct names";
- createFileRoute-lowercase-components: known-bugs-route-hmr "registers
lowercase function components, split and unsplit, with the default
groupings";
- createRootRouteWithContext-type-args: react-refresh-route-components "of a
root route created with context type arguments";
- destructuring: "leave a module that creates no route as it is";
- explicit-undefined-component: "keep an explicitly undefined component
undefined";
- the `@false` snapshots: "route modules compiled without HMR > have no HMR
code and leave window untouched";
- webpackHot / Vite unsplittable AST checks: known-bugs-route-hmr
"vite|webpack: a hot update gives the live route the new options" (and
the Solid/Vue boundary pin);
- lazy reset / `_refreshRoute` strings: handle-route-update "uses a fresh
source lazy importer without erasing an omitted one", "removes stale
loader data ...", "... rematerializes ...";
- generated route id fallback: known-bugs-route-hmr "a hot update gives the
live route the new options" (the new module's `Route.id` is never set);
- "prefers the current generated route id over stale Vite hot data": "is
the route the file is registered under now, not the one in stale hot
data";
- "normalizes the generated root route id": the root route update above
(`routeId: '/__root'`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- known-bugs-route-options.test.ts runs the route generator with Start's
prerender plugin and `pruneServerOnlySubtrees`: controls for a route with
server handlers and a component (kept, prerendered) and one with only
server handlers (pruned); pins for a spread, a computed key, a method, an
async method and an accessor (pruned from the client tree) and for pages
whose component comes from a spread, computed key or method (not
prerendered). Replaces router-generator known-bugs "route options", which
copied Start's rule onto the generator's key set (gap G11; #8504 method
and accessor rows).
- #6480: an exported type reading a schema built from an imported enum
keeps the enum's module out of the client output of a server-fn file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- `evaluateRouteFile` (route-id.ts) evaluates a route file with other router
exports; `routeIdOf` uses it.
- Rewrites: the added constructor import keeps the file's line endings, the
other bindings and the rest of the file, and the route evaluates with its
new id (no exact import merge); multiple Route exports only assert the
error result; a prepended import binds `createFileRoute` once.
- Loosened: option keys are recorded for identifier and string keys
(`arrayContaining`); computed / spread keys are best effort.
- Ports from #8504: options wrapped in `satisfies` / `as` (B), a redeclared
`var Route` with two route calls is an error (B).
- Pins: a moved route whose constructor or id is wrapped in a TypeScript
cast keeps its old id or fails to generate; a type-only `Route` export is
taken for a route instead of being left out with a warning (gap G8).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the directive prologue stays first and whole, and a later string
statement stays out of it, with and without HMR (#8504 router-utils
prepend-statements);
- a syntax error in a route file is reported at its line and column for
every line terminator and Unicode source (#8504 router-utils
diagnostics; bundlers name the file);
- `.jsx` and `.mjs` route files read `a < b > (c)` as JavaScript (#8504
router-utils source-language);
- an import that only an exported type and a split component read leaves the
route module (#6480; replaces router-utils stripTypeExports "#6480
scenario").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New (route-hmr.test.ts), replacing what the add-hmr snapshots proved:
- a hot update of a split route keeps every split component (arrow,
function declaration, two components, quoted keys, a split loader in its
own chunk) and applies the new loader, with Vite and webpack;
- Solid and Vue: the new options apply with the framework's router package,
no React code; D10 goal pins (.fails): the split component keeps its
identity, as with React;
- a root route (`/__root`) is updated in place, keeping its component;
- an update follows the route the file is registered under, not stale hot
data;
- route modules evaluate without `hot.data` or `import.meta.hot` (#7074);
- quoted split keys, a non-route module left as is, an explicitly undefined
component, and no HMR code / untouched `window` without HMR.
Rewrites and loosening:
- handle-route-update: the hot `Route` sees the live route's parent and
options; lazy options load through `router.loadRouteChunk` from the fresh
importer, an update without one keeps it.
- react-refresh-route-components: hoisting tests evaluate what the component
renders instead of checking generated names and placement; the
method-shorthand test is loosened (it keeps working); new root rows
(lowercase function components, `createRootRouteWithContext<Ctx>()`).
- router-plugin-context: chunk ownership after edits is checked by
evaluation with one plugin instance; production / `addHmr: false` by
evaluation and the absence of a bundler HMR API; the duplicated
transform by module validity; option normalisation by the module
accepting its updates and registering its component.
Pins:
- webpack without React Refresh: the harness now also configures the plugin
with a webpack compiler without a refresh plugin, the oracle renders the
live component (new code or `invalidate()`), with a code-splitting row.
- Solid/Vue route modules are HMR boundaries: rewritten on `routerDevServer`
(an edit is a client `update`, not a `full-reload`), with a
`@vitejs/plugin-react` control for React.
- production builds: a Vite row and automatic-code-splitting rows per
bundler (esbuild holds trivially, the esbuild plugin splits nothing).
- goal: a method-shorthand component of a split route is refreshable.
#8504-only ports: inline components wrapped in `as` / `satisfies` / `!`
(red on main, pinned), split `memo`/`forwardRef` components (B, JSX-free
bodies; the JSX form is the splitter's pin), a lowercase component shared
with the unsplit pendingComponent and a component exported by an export
list (red on main, pinned with the root causes they share), the module's
Route hoisted when another route comes first, and route module exports on a
dev server (class, alias and overload-alias cases red with automatic code
splitting, pinned in known-bugs-dev-server).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- `hotUpdate` returns the `window` the modules ran with, and with webpack
configures the plugins through their `webpack(compiler)` hook with a
compiler that has the React Refresh plugin or none (`webpackCompiler`), so
a fix that detects React Refresh from the bundler configuration is seen.
- `createRouteLoader` compiles successive versions of a route file with one
code-splitter plugin instance, as a dev server does; `loadRoute` and
`compileRouteModules` take the Vite `command`.
- `isRefreshable` (registered, or a memo/forwardRef of a registered
component) and `evaluateRouteModule` (exports, Route, registrations) are
exported.
- dev-server.ts: `routerPackageStub(target)` serves a router package whose
lazy options can be loaded, `importRouteModule` serves and imports a route
module, plus the route-module-export assertions shared by the dev-server
tests.
- `@vitejs/plugin-react` becomes a devDependency (catalog) for the
plugin-react HMR boundary control; lockfile regenerated with
`pnpm install --no-frozen-lockfile`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Outcome tests for shapes the deleted snapshot fixtures covered: exported
destructurings read by split options, options given by reference to
imports and local functions, the documented default groupings, a
top-level Route.addChildren call, a 'use server' directive in a moved
function, Solid and Vue routes (split loader included, lazy helpers from
their own router package), and a combined loader/component grouping in
the module-state matrix. Also assert that the non-ASCII route is split and
update comments that named deleted fixtures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the splitter tests that only exist on #8504, rewritten to assert
outcomes (loadRoute, compileRouteModules, real builds). Rows that pass on
main become regular tests; rows that fail on main are pinned in
known-bugs-code-splitter.test.ts (or as .fails next to their controls)
after checking the failure is a main bug. Also pin the D11 goal that the
handler of an object-form loader ends up split, and check that an import
assertion compiles to an import attribute.
The regression helpers now accept JSON source stubs, give plugin hooks a
warn-capable context, and expose a route HMR transform per plugin
instance.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- plugin pipeline: deleteNodes plumbing is covered by the server-only option
tests (known-bugs-code-splitter.test.ts); split/shared module ids without a
split value or shared bindings are an internal protocol no user path
reaches.
- utils: getUniqueProgramIdentifier is replaced by the generated-names tests
(a route file binding or global keeps its value), routeFactoryCallCodeFilter
by the route factory tests (whitespace before the call, type arguments: a
root route hot-updates for every spelling), getObjectPropertyKeyName by the
string, spread and computed option key tests.
- known bugs: the evaluateModule linking control is covered by
compiler-test-utils' module-linker tests; the ambient declare const used as
the split component duplicated the environment-component pin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- delete-nodes snapshots: server-only options removed with their imports on
file routes (React, Solid) and root routes (createRootRoute,
createRootRouteWithContext), and kept without deleteNodes, are asserted in
known-bugs-code-splitter.test.ts (server-only route options on the client).
- shared-bindings-helpers: internal Babel helpers and computeSharedBindings
results; the outcomes (init once, one identity, absences, Route-reading
helpers) are in the module-level bindings matrix and the route-options
tests.
- detect-route-codesplit-groupings: route-level groupings and precedence,
refused non-nested and variable groupings are in
code-splitter-route-options.test.ts (code-split groupings); code-route
groupings and constants are goal pins; the verbose:false form is no longer
generated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every fixture and test it held is covered by a behaviour test or a goal pin:
- snapshot fixtures: falsy option values, option value shapes (memo,
React.memo, lowercase functions, conditionals, destructuring with defaults),
Solid lazy helpers, untouched non-route modules, directive prologues,
import attributes, self-referencing components, non-ASCII text, Route-reading
helpers, transitive and shared state (code-splitter-route-options,
-plugin-pipeline, -imports-exports, -scope, -module-state tests); exported
components and page code (exported-bindings pins, page code in client
builds); unused copies in chunks (what split chunks hold); imported
error/not-found/pending components (code-splitter-router.test.ts);
- lowercase split components with HMR: known-bugs-route-hmr control rows;
- computeSharedBindings invariants and the small-scope matrix: the
module-level bindings matrix (values, init counts, identity, absences) and
the Route-reading helper tests; loader objects: object-form loader pins;
root routes: the root route test and its build-level goal pin;
- fast paths and graph helper units: internal, their outcomes covered by the
dead-code and module-state tests.
shared-runtime.tsx moves next to the runtime contract test that reads it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix pins: the exported-only-candidate pin accepts any warning naming the file
and the binding (rows for default exports, export lists, exported
destructurings); the property-assignment row no longer asserts placement; the
exported-const placement pin moves into a client build per bundler and
side-effect hint, next to the other page code exported from route files.
New goal pins: chunks hold only what their option needs (D5, compiler and
build level), root route error/not-found components split (D12), method
shorthand components split, options destructured from a call split or
reported (D11), object-form loaders with method or spread handlers, generated
names never shadow user bindings, groupings from a constant honoured, code
route groupings not leaking into the file route, one cache next to a
Route-reading destructuring, one identity for an exported Route-reading
helper, array-destructured components that crash the compiler, state shared
with method options.
Also: Solid and root-route rows for removed server-only options, server-only
options kept without deleteNodes, and split error/not-found/pending
components rendered by a real router in Vite client and SSR builds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rewrite the splitter tests that pinned which bindings land in the shared
module, the printed form, or internal ids, as evaluations of the emitted
modules (values, init counts, identity), loosen the runtime contract on
initialiser timing and the exported-component report (any wording, file
named once), and add behaviour tests that replace the snapshot fixtures and
helper units: falsy option values, option value shapes, Route-reading
helpers, a module-state matrix across kinds/groupings/readers, groupings
precedence, root routes, Solid helpers, untouched non-route modules,
directive prologues, import attributes, real-app file names.
New pins found on the way: a class with a side-effectful static initializer
read by one split option is created twice; a chunk that imports shared
bindings loses the file's leading JSX pragma under Oxc.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Route files of real apps live at paths like routes/{-$locale}/index.tsx; the
linker refused any specifier containing $, so their split chunks could not be
loaded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`routeIdOf` (evaluates a route file and returns the id its Route is created
with) moves from known-bugs.test.ts to tests/route-id.ts and accepts the
React, Solid and Vue router packages, with control tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- `compileRouteModules` / `loadRoute` take `targetFramework: 'vue'` (Vue
router package stubbed too), plugin options (`pluginOptions`, e.g.
`codeSplittingOptions.defaultBehavior` / `splitBehavior`, `plugin.hmr.style`)
and the `routeId` the file is registered under.
- `hotUpdate` moves from known-bugs-route-hmr.test.ts to regression-helpers.ts,
with options for code splitting (modules linked like `loadRoute`), the
target framework, the route id (`/__root` mounts a root route), the edited
code, initial hot data and a React Refresh runtime. It returns the live
options before and after the update, the created route options,
`invalidated`, React Refresh registrations/refreshes and lazy loading. Hot
contexts are per module. Routes are router-core routes for every
framework. The route update pins keep their assertion through a local
`updatesOption` wrapper and still fail for the reasons they document.
- handle-route-update.test.ts calls the emitted `handleRouteUpdate` only
through `runHandleRouteUpdate`.
- The out-of-order dev-server pin and its control derive the module URLs
from the imports of the served route module, transitively (the shared
module is imported by the chunks, not by the route module), instead of
hard-coding `?tsr-shared=1` / `?tsr-split=...`.
- `routerDevServer` takes extra Vite plugins, and its default root route
follows the `target` plugin option.
- `importRequests` (static and dynamic imports of a module) is exported.
Control tests in regression-helpers.test.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`compileWithRscCssTransform` takes `env` (default `server`, the rsc
environment), `warn` (passed to the compiler) and extra
`compilerTransforms`, with control tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- `callProvider` / `callReportedServerFns` take the SSR bundle's modules
(`ServerOutputs`: SSR caller + provider, e.g. a `compileAll` or the new
`compileServer` result) and link them into one module graph
(`createServerGraph`), the SSR caller under `/test/src/module.tsx`, so a
provider may import shared state or helpers from the SSR caller instead of
copying them. `evaluateProvider` returns the provider of that graph. The
provider-calling tests now pass their compiled outputs instead of the
provider alone (no assertion changes).
- The Start runtime stub records `createServerFn(options)`, `.middleware()`
and `.validator()`, makes builders callable (server fn factories), and
records `createMiddleware().client()` / `.validator()` / `.middleware()`;
`.server()` still throws uncompiled.
- `expectOutputsFreeOfHandler`, `misplacedServerFnRejection` and
`OutputResult` move from the known-bugs suite to regression-helpers.ts.
- `createStartCompiler`, `compileFor`/`compileAll`/`compileServer`,
`evaluateModule`, `compileHydrate`, `loadClientModule` and
`renderBoundaries` take a `framework` option (react | solid | vue, default
react); the runtime and Hydrate stubs follow it. `evaluateModule` takes its
JSX runtime as `{ runtime }`.
- `compileFor` (and `createStartCompiler().transform`) return the source map.
- `loadClientModule`'s lazy components get `preload()`, which records the
chunk it loaded (`preloaded`), and it returns the parent's `chunkIds`.
- New `importProtection/mock-helpers.ts`: `evaluateWithMock`, `selfMock` and
`isMock` evaluate import-protection mocks through the module linker.
Each helper change has control tests in regression-helpers.test.ts or
mock-helpers.test.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Move router-plugin's module validator (the stronger one: it also rejects
references to undeclared names) to `@tanstack/compiler-test-utils/validate-module`
and use it from router-plugin and start-plugin-core instead of two copies.
Its controls move with it.
- The harnesses no longer call `onTestFinished` from their own Vitest copy:
`createApp`, `bundleApp`, `createDevServer` and `createRsbuildDevServer` take
a `registerCleanup` option, which the package wrappers set to their
`onTestFinished`.
- `evaluateServed(server, url)` links what a Vite dev server serves for a
module and its static imports as real ES modules and evaluates it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- client modules two imports away from an edited server fn factory keep
stale compiled output (DV26)
- import protection reads ModuleInfo.code in dev and fails the client
transform (#8554, DV38)
- importers keep an import protection mock after the server-only marker is
removed (DV37)
- split/shared modules requested before the route module after an edit use
the previous shared bindings (DV8)
- a tsr.config.json edit re-creates the generator without running it (DV3)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Vite harness starts a real dev server on a temporary app, replays file
events deterministically (creations, edits, renames, deletions and the files
plugins write meanwhile) and waits until the server has handled them, then
requests modules per environment and reports HMR payloads. The Rsbuild
harness waits for the rebuild an edit causes and reads the emitted output.
Wired into router-plugin (route generator in dev: scaffolding, renames,
moves, deletions, first load of a new route) and start-plugin-core
(Rsbuild dev rebuilds every importer of an edited server fn factory).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pins, each asserting the correct behaviour and marked .fails:
- code that reads a split binding (export lists/aliases, exported objects,
functions, default exports) loses it (#8505, gap O7)
- class components cannot be split (#8505)
- overloaded functions shared with a split loader break the route (#8505)
- the user's bare `import './Page'` is dropped when `Page` is split (gap O2)
- a split loader's `this` is its chunk namespace (#8688)
- `'` in the app path breaks every split route (#7754)
- Start's `deleteNodes` keeps `ssr()`/`headers()` methods and options given
through spreads, computed keys or calls, with their server imports
(gap D11), plus a client-build canary on Vite, Rspack and webpack
- symlinked route files ship `server.handlers` to the client (#8514)
- Vite source maps of split chunks name the `?tsr-split`/`?tsr-shared` ids
(gap CC-S2)
- webpack/Rspack production builds without NODE_ENV ship the "will not be
code-split" warning and, with code splitting off, route HMR code
(gaps CC-P1, CC-P2)
The build harness gains `nodeEnv` (unset NODE_ENV during a build),
`sourcemap` (`Chunk.map`) and `symlinks`; `loadRoute` returns the route
module's exports and `compileRouteModules` takes `deleteNodes`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pins (.fails, with passing controls) for: declarations dead-code
elimination keeps (class, enum, namespace, overload, redeclared var) with
their server-only imports, at compiler level and in a Vite client build;
a typeof type query keeping a server-only import (verbatimModuleSyntax);
comments around a server fn handler reaching the client; Hydrate boundary
ids shifted by environment-specific removals; a server fn module
initialised twice in one SSR process; a server fn only another server fn
calls missing from the production resolver (#7213); dev id recovery on a
fresh dev server (#8447); import protection failing on a tree-shaken
denied module (#8101).
buildStart accepts extra Start Vite plugins (import protection).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The router-plugin and start-plugin-core regression helpers each had their
own Node `registerHooks` ES module linker, and the Start build harness
imported the router-plugin harness by relative path, building its temporary
apps inside router-plugin/tests.
`@tanstack/compiler-test-utils` is a private workspace package (source
exports, no build) with:
- `module-linker`: one `createModuleGraph` linking in-memory modules as real
ES modules. It keeps what both suites use: object and source stubs (JSON
modules), lazy module discovery through `load` and path resolution or a
custom `resolve`, `fallbackStub`/`lenient` for unresolved imports, custom
`transform`, `runtime`, `scope` and `import.meta`, `evaluated` order,
dynamic imports that resolve (or fail) when they run, `add`/`idOf`, and
Node's native `import()` outside Vitest's module runner.
- `build-harness`: the plugin-agnostic real-build core (`createApp`,
`bundleApp`, chunk placement, `run`). Callers pass the directory their
temporary apps live in, so each package builds apps in its own tests
directory and resolves its own dependencies.
The router plugin (`build`, `routeApp`) and Start (`buildStart`) wiring stay
in their packages. The linker and harness-core controls move to the new
package; two duplicates are dropped (fresh instances per graph, unknown
import).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict in packages/router-plugin/tests/regression-helpers.ts: keep the
module-runtime helpers and drop the imports only the old buildAndRun used,
which is now the thin build-harness wrapper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Goal tests whose outcome the bundler decides (chunk placement, what
tree-shaking drops, what side-effect hints change) need a real build per
bundler. `build-harness.ts` writes an app to disk, builds it with Vite
(rolldown), Rspack, webpack or esbuild for the client or SSR, reports the
entry, eager and lazy chunks and where a marker lands, surfaces bundler
warnings/errors and console output, and runs the output in a child Node
process (jsdom globals for client builds). Side-effect hints are set per
fixture through the app's package.json.
`buildAndRun` becomes a thin wrapper over it (same Vite SSR build, now with
NODE_ENV=production during the build and run).
The Start counterpart builds client then SSR with the Start compiler's Vite
plugin and a stand-in `@tanstack/react-start` package.
Control tests cover placement and `run()` per bundler and env, build errors,
the package.json `sideEffects` hint, `@__PURE__`/`#__NO_SIDE_EFFECTS__`,
and pin that the esbuild adapter never splits routes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Behavioural tests no longer depend on the code splitter's module layout or
generated names through the helpers:
- compileRouteModules drives the real code-splitter plugin hooks (filters,
configResolved, resolveId/load/transform) under an absolute module id and
discovers the emitted modules by following the static and dynamic imports
the output contains. Labels (reference / virtual <exports> / shared), ids
and sharedBindings are derived from that graph for the tests that still
inspect a module by role.
- module-runtime.ts links modules with Node's ES module linker through
in-thread module hooks: every import/export form, live bindings, lazy
dynamic imports, fresh instances per session, import.meta injection.
- loadRoute evaluates the route module first and a split option only when
its lazy loader runs; options are read from the evaluated Route
(load/isLazy), not from chunk export names. It replaces the local
loadRouteModules/linkable copy in known-bugs-code-splitter and the manual
linking in known-bugs-route-hmr and code-splitter-dead-code.
- getRouteOption, expectRegisteredRouteOption and
expectRefreshableRouteOption evaluate the module with the React Refresh
transform and check the registration of the value the route holds.
- The route HMR harness runs the hot API through import.meta and a real
RouterCore with a real file route instead of a regex and a stub router.
- getModuleErrors also rejects references to names that are neither
declared, imported, probed with typeof nor known globals (JSX compiled the
way a bundler compiles it); expectValidModules allows the globals the
route file itself reads.
- formatSnapshot fails on output that does not parse.
Adds regression-helpers.test.ts with controls for each of these.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Evaluate test modules with a real ES module linker (module-linker.ts:
in-memory graph served through node:module hooks) instead of regex
import rewriting and `new Function`: every import/export form, live
bindings, cycles and dynamic imports.
- callProvider finds a handler by its runtime `meta.name`; callServerFns
imports the reported `extractedFilename` and calls the reported
`functionName`, like the server-fn router.
- expectNoClientHandler checks each output on its own: one rejecting output
no longer excuses another.
- Hydrate helpers: chunks found through the plugin's virtual-module pattern
and ordered through their source maps, chunk components and their props
found by evaluation, loadClientModule links the parent and its compiled
chunks in one graph through `lazyRouteComponent`'s load, and boundary-id
parity compares the ids the server and the client actually render.
- Harness controls for each changed helper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Route HMR keeps the previous component options for React Refresh to patch,
also when no React Refresh runtime is installed, so webpack apps without a
refresh plugin (like the webpack quickstart example) never show an edited
route component until a reload.
In a Vite dev server with an empty dependency cache, a client module with a
server fn and a top-level call of a pre-bundled dependency (a `z.object()`
schema) never finishes transforming: the compiler's module lookup waits for
the dependency optimizer, which waits for the transform. Hit by
`server.warmup`, a middleware-mode server's first request and direct
`transformRequest()` calls.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route HMR code accepts through `const hot = import.meta.hot`, so Vite
never marks a route module self-accepting. Solid routes with automatic code
splitting and every Vue route reload the page on each edit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- a server fn handler that calls other `.handler()` methods keeps them
(TanStack/router#3698)
- `<T>value` assertions and `<T>(value: T) => value` arrows in `.ts` route
files, server-fn modules, import-protection rewrites and generator
transforms are parsed as TypeScript, not JSX (TanStack/router#7341)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each pin fails on main and on #8504's head for the stated reason:
- a type-only import re-exported without `type` (`import type { Settings }`
or `import { type Settings }`, then `export { Settings }`) loses its import
but keeps the export, so the module fails to load with "Export 'Settings'
is not defined": route module and split chunks (code splitter), client and
SSR outputs (Start compiler)
- rewriting a denied import to the import-protection mock drops the comments
that lead it (a JSX pragma, a legal comment)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by mutation testing #8504 and by checking exported bindings used by
split options. Each pin fails on main and on #8504's head:
- a classic JSX factory the route module creates and the loader reads is
dropped from the split chunk (created again in the chunk on #8504)
- an unused reference cycle is copied into every split chunk (a row of the
unreferenced side effects table)
- the "will not be code-split" warning is missing when an exported
component is the route's only split candidate
- an exported const only a split component renders stays in the entry
chunk (with a control for the build placement harness)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Several `createFileRoute` calls in one route file were dropped from these
pins in an earlier consolidation; they are on the compiler-diagnostics
follow-up list, to be reported as an unsupported pattern rather than
pinned as a bug.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds engine-agnostic tests found by mutation testing and by porting external
fixture suites while reviewing #8504. Each passes with the current compiler
and with the one in #8504.
- code splitting: const enums, abstract classes with parameter properties,
`using` declarations, non-ASCII text, reference cycles of four
declarations, #__NO_SIDE_EFFECTS__ annotations in files with a pragma,
side effects kept out of the shared module, the classic React import of a
chunk, and shared bindings of loaders in object form or reaching Route
through a later-declared helper
- route HMR and React Refresh: overloaded lowercase components,
method-shorthand component options, split loaders not kept in HMR data
- server functions: handlers with type arguments, client references in
caller modules, and the missing-handler error
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New pins, each failing on main for its stated reason:
- Code splitter: an unused class with a static field and an unused enum
with a member initializer copied into split chunks, and a binding read by
a computed-key route option and the split component not shared (rows of
existing pins); every route a module creates loads the split component of
the last one.
- Hydrate: a module-level `var` declared in a nested block dropped from
the chunk (same root cause as the code-splitter nested `var` pins, now
cross-referenced), and an unexported component named `Route` removed
from the chunk as if it were the route.
- Start compiler: chain methods called through a computed member
(`createServerFn()['handler'](...)`, `['server']` of middleware and
isomorphic fns) leave the module untransformed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
React HMR holds hoisted inline component options aside until it has visited
every option, so renaming a lowercase component passed to a later option
leaves the hoisted component reading the old name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mock declares each name as `export const <name>`, so a denied module
exporting `delete`, or used as `api.delete()`, yields a SyntaxError.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generator renames its temp files into the app, which fails across
filesystems (EXDEV) when the app lives in a separate /tmp, as in the musl
container job.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A split component that is an undeclared global or a `declare const` is
exported from its chunk under a name the chunk never declares, or the
export is erased with the declaration.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New pins, each failing on main for its stated reason:
- Start compiler: builders returned by a function, env-only factories
nested under a renamed import or local alias, a call whose result is
member-called (`.bind()`), the classic JSX pragma factory import, and
Vue `<script setup lang="ts">` blocks parsed as TSX.
- react-start-rsc: `renderServerComponent(...).then()` skipped by the CSS
transform (same root cause as `.bind()`).
- Hydrate: a component with its own boundary inside another boundary and a
children prop next to a comment-only body (rows of existing pins), and the
classic JSX pragma factory import.
- Code splitter: an exported `let` the split component reassigns and a
`declare const` used as the split component (rows of existing pins), the
classic JSX pragma factory import, and apps in a directory with `#`.
- Route HMR: a route exported under another local name, and a getter
component option.
- Router generator (new file): spread/computed/method route options missed
in `createFileRouteProps`, and the route constructor recognized by name
apart from its import (aliased and type-only imports).
`buildAndRun` takes a directory prefix for the `#` pin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With React HMR, a lowercase `function` component that the loader also
reads is renamed in its split chunk although the code splitter moved it
to the shared module, so the chunk exports an undeclared `SplitComponent`
and fails to load in development. An arrow-declared component, the same
harness's control, renders with the module state it shares.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`Card` now renders text, so a transform that drops the JSX argument no
longer passes the control or the pins.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- evaluateModule links side-effect and namespace imports, so a fix that
imports the shared module that way is not rejected by the harness.
- React Refresh pins accept a memo/forwardRef call of a registered binding.
- Module state: merge the exported-function rows and read the state
directly; the registry row counts store initializations; name the
`computeSharedBindings` mechanism.
- Unreferenced top-level statements: add an errorComponent chunk, require
the effect to run with the route module, and group the `export *` pin
under the same root cause.
- Controls for the options-in-a-variable harness and the memo assertion.
- Point the "known limitation" tests at their pins; fix the `hot` comment.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Match rejection errors on the message without its code frame
(`compileErrorMessage`), which quotes the source and let any error
satisfy `/Hydrate.*arguments/`, `/Hydrate.*Route/` or `/createServerFn/`;
require wording specific to each rejection, with a control proving an
unrelated error does not match.
- expectNoClientHandler: the client must not import the server-only module,
neither the client nor the SSR caller may contain the handler body, and
the provider must export and run every server fn the client reports.
- 'use client' provider pin: assert on the parsed directive prologue.
- Own-`this` pins: the server compile must succeed too.
- Recursive boundary ids: assert the boundary counts so a computed `h` id
cannot make the check vacuous.
- `await` in split children: require the clear rejection.
- Split the `Route` row and the `opts` row into their own root causes.
- compileHydrate treats an untransformed module as its own parent, so the
`<Start.Hydrate>` pin fails on its chunk count.
- Controls for callServerFns, expectNoClientHandler, evaluateRewritten and
loadClientModule's stub merge and beforeChunksLoad.
- Fix or drop citations that do not hold upstream.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the cases with unique coverage (the @tanstack/react-start-rsc import
source, transparent JSX wrappers, non-JSX arguments) next to the existing
tests and drop the separate helper, which imported start-plugin-core tests.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merge the five parenthesized-call cases into one test next to the existing
outer-parens test and fold the remaining preservation cases into
transform.test.ts, reusing its makeNode helper.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Dissolve the ported-* and start-compiler edge-case files into behaviour
files (server fn caller dead code, declaration sites, exports and
directives, handler scope, Hydrate captures, factories, user code kept),
drop duplicate cases and vacuous assertions, and compile through a single
harness. The RSC external-transform scope cases move into compiler.test.ts,
replacing react-start-rsc's ported-vite-plugin-rsc.test.tsx.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Dissolve the ported-* and code-splitter edge-case files into behaviour
files (dead code, imports/exports, module state, pragmas, route options,
scope), drop duplicate cases and vacuous assertions, and replace the five
real Vite builds with one.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Before the code-splitter transforms were shared, the real-world file-name
test resolved a Vite config that did not list the router plugin, which
covers the early return of the plugin-order check. Let the shared helper
take the config's plugins and keep that case.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
transform-parenthesized.test.ts duplicated the `transform` harness of
transform-preservation.test.ts; move its tests there.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- The SolidStart "local types used by split children are not passed as
props" Hydrate test duplicates the Qwik "local types used by the children
are not captured as values" test; the Qwik test now also covers JSX type
arguments and asserts that no type is passed as a prop.
- start-compiler-edge-cases "does not duplicate a directive the module
already has" becomes a case of the plugin-rsc "provider module directives"
table, which also checks the prologue and module validity.
- The single test of aliased-env-only-fns.test.ts moves to the
"cross-module factory resolution" tests of start-compiler-edge-cases, where
its output is also validated.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Remove tests whose input shape and assertions another suite already covers,
folding any unique assertion into the surviving test:
- code-splitter-real-world: the two "split chunks share exported route-file
bindings" compile checks duplicate code-splitter-exported-bindings (the
built-app check stays); "file-level JSX pragmas" duplicates the
@jsxImportSource cases of code-splitter-jsx-pragmas, which now also check
that Oxc selects the pragma's JSX runtime for every split chunk.
- ported-react-compiler-fixtures: "a catch parameter shadowing a module
binding" duplicates the plugin-rsc "next to a catch parameter of the same
name" case, which now names both sources.
- ported-nextjs-ssg: "moves one declarator of a multi-declarator statement
into the split chunk" duplicates the React Router "plain declarators" case,
which now also asserts where each declarator is declared.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Both RSC CSS transform regression suites defined the same compile helper
and a copy of the module validator; move the helper into
`tests/regression-helpers.ts` and reuse start-plugin-core's validator.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The regression suites each built their own `StartCompiler`, output compiler,
Start runtime stubs and `<Hydrate>` chunk loader. Move them into
`tests/regression-helpers.ts`:
- `createStartCompiler`, `compileFor`, `compileCode` and `compileAll` (client,
SSR caller and provider outputs, validated), previously built in 10 files
- `importModule`, `callProvider`, `importSources` and `settle`, with one
minimal Start runtime instead of four variants
- `compileHydrate`, `getChunkParams`, `getChunkIds`, `loadChunk`,
`evaluateModule` and `renderChunk`, previously copied into 6 files
No test is added, removed or renamed.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The regression suites each re-implemented the same plumbing. Move it into
`tests/regression-helpers.ts`:
- `compileRouteModules` (reference, virtual chunks and shared module, with
optional route HMR, Solid target or file name) and `expectValidModules`,
previously copied into 12 files
- `buildAndRun`, the Vite build-and-run harness copied into 5 files
- `createCodeSplitterTransforms` and `transformWithRouteHmrPlugin`, which
drive the bundler plugins the way a bundler does
- `evaluateModule`, the JSX-to-text module evaluator copied into 3 files
No test is added, removed or renamed.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Move the Start compiler bugs pinned by the Next.js server actions,
babel-dead-code-elimination and @vitejs/plugin-rsc ports into
`known-bugs-start-compiler.test.ts`, and build their compilers with the
shared `createStartModuleCompiler` helper instead of two more copies of
the `StartCompiler` setup.
The export * diamond and cycle pins share a root cause and become one
table. The `opts` handler pin sits next to the other generated-name
collision pins.
Add passing controls showing that a server fn's server-only import is
removed from the client (directly and through an imported builder) and
that the provider stub harness runs a handler.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Move the Hydrate bugs pinned by the Qwik, SolidStart and React Compiler
ports into `known-bugs-hydrate.test.ts`, grouped by area (boundaries and
ids, captured values, module-level code used by the children), and replace
the four copies of the compile, chunk-loading and chunk-rendering helpers
with `known-bugs-helpers.ts`.
Merge the Qwik and SolidStart pins of "`this` owned by code inside the
children is rejected": their function-expression inputs were the same
shape, so one row keeps the Qwik input (which also captures a prop) with
the SolidStart assertions. The Qwik context and reassigned-`let` pins,
which share a root cause, become one table.
Add passing controls for boundary ids, captured props and module-level
helpers, which every Hydrate pin relies on.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Move the code-splitter bugs pinned by the original list and the Next.js,
React Router, Qwik, React Compiler and Turbopack ports into
`known-bugs-code-splitter.test.ts`, and the route HMR, React Refresh and
router-core CommonJS bugs into `known-bugs-route-hmr.test.ts`, so each
file has one build-and-run harness and one set of HMR compile helpers.
Pins that share a root cause become rows of one table:
- a shared binding reassigned outside the shared module (the original
`let` pin and the React Compiler module-level reassignment, now built
and run like the other rows);
- module state the reference module keeps for a reason outside the route
options (the original partial-export pin, the Qwik context pin, now
built and run, and the Next.js and React Router ports).
Add passing controls for the build-and-run harness and the React Refresh
registration checks. Every pin keeps its source attribution.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A top-level binding that reads a `var` declared inside an `if`, `try` or
`for` head is moved to the shared module when the loader and a split
component both use it, but the nested `var` is not, so calling it throws
`ReferenceError: flag is not defined`. Broken on main and on #8504.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- code splitter: a declaration moved to the shared module evaluates before
the top-level writes that precede it in the route file (Turbopack
write-order / shared-2 fixtures)
- Start compiler: dropping an environment-specific implementation inside a
hook also deletes hook calls only that implementation read (useId shifts
between server and client)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Files whose text matches a detection pattern (such as `.handler(`) are
parsed as strict ES modules, so CommonJS dependencies with sloppy-mode
syntax (legacy octal escapes, `with`, top-level `return`) fail the build
although they have nothing to compile. Scenario from @vitejs/plugin-rsc's
CommonJS transform tests (vitejs/vite-plugin-react, MIT).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Port dead-code-elimination scenarios (pcattori/babel-dead-code-elimination)
and Turbopack tree-shaker analyzer fixtures (vercel/next.js) to the code
splitter and the Start compiler: import specifier pruning, initially unused
declarations and cycles, SCC removal, write-only bindings, nested patterns
with rests and defaults, empty parameter patterns, var declarations nested
in top-level statements, import attributes, typeof references, enum IIFEs,
shared mutable state and statement order in the provider.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Port scope, hoisting, export-shape, export * and directive scenarios from
@vitejs/plugin-rsc's transform tests (vitejs/vite-plugin-react, MIT) to the
Start compiler (server fn providers and callers, env-only functions, Hydrate
chunks), the route code splitter and the RSC CSS transforms.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Route HMR keeps the previous component options so React Refresh can patch
them, but inline memo/forwardRef/method-shorthand components (unsplit
routes) and lowercase variable components in split chunks are never
registered, so edits to them are silently dropped. Ported from React
Refresh's Babel plugin tests; checked with Vite's Oxc React Refresh
transform.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Translate SolidStart's "use server" directive compiler tests and helpers
(type-only import specifiers, rejected server fn positions, captured
this/arguments/super/private members, id stability and opacity, Hydrate
closure captures) and Waku's allowServer transform tests (dependency
pruning, aliasing, default exports, untouched look-alikes, zero-argument
factories, trailing comments) into Start compiler coverage for React and
Solid.
The import-alias namespace test passes on main and fails on the Yuku
compiler (#8504), which deletes the aliased namespace.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Port SolidStart's hoisting validation (`this`, `arguments`) to <Hydrate>
split children: a component's `arguments` silently changes meaning in the
chunk, and a `this` owned by a function, class or object method inside the
children is wrongly rejected. Both fail on main and on #8504.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Split chunks import exported route-file variables (contexts, stores and
caches built from private bindings) from the route module instead of
redeclaring them.
- The Start compiler keeps JSX pragmas in the Hydrate chunk, line-comment and
license-header forms, classic `@jsx` with `@jsxFrag`, and after a
`'use client'` directive.
Both pass on main and on #8504 after its fixes.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Expected failures for inputs adapted from the React Compiler fixture corpus,
broken on main and on the Yuku migration:
- a top-level function reassigned at module level and shared by the loader
and the split component makes the reference module assign to an import,
so the route module throws when it is evaluated
- a TypeScript import alias used only by Hydrate split children is not
declared in the client chunk
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Wrap component bodies adapted from the React Compiler fixture corpus into
route files and Start modules:
- split route components and Hydrate chunks render like the original for
labeled breaks, shadowing catch params and function names, destructuring
defaults, getters/computed keys, hoisted functions, optional call chains,
tagged templates and classes with static blocks/private fields
- server function handlers that read a server-only import through unusual
syntax positions keep it off the client
- unused locals with side-effectful initializers (hook calls) in shared route
modules and Hydrate chunks still run; these fail on the Yuku migration,
which removes them
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Adds regression coverage derived from a differential audit of in-repo
examples/e2e apps and open-source TanStack Router/Start apps:
- split chunks import exported route-file bindings instead of copying them
- declarations and imports only referenced from TypeScript types survive
(classic JSX runtime React imports, side-effecting initializers)
- TypeScript type and value exports sharing a name compile
- file-level JSX pragmas stay in split chunks and Start compiler output
- ambient declarations are not imported from the shared module
- chained comparisons in plain JavaScript route files keep their operands
- real-world route file names go through the code-splitter plugin pipeline
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Pin, as expected failures, bugs found by porting capture and extraction
scenarios from the Qwik optimizer test suite (QwikDev/qwik,
packages/optimizer/core/src/test.rs). They fail with both the Babel and
the Yuku compiler:
- Hydrate copies module-level declarations into the split chunk, so a
module-level context is re-created and a parent-reassigned let is stale
- Hydrate drops top-level statements the children rely on (compound
component member assignments, Object.assign, registry calls)
- recursive components inside their own boundary get client boundary ids
the server never rendered and lazy imports of missing chunks
- `this` of a nested function in the children is rejected as a capture
- `React.useId()` in the children bypasses the hook check
- route code splitting re-creates a private context used by both the
reference module and the split component
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Port capture and extraction scenarios from the Qwik optimizer test suite
(QwikDev/qwik, packages/optimizer/core/src/test.rs) to the Hydrate split
transform, server function extraction and route code splitting. All of
them pass with both the Babel and the Yuku compiler.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Port scenarios from Next.js's SSG transform fixtures and React Router's
route-chunks / remove-exports tests that the code splitter still gets wrong,
as expected failures:
- a destructuring with an unreferenced sibling binding is kept in the
reference module and copied into the split chunk, so its initializer runs
twice
- a top-level statement that initializes or mutates a binding only the split
component reads runs in the reference module and again in the chunk
- property assignments to a split component (displayName etc.) stay in the
reference module (ReferenceError on main, unsplit duplicate on the Yuku PR)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Translate edge cases from Next.js's SSG transform fixtures and React Router's
route-chunks / remove-exports tests into code-splitter coverage: imports used
in JSX positions, shadowed names, transitive pruning of every declaration
kind, destructurings and multi-declarator statements split across groups,
mutually recursive shared helpers, nested-scope dependency analysis, helpers
shared with the loader, top-level calls on imports and split chunk source
maps. All scenarios already behave correctly; these tests pin them.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Ported from the module-level directive scenarios of Next.js's
server-actions transform fixtures. The server-function provider module
keeps its source module's 'use client' directive, so an RSC provider
environment would turn its handlers into client references.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Translate the scenarios of Next.js's server-actions transform fixtures
(crates/next-custom-transforms/tests/fixture/server-actions) to the
createServerFn client, SSR caller and provider outputs: captured module
bindings, shadowing, destructuring, handler forms, directives, export
forms, non-ASCII names and client/server-only code side by side.
The destructuring default and computed-key cases pass on main and fail
with the Yuku compiler (#8504), which keeps every sibling of a live
destructuring and with it a server-only import in the client output.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reproduce 24 compiler/runtime bugs found while validating the Babel to Yuku
migration (#8504) that also break on main. Each test asserts the correct,
user-visible behaviour through public compiler entry points and is marked
`.fails`, so CI stays green and the test flips once a fix lands.
- start compiler: export * cache poisoning, server fn named `opts`,
createServerOnlyFn handlers, unresolved builder chains, generated-name
collisions, nested createServerFn
- code splitter / HMR: shared reassigned let, several createFileRoute calls,
object-form loader, duplicated destructuring initializer, duplicated side
effects, options-variable TDZ, user `hot` binding, CommonJS route HMR
- Hydrate: fallback boundary indices, key/ref captures, await, Route, namespace
import, shadowing, comment-only children with spread, H0 helper collision
- RSC CSS: comments before JSX, options after spread
- import protection: `export * as ns` from a denied module
`validate-module.ts` and `compile-start-module.ts` are copied verbatim from
#8629 (test/compiler-regression-coverage).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Engine-agnostic tests through public compiler entry points, passing on
main. They cover:
- code-splitter module state shared with exported functions, `var`
declared inside top-level statements, long method chains, duplicate
split keys, split options that read `Route`, route options declared
in a variable, re-exports, type-only syntax, private class members,
and namespace JSX tags
- the code-splitter plugin pipeline: analysis cache keys and eviction,
plugin-level `splitBehavior`, config `deleteNodes`, and the
non-split HMR plugin for Solid and Vue
- the route generator transform with parenthesized call parts, and
byte-exact edits after a BOM or astral characters
- the Start compiler: dev-mode server function ids, provider
directives, handler name versioning, provider export removal,
cross-module factory resolution, invalidation, and diagnostic
locations
- Hydrate children with block-bodied callbacks, self-closing
boundaries, captures, split attributes, and the virtual module cache
- import-protection exports, member-chain boundaries, source-mapped
locations, and executed denied-import rewrites
- RSC CSS transform import shapes and argument unwrapping
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- The React Refresh ordering test now requires the inline pendingComponent
to be hoisted instead of passing when it stays inline, since main hoists it
and React Refresh needs a top-level binding.
- The self-referencing side-effect tests also assert that each binding the
callbacks use is still declared. The module validator does not report
references to undeclared names. The Start variant now validates the module.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Add engine-agnostic regression tests for compiler output found while
reviewing the compiler migration (#8504). They only use the public
compiler entry points and validate emitted code with Vite's Oxc
transform/parser (TypeScript erased, parsed as a JS module with semantic
checks), so they run unchanged against any compiler implementation.
router-plugin:
- every emitted code-splitter module stays valid for re-exported imports,
partially exported destructuring and anonymous default exports
- self-/mutually-referencing side effects stay in the reference module
- namespace imports used by `import X = ns.X` and decorator placement
before `export` are preserved
- React Refresh hoisting keeps closures in scope, hoists the root route
component, and declares hoisted components before use
start-plugin-core:
- self-referencing user code survives client and server compilation
- nested and switch-case createServerFn keep provider modules valid
- aliased createClientOnlyFn re-exports are transformed in SSR
- Hydrate split modules: parent/fallback-only bindings are removed, text
children render decoded entities, `'use client'` stays first
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-06 19:41:42 +02:00
2497 changed files with 237970 additions and 78391 deletions