0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00

Compare commits

..

2,930 commits

Author SHA1 Message Date
Sheraff
76581766be
Merge branch 't3/coverage-fix-batch' (coverage review fixes: B1 whole .handler() argument list stubbed, C1 RSC keeps <ClientOnly> children only in handler text as main, C3 Hydrate capture named children, D1 no hot update for a gone file, E1 erased text reads no shared name, A3 single-reader group importer inlined, A5/B4 dead code removed; E2, A2, B3 and the RSC ClientOnly limit recorded; Fable review: no other regression against main; e2e RSC Vite/Rsbuild green)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:44:36 +01:00
Sheraff
60d8229af7
fix(start-plugin-core): RSC keeps <ClientOnly> children only in a handler, as main (C1)
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>
2026-11-16 17:31:28 +01:00
Sheraff
b22412c256
test: coverage of the batch (B1 env-only arguments, C3 Solid and bare children, D1 virtual modules)
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>
2026-11-16 17:06:09 +01:00
Sheraff
b86e4d39c3
chore(changeset): coverage review fixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 16:43:32 +01:00
Sheraff
758ab76873
docs(oracle): record E2, A2 and B3 of the coverage review
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>
2026-11-16 16:43:20 +01:00
Sheraff
f825a98be0
perf(router-plugin): a group's only importer is written in its placeholder (A3)
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>
2026-11-16 16:42:23 +01:00
Sheraff
80df73200d
fix(router-utils): no hot update for a stale module whose file is gone (D1)
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>
2026-11-16 16:32:43 +01:00
Sheraff
b2a978510e
fix(start-plugin-core): a Hydrate capture named children keeps its name (C3)
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>
2026-11-16 16:26:47 +01:00
Sheraff
9025f82751
fix(router-plugin): text the client erases reads no shared name (E1)
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>
2026-11-16 16:24:37 +01:00
Sheraff
df2bab3dd4
fix(start-plugin-core): keep <ClientOnly> children where server components render (C1)
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>
2026-11-16 16:20:11 +01:00
Sheraff
31749a2585
fix(start-plugin-core): the RPC stub replaces the whole argument list of .handler() (B1)
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>
2026-11-16 16:13:59 +01:00
Sheraff
52541a9326
refactor(start-plugin-core): drop the react and vue pure-call rows and pureDefaultNamespaces (B4)
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>
2026-11-16 16:07:36 +01:00
Sheraff
cf899747c1
refactor(router-plugin): no derived kind 'export' since phase 3 (A5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 16:05:02 +01:00
Sheraff
5d96a9712a
fix(e2e): vue-start SFC server fn moves to a plain <script> block (R162)
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>
2026-11-16 14:20:35 +01:00
Sheraff
fd0aeebe63
chore(changeset): main's behaviour for server fns not created once at load, as measured
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:53:34 +01:00
Sheraff
35fcc6bb97
docs(oracle): known limit of R162's order refusal (functions of the chain run at load)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:48:35 +01:00
Sheraff
eacfd5a5cc
Merge branch 't3/phase3-delete-engine' (phase 3 of one placement: the old placement engine is deleted (reach.ts, placement/{events,settle,kept,homes,inclusion}, kept-diagnostics, hosts/eager-exports, export extraction; ~8.6k lines); cluster builder and read index trimmed and renamed; no placement or erasure decision asks what code does: isPureClass, chainWritten, isMutated, memberUse/MUTATORS, linksOn and per-compile purity removed, purity is import protection's effect model only; server fns not written as a top-level declaration are hoisted only from positions evaluated exactly once at load, right above their own statement, else a build error (R162); verifier gen marker; corpus 58,075 identical, bytes identical, 18 bundle scenarios identical but rsbuild short ids (+-6 B); compile 8.6-10.9 % faster; two Fable reviews)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:48:16 +01:00
Sheraff
b27dd4af0a
fix(start-plugin-core): the order refusal follows the language's initialisation rule
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>
2026-11-16 13:34:01 +01:00
Sheraff
11693eff19
docs: comments, names and test titles describe the one placement (review-phase3 F5)
`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>
2026-11-16 13:15:00 +01:00
Sheraff
aa80b86351
fix(start-plugin-core): a hoisted server fn is created at its statement, whatever it reads (review-phase3 F1-F4, F6)
- 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>
2026-11-16 13:15:00 +01:00
Sheraff
fb3dee33ed
test(react-start-rsc): the nested-class rows keep the positions R162 allows
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>
2026-11-16 12:11:07 +01:00
Sheraff
00a198cbff
docs: the compiler's one placement (phase 3 step 9)
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>
2026-11-16 11:47:39 +01:00
Sheraff
e7ed44f3be
refactor(router-utils): one placement module beside its clusters and reads (phase 3 step 8)
`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>
2026-11-16 11:45:08 +01:00
Sheraff
143e095532
fix(router-utils): the verifier tells a generated unit's own text from the source it renders (phase 3 step 7)
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>
2026-11-16 11:33:04 +01:00
Sheraff
b1a325a965
fix(start-plugin-core): a server fn refused inside a function is told so (R162, phase 3b)
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>
2026-11-16 11:30:52 +01:00
Sheraff
74f1dbbf6d
docs: where a server function may be created (R162: SPEC J4.6, guide, changesets)
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>
2026-11-16 11:19:16 +01:00
Sheraff
fadc88c92e
feat(start-plugin-core): R162 by its principle: refuse what may skip, repeat or defer a server fn (phase 3b)
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>
2026-11-16 11:17:28 +01:00
Sheraff
a71b238222
feat(start-plugin-core): hoist a server fn only where its statement creates it once, at load (R162, phase 3b)
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>
2026-11-16 10:59:11 +01:00
Sheraff
a4ab5eb0ff
docs(router-utils): purity is import protection's effect model (phase 3b)
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>
2026-11-16 10:17:36 +01:00
Sheraff
0db2c5005a
refactor: the known pure calls belong to Start's import protection (phase 3b)
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>
2026-11-16 10:06:53 +01:00
Sheraff
df0d264fd2
refactor(router-utils): purity only for a target's effects, built when asked (phase 3b)
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>
2026-11-16 10:06:15 +01:00
Sheraff
b9ba3d1fd3
refactor: no member-write model, mutation is assignment (phase 3b)
`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>
2026-11-16 10:04:53 +01:00
Sheraff
844fb492c4
WIP DO NOT MERGE: the server-fn hoist refuses where it asked purity or isMutated (phase 3b)
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>
2026-11-16 10:02:47 +01:00
Sheraff
48c08c2a54
refactor(router-plugin): options a write reaches are opaque by the reference count alone (phase 3b)
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>
2026-11-16 09:59:32 +01:00
Sheraff
32571051f4
fix(router-utils): a function-level class only erased code reads goes like any declaration (phase 3b)
`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>
2026-11-16 09:58:33 +01:00
Sheraff
b6b17e8a1c
refactor(router-utils): drop the evaluation-run walk's inputs (phase 3 step 6 iii)
`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>
2026-11-16 09:46:27 +01:00
Sheraff
390f5c52a4
refactor(router-utils): the mutation model is assignments and own-name member writes (phase 3 step 6 ii)
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>
2026-11-16 09:43:55 +01:00
Sheraff
27f247bf2f
refactor(router-utils): drop the unit model's effect judgement and rule L (phase 3 step 6 i)
`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>
2026-11-16 09:41:10 +01:00
Sheraff
afa57e159c
refactor(router-utils): clusters per unit and a write table of assignments (phase 3 step 5)
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>
2026-11-16 09:29:06 +01:00
Sheraff
07af2ab096
refactor: delete extracted-export outputs and their host hooks (phase 3 step 4)
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>
2026-11-16 09:10:03 +01:00
Sheraff
7c9e76324c
refactor(router-utils): delete the old placement engine's stages and its kept reports (phase 3 step 3)
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>
2026-11-16 09:05:39 +01:00
Sheraff
de6e23e800
refactor(router-utils): place every plan with route-placement (phase 3 step 2)
`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>
2026-11-16 08:59:32 +01:00
Sheraff
86a5f70b66
tests(router-utils): delete the old engine's rows, place the kept ones as on route-placement (phase 3 step 1)
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>
2026-11-16 08:57:34 +01:00
Sheraff
71b1ff1639
Merge branch 't3/phase2-hydrate' (phase 2 of one placement, R155/R161: <Hydrate> chunks use route-placement and copy what main copies (H1), importing only Route, a declaration leading back to their own boundary, statement-declared names and main's shared names (H2); non-route Hydrate plans leave the old engine, which fixes a client leak of a handler-only function and its .server import; a generated claim whose owner the output no longer keeps is unused (a boundary inside an erased server/headers option builds as on main); export extraction and the shared lazy module between boundaries deleted; a chunk writing its copy of kept state is refused when the writing code left the file; nine module-level rows return to main's behaviour (KNOWN-BUGS); 0 leaks, client bytes never above main beyond recorded rows, 18 bundle scenarios identical, compile time equal or faster; Hydrate e2e on Vite and Rsbuild green; Fable spec, stop rulings and three reviews)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 02:19:26 +01:00
Sheraff
1420cfdff0
fix(router-utils): refuse a Hydrate chunk's copy-write only for code that left the module (review-phase2-fixes 1.3)
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>
2026-11-16 02:19:05 +01:00
Sheraff
ef9aa56252
fix(router-utils): Hydrate chunks refuse to assign their copy of kept state, and import the route binding (measure-phase2 findings 1, 2)
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>
2026-11-16 01:45:24 +01:00
Sheraff
9cc5260b80
docs: record the Hydrate chunk's import of a declaration a var-declaring statement reads (review-phase2-final 3.2, 4.2)
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>
2026-11-16 01:09:13 +01:00
Sheraff
82239d7a3d
tests, docs: <Hydrate> rows that return to main's copy behaviour (R161 D1), SPEC and README
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>
2026-11-15 23:42:46 +01:00
Sheraff
e62da52cb7
tests: N7 in an app marked sideEffects: false
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>
2026-11-15 23:36:22 +01:00
Sheraff
9004fa5b4f
fix(start-plugin-core): hydrate-module-write names what remains, and only split={false}
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>
2026-11-15 23:30:11 +01:00
Sheraff
fcfe042878
feat(router-utils): <Hydrate> chunks copy what their children reach (H1/H2, spec-phase2-hydrate)
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>
2026-11-15 23:29:30 +01:00
Sheraff
5a4efab4fb
fix(router-utils): a claim owner its output no longer keeps is unused, whatever its home
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>
2026-11-15 23:20:55 +01:00
Sheraff
7d370a56e8
fix(router-utils): place <Hydrate> plans with route-placement (leak fix, spec-phase2-hydrate 3.2)
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>
2026-11-15 23:04:38 +01:00
Sheraff
38c0ab74be
tests: phase 2 <Hydrate> rows, failing first (spec-phase2-hydrate 5.1)
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>
2026-11-15 22:58:27 +01:00
Sheraff
75647e727a
docs(router-utils): note the possible hook-call optimisation next to callsHook (R160)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:12:56 +01:00
Sheraff
c249c8e4ab
Merge branch 't3/fix-clientonly-locals' (ClientOnly on SSR: hook calls only erased children used stay as statements, by design: main drops them, which shifts useId and breaks hydration (React #418, verified in Chromium); two useId hydration rows pin it; no compiler change)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:08:47 +01:00
Sheraff
2afddc52bf
tests: <ClientOnly> rows of the useId hydration regression test: a hook call (useId, or a custom hook calling it) only the children read keeps running on the server, ids match (main drops it: React #418)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:00:27 +01:00
Sheraff
0eec02f949
Revert the hook-call removal rows (7d2a63d811): main's removal of hook calls mismatches useId at hydration; ours keeps them (maintainer, runtime check)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 21:58:32 +01:00
Sheraff
7d2a63d811
tests: a hook-call local only <ClientOnly> children read goes on the server with its import, transitively (failing first); a local kept code also reads stays (guard)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 21:50:06 +01:00
Sheraff
c46ffaea43
Merge branch 't3/serverfn-caller-copy' (R159: a split chunk's copy of a server fn is a caller: the user's own chain, .validator links dropped, .middleware kept, handler replaced by createSsrRpc(id), so any chain shape (imported or same-file builders, barrels, factories, non-literal options) loads at chunk load as main and calls the one executing instance through the registry; the stub, its syntax conditions, the two-arrangement split, tsrFn$ re-exports and createSsrFnStub with its runtime exports are deleted (runtime files match main); 0 leaks, client outputs and bytes identical, server env modules -37 KB; Start e2e green on Vite and Rsbuild; Fable review)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 21:43:31 +01:00
Sheraff
da180fc01d
docs, tests: R159's caller copy in the words (router-utils compiler README, rewrite.ts, start-env, SPEC J4.2, KNOWN-BUGS accepted limit, Rsbuild COMPILER_ARCHITECTURE, changesets ssr-serverfn-one-instance and start-compiler-yuku); dev row: a hoisted server fn a plain file names, handler edit reaches SSR and HTTP calls on Vite and Rsbuild (Fable review r159)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 21:43:14 +01:00
Sheraff
8acdc55705
compiler core, start, runtime: delete what the caller copy made dead (R159 step 4): namedByEnvRoots and its importsFromEnv arm; the VariableDeclarator condition (a hoisted server fn's chain is lazy too); createSsrFnStub and its react/solid/vue ssr-rpc exports, start-client-core's FetcherBase type export (back to main); the core rows that existed for namedByEnvRoots
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>
2026-11-15 20:43:53 +01:00
Sheraff
a0411ac1d7
tests: a hoisted server fn with a middleware in a split component loads nothing at server start (R159 step 4, failing first); a server fn a top-level statement names and the component calls has one instance, 1 2 3 4 (guard)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 20:39:25 +01:00
Sheraff
6faea8b163
start: a split chunk's caller copy has no validator (R159 step 3): the existing link-stripping loop erases a server fn's validator link in { kinds: ['split'] } for a lazy provider, as the client's copy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 20:38:23 +01:00
Sheraff
9beffd66df
tests: a split chunk's caller copy has no validator: the schema is built once, by the instance; a validator assigning an exported binding leaves the component split on the server, 1 2 3 4 (R159 step 3, failing first)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 20:37:17 +01:00
Sheraff
65f471a775
start: a split chunk's copy of a server fn is a caller (R159 step 2): the user's chain with createSsrRpc(id) as handler, in { kinds: ['split'] }; stubOf (literal method, factory-call root, static keys), the tsrFn$ re-export and the stub's dynamic import are gone; the file never roots the wrapper of a lazy provider's top-level server fn
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>
2026-11-15 20:36:15 +01:00
Sheraff
a8f37a25cc
tests: builder shapes S0-S5 whose server fn only a split component names load their chain with the chunk as on main, the handler's imports at the first call; one instance (1 2 3 4, #8656, validator state, snapshot a/b); the middleware's client half and its context; method and url; dev edits of an imported builder and its handler (R159 step 1, failing first on the load rows); the stub's fallback row removed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 20:33:57 +01:00
Sheraff
bcf5ee11c5
Merge branch 't3/serverfn-lazy-r158' (server functions: one instance, lazy as main, R157 + R158: the handler module imports what the file keeps and never copies (#8656 fixed again, validator state and sibling server fns right, snapshot 'a/b'); a handler-only declaration whose value reads source state the file keeps stays in the file, a handler assigning kept state stays in place; the file holds a server fn only when its own remaining code names it, otherwise the lazy module holds it with its chain and split chunks call it through createSsrFnStub; the registry points at the lazy module; planner-generated declarations are not file state; erasure gate records load phases: server-start loads above main 74 -> 4 (2 accepted pins, 2 ClientOnly rows for later), 0 leaks; client outputs byte-identical; unit/types/lint, integration, Start e2e server fns + RSC on Vite and Rsbuild, dev/HMR green; Fable design + reviews)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 18:28:40 +01:00
Sheraff
16d541d19f
compiler core, start: rule 4 counts declarations of the source only (R158 amendment); the stub forwards __executeServer and is typed as FetcherBase; claimOwners skip removed
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>
2026-11-15 18:04:00 +01:00
Sheraff
7093a0a217
tests: the step-4 stop's shape (a route loader names one server fn, another only the split component calls stays lazy; the stub's url and method), failing first (core, Vite/Rsbuild build); a stub-less fallback shape (stored builder, non-literal method) keeps R157's one instance; dev: the stop shape's lazy chain edited, one instance over HTTP (R158 amendment)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 18:01:07 +01:00
Sheraff
83531d3a64
start: a server fn the file's code does not name lives in the lazy module with its chain; a split chunk calls it through a stub (R158 step 4, rules 1 and 2)
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>
2026-11-15 17:23:52 +01:00
Sheraff
7920193cfc
compiler core: a { kinds } scope (text for outputs another planner declares); a split chunk imports what the env module keeps that generated code a planner's lazy module roots names (R158 step 4, rule 2)
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>
2026-11-15 17:23:52 +01:00
Sheraff
8ba4932df3
start tests: a server fn the file's code does not name loads nothing at server start or with the chunk, its chain built once at the first call (route probe, cubby), failing first; the state it shares with its module (chain state 1 2 3 4, validator state, snapshot a/b, #8656) (R158 step 4)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 17:11:06 +01:00
Sheraff
b304352062
start hosts: the resolver imports the registry's lazy module of a path with a # (escaped as the file's own imports are); a dev lookup accepts its hot updates (R158 step 3)
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>
2026-11-15 16:26:44 +01:00
Sheraff
884d67eec1
start: the registry imports every server fn's wrapper from the file's lazy module, which re-exports it (R158 step 3, rule 3)
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>
2026-11-15 16:18:56 +01:00
Sheraff
f096f9b43f
start tests: an HTTP call loads its handler's imports before its middleware, as main's provider module (R158 step 3), failing first; direct and HTTP calls share one instance; HTTP call of a top-level-await module
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 16:12:49 +01:00
Sheraff
ce63e930b3
router planner: main's shared names are read from the text the route module keeps; what a planner moves to another output (a server-fn handler) reads nothing there (R158 step 2)
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>
2026-11-15 15:50:18 +01:00
Sheraff
9bbf7cbfb8
start tests: a declaration only a route's server-fn handler reads loads on the first call, not with the route's shared module (R158 step 2), failing first
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 15:47:00 +01:00
Sheraff
6762b4675c
start tests: dev edits of a pinned declaration and of a handler reach server code and HTTP calls (Vite, Rsbuild; R157)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 14:16:01 +01:00
Sheraff
4883c38e7d
placement: a server-fn handler module imports what its file keeps; a handler-only declaration evaluating a read of kept state stays (R157)
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>
2026-11-15 13:59:19 +01:00
Sheraff
eb48025f0b
router-utils tests: a planner's lazy module imports what the env module keeps; the pin (R157 rules 3, 4), failing first
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 13:57:38 +01:00
Sheraff
fee6abdd26
start tests: one instance per server-fn file on SSR (R157), failing first
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>
2026-11-15 13:54:10 +01:00
Sheraff
b89355a9fe
Merge branch 't3/fix-ssr-serverfn-instance' (a derived output imports, instead of copying, a declaration an env-rooted generated unit names: one server-fn instance on SSR for split chunks and handler modules (chain state 1 2 3 as main, schema built once, sibling handlers 1 2 3 4); client outputs unchanged, bytes identical; validator-state case pinned as an accepted limit)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 13:43:55 +01:00
Sheraff
0cfcab4f23
oracle: KNOWN-BUGS entry for a handler reading state its validator writes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 13:27:51 +01:00
Sheraff
6410f54a12
placement: a chunk imports what a generated unit rooted in the env module names (one server-fn instance on SSR)
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>
2026-11-15 13:01:55 +01:00
Sheraff
02f8d6b8bd
Merge branch 't3/one-placement-phase1' (phase 1 of one placement, R155/R156: server-fn handler modules, the RSC provider copy and every erasure-only plan use route-placement; handler modules copy what they need as main's provider does (R156: main's values, main's second instance, #8656 back as a follow-up); a copy also takes the top-level statements and never-read declarations reaching what it copies by name, stopping at imported bindings; enum/namespace removable; a value only a type-only export reads goes; erasure gate (leaks first, 14 controls): 0 leaks, no regression class entered; corpus 58,075 compiles, 0 throws, 0 unparseable; client bytes identical; Start e2e server-fn + RSC green; three Fable reviews)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 12:37:41 +01:00
Sheraff
80054e1e62
placement: the copy's walk stops at what the output imports (O1)
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>
2026-11-15 12:19:33 +01:00
Sheraff
bd4b7c6d23
tests: r5 pinned as an accepted known difference; #8504 pin follows R1 (main throws there, R153)
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>
2026-11-15 11:54:19 +01:00
Sheraff
33d1a9a16d
placement: a never-read declaration is one nothing references, an export included (R1)
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>
2026-11-15 11:26:58 +01:00
Sheraff
2dbbe8eaf2
placement: the provider copy takes the top-level code reaching what it copies too (R1)
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>
2026-11-15 11:18:21 +01:00
Sheraff
f5ff4419a8
placement: a chunk copies the top-level code reaching what it copies (R1)
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>
2026-11-15 10:58:25 +01:00
Sheraff
73d198f21c
Merge branch 't3/yuku-compiler-rewrite' into t3/one-placement-phase1 2026-11-15 10:47:34 +01:00
Sheraff
cb9d1331b2
Merge branch 't3/fix-chunk-copy-gaps' (copies into chunks keep their annotation comments: a copy drops only the export/default keywords, so #__NO_SIDE_EFFECTS__ / @__PURE__ survive and the bundler drops what main's build drops; export default <expression> is copied like any statement, as void (<expression>); corpus 140 files changed in comments/blank lines only, 0 code changes; bytes 0 larger)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 10:47:01 +01:00
Sheraff
a000713237
route splitting: chunk copies keep their annotations and run export default <expression>
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>
2026-11-15 10:46:33 +01:00
Sheraff
5d02cca2f2
start tests: handler modules hold their own copy of module state, as main (R156; #8656 follow-up)
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>
2026-11-15 09:33:12 +01:00
Sheraff
5a2e5ed0bf
placement: server-fn handler modules copy as route chunks do (R156)
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>
2026-11-15 09:05:21 +01:00
Sheraff
ea29359a36
compiler: words for one placement of every plan but <Hydrate>'s (R155 phase 1); changeset
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 08:33:09 +01:00
Sheraff
2ee814b03d
placement: a value only a type-only export reads goes, as on main (F1)
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>
2026-11-15 08:32:27 +01:00
Sheraff
17750affca
Merge branch 't3/yuku-compiler-rewrite' into t3/one-placement-phase1 2026-11-15 08:23:01 +01:00
Sheraff
ed239d5283
Merge branch 't3/fix-type-only-exports' (type-only export syntax is removed from every output, as main does: export type { X }, export { type X } and export type { } from left behind after their import went made Babel reject the output, so a Babel plugin after Start (React Compiler) failed builds main passes; 28 non-route + 2 route corpus files fixed; corpus parse gate 0 unparseable outputs except one truncated source; 6 route modules changed, chunks unchanged)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 01:15:42 +01:00
Sheraff
912318c70d
compiler: no output keeps type-only export syntax (main's stripTypeExports)
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>
2026-11-15 01:15:23 +01:00
Sheraff
199de6c765
placement: every plan without <Hydrate> on the one placement (R155 phase 1)
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>
2026-11-15 00:33:01 +01:00
Sheraff
2ac36c5aee
route placement: enum and namespace declarations go by the removal rule (R155)
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>
2026-11-15 00:00:03 +01:00
Sheraff
aba1db3a47
start compiler tests: erasure parity pins against main before handlers move to the one placement
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>
2026-11-14 23:53:58 +01:00
Sheraff
3d7bdd91e4
Merge branch 't3/split-methods-this' (Fable review fixes: the this warning and guide say only that splitting can change what this refers to; route HMR keeps a method using its own this or super as a method; <this.Foo /> counts as a use of this; corpus 58,075/58,075 identical)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 23:03:19 +01:00
Sheraff
61d2073a40
route splitting: accurate this-rule texts (F1), route HMR keeps a method using its own this/super (F2), <this.Foo /> counts as this (F3)
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>
2026-11-14 23:03:01 +01:00
Sheraff
b7baa085be
Merge branch 't3/split-methods-this' (route options written as methods split like function expressions (#8623); a function value using its own this or super stays unsplit with one warning (#8688), by the language's this-binding scopes; methods count toward main's shared names; corpus 58,075 compiles, 32 method routes changed, no this refusals; 21 files split more, 12 eager +7 B where a method-read binding is now shared instead of copied, as main does for the function-expression form)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 22:36:27 +01:00
Sheraff
f3676ded6e
route splitting: methods split as function expressions (#8623); a function value using its own this or super stays, with a warning (#8688)
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>
2026-11-14 22:26:26 +01:00
Sheraff
12a9c5c3f9
Merge branch 't3/placement-main-shape' (route splitting does what main does, R153: one placement for route files built from main's rules: main's shared names in one fixed point into one shared module, chunks import only Route / export const|let|var / shared names and copy the rest, main's split switches transcribed; the compiler only removes what its changes made unused (types count as original uses, values as remaining ones), already-unused declarations stay in the route file, already-unused imports move into the shared module in source order; erased code writes nothing; the old placement engine's route-only machinery, timing rules, export extraction and kept diagnostics removed with their tests; classic JSX runtime with code splitting unsupported; fixtures, 58,075-compile corpus incl. 15 showcase repos: no file worse than main in behaviour or eager/total bytes beyond recorded exceptions; Vite 8 12-route app byte-identical to main; compile -4 to -6 % per module vs head; four Fable reviews)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 21:52:26 +01:00
Sheraff
72499c8ce1
route splitting: never-used imports move only when the route module reads a shared name (R1)
- 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>
2026-11-14 21:52:04 +01:00
Sheraff
ad2b1855cc
route splitting: types count as a use, never-used imports move to the shared module, W1
- 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>
2026-11-14 21:05:13 +01:00
Sheraff
7005e3e517
route splitting: remove only what the split made unused; drop the classic JSX accommodation; N1, N2
- 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>
2026-11-14 19:33:34 +01:00
Sheraff
e229cf2dbf
route splitting: the shared module holds main's shared names only
- 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>
2026-11-14 18:34:38 +01:00
Sheraff
61011c835f
route splitting: shared names live in the shared module, as on main
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>
2026-11-14 17:41:50 +01:00
Sheraff
0574610b63
route splitting: copy where main copies, main's split switches, reachability in the route module
- 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>
2026-11-14 17:10:32 +01:00
Sheraff
5e69a9a6ba
test(router-plugin): distinct export names for the exported-option rows (the warning prints once per file and wording in a run)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:33:17 +01:00
Sheraff
e85a11c1e4
docs: route splitting as main does it (R153): SPEC J2.0 and the clauses it supersedes, KNOWN-BUGS, core README, router-plugin AGENTS and architecture, the guide's rules; changesets of removed behaviour deleted or reworded, one for what ships
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:24:19 +01:00
Sheraff
af0fd33655
test(router-plugin): main's split shapes, exported option values and one instance of module state, by behaviour (spec-main-splitting §1.5-1.7)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:19:43 +01:00
Sheraff
65e5507df9
tests: the rest of R153's removals (statements that move, unreadable/object loaders, exported components extracted, kept warnings); Start's server-fn loader rows keep their inputs with the new outcome; the exported-option warning has a position
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:18:15 +01:00
Sheraff
7749e88f2b
router-plugin integration tests: delete what R153 removes; keep inputs that cover splitting (split-module-ids, identity, robustness, cyclic exports) with the new expectations
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:14:16 +01:00
Sheraff
4cfa58d49b
router-plugin tests: delete what R153 removes (object-form loaders, this/method refusals, reassigned values, timing rules, old warnings, the 7 whole files of spec §3.3); exported components stay unsplit in react-refresh and HMR tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:07:17 +01:00
Sheraff
f661029ca3
router-utils: drop route-only engine code (R152 calledLater/holds, keep, describeModule, route-module branches); engine tests drive it as Hydrate and handlers do (R153)
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>
2026-11-14 14:56:47 +01:00
Sheraff
35b296af55
Merge branch 't3/yuku-compiler-rewrite' into t3/placement-main-shape 2026-11-14 14:48:59 +01:00
Sheraff
1280442890
router planner: an option another planner already rewrites in place stays, warned, instead of failing the build
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 14:41:19 +01:00
Sheraff
3e0ea1264d
route placement: a generated unit with an effect is a statement, never removed (route HMR's block)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 14:26:37 +01:00
Sheraff
c38247384a
route placement: a write the output erases (a client's stubbed handler) assigns nothing there
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 14:14:44 +01:00
Sheraff
607f2454e1
route placement: a derived output that would assign a binding it imports falls back (its root stays in place)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 14:10:10 +01:00
Sheraff
77f501a972
Merge branch 't3/erasure-keep-statements' (erasure keeps top-level statements: a top-level statement that writes a binding stays whenever erased code was the binding's only other reader, as on main, which never deletes a top-level statement; declarations still go by reachability; 13 client + 1 server inputs that silently lost a statement now keep and run it, plus deleteNodes and Hydrate-fallback probes; corpus 53,490/53,490 identical)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 14:07:33 +01:00
Sheraff
34a087d9fc
test: route-file outputs that would assign a binding they import (failing)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 14:07:05 +01:00
Sheraff
67dcc4d093
docs: top-level statements stay when erasure removes what they write; changeset
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 14:02:46 +01:00
Sheraff
711a350a56
test: deleteNodes and the server's Hydrate fallback keep a top-level statement writing a binding only they read
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 14:02:20 +01:00
Sheraff
26e3e3e7aa
fix(router-utils): keep top-level statements writing a binding only erased code reads
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>
2026-11-14 13:58:28 +01:00
Sheraff
f798cd51ce
test(start-plugin-core): top-level statements on a binding only erased code reads still run
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>
2026-11-14 13:54:55 +01:00
Sheraff
c52a37428b
prototype: a value merged with a type namespace is split (its value declaration decides)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 13:54:46 +01:00
Sheraff
f6765c29e1
prototype: type-only uses, merged types and class declarations in the route placement
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 13:50:36 +01:00
Sheraff
a8b936233c
prototype: drop the method/member split paths main does not have
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 13:44:24 +01:00
Sheraff
72031c22c7
prototype: route files placed as main splits them (route-placement.ts), split decisions as main's
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 13:43:19 +01:00
Sheraff
64bc4de0d5
Merge branch 't3/fix-round2-messages' (review round 2 F2-3, F4-1, F4-2, F5-2: a declaration whose own initialiser changes a kept binding, read only by split code, warns once at it with a fix that works (G4); a require() of a denied file is reported at the call as the import it is, and pattern imports through a cast of import.meta are named (G1); import protection reports a Vue SFC importer at its SFC position without a source map, through the compiler's one original-position owner (new class G7, no rule changed); the id warning of a repaired route constructor prints once at its position in the repaired file (G1); corpus 53,490/53,490 identical incl. diagnostics, spelling classes identical to base in both modes)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 21:29:05 +01:00
Sheraff
5e1edcd123
chore: changeset for round 2's message findings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 21:22:08 +01:00
Sheraff
838320536b
Merge branch 't3/vite-watch-stale-route-output' (review round 2 F3-1: vite build --watch follows route files created while it watches: every Vite watch build generates through the generator session's own watcher, as Rspack/webpack watch builds do, deciding watch from the top level's or any environment's build.watch, a new watcher per generation, closed at closeWatcher; not a B2 regression (pre-B2 and main alike); config-file builds still generate once, non-watch output byte-identical) 2026-11-13 21:15:12 +01:00
Sheraff
19a7fca6bf
fix(router-plugin): vite build --watch follows route files created while it watches
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>
2026-11-13 21:14:35 +01:00
Sheraff
77533b4736
fix(start-plugin-core): a module with no file to read keeps its code's positions
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>
2026-11-13 21:14:16 +01:00
Sheraff
47549100e9
fix(router-generator): the id of a repaired route constructor is reported at its position in the repaired file
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>
2026-11-13 21:11:14 +01:00
Sheraff
58bb1c0263
test: round 2 F5-2, the id of a repaired route constructor is reported twice, first at a stale column
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 21:10:15 +01:00
Sheraff
cd2c3b330c
fix(start-plugin-core): import protection reports a Vue SFC importer at its position in the SFC without a source map
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>
2026-11-13 21:08:16 +01:00
Sheraff
f83db6741c
test(start-plugin-core): round 2 F4-2, import protection reports a Vue SFC importer at compiled coordinates without a source map
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 21:05:29 +01:00
Sheraff
5d331939ca
fix(start-plugin-core): a require() or a cast webpackContext is reported at the call, as what it is
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>
2026-11-13 21:02:35 +01:00
Sheraff
9a7c53fd4a
test(start-plugin-core): round 2 F4-1, a require() or a cast webpackContext is reported as an import another plugin added
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 20:59:17 +01:00
Sheraff
14b7c743ad
test(router-plugin, start-plugin-core): round 2 F3-1, a route file created during vite build --watch
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>
2026-11-13 20:58:51 +01:00
Sheraff
73e02cd235
fix(router-utils): a declaration whose initialiser changes a kept binding warns at it
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>
2026-11-13 20:55:53 +01:00
Sheraff
0cceaeee51
test(router-plugin): round 2 F2-3, a declaration whose initialiser changes a kept binding stays silently
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 20:53:46 +01:00
Sheraff
a51526715f
test(start-plugin-core): remove the corpus tool's runner committed by mistake
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>
2026-11-13 20:35:57 +01:00
Sheraff
75d6147a13
Merge branch 't3/fix-round1-placement-aliases' (review round 1, F2-1 to F2-3: the mutation model gives a local name (a parameter, a for…of or catch variable, a function's own alias) the value its sources give, a parameter's from the calls that may reach its function, so a write through it is a write of the object it names; a member write a value or declaration runs in a function it calls is its write at load, as the let twin was; one warning at the cause; arguments[0] not covered (no binding); corpus outputs identical, spelling green, placement-exec and fuzz on seeds 1800000 identical to the freeze, perf CIs include 0)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 19:32:31 +01:00
Sheraff
117ed15cfc
fix(router-utils): handedTo's climb types on TypeScript 5.6/5.7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 19:29:31 +01:00
Sheraff
1b7e215e41
fix(router-utils): a local name holds only what flows into its sources
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>
2026-11-13 18:50:54 +01:00
Sheraff
673db600ca
Merge branch 't3/fix-round1-route-findings' (review round 1, F5-1 to F5-4: routeCallOf reports a code-based createRoute and a Route declared by a destructuring pattern as unrecognised routes (warned, server options ship, as the other unrecognised shapes; maintainer 11-13 on F5-2), the route id is read through parentheses and TS assertions, and a Vite build with inline plugins prints each generator warning once; corpus outputs identical (one wrapped-route message text), spelling green, perf CIs include 0)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:42:38 +01:00
Sheraff
2b437f57e4
docs(router-utils): local names and writes a value runs in the mutation model; changeset
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 18:38:21 +01:00
Sheraff
3275151c92
fix(router-utils): writes through local names and in functions a value calls keep their order
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>
2026-11-13 18:35:33 +01:00
Sheraff
ecddb9e18a
test(router-utils, router-plugin, start-plugin-core): round 1 F2-1, F2-2, F2-3 regressions
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>
2026-11-13 18:35:33 +01:00
Sheraff
3670c3d65b
fix(router): report createRoute and destructured Route exports, unwrap the route id, print generator warnings once per Vite build
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>
2026-11-13 18:30:18 +01:00
Sheraff
288883d303
test(router): round 1 F5-1 to F5-4 route findings (failing)
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>
2026-11-13 18:22:23 +01:00
Sheraff
e5380aeb16
Merge branch 't3/perf-b2-one-generation' (perf pass B, lane B2: a Vite build whose environments share the plugins generates the route tree once instead of once per config resolution; the generator plugin's config hook marks the resolution that was given it; output byte-identical, generator CPU −48/−192 ms on react-start medium/large)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 17:14:43 +01:00
Sheraff
429ff46e67
Merge branch 't3/start-build-watch-flake-triage' (a watch build without a usable temp dir: its warning says the server's documents may keep the client's older files, also after a save both environments bundle when the client's build of it starts later, and offers a writable temp dir or TMPDIR and a restart; the failed-write warning drops the same false advice; the test asserts the wording and what the mode guarantees, then applies the fix)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 16:12:13 +01:00
Sheraff
5d1ff071da
Merge branch 't3/revert-time-sequencer-sharding' (CI shards: the compiler slow tiers split with Vitest's default --shard, as main's sharded targets use their runner's own split; the time-based sequencer, its stored file times and control test are removed; start-plugin-core keeps 6 shards, router-plugin 4)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 15:59:34 +01:00
Sheraff
1b34247c91
test(ci): shard the compiler slow tiers with Vitest's default split
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>
2026-11-13 15:59:28 +01:00
Sheraff
8410ca57e0
fix(start-plugin-core): the watch build's warning without a usable temp dir states what the server's documents may name, and a fix that works
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>
2026-11-13 15:51:25 +01:00
Sheraff
a7ec87ed11
Merge branch 't3/start-build-watch-flake-triage' (start-build-watch CI flake: the build harness's rebuild by cause ignores a build that emits what the one before emitted (Rolldown reported one save twice under load; Start's server had embedded the last client build), and its quiet window counts the end of each build (a sentinel written in generateBundle was reported after the window had already elapsed); Start unchanged)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 15:39:33 +01:00
Sheraff
99fdda2934
test(start-plugin-core): a watch build's quiet window counts the end of each build
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>
2026-11-13 15:31:37 +01:00
Sheraff
d107240c35
test(start-plugin-core): a watch step's rebuild by cause follows the builds that moved what an environment emits
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>
2026-11-13 15:14:58 +01:00
Sheraff
0f5482beae
test(start-plugin-core): a client-only save the client builds again, unchanged, after the server's rebuild began settles
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>
2026-11-13 15:12:31 +01:00
Sheraff
c152d92c05
Merge branch 't3/reads-move-hint-gaps' (seen-move: a statement changing a binding code the route module keeps uses offers no move, naming that code's line (P04b: moving it made beforeLoad see an empty table); an unused declaration doing so is reported (const n = table.add(d).size was silent; its link twin asked to delete it); the state hint names a module of its own that exports the functions writing it (a let moved there and still assigned is a read-only import))
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:17:17 +01:00
Sheraff
ca98fd8ebb
Merge branch 't3/phase6-step5-ci-shards' (phase 6 step 5: CI shards: start-plugin-core 6 shards; both compiler slow tiers split their shards by stored CI file times (compiler-test-utils/time-sequencer) instead of Vitest's path hash)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:11:31 +01:00
Sheraff
60a9bb71ab
test(ci): split the compiler slow tiers' CI shards by stored file times
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>
2026-11-13 14:11:23 +01:00
Sheraff
4c01809241
fix(router-utils): a joined declaration is reported only when nothing imports it and it holds no option value
`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>
2026-11-13 14:07:10 +01:00
Sheraff
f8a8423072
test(router-utils): the route options' declaration writing a binding at load reports nothing of what the options use (spelling suites: value-own-writes flags)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:07:10 +01:00
Sheraff
84e9b6bb33
fix(router-plugin): offer the state in a module of its own that exports the functions writing it
"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>
2026-11-13 14:00:27 +01:00
Sheraff
90824cf16a
test(router-plugin): the state hint of a split option writing a binding names a module of its own exporting its writers, and works applied
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:00:27 +01:00
Sheraff
f0ca0b89ff
fix(router-utils): offer no move for a statement changing a binding code the route module keeps uses
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>
2026-11-13 14:00:27 +01:00
Sheraff
ee45ff685a
test(router-plugin): P04b and its unused declaration warn once at d and keep what beforeLoad sees
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:00:27 +01:00
Sheraff
778e50bde4
test(router-utils): a statement changing a binding code the route module keeps reads offers no move; an unused declaration doing so is reported
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>
2026-11-13 14:00:27 +01:00
Sheraff
9ed7276e53
Merge branch 't3/merge-server-code-check' (the server-code check as built, option (a): recorders read Start's analysis and the router's recognised route options, not what the planners erase; P02, P02b-e and P15 now fail the build at the check; a self-contained net meant to be removed a couple of months after the release)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 13:54:49 +01:00
Sheraff
94a858e330
Merge branch 't3/phase6-step4-remove-correct-tests' (phase 6 step 4: remove and correct: root-route pins become 2 ordinary tests (R60), the 11 pattern-import pins deleted (R142), KNOWN-BUGS accepted limits, SPEC to the rulings after R147, tier budgets dropped, start-build-options split by subject, split claims in the last three files, start-dev-freshness on the platform smoke list; pins 82 -> 55)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 13:54:09 +01:00
Sheraff
fdab62ef9b
Merge branch 't3/eager-export-reads-move' (reads-move: the moves eager-export:reads and eager-split:written offer name what the moved code reads at load and the statements writing it then (Events.movedWith), so they work when applied; only the route options' declaration keeps a move from being offered; a known method's statement on a kept binding (P04b with add) and an exported binding written together are reported)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 13:43:20 +01:00
Sheraff
b6fc49e27b
fix(router-utils): only the route options' declaration keeps a move from being offered
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>
2026-11-13 13:35:59 +01:00
Sheraff
5b2386ffaf
test(router-utils): a move whose code holds another planner's claims or generated code is offered (corpus: Start server functions)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 13:35:51 +01:00
Sheraff
0a12eb207b
Merge branch 't3/server-code-check-recognition' (the server-code check records server-only text at recognition: Start's analysis and the router's recognised route options, not what the planners erase; as built, option (a))
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>
2026-11-13 13:31:14 +01:00
Sheraff
7e0a7c1a34
perf(router-plugin): one route generation per Vite build whose environments share the plugins
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>
2026-11-13 13:29:31 +01:00
Sheraff
7b2b97839e
test(router-plugin, start-plugin-core): generations of the route tree per Vite build whose environments share the plugins
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>
2026-11-13 13:29:31 +01:00
Sheraff
82292416b3
fix(router-utils): report an exported binding a statement writes with a binding the route module keeps
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>
2026-11-13 13:28:21 +01:00
Sheraff
6ff43502e4
test(router-utils): an exported binding a statement writes with a kept binding warns as an unexported one does
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 13:25:48 +01:00
Sheraff
3aa7935be3
test(start-plugin-core): start-dev-freshness on the macOS/Windows smoke list
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>
2026-11-13 13:24:29 +01:00
Sheraff
f23da882f4
test(router-plugin): split claims asserted in the three files step 3 left
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>
2026-11-13 13:24:29 +01:00
Sheraff
9b452ffc55
test(start-plugin-core): split start-build-options by subject
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>
2026-11-13 13:24:29 +01:00
Sheraff
11231ab9a0
test(compiler-test-utils): drop the per-tier time budgets
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>
2026-11-13 13:24:29 +01:00
Sheraff
3d7973c194
docs(compiler-test-utils): SPEC up to the rulings after R147
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>
2026-11-13 13:24:29 +01:00
Sheraff
0a77e920ec
docs(compiler-test-utils): KNOWN-BUGS: accepted limits apart from pins
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>
2026-11-13 13:24:29 +01:00
Sheraff
65cd8780ed
test(start-plugin-core): delete the 11 pattern-import pins (R142: pattern imports are not covered)
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>
2026-11-13 13:24:29 +01:00
Sheraff
c590cf2a50
test(router-plugin): root routes are not split (R60): two ordinary tests replace the 16 root-route pins
"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>
2026-11-13 13:24:29 +01:00
Sheraff
007774db1a
fix(router-utils): the joined-statement report counts the kept cluster's own other code as a use by the route module
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>
2026-11-13 13:22:30 +01:00
Sheraff
3fdab4fd11
Merge branch 't3/yuku-compiler-rewrite' into t3/eager-export-reads-move 2026-11-13 13:19:47 +01:00
Sheraff
8f223470d0
fix(router-utils): a known method's joined statement reports what it uses through Events.unitChanges
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>
2026-11-13 13:19:39 +01:00
Sheraff
34d05d5790
test(router-utils): a known method's statement keeping a holder of a binding, or an exported binding, warns as an unknown call does
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 13:19:39 +01:00
Sheraff
de40214243
fix(router-utils): report a binding only split code uses that a known method's statement on a kept binding keeps
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>
2026-11-13 13:14:00 +01:00
Sheraff
66c4d69a86
test(router-utils, router-plugin): a statement a known method makes a writer of a kept binding warns once for the binding it uses, only split code needs (phase 6 step 3, P04b with add)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 13:10:21 +01:00
Sheraff
9b0096eef4
fix(router-utils): the move an eager-split:written warning offers takes what the moved code reads at load and the statements writing it then
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>
2026-11-13 13:05:56 +01:00
Sheraff
3f4b32833f
test(router-utils, router-plugin): the move an eager-split:written warning offers names what the binding reads at load and the statements writing a moved binding then, and works when applied
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 13:04:23 +01:00
Sheraff
49dc78cb15
fix(router-utils): the move an eager-export:reads warning offers takes what the moved code reads at load
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>
2026-11-13 13:02:40 +01:00
Sheraff
622d4e7d92
Merge branch 't3/phase6-kill-table-gap-closure' (phase 6 step 3: close the kill table's gaps: user-visible tests for P22/P11/P04b, vacuous split claims made real, split checks per fixture (route-HMR pages: splitOutputs), 11 more mutations all killed, labels of upstream and private reliances, assumption tests, dev-file-back on the platform smoke list, users' mode e2e on Linux arm64)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:56:26 +01:00
Sheraff
47410e63d3
test(router-utils, router-plugin): the move an eager-export:reads warning offers names what the export and the binding it reads read at load, and works when applied
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:56:21 +01:00
Sheraff
6369cf69a7
ci(compiler-platforms): users' mode: the two e2e production builds with self-checks off, under the app's Playwright spec (Linux arm64)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:55:44 +01:00
Sheraff
29aaec59b9
ci(compiler-platforms): rsbuild/dev-file-back joins the smoke list (dev on macOS and Windows)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:51:29 +01:00
Sheraff
2a70e00673
Merge branch 't3/fix-eager-split-warning-move' (state-move: the move a state warning offers names what the moved code reads at load, what reads a moved binding before a moved write and the code assigning it, so it works when applied; no move when it would need the route)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:50:44 +01:00
Sheraff
bce5704567
test(router-plugin): import order
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:50:37 +01:00
Sheraff
744bf15be6
test: phase 6 step 3c: where the split component of the map-sources, imports-exports and dead-code builds and the exported-values page loads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:48:12 +01:00
Sheraff
f1555c156d
fix(router-utils): the move a state warning offers takes what the moved code reads at load (round tools class A)
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>
2026-11-13 12:45:55 +01:00
Sheraff
893e32a81e
test(router-utils, router-plugin): the move a state warning offers names what the moved code reads at load, and works when applied (round tools class A)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:37:04 +01:00
Sheraff
e42ee2b168
Merge branch 't3/cancelled-export-warning-cause' (kept-cause: an export kept only because it reads what another cause keeps is that cause's cascade, so the warning lands at the cause; a kept read ordered with a write at load names that write and offers a move that keeps the values)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:25:58 +01:00
Sheraff
374cf81556
fix(router-utils): report a kept export reading what another cause keeps at that cause, and name the write at load a kept read is ordered with (round tools class B)
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>
2026-11-13 12:25:11 +01:00
Sheraff
7b25ac790f
test(router-plugin): a kept export reading what another cause keeps is that cause's cascade; the warning is at the cause and its fix works (round tools class B)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:13:53 +01:00
Sheraff
bc0d2d6bbc
Merge branch 't3/fix-compiler-placement-failures-1' (round tools classes A, B, C: a read through a holder keeps its order when the component writes through it; an extracted module's member is ordered against writes at load in other outputs; a statement using an export and a chunk's binding stays with both)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 11:59:08 +01:00
Sheraff
24e3bce60c
docs(compiler): phase 6 step 3f: label every reliance on an upstream bug or private bundler behaviour; tripwires become assumption tests (witness-tripwire.test.ts -> witness-assumption.test.ts)
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>
2026-11-13 11:35:21 +01:00
Sheraff
561950b922
test: phase 6 step 3c: split claims assert where the code loads (route-HMR pages: splitOutputs by provenance; page and build files: isLazy / where)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 11:26:33 +01:00
Sheraff
9a6a096b28
fix(router-utils): reads at load keep their order with later writes for V-pinned slots and extracted modules' members (round tools A, B, C)
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>
2026-11-13 11:16:12 +01:00
Sheraff
a7808d0eec
test(router-plugin): an extracted module's member reads in source order; a statement using an export and a chunk's binding stays (round tools classes B and C)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 11:16:12 +01:00
Sheraff
957eebdafc
test: phase 6 step 3b: the vacuous split claims assert where the code loads; cast-wrapped route options are pages (red under P15); factory-made routes are reported, not split; JSX plugin order has one outcome per framework
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 11:15:30 +01:00
Sheraff
7c13a1ca52
feat(router-utils,router-plugin,start-plugin-core): the server-code check records server-only text at recognition, not erasure
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>
2026-11-13 11:13:51 +01:00
Sheraff
76309282f8
test: phase 6 step 3a: user-visible tests for P22 (printed 1-based column), B01 (B1 read loads lazy), P11 (unlisted file served as written, router plugin and Start), P04b (a statement changing a kept binding keeps what it uses)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 11:09:19 +01:00
Sheraff
358f029f14
test(router-plugin): a read through a holder stays before a later write when the component writes through the holder (round tools class A)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 11:03:10 +01:00
Sheraff
29b4456d0e
Merge branch 't3/server-code-route-options' (the server-code check covers the route options a client compile deletes: server, headers, ssr, and deleteNodes) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:24:07 +01:00
Sheraff
642b17b6f0
test(start-plugin-core): a route's server, headers and ssr options: the client build holds none of them, without an error (users' mode)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:07:53 +01:00
Sheraff
6685c74ddb
feat(router-plugin): the route options erased in a client compile are server-only text for the server-code check (R132)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:07:53 +01:00
Sheraff
1aad0c87bd
test(start-plugin-core): a client output keeping an erased server/headers/ssr route option fails the compile (R132)
Failing first: the router planner records nothing for the server-code check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:05:28 +01:00
Sheraff
0a94619bdc
Merge branch 't3/974762e3' (R132: the server-code check: no client output may contain text from a recorded server-only range; an error in users' builds) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 00:02:39 +01:00
Sheraff
0114dd6119
test(start-plugin-core): each kind of server-only text in a split loader: the client build holds none of it, without an error (users' mode)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:43:05 +01:00
Sheraff
f094f2c777
feat(router-utils,start-plugin-core): the server-code check: server-only text fails the module where an output holds it (R132)
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>
2026-11-12 23:43:05 +01:00
Sheraff
faa60b70f0
test(router-utils): server-only text a planner records never reaches an output of the compile (R132)
Failing first: nothing compares the outputs with the recorded ranges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:38:06 +01:00
Sheraff
ff4eb2394e
Merge branch 't3/hydrate-module-write-fixes' (both hydrate-module-write fixes applied in slow-tier tests on Vite and Rsbuild) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:28:36 +01:00
Sheraff
73a2822717
test(start-plugin-core): apply both hydrate-module-write fixes in Vite and Rsbuild builds
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>
2026-11-12 23:28:13 +01:00
Sheraff
b4df5e7318
Merge branch 't3/compiler-small-followups' (the flags placement test applies its offered fix; the toy Hydrate planner honours the core's fallbacks; exported let in <Hydrate> rows) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:26:17 +01:00
Sheraff
e79b09564c
test(start-plugin-core): Hydrate rejects children assigning an exported let, dev and build
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:24:08 +01:00
Sheraff
79cdcacf83
test(router-utils): the toy Hydrate planner keeps a boundary the core reports a fallback for
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>
2026-11-12 23:24:08 +01:00
Sheraff
66fcfb8f28
test(router-utils): a <Hydrate> boundary assigning an exported let stays in place
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>
2026-11-12 23:23:23 +01:00
Sheraff
ae9d437f3a
test(router-utils): apply the own-module fix the flags placement warning offers
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>
2026-11-12 23:17:26 +01:00
Sheraff
5691344bff
Merge branch 't3/dead-code-delete-lane' (dead code the scan found: orphaned fields, methods, parameters and the unreachable eager-export:reassigned; outputs identical) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:10:59 +01:00
Sheraff
7adacb4838
test(start-plugin-core): the dev error's position is its report's at
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:05:56 +01:00
Sheraff
012cb9d18d
test(start-plugin-core): hydrate tests read a compile's edges from its plan
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>
2026-11-12 23:04:36 +01:00
Sheraff
60f2ff1dc4
refactor(router-utils): delete eager-export:reassigned, which no compile output can carry
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>
2026-11-12 23:03:10 +01:00
Sheraff
2ee1976a8f
docs(router-utils): languagePurity's comment no longer cites the deleted extractionEffects
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:03:10 +01:00
Sheraff
eb044f6438
refactor(router-utils, start-plugin-core): delete fields only tests read
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>
2026-11-12 23:02:11 +01:00
Sheraff
5b4442881b
refactor(router-utils, start-plugin-core): delete fields, methods and parameters nothing reads
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>
2026-11-12 23:02:06 +01:00
Sheraff
f0c1ac6d60
Merge branch 't3/80bc0cbd' (the code-splitting guide's side effects rewritten around the model: four sentences, one warnings table, what the compiler doesn't see; every example asserted through the real planner) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 22:52:16 +01:00
Sheraff
c7cb07076c
docs(router): rewrite the code-splitting guide's top-level code part around the model
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>
2026-11-12 22:51:28 +01:00
Sheraff
e15ed92f22
Merge branch 't3/exported-let-row8' (an exported let moves with the code that assigns it, live binding kept; the guide corrected; row 8 left as is, it needs a new mechanism) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 22:37:52 +01:00
Sheraff
863a3e06fe
fix(router-utils): an exported let moves with every unit assigning it, whether or not the setter is exported (R150)
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>
2026-11-12 22:14:28 +01:00
Sheraff
49043253e0
test: an exported let whose every assignment moves with it loads with the component (R150), whatever exports the setter
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 22:04:49 +01:00
Sheraff
e155ee1376
Merge branch 't3/compiler-call-args-d-lane' (R152 variant D: a call holds the functions it is handed when its result is a route option's value or handed on to such a call; 'may use' wording; small item 2b) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 21:58:22 +01:00
Sheraff
f5aecf0f3d
fix(router-utils): a late write only an option value's chunk runs pins it only when other code touches the binding at load (small item 2b)
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>
2026-11-12 21:45:14 +01:00
Sheraff
c4bdc4f7c8
test: an option value reaching a named function that writes state a later reader keeps splits as the inline one (small item 2b under R152)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 21:45:14 +01:00
Sheraff
a042661faf
feat(router-utils,router-plugin): a call whose result is a route option value holds the functions it is handed (R152)
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>
2026-11-12 21:45:14 +01:00
Sheraff
a6af437f3d
test: a call whose result is a route option value holds the functions it is handed (R152)
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>
2026-11-12 21:45:14 +01:00
Sheraff
86aa0905d8
Merge branch 't3/implement-readonly-options' (a Start builder's .options is read-only in its public type) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 21:05:25 +01:00
Sheraff
6c934a7abb
feat(start-client-core): a builder's .options is typed read-only
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>
2026-11-12 21:05:08 +01:00
Sheraff
7c1c080cc1
Merge branch 't3/fpeg1-compiler-rewrite-lane' (F-PEG-1: an extracted export never reads at load a server fn the route module hoisted, through the functions it calls or hands on; the solver loop it exposed) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:48:51 +01:00
Sheraff
0ffd68d0c3
Merge branch 't3/builder-escape-fixes' (builder .options read by name allowed; unfinished-middleware, MDX re-export and Vue getter messages offer fixes that work; real positions for reprinted statements) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:45:25 +01:00
Sheraff
cef4f8bbd2
Merge integration head f36d9bdf9a (small-items) into t3/fpeg1-compiler-rewrite-lane 2026-11-12 20:43:31 +01:00
Sheraff
b0823cd12d
fix(router-utils): an export kept only for a binding a planner generated is not reported
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>
2026-11-12 20:43:26 +01:00
Sheraff
cbc5afa426
test: an export kept only for a binding the server build generates is not reported; a source binding it also reads is named
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>
2026-11-12 20:42:13 +01:00
Sheraff
08fcdcae0a
fix(start-plugin-core): builder escapes: .options read by name builds; refusals give a fix that works and a real position
- 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>
2026-11-12 20:36:11 +01:00
Sheraff
ee0f22fa3d
test(start-plugin-core): builder escapes from the re-check: .options reads, the fixes the messages give, MDX re-export positions
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>
2026-11-12 20:32:32 +01:00
Sheraff
aebcf67e6a
docs(router-utils): what an evaluation runs includes the names its generated text reads; changeset
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:17:13 +01:00
Sheraff
f36d9bdf9a
Merge branch 't3/compiler-rewrite-small-items' (readConflict deleted, R67's kept-let pin revised; the freshness relabel of an unknown path's change deleted) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:16:57 +01:00
Sheraff
b919f7bcdc
fix(router-utils): a follower reading at load what the route module keeps never joins an extracted module
`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>
2026-11-12 20:10:44 +01:00
Sheraff
f4a3e3e538
test(router-utils): unused code handing an extracted function that holds a moved call to a call settles in the route module
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>
2026-11-12 20:10:44 +01:00
Sheraff
d19392a001
fix(router-utils): generated names follow the walk of what an evaluation runs
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>
2026-11-12 20:02:40 +01:00
Sheraff
e80dfc7f74
test(router-utils): an export whose evaluation runs code reading a binding a planner moved to the top level stays
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>
2026-11-12 20:02:40 +01:00
Sheraff
5ed4d734d8
test(start-plugin-core): an extracted export running a function that declares a server fn renders the source's value on SSR
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>
2026-11-12 19:54:04 +01:00
Sheraff
21446b9e5f
Merge branch 't3/fpeg2-overtaken-deps' (F-PEG-2: a request records its text's revision once, so a waiting request of an older text never publishes over the newer plan and its dependency rows) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 19:36:46 +01:00
Sheraff
710d2ec504
docs(router-utils): live plan keys are those with a plan or a request in progress
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 19:34:44 +01:00
Sheraff
69aa905b58
fix(router-utils): a request notes its text's revision once, at arrival
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>
2026-11-12 18:19:29 +01:00
Sheraff
2bd5e3b4b7
test(router-utils): an older text's request answered after the newer text's compile keeps the newer plan's dependencies
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>
2026-11-12 18:17:04 +01:00
Sheraff
3121d23906
chore(changeset): a declaration reading a kept let nothing assigns moves
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:20:20 +01:00
Sheraff
f0e959ab9f
refactor(router-utils): delete readConflict; a kept binding's readers are judged by its writes
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>
2026-11-12 17:15:46 +01:00
Sheraff
d0de535ef2
test(router-utils): a declaration reading a kept binding is judged by the writes of that binding, not by its own effect
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:15:46 +01:00
Sheraff
8f4f7e0e6d
refactor(router-utils): delete the 'unknown path change is an add' relabel
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>
2026-11-12 17:15:46 +01:00
Sheraff
a8daacb76f
Merge branch 't3/compiler-rewrite-options-referenced' (route options whose object is used outside the route call are opaque and reported, never silently split) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 16:16:03 +01:00
Sheraff
b2ce6783c4
Merge branch 'main' (pnpm 12, RSC bundler deps security floor, Rsbuild virtual modules build fix, HMR e2e waits for SSR) into t3/yuku-compiler-rewrite
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>
2026-11-12 16:15:40 +01:00
Sheraff
2584f27d16
chore(changeset): two changesets follow the shipped behaviour (server fn loaders, kept-code hints)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 16:13:51 +01:00
Sheraff
6574abb32c
Merge branch 't3/solid-route-hmr-design7b' (design 7b: temporary workaround of rspack#16594 for Solid split chunks on Rsbuild/webpack in dev; one keep rule for handed-over evaluations) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 16:01:40 +01:00
Sheraff
38737e2d5b
fix(solid-router): a Solid split chunk imported again answers its newest evaluation on Rsbuild/webpack (temporary workaround of web-infra-dev/rspack#16594)
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>
2026-11-12 15:58:42 +01:00
Sheraff
b1987ded65
test(router-plugin): Solid split chunks imported again on Rsbuild: grouped loader shapes, a conditional then an option the route module keeps
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>
2026-11-12 14:49:14 +01:00
Sheraff
9dd1aeb0cc
fix(router-plugin): route options whose object other code also names are not read, and reported
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>
2026-11-12 14:36:51 +01:00
Sheraff
840a4a7d91
test(router-plugin, start-plugin-core): route options whose object is named besides the route call and its chain are reported, not split
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>
2026-11-12 14:34:27 +01:00
Sheraff
04c32bb18a
Merge branch 't3/order-none-v2-closing-a' (the order rule: no order between effects, statements and dead code follow the bindings they use (R146-R149), extracted-export modules as destinations (R150), shared modules holding effects (R151), rule L, the recheck fixes and the rewritten guide) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 14:29:51 +01:00
Sheraff
f61bb41431
fix(router-utils): re-check members each round; report a live-cancelled export's own cause; narrower statement search; unused chains in one report
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>
2026-11-12 14:06:45 +01:00
Sheraff
4ce0678ab5
test(router-utils): members re-checked, the kept export at the cause reported, statement and chain wording (placement-exec seeds 10112, 12263; hand cases x04, x14, m12)
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>
2026-11-12 14:06:45 +01:00
Sheraff
9933e31b23
Merge branch 't3/compiler-rewrite-design7' (design 7: Solid route HMR decides from the loaded values; chunk hand-over on webpack-style hosts; leading @refresh pragmas reach split chunks) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 13:40:01 +01:00
Sheraff
db7e860fcf
perf(router-plugin): read a route file's comments for @refresh pragmas only when its header names one
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>
2026-11-12 13:34:48 +01:00
Sheraff
d5efad08d0
docs(router): top-level code in automatic code splitting after R146-R151
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>
2026-11-12 13:32:55 +01:00
Sheraff
0ccbd49512
fix(router-utils): the order-rule recheck's rulings A-E and messages
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>
2026-11-12 13:32:55 +01:00
Sheraff
6ee41f87bd
test: the order-rule recheck's fixes (rulings A-E, messages, guide examples)
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>
2026-11-12 13:32:55 +01:00
Sheraff
875db0e332
docs(router): SPEC J3.3 Solid rename reload, J2.16 @refresh pragmas in chunks; KNOWN-BUGS rows for design 7; changeset
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 13:13:43 +01:00
Sheraff
adf7f7771a
fix(router-plugin): a split chunk holding components carries the route file's leading @refresh pragmas
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>
2026-11-12 13:13:43 +01:00
Sheraff
2f6825839e
fix(router-core, solid-router, vue-router, router-plugin): Solid route HMR keeps what solid-refresh patches, read from the values
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>
2026-11-12 13:13:43 +01:00
Sheraff
868b5f221b
test(router-plugin): Solid identity matrix: @refresh granular in a split chunk; pin a loader sharing the component chunk on Rsbuild
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>
2026-11-12 13:13:43 +01:00
Sheraff
1045661a3f
test(router-plugin): Solid route HMR identity matrix on Vite and Rsbuild, split and unsplit
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>
2026-11-12 13:02:28 +01:00
Sheraff
9029c36cc5
test(start-plugin-core): integration rows restated for lazy shared modules holding effects (R151)
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>
2026-11-12 12:17:25 +01:00
Sheraff
ac17b427d3
Merge branch 't3/unreadable-loader-compiler-lane' (a split loader the compiler can't inspect stays in the route module, with a warning; spread after handler refused) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 12:05:21 +01:00
Sheraff
aba42f4d45
docs(router): a split loader the compiler cannot read stays in the route file; spread before handler; Start's in-place server fn loader
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 11:57:01 +01:00
Sheraff
7d5ce6e8dc
test(e2e): the code-splitting apps' posts loader calls fetchPosts, so its configured loader split stays
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 11:56:28 +01:00
Sheraff
dbed1b5fdc
test(router-plugin, start-plugin-core): loaders that are imports, calls or members stay in the route module with a warning; a spread before handler splits
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>
2026-11-12 11:55:30 +01:00
Sheraff
154d382434
fix(router-utils): a joined follower goes where the single-writer rule homes its binding (R151)
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>
2026-11-12 11:55:08 +01:00
Sheraff
ed3d9fa554
test(router-utils): a joined follower goes with its binding where the single-writer rule homes it (placement-exec seed 11838)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 11:55:08 +01:00
Sheraff
389b6d9264
fix(router-plugin): a split loader the compiler cannot read stays in the route module with a warning, as does a loader object with a spread after its handler
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 11:38:56 +01:00
Sheraff
0b054c4e4e
fix(router-utils): a follower whose bindings' places grow to several split outputs joins them (R151)
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>
2026-11-12 11:38:31 +01:00
Sheraff
248f4345ef
test(router-utils): a follower whose binding another follower shares joins them; only unused code that puts bindings together is reported (R151, probes b20, b12)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 11:38:31 +01:00
Sheraff
abdfc9b784
test(router-plugin): a split loader the compiler cannot read stays in the route module with a warning; a spread after handler too; each fix splits
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 10:58:45 +01:00
Sheraff
0f8cb61e3b
feat(router-utils): lazy shared modules hold effects; statements and unused code join their bindings there (R151)
- 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>
2026-11-12 10:50:51 +01:00
Sheraff
7aaf4c4933
test: rows restated for lazy shared modules holding effects (R151)
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>
2026-11-12 10:50:51 +01:00
Sheraff
088300909f
test: lazy shared modules hold effects; statements and unused code join their bindings there (R151)
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>
2026-11-12 10:24:38 +01:00
Sheraff
7319ba3d42
fix(router-utils): an extracted const is ordered like a kept one in readConflict
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>
2026-11-12 10:15:21 +01:00
Sheraff
986477d142
test(router-utils): an effectful declaration reading an extracted const at load moves into the chunk that reads it (corpus: edunomatseye)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 10:15:21 +01:00
Sheraff
12ae44bf37
test(router-plugin): the restated kept-export report row uses a name no other row of the shared dev host reports
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>
2026-11-12 10:09:42 +01:00
Sheraff
598048b060
test(router-plugin): integration rows restated for an extracted export's module as a destination (R149, extended)
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>
2026-11-12 10:00:15 +01:00
Sheraff
7c8c69c570
fix(router-utils): a cluster holding an export the planners keep is no extraction candidate
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>
2026-11-12 09:48:51 +01:00
Sheraff
b498cde8eb
test(router-utils): an export a route option value writes stays with the route (placement-exec seeds 2578, 7394, 9413, 9430)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:48:51 +01:00
Sheraff
bb763167f4
feat(router-utils): an extracted export's module is a destination like a chunk (R149, extended)
- 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>
2026-11-12 09:41:15 +01:00
Sheraff
ebc676c119
test: rows restated for an extracted export's module as a destination (R149, extended)
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>
2026-11-12 09:41:15 +01:00
Sheraff
3f716790a5
test: an extracted export's module is a destination; a follower and an export with effects run when the export is used (R149, extended)
Replaces part C's pin (no extracted module's own statements have an
effect).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:17:49 +01:00
Sheraff
253c1013de
Revert "test(router-utils): an export a staying statement keeps is reported…"
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>
2026-11-12 09:16:38 +01:00
Sheraff
9570b7ad9c
test(router-utils): an export a staying statement keeps is reported with that statement; a change worded as a change (R149 rulings)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:13:14 +01:00
Sheraff
33f6d2443c
fix(router-utils): the other chunk's binding is reported only when no statement changing it names it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:09:38 +01:00
Sheraff
58b1ea6dfa
test(router-utils): two statements each changing its binding name it from their own line (probe e04)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:09:38 +01:00
Sheraff
f48b93a97b
fix(router-utils): report the other chunk's binding a staying statement keeps, not only unused code's
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:06:42 +01:00
Sheraff
62846b4b7f
test(router-utils): a statement using bindings of two chunks reports both it keeps (probe b33)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:06:42 +01:00
Sheraff
062ef88d5e
test(router-utils): a read moves past a write through an unknown call's result (R149 answer F, accepted break)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:05:09 +01:00
Sheraff
1e744667f0
chore(changeset): the statement rule as R149 states it; unused code's warning
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 08:57:51 +01:00
Sheraff
8aaa23d5c8
test(start-plugin-core): drop the row pinning the outside rule (R149)
`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>
2026-11-12 08:57:51 +01:00
Sheraff
df39fae437
fix(router-utils): kept-code warnings name the true cause and a fix that works (review finding 5, R149 answers E)
- 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>
2026-11-12 08:55:48 +01:00
Sheraff
226ab39466
test(router-utils): unused code names everything it keeps eager (R149 answers E); rows for an import's writer and copied consts
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>
2026-11-12 08:55:48 +01:00
Sheraff
60c160ad54
feat(router-utils): statements follow the module bindings they use (R149)
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>
2026-11-12 08:49:06 +01:00
Sheraff
264ab41281
test(router-utils): R149's restatements and the review's message findings
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>
2026-11-12 08:48:42 +01:00
Sheraff
da542c5324
test(router-utils): statements follow the bindings they use (R149)
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>
2026-11-12 08:42:40 +01:00
Sheraff
fc6fe6c12e
refactor: one owner for the side-effect-free flag: the hosts flag an extracted export's module by its kind
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>
2026-11-12 08:26:52 +01:00
Sheraff
fe650d9af8
test(router-utils): an extracted module holds nothing with effects of its own
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>
2026-11-12 08:24:44 +01:00
Sheraff
b278cf8ea3
Merge branch 't3/compiler-rewrite-design5-closing' (design 5 closing: wrong-kind constructor repaired whatever its id; Vite dev fails route modules while routes were never generated; routeCallOf gives the reason; one message per cause; a written-later loader object is not split) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 02:17:06 +01:00
Sheraff
ebdab9ff4d
fix(router-generator): a route call made in a function of the file or stored in a const is reported (J2.10)
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>
2026-11-12 02:04:19 +01:00
Sheraff
195398bd07
fix(router-plugin): the wrapped-route message names no stored call (a stored call is not reported)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 01:54:28 +01:00
Sheraff
4f26ae36c0
test(router-plugin): the recognition table's cleanup takes its own test's hook
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>
2026-11-12 01:47:43 +01:00
Sheraff
720d49a8bf
test(router-plugin): pin a loader naming an unreadable object and writes through an alias of the options; changeset
KNOWN-BUGS rows for both (REVIEW-design5-final findings 5 and 6).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 01:46:07 +01:00
Sheraff
802a948bd9
fix(router-plugin, start-plugin-core): a module exporting a Route fails while the routes were never generated
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>
2026-11-12 01:44:21 +01:00
Sheraff
df904d3100
fix(router-generator, router-plugin): foreign routes carry their reason; the generator repairs the constructor whatever the id
- 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>
2026-11-12 01:44:21 +01:00
Sheraff
9d0ea7c0c0
test: design 5 closing, failing rows pinned
- 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>
2026-11-12 01:32:07 +01:00
Sheraff
020dec9000
test(start-plugin-core): the lazy-handlers entry loads seed.ts itself
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>
2026-11-12 01:31:41 +01:00
Sheraff
317a4247b1
Merge branch 't3/design4-vite-exempt-order' (Vite builds report an exempt plain plus exempt pattern importer whatever was served: same input, same result) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 01:29:47 +01:00
Sheraff
d857191f56
fix(start-plugin-core): a Vite build reports two exempt importers whichever way it served the file (design 4 follow-up)
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>
2026-11-12 01:29:22 +01:00
Sheraff
f0458957e7
fix(router-utils): Reflect's mutators change their first argument; imports' users place only a follower without effects of its own
- 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>
2026-11-12 01:28:41 +01:00
Sheraff
bda5b4925b
test: a built-in changing its argument, an unused declaration with an effect of its own; oracle rows restated
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>
2026-11-12 01:28:03 +01:00
Sheraff
126a0de2f0
test(start-plugin-core): a Vite build reports two exempt importers in either order (design 4 follow-up)
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>
2026-11-12 01:22:00 +01:00
Sheraff
03625e17fb
Merge branch 't3/compiler-rewrite-design4-closing' (design 4 closing: R147 importers that disagree fail the build on both hosts; held importers only; messages) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 01:19:57 +01:00
Sheraff
6a77a435bb
docs(router-utils): the statement rule's parameter writes, imports' users and extracted modules
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 01:12:14 +01:00
Sheraff
c2363bc00f
fix(router-utils): an extracted export's module decides no follower's place
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>
2026-11-12 01:05:51 +01:00
Sheraff
7fa309c892
test(router-utils): an unused function reading an extracted export follows its chunk; the export stays extracted
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>
2026-11-12 01:05:30 +01:00
Sheraff
eed30a708d
Merge branch 't3/compiler-rewrite-design5' (design 5: one route recogniser, routeCallOf, shared by the generator and the planner; R144 repairs; R145 unregistered files served as written; R130 deletions; options through const chains) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 01:04:57 +01:00
Sheraff
1eb0e49147
fix(router-utils): where none of its bindings decides, a follower goes with its imports' users' one chunk
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>
2026-11-12 00:58:15 +01:00
Sheraff
d351be8fe9
test(router-utils): an unused function reading only imports goes with the chunk using them (R148)
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>
2026-11-12 00:58:15 +01:00
Sheraff
ba8304e256
perf(start-plugin-core): Rsbuild's held modules compare by resource, canonicalised on a miss only
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>
2026-11-12 00:50:05 +01:00
Sheraff
e7e1b7fab9
fix(router-utils): a staying statement reports only what it keeps in the route module, and words a binding it only uses
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>
2026-11-12 00:46:44 +01:00
Sheraff
21639ed279
test(router-utils): a statement that stays reports nothing that moves
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>
2026-11-12 00:45:31 +01:00
Sheraff
241a76584b
refactor(router-plugin): one const follower for route options, spreads and loader objects (design 5 step 5)
`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>
2026-11-12 00:35:06 +01:00
Sheraff
25037a54e6
fix(router-utils): a binding handed to a function the module declares is changed when its body changes that parameter
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>
2026-11-12 00:33:35 +01:00
Sheraff
0f1ccfc647
test(router-utils): a binding changed through a parameter of a local function the statement calls
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>
2026-11-12 00:32:31 +01:00
Sheraff
ad8ee837f5
test: consumer rows under the amended statement rule (R146 amendment)
- 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>
2026-11-12 00:30:33 +01:00
Sheraff
4790f9ffd3
refactor(router-plugin): drop the half-measures for routes the router does not make (design 5 step 4, R130)
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>
2026-11-12 00:30:03 +01:00
Sheraff
6bf17b5670
test(start-plugin-core): the dev re-read's first page, the orphan row's first build left out (design 4 closing)
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>
2026-11-12 00:24:51 +01:00
Sheraff
b1d81a1053
refactor(router-plugin): the router planner reads the generator's route call and entry (design 5 step 3)
`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>
2026-11-12 00:23:35 +01:00
Sheraff
3955c87ea3
chore(changeset): the statement rule as amended (R146) and dead code following what it reads (R148)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 00:20:25 +01:00
Sheraff
78af687c12
feat(router-utils): a statement follows what it changes; dead code follows what it reads (R146 amendment, R148)
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>
2026-11-12 00:20:13 +01:00
Sheraff
487bc0169b
test(router-utils): why a statement that changes a declaration stays; rows restated for the amended statement rule and R148
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>
2026-11-12 00:18:05 +01:00
Sheraff
b4bd57fd21
perf(start-plugin-core): held ids compare as given, canonical form on a miss only
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 00:15:33 +01:00
Sheraff
fabd2addfe
docs(start): importers that disagree, held importers, the Vite dev limit (design 4 closing)
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>
2026-11-12 00:13:45 +01:00
Sheraff
38127509e2
fix(start-plugin-core): importers that disagree fail the build; demand counts held importers (design 4 closing)
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>
2026-11-12 00:12:56 +01:00
Sheraff
36e151a51c
feat(router-generator): the registry entry carries the file's kind (design 5 step 2)
`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>
2026-11-12 00:07:27 +01:00
Sheraff
7c0c961e63
test(start-plugin-core): served demand and R147 conflict rows (design 4 closing)
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>
2026-11-12 00:04:45 +01:00
Sheraff
d5ece140d6
test(router-utils): a statement stays for what it changes, not what it names (R146 amendment)
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>
2026-11-11 23:59:14 +01:00
Sheraff
21aa68d680
test(router-plugin): exported enums reading a getter, an imported or a declared enum stay, reported, as before rule L
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>
2026-11-11 23:55:25 +01:00
Sheraff
a0242e545f
refactor(router-generator): one route-call recogniser, the root read too (design 5 step 1)
`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>
2026-11-11 23:55:06 +01:00
Sheraff
a2d81ee912
test: design 5 step 0, one verdict on what a route is (failing rows pinned)
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>
2026-11-11 23:43:51 +01:00
Sheraff
2d8c90ab21
style(router-utils): import order; drop the unit the effects message no longer reads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 23:41:22 +01:00
Sheraff
d2b0fe38bb
chore(changeset): exported language operations stay in the route module
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 23:36:02 +01:00
Sheraff
1765e553da
fix(router-utils): extraction candidates ask deletion's purity, not rule L
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>
2026-11-11 23:35:56 +01:00
Sheraff
7687093129
test: what may run code never moves into an extracted export's module (architect's ruling on finding 2)
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>
2026-11-11 23:35:56 +01:00
Sheraff
0b4c08969e
Merge branch 't3/compiler-rewrite-design4-steps-3-5' (design 4 steps 3-4: Vite serves a denied file as its importers ask in dev, reports a build mismatch under behavior; loud graph reads; step 5 dropped, its test passes) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 23:32:30 +01:00
Sheraff
8d130739bf
chore(changeset): rule L's reads through wrapped aliases and what it never deletes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 23:30:51 +01:00
Sheraff
871460e700
test(router-utils): retitle the value-before-a-bare-call row after what it checks; remove a stray empty file
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>
2026-11-11 23:30:41 +01:00
Sheraff
1d10d6ea5d
fix(router-utils): rule L decides when code runs, never whether it is deleted
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>
2026-11-11 23:30:26 +01:00
Sheraff
c03c861278
test(router-utils): what may run code is never deleted, and an extracted language operation's module is not side-effect free
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>
2026-11-11 23:27:28 +01:00
Sheraff
f57abeadfa
fix(router-utils): a name read or written through an expression handing its value on is one of its object
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>
2026-11-11 23:22:25 +01:00
Sheraff
c23de7375d
test(router-utils): a read or write through an alias inside a forwarding expression is one of its object
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>
2026-11-11 23:17:03 +01:00
Sheraff
66209e6bce
test(start-plugin-core): a persistent cache moved to another path builds correctly (design 4 F5-5)
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>
2026-11-11 23:14:58 +01:00
Sheraff
50ccec0ae9
refactor(start-plugin-core): import protection's graph reads are loud (design 4 step 4)
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>
2026-11-11 23:12:26 +01:00
Sheraff
470d8c989e
test(start-plugin-core): the survival witness's tripwire (design 4 step 4, §5)
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>
2026-11-11 23:12:26 +01:00
Sheraff
230aada458
Merge branch 't3/compiler-order-none-v2' (order rule v2, R146) into order-none-v2-closing-a 2026-11-11 23:12:04 +01:00
Sheraff
8f027d6bce
fix(start-plugin-core): Vite serves a denied file as its importers ask, or says why not (design 4 step 3)
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>
2026-11-11 23:01:06 +01:00
Sheraff
1ed4805054
test(start-plugin-core): Vite's served verdict pins (design 4 step 3)
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>
2026-11-11 23:00:46 +01:00
Sheraff
2f4ebd71e3
Merge branch 't3/compiler-rewrite-design4-steps-0-2' (design 4 steps 0-2: import protection's served ledger; Rsbuild serves a denied file as its importers ask) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 22:43:34 +01:00
Sheraff
aac5b052ab
fix(start-plugin-core): Rsbuild serves a denied file as its importers ask, in one compilation (design 4 step 2)
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>
2026-11-11 22:25:39 +01:00
Sheraff
a8434f446f
test(router-plugin): unpin the Rolldown var row the statement rule no longer reaches
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>
2026-11-11 22:24:44 +01:00
Sheraff
02c4304a9f
refactor(start-plugin-core): import protection's served ledger (design 4 step 1)
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>
2026-11-11 22:19:49 +01:00
Sheraff
3153f652d0
test(start-plugin-core): import protection's served verdict pins (design 4 step 0: F5-1, F5-1b, F5-2, F5-6)
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>
2026-11-11 22:17:56 +01:00
Sheraff
b1a70a74b7
fix(router-utils): a follower that declares what it writes follows its declarations' needer; the env module keeps one it reads
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>
2026-11-11 22:04:25 +01:00
Sheraff
04d4d60b2b
test(router-utils): a declaration and a statement writing it follow its only needer
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>
2026-11-11 22:02:27 +01:00
Sheraff
57dc86a742
test(router-utils): the executing property's method-call family, as reported behaviour (seeds 1302, 1141, 1055)
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>
2026-11-11 21:44:28 +01:00
Sheraff
d58265707d
test(router-plugin): the statement follows the table; a global patch runs when the chunk loads (real builds)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 21:43:42 +01:00
Sheraff
1cfa0920b8
test(router-plugin): enum rows under the statement rule and without condition 2
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>
2026-11-11 21:40:15 +01:00
Sheraff
d0c274d642
fix(router-utils): in reads through its name; a reassigned binding names the object its declaration creates
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>
2026-11-11 21:37:52 +01:00
Sheraff
f5cc4dffd1
test(router-utils): rule L's reads through a reassigned binding and in, with the object kept
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>
2026-11-11 21:37:32 +01:00
Sheraff
360c6e6883
fix(router-utils): an enum or a namespace names an object of its own
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>
2026-11-11 21:35:10 +01:00
Sheraff
f5529e64a4
feat(router-utils): a bare statement follows what it touches into its chunk
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>
2026-11-11 21:34:48 +01:00
Sheraff
8613117022
test(router-utils): statements follow what they touch; rule L's objects written through another name
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>
2026-11-11 21:32:53 +01:00
Sheraff
5fa33495fb
feat(router-utils): an unknown call writes nothing it is handed (no condition 2)
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>
2026-11-11 21:30:19 +01:00
Sheraff
bfa81dd187
test(router-plugin): drop an unused import
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 21:19:58 +01:00
Sheraff
d7c8e232e2
test(router-plugin): no order rule in three integration files' headers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 21:19:58 +01:00
Sheraff
9b32ac721c
test: no order rule in the integration rows
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>
2026-11-11 21:19:58 +01:00
Sheraff
95a893a80f
test(router-plugin): rule L in the integration rows (member reads, template initialisers)
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>
2026-11-11 21:19:58 +01:00
Sheraff
a5209d7efd
test(router-utils): pin two reads rule L leaves unordered (an in through an alias, a copy before a late method call)
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>
2026-11-11 21:19:58 +01:00
Sheraff
5bcaef07a1
test(router-utils): pin a read of a reassigned binding moving past a write through a holder (rule L)
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>
2026-11-11 21:19:58 +01:00
Sheraff
bf7d6ef184
chore(changeset): language operations and no order rule
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 21:19:58 +01:00
Sheraff
3457450065
test(router-plugin): a decorated class and a destructuring default run when the component loads (no order rule)
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>
2026-11-11 21:19:58 +01:00
Sheraff
943e958d82
feat(router-utils): no order rule, bindings decide
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>
2026-11-11 21:19:55 +01:00
Sheraff
332848bdba
test: no order rule, bindings decide
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>
2026-11-11 21:19:52 +01:00
Sheraff
ea2530705f
feat(router-utils): language operations are no effect for placement (rule L)
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>
2026-11-11 21:19:47 +01:00
Sheraff
61d09e31a0
test(router-utils): language operations are no effect for placement (rule L)
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>
2026-11-11 21:19:47 +01:00
Sheraff
bb44e7fb40
test(router-utils): the JSX-children scaling bound leaves room for CI's macOS runners (176 read, quadratic ~800)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 20:08:58 +01:00
Sheraff
3f8153acb7
Merge branch 't3/generated-tests-local' (no generated or seeded tests in the repository; their found cases as static tests) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 19:56:49 +01:00
Sheraff
97058ec0b7
test: generated and seeded tests leave the repository
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>
2026-11-11 19:52:17 +01:00
Sheraff
d8131d48b8
test(router-utils): the cases the generated tests found, written out
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>
2026-11-11 19:52:12 +01:00
Sheraff
bc1bdb5d70
test(router-plugin): the executing placement test takes what its throwaway hosts left stale
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 18:37:49 +01:00
Sheraff
a21637d84b
Merge branch 't3/compiler-rewrite-design2-closing' (placement closing: one owner of the object a binding names, builder links from the reference, confined over every output, executing property test; checkPlacement deleted) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 18:12:40 +01:00
Sheraff
61be3fee2b
Merge branch 't3/compiler-rewrite-design3-closing' (freshness closing: per-run sentinel dir, every applied event moves the file set, standing staleHits check) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 18:02:48 +01:00
Sheraff
ef45aab887
test(start-plugin-core): a watch build whose buildApp throws closes the watchers it started
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 18:01:34 +01:00
Sheraff
1a70ef0b69
perf(router-utils): the value walk reads a write's expression from its classification; objects written through other names, once per name
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>
2026-11-11 17:42:46 +01:00
Sheraff
55bca580c1
test(start-plugin-core): two more client-only-save rows settle on the server's rebuild
"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>
2026-11-11 17:40:23 +01:00
Sheraff
b68024e102
test(start-plugin-core): the linked-package exports pin passes with option A (pin removed)
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>
2026-11-11 17:40:23 +01:00
Sheraff
2c58ba3883
fix(router-utils): planners' isMutated answers for writes through the binding's name; writes through other names stay placement's
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>
2026-11-11 17:07:01 +01:00
Sheraff
1d09ffc108
chore(changeset): the twin sentence says what option A does
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 17:00:42 +01:00
Sheraff
4571aad626
test(router-plugin): the executing property's groupings are split keys
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 16:10:13 +01:00
Sheraff
0a446abb14
chore(changeset): plain wording for the hints changeset
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 16:08:52 +01:00
Sheraff
ad711a669e
chore: format
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 16:08:42 +01:00
Sheraff
9435fae838
chore(changeset): the asset mock declares its file where a load's file is declared
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 16:05:30 +01:00
Sheraff
b5c6564c71
test(start-plugin-core): watch steps settle on the rebuild they cause, not on quiet
`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>
2026-11-11 15:53:02 +01:00
Sheraff
35604e72c3
refactor(router-utils): delete lazyConflict's unreachable second loop (final review item 8)
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>
2026-11-11 15:52:35 +01:00
Sheraff
b093c2707a
fix(router-utils): every applied file event moves the file set (option A)
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>
2026-11-11 15:47:07 +01:00
Sheraff
0104b3c5fc
test(router-plugin): the unanalysed-module tripwire covers the SSR environment
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:47:07 +01:00
Sheraff
b8f52f2414
refactor: one owner for whether a load declares its file (watchLoadedFile)
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>
2026-11-11 15:47:07 +01:00
Sheraff
e9cefa45eb
test(router-utils): the twin of a file removed and created again within one change (forms a, b, c)
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>
2026-11-11 15:45:16 +01:00
Sheraff
5393ad5de6
test(react-start-rsc): the integration files end with the compilers' stale check
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:43:56 +01:00
Sheraff
ce14e4597a
refactor(router-utils): delete checkPlacement (final review item 6)
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>
2026-11-11 15:43:27 +01:00
Sheraff
11d7e50b6d
test: the executing placement property in the repository (final review item 6)
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>
2026-11-11 15:40:49 +01:00
Sheraff
4626d40693
test(compiler-test-utils): each dev and build file ends with no stale hit and no stale path of its own (I5)
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>
2026-11-11 15:35:31 +01:00
Sheraff
d7476a3e45
fix(start-plugin-core): the watch build's sentinel lives in a directory of the run's own
`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>
2026-11-11 15:29:23 +01:00
Sheraff
879b94faf2
test(start-plugin-core): a watch build's temporary files: private, removed at close, a missing temp dir builds
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>
2026-11-11 15:27:10 +01:00
Sheraff
847f4bd514
Merge branch 't3/statement-guard-implementation' (the ; guard asks only what it needs; comment-only text gets no ;) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:23:06 +01:00
Sheraff
41514d4425
test(compiler-test-utils): the child runner's watchdog starts one thread, not one per thread; a stuck run names its step
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>
2026-11-11 15:22:54 +01:00
Sheraff
abaea78f39
fix(router-utils,router-plugin): every hint of a kept declaration or option frees what it names (final review finding 4)
(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>
2026-11-11 15:14:57 +01:00
Sheraff
5389f223b5
fix(router-utils): one rule for a function an evaluation passes to a call, in an option value or a declaration (final review finding 5)
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>
2026-11-11 15:06:13 +01:00
Sheraff
5049b325fa
test: a declaration whose call runs its own function writing state nothing else touches moves, as the option value splits (final review finding 5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:05:19 +01:00
Sheraff
3f5cd317b5
fix(router-utils): an option value's write at load is confined only when nothing anywhere else reads the binding (final review finding 2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:02:18 +01:00
Sheraff
90b92d7738
test: an option value whose let a module two chunks share reads stays in place (final review finding 2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:00:57 +01:00
Sheraff
30195c105b
fix(router-utils): a link on a const writing builder is a write wherever it stands (final review finding 3)
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>
2026-11-11 14:59:37 +01:00
Sheraff
93cb7659cd
test(router-utils): a middleware link in a function or an option value writes its builder (final review finding 3)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 14:57:05 +01:00
Sheraff
017366268a
perf(router-utils): the statement-start guard finds the child holding the offset by a binary search
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>
2026-11-11 14:54:09 +01:00
Sheraff
8dc63f3266
fix(router-utils): a write through another name of an object is a write of that object (final review finding 1)
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>
2026-11-11 14:53:58 +01:00
Sheraff
cf81169c7e
test(router-plugin): a read of an object written through an alias or a holder keeps the source's value (final review finding 1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 14:52:00 +01:00
Sheraff
ffe83876df
test(router-utils): a write through another name of an object is a write of it (final review finding 1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 14:40:49 +01:00
Sheraff
8aa9f30ea9
chore(changeset): the statement-start guard
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 14:30:53 +01:00
Sheraff
6b70a972af
Merge branch 't3/compiler-rewrite-design3-step6' (freshness steps 6-7: one record per key, rows at ask time, tripwires; step 5 review fixes) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 14:16:53 +01:00
Sheraff
b62d791590
chore(changeset): design 3 steps 6-7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 14:15:42 +01:00
Sheraff
3c0d008107
test(start-plugin-core): the save-during-first-build row waits for the server's rebuild by its outcome
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>
2026-11-11 14:06:24 +01:00
Sheraff
31c2e09cb7
perf(router-utils): the statement-start guard descends through the nodes holding the offset
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>
2026-11-11 14:05:20 +01:00
Sheraff
f42baec6f3
fix(router-utils): a text that is only a comment starts no token for the statement-start guard
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>
2026-11-11 14:04:27 +01:00
Sheraff
e626f04fee
test(router-utils): a text that is only a comment has no first token for the statement-start guard (failing)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 14:01:53 +01:00
Sheraff
5a37a6a65b
Merge branch 't3/compiler-rewrite-design2-step5' (placement step 5: same slot, R138; step 4 review fixes) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 13:53:08 +01:00
Sheraff
d6678fe565
perf(router-utils): a Vite hot update does not transform a file for derived modules nothing loaded
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>
2026-11-11 13:50:19 +01:00
Sheraff
d60d8e3703
test(router-plugin, react-start-rsc): tripwire for compiler.idle around done and afterDone (Rspack, webpack)
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>
2026-11-11 13:45:25 +01:00
Sheraff
fc1a787e4a
test(router-utils, start-plugin-core): tripwires for a client build failing in generateBundle and for truncation moving a file's time
- 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>
2026-11-11 13:42:59 +01:00
Sheraff
24195e7d72
refactor(router-utils, router-plugin, start-plugin-core): a watch build takes its stale set at its start; tripwires for Rolldown's watch rebuilds
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>
2026-11-11 13:39:48 +01:00
Sheraff
9112684e50
fix(router-utils): any event of a file asks the resolutions it may take, past the memo
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>
2026-11-11 13:36:23 +01:00
Sheraff
9050bd9f46
perf(router-utils): the touch walk checks a touched cluster's effect before its set, and keeps the last span
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>
2026-11-11 13:35:24 +01:00
Sheraff
a169d276cf
docs(compiler-test-utils): link the oxc refresh issue from the memo(Page as any) pin
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 13:35:12 +01:00
Sheraff
fdff19eee8
refactor(router-utils): one record per plan key
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>
2026-11-11 13:34:59 +01:00
Sheraff
0e080257d7
refactor(router-utils, router-plugin, start-plugin-core): invalidate() returns nothing; the core tells the session of a removal
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>
2026-11-11 13:33:16 +01:00
Sheraff
66685669e8
fix(router-utils): a row holds published and asked apart; a failed answer an event overlapped is asked again
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>
2026-11-11 13:28:23 +01:00
Sheraff
0a7b446799
fix(start-plugin-core): the watch build's sentinel outside the app, its digest over the manifest's maps, followed at each server build's end
- 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>
2026-11-11 13:26:52 +01:00
Sheraff
69845c0aac
test(router-utils, start-plugin-core): design 3 step 5 review rows (failing at head)
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>
2026-11-11 13:23:04 +01:00
Sheraff
f1386681dd
perf(router-utils): one climb of a reference's parents decides both its member write and its read through (memberUse)
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>
2026-11-11 13:21:27 +01:00
Sheraff
9ab4f4005c
perf(router-utils): a cluster's walk of what it touches stops at V again (design 2 step 5)
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>
2026-11-11 13:19:32 +01:00
Sheraff
9c32f898ea
Merge branch 't3/compiler-rewrite-design6' (React route HMR: take the new component after React Refresh's pass; the compile-time prediction deleted) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 13:06:52 +01:00
Sheraff
d0b942807f
test(router-plugin): an effectful declaration another one reads moves with it, in source order (design 2 step 5, R138)
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>
2026-11-11 12:57:47 +01:00
Sheraff
0adf97841d
test(router-utils): a route option calling an unknown function keeps the column helper and the columns before it (design 2 step 5)
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>
2026-11-11 12:39:28 +01:00
Sheraff
b66ddc11ff
test(router-utils): the user's TanStack Table route moves its column helper and columns to the chunk; an unknown call after them keeps both (design 2 step 5)
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>
2026-11-11 12:37:24 +01:00
Sheraff
2b9f42ff4c
fix(router-utils,start-plugin-core): whether a builder link writes its builder is a fact of the builder's kind (design 2 step 4 review, finding 4)
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>
2026-11-11 12:35:51 +01:00
Sheraff
78fc2ec059
test(router-utils): two server fns on a shared const base are independent; a middleware's links stay with their base (design 2 step 4 review, finding 4)
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>
2026-11-11 12:33:30 +01:00
Sheraff
95be989271
fix(router-utils,router-plugin): an option value's own write at an unknown time pins it only when the binding is not confined to its chunk (design 2 step 4 review, finding 3)
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>
2026-11-11 12:32:05 +01:00
Sheraff
b8fd5f1d9b
test(router-utils,router-plugin): an option value whose call runs a function writing state nothing else touches is split (design 2 step 4 review, finding 3)
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>
2026-11-11 12:29:21 +01:00
Sheraff
b8a861f6cd
fix(router-plugin): the React hoist hint unwraps a cast argument (design 6 step 3)
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>
2026-11-11 12:24:07 +01:00
Sheraff
cd9c54800d
fix(router-utils): a mutator-named method is a write only on a built-in collection (design 2 step 4 review, finding 2)
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>
2026-11-11 12:23:39 +01:00
Sheraff
fd306ff1f0
fix(router-utils): a read through another name reads the object that name holds (design 2 step 4 review, finding 1)
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>
2026-11-11 12:19:48 +01:00
Sheraff
e74ee81da1
test(router-utils,router-plugin): state read through another name, and a mutator-named method of the module's own object (design 2 step 4 review, findings 1 and 2)
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>
2026-11-11 12:17:24 +01:00
Sheraff
4b8493d11e
feat(router-utils): an effectful declaration reading another moves when both evaluate in one chunk (design 2 step 5, R138)
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>
2026-11-11 12:12:07 +01:00
Sheraff
fb2be59c44
refactor(router-plugin, start-plugin-core, router-utils): delete React's compile-time refresh identity (design 6 step 2)
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>
2026-11-11 12:10:32 +01:00
Sheraff
f2992d3c08
test(router-utils,router-plugin): two effectful declarations one chunk needs load with it, in source order (design 2 step 5, R138)
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>
2026-11-11 12:06:12 +01:00
Sheraff
27e3a9142e
fix(router-core, react-router): React route HMR takes the new component after the refresh pass (design 6 step 1)
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>
2026-11-11 12:00:59 +01:00
Sheraff
0416a25706
Merge branch 't3/compiler-rewrite-design2-step4' (placement step 4: a pure write to a named binding is a write (R139, narrowed); comma values; reassigned wording) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 11:54:35 +01:00
Sheraff
d7794dfdec
test(router-plugin): React route HMR identity matrix (design 6 step 0)
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>
2026-11-11 11:47:41 +01:00
Sheraff
607d379fbc
perf(router-utils): own augmentations decided once per cluster, pure-write checks without a scan per unit
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>
2026-11-11 11:42:26 +01:00
Sheraff
819c4916d3
Merge branch 't3/design3-step5-implementation' (freshness step 5: client-build record and sentinel; step 4 review fixes) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 11:28:21 +01:00
Sheraff
744c98962d
chore(router-utils): drop imports step 4 left unused
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 11:24:48 +01:00
Sheraff
c0fa265235
chore(changeset): bundled dev keeps watching derived ids' files
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 11:08:07 +01:00
Sheraff
ba1c13a9af
fix(router-utils): a derived id's file stays watched in Vite's bundled dev
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>
2026-11-11 11:06:18 +01:00
Sheraff
390cadfc3c
fix(router-utils): the solver demotes its pinned clusters in cluster order (kept reports keep their order)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 11:00:48 +01:00
Sheraff
9263e8a172
test(router-plugin,start-plugin-core): an augmented export after an effect and a link on a const builder load with their chunk (R139, listed differences)
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>
2026-11-11 10:51:59 +01:00
Sheraff
d1bac5aace
fix(router-utils): a pure write is no effect only on a binding owning the object it writes (R139)
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>
2026-11-11 10:50:02 +01:00
Sheraff
8730b0b61b
test(router-utils): a write through a binding naming another one's object stays an effect
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>
2026-11-11 10:50:02 +01:00
Sheraff
7723b4f12c
perf(router-utils): the shadow index keeps one path per stem as a string; only rows that met a failed resolution carry the field
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 10:49:47 +01:00
Sheraff
a591da866b
refactor(router-utils): a write of pure values to a named binding is a write, not an effect (design 2 step 4, R139)
- 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>
2026-11-11 10:37:57 +01:00
Sheraff
adab66c871
test(router-utils): a pure write to a named binding is a write, not an effect (design 2 step 4, R139)
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>
2026-11-11 10:28:01 +01:00
Sheraff
c31465b14b
fix(router-utils): an evaluation's writes include assignments, import members and functions it passes to a call (design 2 step 3 review rulings)
- 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>
2026-11-11 10:24:34 +01:00
Sheraff
eb7c8d3270
docs, chore(changeset): design 3 step 5 and the step 4 review fixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 10:23:52 +01:00
Sheraff
f4cd72d6d7
perf(start-plugin-core): a server module waits for the client build running (watch builds)
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>
2026-11-11 10:22:33 +01:00
Sheraff
bfbdcdc960
test(router-utils,router-plugin): writes an evaluation runs in a split value or an unclaimed region are its writes (design 2 step 3 review rulings)
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>
2026-11-11 10:18:02 +01:00
Sheraff
bb984e9b04
feat(start-plugin-core, router-plugin, router-utils): the client-build record and its sentinel (design 3 step 5)
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>
2026-11-11 10:16:28 +01:00
Sheraff
818bee4661
fix(router-utils): the reassigned-export warning names the binding and the line reassigning it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 10:13:37 +01:00
Sheraff
772054bac1
test(start-plugin-core): a watch build whose client's first build fails rebuilds the server once the client builds
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>
2026-11-11 10:13:20 +01:00
Sheraff
bf7f00e836
test(router-utils): an exported binding's reassigned warning names the binding and its reassignment
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 10:13:07 +01:00
Sheraff
4ef7358870
fix(router-plugin): a split option value written as a sequence keeps its parentheses in the chunk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 10:12:01 +01:00
Sheraff
16cb8f6836
test(router-plugin): a component option written as a parenthesized sequence is split and renders
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 10:12:01 +01:00
Sheraff
9b7b1fff2e
test(start-plugin-core): F6-2, a fix saved while the client builds the edit that broke the server
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>
2026-11-11 10:03:20 +01:00
Sheraff
31967e8499
test(start-plugin-core): watch builds take a sequence of edit steps
`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>
2026-11-11 10:03:20 +01:00
Sheraff
f16cd50ab3
Merge branch 't3/compiler-rewrite-design2-step3' (placement step 3: the union's reader half goes; step 2's registry cost and checker gate fixed; option-value writes ordered) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 09:56:01 +01:00
Sheraff
0d27136978
fix(router-utils, router-plugin, start-plugin-core): design 3 step 4 review findings
- 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>
2026-11-11 09:54:56 +01:00
Sheraff
1d23897cf0
test: step 4 review rows (rule A repeats, coarse clock, twin pin, broken route on the page)
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>
2026-11-11 09:46:38 +01:00
Sheraff
dd68c9426e
Merge branch 't3/design3-step3-followups' (freshness step 3 follow-ups: raw loaders, failing hooks report, warm-start plan restore, node_modules route warning) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 09:31:07 +01:00
Sheraff
630f4b5263
fix(router-utils): an option value that writes a binding at load stays in place when other code reads it (design 2 step 3, architect ruling)
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>
2026-11-11 09:16:42 +01:00
Sheraff
7b9924751b
test(router-plugin): a reader of state after its last write at load loads with its chunk (design 2 step 3, listed difference)
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>
2026-11-11 09:16:42 +01:00
Sheraff
de17053a96
revert(start-plugin-core): no parse-error hint for binary files with a JS extension in the app
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>
2026-11-11 09:08:00 +01:00
Sheraff
fb7f017cc2
refactor(router-utils): a reader of state written at load is a cluster of its own, placed by the order rule (design 2, step 3)
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>
2026-11-11 08:54:22 +01:00
Sheraff
48fbbddd43
test(router-utils): a reader of state written at load is placed on its own, a writer stays with its binding (design 2, step 3)
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>
2026-11-11 08:43:34 +01:00
Sheraff
6312491276
fix(router-utils): the pipeline checks the placement of the plan it freezes, whatever fallbacks it keeps
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>
2026-11-11 08:39:37 +01:00
Sheraff
76efa9729f
test(router-utils): the plan a module is compiled with is checked whatever fallbacks it keeps (design 2 step 2 review, finding 1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:38:55 +01:00
Sheraff
76a057c9f8
fix(router-utils): a registry filled by statements compiles in quadratic time, not cubic
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>
2026-11-11 08:33:00 +01:00
Sheraff
bd650f88de
test(router-utils): a registry filled by statements compiles in quadratic time, not cubic (design 2 step 2 review, finding 2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:32:17 +01:00
Sheraff
60b7702824
test(router-utils): give the virtual-clock freshness property the time CI's macOS runners take
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:31:06 +01:00
Sheraff
135114ed20
Merge branch 't3/compiler-rewrite-design3-step4' (freshness step 4: the Vite hosts take their stale sets; failed resolutions re-asked on every event) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:20:50 +01:00
Sheraff
a6732f29e8
chore(changeset): the Vite hosts' stale-set take
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:19:09 +01:00
Sheraff
13a4b564a2
test(start-plugin-core): type the binary-asset app as StartBuildOptions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:18:47 +01:00
Sheraff
6a2555d105
fix(start-plugin-core): the client parse error says to give a non-JS file another extension
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>
2026-11-11 08:16:04 +01:00
Sheraff
b0e9dfdef9
fix(router-plugin): restore the plans of route modules a persistent cache restores, at a compiler's first compilation
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>
2026-11-11 08:10:05 +01:00
Sheraff
57ec856038
test(router-plugin): a route id change after a start from the persistent cache rebuilds the route module (webpack, Rsbuild)
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>
2026-11-11 08:07:33 +01:00
Sheraff
828a6c5b53
fix(router-plugin,start-plugin-core): in watch mode our webpack-family hooks report a failure instead of rejecting
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>
2026-11-11 08:01:37 +01:00
Sheraff
9b45c56b5a
test(router-plugin,start-plugin-core): a failed hook of ours fails one dev compilation, and the next edit is built (webpack, Rsbuild)
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>
2026-11-11 07:57:56 +01:00
Sheraff
c9e0b0d37a
fix(router-plugin): warn once per route file under node_modules that webpack/Rspack builds do not split
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>
2026-11-11 07:53:37 +01:00
Sheraff
bee6ae62dc
test(router-plugin): a route file under node_modules is reported as not split (webpack, Rspack)
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>
2026-11-11 07:53:06 +01:00
Sheraff
a25641c14b
chore(changeset): under pnpm, module ids change with each update of the router plugin
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 07:51:28 +01:00
Sheraff
e9eb903b83
fix(router-plugin,start-plugin-core): raw loaders, so a module they do not compile keeps its bytes
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>
2026-11-11 07:51:11 +01:00
Sheraff
5fbb5bda11
test(router-plugin,start-plugin-core): a binary .ts file imported as an asset is emitted byte for byte (webpack, Rspack, Start on Rsbuild)
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>
2026-11-11 07:47:37 +01:00
Sheraff
5e88cd88c3
Merge branch 't3/compiler-placement-step2' (placement step 2: event table, bounded solver, F1-2) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 07:33:14 +01:00
Sheraff
fd3cd8fe8a
test(start-plugin-core): drop the broken-route-on-the-page pin (it times out in the harness under load; the finding is in the lane notes)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 07:05:46 +01:00
Sheraff
3931a9c0bc
fix(start-plugin-core, router-plugin): a registry change rebuilds the route module in every Vite environment, compiled or not
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>
2026-11-11 06:56:26 +01:00
Sheraff
904dd919b8
test(start-plugin-core): the broken route on the page pins its reload as an assertion
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 06:47:52 +01:00
Sheraff
fcf2795939
perf(router-utils): checkPlacement orders O's effects, and only when a source effect left the module
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>
2026-11-11 06:42:01 +01:00
Sheraff
8be54d2a45
feat(start-plugin-core, router-plugin): the Vite hosts take their stale sets in each environment's hook (design 3 step 4)
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>
2026-11-11 06:41:07 +01:00
Sheraff
80bd7281de
fix(router-utils): every file event asks failed resolutions again; a change nothing knows is a creation; an empty read waits unless it repeats one
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>
2026-11-11 06:28:22 +01:00
Sheraff
02fda7833c
test: freshness rows of design 3 step 4, failing first
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>
2026-11-11 06:27:02 +01:00
Sheraff
16a272de33
perf(router-utils): the event table walks touches per rule instead of storing them
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>
2026-11-11 05:58:13 +01:00
Sheraff
723e36c7ca
Merge branch 't3/design3-step3-implementation' (freshness step 3: the router's webpack-family host drains through the shared StaleSetDrain, static loader rule) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 05:37:22 +01:00
Sheraff
cfad828c78
chore(changeset): the router loader rule renames other modules' deterministic ids once
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 05:36:13 +01:00
Sheraff
1d02906421
refactor(router-utils): the event table and one bounded solver decide what may move (design 2, step 2)
`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>
2026-11-11 05:31:24 +01:00
Sheraff
75d1fac40b
fix(router-utils): a name's value includes the statements writing it at load; a region nests in one unit
`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>
2026-11-11 05:12:24 +01:00
Sheraff
9277632b1e
test(router-utils): a name's value includes the statements writing it; a region nests in one unit (design 2, step 2)
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>
2026-11-11 05:07:35 +01:00
Sheraff
93a5a0f994
Merge branch 't3/compiler-rewrite-design2-steps0-1' (placement steps 0-1: F1 tests, one walk per member, one insert owner) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 04:42:20 +01:00
Sheraff
1901c4710f
fix(start-plugin-core): under RSC the client's stale set asks the server compiler for a compilation
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>
2026-11-11 04:16:30 +01:00
Sheraff
26d378ea87
test(react-start-rsc): edits after a route file is created reach the page (RSC Rsbuild dev)
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>
2026-11-11 04:15:39 +01:00
Sheraff
43eac2220d
test(router-plugin): created routes on webpack dev
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>
2026-11-11 04:04:03 +01:00
Sheraff
eedc8067ad
fix(router-utils): the stale-set drain builds what a compilation's own events did not; the wake bound counts compilations that left the set full
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>
2026-11-11 04:01:52 +01:00
Sheraff
7d383aa864
test(router-plugin): a stale route rewritten unchanged is built on webpack with hash snapshots
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>
2026-11-11 03:51:58 +01:00
Sheraff
739284b583
feat(router-plugin): the webpack-family host drains the stale sets at finishMake (design 3, step 3)
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>
2026-11-11 03:51:02 +01:00
Sheraff
e9eec2c8cb
test(router-plugin): a route id change rebuilds the route module in webpack dev (F7-5a)
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>
2026-11-11 03:41:51 +01:00
Sheraff
5b7ed17cf3
test(router-utils): scaling compares 400 with 6,400 sampled alternately, so load can't pass for quadratic time
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 03:29:24 +01:00
Sheraff
2e0ab25671
Merge branch 't3/design3-step2-freshness' (freshness step 2: the Rsbuild host drains the stale sets) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 03:13:24 +01:00
Sheraff
cd4a7c7035
fix(start-plugin-core): a stale importer explains a marked module's presence (import protection, Rsbuild dev)
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>
2026-11-11 02:47:46 +01:00
Sheraff
43163a8f77
refactor(router-utils): what an evaluation runs comes from its reads' walk
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>
2026-11-11 01:54:50 +01:00
Sheraff
9457b27729
fix(router-utils): one owner per insert, for the walk, the reads and the env pieces
`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>
2026-11-11 01:53:04 +01:00
Sheraff
d1b243165e
test(router-utils): an insert has one owner (design 1 final review, findings 1, 2 and 4)
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>
2026-11-11 01:53:02 +01:00
Sheraff
97aeda6f8c
perf(start-plugin-core): a compilation's own changed files leave its stale set at make
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>
2026-11-11 01:32:18 +01:00
Sheraff
a536543f81
refactor(router-utils): one walk for what an evaluation runs (design 2, step 1)
`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>
2026-11-11 01:21:29 +01:00
Sheraff
44b693d756
test: what an evaluation runs, one walk for every placement rule (design 2, step 0)
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>
2026-11-11 00:54:41 +01:00
Sheraff
aece2f164a
feat(start-plugin-core): Rsbuild host drains the stale sets at finishMake (design 3, step 2)
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>
2026-11-11 00:22:25 +01:00
Sheraff
1c5e27b377
Merge branch 't3/rewrite-design1-step4' (rewrite tree step 4: placement reads once per plan, env module from pieces) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 00:21:26 +01:00
Sheraff
dcd9d617f6
perf(router-utils): one span visitor per renderer
`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>
2026-11-11 00:10:29 +01:00
Sheraff
dfdaabcd90
fix(router-utils): an add or a removal is never a repeat; a text without a plan drops the old plan; staleHits split
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>
2026-11-11 00:10:25 +01:00
Sheraff
f712f6deca
refactor(router-utils): the env module is put together from pieces (design 1, step 4)
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>
2026-11-11 00:10:14 +01:00
Sheraff
101e517121
test: freshness design 3 step 2 (Rsbuild host): failing tests first
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>
2026-11-11 00:00:43 +01:00
Sheraff
33c60cf1a9
perf(router-utils): region reads from one index per plan (design 1, step 4)
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>
2026-11-10 23:44:04 +01:00
Sheraff
ce3f5b932d
Merge branch 't3/design3-steps0-1-implementation' (freshness steps 0-1: tests, comparing invalidation in the core) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 23:35:15 +01:00
Sheraff
6a6cbd8ed8
Merge branch 't3/design1-step3-region-renderer' (rewrite tree step 3: text and place) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 23:19:46 +01:00
Sheraff
a23818bf70
feat(router-utils): invalidate() compares the file with what the caches read; stale sets per environment
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>
2026-11-10 22:51:36 +01:00
Sheraff
0239238822
test(router-utils): repeating an invalidation is harmless; after any edits, the same as a fresh start
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>
2026-11-10 22:51:18 +01:00
Sheraff
a682dae553
refactor(router-utils): text and place per region (design 1, step 3)
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>
2026-11-10 22:29:50 +01:00
Sheraff
444f06cc27
test: text at a claimed or handler place compiles per output (design 1, step 3)
- 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>
2026-11-10 22:00:50 +01:00
Sheraff
7125a94c29
test(router-generator): skip the unreadable-file batch test as root, which chmod doesn't stop
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 21:49:59 +01:00
Sheraff
71bd62cf3d
chore(changeset): one entry for the rewrite tree's scaling fixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 21:41:48 +01:00
Sheraff
93b2a6ba2b
Merge branch 't3/design1-step2-renderer-visitor' (rewrite tree step 2: the renderer walks the region tree) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 21:40:58 +01:00
Sheraff
9945237b91
refactor(router-utils): the renderer is the walk of the region tree (design 1, step 2)
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>
2026-11-10 21:19:34 +01:00
Sheraff
688113921f
Merge branch 't3/oracle-parallel-runner' (oracle runs in parallel: docs) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 20:51:26 +01:00
Sheraff
62a6636fe9
docs(compiler-test-utils): run the whole oracle's targets at once
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>
2026-11-10 20:50:06 +01:00
Sheraff
125e21dc70
test(router-utils): a kept slice cutting an edited region fails the compile; an insert at a claim's edge renders once (design 1, I3/I5)
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>
2026-11-10 20:02:57 +01:00
Sheraff
d62279044e
Merge branch 't3/design1-step1-implementation' (rewrite tree step 1: one region tree, liveness by climb) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 19:41:44 +01:00
Sheraff
14a34e5d28
perf(router-utils): keep the units out of the region tree, skip ranges without edits
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>
2026-11-10 19:09:23 +01:00
Sheraff
dd7a83110f
Merge branch 't3/fix-spelling-variant-splits' (local bugs 1110, lane C) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:43:55 +01:00
Sheraff
fa5066e1a4
fix(router-plugin, start-plugin-core): production maps of Vite builds name a derived output's source by its file
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>
2026-11-10 18:34:18 +01:00
Sheraff
9f65adce66
test(router-plugin): an app's own sourcemapPathTransform still names a split route's sources
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:34:18 +01:00
Sheraff
440bb4bee6
test(start-plugin-core): every output of a Start route file names it once in the emitted maps
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>
2026-11-10 18:34:18 +01:00
Sheraff
435192b66a
test(router-plugin): every emitted map of a split route names the route file once, without the compiler's query
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>
2026-11-10 18:34:18 +01:00
Sheraff
a6c25f636f
refactor(router-utils): one region tree per plan, liveness by climbing it (design 1, step 1)
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>
2026-11-10 18:05:24 +01:00
Sheraff
4eb3e81c4e
test(router-utils): seeded random rewrite trees, liveness against the compiled module (design 1, §5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:05:04 +01:00
Sheraff
68590dfc0f
chore: changeset for the spelling-variant fixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:00:26 +01:00
Sheraff
d0d7981df6
test(router-utils): edits that cut each other conflict whichever outputs they are scoped to (design 1, I1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 17:52:02 +01:00
Sheraff
1ed7fcebda
test(router-utils): a module of 1,600 server functions compiles in less than 6 times one of 400 (F9-3)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 17:52:02 +01:00
Sheraff
dc0d2df7fa
Merge branch 'proto/rspack-rebuild-batch' (HACK rspack#16567: one-tick rebuild batch led by an entry module) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 17:50:18 +01:00
Sheraff
a3b5cd6454
test(start-plugin-core): tripwire for the batched Rspack rebuild
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>
2026-11-10 17:42:53 +01:00
Sheraff
f922f750b3
proto(router-utils): batch Rspack rebuildModule calls behind an entry lead (HACK rspack#16567)
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>
2026-11-10 17:42:53 +01:00
Sheraff
251b1ef05e
fix(router-plugin): the this check and codeSplitGroupings read the value an option names through its bindings
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>
2026-11-10 17:42:03 +01:00
Sheraff
af93357864
test(router-plugin): a this-reading loader named by a binding stays, and groupings read through two consts
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>
2026-11-10 17:40:50 +01:00
Sheraff
0b0f7e7fd3
fix(start-plugin-core): an env implementation in a type wrapper keeps parsing where it replaces its call
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>
2026-11-10 17:33:44 +01:00
Sheraff
840b774385
test(start-plugin-core): an env implementation in a type wrapper, called in place, builds and runs
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>
2026-11-10 17:33:44 +01:00
Sheraff
9e926c96c9
Merge branch 't3/local-bugs-lane-a' (local bugs 1110, lane A) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 17:21:27 +01:00
Sheraff
31acb1ff21
Merge branch 't3/local-bugs-lane-b' (local bugs 1110, lane B) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 17:14:30 +01:00
Sheraff
f890aab021
feat(router-plugin): route HMR for lazy route files (F8-3)
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>
2026-11-10 16:31:14 +01:00
Sheraff
44908c3f8f
style: sort the ViteRunSessions import members
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:30:04 +01:00
Sheraff
fffdbb1eab
fix(router-plugin): the webpack-family host ends its route listener at the compiler's shutdown
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:24:49 +01:00
Sheraff
1861397760
test(router-plugin): a finished webpack or Rspack build leaves no router compiler session alive
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:24:11 +01:00
Sheraff
c64412fc68
test(router-plugin): an edit of a lazy route file updates in place (F8-3)
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>
2026-11-10 16:23:37 +01:00
Sheraff
79b78e6cf6
test(compiler-test-utils): the watch helper settles on the build that took the edit (F9-7)
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>
2026-11-10 16:20:37 +01:00
Sheraff
6b9b31f5d1
test(react-start-rsc): a second build of one Rsbuild instance serves its own client files
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:20:25 +01:00
Sheraff
be27de9918
test(compiler-test-utils): rebuildAfter describes the edit's rebuild when it lands during a build (F9-7)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:19:52 +01:00
Sheraff
9decf742ec
fix(router-utils): Vite watch builds watch the files a module's plan read
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:16:28 +01:00
Sheraff
7c92ec0856
test: the platform smoke set is a list of files (F9-5)
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>
2026-11-10 16:16:12 +01:00
Sheraff
ecdf90c52e
test(start-plugin-core): vite build --watch rebuilds a client whose mocked file stops being denied
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:14:48 +01:00
Sheraff
1c70b86d7c
fix(router-plugin): the Vite host keeps one session per build run or dev server, shared with Start's host
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:12:29 +01:00
Sheraff
9a5d07ede0
test(router-plugin): a Vite dev server with inline plugins re-plans route modules after it restarts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:09:42 +01:00
Sheraff
246e5ef822
fix(router-generator): a failed batch makes the next one rescan (F8-4)
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>
2026-11-10 16:08:27 +01:00
Sheraff
8cc434b8e4
test(router-generator): a failed read in a batch keeps another file's change (F8-4)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:07:49 +01:00
Sheraff
fbdf27daae
docs(start): a second argument to .handler() is outside what the compiler follows
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:06:29 +01:00
Sheraff
c10e470f41
fix(start-plugin-core): allocate each server fn's wrapper name when its site is found, in every environment
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:06:04 +01:00
Sheraff
2cd20ea9dd
fix(router-utils): an external resolution is an answer, not a failure (F3-3)
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>
2026-11-10 16:04:54 +01:00
Sheraff
51605dfa3f
test(start-plugin-core): a client call reaches its own server fn when a nested one the client erases derives the same wrapper name
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:03:53 +01:00
Sheraff
d10ac45a06
fix(start-plugin-core): the Vite dev lookup compiles only files the dev server may serve
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:02:11 +01:00
Sheraff
12e926005e
test(start-plugin-core): the Vite dev lookup refuses an id naming a file the dev server may not serve
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:00:51 +01:00
Sheraff
ad813d23a0
test(router-utils): an external answer is not asked again on add/unlink (F3-3)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 16:00:34 +01:00
Sheraff
bd1c776845
fix(router-utils): plan caching off keeps each plan's dependencies (F3-2)
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>
2026-11-10 15:58:12 +01:00
Sheraff
b0424b28a9
test(router-utils): dependents reported with plan caching off (F3-2)
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>
2026-11-10 15:57:26 +01:00
Sheraff
5135508494
Merge branch 't3/rsc-layer-resolver-conditions' (G5-6: per-layer resolver for Rsbuild RSC) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 14:05:40 +01:00
Sheraff
615d08c514
test(router-utils): invalidation hosts take the plan key
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:39:54 +01:00
Sheraff
d9a880d890
fix(start-plugin-core): the compiler resolves Rsbuild's RSC layer with its rule options
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>
2026-11-10 12:37:55 +01:00
Sheraff
f46a260ab2
test(react-start-rsc): import protection judges the file Rsbuild's RSC layer resolves
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>
2026-11-10 12:31:03 +01:00
Sheraff
25d695b1a8
Merge branch 't3/copy-guard-safety-net' (renderer copy guard) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:11:23 +01:00
Sheraff
584d747cb1
chore(router-utils): import order after the self-checks rename
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:10:21 +01:00
Sheraff
5d256bc633
Merge branch 't3/run-scoped-state' (Start plugin state per build run / dev server) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 11:39:54 +01:00
Sheraff
30a969cc69
docs(start-plugin-core): the Rsbuild session's lifetime
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 11:34:23 +01:00
Sheraff
03d8af0e84
docs(router-utils): copied text keeps its edits, the renderer's copy check, and edits scoped to one output
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 11:26:45 +01:00
Sheraff
bd5daba582
fix(router-utils): fail the compile when copied text would lose an edit under it (R127 safety net)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 11:19:20 +01:00
Sheraff
cd0e5480fb
test(router-utils): copied text keeps the edits under it (an owner copying part of its claim)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 11:19:20 +01:00
Sheraff
e00cf30e3b
fix(start-plugin-core): scope Start's compiler state to a build run or a dev server
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>
2026-11-10 10:56:54 +01:00
Sheraff
c9c0c8a4b1
test(start-plugin-core): builds and dev servers that reuse Start's plugins
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>
2026-11-10 10:43:17 +01:00
Sheraff
a849a0841c
Merge branch 't3/fix-split-cast-wrapper-leak' (cast-wrapped split values leaked server code) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 10:39:17 +01:00
Sheraff
093ac316c3
fix(router-plugin): a split or hoisted route option value in a cast claims the text it copies
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>
2026-11-10 09:55:27 +01:00
Sheraff
12a54bd43d
test(start-plugin-core): a dev route component kept in the route module, in a type wrapper, serves the client its client compile
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>
2026-11-10 09:53:29 +01:00
Sheraff
25925592e8
test(start-plugin-core): split loader values in type wrappers keep each build's compile (self-checks on and off)
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>
2026-11-10 09:50:17 +01:00
Sheraff
f4d66bdcf6
Merge branch 't3/review-round3-f1-fixes' (round 3 follow-ups F1) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 09:46:48 +01:00
Sheraff
366e8f8437
perf(start-plugin-core): judge a target's two ids in one async function
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>
2026-11-10 09:44:14 +01:00
Sheraff
3dd6a3965e
Merge branch 't3/review3-f2-wrapper-shapes' (round 3 follow-ups F2) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 09:22:40 +01:00
Sheraff
b2742f48b3
fix(start-plugin-core): the builder-assignment message and the import-protection route-option fix see through every expression wrapper
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>
2026-11-10 08:32:20 +01:00
Sheraff
f71b1af341
test(start-plugin-core): refusals and fixes for wrapped assignment targets and wrapped route option components
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>
2026-11-10 08:31:39 +01:00
Sheraff
6e95c5dd35
refactor(start-plugin-core): judge an id's #-cut path only when the id holds a #
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>
2026-11-10 08:30:58 +01:00
Sheraff
d251a10091
fix(start-plugin-core): Rsbuild dev hands over the warnings of a module the newer compilation built again
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>
2026-11-10 08:26:12 +01:00
Sheraff
7da3f9064b
test(start-plugin-core): Rsbuild dev hands over the warnings of a module the newer compilation built again
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>
2026-11-10 08:25:00 +01:00
Sheraff
b52e3a2f0b
fix(start-plugin-core): an Rsbuild file is created only when no environment's last compilation knows it
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>
2026-11-10 08:24:10 +01:00
Sheraff
d5d70cebe7
fix(router-plugin): a split option value another planner claims fails the build at the value (R3-G7-4)
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>
2026-11-10 08:23:45 +01:00
Sheraff
093b5edf73
test(start-plugin-core): an Rsbuild file event is a creation only when no environment's last compilation knows the file
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>
2026-11-10 08:22:42 +01:00
Sheraff
06a6c42bbd
fix(start-plugin-core): Vite judges a #fragment import as the file too
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>
2026-11-10 08:20:35 +01:00
Sheraff
7b58e64158
Merge fingerprint follow-up D (export keys computed on first read) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 08:19:21 +01:00
Sheraff
94bb3b3090
docs(start): an import that disables the configured loaders is a deliberate bypass of the compiler
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>
2026-11-10 08:18:16 +01:00
Sheraff
52a5ed0831
test(start-plugin-core): a worker's pattern import of a denied file fails the Rsbuild build, naming the file
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>
2026-11-10 08:17:53 +01:00
Sheraff
31bb419225
fix(start-plugin-core): a worker's denied import fails the Rsbuild build with its violation report
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>
2026-11-10 08:16:36 +01:00
Sheraff
e2c5ad1caa
test(start-plugin-core): a worker's denied import fails the Rsbuild build at the import, reported as its violation
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>
2026-11-10 08:16:12 +01:00
Sheraff
29a1a22ec3
test(start-plugin-core): a split loader written as a server fn in place fails the build at the server fn (R3-G7-4)
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>
2026-11-10 08:15:58 +01:00
Sheraff
19372c013e
Merge fingerprint follow-up C (one exports record per module, star list folded in) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 08:13:11 +01:00
Sheraff
6fcf8db4a8
Merge branch 't3/review3-lane2-dce-cache-fixes' (review round 3, lane 2) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 02:18:37 +01:00
Sheraff
cd076b4eee
Merge branch 't3/review3-placement-analysis-fixes' (review round 3, lane 3) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 02:04:27 +01:00
Sheraff
c779c38c36
fix(start-plugin-core): a dev server without HMR invalidates through watchChange
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>
2026-11-10 01:21:31 +01:00
Sheraff
c4d8f8353a
test(start-plugin-core): move the dev-input regression tests to their own file (per-file budget)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 01:21:31 +01:00
Sheraff
7818437c79
test(start-plugin-core): a dev server without HMR never invalidates the compiler (R3-G4-4)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 01:19:32 +01:00
Sheraff
b2de9bae44
fix(router-utils): an exhausted compile's last plan stays indexed by its dependencies
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>
2026-11-10 01:17:33 +01:00
Sheraff
13724a4672
test(router-utils): an exhausted compile leaves its module unreported by later edits (R3-G3-2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 01:16:27 +01:00
Sheraff
5f736c85f4
fix(router-utils): a tsconfig or jsconfig edit moves the file set
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>
2026-11-10 01:14:44 +01:00
Sheraff
4e402aba75
test(start-plugin-core): a tsconfig paths edit leaves a server fn compiled against the old resolution (R3-G3-1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 01:12:46 +01:00
Sheraff
939e00e9f8
fix(start-plugin-core): every dev environment loads the virtual ids it resolved
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>
2026-11-10 01:10:29 +01:00
Sheraff
0b9f743f42
test(start-plugin-core): a factory of a virtual module is unknown to the SSR compile in dev (R3-G4-2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 01:09:16 +01:00
Sheraff
2d2ddf1f3c
fix(router-utils): compose an earlier loader's index map (R3-G7-6)
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>
2026-11-10 01:09:05 +01:00
Sheraff
02ffd887b9
test(router-utils): type the output list of the derived-order test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 01:09:05 +01:00
Sheraff
28e1198c5a
fix(start-plugin-core): a watch rebuild's server waits for the client's bundle, manifest included
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>
2026-11-10 01:07:38 +01:00
Sheraff
3889e3aca6
test(router-plugin): an index map from an earlier webpack/Rspack loader composes (R3-G7-6)
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>
2026-11-10 01:04:59 +01:00
Sheraff
65ca02fcb4
Merge branch 't3/review3-lane1-security-fixes' (review round 3, lane 1) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 01:02:59 +01:00
Sheraff
281b79c680
fix(router-utils): a unit anchored after a statement renders before the next one in derived outputs (R3-G7-3)
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>
2026-11-10 01:02:14 +01:00
Sheraff
1334982a41
test(start-plugin-core): a vite build --watch rebuild renders the previous client build's files (R3-G4-1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 01:00:13 +01:00
Sheraff
2d5cf69e66
test(react-start-rsc): a chain hoisted after the declaration it reads loads in the provider (R3-G7-3)
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>
2026-11-10 00:59:46 +01:00
Sheraff
6664c3ad26
fix(start-plugin-core): follow a var builder only when it is the name's value
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>
2026-11-10 00:58:33 +01:00
Sheraff
da82127ee3
test(start-plugin-core): a var redeclaring a function or parameter ships its builder's handler (R3-G2-3)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 00:58:33 +01:00
Sheraff
069316cf18
test(start-plugin-core): pin the in-place server fn split loader, with the const spelling as control (R3-G7-4, open)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 00:57:43 +01:00
Sheraff
7a4e88f6c2
fix(router-utils): a join of isomorphic fns keeps what their call gives, or is unknown
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>
2026-11-10 00:55:19 +01:00
Sheraff
8652820623
test(start-plugin-core): a join of isomorphic fns loses what one call returns (R3-G2-2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 00:54:22 +01:00
Sheraff
a801c22768
test(start-plugin-core): a split loader written as a server fn builds (R3-G7-4)
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>
2026-11-10 00:53:51 +01:00
Sheraff
c0c10dc7bb
fix(router-utils): a renamed exported binding re-exports only its own name (R3-G7-2)
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>
2026-11-10 00:51:28 +01:00
Sheraff
04023bc7f7
fix(router-utils): order load-time writes and reads where they run (R3-G1-2, G1-4, G8-1, G8-2)
- 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>
2026-11-10 00:49:52 +01:00
Sheraff
53a70008c5
fix(router-utils): a function-local declarator only erased code reads goes with its initialiser
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>
2026-11-10 00:48:59 +01:00
Sheraff
e69587b370
test(router-plugin): each export of a declaration keeps its binding when route HMR renames the component (R3-G7-2)
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>
2026-11-10 00:46:59 +01:00
Sheraff
abd1e30a44
test(start-plugin-core): a middleware factory's helper call stays on the client (R3-G2-1)
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>
2026-11-10 00:45:01 +01:00
Sheraff
c84879939c
Merge fingerprint follow-up B (fingerprint paths without a parse) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 00:39:23 +01:00
Sheraff
9fab7a0ce3
test(router-plugin): a load-time value only split code reads keeps its value (R3-G1-2, G1-4, G8-1, G8-2)
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>
2026-11-10 00:37:10 +01:00
Sheraff
2bb9b047c2
Merge branch 't3/review2-lane-b-dead-code-cleanup' (review round 2, lane B) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 00:28:40 +01:00
Sheraff
4ac9351a6b
Merge branch 't3/review-round3-lane4-fixes' (review round 3, lane 4) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 00:08:08 +01:00
Sheraff
bbdefdba54
test(start-plugin-core): type the fragment test's build failure as the build error
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 23:45:07 +01:00
Sheraff
c0ff63ca35
fix(start-plugin-core): an app entry a file rule denies is its own violation
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>
2026-11-09 23:41:59 +01:00
Sheraff
a7f4505032
test(start-plugin-core): a pattern import reaching a *.server.* entry gets its mock, reported
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 23:41:59 +01:00
Sheraff
aec5e4c414
docs(start): the import-protection guide's split example names the client-imported file without .server
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 23:39:41 +01:00
Sheraff
a976343cb5
fix(start-plugin-core): every rsbuild build --watch rebuild is a run of the warning ledger
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>
2026-11-09 23:38:52 +01:00
Sheraff
cd483c0c8a
test(start-plugin-core): an invalid custom server fn id fails every build --watch rebuild
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 23:38:09 +01:00
Sheraff
2bea4eceb8
fix(start-plugin-core): Vite dev resolves an allowed import of a pre-bundled dependency to its bundle
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>
2026-11-09 23:35:56 +01:00
Sheraff
f672aa8dbf
test(start-plugin-core): Vite dev serves an allowed import of a pre-bundled dependency its bundle
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 23:35:56 +01:00
Sheraff
704dcb2f4c
fix(start-plugin-core): Rsbuild warm builds keep an exempt importer's real module of an edited denied file
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>
2026-11-09 23:30:33 +01:00
Sheraff
8749a536c8
test(start-plugin-core): an Rsbuild warm build keeps an exempt importer's real module of an edited denied file
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 23:28:09 +01:00
Sheraff
a0ab411bc1
fix(router-utils): a webpack-family resource's fragment names no other source
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>
2026-11-09 23:18:56 +01:00
Sheraff
2247d5070d
test(start-plugin-core): an import with a #fragment is judged and compiled as its file
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 23:15:34 +01:00
Sheraff
3207ccd8a8
test(router-plugin): pin a route edit reloading after a recovered render error (R3-G9-2, open)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 23:10:58 +01:00
Sheraff
5504665661
fix(start-plugin-core): compile a script imported under a query its bundler ignores
`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>
2026-11-09 23:10:49 +01:00
Sheraff
d9f1c3ab75
docs(start): list every Hydrate pattern that fails the build; changesets for lane review3-4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 23:10:36 +01:00
Sheraff
a3377bdbf9
fix(start-plugin-core): link the CSS of a boundary reached through a hydration chunk's imports
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>
2026-11-09 23:08:13 +01:00
Sheraff
c1b92cef1d
test(start-plugin-core): a boundary inside a helper two boundaries share keeps its CSS linked
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 23:06:51 +01:00
Sheraff
7d50fd1692
fix(router-plugin): route HMR identity is the refresh family, not the binding name
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>
2026-11-09 23:05:25 +01:00
Sheraff
7ea71bf286
perf(router-utils): key a summary's exports when they are read
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>
2026-11-09 23:03:11 +01:00
Sheraff
f9f4fd682d
perf(router-utils): one exports record per module, star list included
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>
2026-11-09 23:03:11 +01:00
Sheraff
a71b730223
test(start-plugin-core): a script under an asset query its bundler ignores is compiled as the file
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 23:02:10 +01:00
Sheraff
f336ec506c
test(router-plugin): route HMR shows a same-named component from another module
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 23:01:49 +01:00
Sheraff
3e00e1f366
test(router-plugin): an imported component read by a split and an unsplit option (#8914)
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>
2026-11-09 23:01:49 +01:00
Sheraff
452a161381
refactor(start-plugin-core): the Hydrate planner reads its typed config
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 22:59:54 +01:00
Sheraff
b0928618ce
fix(start-plugin-core): React Hydrate refuses a closure reading a reassigned let
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>
2026-11-09 22:59:54 +01:00
Sheraff
d8b2e95ce7
fix(start-plugin-core): Solid Hydrate takes a wrapped ref for a ref assignment
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>
2026-11-09 22:59:54 +01:00
Sheraff
b1c66ef932
fix(router-utils): guard a statement start rendered through a substitution environment
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>
2026-11-09 22:59:40 +01:00
Sheraff
e97b33ea6c
fix(start-plugin-core): Rsbuild judges a request with inline loaders as the file it loads
`!!./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>
2026-11-09 22:57:53 +01:00
Sheraff
939f17c045
test(start-plugin-core): Rsbuild judges imports with webpack inline loaders as the file they load
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 22:56:21 +01:00
Sheraff
0072ae33b1
fix(start-plugin-core): Rsbuild child compilers run Start's loaders as their environment's
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>
2026-11-09 22:52:16 +01:00
Sheraff
18954fbbaa
test(start-plugin-core): Rsbuild child compilers compile their modules as the environment's
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>
2026-11-09 22:52:16 +01:00
Sheraff
53229e9d05
test(start-plugin-core): a React Hydrate closure reading a reassigned let fails the build
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 22:52:03 +01:00
Sheraff
2c37de5a71
test(start-plugin-core): Solid Hydrate statements without semicolons and wrapped refs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 22:52:03 +01:00
Sheraff
7f4a489d99
fix(start-plugin-core): prerender discovery keeps routes without a route file
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>
2026-11-09 22:46:19 +01:00
Sheraff
fc249c9772
test(start-plugin-core): a lazy-only route is discovered for prerendering
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 22:45:47 +01:00
Sheraff
987dd345e4
fix(router-generator): the tree model changes with the published tree
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>
2026-11-09 22:43:50 +01:00
Sheraff
fa02a14408
test(router-generator): a batch that fails to publish leaves the tree model as published
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 22:43:19 +01:00
Sheraff
ed3bdff893
fix(router-generator): a route file a virtual route config names must exist
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>
2026-11-09 22:42:28 +01:00
Sheraff
b4bfd11c8e
test(router-generator): a virtual route config naming a missing file fails the run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 22:41:18 +01:00
Sheraff
30fc5344a9
refactor: one owner for each duplicated compiler helper
- 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>
2026-11-09 22:36:54 +01:00
Sheraff
562aab3b4b
refactor(start-plugin-core): one owner each for the provider bit and the client build's end
- `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>
2026-11-09 22:27:28 +01:00
Sheraff
8486bd1eae
refactor: un-export names used only in their own file
- router-plugin: splitGroupingsSchema, RoutesChangedListener,
  CODE_SPLITTER_PLUGIN_NAME, WebpackPluginOptions, routerLoaderPath,
  RouterPlannerEnv, RouterCompilerOptions, CompileRequest, SplitShape,
  NotSplitReason, NotSplit, and route.ts's RouteKind, RouteFactory,
  ROUTER_PACKAGE_RE, OptionKind, OptionsResolution, RouteRecognition.
- router-generator: watchRouteFiles/RouteFileWatcher leave the package index
  (new in this PR; only watch/session.ts uses them); getRouteMeta,
  getRouteNodesRecursive, UnparsableRouteFileError, RouteConstructorName,
  RouteFileExpectation, TreeModelInput, PrintTreeOptions, ScaffoldKind,
  ScaffoldOptions, hasEscapedTrailingUnderscore, hasRoutePathSegmentMetadata,
  removeLayoutSegments.
- start-plugin-core: selfEdgeKey, targetExcluded, matchFile;
  StartCompilerSession.envInfo is private.
- compiler-test-utils: linkDirectorySync, consoleMethods, consoleText,
  hostPagePath, initialFilesAge (types in exported signatures stay).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 22:24:13 +01:00
Sheraff
d499d046c6
refactor(router-utils, start-plugin-core): remove compiler code nothing produces or reads
- 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>
2026-11-09 22:21:35 +01:00
Sheraff
db36fa3860
Merge branch 't3/pure-calls-server-builder-chains' (builder rule on the server, default-import React.memo) into t3/yuku-compiler-rewrite
Builder factories keep their bindings (round-2 lane A) in the merged single import scan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 21:57:01 +01:00
Sheraff
c05619049f
Merge branch 't3/extracted-rpc-verify-fix' into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 21:55:47 +01:00
Sheraff
30b9c35beb
perf(router-utils): fingerprint paths without parsing the id
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>
2026-11-09 21:54:57 +01:00
Sheraff
dcb5e03a5d
Merge branch 't3/barrel-fingerprint-bound' (fingerprint records per plan and module) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 21:22:40 +01:00
Sheraff
0598b32dbe
test: every module holding a server-fn stub imports its runtime itself
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>
2026-11-09 21:14:01 +01:00
Sheraff
8e6c54e700
Merge branch 't3/review-fixes-lane-a' (review round 2, lane A) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 21:13:31 +01:00
Sheraff
584a5b724e
test(router-utils): the generated-imports block before the builder-chain comment
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 21:07:43 +01:00
Sheraff
ea451e3705
test(react-start-rsc): a route exporting two server fns its component reads, RSC builds
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>
2026-11-09 21:06:19 +01:00
Sheraff
5e10506b99
fix(router-utils): a generated import is an import cluster in placement
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>
2026-11-09 20:50:59 +01:00
Sheraff
a1328d5e46
test(start-plugin-core): two exported server fns a component reads build with the self-checks on
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>
2026-11-09 20:45:01 +01:00
Sheraff
770d624a14
Merge branch 't3/ci-e2e-compiler-verify' into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 20:11:49 +01:00
Sheraff
8ea19a0b64
ci: run the e2e compiles with the compiler's self-checks on
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>
2026-11-09 20:10:56 +01:00
Sheraff
bc4af4e125
docs(compiler-test-utils): OQ14 is answered, a chunk forwards component: Outlet as on main
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 20:09:11 +01:00
Sheraff
dadaa543c1
Merge branch 't3/yuku-compiler-arch-refactors' (architecture refactors 1-3) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 20:02:55 +01:00
Sheraff
17c6dfe973
style: format
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 19:54:25 +01:00
Sheraff
82af24094a
fix(start-plugin-core): the unchecked-importers warning of a marked module names its marker
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>
2026-11-09 19:52:49 +01:00
Sheraff
2aa68985df
fix(router-utils): builder purity knows chain factories by binding
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>
2026-11-09 19:51:19 +01:00
Sheraff
84905fd1b0
test(router-utils): the shadowed-factory orphan reads no import (else the orphaned-imports rule drops it)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 19:50:20 +01:00
Sheraff
d91c60327f
perf(router-utils): read a module's chain-factory imports in the analysis's one import pass
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>
2026-11-09 19:48:04 +01:00
Sheraff
5f5028b51c
fix(router-plugin): the esbuild entry runs the route generator at each build start
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>
2026-11-09 19:47:40 +01:00
Sheraff
1a9c1239f9
fix(router-core): a loader's non-Error throw caught by Solid's boundary is no render error
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>
2026-11-09 19:46:45 +01:00
Sheraff
4082ac363c
chore(changeset): a file emptied on purpose is an empty module
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 19:46:45 +01:00
Sheraff
75585bdca3
docs: builder chains in the compiler README, temp dir rationale, misplaced doc comments
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 19:44:09 +01:00
Sheraff
7618ca1a54
test(start-plugin-core): a namespace read by member, of a module that does not parse
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 19:44:09 +01:00
Sheraff
d0f52bd16e
test(start-plugin-core): the unchecked-importers warning of a marked module names its marker
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 19:44:09 +01:00
Sheraff
9ced6941c3
test(router-utils): the self-checks warn branch returns the violation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 19:44:09 +01:00
Sheraff
8b6454354a
test(router-utils): a local shadowing a builder factory keeps an orphan's effects
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 19:44:08 +01:00
Sheraff
88b4e3c482
test(router-plugin): the esbuild entry generates the route tree of an app that has none
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 19:44:08 +01:00
Sheraff
f45365827a
test(start-plugin-core): Solid route edits after a loader threw a value that is no Error
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 19:44:08 +01:00
Sheraff
1df4230513
fix(router-utils): a file that still reads empty after the save retries is an empty module
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>
2026-11-09 19:36:57 +01:00
Sheraff
68af981940
perf(router-utils): aggregate export reads per module while compiling
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>
2026-11-09 19:33:04 +01:00
Sheraff
3f832e35f4
perf(router-utils): one exports fingerprint per (plan, module) read by name
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>
2026-11-09 19:33:04 +01:00
Sheraff
58b6e3c3f7
test(start-plugin-core): a server-only module emptied by an edit stops failing its importer in dev
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 19:29:45 +01:00
Sheraff
d7a8a90793
refactor(start-plugin-core): split the Vite and Rsbuild Start plugins by the plugins they hold
`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>
2026-11-09 19:28:21 +01:00
Sheraff
5897e0c804
refactor(router-utils): export only the compiler core's used surface
`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>
2026-11-09 19:28:09 +01:00
Sheraff
982666885c
refactor(router-utils): type the planner data that crosses the core boundary
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>
2026-11-09 19:27:59 +01:00
Sheraff
47df610742
test(start-plugin-core): a middleware only a server fn nested in split code reads stays with the hoisted server fn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 19:05:23 +01:00
Sheraff
0709cc5608
feat(router-utils, router-plugin): React default-import members and server-side builder chains are pure
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>
2026-11-09 18:51:26 +01:00
Sheraff
2966468587
test(router-plugin, start-plugin-core): React default-import members and server-side builder chains are pure
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>
2026-11-09 18:44:50 +01:00
Sheraff
91b3cfac8c
test(start-plugin-core): several names read of one module re-plan exactly their readers
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>
2026-11-09 18:34:11 +01:00
Sheraff
a9f7ba0d50
Merge branch 't3/pure-framework-call-table' (known-pure framework calls, R114) into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 18:17:04 +01:00
Sheraff
1f905b5370
Merge branch 't3/placement-invariant-checks' into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 18:10:39 +01:00
Sheraff
c4b88a31ce
Merge branch 't3/minor-review-fixes' into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 17:48:49 +01:00
Sheraff
3473f78bc4
test(start-plugin-core): the transport-failure control aborts a module new to the page
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>
2026-11-09 17:28:28 +01:00
Sheraff
20260b80f7
test(router-utils): type the toy recognizer of the client builder-chain tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 17:12:57 +01:00
Sheraff
cb59996eac
test(start-plugin-core): check the client build's warnings and Vite's chunk count for one builder instance
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>
2026-11-09 17:08:14 +01:00
Sheraff
eb002719ae
feat(router-utils): a client compile's Start builder chains are no effect for placement
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>
2026-11-09 17:08:08 +01:00
Sheraff
9c48b5d806
Merge branch 't3/generator-core-review1109-fixes' into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 17:01:44 +01:00
Sheraff
4a80108c96
test(start-plugin-core): Start's builder chains load with the split chunk on the client
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>
2026-11-09 17:01:42 +01:00
Sheraff
e5c73d2f26
Merge branch 't3/review1109-hosts-fixes' into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 17:00:17 +01:00
Sheraff
709bb9e03a
feat(router-utils): placement invariants warn in users' runs, throw in our tests
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>
2026-11-09 16:46:44 +01:00
Sheraff
e486ad9069
test(router-plugin): a memo component reading a context splits, the context stays one instance
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 16:40:52 +01:00
Sheraff
a100abe87b
feat(router-plugin): React memo/forwardRef/lazy, Solid lazy and Vue defineComponent/defineAsyncComponent are pure calls
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>
2026-11-09 16:34:22 +01:00
Sheraff
d335785d43
test(start-plugin-core): two pins pass only for their own bug
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>
2026-11-09 16:30:01 +01:00
Sheraff
f8a6da2b87
test(compiler-test-utils): an edit without its outcome fails as an assertion
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>
2026-11-09 16:30:01 +01:00
Sheraff
7c94795196
chore(changeset): code-splitter fixes of the review's minor findings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 16:28:42 +01:00
Sheraff
de9392f387
fix(router-utils): a parameter decorator makes its class an effect
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>
2026-11-09 16:28:15 +01:00
Sheraff
5312a31913
fix(router-utils): a switch value or case test observes identity
`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>
2026-11-09 16:28:15 +01:00
Sheraff
2361473819
test(router-utils): #__NO_SIDE_EFFECTS__ placements before a const declaration
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 16:28:15 +01:00
Sheraff
0d18a90a54
fix(router-utils): decide immediately invoked functions from the parents only
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>
2026-11-09 16:28:03 +01:00
Sheraff
8b3265acf7
docs(changeset): physical() mounts are watched from the first run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 16:27:19 +01:00
Sheraff
0fe2f4a7c2
Merge branch 't3/generator-core-review1109-fixes' into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 16:27:13 +01:00
Sheraff
e86583705b
test(router-plugin, start-plugin-core): framework calls pure at module level load with the split chunk
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>
2026-11-09 16:27:04 +01:00
Sheraff
dfb15790c3
test(start-plugin-core): move the loader-error route HMR tests to their own file
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>
2026-11-09 16:26:05 +01:00
Sheraff
3aecde8cde
fix(router-utils): accept #__NO_SIDE_EFFECTS__ before a const declaration
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>
2026-11-09 16:22:05 +01:00
Sheraff
895a343f6d
test(router-plugin): regression tests for IIFE classification, NO_SIDE_EFFECTS placement, case-label identity, parameter decorators
- 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>
2026-11-09 16:20:07 +01:00
Sheraff
3087c5ae8d
Merge branch 'research-1109/d-pathe' into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 16:04:53 +01:00
Sheraff
63c1eb97c6
fix(start-plugin-core): fail a Vite build on a wait for a virtual module that never ends
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>
2026-11-09 16:04:13 +01:00
Sheraff
d1c41edcf3
fix(router-plugin, start-plugin-core): count map lines at LF only on the webpack family
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>
2026-11-09 15:59:43 +01:00
Sheraff
cb8c128c20
fix(start-plugin-core): key Rsbuild's once-per-change dedupe by normalised path
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>
2026-11-09 15:59:17 +01:00
Sheraff
4e6fd19b1a
fix(start-plugin-core): register Rsbuild's Vue script-block rule in every configuration
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>
2026-11-09 15:59:01 +01:00
Sheraff
1deb1c24b8
fix(start-plugin-core): fail a Vite build whose server environment builds before the client
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>
2026-11-09 15:59:01 +01:00
Sheraff
99d609d719
fix(router-core): only render errors make route HMR reload the page
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>
2026-11-09 15:57:52 +01:00
Sheraff
7049b768a3
test(start-plugin-core): route edits after a loader failed update in place
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:54:03 +01:00
Sheraff
2cf501e8c6 fix(start-plugin-core): a server fn's filename is pathe's relative path, as on main
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>
2026-11-09 15:52:09 +01:00
Sheraff
03e064eeaf
test(start-plugin-core, router-plugin): failing regressions of the review's host findings
- 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>
2026-11-09 15:43:42 +01:00
Sheraff
d22db9d3c3
fix(compiler-test-utils): a pin passes only on a failed assertion
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>
2026-11-09 15:39:42 +01:00
Sheraff
231c4ffdf0
test(compiler-test-utils): a pin fails when it fails without an assertion
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:39:42 +01:00
Sheraff
086fe3dad6
fix(router-generator): watch physical() mounts after the first run
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>
2026-11-09 15:37:09 +01:00
Sheraff
587206bae4
test(router-plugin): physical() mounts are watched when dev starts with an up-to-date tree
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:35:37 +01:00
Sheraff
8413531ac3
fix(router-utils): read a file saved in place again when it reads empty
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>
2026-11-09 15:35:21 +01:00
Sheraff
a9b8893051
Merge branch 't3/review-docs-brief-1109' into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:30:51 +01:00
Sheraff
0230f74653
test(start-plugin-core): a factory saved in place stays a factory in dev
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>
2026-11-09 15:30:36 +01:00
Sheraff
f6872fdcbb
docs(changeset): behaviour changes and stale claims from the review
- 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>
2026-11-09 15:30:28 +01:00
Sheraff
2433a9fa31
Merge branch 't3/fix-windows-x64-ci-failure' into t3/yuku-compiler-rewrite
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:29:11 +01:00
Sheraff
1738743791
test(start-plugin-core): a page run whose page saw a request fail in transport runs again on a new page
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>
2026-11-09 15:24:29 +01:00
Sheraff
9e73cb4b04
Merge branch 't3/remove-gitignore-warning-tanstack-ignore' into t3/yuku-compiler-rewrite 2026-11-09 15:02:35 +01:00
Sheraff
fcddd16f20
chore(examples): ignore .tanstack/ in every Start example
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>
2026-11-09 15:00:55 +01:00
Sheraff
69ae82c47d
revert(router-generator): drop the warning when git does not ignore the temporary directory
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>
2026-11-09 14:59:09 +01:00
Sheraff
665be96ccf
Merge commit '66bd8f1f34' into t3/yuku-compiler-rewrite 2026-11-09 14:58:11 +01:00
Sheraff
cd9379d707
Merge branch 't3/server-fn-burst-duplicate-routes' into t3/yuku-compiler-rewrite 2026-11-09 14:44:00 +01:00
Sheraff
24236d0729
Merge branch 't3/route-generator-burst-fixes' into t3/yuku-compiler-rewrite 2026-11-09 14:44:00 +01:00
Sheraff
bb081071e4
docs(compiler-test-utils): link the reload-in-flight pin to vitejs/vite#24046
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 14:41:16 +01:00
Sheraff
24cd7b7542
test(router-generator): the sampler stops on an abort signal (lint)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 14:35:29 +01:00
Sheraff
76651e16a7
test(start-plugin-core): pin requests that overlap a Vite SSR reload
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>
2026-11-09 14:30:45 +01:00
Sheraff
8f77d4ff7d
docs(router): ignore the generator's temporary directory in git; changeset
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:53:24 +01:00
Sheraff
5746d0ecb1
feat(router-generator): warn once when git does not ignore the temporary directory
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>
2026-11-09 13:52:32 +01:00
Sheraff
46685f7eaa
test(router-generator): a watch session warns once when git does not ignore the temporary directory
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:52:02 +01:00
Sheraff
b798dc3d2f
fix(router-generator): create the temporary directory again when it was deleted under a session
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:47:44 +01:00
Sheraff
ab62812cee
fix(router-generator): scan the routes again when the route tree on disk is not the one published
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>
2026-11-09 13:47:44 +01:00
Sheraff
a005a2f20d
test(router-generator): a route tree rewritten with a route delete, and a deleted temporary directory, under a watch session
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:47:44 +01:00
Sheraff
4d4d04205a
Merge commit 'a262fb9bde' into t3/yuku-compiler-rewrite 2026-11-09 13:28:40 +01:00
Sheraff
66bd8f1f34
fix(start-plugin-core): a namespace import's readability check records only an unreadable module
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>
2026-11-09 11:45:30 +01:00
Sheraff
a262fb9bde
test: a plan hit checks the route registry and re-reads facts the cache dropped
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>
2026-11-09 11:45:30 +01:00
Sheraff
49d97156a2
test(start-plugin-core): a namespace read by member depends only on the members it reads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 11:45:30 +01:00
Sheraff
8fd8404796
test(router-utils): pin the JSX scan's two bindings, an aliased factory's erased imports and a superseded marker scan
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>
2026-11-09 11:45:30 +01:00
Sheraff
a342280b65
perf(router-utils): a plan depends on the exports it reads, not the whole summary
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>
2026-11-09 11:45:30 +01:00
Sheraff
e70f373fb1
docs(router-utils): effect comments name ModuleAnalysis.effects()
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 11:45:30 +01:00
Sheraff
a46f429fdb
fix(start-plugin-core): Vite dev re-invalidates unchanged dependents after all of them compiled
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>
2026-11-09 11:45:30 +01:00
Sheraff
63d5e74e48
test(start-plugin-core): Vite dev compiles an unchanged dependent once per environment
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>
2026-11-09 11:45:30 +01:00
Sheraff
6829145359
docs(router-utils): raw facts validated at the current facts version stand
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 11:09:33 +01:00
Sheraff
0255334a1b
perf(router-generator): keep a digest of each route file instead of its text
`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>
2026-11-09 11:07:18 +01:00
Sheraff
fba13d1447
perf(router-generator): writePending returns early when no file has upkeep pending
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>
2026-11-09 11:07:01 +01:00
Sheraff
035059692a
fix(start-plugin-core): Vite dev recognises pre-bundled dependencies in a custom cacheDir
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>
2026-11-09 11:06:53 +01:00
Sheraff
c4e515a75d
test(start-plugin-core): dev compiles no pre-bundled dependency in a custom cacheDir
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>
2026-11-09 11:06:44 +01:00
Sheraff
593c3f883a
fix(start-plugin-core): Vite dev SSR no longer keeps a failed load after a multi-file restore
`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>
2026-11-09 11:06:07 +01:00
Sheraff
f7dc9010de
test(start-plugin-core): SSR loads a restored file restored together with another new file
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>
2026-11-09 11:05:07 +01:00
Sheraff
c465ff83e4
perf(start-plugin-core): Vite dev transforms a change's dependents 128 at a time
`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>
2026-11-09 11:04:00 +01:00
Sheraff
8c13593288
perf(start-plugin-core): Rsbuild rebuild replay reads each module's build info once
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>
2026-11-09 11:03:53 +01:00
Sheraff
f1e6522fbf
perf(router-utils): reuse an emitted map's fill while its chunk's hash is unchanged
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>
2026-11-09 11:03:53 +01:00
Sheraff
eda321d4bd
perf(router-utils): a plan hit skips re-validating raw facts nothing marked stale
`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>
2026-11-09 11:03:43 +01:00
Sheraff
f4bc6abe3f
perf(router-utils): freeze drops a dead map and shares edge provenance; item comment scan is linear
- `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>
2026-11-09 11:03:11 +01:00
Sheraff
0a1a333822
refactor(router-utils): drop the raw facts' unread revision hashes
`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>
2026-11-09 11:03:02 +01:00
Sheraff
b0e751d940
refactor(router-utils): side-effect classification only where raw facts are built
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>
2026-11-09 11:02:55 +01:00
Sheraff
cef82ead6f
perf(router-utils): the implicit JSX read scan skips .ts files and stops at the first element
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>
2026-11-09 11:02:55 +01:00
Sheraff
c62cb886c0
perf(start-plugin-core): don't follow a namespace import of an unreadable module
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>
2026-11-09 11:02:39 +01:00
Sheraff
8c1bbc2472
perf(start-plugin-core): a module that only uses finished Start values skips the start-env pass
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>
2026-11-09 11:02:39 +01:00
Sheraff
53b52cbf20
docs(start): a second .handler() on a finished server fn isn't followed either
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 08:31:37 +01:00
Sheraff
584ba0d6ab
Merge branch 't3/resolver-throw-unresolved-imports' into t3/yuku-compiler-rewrite 2026-11-09 00:03:38 +01:00
Sheraff
5bd66855c3
ci: start-plugin-core integration in 5 shards, router-plugin in 4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 23:49:36 +01:00
Sheraff
9b78e2e9ab
test(start-plugin-core): claim 7 leaves a throwing resolver's import to the bundler
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>
2026-11-08 23:31:42 +01:00
Sheraff
9336c72546
fix(start-plugin-core): a resolver that throws couldn't resolve the import
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>
2026-11-08 23:23:30 +01:00
Sheraff
169f050b89
Merge branch 't3/fix-route-edits-dev-flake' into t3/yuku-compiler-rewrite 2026-11-08 23:23:06 +01:00
Sheraff
f583ae4240
test(start-plugin-core): imports of a package the client resolver rejects
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>
2026-11-08 23:21:21 +01:00
Sheraff
684e19db7d
Merge branch 't3/ci-integration-shards' into t3/yuku-compiler-rewrite 2026-11-08 23:06:49 +01:00
Sheraff
16fe442f05
test(start-plugin-core): route edits after a rename settle each page before the next edit
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>
2026-11-08 22:46:31 +01:00
Sheraff
6fc245ca96
Merge branch 't3/fix-partial-prune-server-leak' into t3/yuku-compiler-rewrite 2026-11-08 22:42:04 +01:00
Sheraff
b851f784e8
test: split the two slowest slow-tier files along their describe blocks
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>
2026-11-08 22:03:01 +01:00
Sheraff
a66dbc1408
test(compiler-test-utils): each test file gets its own run pages and context
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>
2026-11-08 22:03:01 +01:00
Sheraff
19acddd4e7
fix(router-utils): an import is an output's edge where its specifier renders
`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>
2026-11-08 21:36:50 +01:00
Sheraff
d76fd69c38
test: more shapes of a partly kept import (coverage review)
- 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>
2026-11-08 21:36:50 +01:00
Sheraff
3c987f8470
test: a denied import the client keeps only part of is judged like one it keeps whole
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>
2026-11-08 21:06:49 +01:00
Sheraff
d0fb652f9f
Merge commit '99fd95c6f4' into t3/ci-integration-shards 2026-11-08 21:05:07 +01:00
Sheraff
99fd95c6f4
docs(start): with an exempt importer, a pattern import of a denied file is not guaranteed the mock
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 20:56:09 +01:00
Sheraff
197f51d0b7
Merge import-protection review fixes I2/I3 (I1 dropped, R102.1) 2026-11-08 20:55:39 +01:00
Sheraff
143e87f4b6
Merge branch 't3/effectful-top-level-writes-placement' into t3/yuku-compiler-rewrite 2026-11-08 20:53:04 +01:00
Sheraff
599789d2a1
Merge branch 't3/fix-solid-start-plugin-order' into t3/yuku-compiler-rewrite 2026-11-08 20:44:43 +01:00
Sheraff
1a8892f355
fix(router-utils): kept-declaration warnings suggest an annotation only where it works
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>
2026-11-08 20:44:02 +01:00
Sheraff
ab117c9ba5
test(router-utils): offer /* @__PURE__ */ only where it frees the initialiser
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>
2026-11-08 20:44:02 +01:00
Sheraff
f1e063b997
test: an effect setting split-only state runs at the same time in its declaration or after it
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>
2026-11-08 20:31:42 +01:00
Sheraff
694fd2a966
Merge branch 't3/fix-server-fn-barrel-build-break' into t3/yuku-compiler-rewrite 2026-11-08 20:27:37 +01:00
Sheraff
6ca411520d
refactor(start-plugin-core): exportName follows main's manifest fields; format.ts owns the file tag
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>
2026-11-08 20:27:02 +01:00
Sheraff
5359abf711
fix(start-plugin-core): refuse Start listed after vite-plugin-solid
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>
2026-11-08 20:11:06 +01:00
Sheraff
32070523ea
Merge branch 't3/core-review-1108-fixes' into t3/yuku-compiler-rewrite
# Conflicts:
#	packages/router-utils/src/compiler/host.ts
#	packages/router-utils/tests/pipeline.test.ts
2026-11-08 20:06:41 +01:00
Sheraff
fd551fda3a
fix(start-plugin-core): the report claims another plugin added an import only for a checked direct importer with no pattern-like call
"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>
2026-11-08 19:56:33 +01:00
Sheraff
9670db4008
test(start-plugin-core): what brought a denied file is named accurately: an unchecked importer, a hidden pattern import, a module in between; the suggested fix applied builds
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 19:56:33 +01:00
Sheraff
fc884bca36
fix(start-plugin-core): an in-place provider's glue exports are unique per file
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>
2026-11-08 19:48:23 +01:00
Sheraff
fe0544f320
test(start-plugin-core): barrel API modules whose handlers read module state of the same name
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>
2026-11-08 19:48:15 +01:00
Sheraff
8dbc2152cd
docs(start): a refused server-only call answers HTTP 500 "Server function info not found"
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>
2026-11-08 19:48:15 +01:00
Sheraff
5e935242a1
fix(start-plugin-core): the provider wrapper's export name is unique per file
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>
2026-11-08 19:48:15 +01:00
Sheraff
c3344a2b63
test(start-plugin-core): server fns behind export * barrels build and answer their calls
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>
2026-11-08 19:48:15 +01:00
Sheraff
f810b29b2e
Merge commit '666a787264' into t3/yuku-compiler-rewrite 2026-11-08 19:37:59 +01:00
Sheraff
60ad2645d2
fix(start-plugin-core): the Vite plugin order no longer matters for Start
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>
2026-11-08 19:36:50 +01:00
Sheraff
46c536c072
fix(start-plugin-core): the Vite late pass reports only text the bundler parses
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>
2026-11-08 19:30:28 +01:00
Sheraff
44da2326a7
test(start-plugin-core): the late pass leaves text a later plugin compiles to the bundler
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>
2026-11-08 19:28:53 +01:00
Sheraff
e511ceb77c
fix(router-utils): the verifier skips type-only imports
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>
2026-11-08 19:26:03 +01:00
Sheraff
ef869df06f
test(router-utils): the verifier passes a type-only import of the module itself
Check (b) reads it as glue naming an export the env module lacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 19:25:29 +01:00
Sheraff
2118ddea5c
test(start-plugin-core): two handlers writing one binding share one instance of it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 19:24:56 +01:00
Sheraff
b34b6f9099
fix(router-utils): a package.json that appears asks again every resolution under its directory
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>
2026-11-08 19:24:09 +01:00
Sheraff
f7b7188f4a
test(router-utils): a package.json that appears makes a plan reading its imports stale
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>
2026-11-08 19:23:21 +01:00
Sheraff
cd288cca47
docs(router-utils): the compiler index comment says what it exports
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 19:20:33 +01:00
Sheraff
a1c30f2aea
refactor(router-plugin): one list of the route options code splitting can split
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>
2026-11-08 19:20:33 +01:00
Sheraff
3df02cf109
test(router-utils): an add asks again only the resolutions it may take
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 19:20:33 +01:00
Sheraff
950835bbeb
fix(router-utils): a created file asks again only the resolutions it may take
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>
2026-11-08 19:20:33 +01:00
Sheraff
bbaa85e7d6
ci: run the router-plugin and start-plugin-core slow tiers as Nx shards
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>
2026-11-08 19:18:32 +01:00
Sheraff
b0d69d95d1
fix(start-plugin-core): an import another plugin added is reported as such, not as a pattern import
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>
2026-11-08 19:18:08 +01:00
Sheraff
2313aa347e
test(start-plugin-core): an import another plugin added is not reported as a pattern import
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 19:18:08 +01:00
Sheraff
c6f6a759cf
fix(start-plugin-core): the Vite late pass reports output it cannot parse
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>
2026-11-08 19:16:08 +01:00
Sheraff
7610e727ff
test(start-plugin-core): a late-pass module the compiler cannot parse fails the client build when it names Start
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>
2026-11-08 19:16:08 +01:00
Sheraff
8d85e1aa5c
fix(router-utils): writers landing in one output are one writer
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>
2026-11-08 19:16:08 +01:00
Sheraff
eabb056a3a
test(router-plugin): options of one split group writing one binding split together
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>
2026-11-08 19:16:08 +01:00
Sheraff
d90c6e3417
fix(router-utils): the verifier matches glue imports with the identity parser
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>
2026-11-08 19:16:08 +01:00
Sheraff
3b0d88e597
test(router-utils): the verifier catches broken glue at an ordinary path
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>
2026-11-08 19:16:08 +01:00
Sheraff
666a787264
test(start-plugin-core): Rsbuild dev edits in an app that watches its source directory
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>
2026-11-08 19:07:30 +01:00
Sheraff
04d4dc7cfb
test(router-utils): an add asks again only the resolutions it may take
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 19:07:30 +01:00
Sheraff
07bc9324c7
fix(start-plugin-core): Rsbuild dev takes no watched directory for a created file
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>
2026-11-08 19:07:30 +01:00
Sheraff
66b30180bd
fix(router-utils): a created file asks again only the resolutions it may take
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>
2026-11-08 19:07:30 +01:00
Sheraff
cb434d5c60
chore(changeset): generator plugin internals are not public API (R55)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 19:03:46 +01:00
Sheraff
14468e101c
Merge branch 't3/packaging-review-fixes' into t3/yuku-compiler-rewrite 2026-11-08 19:03:45 +01:00
Sheraff
72a671eeca
fix(router-utils): a specifier substitution no slice can hold fails the compile
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>
2026-11-08 19:03:07 +01:00
Sheraff
21d3579a5c
test(router-utils): a substitution whose specifier no slice holds whole fails the compile
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 19:02:10 +01:00
Sheraff
699d6ed296
fix(router-generator): warnings about route files go through the generator's logging
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>
2026-11-08 18:58:26 +01:00
Sheraff
fa754d893a
test(router-generator): disableLogging silences warnings about route files
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 18:55:54 +01:00
Sheraff
bbfc8936dd
docs(start): state the actual Vite, Rsbuild and Rspack floors
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 18:54:13 +01:00
Sheraff
12fd439940
docs(changeset): @babel/core no longer comes with the router plugin or Start
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 18:53:50 +01:00
Sheraff
a81935d65e
chore: drop the yuku release-age exemption
yuku 0.27.0 is older than the one-day window now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 18:53:50 +01:00
Sheraff
b417cb2514
test(react-start-rsc): the helper refusal waits for its outcome within one bound
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>
2026-11-08 17:20:46 +01:00
Sheraff
1145fd93bf
docs(compiler-test-utils): the Vue script setup recipe no longer names a module-scope script block
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 16:22:39 +01:00
Sheraff
294b3f36e1
fix(start-plugin-core): the parse message names the file relative to the root
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 15:49:33 +01:00
Sheraff
a3b22b1801
Merge branch 't3/import-protection-message-fixes' into t3/yuku-compiler-rewrite 2026-11-08 15:48:31 +01:00
Sheraff
d42ab79098
Merge branch 't3/start-compiler-message-fixes' into t3/yuku-compiler-rewrite
# Conflicts:
#	packages/start-plugin-core/src/vite/compiler-plugin.ts
2026-11-08 15:48:31 +01:00
Sheraff
c579aba588
Merge branch 't3/router-message-fixes' into t3/yuku-compiler-rewrite 2026-11-08 15:47:29 +01:00
Sheraff
57751bc294
fix(start-plugin-core): server fn ids compare the root's drive letter case-insensitively
`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>
2026-11-08 15:35:56 +01:00
Sheraff
324f009b1d
test(start-plugin-core): Windows server fn ids with the root's drive letter in the other case
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>
2026-11-08 15:35:56 +01:00
Sheraff
9ca4399628
test(start-plugin-core): the witness tests' app is a named package, as an app's
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>
2026-11-08 15:31:47 +01:00
Sheraff
41ebb1151f
test(e2e): the Rsbuild overlay's error line from its File: line when the message has none
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>
2026-11-08 14:15:30 +01:00
Sheraff
b674c15676
fix(start-plugin-core): Rsbuild RSC dev rebuilds the manifest once the client build is in
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>
2026-11-08 13:51:10 +01:00
Sheraff
6b930192e0
fix(start-plugin-core): Rsbuild dev writes the manifest into the server's module
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>
2026-11-08 13:41:51 +01:00
Sheraff
bfe04cca07
fix(react-router): Rsbuild RSC dev builds the lazy route component's hot slot
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>
2026-11-08 13:36:55 +01:00
Sheraff
1368ed4d36
test(e2e): import-protection log parsers read mock-mode reports too
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>
2026-11-08 12:47:03 +01:00
Sheraff
46bfce2c87
test(router-plugin): the mode-less control, and Vite's interop names in the hot-binding check
- 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>
2026-11-08 12:21:00 +01:00
Sheraff
679654c838
test(start-plugin-core): main's dev restart case on Rsbuild's restart
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>
2026-11-08 12:17:31 +01:00
Sheraff
468a26ac5e
fix(router-plugin): a webpack or Rspack configuration without mode builds for production
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>
2026-11-08 12:13:46 +01:00
Sheraff
ba57cee365
fix(start-plugin-core): Vite crawls Start libraries from the resolved, physical root
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>
2026-11-08 12:13:30 +01:00
Sheraff
af7628ba86
fix(start-plugin-core): Rsbuild resolves a relative root before building Start's paths
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>
2026-11-08 12:13:18 +01:00
Sheraff
122fd92e0d
fix(start-plugin-core): Rsbuild dev leaves compression off unless the app turns it on
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>
2026-11-08 12:13:09 +01:00
Sheraff
766769b4fc
Merge origin/main into compiler-rewrite/yuku
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>
2026-11-08 12:12:53 +01:00
Sheraff
fd8cb6d723
test: reproduce bugs fixed on main in #8817's code
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>
2026-11-08 12:02:01 +01:00
Sheraff
3a5d1d4082
chore(changeset): positions on the Vite dev server
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:52:26 +01:00
Sheraff
3198ec4a84
docs: where the Vite dev server prints a message's position
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:52:19 +01:00
Sheraff
90bd38ae1e
test(router-utils): the analysis policy test's toy policy is not async
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:36:43 +01:00
Sheraff
209c37eb74
test(compiler-test-utils): a compilation error's webpack loc and module are what the bundler prints
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>
2026-11-08 11:23:58 +01:00
Sheraff
db8283c172
fix(start-plugin-core): late positions without a map, bundled dev, and message names from the coverage review
- 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>
2026-11-08 11:12:48 +01:00
Sheraff
1786f24751
test(start-plugin-core): coverage review rows for positions, Solid use* calls and the Vue fact
- .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>
2026-11-08 11:12:13 +01:00
Sheraff
ce3a327940
test(start-plugin-core): adjust two tests to the R101 mock and warning texts
- 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>
2026-11-08 11:03:50 +01:00
Sheraff
8b73c9e155
fix(start-plugin-core): the mock runtime's production text is chosen when it is generated
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>
2026-11-08 11:03:50 +01:00
Sheraff
63ee3882ee
fix(router-plugin): bundled dev carries the position in the message, as a build does
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>
2026-11-08 11:01:36 +01:00
Sheraff
21f2202893
fix(router-utils): entry-chunk export causes from the coverage review
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>
2026-11-08 10:59:40 +01:00
Sheraff
63cee48c0c
test(compiler-test-utils): the root-relative tail names a file in diagnostics only
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>
2026-11-08 10:59:40 +01:00
Sheraff
bad2b02d79
fix(router-generator): a generation error prints as its message alone
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>
2026-11-08 10:59:40 +01:00
Sheraff
f5e0d58191
fix(router-utils): only Rsbuild hosts name a derived module's file on its located diagnostics
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>
2026-11-08 10:59:40 +01:00
Sheraff
12558b1d76
fix(router-utils): Vite dev keeps loc, so Vite maps it through earlier plugins and links it
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>
2026-11-08 10:59:40 +01:00
Sheraff
465d3c8193
fix(router-utils): kept reports from the coverage review: own reasons, real uses, causes by their own effects
- 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>
2026-11-08 10:59:40 +01:00
Sheraff
19a2978101
test(compiler-test-utils): an absolute file is named by its root-relative path too
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>
2026-11-08 10:41:52 +01:00
Sheraff
c22a959b62
chore(changeset): router and generator messages (R101)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:34:41 +01:00
Sheraff
2faa6b3270
docs: messages and fixes of the route compiler and generator (R101)
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>
2026-11-08 10:34:24 +01:00
Sheraff
676e90b1e0
fix(router-plugin): a writer fallback's example names the binding it writes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:33:31 +01:00
Sheraff
5f47eed557
fix(router-utils): the entry-chunk export warning names the real cost and a fix that works
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>
2026-11-08 10:29:44 +01:00
Sheraff
23405296a0
test(router-plugin): eager-export warnings only where something is to fix
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>
2026-11-08 10:29:43 +01:00
Sheraff
9fb40b4f90
fix(router-utils): the core's own messages take the host's prefix and say what to do
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>
2026-11-08 10:29:43 +01:00
Sheraff
054711be2f
fix(start-plugin-core): a rendered use inside <ClientOnly> is skipped by its element, not by the output's slices
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>
2026-11-08 10:25:23 +01:00
Sheraff
4a07760f18
fix(start-plugin-core): type and lint fixes; the inputValidator unit test no longer pins PR numbers
The message dropped the PR numbers (R101 review): the test pinned that
incidental wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:23:13 +01:00
Sheraff
bb562b142d
fix(start-plugin-core): import-protection report fixes from the coverage review
- 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>
2026-11-08 10:22:21 +01:00
Sheraff
ca48212c85
test(start-plugin-core): coverage of the import-protection report fixes
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>
2026-11-08 10:22:21 +01:00
Sheraff
00da8f5ae3
fix(router-plugin): not-split and route warnings name the binding and give a fix that works
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>
2026-11-08 10:20:21 +01:00
Sheraff
a355a313d0
docs(changeset): Start compiler messages and Solid Hydrate use* calls
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:20:19 +01:00
Sheraff
16cb193d89
fix(start-plugin-core): a builder assigned after its declaration is told to use const; the rsc-css warning drops the path
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:19:43 +01:00
Sheraff
67eac16c06
fix(router-plugin): split-groupings and plugin-option errors name the problem, at its position, without a stack
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>
2026-11-08 10:17:52 +01:00
Sheraff
d424fb56ef
test(router-plugin): invalid split groupings fail at the value; invalid plugin options with one error
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:17:52 +01:00
Sheraff
345f5f4cb7
fix(react-start-rsc): the client stubs of the RSC helpers point at server functions
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>
2026-11-08 10:14:58 +01:00
Sheraff
d2241c2b37
fix(start-plugin-core): Start compiler messages name the shape and give a fix that works
- 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>
2026-11-08 10:14:58 +01:00
Sheraff
c17ca59971
test(start-plugin-core): a JavaScript <script setup> refusal at the SFC's import, on both dev servers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:14:58 +01:00
Sheraff
b6efcc5fad
fix(router-generator): generator messages take the router prefix and root-relative files, without a stack
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>
2026-11-08 10:14:10 +01:00
Sheraff
742884ea1b
test(start-plugin-core): Start refusals at their positions, and the fixes their messages give build
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>
2026-11-08 10:12:35 +01:00
Sheraff
0cecb3d403
fix(router-generator): a failed route tree generation fails the build (R101)
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>
2026-11-08 10:10:51 +01:00
Sheraff
80184c3af4
docs(start): import protection guide samples are the printed reports
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>
2026-11-08 10:10:25 +01:00
Sheraff
e82f33b213
test(router-generator): a build fails on any route tree generation error (R101)
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>
2026-11-08 10:10:04 +01:00
Sheraff
65dc9e3f31
fix(start-plugin-core): an Rsbuild dev import-protection failure is located like a compile error
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>
2026-11-08 10:09:09 +01:00
Sheraff
f97bfafe34
fix(start-plugin-core): import protection reports say where, why and a fix that works (R101)
- 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>
2026-11-08 10:09:09 +01:00
Sheraff
4907ed2c00
fix(start-plugin-core): a Vite build reports every import-protection violation
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>
2026-11-08 10:08:56 +01:00
Sheraff
eec0add541
feat(router-utils): an edge policy reads its compile's analysis
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>
2026-11-08 10:08:56 +01:00
Sheraff
5bc6cebf88
test(start-plugin-core): import protection reports where a violation is, and the fixes they suggest work
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>
2026-11-08 10:08:56 +01:00
Sheraff
052f7a6973
fix(router-utils): a split chunk's located diagnostic names the user's file on Rsbuild
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>
2026-11-08 10:08:06 +01:00
Sheraff
e66e627ea4
test(router-utils): a split chunk's located diagnostic names the user's file
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:07:56 +01:00
Sheraff
ea84982361
test(router-plugin): kept reports on real builds; the harness prints a webpack stats item's loc
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>
2026-11-08 10:07:32 +01:00
Sheraff
4924a71aa4
fix(router-utils): eager-export warnings only where the route module does not need the export; report declared shared writers and state readers
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>
2026-11-08 10:05:32 +01:00
Sheraff
35e48531e8
fix(router-utils): one path style and one 1-based position per message on every host
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>
2026-11-08 10:04:41 +01:00
Sheraff
752a02ab4e
test(router-utils): one root-relative path and one 1-based position per message
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>
2026-11-08 10:04:41 +01:00
Sheraff
151487e6ba
fix(start-plugin-core): Hydrate splits use* calls in Solid children
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>
2026-11-08 09:49:36 +01:00
Sheraff
d29ed9cb06
test(start-plugin-core): the Rsbuild Solid app of the use* test hydrates with hydrateStart
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 09:49:36 +01:00
Sheraff
793bc91435
test(start-plugin-core): use* calls in Solid Hydrate children split and keep owner, context and match
The test host's preview() serves Solid apps too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 09:43:23 +01:00
Sheraff
724253639f
test(router-utils): exported declarations the route module needs, declared shared writers, state readers it keeps
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>
2026-11-08 09:40:01 +01:00
Sheraff
f90a6e5707
Merge branch 't3/fix-export-chunk-route-attribution' into t3/yuku-compiler-rewrite 2026-11-08 00:59:55 +01:00
Sheraff
0559639909
test(start-plugin-core): more route asset placements from the coverage review
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>
2026-11-07 23:29:33 +01:00
Sheraff
2cefcf73e4
fix(start-plugin-core): a route's manifest chunks are those of its split groups
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>
2026-11-07 23:19:36 +01:00
Sheraff
29609c599e
test(start-plugin-core): each route's SSR page links only its own assets
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>
2026-11-07 23:16:33 +01:00
Sheraff
a5e5d1bec3
Merge branch 't3/server-fn-main-format-compat' into t3/yuku-compiler-rewrite 2026-11-07 23:06:08 +01:00
Sheraff
3f1e9b0178
Merge branch 't3/shared-split-hmr-browser-test' into t3/yuku-compiler-rewrite 2026-11-07 23:00:58 +01:00
Sheraff
d8af0a91ca
test(router-plugin): route HMR of a binding two split options share
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>
2026-11-07 23:00:25 +01:00
Sheraff
3bc54a78d5
Merge branch 't3/split-id-main-format-compat' into t3/yuku-compiler-rewrite 2026-11-07 22:46:26 +01:00
Sheraff
cce09910ec
test: the integration smoke set runs its project-path and unparsed tests
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>
2026-11-07 22:45:24 +01:00
Sheraff
bb5ce0279e
docs(start): collision rank, numbered names and percent-encodings; ServerFnMeta.name
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 21:53:24 +01:00
Sheraff
9cd22c2ee4
test(start-plugin-core): golden app gains a variable exported as default; record script checks what it found
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 21:51:04 +01:00
Sheraff
90a22c1276
fix(start-plugin-core): refuse custom ids whose percent-encoding the server misreads
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>
2026-11-07 21:46:33 +01:00
Sheraff
ccfd2827bf
test(start-plugin-core): a percent-encoding the server reads as another id fails the build
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>
2026-11-07 21:43:34 +01:00
Sheraff
764eec3fa0
fix(start-plugin-core): Rsbuild RSC client-origin gate lists final custom ids
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>
2026-11-07 21:41:30 +01:00
Sheraff
10960b2bcc
test(react-start-rsc): custom server-fn ids the browser calls reach their handlers under RSC
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>
2026-11-07 21:41:30 +01:00
Sheraff
23a9f62694
docs(router-utils): the ! form of own-file specifiers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 20:31:52 +01:00
Sheraff
1834c1f17a
test: build the ! project-path app with a context-relative entry
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>
2026-11-07 20:31:23 +01:00
Sheraff
53ef32f98e
fix(router-utils): import an output of a file under a path with ! by its basename
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>
2026-11-07 20:29:28 +01:00
Sheraff
5cd3939402
test: own-file imports under # and ! project paths, no checkout path in client output
- 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>
2026-11-07 20:29:28 +01:00
Sheraff
271ce8c744
docs(start): a builder method the types forbid, such as a second .server(), isn't followed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 19:52:03 +01:00
Sheraff
69e37f0ec2
Merge branch 't3/accurate-hints' into t3/yuku-compiler-rewrite 2026-11-07 19:51:53 +01:00
Sheraff
74bbd54618
fix(router-utils): keep main's split-module ids and import specifiers
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>
2026-11-07 18:49:15 +01:00
Sheraff
2a7e42f6f0
docs(start): server-fn ids and metadata keep main's formats; id characters split into error and deprecation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 18:47:04 +01:00
Sheraff
47ee528891
test(start-plugin-core): planner outputs print main's id and literal format
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 18:47:04 +01:00
Sheraff
f4da7082e6
fix(start-plugin-core): print main's server-fn ids and metadata
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>
2026-11-07 18:47:04 +01:00
Sheraff
c83c1a69ed
fix(start-plugin-core): a middleware returned from createClientOnlyFn is only told to be listed directly
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>
2026-11-07 18:46:58 +01:00
Sheraff
f30e8ddda3
fix(start-plugin-core): a flow escape's fix is the one for what escapes
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>
2026-11-07 18:43:38 +01:00
Sheraff
1df8b24259
test: split-module ids and specifiers keep main's format (failing)
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>
2026-11-07 18:41:25 +01:00
Sheraff
60938f75a2
test(start-plugin-core): main's custom-id acceptance, default id and functionName
- 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>
2026-11-07 18:41:23 +01:00
Sheraff
071af7fd52
fix(start-plugin-core): a client-only isomorphic fn's escape suggests .server(() => undefined)
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>
2026-11-07 18:40:11 +01:00
Sheraff
f2656a2064
fix(start-plugin-core): an open middleware's escape names its missing .server() and fixes that compile
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>
2026-11-07 18:38:21 +01:00
Sheraff
6e1043fb0a
test(start-plugin-core): golden test of main's server-fn ids and metadata on both bundlers
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>
2026-11-07 18:35:35 +01:00
Sheraff
f0c0531f3d
fix(start-plugin-core): import protection says createClientOnlyFn throws on the server
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>
2026-11-07 18:33:21 +01:00
Sheraff
eb1a7841bb
test(compiler-test-utils): removing the run directory at the teardown is best effort
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>
2026-11-04 06:39:57 +01:00
Sheraff
0793eedd29
Merge 17e475671e into compiler-rewrite/yuku
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 06:21:35 +01:00
Sheraff
0734113c27
Merge 9fc07dc514 into compiler-rewrite/yuku
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 06:21:35 +01:00
Sheraff
9fc07dc514
fix(start-plugin-core): say that .inputValidator() was renamed to .validator() and removed
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>
2026-11-04 06:04:31 +01:00
Sheraff
d6a1638684
chore(examples): start-workos on @workos/authkit-tanstack-react-start 0.12.0
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>
2026-11-04 05:59:21 +01:00
Sheraff
17e475671e
test(compiler-test-utils): Node's compile cache in the test run's directory
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>
2026-11-04 05:40:55 +01:00
Sheraff
299067584b
fix(router-plugin): locate the router's compile diagnostics on Rspack and webpack
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>
2026-11-04 05:36:11 +01:00
Sheraff
e27395a033
Merge branch 't3/hydrate-barrel-kit-effect-fixes' into compiler-rewrite/yuku
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 05:27:01 +01:00
Sheraff
fbf9a67e59
fix(start-plugin-core): no import-protection report for a dead re-export of Start builder chains
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>
2026-11-04 04:02:22 +01:00
Sheraff
242fa25149
test(router-utils): the stats registry's count can drop when an earlier session is collected
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 03:25:41 +01:00
Sheraff
a6be38b48d
Merge branch 't3/host-items-1104' into compiler-rewrite/yuku
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 03:05:25 +01:00
Sheraff
deb31957e1
fix(start-plugin-core): print Rsbuild dev warnings of unprinted compilations
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>
2026-11-04 03:04:01 +01:00
Sheraff
902839b0ae
fix(start-plugin-core): detect vue-loader in Rsbuild's final Rspack config
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>
2026-11-04 03:04:00 +01:00
Sheraff
f474c8ce2d
fix(start-plugin-core): locate Start's compile diagnostics on Rsbuild
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>
2026-11-04 03:04:00 +01:00
Sheraff
593fff01c4
fix(start-plugin-core): bundle kits that list Start under dependencies on the Vite server
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>
2026-11-04 01:58:24 +01:00
Sheraff
6c93548141
fix(start-plugin-core): split a Hydrate imported through the app's re-exports
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>
2026-11-04 01:58:24 +01:00
Sheraff
cce9eb021d
test(router-generator): compare a symlink's target with the platform's separators
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 00:40:12 +01:00
Sheraff
3cba607be5
Merge t3/52bec041 (0cf014e55f): R88 reverted, dev servers under NODE_ENV=development
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>
2026-11-04 00:23:39 +01:00
Sheraff
758377e4d2
Merge t3/server-fn-url-safe-ids (35aedf618c): server function ids in the URL
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>
2026-11-03 22:18:50 +01:00
Sheraff
3bdeacc710
Merge origin/main (da8c28c498) into the compiler rewrite
#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>
2026-11-03 22:18:19 +01:00
Sheraff
0cf014e55f
test(compiler-test-utils): dev servers run under NODE_ENV=development
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>
2026-11-03 21:19:06 +01:00
Sheraff
aafc19ab91
revert(router-core): key the server route tree cache on the route tree again
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>
2026-11-03 21:10:30 +01:00
Sheraff
5a67481d85
chore: keep main's router-utils test:unit line and only the esbuild tests the PR lacks
`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>
2026-11-03 20:23:27 +01:00
Sheraff
2d8e6d3d6c
test(router-generator): keep the PR's group layout type tests as they were
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>
2026-11-03 20:23:13 +01:00
Sheraff
3ee403ebeb
style(router-generator): format the fixture types test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 20:12:31 +01:00
Sheraff
9ea8e609a1
chore(benchmarks): regenerate the Solid benchmark route trees with the route generator
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>
2026-11-03 20:12:16 +01:00
Sheraff
48418e038f
Merge t3/df5de384: compile a Vue SFC's script block once on Rsbuild, report its refusals in the SFC
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>
2026-11-03 20:10:42 +01:00
Sheraff
507fc1497b
test(router-generator): the group layout type checks are regression tests, not pins
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>
2026-11-03 20:09:52 +01:00
Sheraff
f348961e35
fix(router-generator): a childless pathless layout that carries a path conflicts with a route at that path
`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>
2026-11-03 20:09:52 +01:00
Sheraff
6c7511403e
Merge origin/main into compiler-rewrite/yuku
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>
2026-11-03 20:09:45 +01:00
Sheraff
35aedf618c
fix(start-plugin-core): a custom server function id must be one URL path segment
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>
2026-11-03 18:34:17 +01:00
Sheraff
ad5ee67c44
fix(start-plugin-core): generateFunctionId receives the generated handler name again
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>
2026-11-03 18:24:46 +01:00
Sheraff
0b77b93f57
fix(router-utils): the kept-declaration warning names several bindings in the plural
"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>
2026-11-03 18:20:17 +01:00
Sheraff
db3211b2f1
test(start-plugin-core): pin the Vue template-handler refusal and the recipe
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>
2026-11-03 18:15:51 +01:00
Sheraff
240f34eda4
docs(start-plugin-core): the Vue <script setup> limitation and its recipe
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>
2026-11-03 17:56:43 +01:00
Sheraff
050f706529
fix(start-plugin-core): report a Vue SFC's refusals of generated code at the binding
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>
2026-11-03 17:56:43 +01:00
Sheraff
04c9593d3d
fix(start-plugin-core): compile a Vue SFC's script block on Rsbuild, once
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>
2026-11-03 17:56:43 +01:00
Sheraff
908f1381a0
fix(router-utils): the statement after a removal keeps its own start
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>
2026-11-03 16:25:51 +01:00
Sheraff
19b3bf550f
chore(router-plugin): keep Rsbuild 1 in the router plugin's peer range
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>
2026-11-03 16:17:51 +01:00
Sheraff
f9df0c220b
test(router-plugin): a chunk reading a binding kept for state read in a callback at load is a kept reader on Rsbuild and webpack dev, and gives the source's value in an Rsbuild build
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 16:12:45 +01:00
Sheraff
6cfce5b4be
Merge branch 't3/compiler-review3-fix-list' 2026-11-03 16:05:44 +01:00
Sheraff
de1728d7db
Merge branch 't3/hmr-option-b-kept-readers' 2026-11-03 16:05:44 +01:00
Sheraff
f7664a8e8b
chore(start-plugin-core, router-plugin): raise the bundler peer floors to what the suites pass on
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>
2026-11-03 14:00:28 +01:00
Sheraff
6bcb764236
fix(router-utils): state read at load keeps its reader in the route module
`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>
2026-11-03 14:00:28 +01:00
Sheraff
0e7a91c975
fix(start-plugin-core): a client build fails on any module the compiler cannot parse
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>
2026-11-03 14:00:28 +01:00
Sheraff
9627d1c119
fix(router-utils): an annotation ending its line stays with the code on the next
`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>
2026-11-03 09:10:11 +01:00
Sheraff
72625803a0
fix(start-plugin-core): Rsbuild sees a package.json edit on Windows
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>
2026-11-03 08:38:00 +01:00
Sheraff
d5b3b82ff5
fix(router-generator): a symlinked route file or route tree keeps its link
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>
2026-11-03 08:38:00 +01:00
Sheraff
7da8433dc0
test: the fix after a syntax error may apply in place or reload
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>
2026-11-03 08:26:41 +01:00
Sheraff
c3b393ca34
test(router-plugin): lint the kept-binding matrix
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 08:22:43 +01:00
Sheraff
aaf76275f1
test(router-plugin): the kept-binding matrix says what webpack keeps
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 08:15:31 +01:00
Sheraff
2f284c875c
docs(router-utils): the env-readers home of a generated unit; route HMR's kept readers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 08:09:59 +01:00
Sheraff
25a43870b0
test(start-plugin-core): Start route edits on Rsbuild reach the chunks reading a binding the route module keeps
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>
2026-11-03 08:09:10 +01:00
Sheraff
048721c2c2
test(router-plugin): the kept-binding pins pass; the edits of a route keeping a binding its chunk reads on Rsbuild and webpack
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>
2026-11-03 08:00:45 +01:00
Sheraff
7b394e7ebe
fix(router-plugin): a route module edit reaches the chunks reading what it keeps on webpack-style hosts
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>
2026-11-03 07:46:54 +01:00
Sheraff
abc71aa1fc
feat(router-utils): a generated unit for the env module's readers
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>
2026-11-03 07:46:54 +01:00
Sheraff
0b395683ca
perf(router-utils): a rebuild asks the graph whether a module is still in it
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>
2026-11-03 07:39:14 +01:00
Sheraff
5bc674ea80
refactor(react-start-client): visible() reads its gate off props
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>
2026-11-03 04:35:46 +01:00
Sheraff
a5ca5977da
test(start-plugin-core): the hydrate pages wait with the same settled as the render kit
`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>
2026-11-03 02:48:29 +01:00
Sheraff
16f5be2a78
test(react-start-client): format the flipped visible() test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 02:48:29 +01:00
Sheraff
20faff8253
chore(start-plugin-core): format
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 02:48:29 +01:00
Sheraff
da19321452
fix(react-start-client): a visible() boundary survives an intersection during its replay
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>
2026-11-03 02:26:22 +01:00
Sheraff
cd8e2d28bc
merge: t3/allow-import-callback-api (allowImport decides before the mock)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 02:23:46 +01:00
Sheraff
67b5500b31
merge: t3/investigate-hydrate-boundary-flake (hydrate page settled race, visible() pin)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 02:23:46 +01:00
Sheraff
1d02042b0d
merge: t3/fix-annotated-decl-rename (annotated rename, kept-binding Rsbuild HMR pin)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 02:23:46 +01:00
Sheraff
c67638b5fe
test(react-start-client): pin visible() failing when the intersection lands during a replay
`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>
2026-11-02 23:33:44 +01:00
Sheraff
ceb54dca5e
fix(start-plugin-core): the hydrate page run waits for what the page has yet to do
`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>
2026-11-02 23:33:44 +01:00
Sheraff
1e281fc242
chore(start-plugin-core): lint
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 22:33:25 +01:00
Sheraff
2978292af5
fix(start-plugin-core): allow state follows the edge module, restored edges are always re-asked
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>
2026-11-02 22:26:59 +01:00
Sheraff
16f31d2c93
chore(start-plugin-core): remove what only served the second pass
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>
2026-11-02 22:13:24 +01:00
Sheraff
ae38ee9810
fix(start-plugin-core): a dead re-export is reported for real effects only
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>
2026-11-02 22:11:47 +01:00
Sheraff
3b393c4ac8
fix(start-plugin-core): a denied file's unresolvable import no longer hides the denial
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>
2026-11-02 22:09:41 +01:00
Sheraff
627da2c6ef
fix(start-plugin-core): awaiting a mock settles instead of freezing the process
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>
2026-11-02 22:09:01 +01:00
Sheraff
7503dc8484
feat(start-plugin-core): allowImport decides before the mock, onViolation only reports
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>
2026-11-02 22:03:47 +01:00
Sheraff
ceedb76176
test(router-plugin): pin an edit of a kept binding a chunk reads on Rsbuild
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>
2026-11-02 21:01:53 +01:00
Sheraff
ffeb743135
fix(router-utils): a rename reaches an annotated declaration
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>
2026-11-02 21:01:53 +01:00
Sheraff
2ac542e0a4
test(router-plugin): pin the annotated lowercase component binding in React dev
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 20:31:14 +01:00
Sheraff
eb12efe304
fix(router-utils): an annotation stays with the code it annotates
`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>
2026-11-02 16:20:18 +01:00
Sheraff
9d4e27c405
fix(router-utils): a rename keeps the property a shorthand with a default names
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>
2026-11-02 16:07:51 +01:00
Sheraff
e4960c29fa
fix(router-utils): a statement rewritten from its first byte stays an effect
`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>
2026-11-02 16:00:40 +01:00
Sheraff
abf0c7b3b6
chore(e2e): restore the generated Prisma clients a format run rewrote
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 14:58:40 +01:00
Sheraff
dd3fe4f0e0
revert: the virtual-module work (470a012a4d, 75f3a86d7b, 69f7190120)
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>
2026-11-02 14:56:53 +01:00
Sheraff
655d611d66
refactor(router-utils): Yuku 0.27 lists export namespace A.B, remove what its gap needed
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>
2026-11-02 14:56:52 +01:00
Sheraff
9bb886b811
chore: bump yuku to 0.27.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 13:03:49 +01:00
Sheraff
53f8ec6789
refactor(router-plugin): locate the package root by reading package.json, without checking that it exists first
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 13:00:58 +01:00
Sheraff
52985c82be
test(start-plugin-core): a diagnostic is matched by file and root
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 12:48:17 +01:00
Sheraff
ce07e3904e
style: format
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 11:19:36 +01:00
Sheraff
0f9d8d1f6b
docs: stale statements about upstream filing and the Rsbuild session's reads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 11:18:52 +01:00
Sheraff
75f3a86d7b
fix(start-plugin-core): virtual modules in build --watch and with an asset query
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>
2026-11-02 11:18:52 +01:00
Sheraff
4060f7230f
fix(start-plugin-core): the compiler's cache key also holds for a cache tools.rspack sets
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>
2026-11-02 11:18:52 +01:00
Sheraff
5741ca5774
fix(router-plugin): a type namespace sharing a name with a route or its options is erased
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>
2026-11-02 11:15:55 +01:00
Sheraff
34d5bc351e
fix(start-plugin-core): Rsbuild's SSR layer doesn't provide server functions under RSC
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>
2026-11-02 11:15:12 +01:00
Sheraff
4db99d6420
docs: where a virtual module's raw text comes from and what keys a persistent cache
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 10:51:03 +01:00
Sheraff
69f7190120
fix(start-plugin-core): remove a read of our virtual modules that always missed
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>
2026-11-02 10:50:59 +01:00
Sheraff
0fbdef4028
test: a server fn nested in an exported class of a route file, with and without a separate provider
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>
2026-11-02 10:46:44 +01:00
Sheraff
02aba27fa4
fix(router-plugin): a Route merged with a namespace warns that it isn't split
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>
2026-11-02 10:39:49 +01:00
Sheraff
2e29287aa2
fix(start-plugin-core): a persistent cache doesn't restore another compiler's outputs
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>
2026-11-02 10:37:02 +01:00
Sheraff
6f53a083e0
test(start-plugin-core): a restarted Rsbuild dev server follows a builder that became plain
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>
2026-11-02 10:29:02 +01:00
Sheraff
470a012a4d
fix(start-plugin-core): a virtual module's raw read never waits for its transforms
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>
2026-11-02 10:26:55 +01:00
Sheraff
de9f0dc452
docs(router-utils): an enum read is pure only for a member the enum declares
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 09:23:09 +01:00
Sheraff
60703bbcb8
revert: the eager warning's wording about a shared module
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>
2026-11-02 08:14:11 +01:00
Sheraff
e3478c374c
test: a Hydrate module's dotted namespace pin, an empty export name, function cycles and two cycles
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>
2026-11-02 07:36:22 +01:00
Sheraff
ac7d636135
fix(router-utils): the eager warning of a shared module says other exports may be in it
An importer of `A` was told only about `Z`, the export naming the module of a cycle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 07:36:22 +01:00
Sheraff
8dd05be361
fix(router-utils): only a member an enum declares is a pure read of it
`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>
2026-11-02 07:36:22 +01:00
Sheraff
e02a15e112
fix(router-utils): an export row with no binding doesn't overwrite what another row of the name knows
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>
2026-11-02 07:36:22 +01:00
Sheraff
005797b148
test: a read cycle of exports behind a server fn the loader calls
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>
2026-11-02 06:57:12 +01:00
Sheraff
75d7d3beab
fix(router-utils): drop the fallback for Yuku's missing export of a dotted namespace, pin the shape
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>
2026-11-02 06:57:12 +01:00
Sheraff
040c225283
Merge branch 't3/router-compiler-followups'
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 06:52:19 +01:00
Sheraff
b5578cad9a
Merge branch 't3/investigate-e2e-ci-failures': a cluster the env module evaluates reads through the env tree
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 06:52:19 +01:00
Sheraff
162df17fc8
fix(router-utils): exports that read each other share one extracted module
`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>
2026-11-01 22:56:21 +01:00
Sheraff
e4952132c3
style: format
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 22:22:31 +01:00
Sheraff
4a67d81132
fix(router-utils): a rebuild doesn't reach a module the previous rebuild removed
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>
2026-11-01 22:22:31 +01:00
Sheraff
e39d91f36c
fix(start-plugin-core): TSR_COMPILER_NO_CACHE bypasses the route registry's answer
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>
2026-11-01 22:22:31 +01:00
Sheraff
0c09177e0f
fix(router-utils): a dotted namespace and an exported import alias declare their name
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>
2026-11-01 22:22:31 +01:00
Sheraff
6e7f47f77a
fix(router-utils): only a query names an extracted export
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>
2026-11-01 22:22:31 +01:00
Sheraff
b6b7fd35d4
fix(router-plugin): an extracted module and its eager warning name the export
`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>
2026-11-01 22:22:31 +01:00
Sheraff
9fd7552bfd
fix(router-utils): a read of a member of the module's own enum runs no code
`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>
2026-11-01 22:22:31 +01:00
Sheraff
fc7ef869e4
refactor(router-utils): a generated specifier has no edge location
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>
2026-11-01 22:22:31 +01:00
Sheraff
e0cb50c76b
refactor(router-utils): the edit order is named bands, not numeric gaps
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>
2026-11-01 22:22:31 +01:00
Sheraff
6039f5b02b
fix(router-utils): a chunk reads what the env module evaluates through the env tree
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>
2026-11-01 22:12:09 +01:00
Sheraff
fa6a9906ed
style: format
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 16:32:04 +01:00
Sheraff
76ddc5e13e
docs: the copy rule names what observes identity; the older changesets and AGENTS state the final rule
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 16:15:30 +01:00
Sheraff
093769aeb2
test: the load-time read and the failing generator, through the real plugins
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 16:15:30 +01:00
Sheraff
aa775dd336
test(start-plugin-core): the differing-text window is what the test exercises, with a control
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 16:13:56 +01:00
Sheraff
df4bf575b9
fix(router-generator): a failed batch keeps the routes but not a constructor fact the file no longer holds
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 16:13:56 +01:00
Sheraff
d130112795
fix(router-utils): the route module re-exports a merged declaration once
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 16:13:56 +01:00
Sheraff
33924a8ddc
fix(router-utils): a factless raw entry does not count as stale once its marker scan is current
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 16:13:56 +01:00
Sheraff
d787e6a485
fix(router-utils): a save during a compile is not reported as a plugin's differing text
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 16:13:56 +01:00
Sheraff
6c864980b8
fix(router-utils): a package.json change checks a plan's resolutions once, not once per file under it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 16:13:56 +01:00
Sheraff
1b88b6ccf5
fix(router-utils): an evaluation that calls anything may run what it reads, however the call is spelled
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>
2026-11-01 16:11:13 +01:00
Sheraff
f8cfccb989
style: format
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 15:26:29 +01:00
Sheraff
de0b0bd901
Merge branch 't3/fc-review2-identity' into t3/integrate-router-compiler-rewrite
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>
2026-11-01 15:25:37 +01:00
Sheraff
0528268fca
Merge branch 't3/double-parse' into t3/integrate-router-compiler-rewrite
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>
2026-11-01 15:23:56 +01:00
Sheraff
8b28671d1e
Merge branch 't3/compiler-rewrite-factcheck' into t3/integrate-router-compiler-rewrite 2026-11-01 15:23:36 +01:00
Sheraff
52406c887c
Merge branch 't3/windows-ci-changesets-pins' into t3/integrate-router-compiler-rewrite 2026-11-01 15:23:36 +01:00
Sheraff
61938bace0
Merge branch 't3/dev-dependents-flake' into t3/integrate-router-compiler-rewrite 2026-11-01 15:23:36 +01:00
Sheraff
2599dcd0b3
Merge branch 't3/investigate-integration-oom' into t3/integrate-router-compiler-rewrite 2026-11-01 15:23:36 +01:00
Sheraff
ef9e496aba
fix(router-utils): the eager-export warning names both routes to the entry when split code imports the module
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>
2026-11-01 15:21:00 +01:00
Sheraff
d427fd09b8
perf(router-utils): the identity and call facts of a reference are contexts, not fields
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>
2026-11-01 14:35:05 +01:00
Sheraff
8eb7fd1756
fix(router-utils): an orphaned import only a provider output needs goes with the provider
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>
2026-11-01 14:07:02 +01:00
Sheraff
c2397221de
fix(router-utils): the copy carries only what no output keeps once; identity uses and load-time calls count
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>
2026-11-01 13:59:26 +01:00
Sheraff
8458d4f80a
perf(start-plugin-core): the route tree's imports of Route are answered from the route registry, not from every route file
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>
2026-11-01 13:46:23 +01:00
Sheraff
59e3c1a938
style(router-utils): import order
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 13:21:04 +01:00
Sheraff
8cac483ae0
fix(router-utils): the compiler stats registry keeps no session alive
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>
2026-11-01 13:15:14 +01:00
Sheraff
f229cb67e5
fix(compiler-test-utils): harness scopes release their work when it ends
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>
2026-11-01 13:15:14 +01:00
Sheraff
126d23ed77
chore: changeset for the copy rule
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-01 13:04:00 +01:00
Sheraff
490348c024
docs(router-utils): state the placement stage order; name bindings in invariants; correct parse and plan-key docs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 09:54:00 +01:00
Sheraff
11fce9bd2e
fix(start-plugin-core): file events: resolver errors, package.json edits, bursts and differing input texts
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>
2026-11-01 09:54:00 +01:00
Sheraff
72e8f153fc
fix(router-plugin): a frozen component read through a namespace is not marked for route HMR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 09:54:00 +01:00
Sheraff
f3ca5f090b
fix(router-utils): a name user code chooses never finds Object.prototype in a table
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 09:54:00 +01:00
Sheraff
128f5250ae
fix(router-utils): an enum whose members have effects keeps its place in evaluation order
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 09:54:00 +01:00
Sheraff
1ea9f9b2a2
fix(router-utils): a chunk copies an extracted export only when the copy is functions and primitives nothing writes
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>
2026-11-01 09:52:37 +01:00
Sheraff
2d7d148edc
test(start-plugin-core): the dev-dependents test checks which modules an edit builds, not how many compiles
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>
2026-11-01 09:35:12 +01:00
Sheraff
776105252a
test(start-plugin-core): pin a stale resolution memo and a rejected registry invalidation (review 2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 09:30:00 +01:00
Sheraff
b42aa9193f
test(router-plugin): pin enum effects, Object.prototype specifiers and two-text plans (review 2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 09:30:00 +01:00
Sheraff
a438b8e620
test(router-plugin): module state and identity behind copied exported bindings, in builds and dev
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>
2026-11-01 09:03:35 +01:00
Sheraff
50a2c9a55d
docs(changeset, oracle): route options the compiler can't read build and warn; the wrapper pin becomes a build test
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>
2026-11-01 08:45:30 +01:00
Sheraff
63b8d45127
test(router-generator): the unparsable-route tests spell paths as the generator does on Windows
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>
2026-11-01 08:39:20 +01:00
Sheraff
b7a8d45b2b
test(router-plugin): a spread or a call of server-only route options warns, by ruling
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>
2026-10-31 15:47:54 +01:00
Sheraff
a0a98d2fc6
style: format
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 15:26:56 +01:00
Sheraff
470c3b41cb
fix(router-plugin): route calls the planner doesn't own, followed through a name and warned about
`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>
2026-10-31 15:26:24 +01:00
Sheraff
ae2de8864b
fix(router-plugin): an edit of a route whose options can't be read reloads the page
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>
2026-10-31 15:26:24 +01:00
Sheraff
0b44984116
fix(start-plugin-core): an isomorphic fn is compiled when what it returns is a Start value
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>
2026-10-31 15:26:24 +01:00
Sheraff
57cd6377f5
Revert "fix(start-plugin-core): an import() of a marker the client keeps is a violation"
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>
2026-10-31 15:18:52 +01:00
Sheraff
2e5dbeef27
perf(router-plugin): a route file holding one factory call skips the look for others
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>
2026-10-31 14:29:12 +01:00
Sheraff
60df64cfd4
docs: SPEC J2.8 and J2.14, the changeset and the guide for route options the compiler can't read
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 14:02:49 +01:00
Sheraff
79190fc2fe
test(start-plugin-core): pin the Vue <script setup> compile error on the dev server
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>
2026-10-31 14:01:48 +01:00
Sheraff
a199a76c78
Revert "fix(start-plugin-core): plugin-vue's generated __returned__ object is no use of a Start value"
This reverts commit a21054944b.
2026-10-31 14:01:48 +01:00
Sheraff
60ee8f6edd
fix(start-plugin-core): an import() of a marker the client keeps is a violation
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>
2026-10-31 14:01:48 +01:00
Sheraff
df6c00c565
feat(router-plugin): route options the compiler can't read build and warn
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>
2026-10-31 14:00:44 +01:00
Sheraff
a21054944b
fix(start-plugin-core): plugin-vue's generated __returned__ object is no use of a Start value
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>
2026-10-31 13:56:54 +01:00
Sheraff
953fde439c
fix(router-utils): an isomorphic fn's call gives what its implementation returns
`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>
2026-10-31 13:54:47 +01:00
Sheraff
468e7dfd67
docs: the coverage review's changes in SPEC J4.5 and the changeset
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 13:20:15 +01:00
Sheraff
2b0b573ebc
perf(start-plugin-core): prefetch reads reference nodes only for a namespace
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>
2026-10-31 12:26:21 +01:00
Sheraff
bd2da722ea
fix(start-plugin-core): a type-only namespace of a server fn's name keeps it at the top level
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>
2026-10-31 12:17:24 +01:00
Sheraff
a12e2d90bf
fix(start-plugin-core): what the coverage review of the R92 round found
- 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>
2026-10-31 12:03:51 +01:00
Sheraff
51c2698a0a
fix(router-utils): any import of a marker marks the module; import() only where it evaluates with the module
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>
2026-10-31 12:02:57 +01:00
Sheraff
a9873a9d8a
fix(router-plugin): a route factory call's options in a constant are judged too
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 12:02:57 +01:00
Sheraff
8826f37feb
fix(router-utils): a re-export cycle is cut on the module and the name
`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>
2026-10-31 12:02:57 +01:00
Sheraff
4d66cbfa3c
docs: changeset, SPEC J4.5 and J2.11 and the guide for R92
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>
2026-10-31 11:19:15 +01:00
Sheraff
4b14573b19
feat(start-plugin-core): createServerFn.call(thisArg, options) compiles
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>
2026-10-31 11:17:22 +01:00
Sheraff
18086d2b84
fix(start-plugin-core): an RSC primitive outside a server fn fails the client build
`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>
2026-10-31 11:14:50 +01:00
Sheraff
8d0d4c6b2f
fix(router-plugin): a route factory call the planner doesn't own fails where it carries server options
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>
2026-10-31 11:11:25 +01:00
Sheraff
27c07e71ad
fix(router-utils): export * and import() of a marker mark the module
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>
2026-10-31 11:08:55 +01:00
Sheraff
e154b0c778
fix(router-utils): a name: specifier may be a plugin's or an alias's
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>
2026-10-31 11:06:59 +01:00
Sheraff
2cb850d4d7
fix(start-plugin-core): Rsbuild's compiler resolves the imports it reads with their exports conditions
`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>
2026-10-31 11:05:24 +01:00
Sheraff
f3826e1a7f
fix(start-plugin-core): a client-only middleware in a const list compiles
`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>
2026-10-31 11:04:07 +01:00
Sheraff
b4587dbe90
fix(start-plugin-core): console.* arguments and typeof ns are no escapes
`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>
2026-10-31 11:02:28 +01:00
Sheraff
45a3064412
fix(start-plugin-core): a builder returned through a Start call, or held by a TS namespace, is refused
`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>
2026-10-31 11:00:58 +01:00
Sheraff
cd987a73c3
fix(start-plugin-core): a let builder reassigned with the same kind of builder compiles
`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>
2026-10-31 10:59:44 +01:00
Sheraff
342c1b68a3
fix(start-plugin-core): a method called on a finished server fn keeps the chain
`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>
2026-10-31 10:57:49 +01:00
Sheraff
cdf08f0326
feat(start-plugin-core): a parameter passed directly to .validator() fails the client build
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>
2026-10-31 10:57:00 +01:00
Sheraff
63e990a52c
refactor(router-utils): a function returning its parameter is no longer followed
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>
2026-10-31 10:55:36 +01:00
Sheraff
f5245b0eaa
test(start-plugin-core): test apps keep builders out of the namespaces they hand to page code
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>
2026-10-31 10:51:57 +01:00
Sheraff
58adad276d
fix(router-utils): a name's value is read from its first declaration holding one
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>
2026-10-31 10:46:31 +01:00
Sheraff
a744e235bc
feat(start-plugin-core): a project namespace is followed through exports, and refused where it escapes
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>
2026-10-31 10:45:08 +01:00
Sheraff
fde969aa3b
refactor(start-plugin-core): a Start package imported at run time is no longer refused
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>
2026-10-31 10:43:09 +01:00
Sheraff
bd5869cccd
refactor(start-plugin-core): remove the client build's graph check of importers of a builder
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>
2026-10-31 10:42:34 +01:00
Sheraff
8314d304d1
test(start-plugin-core): pin a server fn whose method is called where it is created
`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>
2026-10-31 10:37:30 +01:00
Sheraff
804cbfd8f5
docs: changeset, SPEC J4.5 and the import protection guide for the Start compiler's builder escapes
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>
2026-10-31 10:37:30 +01:00
Sheraff
2cbe507b86
fix(router-utils): the output checker reads an import of a same-named module of another directory as no import of the module itself
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>
2026-10-31 10:37:30 +01:00
Sheraff
6afc3a2250
fix(start-plugin-core): an isomorphic fn under a TypeScript cast compiles to code that parses
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>
2026-10-31 10:37:30 +01:00
Sheraff
97473827a5
feat(start-plugin-core): Start compiles the JavaScript of .mdx and other late-pass modules that name it
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>
2026-10-31 10:37:30 +01:00
Sheraff
2f000a48b9
feat(start-plugin-core): a client build fails where a module exporting a Start builder is imported beyond the compiler's view
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>
2026-10-31 10:37:30 +01:00
Sheraff
5220d93d98
feat(start-plugin-core): the client build fails where a Start builder goes beyond what the compiler follows
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>
2026-10-31 10:37:30 +01:00
Sheraff
dcfd7c74bf
feat(start-plugin-core): Start recognises destructured factories, sequence callees, joined builders and factories with statements
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>
2026-10-31 10:37:30 +01:00
Sheraff
b0f47696e4
test(start-plugin-core): pin builder shapes that leak server code to the client silently
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>
2026-10-31 10:37:30 +01:00
Sheraff
e536af167a
test(start-plugin-core): one Files type in the asset-query tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 23:30:19 +01:00
Sheraff
8aff746a9e
fix(start-plugin-core): what the coverage review of the denied-file scope found
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>
2026-10-30 23:26:57 +01:00
Sheraff
cc69fa8187
fix(start-plugin-core): a denied file is judged wherever it lives, whatever its file type
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>
2026-10-30 23:14:46 +01:00
Sheraff
7a2af06e5a
docs(start-plugin-core): changeset for asset queries in import protection
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 23:02:43 +01:00
Sheraff
31cb945661
fix(start-plugin-core): the asset-query rule keeps every other rule's index (module ids)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:56:45 +01:00
Sheraff
e66a6706b0
fix(start-plugin-core): what the coverage review of asset queries found
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>
2026-10-30 22:44:20 +01:00
Sheraff
b097fe62f5
fix(start-plugin-core): an asset query of a denied file is mocked and reported, whatever import brought it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:27:21 +01:00
Sheraff
613e077ad1
test(router-utils): the erased parts test reproduces the loop on an edit exactly on a hidden claim
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 20:38:14 +01:00
Sheraff
0264fd4799
perf(router-utils): only a var binding's declarations are read; a statement's line end asks nothing more of it
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>
2026-10-30 20:38:14 +01:00
Sheraff
57093b8176
docs: the open issues of the compiler lane: known bugs, changeset
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 20:38:14 +01:00
Sheraff
55324acd42
fix(router-utils, router-generator, start-plugin-core): what the coverage review of the open issues found
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>
2026-10-30 20:38:14 +01:00
Sheraff
b580ab5976
fix(router-generator): a build fails on a route file that does not parse, whatever else fails
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>
2026-10-30 20:38:14 +01:00
Sheraff
c472feb33d
fix(router-utils): a var declared again with a value is a write
`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>
2026-10-30 20:38:14 +01:00
Sheraff
d586549080
fix(start-plugin-core): the provider serves a server fn in code it erases
`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>
2026-10-30 20:38:01 +01:00
Sheraff
84ddc672a4
fix(router-utils): glue never joins a statement that ends without a terminator
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>
2026-10-30 20:38:01 +01:00
Sheraff
e1de44ec3a
docs(router-utils): wrap the note on destructured literals
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:54:18 +01:00
Sheraff
c5eee38f00
revert(router-utils): a destructured literal stays as written (R90)
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>
2026-10-30 19:20:55 +01:00
Sheraff
e3a8dc5cfe
fix(router-utils, router-generator): what the coverage review of this lane's fixes found
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>
2026-10-30 18:36:41 +01:00
Sheraff
4ae4b7d7ca
perf(router-utils): a claim's readers are looked at only when its occurrence is erased
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>
2026-10-30 17:37:13 +01:00
Sheraff
9115cf4405
fix(router-utils): a literal keeps the value of a key another pattern property reads
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>
2026-10-30 16:30:02 +01:00
Sheraff
cd94c77f4f
fix(router-generator): every batch a waiting build drains is a build
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>
2026-10-30 16:30:02 +01:00
Sheraff
2da615ab8a
fix(router-utils): export default x above var x = … is no name the chunk reads x by
`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>
2026-10-30 16:30:02 +01:00
Sheraff
7f69ca9a87
fix(router-utils): a claim other generated code reads outlives an erasure of its occurrence
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>
2026-10-30 16:30:02 +01:00
Sheraff
4d8a5415a1
fix(router-utils): a literal's value only removed code reads goes with its destructuring leaf
`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>
2026-10-30 16:30:02 +01:00
Sheraff
5cefb94792
docs: Rsbuild removals are invalidated at watchRun; an unlinked file's resolutions are stale
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 16:00:55 +01:00
Sheraff
6279d65a41
fix(start-plugin-core): Rsbuild builds a removed file's stale dependents in the same compilation
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>
2026-10-30 15:54:50 +01:00
Sheraff
b01f19a6b7
fix(router-utils): a resolution that found a removed file is stale without asking a resolver
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>
2026-10-30 15:54:50 +01:00
Sheraff
564605fe9b
docs(start-plugin-core): cite where Rspack reads the change set a watchRun extends
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:11:01 +01:00
Sheraff
bc32a92481
refactor(start-plugin-core): Rsbuild checks restored plans only where modules carry them
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:11:01 +01:00
Sheraff
d4a45615c1
perf(start-plugin-core): an Rsbuild module's persisted plan is one JSON string
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>
2026-10-30 15:11:01 +01:00
Sheraff
c512aeaf0b
perf(start-plugin-core): Rsbuild modules carry their plan only with a cache that outlives the process
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>
2026-10-30 15:11:01 +01:00
Sheraff
2f9dc1a49e
fix(start-plugin-core): Rsbuild watches every file a plan read, at the compilation level
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>
2026-10-30 15:11:01 +01:00
Sheraff
7b3d11375a
style(start-plugin-core): format the Rsbuild dev dependents test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:11:01 +01:00
Sheraff
13151ce99b
perf(start-plugin-core): Rsbuild dev builds only the stale dependents of an edit
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>
2026-10-30 15:11:01 +01:00
Sheraff
b5cb576b6f
fix(router-utils): a created file invalidates the resolutions it may take; restored plans
`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>
2026-10-30 15:11:01 +01:00
Sheraff
d6b7aea973
test(start-plugin-core): what an Rsbuild dev edit rebuilds, files that appear, warm restarts
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>
2026-10-30 15:11:01 +01:00
Sheraff
c79554109f
test(compiler-test-utils): an Rsbuild dev server's rebuilt modules cover every compile of an edit
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>
2026-10-30 15:11:01 +01:00
Sheraff
503536507b
perf(router-plugin): route HMR asks for a glue name only where it can differ
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>
2026-10-30 15:06:17 +01:00
Sheraff
2bf4e62021
perf(router-utils, router-plugin): route HMR names glue exports ahead instead of a render-time fragment
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>
2026-10-30 15:06:17 +01:00
Sheraff
875719a21f
test(router-plugin): the deleteNodes HMR test checks the served imports, not the text
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:06:17 +01:00
Sheraff
732e8c2e76
fix(router-plugin): the React HMR ignore list keeps the module-level names it ignored before
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>
2026-10-30 15:06:17 +01:00
Sheraff
6596b9951f
docs(router-utils): a rest element keeps a pruned property without its default; glue frag comment
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:06:17 +01:00
Sheraff
66591afb22
test(router-utils): glue names next to export * as and export type *, aliased companions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:06:17 +01:00
Sheraff
d6e61f2558
fix(router-generator): a broken file naming no Route, a Vue root and a file outside the routes directory follow R86
- 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>
2026-10-30 15:06:17 +01:00
Sheraff
0ab57838c7
fix(router-utils): a destructuring default only removed code reads goes, also next to a rest element
`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>
2026-10-30 15:06:17 +01:00
Sheraff
7097480d36
fix(router-plugin): route HMR hoists no option deleteNodes removes
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>
2026-10-30 15:06:17 +01:00
Sheraff
07b681a938
fix(router-utils, router-plugin): the React HMR ignore list names the glue exports only
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>
2026-10-30 15:06:17 +01:00
Sheraff
6d642be074
fix(router-utils): a member of a namespace import is a pure read
`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>
2026-10-30 15:06:17 +01:00
Sheraff
77adeadbb3
fix(router-generator): every cold or build run rejects a route file that does not parse, the root included
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>
2026-10-30 15:06:17 +01:00
Sheraff
9b3fef3732
fix(router-utils, router-plugin): glue export names never shadow export * names and are ignored by React Refresh
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>
2026-10-30 15:06:17 +01:00
Sheraff
2554334957
fix(router-utils): export default x of a reassigned x is no name of the binding
`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>
2026-10-30 15:06:17 +01:00
Sheraff
f2d687e257
fix(router-utils): an extracted cluster re-exports every binding its export lists export
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>
2026-10-30 15:06:17 +01:00
Sheraff
b4d2482dcf
fix(router-utils): code with side effects never moves into an extracted export's module
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>
2026-10-30 15:06:17 +01:00
Sheraff
858f5daebd
fix(router-plugin): deleteNodes options take what only they read out of every output
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>
2026-10-30 15:06:17 +01:00
Sheraff
67dc1090d2
chore: changeset for the unchecked-importer build warning
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 14:30:01 +01:00
Sheraff
edc270b7b8
docs(start): a build warns about the accepted import-protection rejections
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 14:29:42 +01:00
Sheraff
f307e54083
feat(start-plugin-core): a build warns about a denied file only unchecked importers reach
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>
2026-10-30 14:29:42 +01:00
Sheraff
a9d5385edf
docs(start): import protection limitations for unchecked importers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 14:17:04 +01:00
Sheraff
23f09651da
test(start-plugin-core): pin two accepted import-protection rejections (safe direction)
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>
2026-10-30 14:17:04 +01:00
Sheraff
f85217dbf0
fix(router-plugin): a route whose factory an app module re-exports is reported, and refused under Start
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>
2026-10-30 12:35:57 +01:00
Sheraff
7728f677c8
fix(start-plugin-core): a denied file a pattern import reaches is mocked and reported
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>
2026-10-30 12:35:56 +01:00
Sheraff
b525d49d60
fix(start-plugin-core): Start's prefetch recognises a builder two imports reach at once
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>
2026-10-30 12:35:19 +01:00
Sheraff
c230b7a7f4
test: a route whose createFileRoute an app module re-exports is split or reported, and never ships its server options silently (pinned)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 12:35:19 +01:00
Sheraff
db53de1b04
test(start-plugin-core): a glob or template import of a denied file never runs in the client
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>
2026-10-30 12:35:19 +01:00
Sheraff
4eeac2bc12
test(start-plugin-core): pin two builders derived from one imported builder leaking a handler to the client
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>
2026-10-30 12:35:19 +01:00
Sheraff
473c13d6cd
perf(start-plugin-core): the client registry sweep runs in watch builds only
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>
2026-10-30 12:20:34 +01:00
Sheraff
cfce5fa772
docs(start-plugin-core): why planStartEnv rewrites server fns after step 5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 12:20:34 +01:00
Sheraff
7df68562b5
refactor(router-utils): name the edit sequence bands
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>
2026-10-30 12:20:34 +01:00
Sheraff
c40efdb472
fix(router-utils, start-plugin-core): a deleted file leaves the emitted-maps texts and Vite output digests
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>
2026-10-30 12:20:34 +01:00
Sheraff
e1188be2d0
fix(router-core): the server route tree cache misses a route tree re-evaluated on the same root
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>
2026-10-30 12:20:34 +01:00
Sheraff
80ff06fe5a
perf(start-plugin-core): dependency scripts reach the Vite compile hook only when their text names Start
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>
2026-10-30 12:20:24 +01:00
Sheraff
420d6d716a
fix(start-plugin-core): Vite build --watch refuses a server fn the client stopped importing
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>
2026-10-30 12:20:24 +01:00
Sheraff
6f422cdb68
test(start-plugin-core): a server fn the client stops importing is refused after a watch rebuild
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>
2026-10-30 12:20:24 +01:00
Sheraff
23869af462
fix(start-plugin-core): Vite build --watch invalidates the file Rolldown reports on Windows
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>
2026-10-30 12:20:24 +01:00
Sheraff
185dcd575d
fix(router-utils): requests of one text share one compile; dependents rows outlive overlapping attempts
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>
2026-10-30 12:20:24 +01:00
Sheraff
97472b0fa9
test(router-utils): pin plan-cache concurrency findings of review 1
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>
2026-10-30 12:20:24 +01:00
Sheraff
1c6d373131
fix: a build that does not watch fails when its route generation fails
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>
2026-10-30 11:46:04 +01:00
Sheraff
50806d8563
fix(router-plugin): React + Vite route HMR validates the route file's own exports again
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>
2026-10-30 11:46:03 +01:00
Sheraff
cb682be4ca
docs: deleteNodes refusals, removed router-plugin exports and afterTransform in the changesets
- 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>
2026-10-30 11:46:03 +01:00
Sheraff
da96a36239
fix(router-generator): a route file that does not parse fails a cold run, naming it
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>
2026-10-30 11:46:03 +01:00
Sheraff
fd02e9609e
test(router-generator): a cold run with a route file that does not parse fails or keeps its route (pinned)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 11:46:03 +01:00
Sheraff
299392ce1e
fix(router-utils): an augmentation with an effect of its own keeps its export in the route module
`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>
2026-10-30 11:46:03 +01:00
Sheraff
c6b9a7f3b3
fix(router-utils): an expression default export reading an extracted candidate stays in the route module
`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>
2026-10-30 11:46:03 +01:00
Sheraff
f73c0bcdb6
fix(router-utils): a module-level destructuring leaf another output takes stays in its pattern
`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>
2026-10-30 11:46:03 +01:00
Sheraff
5d896f6959
fix(router-utils): glue writes a string export name as a string literal
`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>
2026-10-30 10:40:11 +01:00
Sheraff
019cf70194
test(start-plugin-core): factory-built and spread route options never ship their server handlers to the client silently
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:27:19 +01:00
Sheraff
15b9da2c2c
test(router-plugin): an edit of a route file's exported value shows in the module importing it on React + Vite (pinned)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:27:19 +01:00
Sheraff
bcff490768
test(router-plugin): an effectful augmentation calling an imported function runs in source order (pinned on vite, rspack, webpack)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:27:19 +01:00
Sheraff
b1a5919450
test(router-plugin): export and declaration shapes next to a split component build and run (string export name, destructured components and wrapping default export pinned)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:27:19 +01:00
Sheraff
37e941dfe6
test(e2e): the Rsbuild overlay spec reads the line from Rspack's file-less SWC code frame
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>
2026-10-30 03:41:34 +01:00
Sheraff
23d4bebc6e
test(start-plugin-core): a watch rebuild forgets a deleted server fn module
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 02:26:17 +01:00
Sheraff
86ffa8a93c
test(start-plugin-core): Rsbuild's persistent cache compiles a module again when its import changed meanwhile
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>
2026-10-30 01:36:47 +01:00
Sheraff
a05c723a58
perf(start-plugin-core): Start's Vite host builds maps only when the build wants them
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>
2026-10-30 01:36:47 +01:00
Sheraff
a07a903c24
test(start-plugin-core): a watch build's first build is reported, not thrown, on both bundlers
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>
2026-10-30 01:36:47 +01:00
Sheraff
ef1373b3f8
perf(start-plugin-core): Rsbuild replays restored-module checks in the first compilation only
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>
2026-10-30 01:36:47 +01:00
Sheraff
234f6bec0a
perf(start-plugin-core): Rsbuild retain returns when the file set is unchanged
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>
2026-10-30 01:36:47 +01:00
Sheraff
d21cdc41cf
perf(start-plugin-core): Rsbuild dev server keeps the server's shared chunk only
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>
2026-10-30 01:36:47 +01:00
Sheraff
cb29f5bd13
chore: changeset for vite build --watch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 01:36:47 +01:00
Sheraff
7c3b46f1dd
fix(start-plugin-core): vite build --watch rebuilds against the edit
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>
2026-10-30 01:36:46 +01:00
Sheraff
37f89d8ac2
fix(start-plugin-core, router-utils): load a virtual id through the environment that resolved it
`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>
2026-10-30 01:36:46 +01:00
Sheraff
3a3e0b22b7
docs: one router planner; placement rules point at placement/
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>
2026-10-30 01:05:03 +01:00
Sheraff
9ca9d47575
test(start-plugin-core): the .mdx import-protection warning is located
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>
2026-10-30 01:04:02 +01:00
Sheraff
857cc37659
test(react-router): drop the unused click helper of the route HMR tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 00:59:39 +01:00
Sheraff
5a887ae664
test(compiler-test-utils): drop harness fields no test reads
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>
2026-10-30 00:59:29 +01:00
Sheraff
17f5a54b63
refactor(start-plugin-core): the Rsbuild host uses the Start session's environment type
StartRsbuildEnvironment was StartCompilerEnvironment field for field, a
leftover of the one Start session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 00:57:58 +01:00
Sheraff
6dceee4a84
refactor(router-plugin): the planners entry re-exports only the config type Start imports
HmrStyle and RouterPlannerEnv came back with the one-planner merge and
have no importer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 00:57:58 +01:00
Sheraff
3a5b64162e
refactor(router-utils): drop unread core fields
- 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>
2026-10-30 00:57:29 +01:00
Sheraff
0ea600fe30
refactor(router-utils): gates and prefetches get only what planners read
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>
2026-10-30 00:57:29 +01:00
Sheraff
7c904e9349
refactor(router-utils): module summaries carry no raw revision or import flag
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>
2026-10-30 00:55:13 +01:00
Sheraff
1ea4df08c5
refactor(router-utils): drop the plan's unread summary digest and source length
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>
2026-10-30 00:55:13 +01:00
Sheraff
8ef0b4d03e
refactor(router-utils, router-plugin): the shared Vite host helpers live in the compiler's hosts
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>
2026-10-30 00:54:07 +01:00
Sheraff
00eee4b050
refactor(start-plugin-core): one env shape for the registry snapshots
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 00:35:52 +01:00
Sheraff
593e0d8220
test(router-core): type the fake router's rebuilt route tree
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 00:32:44 +01:00
Sheraff
8842e6bfe2
chore: changeset for the server-fn registry following edits
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 00:29:43 +01:00
Sheraff
6af79385bf
fix(router-core, react-router): route HMR forgets the routes a rebuilt tree drops
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>
2026-10-30 00:29:29 +01:00
Sheraff
3e7df32c8c
fix(start-plugin-core): a compile replaces its module's server functions in the registry
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>
2026-10-30 00:24:14 +01:00
Sheraff
35c78b8170
refactor(start-plugin-core): one opacity predicate for the summaries
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>
2026-10-29 23:13:47 +01:00
Sheraff
bf940a0fda
refactor(router-generator, router-plugin): the generator owns the route files' real paths
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>
2026-10-29 23:13:47 +01:00
Sheraff
43dbe0dc93
refactor(start-plugin-core): one route generator configuration for Start on Vite and Rsbuild
`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>
2026-10-29 23:13:47 +01:00
Sheraff
3aaa735491
fix(router-generator, router-plugin, start-plugin-core, router-cli): one generator session for every watch mode
`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>
2026-10-29 23:13:47 +01:00
Sheraff
c6b9019aee
refactor(router-plugin, start-plugin-core): the Vite hosts share derived loads and graph invalidation
`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>
2026-10-29 23:13:47 +01:00
Sheraff
010c9dab73
refactor(start-plugin-core): one bundler-free Start session for the Vite and Rsbuild hosts
`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>
2026-10-29 23:13:47 +01:00
Sheraff
05f12bb3f2
refactor(compiler): the hosts' bundler-shaped helpers in their own section
`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>
2026-10-29 23:13:47 +01:00
Sheraff
3b760f111e
refactor(compiler): one eager-export warning, deduped by the ledger on every host
`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>
2026-10-29 23:13:47 +01:00
Sheraff
63f0e57ec6
refactor(compiler): one diagnostics reporter next to the warning ledger
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>
2026-10-29 23:13:47 +01:00
Sheraff
5ebce5532b
chore(e2e): the Rsbuild e2e apps and examples use the catalog @rsbuild/core
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>
2026-10-29 21:02:24 +01:00
Sheraff
3090daf893
test: source-map tests assert the map holds the user's file
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>
2026-10-29 20:59:19 +01:00
Sheraff
01ec45e428
fix(router-plugin, start-plugin-core): webpack-family source maps hold the compiled files' text
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>
2026-10-29 20:59:19 +01:00
Sheraff
8ec665dd38
perf(compiler): the orphan cleanup rejects a live binding first
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>
2026-10-29 20:55:53 +01:00
Sheraff
f3e717092e
docs(compiler): the README maps placement's stages, freeze, edges and the orphan cleanup
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 20:55:53 +01:00
Sheraff
bcc0c2361b
perf(compiler): yield in dev for a module's own imports only
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>
2026-10-29 20:55:53 +01:00
Sheraff
6021617f4a
fix(planners): remove object properties with the core's list helper
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>
2026-10-29 20:55:53 +01:00
Sheraff
a0cbe4dd1a
refactor(compiler): export the comma-aware list-item removal
`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>
2026-10-29 20:55:53 +01:00
Sheraff
cb3de3a10e
refactor(planners): leave function-scope orphans to the core
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>
2026-10-29 20:55:53 +01:00
Sheraff
b853bc112c
refactor(compiler): the core cleans up function-scope orphans once
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>
2026-10-29 20:55:53 +01:00
Sheraff
80f9b3952c
fix(compiler): a merged edge is located at the import that reads a binding
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>
2026-10-29 20:55:53 +01:00
Sheraff
ba7d7eca39
fix(compiler): one source-edges builder for Tier 0 and Tier 1
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>
2026-10-29 20:55:53 +01:00
Sheraff
3b8d54851c
refactor(planners): word the core's kept-declaration warnings
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>
2026-10-29 20:55:53 +01:00
Sheraff
13528935d2
refactor(compiler): split AnalysisPlan into plan, kept diagnostics and freeze
`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>
2026-10-29 20:55:53 +01:00
Sheraff
5e88a91c81
refactor(compiler): stage computePlacement
`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>
2026-10-29 20:55:53 +01:00
Sheraff
fa61e70966
test: guard production bundles and Solid's cold start against the dev hot slot
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>
2026-10-29 20:38:28 +01:00
Sheraff
1eafa3c13c
fix(router-core): a kept hot import clears the failure the lazy wrapper held
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>
2026-10-29 20:36:26 +01:00
Sheraff
56a1b66982
test(router-plugin): a fixed split chunk shows after a failed hot import
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>
2026-10-29 20:36:26 +01:00
Sheraff
2daca8cc19
test(router): pin the lazy hot slot's remaining transitions
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>
2026-10-29 20:12:57 +01:00
Sheraff
11091edb0c
refactor(router-plugin): the round records split components without a type of their own
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>
2026-10-29 20:12:56 +01:00
Sheraff
7839ca3944
test(router-plugin): run the split-loader routes on Rsbuild too
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>
2026-10-29 19:58:28 +01:00
Sheraff
c03e696f3e
test(start-plugin-core): planner tests check names by shape, not by spelling
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>
2026-10-29 19:57:51 +01:00
Sheraff
e2e9da916b
test(router): drop in-process route HMR tests real pages cover
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>
2026-10-29 19:48:34 +01:00
Sheraff
a54a23c0bd
refactor(router-core): one dev-only hot slot for the lazy route components
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>
2026-10-29 19:37:06 +01:00
Sheraff
4937c2d53e
refactor(router-plugin): route HMR marks the split chunks' components
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>
2026-10-29 19:30:54 +01:00
Sheraff
51d60d525e
test(start-plugin-core): Start's router options follow one rule on Vite and Rsbuild
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>
2026-10-29 19:28:26 +01:00
Sheraff
f0d3f474f8
refactor(compiler): drop the planner prepare phase
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>
2026-10-29 19:24:21 +01:00
Sheraff
abc50176da
refactor(router-plugin): one router planner, configured by one builder
`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>
2026-10-29 19:24:13 +01:00
Sheraff
b25a528bc4
refactor: lint follow-ups of the cleanup (the last dependency kind, Vite's resolved sourcemap option)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 18:25:47 +01:00
Sheraff
1a2f262bf4
refactor(compiler): no export on declarations only their own module uses
The compiler core and Start's compiler code this PR added; main's
exports stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 18:21:47 +01:00
Sheraff
0bd5e9e9f5
refactor(import-protection): no export on declarations only their own module uses
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 18:21:47 +01:00
Sheraff
f38121c4ac
docs: Rsbuild compiler architecture, router plugin skill and planner docs say what the code does
- 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>
2026-10-29 18:18:09 +01:00
Sheraff
ec299aecdd
docs: source, docs and test comments explain instead of citing ruling numbers
Maintainers do not have the decision log the numbers point into.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 18:16:24 +01:00
Sheraff
0c8661664c
test(import-protection): comments say what they cite instead of a ruling number
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 18:16:24 +01:00
Sheraff
f565bb56cc
test: known-bug pins that passed become plain tests; KNOWN-BUGS lists the remaining pins
- 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>
2026-10-29 18:14:40 +01:00
Sheraff
4d9e394197
chore(react-start-rsc): drop the test:unit target that ran no file
Its budget and oracle listing go too; test:noncompiler and
test:integration cover the package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 18:14:40 +01:00
Sheraff
1528ffe8e1
chore(compiler-test-utils): drop helpers only their own controls used, and unread result fields
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>
2026-10-29 18:14:40 +01:00
Sheraff
58ceca8968
chore: drop tsconfig excludes of deleted snapshot and fixture directories
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 18:04:14 +01:00
Sheraff
c88e25f9c7
refactor(router-generator): one event classification, leaner tree model, imports under the header
- 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>
2026-10-29 18:04:09 +01:00
Sheraff
5956ae5c3d
refactor(import-protection): drop unread decide reports, judged origin and reporter knobs
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>
2026-10-29 17:58:42 +01:00
Sheraff
7db924cb4d
refactor(start-plugin-core): drop unread Start compiler options, facts and fields
- 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>
2026-10-29 17:57:19 +01:00
Sheraff
031dcc2c14
fix(router-core): one refresh per split-loader edit on webpack-style hosts
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>
2026-10-29 17:48:57 +01:00
Sheraff
55fee0217b
refactor(router-core): the lazy wrapper's hot slot holds its first importer; HMR types only on /hmr
- 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>
2026-10-29 17:47:46 +01:00
Sheraff
f05bbac1bf
fix(router-plugin): the router planners read the route registry from HostServices.routes
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>
2026-10-29 17:47:40 +01:00
Sheraff
4218125603
refactor(router-plugin): the React refresh export list names module-level bindings only
Function locals can be neither exports nor glue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:41:43 +01:00
Sheraff
38771ea4aa
refactor(router-plugin)!: derive the route HMR style from the host; remove plugin.hmr.style
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>
2026-10-29 17:40:56 +01:00
Sheraff
ad6d556af3
refactor(router-utils): drop PolicyContext.memo and CompileOutput.fingerprint
Neither has a production reader since import protection stopped using them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:37:58 +01:00
Sheraff
ac906657b7
refactor(router-plugin): drop unread planner facts, recognition fields and dead host guards
- 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>
2026-10-29 17:36:14 +01:00
Sheraff
d5267cbea3
refactor(compiler): drop the Edit.reason debug label
Written at every edit, read by nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:36:14 +01:00
Sheraff
321d8c20ff
test(start-plugin-core): import-protection test hosts follow the core's EnvInfo and HostServices
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:36:14 +01:00
Sheraff
9411b943c6
refactor(router-utils): drop the compiler core's unread fields, hooks and fingerprints
- 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>
2026-10-29 17:36:14 +01:00
Sheraff
5035c8161d
fix(import-protection): dev log: 'always' asks onViolation at every compile, cached plans included
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>
2026-10-29 17:27:19 +01:00
Sheraff
46208974c0
test(import-protection): the bundler witness rows in Vite full-bundle dev
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>
2026-10-29 17:05:02 +01:00
Sheraff
0f1aef15c0
fix(import-protection): Rsbuild dev log: 'always' reports a kept import SWC keeps on every compilation
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>
2026-10-29 17:02:32 +01:00
Sheraff
da12a6f6ba
perf(start-plugin-core): one server chunk for the router and server-fn providers on Rsbuild
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>
2026-10-29 16:19:08 +01:00
Sheraff
c963c2584f
chore(router-utils): bump yuku to 0.26.0
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>
2026-10-29 14:15:55 +01:00
Sheraff
78db3da6c3
test(router-utils): the overlapping-save and in-flight tests wait on their suspension, not on 5 ms
(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>
2026-10-29 12:19:17 +01:00
Sheraff
e80188ee7b
fix(compiler): a dynamic import is an edge only of the outputs rendering it
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>
2026-10-29 10:33:00 +01:00
Sheraff
290b524121
fix(start-plugin-core): a dev client server fn stub names its file's revision
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>
2026-10-29 10:11:31 +01:00
Sheraff
281a9967ea
perf(router-utils): compiler source maps carry no sourcesContent
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>
2026-10-29 09:20:43 +01:00
Sheraff
1e4ceea5c8
test(router-utils): the lazy handler module counts as an importing output in verify (d)
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>
2026-10-29 04:40:42 +01:00
Sheraff
b93cd59c46
fix(compiler): a claimed region in a statement placement drops still renders in its owner
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>
2026-10-29 04:40:42 +01:00
Sheraff
774eba05a4
test(start): a server fn nested in a handler is registered on the server envs only
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>
2026-10-29 03:11:05 +01:00
Sheraff
ebfb3c6934
perf(compiler): a frozen plan keeps its planner facts instead of a JSON copy
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>
2026-10-29 03:08:06 +01:00
Sheraff
8c16be0f50
perf(start): orphaned declarations are cleaned only after a start-env edit
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>
2026-10-29 03:03:20 +01:00
Sheraff
7cf96fc3ec
perf(compiler): raw facts list a module's imports in linear time
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>
2026-10-29 03:03:20 +01:00
Sheraff
384ae08dbd
perf(compiler): a leading comment is no statement-start hazard
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>
2026-10-29 03:03:20 +01:00
Sheraff
f5851f2578
refactor(compiler): delete unread ROUTE_HMR and Chain.headValue; one dependents-index row per path per compile
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>
2026-10-29 03:03:20 +01:00
Sheraff
8af98f0c75
docs(import-protection): erasable imports are judged by what the bundler keeps
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 01:17:31 +01:00
Sheraff
1ad9091a26
perf(import-protection): locate without Vite's identity map; edge-module code on demand
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>
2026-10-29 01:17:30 +01:00
Sheraff
b8e1b6b781
fix(import-protection): Rsbuild dev builds edge modules restored from the persistent cache again
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>
2026-10-29 01:17:30 +01:00
Sheraff
4dccdda6fa
fix(import-protection): the bundler witnesses TypeScript-erasable edges; delete the tsconfig reader
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>
2026-10-29 01:17:14 +01:00
Sheraff
6aee39014f
fix(compiler): hoisted imports are no effect before or after a cluster
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>
2026-10-28 23:51:06 +01:00
Sheraff
6e14f8610e
refactor(compiler): delete dead and duplicated code, do less work per compile
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>
2026-10-28 23:51:06 +01:00
Sheraff
8acadc9590
test(compiler): delete the R77 identity pins, assert warnings by position, align prose
- 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>
2026-10-28 22:53:50 +01:00
Sheraff
075ec32142
fix(hosts): one invalidation per change, registry changes reach symlinked and un-planned route files, shared tsconfig reader
- 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>
2026-10-28 22:53:50 +01:00
Sheraff
64261766ea
fix(compiler): one purity seeding, empty defaultBehavior, live mutation view, nested server-fn order, opaque digests
- `#__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>
2026-10-28 22:53:50 +01:00
Sheraff
b9c8d90e16
Merge P1 (per-environment analysis resolution memo; dev yields per resolution): t3/share-analysis-resolutions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 21:00:22 +01:00
Sheraff
62e109bcc9
perf(router-utils): memoise analysis resolutions per environment while the file set is unchanged
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>
2026-10-28 20:51:19 +01:00
Sheraff
8dd710425a
Merge origin/compiler-rewrite/yuku (8ac76eda00) into R79 (pure router APIs)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 20:11:24 +01:00
Sheraff
98ff8c8282
refactor(router-utils, router-plugin): R79 recognises the router's pure APIs by binding only; app re-exports are not followed
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>
2026-10-28 20:02:39 +01:00
Sheraff
8ac76eda00
chore: format KNOWN-BUGS.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 19:51:43 +01:00
Sheraff
f471145e26
Merge allocation cuts (lazy import-protection locations; marker-only raw facts; dependencies opaque to summaries; no parentOf on hot paths): t3/reduce-compiler-allocations
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 19:36:50 +01:00
Sheraff
6ae5eba70e
docs(start-plugin-core): changeset note for the import-protection and raw-facts build-time changes
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-28 19:01:28 +01:00
Sheraff
d8b59f7258
feat(router-plugin, start-plugin-core): the router's pure APIs are no effect in route modules (R79)
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>
2026-10-28 18:40:34 +01:00
Sheraff
69eec67ff7
feat(router-utils): calls of known packages' pure exports are pure, by binding and through re-exports (R79)
`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>
2026-10-28 18:40:34 +01:00
Sheraff
b3f396be2e
perf(start-plugin-core): ordinary packages are opaque to the summaries, as designed
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>
2026-10-28 18:27:52 +01:00
Sheraff
a27b8ec72e
perf(router-utils): raw facts answer a marker query from the text; tier 0 asks less of Yuku
- 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>
2026-10-28 18:15:45 +01:00
Sheraff
7ce6acad5b
fix(router-utils): the order warning of several declarations reads "runs after them"
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 18:02:34 +01:00
Sheraff
199dc861eb
feat(router-utils): the order warning suggests the least effortful fix first
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>
2026-10-28 17:56:50 +01:00
Sheraff
e6d37f3b02
perf(start-plugin-core): import protection locates only reported violations; trace steps are located from the raw file
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>
2026-10-28 17:50:39 +01:00
Sheraff
c9d95f4342
test(router-plugin, start-plugin-core): split-only declarations a later effect pins warn once in every host; docs
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>
2026-10-28 17:45:56 +01:00
Sheraff
947d88228b
fix(start-plugin-core): Rsbuild reports two warnings of one reason in a file once each
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>
2026-10-28 17:45:56 +01:00
Sheraff
23f0c3351c
feat(router-utils): report a declaration only split code needs that the movable rules keep in the route module
`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>
2026-10-28 17:45:56 +01:00
Sheraff
53bc453abf
docs(router): a top-level side effect stays in the route file when a later one does
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>
2026-10-28 17:06:56 +01:00
Sheraff
021eb401a6
fix(router-plugin): a split chunk declares an imported option value instead of re-exporting it
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>
2026-10-28 16:38:24 +01:00
Sheraff
5e46d23c5f
fix(solid-router): keep MatchInner's componentKey a const so production output folds as before
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>
2026-10-28 16:33:11 +01:00
Sheraff
a5cdd910f9
fix(router-generator): a physical() mount of the root route file's directory keeps that file the root route only
`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>
2026-10-28 16:29:22 +01:00
Sheraff
064d29003a
fix(router-utils): a cluster holding a region another output claims is never copied
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>
2026-10-28 12:58:15 +01:00
Sheraff
dae5d4f7af
docs(router-plugin): why Rolldown < 1.1.5 is not pinned in the exported-bindings build matrix
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-28 12:44:17 +01:00
Sheraff
7c7bdbc491
docs(start-plugin-core): changeset note for split exported bindings and the eager-export build warning
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-28 12:40:20 +01:00
Sheraff
d2cbb39abc
perf(compiler-perf): react-start-deps variant with a large generated dependency graph
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>
2026-10-28 12:39:45 +01:00
Sheraff
c60a143aa3
test(router-plugin): exported bindings stay lazy in every bundler and chunking configuration; copied-identity rows become pins
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>
2026-10-28 12:39:45 +01:00
Sheraff
e97a6e068b
feat(start-plugin-core): warn after a client build when an extracted export landed in an entry chunk, in every host
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>
2026-10-28 12:39:45 +01:00
Sheraff
bc9462c684
feat(router-utils): a split chunk copies a pure extracted export instead of importing its module (R77)
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>
2026-10-28 12:39:45 +01:00
Sheraff
71084a1607
docs(router-utils): keep an inline code span on one line
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 10:49:55 +01:00
Sheraff
bf92273f99
Merge Start host dependency filter (one scope rule for both hosts; asset queries; no no-op rewrites): t3/start-vite-host-filter
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 10:47:35 +01:00
Sheraff
9e1c8c1944
docs(router-utils): a read synthesised from a name binds only to a runtime value
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-28 10:18:55 +01:00
Sheraff
af2d6a3f5d
perf(start-plugin-core): compile a dependency only when it uses Start, in both hosts
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>
2026-10-28 10:17:20 +01:00
Sheraff
8aa18c218d
fix(router-utils): an asset is never read as code, and an unchanged module is its input
- `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>
2026-10-28 10:17:20 +01:00
Sheraff
abebb4013d
fix(router-utils): a destructuring pattern losing every property keeps its braces
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>
2026-10-28 10:14:07 +01:00
Sheraff
0981a86bfd
fix(router-utils): a read synthesised from a name never binds to a type-only declaration
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>
2026-10-28 10:14:07 +01:00
Sheraff
390ca815c3
fix(router-utils): a type-only import stays type-only next to a value of the same name
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>
2026-10-28 02:58:52 +01:00
Sheraff
2dbc6f63db
test(router-plugin): a type-only import whose name a split component also declares stays type-only
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>
2026-10-28 02:49:48 +01:00
Sheraff
b25984c166
feat(router-utils): an exported binding leaves with its augmentations
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>
2026-10-28 01:10:06 +01:00
Sheraff
ce40af0b5b
perf(router-utils): placement does less bookkeeping
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>
2026-10-28 00:48:14 +01:00
Sheraff
60196b62ad
perf(router-utils): placement read caches keyed by output and member, not by string
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>
2026-10-28 00:37:42 +01:00
Sheraff
3bd46fdc2c
Merge structural pass (one mutation model; evaluation-based laziness; fallback rounds to the bound; TSR_COMPILER_VERIFY): t3/compiler-mutation-model-structural-pass
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 00:23:36 +01:00
Sheraff
ebac639f59
test(router-utils): an output holds an effect unit by any segment from its range
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>
2026-10-28 00:22:57 +01:00
Sheraff
4065144959
perf(router-utils): one reference shape, mutable readers precomputed
`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>
2026-10-28 00:15:07 +01:00
Sheraff
811a1cca5e
docs(router-plugin): what happens when re-planning does not settle
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-27 23:45:04 +01:00
Sheraff
d03c8c1327
perf(router-utils): the mutation model and the eagerness test cost nothing on the common module
- `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>
2026-10-27 23:43:20 +01:00
Sheraff
8f9d9f9fc0
docs(compiler-test-utils): the Rspack HMR new-async-chunk gap is still present on 2.2.9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:35:35 +01:00
Sheraff
96e5e1f9e6
test(router-plugin): unparsed route row uses a grammar error SWC 2.2.9 still accepts
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>
2026-10-27 23:32:52 +01:00
Sheraff
cff83b02e1
Merge remote-tracking branch 'origin/compiler-rewrite/yuku' into t3/compiler-mutation-model-structural-pass 2026-10-27 23:26:21 +01:00
Sheraff
775f11588c
perf(router-utils): cheaper benign check and lazy mutable-read cache
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>
2026-10-27 23:26:21 +01:00
Sheraff
ff6eefe8be
test(router-utils): verify every emitted output against the plan's invariants
`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>
2026-10-27 23:23:51 +01:00
Sheraff
f9ab025647
fix(router-utils): re-plan until no new region falls back
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>
2026-10-27 23:23:51 +01:00
Sheraff
5a6b1de631
refactor(router-utils): one mutation model behind every placement rule
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>
2026-10-27 23:23:51 +01:00
Sheraff
fdbf5ac4fb
chore(changeset): RSC CSS HMR on Rsbuild needs @rspack/core >= 2.2.9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:23:28 +01:00
Sheraff
9146f10e17
Merge R74 (Rsbuild 2.2.14 / Rspack 2.2.9: MultiCompiler stale-done fix): t3/362bbafa 2026-10-27 23:23:23 +01:00
Sheraff
a34b89ad06
fix(router-utils, router-plugin): hot updates follow the core's extraction decision
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>
2026-10-27 23:10:30 +01:00
Sheraff
d1a79d798a
chore(deps): bump @rsbuild/core to 2.2.14 and @rspack/core to 2.2.9
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>
2026-10-27 23:05:41 +01:00
Sheraff
d974344a7e
Merge HMR consistency fuzz fixes: t3/hmr-consistency-fuzzing
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:02:26 +01:00
Sheraff
62cc7af08c
fix(router-plugin, start-plugin-core): a file's hot update is of the modules its current plan produces
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>
2026-10-27 22:27:48 +01:00
Sheraff
39dc07b190
style(router-plugin): import order
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-27 22:13:48 +01:00
Sheraff
88371854f7
chore: changeset for the dev HMR fixes
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-27 22:13:26 +01:00
Sheraff
4f39cda524
fix(router-plugin): refresh id of an extracted component names its module
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>
2026-10-27 22:13:26 +01:00
Sheraff
bc02318ab7
fix(router-plugin, start-plugin-core): hot updates stay in place after a route file's layout changes
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>
2026-10-27 22:13:26 +01:00
Sheraff
6a4baf9d21
fix(router-utils): a file that stops parsing keeps its last facts
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>
2026-10-27 22:13:26 +01:00
Sheraff
46bcd8c45f
Merge consolidation 2 per second coherence review (one predicate per placement rule; RSC nested server fn row): t3/compiler-consolidation-pass
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 22:05:10 +01:00
Sheraff
dc3eb69feb
test(react-start-rsc): a server fn nested in a function only the split component calls
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>
2026-10-27 21:55:49 +01:00
Sheraff
6e28afea28
refactor(router-utils): one predicate per placement rule
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>
2026-10-27 21:55:49 +01:00
Sheraff
bc924e0292
fix(router-generator): only edit the route files the tree imports
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>
2026-10-27 21:55:36 +01:00
Sheraff
3e8957b64c
fix(router-generator): report files of one module used for two routes
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>
2026-10-27 21:37:39 +01:00
Sheraff
92e3b68232
fix(router-generator): keep __root.tsx the root route next to a __root/ directory
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>
2026-10-27 21:37:39 +01:00
Sheraff
0bb4250350
Merge R73 (keep imports a route module never read): t3/preserve-import-provenance
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 21:05:23 +01:00
Sheraff
cdabb2e818
fix(router-utils): keep imports a route module never read
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>
2026-10-27 20:27:34 +01:00
Sheraff
1e8c372018
style(start-plugin-core): import order
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 19:13:13 +01:00
Sheraff
c8208bcb50
refactor(start-plugin-core): keep providerEnvironmentName on the Vite options only
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 19:11:39 +01:00
Sheraff
5599b21f98
refactor(start-plugin-core): drop Rsbuild support for a server-fn provider environment other than ssr
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>
2026-10-27 19:09:36 +01:00
Sheraff
e86561c2aa
refactor(router-utils): drop OutputBuilder's unused tokenStarts option
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 19:07:35 +01:00
Sheraff
8d7caead8e
Merge coverage gaps (targeted tests for unreached areas; delete proven-dead helpers): t3/compiler-coverage-gaps
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 18:58:10 +01:00
Sheraff
beb3029bbc
refactor: drop compiler code no input can reach
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>
2026-10-27 18:34:04 +01:00
Sheraff
885e105f19
fix(router-utils): keep what an extracted export's module would read before the route module initialises it
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>
2026-10-27 18:28:30 +01:00
Sheraff
5bfb9482d8
test(router-generator): cover namespace-imported constructors and an empty route id
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 18:00:42 +01:00
Sheraff
fe1a3cc6b1
test(router-plugin): cover writer fallbacks and namespace-imported route factories
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>
2026-10-27 18:00:42 +01:00
Sheraff
13c0a7661d
test(start-plugin-core): cover nested server fn refusals, id paths, top-level for await, sideEffects lists, Hydrate new.target
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>
2026-10-27 18:00:42 +01:00
Sheraff
f622474145
Merge consolidation per coherence review (one reach fixed point, core claim rule, shared host helpers): t3/compiler-consolidation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:21:53 +01:00
Sheraff
52ffd18489
perf(router-utils): keep the consolidated placement and claim rules allocation-free on hot paths
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>
2026-10-27 17:20:48 +01:00
Sheraff
86bd7d8cc2
docs(router-utils): document the placement fixed point, the dead-pure refinement and the stats test contract
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>
2026-10-27 16:45:55 +01:00
Sheraff
1a9a4727b1
refactor(start-plugin-core): one final-build predicate and one registry publication guard
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>
2026-10-27 16:44:23 +01:00
Sheraff
190034678c
refactor(router-utils): one owner for claim overrides, fallback lookups, member writes and ASI
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>
2026-10-27 16:41:12 +01:00
Sheraff
e2d3a89064
fix(router-utils): decide env roots, movable clusters and extraction in one fixed point
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>
2026-10-27 16:28:36 +01:00
Sheraff
7afd589bc3
fix(router-core): reload on a route update after a router boundary caught a render error
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>
2026-10-27 16:26:46 +01:00
Sheraff
6eae7b5727
test(start-plugin-core): the Solid Start fix-after-throw edit test waits for the throw only
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>
2026-10-27 14:42:58 +01:00
Sheraff
5a18f0bc46
test(start-plugin-core): a Solid Start route edit that fixes a component that threw in the browser shows
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>
2026-10-27 14:42:58 +01:00
Sheraff
eedc638e42
Merge R66 (lazy server-fn handlers without double run): t3/lazy-server-function-handlers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 11:09:42 +01:00
Sheraff
350e0c8e16
fix(router-plugin): declare each split importer right before its first reader
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>
2026-10-27 10:18:48 +01:00
Sheraff
834383879c
docs(start-plugin-core): server fn handler modules of the in-place provider
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:55:16 +01:00
Sheraff
eeaab83baa
test(start-plugin-core): handler modules load on the first call in Vite and Rsbuild dev, Vue SFC builds
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>
2026-10-27 09:54:14 +01:00
Sheraff
58e6778f05
fix(router-utils): move an effectful declaration reading a const the route module keeps (R67)
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>
2026-10-27 09:51:10 +01:00
Sheraff
6d29132425
feat(start-plugin-core): load server fn handlers on the first call, without running their module twice
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>
2026-10-27 09:47:03 +01:00
Sheraff
d5a1326106
test(start-plugin-core): a server fn handler's server-only imports load on the first call in SSR
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>
2026-10-27 09:35:07 +01:00
Sheraff
552cad5bed
test: effect order of effectful clusters moving with a split component or a handler (R64, R65)
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>
2026-10-27 09:33:06 +01:00
Sheraff
3710b36e86
fix(router-utils): move an effectful declaration whose import code that stays also reads; check effects after its first effect
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>
2026-10-27 09:33:06 +01:00
Sheraff
b12dcc52b8
test(router-plugin): a page-only effectful declaration moves even when the route module uses its import
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>
2026-10-27 09:26:45 +01:00
Sheraff
8d3eb88e57
fix(router-utils): clean a chain of orphaned local declarations of any length
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>
2026-10-27 08:59:12 +01:00
Sheraff
b6f7617ac0
fix(router-utils): keep the ; a statement starting with ( relies on
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>
2026-10-27 08:59:12 +01:00
Sheraff
9f1abe68ee
fix(router-utils): decide extracted exports over the final env module
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>
2026-10-27 08:59:12 +01:00
Sheraff
748abef4bb
test: effect order of effectful declarations moving with a split component or a handler
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>
2026-10-27 00:56:51 +01:00
Sheraff
4747c62574
fix(router-utils): a later effect moving to the same chunk does not pin an effectful declaration
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>
2026-10-27 00:56:51 +01:00
Sheraff
8973f6df98
test(router-plugin): every effectful declaration only the split component reads moves with it
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>
2026-10-27 00:47:05 +01:00
Sheraff
87df4006f9
test(start-plugin-core): measure the environment release in a process of its own
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>
2026-10-26 23:42:52 +01:00
Sheraff
a0f49b4ae6
test(router-plugin): import the registry publication test's plugin from src
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>
2026-10-26 23:42:52 +01:00
Sheraff
5ff36a1816
test(start-plugin-core): a fresh host page run opens a new page instead of reloading
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>
2026-10-26 23:02:03 +01:00
Sheraff
e43c275264
test(router-plugin): expect the registry's posix-form route paths (Windows)
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>
2026-10-26 23:02:03 +01:00
Sheraff
76ddec27f3
style(start-plugin-core): format environment release test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 21:22:11 +01:00
Sheraff
21ff64c85b
Merge HMR scaling (an unchanged route registry notifies no subscriber): t3/investigate-hmr-scaling-1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 21:21:42 +01:00
Sheraff
b46944e54e
perf(router-plugin,start-plugin-core): an unchanged route registry notifies no subscriber
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>
2026-10-26 21:03:32 +01:00
Sheraff
fdc48254c8
chore: changeset for releasing finished environments' compiler state
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 20:29:52 +01:00
Sheraff
f458f58452
fix(start-plugin-core,router-plugin): release a finished environment's compiler state in production builds
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>
2026-10-26 20:03:38 +01:00
Sheraff
d0cb0e3ff6
test(router-plugin): a type annotation naming the split component does not share it
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>
2026-10-26 18:50:09 +01:00
Sheraff
d3b5610202
Merge R63 (route CSS stays in the route module, as on main): t3/revert-route-css-splitting
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 18:50:09 +01:00
Sheraff
4e64540605
Merge Lane P2 (plan/raw-facts cache path index, Vue Start dev cold start): t3/index-plan-cache-keys
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 18:50:09 +01:00
Sheraff
c271282ac5
fix(start-plugin-core,vue-start): dev cold start hydrates without a stranded page or a reload
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>
2026-10-26 18:12:02 +01:00
Sheraff
6e6340af98
perf(router-utils): index plans and raw facts by path for invalidation
`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>
2026-10-26 17:58:14 +01:00
Sheraff
8604d60abc
test(router-plugin): a CSS module import follows the split component that reads it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:49:33 +01:00
Sheraff
2a31d358e6
docs: route CSS loads with the route module, as on main (R63)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:40:19 +01:00
Sheraff
9a3b7cd37b
test(start-plugin-core): pin the route-module CSS rows again (R63)
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>
2026-10-26 17:40:19 +01:00
Sheraff
076c65aab4
fix(router-plugin): keep route CSS imports in the route module (R63)
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>
2026-10-26 17:40:19 +01:00
Sheraff
6b90fe7291
test(router-plugin): give the exported-component split-or-report cases a dev server of their own
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>
2026-10-26 15:23:31 +01:00
Sheraff
c48101f982
test(compiler-test-utils,start-plugin-core): ignore the browser's favicon 404; bound the dev-edit page runs
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>
2026-10-26 15:15:30 +01:00
Sheraff
735b19517b
fix(start-plugin-core): path-separator-agnostic import-protection tests and harness graph walks (Windows)
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>
2026-10-26 15:15:30 +01:00
Sheraff
979c40de72
Merge Lane CI (Compiler Platforms setup, Windows links, plugin-order gate, library-build generateBundle, compiler-tier parallelism): t3/compiler-rewrite-ci-fixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 14:58:36 +01:00
Sheraff
e965af61e5
Merge R60 (keep root route options in the root module): t3/keep-root-routes-unsplit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 14:58:36 +01:00
Sheraff
01d23f0d77
Merge Lane M2 (hmr write spacing, (file:line:col) diagnostics, core coverage + isPureClass fix, route trees): t3/fix-hmr-refresh-diagnostics
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 14:58:36 +01:00
Sheraff
d8f137396c
test(router-plugin): give the imported-options route a dev server of its own
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>
2026-10-26 13:40:07 +01:00
Sheraff
25888f0c7b
test(router-generator): match the fixture inputs against Vite's forward-slash ids (Windows)
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>
2026-10-26 13:24:48 +01:00
Sheraff
c91fc9081e
chore(examples): regenerate route trees through the example builds
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-26 13:18:57 +01:00
Sheraff
de07630430
fix(router-utils): drop a pure function-local class only erased code read; test the core's small modules
`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>
2026-10-26 13:18:57 +01:00
Sheraff
a9d8cf52f6
fix(start-plugin-core,router-plugin): position loader diagnostics as (file:line:col) like the Vite host
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>
2026-10-26 13:18:57 +01:00
Sheraff
d807aadb07
fix(e2e-utils): space successive writes of one file past the watcher's change throttle
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>
2026-10-26 13:18:57 +01:00
Sheraff
ecfde7c2f4
fix(router-plugin): keep root route options in the root module
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>
2026-10-26 13:18:45 +01:00
Sheraff
64b41c0fb9
test(compiler-test-utils,router-generator): link the test apps' node_modules with symbolic links, not junctions (Windows)
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>
2026-10-26 13:11:52 +01:00
Sheraff
a10cb4a844
fix(router-plugin): check the Vite plugin order only with autoCodeSplitting, as before
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>
2026-10-26 13:11:52 +01:00
Sheraff
c637549e37
test(router-plugin,router-generator): tolerate the browser's favicon request and slow CI runners
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>
2026-10-26 12:40:16 +01:00
Sheraff
5397c6b950
test(router-plugin,start-plugin-core): run the compiler tiers alone and size their workers to the machine
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>
2026-10-26 12:29:30 +01:00
Sheraff
fad6bf1252
fix(router-plugin): skip external imports in the end-of-build eager-export report
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>
2026-10-26 12:29:30 +01:00
Sheraff
aa994c9ea9
fix(examples): put the router plugin before the framework plugin in the router-monorepo examples
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>
2026-10-26 12:29:30 +01:00
Sheraff
e8d1bded54
test(router-generator): compare fixture paths in their native real form (Windows)
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>
2026-10-26 12:29:30 +01:00
Sheraff
17175c60ab
ci(compiler-platforms): install Chromium and the Start packages the compiler tiers need
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>
2026-10-26 12:29:30 +01:00
Sheraff
c4cb7e889a
fix(start-plugin-core): export stripQueryAndHash for the path-normalization test
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>
2026-10-26 10:23:15 +01:00
Sheraff
b3efe6e84b
chore(router-plugin): spell the vite peer range as >=6.0.0
The extra >=7.0.0 and >=8.0.0 alternatives are subsumed by >=6.0.0.

[final-head]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 10:17:35 +01:00
Sheraff
6cdcd3cdff
Merge Lane K1 (perf, path memo, harness race fix, edge keys, Rsbuild pin): t3/compiler-perf-and-bug-fixes
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>
2026-10-26 10:17:35 +01:00
Sheraff
760a4de1d8
Merge Lane K2 (leftovers, helper consolidation, comment rewrites, docs): t3/compiler-rewrite-final-cleanup
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 10:16:20 +01:00
Sheraff
422f3a0c41
test(start-plugin-core): type the page evaluate of the first-server-fn test for TS 5.6–5.9
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-26 10:13:06 +01:00
Sheraff
efa891c242
docs(compiler-test-utils): list the Rspack new-async-chunk hot-update pin in KNOWN-BUGS
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-26 10:08:44 +01:00
Sheraff
c9de799c43
test(start-plugin-core): pin a route's first server fn breaking its component chunk's hot update on Rsbuild
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>
2026-10-26 10:08:44 +01:00
Sheraff
e5bc284f27
perf(router-utils): edge keys spell their record's canonical JSON directly
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>
2026-10-26 10:03:11 +01:00
Sheraff
5f121e70fc
test(router-plugin): unpin the module-state row a type alias reads
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>
2026-10-26 09:54:14 +01:00
Sheraff
cd23b4c49a
test(router-plugin): import app files by the URL the dev server gives at import time
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>
2026-10-26 09:54:14 +01:00
Sheraff
556140f4d1
perf(start-plugin-core): bound the import-protection path memo
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>
2026-10-26 09:38:29 +01:00
Sheraff
ba4f635864
style(compiler): drop imports the deleted helpers left unused
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 09:32:34 +01:00
Sheraff
7369a14909
perf(router-utils): cheaper per-module compile work, same outputs
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>
2026-10-26 09:32:31 +01:00
Sheraff
bd50a3629d
docs(start-plugin-core): explain comments without citing internal design notes
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>
2026-10-26 09:30:13 +01:00
Sheraff
dd0fa2aeb1
docs(router-utils): explain comments without citing internal design notes
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>
2026-10-26 09:30:13 +01:00
Sheraff
cdc8e4ec71
docs(compiler): explain comments without citing internal design notes
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>
2026-10-26 09:28:49 +01:00
Sheraff
3e0356e907
docs(router-utils): document the compiler's debugging knobs
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>
2026-10-26 09:27:52 +01:00
Sheraff
39b9ee948b
chore(router-plugin): narrow the vite peer range to >=6
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>
2026-10-26 09:26:43 +01:00
Sheraff
df9128cf38
refactor(compiler): delete leftovers and consolidate duplicated helpers
- 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>
2026-10-26 09:24:57 +01:00
Sheraff
81b7803f94
fix(router-utils): rewrite the import assertion keyword, not a comment naming it
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>
2026-10-26 09:24:57 +01:00
Sheraff
a365ff8881
chore: drop unused devDependencies, the yuku release-age exclusion and a stale .gitignore entry
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>
2026-10-26 09:24:57 +01:00
Sheraff
4f4f2e848d
Merge Lane H1 (pre-merge review correctness): t3/compiler-rewrite-h1-correctness
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	packages/router-utils/src/compiler/pipeline.ts
2026-10-26 08:50:06 +01:00
Sheraff
05779e034d
Merge Lane G (breakage fixes): t3/fix-compiler-rewrite-breakages
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	packages/router-plugin/src/planners/split.ts
2026-10-26 08:49:33 +01:00
Sheraff
f3391a130a
fix(router-core): route HMR of a root route, which has no parent
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>
2026-10-26 00:50:11 +01:00
Sheraff
e3e8a4264c
Merge Lane F (final fixes): t3/compiler-final-fixes
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>
2026-10-26 00:43:10 +01:00
Sheraff
e3489ea98b
fix(router-utils): keep orphaned hook calls only; other server-only initialisers still leave
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>
2026-10-26 00:40:23 +01:00
Sheraff
80f2a86cd3
chore(start-plugin-core): drop imports the Hydrate orphan pass left behind
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-26 00:35:43 +01:00
Sheraff
aacf77026e
fix(router-plugin, start-plugin-core): split decisions for reassigned values and object-form loaders; Hydrate on the core orphan cleanup
- 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>
2026-10-26 00:33:57 +01:00
Sheraff
9299756dfe
fix(compiler): resolve derived ids by their importer only
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>
2026-10-26 00:26:46 +01:00
Sheraff
edfdc88082
fix(router-utils): core correctness fixes from the pre-merge review
- 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>
2026-10-26 00:20:40 +01:00
Sheraff
1f9db3db82
fix(compiler): warn once per file per build run on Rspack and webpack
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>
2026-10-26 00:19:28 +01:00
Sheraff
d84b065ee5
style(router-plugin): drop an unnecessary fallback on the resolved environments
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-26 00:18:00 +01:00
Sheraff
e734796e7d
ci(compiler): widen the platform smoke tier
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>
2026-10-26 00:16:42 +01:00
Sheraff
95e7929f04
test(router-plugin): smoke the plugin on Vite 6 and 7
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>
2026-10-26 00:16:42 +01:00
Sheraff
d662cbc23b
perf(router-core): re-read the route tree only when it re-executed
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>
2026-10-26 00:13:05 +01:00
Sheraff
359e44c816
Merge t3/compiler-dce-coverage: DCE orphan cleanup in compiler core
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 23:59:58 +01:00
Sheraff
b01bb76ee3
chore(compiler): require Node with require(esm) for the CommonJS builds, and say what changes in the changesets
`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>
2026-10-25 23:56:10 +01:00
Sheraff
78f7ffa246
fix(compiler): report modules the compiler cannot parse instead of passing them through
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>
2026-10-25 23:55:46 +01:00
Sheraff
48d58a4a9f
fix(compiler): compile modules under project paths with a #
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>
2026-10-25 23:55:46 +01:00
Sheraff
7c489abb73
test: route options with their parent route; import order in the Vite tree-rebuild test
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 23:49:25 +01:00
Sheraff
025e894f46
fix(router-plugin): deleteNodes takes destructured bindings only it read
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>
2026-10-25 23:27:22 +01:00
Sheraff
c5f44b8ff0
fix(router-utils, start-plugin-core): clean destructured and local orphans in the compiler core
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>
2026-10-25 23:27:22 +01:00
Sheraff
b256de52f5
docs(router-utils): describe the file-set version in the compiler README and changeset
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 23:13:25 +01:00
Sheraff
a9d4ec3550
perf(router-utils): re-resolve a plan's resolutions only after the file set changed
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>
2026-10-25 23:12:23 +01:00
Sheraff
45e3811865
chore(changesets): note the removed caches and the route HMR fix
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 23:08:41 +01:00
Sheraff
a078a90f90
fix(router-core): route HMR updates the route a rebuilt route tree holds
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>
2026-10-25 23:07:53 +01:00
Sheraff
468ecbd88c
style(benchmarks): format heap-diff script
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 22:56:24 +01:00
Sheraff
2c931e6b08
Merge origin/main into t3/yuku-compiler-rewrite
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>
2026-10-25 22:56:24 +01:00
Sheraff
9efdc23d96
refactor(router-utils): drop the resolution cache and the emitted-output memo (R54)
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>
2026-10-25 22:32:31 +01:00
Sheraff
c69e7c6f41
Merge t3/compiler-cache-soak-validation: bounded compiler caches and soak validation
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>
2026-10-25 22:09:31 +01:00
Sheraff
f1ec056321
Merge t3/compiler-dependency-perf-cleanups: dependency and perf cleanups
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 21:55:55 +01:00
Sheraff
e561d38329
revert(start-plugin-core): keep exsolve for entry lookups, without its cache
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>
2026-10-25 21:54:43 +01:00
Sheraff
269871fb54
revert(router-plugin, start-plugin-core): import remapping statically again
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>
2026-10-25 21:34:10 +01:00
Sheraff
bd451462fc
fix(benchmarks): retry reading a CPU profile Node is still writing
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 21:21:09 +01:00
Sheraff
72f73cc93f
feat(router-core): tooling entry for the build plugins' helpers
@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>
2026-10-25 21:21:09 +01:00
Sheraff
d907db3613
refactor(start-plugin-core): probe Start entries directly instead of exsolve
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>
2026-10-25 21:21:09 +01:00
Sheraff
3ba6e22aef
perf(router-generator, router-plugin, start-plugin-core): load jiti, remapping and lightningcss on first use
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>
2026-10-25 21:21:09 +01:00
Sheraff
a555aea4fc
perf(router-utils, start-plugin-core): one-shot crypto.hash for digests
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>
2026-10-25 21:21:09 +01:00
Sheraff
961109683f
chore(router-utils, router-plugin): drop dead exports and dependencies
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>
2026-10-25 21:20:56 +01:00
Sheraff
d55431ada6
Merge t3/compiler-pr-prep: consolidated changesets, user and maintainer docs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 20:14:09 +01:00
Sheraff
18ef570edc
chore(changeset): bounded compiler caches and marker-only target fingerprints
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 20:11:12 +01:00
Sheraff
c69c2dce6b
fix(compiler-perf): HMR scenario reports a missed edit instead of crashing
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 20:10:08 +01:00
Sheraff
42ff6ebe74
feat(compiler-perf): transform-off soak mode, crash-tolerant soak pages and knob runs; document soak and compiler knobs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 19:53:44 +01:00
Sheraff
f265506673
docs(router-utils, router-plugin, start-plugin-core): maintainer docs for the compiler core
- 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>
2026-10-25 19:50:37 +01:00
Sheraff
92645efe65
docs: behaviour changes of the compiler rewrite
- 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>
2026-10-25 19:50:19 +01:00
Sheraff
77713957cd
chore(changeset): one changeset per area for the compiler rewrite
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>
2026-10-25 19:44:34 +01:00
Sheraff
333f355110
Merge t3/compiler-watch-flake-root-cause: compiler watch flake root-cause fix
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

# Conflicts:
#	packages/router-utils/tests/pipeline.test.ts
2026-10-25 19:31:54 +01:00
Sheraff
9802977cf3
test(start-plugin-core): type the stats counters in the Rsbuild retention test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 19:25:29 +01:00
Sheraff
4493968b5e
test(compiler-test-utils): settle an Rsbuild edit only once Rspack handed its compiles on
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>
2026-10-25 19:24:41 +01:00
Sheraff
b5dbb9f609
fix(router-utils): no known package among a compile's dependency paths
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>
2026-10-25 19:24:41 +01:00
Sheraff
99bd9a4c29
test(start-plugin-core): Rsbuild retention regression test asserts no growth
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 19:22:46 +01:00
Sheraff
5cb7970706
fix(start-plugin-core): Rsbuild dev keeps compiler state of the compilation's files only
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>
2026-10-25 19:20:32 +01:00
Sheraff
05d29e05c4
Merge t3/compiler-correctness-perf-fixes: Lane C3a compiler correctness and perf fixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 18:56:00 +01:00
Sheraff
82f0dc35b7
feat(router-utils): emitted-output memo knob and cache use counters in compiler stats
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 18:46:09 +01:00
Sheraff
3417966136
fix(start-plugin-core): Rsbuild dev log: 'always' prints a repeated plan's violations once
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>
2026-10-25 18:44:57 +01:00
Sheraff
e08666bca3
Merge origin/compiler-tests/baseline: Rsbuild owed-compile wait, dev may answer any server fn
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>
2026-10-25 18:41:36 +01:00
Sheraff
8fd4458e52
fix(start-plugin-core): refuse client calls of server-only fns in production builds with a separate provider (R44)
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>
2026-10-25 18:36:47 +01:00
Sheraff
f37f173df7
test(compiler-test-utils): dev servers may answer any server fn by id
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>
2026-10-25 18:33:31 +01:00
Sheraff
7de8a06b19
chore(start-plugin-core): drop two unused bindings in the Hydrate planner
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 18:32:24 +01:00
Sheraff
ec4e15df2d
fix(router-plugin): keep a route callback that reads this in the route module (#8688)
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>
2026-10-25 18:32:09 +01:00
Sheraff
91e646571b
fix(router-utils): record the names a require() edge reads
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>
2026-10-25 18:32:09 +01:00
Sheraff
ec0cbf4496
chore(compiler-perf): heap diff by owner and constructor, recover stuck soak pages; router-utils import order
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 18:17:41 +01:00
Sheraff
7f6277edd9
fix(start-plugin-core): Rsbuild host reporting and hook details
- 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>
2026-10-25 18:15:46 +01:00
Sheraff
2210452c2a
fix(router-plugin): no refresh marker on an imported component
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>
2026-10-25 18:15:46 +01:00
Sheraff
a7eb8d0e1c
fix(start-plugin-core): Hydrate planner edge cases (recursive component, tag comments, Solid setters, refresh markers)
- 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>
2026-10-25 18:15:46 +01:00
Sheraff
6116bb58bf
fix(start-plugin-core): keep a nested server fn's chain in the env module of a separate provider (R50)
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>
2026-10-25 18:15:46 +01:00
Sheraff
9c6e73db90
Merge t3/fix-generator-rewrite-findings: fix generator rewrite findings
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 18:06:37 +01:00
Sheraff
523c880bff
perf(router-utils): index sub-region dedupe and hoisted-var item lookup
`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>
2026-10-25 18:05:42 +01:00
Sheraff
67f180cc10
fix(router-utils): re-validate each environment's fingerprints with its own resolver
`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>
2026-10-25 18:05:42 +01:00
Sheraff
537a3379ce
fix(router-utils): read env roots in the env module from chunks; keep sibling exports on a rename
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>
2026-10-25 18:05:42 +01:00
Sheraff
cd8792a75b
fix(start-plugin-core): remove orphaned declarators of one statement with one edit (R17)
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>
2026-10-25 18:05:42 +01:00
Sheraff
b58ddb87a3
chore(changeset): generator review fixes and Start router/Rsbuild options
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 17:58:20 +01:00
Sheraff
b99e3922a2
test(router-generator): type the reused-file cases table
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 17:53:53 +01:00
Sheraff
481607e0d6
fix(start-plugin-core): Rsbuild dev honours SPA mode and server.compress
- 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>
2026-10-25 17:50:44 +01:00
Sheraff
f1cbd5f514
fix(start-plugin-core): keep router.plugins and the route tree code style
- 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>
2026-10-25 17:47:34 +01:00
Sheraff
01c1f51cbd
fix(router-generator): say why a Route is not kept up
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>
2026-10-25 17:43:13 +01:00
Sheraff
f7269eb6ec
perf(router-generator): the generator's own route tree write no longer regenerates
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>
2026-10-25 17:41:45 +01:00
Sheraff
a0de933851
fix(router-generator): report route files used twice and routes with one id
- 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>
2026-10-25 17:40:30 +01:00
Sheraff
3bfb2a51c6
feat(compiler-perf): soak analysis, heap snapshot diff, cache knob runner; robust soak navigation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 17:39:56 +01:00
Sheraff
4283c9e269
fix(router-utils, start-plugin-core): bound compiler bookkeeping by the live plans and files
- 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>
2026-10-25 17:39:56 +01:00
Sheraff
6c67bc84a2
fix(router-generator): rewrite a route file's id when the config moves its route
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>
2026-10-25 17:37:13 +01:00
Sheraff
179d5ea152
chore(start-plugin-core): remove stray vitest output file committed by accident
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 17:26:07 +01:00
Sheraff
268f2ef0a4
Merge t3/rsbuild-cache-edge-modules: Rsbuild import protection with the persistent cache
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 17:25:55 +01:00
Sheraff
d1b1a33b04
chore(changeset): Rsbuild import protection with the persistent cache
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 17:24:00 +01:00
Sheraff
fa5a74ef49
fix(start-plugin-core): judge Rsbuild dev modules restored from the persistent cache again
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>
2026-10-25 17:15:29 +01:00
Sheraff
5751d64ac3
test(start-plugin-core): pin the Rsbuild client build's tsr-split/tss-hydrate query rules
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>
2026-10-25 17:12:02 +01:00
Sheraff
745c1a4207
fix(start-plugin-core): keep import-protection trace steps through Rsbuild restored modules
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>
2026-10-25 17:11:12 +01:00
Sheraff
80304b550a
feat(compiler-perf): soak scenario with compiler cache stats and heap snapshots
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 17:09:59 +01:00
Sheraff
b98a474343
feat(router-utils): compiler cache stats and cache knobs; fix(start): marker-only target fingerprints
- 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>
2026-10-25 17:09:59 +01:00
Sheraff
8aa581eb0f
fix(start-plugin-core): define Rsbuild import-protection edge modules from their request
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>
2026-10-25 17:05:55 +01:00
Sheraff
f78d5ffcb2
test(compiler-test-utils): wait for the compile Rspack still owes an Rsbuild edit
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>
2026-10-25 17:00:15 +01:00
Sheraff
53ea64a8ba
Merge t3/bundled-dev-hmr-import-fallback: route HMR falls back to the first importer on MissingFactoryError
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 16:11:35 +01:00
Sheraff
fe377ebe92
Merge t3/fix-yuku-compiler-regressions: Lane C2 compiler regression fixes, HMR /hmr subpaths, compiler-perf-harness-2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 16:11:31 +01:00
Sheraff
51941cd925
Revert "perf(start-plugin-core): import provider modules statically in Rsbuild production manifests"
This reverts commit 6ad10ee66e.
2026-10-25 15:51:21 +01:00
Sheraff
c6c5115489
Merge branch 't3/yuku-compiler-rewrite' into t3/fix-yuku-compiler-regressions 2026-10-25 15:37:52 +01:00
Sheraff
6ad10ee66e
perf(start-plugin-core): import provider modules statically in Rsbuild production manifests
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>
2026-10-25 15:37:46 +01:00
Sheraff
7cb045280c
perf(router-plugin, start-plugin-core): no pure annotation of split placeholders in server output
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>
2026-10-25 15:35:41 +01:00
Sheraff
e147fa5032
feat(start-plugin-core): warn once in development for a client call of an unreferenced server fn
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>
2026-10-25 15:35:41 +01:00
Sheraff
44ec8cf464
fix(router-core): route HMR falls back to the first importer on Rolldown's MissingFactoryError
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>
2026-10-25 15:34:54 +01:00
Sheraff
c909ac9e13
test(e2e): rsbuild overlay asserts the syntax error's file and line
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>
2026-10-25 15:14:19 +01:00
Sheraff
098e08b315
test(e2e): import-protection specs follow SPEC J6.4/J6.5
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>
2026-10-25 15:14:19 +01:00
Sheraff
4666abaa4f
chore(changeset): generateFunctionId receives the server fn's stable key
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>
2026-10-25 15:12:44 +01:00
Sheraff
62c4b5a455
Merge t3/compiler-e2e-x-vite-rsc-provider: Vite RSC always derives the provider module (R50)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 15:12:24 +01:00
Sheraff
75fd68c5d4
Merge t3/compiler-e2e-validation: Lane X e2e validation fixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 15:12:19 +01:00
Sheraff
12e85f2c93
chore(changeset): e2e validation fixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 15:08:16 +01:00
Sheraff
1d3ae10e00
test(start-plugin-core): type the new snippet field and onViolation probe
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 15:08:08 +01:00
Sheraff
ccebf39ba4
chore(e2e): regenerate route trees with the new generator
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>
2026-10-25 15:05:53 +01:00
Sheraff
b255df8167
fix(start-plugin-core): list the server fns a handler's client components import in the RSC provider manifest
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>
2026-10-25 14:57:38 +01:00
Sheraff
48f52b5e0e
test(react-start-rsc): flip the dev gating pin of a separate RSC provider
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 14:45:06 +01:00
Sheraff
c6c1447d29
feat(start-plugin-core): gate server functions by client reference in development
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>
2026-10-25 14:43:43 +01:00
Sheraff
1368d20d8f
test(e2e): esbuild apps drop autoCodeSplitting
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>
2026-10-25 14:39:02 +01:00
Sheraff
2ffe150e25
refactor(start-plugin-core): one rule for self-marked entries on Rsbuild
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>
2026-10-25 14:36:22 +01:00
Sheraff
1625f437e3
perf(start-plugin-core): share modules between async server chunks on Rsbuild
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>
2026-10-25 14:32:06 +01:00
Sheraff
f566295613
perf(router): move the dev-only route HMR runtime to a /hmr subpath
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>
2026-10-25 14:32:06 +01:00
Sheraff
b639c83825
fix(start-plugin-core): drop the dead origin check of the production resolver
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>
2026-10-25 14:32:06 +01:00
Sheraff
f13f2dab87
fix(router-utils): never resolve builtins or URL-scheme specifiers for analysis
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>
2026-10-25 14:20:31 +01:00
Sheraff
719187f63a
Merge branch 'compiler-perf-harness-2' into t3/fix-yuku-compiler-regressions 2026-10-25 14:16:57 +01:00
Sheraff
0e83826b68
Merge t3/compiler-pin-sweep: Lane P pin sweep
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 13:51:01 +01:00
Sheraff
bbcea7a11e
test: flip 12 G16/S3/S7 pins the compiler already fixes
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>
2026-10-25 13:25:52 +01:00
Sheraff
2aa68d76da
Merge compiler-tests/baseline: G16 dead-code shapes, required J4.11 server drop, G8 leftovers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	packages/start-plugin-core/tests/known-bugs-start-compiler.test.ts
2026-10-25 13:18:17 +01:00
Sheraff
85c2b672dd
test(router-plugin): pin lost parentheses around a JSX element in a route module
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>
2026-10-25 13:08:54 +01:00
Sheraff
da4cb9f35f
test(start-plugin-core): require the server drop for neutral modules
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>
2026-10-25 13:08:54 +01:00
Sheraff
ae6dda9d8b
docs(oracle): the server drops client-only code whatever the file's name
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>
2026-10-25 13:08:54 +01:00
Sheraff
6e5ca2c0f5
bench(compiler-perf): report the leak check's failing edit
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>
2026-10-25 12:55:46 +01:00
Sheraff
96e28d4e5b
test: run every dependency shape through every removal
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>
2026-10-25 12:31:12 +01:00
Sheraff
d97fe1835f
fix(router-utils): render zero-width edits at an edit's start once
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>
2026-10-25 12:30:37 +01:00
Sheraff
c9f9246923
bench(bundle-size): measure Start server output and server cold start
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>
2026-10-25 12:29:02 +01:00
Sheraff
13b0f861c9
bench(compiler-perf): solid-start and solid-router workloads
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>
2026-10-25 12:28:37 +01:00
Sheraff
3880757665
bench(compiler-perf): replay ESM Rspack loaders through a module hook
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>
2026-10-25 12:28:37 +01:00
Sheraff
925684aacd
fix(start-plugin-core): prune neighbouring orphaned pattern properties together
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>
2026-10-25 12:23:51 +01:00
Sheraff
9af54a337f
test(start-plugin-core): client-only imports never reach the server
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>
2026-10-25 12:23:12 +01:00
Sheraff
ad7a912b7f
test(start-plugin-core): no stub or warning for imports only removed server code reads
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>
2026-10-25 12:22:59 +01:00
Sheraff
cd22b0711e
docs(oracle): add G16, removed code takes what only it used
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>
2026-10-25 12:22:49 +01:00
Sheraff
4d67d19fb2
fix(start-plugin-core): Vite RSC always derives the server-fn provider module
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>
2026-10-25 12:18:54 +01:00
Sheraff
c111c7f87c
fix(start-plugin-core): Rspack traces follow scope-hoisted modules
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>
2026-10-25 12:04:29 +01:00
Sheraff
02e636c3f9
fix(router-utils): home what env roots added after homing read
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>
2026-10-25 12:04:29 +01:00
Sheraff
b1091d7400
chore(start-plugin-core): import order and unit-test typing of the resolver warning filter
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 11:50:01 +01:00
Sheraff
98b3f237e4
test(start-plugin-core): the Rsbuild .mdx import-protection rows accept the page's thrown denial
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>
2026-10-25 11:42:28 +01:00
Sheraff
1634fc1306
test(start-plugin-core): name the Rsbuild cause of the unused-boundary-chunk pin
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 11:35:29 +01:00
Sheraff
247e55bedc
fix(router-plugin): an edit of a split loader alone reaches the page on webpack-style hosts
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>
2026-10-25 11:35:29 +01:00
Sheraff
a6e742719d
test(e2e): deferred-hydration HMR waits on the route's dev modules
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>
2026-10-25 11:12:45 +01:00
Sheraff
5c45d33830
test(e2e): import-protection whitelists the mock-access diagnostic
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>
2026-10-25 11:12:45 +01:00
Sheraff
394c5aa93b
fix(start-plugin-core): import-protection reports print a code frame
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>
2026-10-25 11:12:45 +01:00
Sheraff
d153f34929
test(e2e): server-functions custom ids key on the stable key
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>
2026-10-25 11:12:45 +01:00
Sheraff
396d72c6fe
fix(start-client-core): client middleware sees only the server fn id during SSR
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>
2026-10-25 11:12:45 +01:00
Sheraff
dfe2bc9caa
fix(start-plugin-core): drop Rolldown's chunking hint about the server-fn resolver's lazy imports
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>
2026-10-25 11:07:53 +01:00
Sheraff
1bd61ba7b7
fix(start-plugin-core): the Vite host leaves parse errors to the bundler's parser
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>
2026-10-25 11:07:53 +01:00
Sheraff
28f6d3e742
fix(router-utils): a marker import is no evaluation edge and no effect of the marked module
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>
2026-10-25 11:07:53 +01:00
Sheraff
adac66b8a5
fix(start-plugin-core): Rsbuild manifest counts a chunk available only when every group of the importer has it (#8780)
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>
2026-10-25 10:41:47 +01:00
Sheraff
3a575ca1c9
fix(router-utils): decide orphans on the final env liveness, after cancelled extractions
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>
2026-10-25 10:39:28 +01:00
Sheraff
c991c6b7c0
bench(compiler-perf): floor via record/replay of TanStack hook outputs, memory and HMR leak check
Brings a462a782c1 from compiler-perf-harness onto the integration branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 10:23:34 +01:00
Sheraff
498ac9be17
chore(changeset): router-utils drops its Babel helpers; Start's Babel leftovers removed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 09:51:05 +01:00
Sheraff
2cce7da46a
chore(start-plugin-core, router-utils): delete the Babel modules no host imports anymore
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>
2026-10-25 09:50:48 +01:00
Sheraff
97f3dd66f5
Merge lane B: Start Rsbuild host on the compiler core with its own loaders
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>
2026-10-25 09:48:01 +01:00
Sheraff
ed7be48d01
Merge lane V: Start Vite host fused (router + Hydrate + import-protection planners in one compile)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 09:43:59 +01:00
Sheraff
b218c78900
fix(start-plugin-core): every server router env splits route options like the client
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>
2026-10-25 09:18:42 +01:00
Sheraff
cfe166433c
fix(router-plugin): deleting every option of a route takes the trailing comma
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>
2026-10-25 09:06:45 +01:00
Sheraff
c938e35107
chore(changeset): Start's fused Vite compile and import protection on the compiler core
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 08:46:39 +01:00
Sheraff
935982c323
perf(start-plugin-core): Hydrate chunks export H<n>, ordinal ids, Solid props only when read
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>
2026-10-25 08:43:55 +01:00
Sheraff
f64ae5f28b
test(start-plugin-core): the Yuku router splitter fixes 6 Rsbuild route CSS pins
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 08:43:44 +01:00
Sheraff
d9b6816b1b
Merge origin/compiler-tests/baseline: route CSS rows on Rsbuild, and two routes sharing a module
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>
2026-10-25 08:41:15 +01:00
Sheraff
5bf3b4497c
test(start-plugin-core): route CSS rows on Rsbuild, and two routes sharing a module
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>
2026-10-25 08:34:56 +01:00
Sheraff
a449f9cff8
fix(router-utils): only a region-written cluster is barred from extraction
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>
2026-10-25 08:25:42 +01:00
Sheraff
c07baf060e
fix(start-plugin-core): a pre-bundled dependency resolves to its source entry; flip 120 Vite pins the Yuku host fixes
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>
2026-10-25 08:18:57 +01:00
Sheraff
39f9f04c62
fix(start-plugin-core): Solid server envs split, original inputs carry no map, an entry's own marker is judged
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>
2026-10-25 07:56:33 +01:00
Sheraff
e402c5b70b
fix(start-plugin-core): the manifest ignores a discarded veto pass; Rsbuild hydrate pins
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>
2026-10-25 07:33:23 +01:00
Sheraff
1ce8a6eb25
fix(router-utils): a cluster holding a written binding is never an extracted export
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>
2026-10-25 07:33:23 +01:00
Sheraff
fb8dc9164a
fix(start-plugin-core): the Rspack graph view finds a concatenated entry by its root module
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>
2026-10-25 04:19:13 +01:00
Sheraff
2918a0c52c
refactor(start-plugin-core): the host plugin does not load the Rspack loader file
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>
2026-10-25 04:11:17 +01:00
Sheraff
0ea70b86d2
style(start-plugin-core): format lane B sources with the repo formatter
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 04:11:17 +01:00
Sheraff
4d965b8412
fix(start-plugin-core): read Rspack's module graph only after finishModules
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>
2026-10-25 03:49:44 +01:00
Sheraff
c2a68a7ac6
chore: changeset for the Rsbuild compiler host
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 03:31:07 +01:00
Sheraff
293c4d5a3f
test(router-utils): narrow the export entry in the provider placement test
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 03:30:02 +01:00
Sheraff
e84147004e
fix(start-plugin-core): Rsbuild RSC providers are self-contained modules of the react-server layer
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>
2026-10-25 03:28:22 +01:00
Sheraff
24de105a49
fix(start-plugin-core): Hydrate keeps writers of module bindings out of extracted exports
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 03:10:41 +01:00
Sheraff
bbcc759482
test(start-plugin-core): the Rsbuild host on the compiler core fixes 60 integration pins
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 03:08:38 +01:00
Sheraff
4ba22b2a33
fix(start-plugin-core): Rsbuild host fixes from the slow tier
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>
2026-10-25 03:01:54 +01:00
Sheraff
5d08cc41f1
feat(start-plugin-core): one compile per module in the Vite host (router, Hydrate and import-protection planners fused)
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>
2026-10-25 02:40:51 +01:00
Sheraff
5a3f20a293
feat(router-plugin): share the route registry view and registry change events with Start
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>
2026-10-25 02:39:26 +01:00
Sheraff
0692290858
feat(start-plugin-core): Rsbuild runs on the compiler core with its own loaders
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>
2026-10-25 02:26:30 +01:00
Sheraff
40932b80c1
test(start-plugin-core): the Yuku router splitter fixes 12 integration pins
- 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>
2026-10-25 02:29:18 +02:00
Sheraff
8471caf670
fix(router-plugin): deleteNodes refuses only options that may hide a deleted key
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>
2026-10-25 02:29:10 +02:00
Sheraff
f0c813fa38
fix(router-plugin): the code splitter used alone always splits
`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>
2026-10-25 02:29:10 +02:00
Sheraff
05f75521db
fix(start-plugin-core): Hydrate and env planners on Lane R's core
- 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>
2026-10-25 02:09:18 +02:00
Sheraff
74e46d74bb
fix(router-plugin): leave derived ids of other compilers alone
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>
2026-10-25 02:09:18 +02:00
Sheraff
b7f84515b5
fix(router-plugin): types and lint gates (unneeded non-null assertion, the pinned state row's options)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 01:47:32 +02:00
Sheraff
848892901e
chore(router-utils): drop an unused destructured name in freeze
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 01:44:56 +02:00
Sheraff
c413a3a969
chore: format
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 01:43:52 +02:00
Sheraff
19fdfa07b5
merge: compiler perf harness (benchmarks/compiler-perf) into the compiler integration branch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 01:43:08 +02:00
Sheraff
fa69abb15d
merge: Lane R router splitter and route HMR on the Yuku compiler core into the compiler integration branch
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>
2026-10-25 01:43:03 +02:00
Sheraff
ddb195e608
merge: Lane S Start env separation, RSC CSS and Start host on the compiler core into the compiler integration branch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 01:40:47 +02:00
Sheraff
bbd956af44
test(router-plugin): keep the page-code test names; pin the order-sensitive state row
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>
2026-10-25 01:28:43 +02:00
Sheraff
383f1918fb
fix(router-plugin): chunks export identifier option values directly
`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>
2026-10-25 01:28:43 +02:00
Sheraff
63ae9674cf
test(router-plugin): the Yuku splitter fixes the remaining integration pins
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>
2026-10-25 01:15:12 +02:00
Sheraff
3e44d52603
feat(router-plugin): not-split by placement, deleteNodes refusal, object loaders by reference, symlinked routes, eager-export warning
- 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>
2026-10-25 01:15:12 +02:00
Sheraff
92114d1fd0
fix(router-utils): own augmentations move with their declaration; env-declared fallback; type-only export specifiers
- 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>
2026-10-25 01:15:12 +02:00
Sheraff
8956ccc516
test(start-plugin-core): drop an unused destructured name in the builder table
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 00:53:00 +02:00
Sheraff
4f70d410f9
test(start-plugin-core): the introduced-names probe ignores Vite's SSR wrapper identifiers
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>
2026-10-25 00:45:46 +02:00
Sheraff
f13a312780
fix(start-plugin-core, react-start-rsc): RSC provider manifest without the origin check; flip 9 RSC CSS pins
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>
2026-10-25 00:40:23 +02:00
Sheraff
41ae553bbf
fix(start-plugin-core): defer dependents' hard invalidation on unlink; flip 60 integration pins
- `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>
2026-10-24 21:57:48 +02:00
Sheraff
1c19cd01e0
merge: compiler integration branch (R47 failed resolutions, Lane E planner, Lane D tests) into lane start
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

# Conflicts:
#	packages/router-utils/src/compiler/facts.ts
2026-10-24 21:34:51 +02:00
Sheraff
91a0504a76
fix(start-plugin-core): interim import-protection graph with the compiler host; maps always; dev glue newline
- 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>
2026-10-24 21:34:15 +02:00
Sheraff
6ef5ec4f33
feat(router-plugin): exported page code loads with its chunk; deleteNodes of adjacent properties
- 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>
2026-10-24 21:29:51 +02:00
Sheraff
5c39d9bb0d
feat(router-utils): extracted-export outputs and route-module placement rules
- 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>
2026-10-24 21:29:51 +02:00
Sheraff
883dfdee23
test(router-plugin): the Yuku splitter fixes the production-build and route HMR pins
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>
2026-10-24 20:59:40 +02:00
Sheraff
6199cea9a4
fix(router-plugin): lowercase and identifier split options, recognition warnings, warning ledger
- 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>
2026-10-24 20:59:40 +02:00
Sheraff
0e3968ed0d
fix(router-utils): renames skip ranges other planners own; orphaned clusters a chunk needs stay
- 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>
2026-10-24 20:59:40 +02:00
Sheraff
f52e58b595
fix(start-plugin-core, router-utils): J4 unit tier green on the compiler core; flip 130 pins
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>
2026-10-24 20:53:38 +02:00
Sheraff
78df6f9359
merge: compiler unresolved-lang override into the compiler integration branch
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 20:39:23 +02:00
Sheraff
39800cffcb
feat(router-utils): re-resolve failed resolutions on file add/unlink (R47) and a host language override for non-JS ids (R48)
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>
2026-10-24 20:38:22 +02:00
Sheraff
cfca98d1f5
feat(start-plugin-core): Start Vite host on the compiler core
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>
2026-10-24 20:33:33 +02:00
Sheraff
a7edfd0e50
feat(start-plugin-core): Start env separation and RSC CSS planners on the compiler core
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>
2026-10-24 20:33:33 +02:00
Sheraff
0623d85e35
feat(router-utils): symbolic value terms, known-specifier summaries and planner withdrawal in the compiler core
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>
2026-10-24 20:33:33 +02:00
Sheraff
1721025880
test(router-plugin): the Yuku splitter fixes the fast-tier pins
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>
2026-10-24 20:30:52 +02:00
Sheraff
a2f93db3ed
feat(router-plugin): route splitting and route HMR on the Yuku compiler core
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>
2026-10-24 20:30:52 +02:00
Sheraff
065cb25d14
fix(router-utils): compiler core follow-ups for the router planners
- 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>
2026-10-24 20:30:52 +02:00
Sheraff
5e5170b2d9
merge: Lane E import-protection planner/policy and core edge facts into the compiler integration branch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 20:28:43 +02:00
Sheraff
6a30912bc2
feat(start-plugin-core): Vite dev graph view for import-protection traces; forwarded-glue and buildInfo replay tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 20:27:35 +02:00
Sheraff
6b6870bc94
test(start-plugin-core): import-protection survival witness and veto fixed point on real Vite and Rsbuild builds
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>
2026-10-24 20:23:37 +02:00
Sheraff
9ff5947c70
fix(router-utils): input maps are any upstream map (InputSourceMap), not our emitted shape
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 20:23:37 +02:00
Sheraff
cf3a57315c
merge: Lane D Hydrate planner and core reach fixes into the compiler integration branch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 20:19:45 +02:00
Sheraff
8e96610691
test(start-plugin-core): unit tests of the <Hydrate> planner on the core
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>
2026-10-24 20:17:12 +02:00
Sheraff
8fcfd7ddd9
fix(start-plugin-core): Hydrate prefixes after the last attribute, nested boundaries validated alone
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>
2026-10-24 20:17:12 +02:00
Sheraff
fb41dbd557
feat(start-plugin-core): import-protection planner and policy on the compiler core
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>
2026-10-24 20:16:16 +02:00
Sheraff
31be645971
feat(router-utils): target facts separate module loading from a module's own code effects
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>
2026-10-24 20:13:56 +02:00
Sheraff
d907335020
feat(start-plugin-core): the <Hydrate> planner on the compiler core (J5)
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>
2026-10-24 20:09:11 +02:00
Sheraff
374926aeb3
fix(router-utils): copies follow their direct readers only
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>
2026-10-24 20:08:45 +02:00
Sheraff
c33202c41a
fix(router-utils): writes make a region need the binding; generated reads unpin imports
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>
2026-10-24 20:07:03 +02:00
Sheraff
df706a5b6b
fix(router-utils): a transform's own analysis uses the session's marker specifiers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 19:58:12 +02:00
Sheraff
b9d1548deb
feat(router-utils): J6 edge names by value use, target facts for edge modules, policy input text
- 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>
2026-10-24 19:57:08 +02:00
Sheraff
e9deb5b7b2
bench(compiler-perf): default to --max-busy 1.5 and 5 retries
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 19:41:35 +02:00
Sheraff
e12e5fc1fa
style(router-generator): format generator.ts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 19:36:14 +02:00
Sheraff
1a3fc45a5f
merge: framework route HMR runtime into the compiler integration branch
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>
2026-10-24 19:35:58 +02:00
Sheraff
40d495bd56
merge: router-generator rewrite on Yuku into the compiler integration branch
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>
2026-10-24 19:35:55 +02:00
Sheraff
6f9c8336a6
test(router-utils): core engine tests and the slice gates with toy planners
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>
2026-10-24 19:33:25 +02:00
Sheraff
9baa95d98e
feat(router-utils): compiler core on Yuku (identity, analysis, rewrite tree, placement, caches, pipeline)
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>
2026-10-24 19:33:25 +02:00
Sheraff
a7ab5cfceb
fix(router-generator): rebuild after a failed generation of a content edit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 19:13:01 +02:00
Sheraff
3d2a81ffc3
build(router-utils): add yuku, a vitest setup and the compiler subpath export
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>
2026-10-24 19:12:50 +02:00
Sheraff
cc81348ff8
test(router-plugin): run the Rsbuild generator scenarios the pins skipped
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>
2026-10-24 19:12:33 +02:00
Sheraff
87ce40d15d
chore(changeset): the route generator rewrite and the formatting default change
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 19:02:36 +02:00
Sheraff
497ae87c44
perf(router-generator): skip unchanged files by stamp and cheaper literals
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>
2026-10-24 19:02:36 +02:00
Sheraff
0843bc5ad4
chore: changeset for the route HMR runtime
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 19:00:17 +02:00
Sheraff
d4714a2e61
bench(compiler-perf): repeat runs flagged for machine load
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 18:58:47 +02:00
Sheraff
ac99ee252e
test(router-plugin, start-plugin-core): the generator rewrite fixes the J1 and J2.15 pins
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 18:57:46 +02:00
Sheraff
8e58831614
docs(router): enableRouteTreeFormatting now defaults to false
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 18:57:46 +02:00
Sheraff
9e9ab26815
feat(router-plugin): one generator-owned watcher on Rspack and webpack
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>
2026-10-24 18:57:46 +02:00
Sheraff
138d3cb098
feat(start-plugin-core): serve the pruned client route tree on Vite and Rsbuild
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>
2026-10-24 18:57:46 +02:00
Sheraff
39e70412cb
fix(solid-router,vue-router): keep route HMR dev branches out of production output
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>
2026-10-24 18:57:39 +02:00
Sheraff
2b5a63767b
test(react-router,solid-router,vue-router): type-check and lint the route HMR tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 18:53:31 +02:00
Sheraff
22e172a753
test(router-generator): the generator rewrite fixes the J1 pins
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 18:52:14 +02:00
Sheraff
351f0dc60b
feat(router-generator): rebuild the generator on a Yuku analyser and a pure tree model
- 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>
2026-10-24 18:52:14 +02:00
Sheraff
799a017fc7
feat(vue-router): dev-only route HMR adapter and lazy wrapper hot slot
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>
2026-10-24 18:44:43 +02:00
Sheraff
e8c415538f
feat(solid-router): dev-only route HMR adapter and lazy wrapper hot slot
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>
2026-10-24 18:44:43 +02:00
Sheraff
c1c2a8ce31
feat(router-core,react-router): dev-only route HMR helper and lazy wrapper hot slot
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>
2026-10-24 18:40:59 +02:00
Sheraff
affb6ed4af
bench(compiler-perf): flag runs by other processes' CPU use during the run
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>
2026-10-24 18:20:38 +02:00
Sheraff
779ccc2256
bench(compiler-perf): share the plugins' vite and rsbuild instances with the apps
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 17:20:53 +02:00
Sheraff
e75733d711
bench(compiler-perf): dev startup, HMR and build harness for the compiler
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>
2026-10-24 17:03:23 +02:00
Sheraff
80d1890bed
test(compiler-test-utils): run server code on Vite's module runner as is
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>
2026-10-24 16:05:08 +02:00
Sheraff
d6621667d7
docs(compiler-test-utils): how to run the whole oracle and the pins
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>
2026-10-24 14:49:38 +02:00
Sheraff
34c4e8caf2
test(start-plugin-core): type-check the route tree footer of a Solid Start app
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>
2026-10-24 14:48:47 +02:00
Sheraff
fa8c809fe4
test(router-plugin): edit the root route of a Solid app in dev
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>
2026-10-24 14:47:53 +02:00
Sheraff
8d612da0b3
test(start-plugin-core): a Hydrate written in a split Solid route component
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>
2026-10-24 14:45:23 +02:00
Sheraff
182ef10b5d
test: Solid use: directives in code the compilers move
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>
2026-10-24 14:43:36 +02:00
Sheraff
3a0e3707f4
test(start-plugin-core): pin a Solid ref to a let inside split Hydrate children
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>
2026-10-24 14:43:02 +02:00
Sheraff
d7830ef8d8
test(start-plugin-core): Solid Hydrate children follow the props of their component
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>
2026-10-24 14:42:38 +02:00
Sheraff
893b7f5477
test(start-plugin-core): build Solid Start apps in the environment separation tests
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>
2026-10-24 14:37:15 +02:00
Sheraff
bc2aafcf17
test(start-plugin-core): check handler leaks by a marker instead of printed code
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>
2026-10-24 14:30:02 +02:00
Sheraff
2b254052e5
test(compiler-test-utils): run every known-bug pin as an ordinary test with COMPILER_TESTS_PINS=run
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>
2026-10-24 14:26:37 +02:00
Sheraff
69cac5cda1
test(start-plugin-core): say which hydration ids the nested-boundaries test compares
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>
2026-10-24 14:15:13 +02:00
Sheraff
4163d24bd6
test(react-start-rsc): run the Rsbuild RSC CSS build rows in a file of their own
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>
2026-10-24 14:15:13 +02:00
Sheraff
42b62d90c2
test(start-plugin-core): mock a denied import that carries an import attribute
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>
2026-10-24 13:57:53 +02:00
Sheraff
dedf978669
test(react-start-rsc): RSC CSS of a helper module in production builds, and an Rsbuild RSC build
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>
2026-10-24 13:57:53 +02:00
Sheraff
c25ab6c439
test(router-plugin): production bundles of the route shapes route HMR compiles differently
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>
2026-10-24 13:57:53 +02:00
Sheraff
d010f50824
test(start-plugin-core): check the printed import-protection warning in mock builds
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>
2026-10-24 13:57:53 +02:00
Sheraff
c18a49068f
test(router-plugin): check the not-split warning: once, naming the route file
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>
2026-10-24 13:57:53 +02:00
Sheraff
a8cbd070ef
test(react-start-rsc): check renamed env-only fns in a server fn handler in an RSC build
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>
2026-10-24 13:57:53 +02:00
Sheraff
9f512a79ce
test(start-plugin-core): pin env-function handlers (#8446) in production builds
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>
2026-10-24 13:57:53 +02:00
Sheraff
e189136176
test(start-plugin-core): run the factory-module edits in an Rsbuild watch build
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>
2026-10-24 13:57:53 +02:00
Sheraff
df2a9eac12
test(start-plugin-core): run the dev input shapes in production builds
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>
2026-10-24 13:57:53 +02:00
Sheraff
e46cdc9832
test(router-plugin): pin a shared lowercase const created twice under route HMR
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>
2026-10-24 12:49:56 +02:00
Sheraff
3968fa6b58
test: a route's CSS loads only when the route matches
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>
2026-10-24 12:39:48 +02:00
Sheraff
6ac0885b71
test(start-plugin-core): accept a reported module for handlers that are env-only fn calls
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>
2026-10-24 12:22:31 +02:00
Sheraff
210f0034ae
test(router-plugin): require dev source maps to name the route file itself
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>
2026-10-24 12:18:31 +02:00
Sheraff
738f95c7c7
test(start-plugin-core): pin a Start library's CommonJS dependency in Vite dev
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>
2026-10-24 12:15:33 +02:00
Sheraff
16c2dcfe29
test(router-plugin): cover lowercase bindings shared by kept and split options under route HMR
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>
2026-10-24 12:09:21 +02:00
Sheraff
d28b045e69
test(react-start-rsc): pin a server fn reached only through a 'use client' component in the RSC build
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>
2026-10-24 12:04:44 +02:00
Sheraff
6b96954f79
test(start-plugin-core): drop the unused pinnedReports switch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 09:57:48 +02:00
Sheraff
e9ff826908
test: drop references to working notes from compiler test comments
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>
2026-10-24 04:07:04 +02:00
Sheraff
ef4f65164c
docs(compiler-test-utils): terse oracle README, known bugs by root cause, harness notes
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>
2026-10-24 04:07:04 +02:00
Sheraff
24a17b4dd8
docs(compiler-test-utils): fold the rulings into SPEC and delete RULINGS.md
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>
2026-10-24 04:06:57 +02:00
Sheraff
d88794d664
test(compiler-test-utils): delete the unused loadedModules()
Nothing calls it; resetLoadedModules(), loadMarker and
loadedModulesExpression stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 04:06:57 +02:00
Sheraff
e7e1a9ec35
test(start-plugin-core): HydrationApp keeps the members its suites use
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 03:23:56 +02:00
Sheraff
6efed7278b
test(compiler-test-utils): drop an unread EditWait field and a doubled release()
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 03:23:56 +02:00
Sheraff
985556db0d
test(router-plugin): drop helper options and members nothing uses
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>
2026-10-24 03:23:56 +02:00
Sheraff
9e54d9a07b
test(router-generator): one fixtureConfig case for the two custom-token fixtures
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 03:22:35 +02:00
Sheraff
38cb94cc09
test(compiler-test-utils): drop host and dev-server options nobody passes
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>
2026-10-24 03:22:35 +02:00
Sheraff
8f3096abf9
test(compiler-test-utils): drop DiagnosticChannelOptions
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>
2026-10-24 03:22:35 +02:00
Sheraff
5a14e62104
test(compiler-tests): share the plugin-name, Start-runtime-link and RSC-package helpers
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>
2026-10-24 03:14:29 +02:00
Sheraff
546ed8d8a6
test(start-plugin-core): delete helpers and re-exports nothing uses
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>
2026-10-24 03:14:29 +02:00
Sheraff
9c7c20048c
test(compiler-test-utils): drop build-harness options and evidence nothing reads
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>
2026-10-24 03:06:08 +02:00
Sheraff
8d83d377bb
Merge branch 'compiler-tests/fix-oc-b' into compiler-tests/baseline
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 02:36:40 +02:00
Sheraff
918d1d6774
Merge branch 'compiler-tests/fix-oc-a' into compiler-tests/baseline
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 02:36:37 +02:00
Sheraff
ec1b67fd50
docs(compiler-test-utils): record the 2026-10-24 rulings in the oracle
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>
2026-10-24 02:34:37 +02:00
Sheraff
ca0ccaf685
test(router-plugin): read routes through the router, not generated options
- 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>
2026-10-24 02:34:37 +02:00
Sheraff
6548989893
test(router-plugin): route HMR checks follow the 2026-10-24 rulings
- 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>
2026-10-24 02:34:37 +02:00
Sheraff
2701ac7ba0
test(router-plugin): judge split modules by what the route loads and ships
- 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>
2026-10-24 02:34:37 +02:00
Sheraff
a7ad71eff6
test(router-plugin): build entries import Route, not every export
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>
2026-10-24 02:34:37 +02:00
Sheraff
a3df043200
test(router-plugin): compare dev-server route files outside their imports
- 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>
2026-10-24 02:34:37 +02:00
Sheraff
b684ff9cf9
test(compiler-test-utils): check what a compiler's virtual modules do
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>
2026-10-24 02:33:33 +02:00
Sheraff
3e196ffe18
test(router-generator): accept blank lines a removed import leaves; vary every listing API
- 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>
2026-10-24 02:33:33 +02:00
Sheraff
9a8ed5c0dc
docs(compiler-test-utils): record the rulings of 2026-10-24 (outcomes audit B)
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>
2026-10-24 01:52:35 +02:00
Sheraff
b5a7ae96b1
test(start-plugin-core): apply the user rulings of 2026-10-24
- 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>
2026-10-24 01:52:35 +02:00
Sheraff
67d24d2353
test(start-plugin-core): stop pinning a correct compiler's free choices in middleware, directive and RPC rows
- 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>
2026-10-24 01:52:35 +02:00
Sheraff
4b6b46baa7
test(start-plugin-core): accept either onViolation trace direction and an absent resolved path
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>
2026-10-24 01:52:35 +02:00
Sheraff
27bb40ba4a
Merge branch 'compiler-tests/quickwins-rp' into compiler-tests/baseline
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>
2026-10-23 23:24:39 +02:00
Sheraff
e4f4bedd87
fix(start-plugin-core): require exsolve ^1.1.3
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>
2026-10-23 23:23:43 +02:00
Sheraff
3656f5599b
chore(deps): update exsolve to 1.1.3 (within ^1.1.1)
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>
2026-10-23 22:58:39 +02:00
Sheraff
bb200e381a
test(router-plugin): read each loaded script once per marker in scriptHolds
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>
2026-10-23 22:53:51 +02:00
Sheraff
dd95e2a0b8
test(compiler-test-utils): read each source's names once per dangling-name check
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>
2026-10-23 22:53:51 +02:00
Sheraff
aaf7aa8adb
test(compiler-test-utils): cap the compiler test runs at 4 Vitest workers
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>
2026-10-23 22:45:57 +02:00
Sheraff
b77150c04f
test(router-generator): apply ruling Q10, import statements are the generator's to edit
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>
2026-10-23 18:56:05 +02:00
Sheraff
c2588d0ed6
docs(compiler-test-utils): oracle README status after the rulings of 2026-10-23
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>
2026-10-23 18:40:56 +02:00
Sheraff
c2161c4d14
merge compiler-tests/rulings-b (Start-side rulings of 2026-10-23)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	packages/compiler-test-utils/oracle/KNOWN-BUGS.md
#	packages/compiler-test-utils/oracle/README.md
#	packages/compiler-test-utils/oracle/SPEC.md
2026-10-23 16:06:34 +02:00
Sheraff
5fca88794a
merge compiler-tests/rulings-a (router-side rulings of 2026-10-23)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 16:04:36 +02:00
Sheraff
912cea3f2e
docs(compiler-test-utils): record the router-side rulings of 2026-10-23
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>
2026-10-23 15:39:54 +02:00
Sheraff
5e53181154
test(router-plugin): apply rulings Q5, Q8, Q9 and NEW-1
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>
2026-10-23 15:39:54 +02:00
Sheraff
2927ae6ad1
test(router-generator): apply rulings Q1 and Q2 (no injected fs, file route types through router-core)
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>
2026-10-23 15:39:54 +02:00
Sheraff
85a72cdc02
docs(compiler-test-utils): record the rulings Q3, Q4, #34, #42 and #57 of 2026-10-23
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 15:35:40 +02:00
Sheraff
31d38a6f0a
test(start-plugin-core): star re-export of a denied module is a mock, or the build fails or dev warns
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>
2026-10-23 15:35:40 +02:00
Sheraff
6f586bb27d
test(compiler-test-utils): wait for Vite's dependency optimizer before closing a dev server
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>
2026-10-23 15:35:40 +02:00
Sheraff
fb72ef4e73
test(react-start-rsc): pin Rsbuild RSC CSS of a helper module's render in the oracle, drop the e2e copy
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>
2026-10-23 15:03:00 +02:00
Sheraff
efe105f5fe
test(start-plugin-core): request the dev-deadlock pin's module before the dev server starts its optimizer
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>
2026-10-23 14:49:32 +02:00
Sheraff
edc4207ead
docs(compiler-test-utils): oracle README status after F-L and F-M
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>
2026-10-23 13:25:30 +02:00
Sheraff
57addcc41e
test(compiler-test-utils): let the run's teardown alone remove the run directory
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>
2026-10-23 10:59:36 +02:00
Sheraff
e2fad302c3
test(router-plugin): start the generator watch session on an app with its route tree and no recent change
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>
2026-10-23 10:44:35 +02:00
Sheraff
6918227403
test(router-generator): pin the event dropped while a run checks unchanged files
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>
2026-10-23 10:44:35 +02:00
Sheraff
fa811951ea
test(start-plugin-core): judge other errors and importer locations by file, never by a colon split
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>
2026-10-23 10:26:29 +02:00
Sheraff
34ce33b24e
Merge branch 'compiler-tests/final-l' into compiler-tests/integrate-s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:21:30 +02:00
Sheraff
07a0173ef8
docs(compiler-test-utils): oracle README status after the FINAL-2 measurement
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>
2026-10-23 10:19:26 +02:00
Sheraff
80666b0cf7
docs(compiler-test-utils): oracle docs match what F-L checks; check the MDX dev row's printed warnings
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>
2026-10-23 06:30:01 +02:00
Sheraff
326709c929
test(router-generator): keep temporary files in the run's directory
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>
2026-10-23 06:17:08 +02:00
Sheraff
7149f4f1e3
test: a compile error must name the module, with its line after the file is named
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>
2026-10-23 06:14:28 +02:00
Sheraff
8efece5b5f
test(start-plugin-core): restore main's Rsbuild RSC rule-cloning test (#7482) as a non-compiler test
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>
2026-10-23 06:10:45 +02:00
Sheraff
909564729d
test(compiler-test-utils): decide the typeof exemption of dangling names per module, and fail on unreadable chunks
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>
2026-10-23 06:09:44 +02:00
Sheraff
f1b3980717
test(start-plugin-core): a wrong-environment env-only function must be a function whose call throws
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>
2026-10-23 05:59:50 +02:00
Sheraff
749366bdef
test(start-plugin-core): check that import-protection violations are printed, and count printed warnings for log
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>
2026-10-23 05:57:03 +02:00
Sheraff
f16aae85ac
Merge branch 'compiler-tests/final-j' into compiler-tests/integrate-s
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>
2026-10-23 05:13:46 +02:00
Sheraff
52a4b8a19e
docs(compiler-test-utils): oracle README counts after S-B
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 04:14:15 +02:00
Sheraff
e9044824b9
Merge branch 'compiler-tests/simplify-b' into compiler-tests/integrate-s
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>
2026-10-23 04:10:43 +02:00
Sheraff
6c1399f9cd
docs(compiler-test-utils): oracle docs after the integration of S-A, Q6/Q7, NOL-delete and main-tests
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>
2026-10-23 02:50:09 +02:00
Sheraff
43d60fd317
test(compiler-tests): delete what the merged clean-ups left unused
- 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>
2026-10-23 02:50:09 +02:00
Sheraff
82e0ab3d5f
Merge branch 'compiler-tests/main-tests' into compiler-tests/integrate-s
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>
2026-10-23 02:35:58 +02:00
Sheraff
d6169771a3
Merge branch 'compiler-tests/nol-delete' into compiler-tests/integrate-s
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>
2026-10-23 02:35:27 +02:00
Sheraff
4705e64b67
Merge branch 'compiler-tests/q6-q7' into compiler-tests/integrate-s
Conflicts: the import gate (deleted by simplify-a) drops q6-q7's allowlist
edits; files q6-q7 deleted stay deleted; KNOWN-BUGS counts combined.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 02:35:00 +02:00
Sheraff
a599d07a0b
Merge branch 'compiler-tests/simplify-a' into compiler-tests/integrate-s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 02:34:14 +02:00
Sheraff
c270c53cb2
docs(compiler-test-utils): oracle README counts after S-A
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 02:32:54 +02:00
Sheraff
29b2adebc9
test(compiler-test-utils): annotate mentionsFile's loop variables for tsc 6
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>
2026-10-23 02:31:33 +02:00
Sheraff
b4a53e1ea1
test(start-plugin-core): the ignored importer is never reported
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>
2026-10-23 00:50:40 +02:00
Sheraff
dae57e9ab0
docs(compiler-test-utils): app directories mirror their path
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:05:00 +02:00
Sheraff
f8fc806ab4
test(compiler-test-utils): app directories keep their path below the root
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>
2026-10-22 19:04:47 +02:00
Sheraff
6251c7bf6d
docs(compiler-test-utils): the F-J pass in the oracle README status
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:20:58 +02:00
Sheraff
052c3b530c
test(compiler-test-utils): a path relative to the working directory names a file
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>
2026-10-22 18:11:29 +02:00
Sheraff
f40f97c5ca
docs(compiler-tests): oracle = acceptance; main's noncompiler tests untouched, main's compiler-internal tests deleted
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>
2026-10-22 18:08:15 +02:00
Sheraff
f905f57b10
test(compiler-tests): main's noncompiler tests back at main's paths, main's compiler-internal tests deleted
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>
2026-10-22 18:07:56 +02:00
Sheraff
f211578d60
test(router-plugin): read a .js route file with JSX in its language
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:06:09 +02:00
Sheraff
9c5b1236e8
docs(compiler-test-utils): oracle counts after the Q6 and Q7 rulings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 17:57:20 +02:00
Sheraff
8906f0a49e
docs(compiler-test-utils): oracle README lanes and counts after the non-oracle deletions
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>
2026-10-22 17:54:18 +02:00
Sheraff
a3e883a6d8
docs(compiler-test-utils): record the file-and-position and onViolation rulings
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>
2026-10-22 17:46:36 +02:00
Sheraff
a6a1308349
test(compiler-test-utils): check diagnostics by file and position, read import protection through onViolation
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>
2026-10-22 17:46:36 +02:00
Sheraff
df61ed18fc
test: delete the legacy harness controls and trim the legacy helpers
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>
2026-10-22 17:43:26 +02:00
Sheraff
58fa00f2b7
test(start-plugin-core): pin the CommonJS dependency bug through real apps (Q7)
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>
2026-10-22 17:43:26 +02:00
Sheraff
30b7e82d36
test(start-plugin-core): replace the Q6 hand-built package graph rows with real-app tests
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>
2026-10-22 17:43:26 +02:00
Sheraff
0e82b9dafd
test(compiler-test-utils): a name a module probes with typeof is not free
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>
2026-10-22 17:38:44 +02:00
Sheraff
d684988494
test(compiler-tests): delete non-oracle test-helper, internals and non-compiler lane files
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>
2026-10-22 17:37:33 +02:00
Sheraff
3c218ec478
test(router-plugin): read the route file's free names with its TypeScript erased
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>
2026-10-22 17:35:45 +02:00
Sheraff
6ef744fe25
docs(compiler-test-utils): where the test apps live
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>
2026-10-22 17:32:12 +02:00
Sheraff
226aed1593
test: free names from Yuku's semantic model replace the hand scope analysers
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>
2026-10-22 17:32:09 +02:00
Sheraff
0b4e4eea4d
chore(compiler-test-utils): add yuku for its semantic model
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>
2026-10-22 17:30:56 +02:00
Sheraff
4ae03d55c3
test(router-plugin): production bundle equals the route-HMR-off control build
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>
2026-10-22 17:04:28 +02:00
Sheraff
21f2781ba0
test(compiler-test-utils): delete the import gate
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>
2026-10-22 16:52:28 +02:00
Sheraff
8cb307ceb2
test(compiler-test-utils): create the test apps outside the packages
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>
2026-10-22 16:36:46 +02:00
Sheraff
e89575bc67
docs(compiler-test-utils): oracle README status after the F-H measurement
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>
2026-10-22 15:29:09 +02:00
Sheraff
d07614d3b3
test(start-plugin-core): assert on Vite that a server-only fn is callable from SSR code
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>
2026-10-22 11:08:00 +02:00
Sheraff
dad235a21c
Merge branch 'compiler-tests/final-i' into compiler-tests/baseline
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 10:53:37 +02:00
Sheraff
fe98fd0d7b
test(start-plugin-core): no D6 control row depends on the #7213 race
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>
2026-10-22 09:46:23 +02:00
Sheraff
1af57eb168
test(start-plugin-core): pin the #7213 middleware caller deterministically
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>
2026-10-22 09:28:41 +02:00
Sheraff
633a4c0917
docs(compiler-test-utils): oracle README after the V-G1 validation
#34 rates measured by V-G1, and the #7213 race seen once at an extreme load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 08:37:21 +02:00
Sheraff
fdb9698869
Merge branch 'compiler-tests/final-g3' into compiler-tests/baseline
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 08:29:19 +02:00
Sheraff
1533cdc1b3
docs(compiler-test-utils): the core factory reaches only the implementation test (corePlugins)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 08:29:04 +02:00
Sheraff
c049aff49b
docs(compiler-test-utils): no stand-in next outside the Q3 rows
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 08:19:35 +02:00
Sheraff
4e434e01bc
test(start-plugin-core): run the last middleware rows through Start's middleware chain
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>
2026-10-22 08:19:34 +02:00
Sheraff
e8b5a44679
test(start-plugin-core): hydrate pages click again only once the page took the click in
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>
2026-10-22 08:09:12 +02:00
Sheraff
e589429272
test(start-plugin-core): no acceptance harness imports Start's core plugin factory
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>
2026-10-22 08:09:12 +02:00
Sheraff
cc16e306a7
Merge branch 'compiler-tests/final-g1' into compiler-tests/baseline
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 07:52:51 +02:00
Sheraff
1fcbf2efc4
Merge branch 'compiler-tests/final-g2' into compiler-tests/baseline
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 07:47:49 +02:00
Sheraff
45605f86e2
docs(compiler-test-utils): oracle README after the F-G2 validation
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>
2026-10-22 07:47:45 +02:00
Sheraff
661ac966f7
test(router-plugin): the stale page's render is not judged, also when it fails
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>
2026-10-22 07:47:45 +02:00
Sheraff
3bb5f4876f
test(compiler-test-utils): settlePage also waits for what the page's invalidate() asked of the server
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>
2026-10-22 07:47:45 +02:00
Sheraff
2c5b34415a
docs(compiler-test-utils): #34 now also fails single dev-server rows under load (F-G1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 07:38:36 +02:00
Sheraff
468e054d0c
test(start-plugin-core): import order of the shared hmr-sync helper
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 07:18:12 +02:00
Sheraff
023fddd312
test(compiler-tests): addHmr: false Vite rows settle on the page, not a 3 s bound
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>
2026-10-22 07:15:46 +02:00
Sheraff
6166aa1ab8
test(start-plugin-core): pin the computed-member request middleware once, in its build twin
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>
2026-10-22 07:15:46 +02:00
Sheraff
ec39a6716a
docs(compiler-test-utils): oracle README after the final pass F-G2
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>
2026-10-22 07:02:01 +02:00
Sheraff
3807384702
test(start-plugin-core): the safe-mock probe leaves the object protocol free
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>
2026-10-22 06:54:56 +02:00
Sheraff
508707e9a6
test(compiler-tests): fix-agnostic unused-chunk pins, out-of-order pins reached by a real page
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>
2026-10-22 06:54:56 +02:00
Sheraff
aef6fd3a57
test(start-plugin-core): settle dev pages on what the page took in, not a quiet period
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>
2026-10-22 06:54:55 +02:00
Sheraff
62c31cd297
test(start-plugin-core): run server middleware and route handlers through real requests
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>
2026-10-22 06:54:55 +02:00
Sheraff
65f4d3b314
test(router-plugin): decide webpack addHmr: false by behaviour on a webpack dev server
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>
2026-10-22 06:54:55 +02:00
Sheraff
700640b27b
test(router-generator): restore the fixture route files' quoting from main
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>
2026-10-22 06:54:55 +02:00
Sheraff
c5bf72076d
test(start-plugin-core): import order in start-host
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 06:37:02 +02:00
Sheraff
f24c3d9517
Merge branch 'compiler-tests/final-f' into compiler-tests/final-g1 2026-10-22 06:35:19 +02:00
Sheraff
bee0eadc58
test(compiler-tests): build harness apps with the plugins a real app configures
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>
2026-10-22 06:35:19 +02:00
Sheraff
c398a77eab
style(start-plugin-core): format violation-report.ts (pnpm format)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 06:21:26 +02:00
Sheraff
389ff343cc
Merge branch 'compiler-tests/final-f' into compiler-tests/baseline
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 06:20:57 +02:00
Sheraff
8435535a10
test(router-plugin): G8 escalation also fails on a dangling name the production build spells otherwise
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>
2026-10-22 06:20:41 +02:00
Sheraff
73d818de3f
docs(compiler-test-utils): oracle README after the final pass F-F
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>
2026-10-22 05:58:46 +02:00
Sheraff
88720e56a0
test(compiler-tests): decide route module dangling names on the real production build (G8)
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>
2026-10-22 05:57:15 +02:00
Sheraff
44cd33cc2a
test(compiler-tests): final pass F-F: real module graph, public server fn URLs, content-judged diagnostics
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>
2026-10-22 05:49:36 +02:00
Sheraff
db2659114c
docs(compiler-test-utils): oracle README measured status at 45f58967ea
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>
2026-10-22 04:54:35 +02:00
Sheraff
45f58967ea
docs(compiler-test-utils): NEW-2 stays an open question; three doc corrections
- 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>
2026-10-21 23:37:19 +02:00
Sheraff
e31d056d10
Merge branch 'compiler-tests/final-e' into compiler-tests/baseline
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>
2026-10-21 23:37:19 +02:00
Sheraff
fed937b183
test(compiler-tests): final pass F-E-a: idle HMR client root cause, strict import gate in CI, oracle docs
- 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>
2026-10-21 23:15:15 +02:00
Sheraff
a22372286a
Merge branch 'compiler-tests/final-b' into compiler-tests/baseline
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>
2026-10-21 22:11:10 +02:00
Sheraff
3aec0a61f7
test(compiler-tests): F-B follow-ups: run pages leave their document before a run returns; deterministic pin; no ENOTEMPTY retry
- 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>
2026-10-21 21:26:36 +02:00
Sheraff
fe4ce59869
test(compiler-tests): final pass F-B: shared hosts and bounded pages, fast tiers within budget
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>
2026-10-21 20:43:27 +02:00
Sheraff
f351b388e3
Merge branch 'compiler-tests/final-e1' into compiler-tests/baseline
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>
2026-10-21 16:38:38 +02:00
Sheraff
25aa5ec098
Merge branch 'compiler-tests/final-a2' into compiler-tests/baseline
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>
2026-10-21 16:30:10 +02:00
Sheraff
4dc49b6724
test(compiler-tests): final pass F-A2: structured build diagnostics, G7 trap probes, provenance, Hydrate chunk rule, two pins
- 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>
2026-10-21 15:37:35 +02:00
Sheraff
f6a515a4b4
test(start-plugin-core): SSR scripts run inside a real request of the app
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>
2026-10-21 14:55:50 +02:00
Sheraff
60e5622333
test(router-plugin): an unfoldable dead-code marker, an eager-or-lazy presence check; RULINGS D9
- 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>
2026-10-21 14:17:19 +02:00
Sheraff
4f342f2276
Merge branch 'compiler-tests/final-d' into compiler-tests/baseline
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>
2026-10-21 14:17:19 +02:00
Sheraff
f29cfdb5ea
test(start-plugin-core): the route row's chunk check reads the boundaries' split code only
"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>
2026-10-21 13:59:25 +02:00
Sheraff
a4c575ad05
Merge branch 'compiler-tests/final-c' into compiler-tests/baseline
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>
2026-10-21 13:59:25 +02:00
Sheraff
2dd813f02e
test(start-plugin-core): F-C after F-A: F1 pins for the location rows, pre-bundled host runtime, source-map chunk ownership
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 11:56:37 +02:00
Sheraff
955ac15707
test(router-plugin, router-generator): final pass F-D: severity floor, provenance, G7 traps, D5 pairs
- 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>
2026-10-21 11:54:14 +02:00
Sheraff
9dc85a0459
Merge branch 'compiler-tests/final-a' into compiler-tests/final-d 2026-10-21 11:54:14 +02:00
Sheraff
e7f49d2086
Merge branch 'compiler-tests/final-a' into compiler-tests/final-c 2026-10-21 11:47:22 +02:00
Sheraff
a958b92658
test(start-plugin-core): final pass F-C: restored concepts, Vue host, G7 trap, upstream pins dropped
- 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>
2026-10-21 11:47:22 +02:00
Sheraff
c3101174ee
test(compiler-test-utils): final pass F-A: actionable explains, severity floor, exact caret, page and build guards
- 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>
2026-10-21 11:43:59 +02:00
Sheraff
e6dc22fc32
Merge branch 'compiler-tests/repair-b3' into compiler-tests/baseline
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>
2026-10-21 10:55:15 +02:00
Sheraff
cbe987cd72
test(router-plugin): restore the helper inventory concept; G15 pin reachable from an app
- 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>
2026-10-21 10:35:19 +02:00
Sheraff
ead40d14fc
Merge branch 'compiler-tests/repair-b1' into compiler-tests/baseline
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>
2026-10-21 10:35:18 +02:00
Sheraff
4acbd758f4
Merge branch 'compiler-tests/baseline' into compiler-tests/repair-b3 2026-10-21 09:47:37 +02:00
Sheraff
59676e2d7c
test(start-plugin-core): the warning-delivery control reads the build's merged channel once
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 09:38:14 +02:00
Sheraff
cebbdc4ec8
test(router-plugin): format two implementation-lane imports
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 09:27:14 +02:00
Sheraff
9680e5bbc7
test(start-plugin-core): restore three concepts the B2 reroute weakened
- 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>
2026-10-21 09:20:50 +02:00
Sheraff
fdffc1cd98
Merge branch 'compiler-tests/repair-b2' into compiler-tests/baseline
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>
2026-10-21 09:20:49 +02:00
Sheraff
d2092dbffb
Merge branch 'compiler-tests/repair-b2' into compiler-tests/repair-b3
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>
2026-10-21 09:15:16 +02:00
Sheraff
4c723ecedc
test(start-plugin-core): build harness on ctu's scoped build channel and Rsbuild logger; reports are warnings or errors
- 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>
2026-10-21 09:14:34 +02:00
Sheraff
0d75d07bfa
test(router-plugin): generator dev app diagnostics count output both captures received once
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 09:05:42 +02:00
Sheraff
2c4f167274
Merge branch 'compiler-tests/baseline' into compiler-tests/repair-b3 2026-10-21 09:01:12 +02:00
Sheraff
9d1e1c8f21
test(start-plugin-core): reader orients a chain by the step importing the specifier; reads the report's own frame next to a tool's frame
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>
2026-10-21 09:01:09 +02:00
Sheraff
ee0932f4e9
test(router-plugin): generator dev apps read what the generator prints from the dev server's own capture
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 09:00:46 +02:00
Sheraff
e9a0894fad
test(start-plugin-core): adaptive generated-name collision pin (names read from the served code)
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>
2026-10-21 08:58:30 +02:00
Sheraff
ef142b8105
test(router-plugin): a split-or-warn fallback needs a warning or an error, not an info line
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 08:55:41 +02:00
Sheraff
7ab64dac2b
Merge branch 'compiler-tests/baseline' into compiler-tests/repair-b2
# Conflicts:
#	packages/react-start-rsc/tests/rsc-css-diagnostics.test.ts
2026-10-21 08:55:25 +02:00
Sheraff
b70dc4df85
Merge branch 'compiler-tests/baseline' into compiler-tests/repair-b1 2026-10-21 08:54:13 +02:00
Sheraff
53c169ac9d
test(start-plugin-core): reload a page that loaded a re-optimized dependency; fix stale references
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 06:32:34 +02:00
Sheraff
a206b63e57
Merge branch 'compiler-tests/repair-b5-fix' into compiler-tests/baseline
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>
2026-10-21 06:26:27 +02:00
Sheraff
505f222d42
test(start-plugin-core): integration and import-protection tests through the public plugins, read by content (B3)
- 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>
2026-10-21 06:26:03 +02:00
Sheraff
ee306c8e46
test(router-plugin): generator dev pages settle on answered requests, not on a deleted module's hot import
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 06:22:37 +02:00
Sheraff
d7ebd24e56
test(compiler-test-utils): read Rsbuild's logger through its API, attribute native-callback output, record each compilation report once
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>
2026-10-21 06:09:16 +02:00
Sheraff
e9d130f601
test(router-generator): the route a tree creates comes from the target runtime
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>
2026-10-21 06:06:13 +02:00
Sheraff
5a6244c324
Merge branch 'compiler-tests/repair-b4' into compiler-tests/baseline
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>
2026-10-21 06:06:07 +02:00
Sheraff
514b442b3b
test: point the not-yet-migrated B3/B5 importers at the legacy helpers; export StartPreview; lint
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 05:39:44 +02:00
Sheraff
6ff1aaf252
Merge branch 'compiler-tests/b2-fork-d' into compiler-tests/repair-b2 2026-10-21 05:36:07 +02:00
Sheraff
13e0ae6edf
test(start-plugin-core): host page-run timeout, edit() guard on hosts with cases; edit dirs exist before the dev server starts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 05:36:07 +02:00
Sheraff
7ef5bf486b
test(start-plugin-core): Hydrate suites through the public Start plugin and real browser hydration
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>
2026-10-21 05:34:12 +02:00
Sheraff
5b2ca2c86f
Merge branch 'compiler-tests/b2-fork-c' into compiler-tests/repair-b2
# Conflicts:
#	packages/start-plugin-core/tests/integration/start-compiler-build-ids.test.ts
#	packages/start-plugin-core/tests/start-host.ts
2026-10-21 05:30:59 +02:00
Sheraff
472a2adfce
test(start-plugin-core): factories suite on the public Start host; production env fns; host defaults of the lead; dev factory edit pin
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 05:28:43 +02:00
Sheraff
0c1f036ded
test(start-plugin-core): drop the per-suite host-default shims (now host defaults)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 05:27:32 +02:00
Sheraff
899eacc8f3
test(router-plugin): drop the unused Node render and evaluateServed stub key of the dev-server harness
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 05:25:17 +02:00
Sheraff
b2857ec92e
test(compiler-test-utils): console output from native bundler callbacks reaches every open channel
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>
2026-10-21 05:24:54 +02:00
Sheraff
635429f5e7
Merge branch 'compiler-tests/b2-fork-b' into compiler-tests/repair-b2 2026-10-21 05:24:52 +02:00
Sheraff
004899c713
Merge branch 'compiler-tests/repair-b5' into compiler-tests/baseline
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>
2026-10-21 05:24:40 +02:00
Sheraff
ee74accae0
test(start-plugin-core): reroute known-bugs-start-compiler, compiler and createMiddleware tests through the public Start host
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>
2026-10-21 05:23:30 +02:00
Sheraff
eb6d2fedb7
test(router-plugin): Node-evaluation harness leaves the corpus helpers; lazy checks fail on a broken chunk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 05:23:27 +02:00
Sheraff
d073ab3a6a
Merge branch 'compiler-tests/b2-fork-a' into compiler-tests/repair-b2 2026-10-21 05:16:35 +02:00
Sheraff
37555e891d
Merge branch 'compiler-tests/repair-b1-f4' into compiler-tests/repair-b1 2026-10-21 05:16:20 +02:00
Sheraff
bfe553b6fb
Merge branch 'compiler-tests/repair-b1-f7' into compiler-tests/repair-b1 2026-10-21 05:16:20 +02:00
Sheraff
2519f4bb68
test(start-plugin-core): host defaults: app tsconfig with verbatimModuleSyntax, import protection off unless configured
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 05:16:16 +02:00
Sheraff
3478b2204c
test(start-plugin-core): integration harnesses on the built public Start plugins (WIP B3)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 05:15:44 +02:00
Sheraff
243810da67
test(router-plugin): a route compiled for HMR works under a module runner without HMR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 05:14:40 +02:00
Sheraff
7e981e68bc
test(start-plugin-core): createServerFn suites on the public Start host
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>
2026-10-21 05:14:28 +02:00
Sheraff
81b119f6c7
test(router-generator): observe diagnostics and async consumer outcomes
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>
2026-10-21 05:13:50 +02:00
Sheraff
d5bbdb9528
Merge branch 'compiler-tests/repair-b1-f9' into compiler-tests/repair-b1 2026-10-21 05:11:11 +02:00
Sheraff
af8d937b82
test(router-plugin): route HMR, React Refresh and dev-server unit tests in the browser route app
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>
2026-10-21 05:10:32 +02:00
Sheraff
93c8b1ee06
test: repair RSC compiler oracle and noncompiler lanes
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>
2026-10-21 05:09:46 +02:00
Sheraff
0d6823a305
Merge branch 'compiler-tests/repair-b1' into compiler-tests/repair-b1-f3
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>
2026-10-21 05:08:50 +02:00
Sheraff
5680631a26
Merge branch 'compiler-tests/repair-b1' into compiler-tests/repair-b1-f7 2026-10-21 05:08:02 +02:00
Sheraff
2fb2ad5d14
wip f7 2 2026-10-21 05:08:02 +02:00
Sheraff
ec4a4801db
Merge branch 'compiler-tests/repair-b1' into compiler-tests/repair-b1-f4 2026-10-21 05:05:41 +02:00
Sheraff
dfd548cd6d
Merge branch 'compiler-tests/repair-b1-f6' into compiler-tests/repair-b1
# Conflicts:
#	packages/router-plugin/tests/route-app.ts
2026-10-21 05:05:22 +02:00
Sheraff
9b6c6b879c
test(start-plugin-core): jsx pragma and server fn id suites on the public Start host; build ids and determinism through real builds
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 05:04:39 +02:00
Sheraff
ad2e022919
test(router-plugin): imports/exports and scope tests in the browser route app; import attributes judged by webpack
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>
2026-10-21 05:03:17 +02:00
Sheraff
8e5e89ef67
Merge branch 'compiler-tests/repair-b1' into compiler-tests/repair-b1-f9 2026-10-21 05:03:08 +02:00
Sheraff
e0d0e09a8d
test(router-plugin): known code-splitter bugs from groupings to look-alike factories in the browser route app
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 05:03:00 +02:00
Sheraff
81a1c534e6
test(router-plugin): integration tier through public entry points and outcome-based observations
- 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>
2026-10-21 05:02:54 +02:00
Sheraff
0caba0ef29
Merge compiler-tests/repair-b1 into compiler-tests/repair-b1-f1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 04:59:49 +02:00
Sheraff
0e3be0426e
Merge branch 'compiler-tests/repair-b1' into compiler-tests/repair-b1-f3
# Conflicts:
#	packages/router-plugin/tests/route-app.ts
2026-10-21 04:58:56 +02:00
Sheraff
4736b6aad1
Merge branch 'compiler-tests/repair-b1' into compiler-tests/repair-b1-f7 2026-10-21 04:58:13 +02:00
Sheraff
78a1811808
wip f7 2026-10-21 04:58:13 +02:00
Sheraff
9c911bc6da
Merge branch 'compiler-tests/repair-b1' into compiler-tests/repair-b1-f4 2026-10-21 04:58:08 +02:00
Sheraff
e2b3943316
test(router-plugin): dead code, plugin pipeline, options and plugin context through the public route app
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 04:58:08 +02:00
Sheraff
3370a8d690
test(router-plugin): imports/exports and scope tests on the route app (F3 wip)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 04:58:00 +02:00
Sheraff
17191087b1
test(router-plugin): module-state, jsx and determinism tests run in the shared browser page
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 04:57:27 +02:00
Sheraff
7c981b9987
Merge branch 'compiler-tests/repair-b1-f5' into compiler-tests/repair-b1 2026-10-21 04:56:21 +02:00
Sheraff
7b294d7bdd
Merge branch 'compiler-tests/repair-b1-f2' into compiler-tests/repair-b1 2026-10-21 04:56:17 +02:00
Sheraff
12d0049dc8
test(start-plugin-core): import forms, v2 inputs, runtime contract and user-code suites on the public Start host
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 04:56:00 +02:00
Sheraff
428b382dda
test(router-plugin): route options, imported options and pragmas tests in the browser route app
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 04:54:42 +02:00
Sheraff
5eb2ee4dcd
test(router-plugin): known code-splitter bugs (module state, shapes, chunk contents, names) in the route app
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 04:53:21 +02:00
Sheraff
d3b4443f74
test(router-plugin): pin injected route HMR code reading a user's Map
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 04:49:06 +02:00
Sheraff
6c20fe0648
test(start-plugin-core): compile failures read every channel (CompileFailure)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 04:48:19 +02:00
Sheraff
c68c106dd2
Merge branch 'compiler-tests/repair-b1-f8' into compiler-tests/repair-b1 2026-10-21 04:47:20 +02:00
Sheraff
32bbb6baec
test(router-plugin): route app controls; type a route or its modules without the in narrowing
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 04:47:20 +02:00
Sheraff
63d581ee0c
test(router-plugin): route updates on a real page; updater controls leave the corpus except Q5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 04:44:28 +02:00
Sheraff
09631dece1
test(start-plugin-core): host controls; legacy helper controls outside the corpus; handler spread diagnostic in the corpus
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 04:44:18 +02:00
Sheraff
75d349fc66
test(start-plugin-core): production mode of the Start host (vite build + Start's preview server)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 04:39:07 +02:00
Sheraff
1fe233132c
test(router-generator): decouple compiler acceptance consumers
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>
2026-10-21 04:38:17 +02:00
Sheraff
12a10bd126
test(start-plugin-core): public Start host for the fast tier; legacy internal helpers outside the corpus
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>
2026-10-21 04:31:07 +02:00
Sheraff
6c5f726e04
test(router-plugin): route app on the public plugin host, client checks in the shared page
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 04:29:13 +02:00
Sheraff
00317474fd
test(compiler-test-utils): Vite dangling-name evidence per module id, not per file
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>
2026-10-21 03:58:38 +02:00
Sheraff
bfda16f6e2
Merge branch 'compiler-tests/repair-a2' into compiler-tests/baseline
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>
2026-10-21 03:52:55 +02:00
Sheraff
35c21eb954
test(compiler-test-utils): public plugin hosts, one diagnostic channel, outcome-based settling
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>
2026-10-21 03:32:47 +02:00
Sheraff
b15685ff01
docs(compiler-test-utils): complete the oracle status notice
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>
2026-10-21 02:50:35 +02:00
Sheraff
f53c0d92ba
Merge branch 'compiler-tests/repair-a1' into compiler-tests/baseline
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>
2026-10-21 02:49:03 +02:00
Sheraff
2fb685012d
test(compiler-test-utils): import gate for compiler internals; oracle docs state the current truth
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>
2026-10-21 02:43:43 +02:00
Sheraff
1c4c5218dc
docs(compiler-test-utils): oracle documents for compiler implementers
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>
2026-10-20 23:41:24 +02:00
Sheraff
81650d9d07
test(start-plugin-core): renamed env-only factories read through a namespace import
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>
2026-10-20 23:41:24 +02:00
Sheraff
407ae76129
test(start-plugin-core): unpin the z.object() dev hang fixed by #8758
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>
2026-10-20 22:46:25 +02:00
Sheraff
0c1a4ad98b
Merge origin/main (ed5577593a) into compiler-tests/baseline
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>
2026-10-20 22:42:18 +02:00
Sheraff
7458b3676c
Merge branch 'compiler-tests/w6-restore' into compiler-tests/baseline
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>
2026-10-20 22:25:06 +02:00
Sheraff
e37405865d
Merge branch 'compiler-tests/w6-flakes' into compiler-tests/baseline
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>
2026-10-20 22:15:49 +02:00
Sheraff
7833338b09
test(start-plugin-core): require string export names; restore the server-only alias block row
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>
2026-10-20 22:14:34 +02:00
Sheraff
14a6ed31ca
test(start-plugin-core): keep the Vite marker-exemption pin red in every build
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>
2026-10-20 22:06:08 +02:00
Sheraff
c450a6d3bb
test(start-plugin-core): read the Vite client fixture from one document
`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>
2026-10-20 22:06:01 +02:00
Sheraff
f1581dd923
test(start-plugin-core): restore the top-level block and unrecognised call shape inputs
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>
2026-10-20 21:46:15 +02:00
Sheraff
9a4929a695
Merge branch 'compiler-tests/w6-scope' into compiler-tests/baseline
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>
2026-10-20 21:14:41 +02:00
Sheraff
c6d82a253c
test(router-plugin): name the cause of the Rsbuild unsplit Solid route HMR pin
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>
2026-10-20 20:56:49 +02:00
Sheraff
75d1aa8fe5
test(start-plugin-core): drop the visible() runtime pin from the compiler corpus
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>
2026-10-20 20:48:25 +02:00
Sheraff
4603fcb42a
Merge branch 'compiler-tests/w5-flakes' into compiler-tests/baseline
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>
2026-10-20 20:18:32 +02:00
Sheraff
2846075981
test(start-plugin-core): pin the visible() boundary's concurrent-render error; client-mount rows scroll to an idle boundary
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>
2026-10-20 20:05:08 +02:00
Sheraff
7d6aaa3dd9
test(router-plugin): generator dev app settles the page too, and never refetches failed scripts
"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>
2026-10-20 20:05:08 +02:00
Sheraff
37b996619e
test(compiler-test-utils): a Vite build ends once every hook it started settled
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>
2026-10-20 20:05:08 +02:00
Sheraff
e22a025564
Merge branch 'compiler-tests/w5-fixup' into compiler-tests/baseline
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>
2026-10-20 16:04:30 +02:00
Sheraff
86da53c400
test(compiler-test-utils): budget reporter treats failed runs as no measurement
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>
2026-10-20 15:59:25 +02:00
Sheraff
eb0af2a0d9
test(react-start-rsc): build react-start-client before test:unit
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>
2026-10-20 15:59:25 +02:00
Sheraff
322411da15
Merge branch 'compiler-tests/w5-final' into compiler-tests/baseline
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>
2026-10-20 15:22:59 +02:00
Sheraff
656a858a33
test(start-plugin-core): a resolve-elsewhere edit may report its in-between unresolved state
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>
2026-10-20 14:38:00 +02:00
Sheraff
f933efb6d5
test(compiler-test-utils): Rsbuild harness starts on predated files and attributes compiles to edits by file state
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>
2026-10-20 14:38:00 +02:00
Sheraff
8fdba5852d
test(start-plugin-core): the MDX page's genuine use is at 7:27, not 7:24
`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>
2026-10-20 13:04:03 +02:00
Sheraff
bd28724e33
test(compiler-tests): pin Source lines point at the product cause
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>
2026-10-20 12:59:06 +02:00
Sheraff
8c3b2df5b8
test(compiler-test-utils): importedBindingUses counts only runtime references to the import
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>
2026-10-20 12:59:06 +02:00
Sheraff
561ac85fec
test(compiler-test-utils): wait for Vite's full-bundle initial build before closing
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>
2026-10-20 12:58:58 +02:00
Sheraff
0d4d35c6cb
Merge branch 'compiler-tests/w5-ip' into compiler-tests/baseline
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>
2026-10-20 12:15:51 +02:00
Sheraff
3e91abe1e9
style(compiler-tests): prettier and import order (W5-ip files)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 11:51:24 +02:00
Sheraff
7f2e9d610f
test(start-plugin-core): one Chromium client runner for the dev-server tests
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>
2026-10-20 11:17:38 +02:00
Sheraff
2bd3dc0346
test(start-plugin-core): import-protection location checks on the shared oracle
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>
2026-10-20 10:51:54 +02:00
Sheraff
699cb5bd99
Merge branch 'compiler-tests/w5-polish' into compiler-tests/baseline
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>
2026-10-20 10:49:01 +02:00
Sheraff
812023ffd4
Merge branch 'compiler-tests/w4-hydrate-rsc' into compiler-tests/baseline
W4-hydrate-rsc acceptance fixes (hydrate-rsc-SYNTH H01-H09; H10, the
spc render.ts virtual-id host restriction, stays with the shared owner):
RSC CSS diagnostics and conditional/model/look-alike outcomes, server
CSS contamination controls, public-URL D6 refusal, request-based Hydrate
independence and edit observations, and rows for the V4 round-2 escapes
astra-r2/10-13, 19, 20 and fable-r2/14. Tests only; no conflicts. The
branch already uses the shared ctu diagnostics and browser helpers.

Validated (Nx, --skip-nx-cache, --maxWorkers=4): spc types/eslint pass,
unit 919/189 (1108), integration 848/202 (1050) x2, implementation
245/7 (252); rsc types/eslint pass, unit 50/1 (51), integration 108/11
(119) x2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 10:34:40 +02:00
Sheraff
584a762d4c
test(compiler-test-utils): name files absolute or project-relative only
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>
2026-10-20 10:30:47 +02:00
Sheraff
e0070dae57
Merge branch 'compiler-tests/w4-ip' into compiler-tests/baseline
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>
2026-10-20 10:08:58 +02:00
Sheraff
dfa050f48d
test(start-plugin-core): dispatch the in-process client host through the virtual module contract (H10)
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>
2026-10-20 09:49:14 +02:00
Sheraff
f7e3981bc5
test(start-plugin-core): take Miniflare from a test-only devDependency
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>
2026-10-20 09:46:09 +02:00
Sheraff
1b61203efa
test(compiler): name user-visible impacts and sources of three pins
- 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>
2026-10-20 09:43:39 +02:00
Sheraff
6ad87ba780
test(router-plugin): restore the window-defined variation of the HMR-06 rows
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>
2026-10-20 09:42:33 +02:00
Sheraff
619d42754d
test(router-generator): clear leftover route files before preparing the file-modification fixture
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>
2026-10-20 09:42:33 +02:00
Sheraff
b0f74b0cf9
test(rsc): strengthen CSS delivery and Flight semantics coverage
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>
2026-10-20 09:38:54 +02:00
Sheraff
9fc102aea1
test(start): strengthen the Hydrate compiler oracle
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>
2026-10-20 09:38:54 +02:00
Sheraff
8fe0694a42
test(start): repair import-protection compiler outcome oracles
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>
2026-10-20 09:36:47 +02:00
Sheraff
d863de0a6b
Merge branch 'compiler-tests/w4-shared' into compiler-tests/baseline
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>
2026-10-20 09:36:16 +02:00
Sheraff
484cac89e0
Merge branch 'compiler-tests/w4-start' into compiler-tests/baseline
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>
2026-10-20 09:07:49 +02:00
Sheraff
975a7a7796
test(compiler-test-utils): check for dangling names only the modules the compilers under test produced or changed
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>
2026-10-20 09:05:13 +02:00
Sheraff
29b8681040
test(compiler-test-utils): a free name a dependency reads in its own source is not a dangling-name defect
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>
2026-10-20 08:52:24 +02:00
Sheraff
9447f7d423
Merge branch 'compiler-tests/w4-split' into compiler-tests/baseline
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>
2026-10-20 08:45:46 +02:00
Sheraff
26d0985339
test(start): catch async receiver and client transport escapes
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>
2026-10-20 08:40:07 +02:00
Sheraff
b424184a8c
test(start): repair compiler oracle and use real host consumers
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>
2026-10-20 08:40:07 +02:00
Sheraff
3e0bd43c8a
Merge branch 'compiler-tests/w4-hmr' into compiler-tests/baseline
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>
2026-10-20 08:29:02 +02:00
Sheraff
0b43d7f935
test(router-plugin): count bundle atoms once per chunk
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>
2026-10-20 08:23:35 +02:00
Sheraff
0338a3964c
Merge branch 'compiler-tests/w3-loadflakes' into compiler-tests/baseline
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>
2026-10-20 08:16:28 +02:00
Sheraff
76d2fcbbac
test(router-plugin): format
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 08:14:15 +02:00
Sheraff
5aa6e3e7c3
test(router-plugin): harness controls run outside the corpus; the out-of-order pins accept any graph layout
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>
2026-10-20 08:12:57 +02:00
Sheraff
d46adb25b2
test(router-plugin): keep the handleRouteUpdate tests in the corpus, labelled as owned-runtime controls
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>
2026-10-20 08:07:59 +02:00
Sheraff
bdbc209d83
test(router-plugin): strengthen HMR outcome coverage
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>
2026-10-20 08:07:19 +02:00
Sheraff
4da047d5d7
test(compiler-test-utils): stop a dev server without removing its app, and read every channel a dev app prints through
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>
2026-10-20 08:04:09 +02:00
Sheraff
d8692a7342
Merge branch 'compiler-tests/w4-gen' into compiler-tests/baseline
W4-gen acceptance fixes for the generator slice (gen-SYNTH G01-G27 local
parts, V4 round-2 rows astra-r2/01-03, green-sol-r2/01). Tests only.

Validated (Nx, --skip-nx-cache, --maxWorkers=4): rg types/eslint pass,
rg unit 354/28 (382), rg integration 60/3 (63) x2, rp unit 450/180 (630),
rp integration 359/179 (538, 43 files) x2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 08:03:23 +02:00
Sheraff
1f9a32d0dd
test(compiler): select the corpus by default and run implementation tests in their own targets
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>
2026-10-20 07:59:23 +02:00
Sheraff
29f06cdb96
Merge branch 'compiler-tests/w4-shared-b' into compiler-tests/w4-shared 2026-10-20 07:56:58 +02:00
Sheraff
a418db034c
style(compiler-test-utils): format
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 07:54:56 +02:00
Sheraff
ce1d20e22e
Merge branch 'compiler-tests/w4-shared-e' into compiler-tests/w4-shared 2026-10-20 07:54:44 +02:00
Sheraff
cd0a9f0590
Merge branch 'compiler-tests/w4-shared-d' into compiler-tests/w4-shared 2026-10-20 07:54:44 +02:00
Sheraff
0cc76bc1f1
Merge branch 'compiler-tests/w4-shared-c' into compiler-tests/w4-shared 2026-10-20 07:54:44 +02:00
Sheraff
108d7e4e24
test(compiler): attribute dev-only support in production by paired builds, and inspect the whole excluded dev graph
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>
2026-10-20 07:50:21 +02:00
Sheraff
9e778ed2db
test(router-plugin): follow every app and virtual module from the served route module, not only same-path ids
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>
2026-10-20 07:48:49 +02:00
Sheraff
16edd8ed17
test(router-plugin): restore the 'route created inside a function' block cut off by the S02 edit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 07:48:14 +02:00
Sheraff
af7e6ce35e
test(compiler-test-utils): the self-test's generator writes atomically
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>
2026-10-20 07:46:58 +02:00
Sheraff
7f56fb84ab
test(compiler-tests): format and lint the shared diagnostic oracle changes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 07:46:27 +02:00
Sheraff
b552becb0d
test(router-generator): type the helper-module rows of the upkeep test as tuples
The vitest typecheck reported the destructured helper path and source as
possibly undefined.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 07:36:49 +02:00
Sheraff
138b8611d4
test(start-plugin-core): count a dynamic import as a load only where a production bundler keeps it
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>
2026-10-20 07:34:59 +02:00
Sheraff
498067923f
test(router-plugin): parity of values, reverse activation and every grouping setting; property-write cells per bundler and hint
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>
2026-10-20 07:32:49 +02:00
Sheraff
c45f0b2bd1
test(router-plugin): generator failure reports from any channel, recovery checked after the fix
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>
2026-10-20 07:31:12 +02:00
Sheraff
e543c2c92f
test(compiler-test-utils): check every production client artifact for dangling names, unminified webpack and Rspack included
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>
2026-10-20 07:30:10 +02:00
Sheraff
cb3ea3d8d9
test(router-plugin): format the in-process host
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 07:29:36 +02:00
Sheraff
e26da616e8
test(router-generator): rows for the V4 round-2 escapes (Unicode token, duplicate aliases, empty ignore prefix)
- 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>
2026-10-20 07:29:14 +02:00
Sheraff
43c48053a9
test(router-plugin): close V4 round-2 split escapes (private-method dependency, wrapped const component)
- 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>
2026-10-20 07:28:39 +02:00
Sheraff
c5fe57a914
test(router-plugin): name the helper-function route pin after its outcome
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 07:28:17 +02:00
Sheraff
382914bd74
test(compiler): real-watcher rows for virtual config edits and dev server shutdown, and look-alike route constructors
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>
2026-10-20 07:28:17 +02:00
Sheraff
a06396f30f
test(router-plugin): read generator reports on every channel, and scope recovery to the fix
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>
2026-10-20 07:28:08 +02:00
Sheraff
b244671c40
test(router-plugin): a diagnostic never stands in for a working fallback edit
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>
2026-10-20 07:27:58 +02:00
Sheraff
df6fc22555
test(router-plugin): outcome-only harness, identity, HMR and source-map rows
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>
2026-10-20 07:27:17 +02:00
Sheraff
1356241f94
test(compiler-test-utils): watcher readiness across all compilers; control tests
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>
2026-10-20 07:26:05 +02:00
Sheraff
7418862cef
test(router-plugin): the out-of-order dev edit pins render in a real browser page, and walks follow every app module
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>
2026-10-20 07:24:12 +02:00
Sheraff
e4be509c0c
test(start-plugin-core): run the Rsbuild dev server's client code in a real browser
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>
2026-10-20 07:22:58 +02:00
Sheraff
98aeea4b42
test(compiler-test-utils): let a browser page get its document and an init script
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>
2026-10-20 07:22:50 +02:00
Sheraff
0e8432425e
test(router-plugin): plugin-order outcomes by name aliases; Solid refresh pragma compared with the unsplit app
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>
2026-10-20 07:22:41 +02:00
Sheraff
c7e078f2d5
test(start-plugin-core): import-protection locations through the shared location oracle
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>
2026-10-20 07:22:32 +02:00
Sheraff
a440ba61c7
test(router-plugin): route tree loaded by the real router, dev map columns, React Compiler placement outside the corpus
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>
2026-10-20 07:19:45 +02:00
Sheraff
2383e72b03
test(router-generator): give the route-groups fixture's (bar)/_layout children their own layout
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>
2026-10-20 07:17:44 +02:00
Sheraff
1474a3f291
test(router-generator): read route types through the router's public type API, not generated type names
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>
2026-10-20 07:16:55 +02:00
Sheraff
398c848953
test(compiler): compare what compiled code does across roots and orders, not bytes
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>
2026-10-20 07:16:43 +02:00
Sheraff
b39c53ff47
test(router-plugin): the in-process host follows every module the plugins emit, and reports what they log
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>
2026-10-20 07:15:46 +02:00
Sheraff
77f1f4fc51
test(router-plugin): name- and printer-free comparison of production bundles with the HMR-off control
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>
2026-10-20 07:15:38 +02:00
Sheraff
c21f3f87e3
test(start-plugin-core): compile errors are read in prose, with causes and API alternatives
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>
2026-10-20 07:15:08 +02:00
Sheraff
19fec3aca1
test(router-generator): require Vue piece files to load lazily, not with the route tree
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>
2026-10-20 07:14:14 +02:00
Sheraff
2adf4472ef
test(router-generator): check option outcomes on the route file imports, footer lines and every log channel
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>
2026-10-20 07:13:17 +02:00
Sheraff
fe2e03e4ec
test(router-plugin): outcome-only state, identity and option checks; real imported options source
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>
2026-10-20 07:11:39 +02:00
Sheraff
7f47f1df43
test(compiler-test-utils): shared prose, cause and reported-location oracles
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>
2026-10-20 07:11:07 +02:00
Sheraff
256166eed5
test(router-generator): accept the permitted upkeep outcomes and give the upkeep inputs real modules
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>
2026-10-20 07:10:59 +02:00
Sheraff
d46feb5439
test(compiler-test-utils): observe lazy loading by awaiting the real trigger
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>
2026-10-20 07:10:23 +02:00
Sheraff
0d05cbe3d2
test(router-plugin): semantic reuse/cachebuster checks, real Vue route HMR, look-alike provenance
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>
2026-10-20 07:08:27 +02:00
Sheraff
8db0ac1324
test(router-generator): compare routes and diagnostics, not tree text, across listing orders and cwds
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>
2026-10-20 07:08:06 +02:00
Sheraff
077ff1704c
test(router-generator): target each publication failure, and move the staging cleanup pin outside the corpus
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>
2026-10-20 07:06:57 +02:00
Sheraff
abc64ac49a
test(router-plugin): real classic JSX factories, name-free class absence and Solid deleteNodes bindings
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>
2026-10-20 07:04:15 +02:00
Sheraff
e0b305437a
test(router-generator): accept correct routing without a diagnostic for (group).tsx files
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>
2026-10-20 07:03:21 +02:00
Sheraff
8b3a1c94b9
test(router-generator): check fixture lazy files on demand instead of an exact load inventory
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>
2026-10-20 07:01:54 +02:00
Sheraff
3f204542c0
test(router-generator): compare untouched router imports byte for byte in expectOnlyOwnedEdits
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>
2026-10-19 21:54:30 +02:00
Sheraff
ba3e1be212
test(compiler-test-utils): wait for Rspack's watcher to scan the app before edits
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>
2026-10-19 21:32:03 +02:00
Sheraff
70c7fe97c6
Merge branch 'compiler-tests/w3-budgets' into compiler-tests/baseline
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 21:07:40 +02:00
Sheraff
4b98f43d5f
test(compiler): local test budgets with an opt-in strict check, and a fast-slice guide
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>
2026-10-19 21:04:08 +02:00
Sheraff
15aa391d8f
test(router-generator): pin the temporary file left when a save makes a fix unnecessary
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>
2026-10-19 21:04:01 +02:00
Sheraff
415d026951
test(react-start-rsc): V2-13 Rsbuild row edits the handler, then the component, in one session
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>
2026-10-19 21:03:57 +02:00
Sheraff
26d0369d5f
Merge branch 'compiler-tests/w3-harness2' into compiler-tests/baseline
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>
2026-10-19 20:09:16 +02:00
Sheraff
01eb629489
test(start-plugin-core): settle across a turn of the event loop between Rsbuild edits
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>
2026-10-19 19:26:33 +02:00
Sheraff
7d398cb5ae
test(start-plugin-core): lint fixes in the import-protection test files
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>
2026-10-19 19:14:20 +02:00
Sheraff
58a1b93e21
test(start-plugin-core): settle before each step's first removal on Rsbuild
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>
2026-10-19 17:56:58 +02:00
Sheraff
ef046c4951
Merge branch 'compiler-tests/w3-speed-rp' into compiler-tests/baseline
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>
2026-10-19 17:20:53 +02:00
Sheraff
64ca1908cd
test(start-plugin-core): one file per Rsbuild edit; V2-14 Rsbuild page row; deterministic Vite pin read
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>
2026-10-19 17:19:14 +02:00
Sheraff
734b0204f8
test(router-plugin): generator temp files of harness builds in a run-scoped directory
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>
2026-10-19 16:48:37 +02:00
Sheraff
e975101e88
test(start-plugin-core): v2-edits Rsbuild rows read the last compile's warnings
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>
2026-10-19 16:40:50 +02:00
Sheraff
030f045a8b
Merge branch 'compiler-tests/w3-speed-spc' into compiler-tests/baseline
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>
2026-10-19 16:35:54 +02:00
Sheraff
3c127288b0
test(router-plugin): unminified webpack robustness app (speedup 5)
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>
2026-10-19 16:12:55 +02:00
Sheraff
acbc092bfe
test(compiler-test-utils): settleRounds option; faster reload-loop control test
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>
2026-10-19 16:12:31 +02:00
Sheraff
c1fe785595
test(compiler-test-utils): drop the unused jsdom dependency
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>
2026-10-19 16:12:31 +02:00
Sheraff
2b265e7e88
test(start-plugin-core): read Rsbuild dev diagnostics of every compile
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>
2026-10-19 16:12:31 +02:00
Sheraff
1b5a169898
test(compiler-test-utils): keep every compile's diagnostics in the Rsbuild dev harness
`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>
2026-10-19 16:12:31 +02:00
Sheraff
1bab2b49f0
test(react-start-rsc): V2-13 component edit on Rsbuild with React Refresh
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>
2026-10-19 15:51:34 +02:00
Sheraff
4209d5d630
test(start-plugin-core): speed pass on hydrate-dev and known-bugs-start-compiler
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>
2026-10-19 15:51:26 +02:00
Sheraff
6e57c3fb99
test(start-plugin-core): Hydrate rejection checks without the code-frame parser
`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>
2026-10-19 15:51:16 +02:00
Sheraff
a835499d2f
test(start-plugin-core): lint the tests
`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>
2026-10-19 15:51:06 +02:00
Sheraff
7b132271d8
test(router-plugin, router-generator): lint the tests
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>
2026-10-19 15:24:41 +02:00
Sheraff
32dc97abda
test(router-plugin): one robustness app per bundler (speedup 6)
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>
2026-10-19 15:24:33 +02:00
Sheraff
fd4c2c7fdc
test(router-plugin): drop matrix cells the transform decides (speedup 7)
- 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>
2026-10-19 15:24:33 +02:00
Sheraff
a1e05c89e3
test(router-plugin): one Rsbuild generator pin per file
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>
2026-10-19 15:24:25 +02:00
Sheraff
908c0c5018
test(router-plugin): route HMR page pins in two files
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>
2026-10-19 15:24:25 +02:00
Sheraff
70cf9bc578
test(router-plugin): production bundle checks in two files; one pin per NODE_ENV bug
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>
2026-10-19 15:24:25 +02:00
Sheraff
59bebd611e
test(router-plugin): generator temp files of harness builds go with the app
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>
2026-10-19 15:24:13 +02:00
Sheraff
f58b6b313f
Merge compiler-tests/baseline into compiler-tests/w3-harness2 2026-10-19 15:10:10 +02:00
Sheraff
95ca55a54d
test(start-plugin-core): V2-14 Rsbuild: recreate the targets with the step's edit
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>
2026-10-19 14:46:54 +02:00
Sheraff
2d3243892e
Merge branch 'compiler-tests/w3-solid-rsbuild' into compiler-tests/baseline
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>
2026-10-19 14:44:26 +02:00
Sheraff
11051d6f79
Merge branch 'compiler-tests/w3-compose' into compiler-tests/baseline
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>
2026-10-19 14:30:16 +02:00
Sheraff
26a7a08540
test(start-plugin-core): import-protection boundary transitions in dev (V2-14)
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>
2026-10-19 14:28:48 +02:00
Sheraff
b3245dc7e5
test(start-plugin-core): Rsbuild dev exemptions, onViolation false (sync and async), custom entries (V2-18)
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>
2026-10-19 14:28:48 +02:00
Sheraff
7944428032
test(start-plugin-core): client.files / server.files replace the default file rules (V2-21)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 14:28:48 +02:00
Sheraff
a769cd128d
test(start-plugin-core): type-only edges through real hosts (V2-22)
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>
2026-10-19 14:28:48 +02:00
Sheraff
96eaf9354c
test(start-plugin-core): import protection through tsconfig path aliases (V2-04)
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>
2026-10-19 14:28:48 +02:00
Sheraff
b746c0c915
test(start-plugin-core): cast the host's request body through unknown for every TS version
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>
2026-10-19 14:17:49 +02:00
Sheraff
936415052a
test(start-plugin-core): V2-20 Solid row on Start's Rsbuild dev server
`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>
2026-10-19 12:17:28 +02:00
Sheraff
bcd71fbae2
test(start-plugin-core): build the Solid Rsbuild page app in development mode
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>
2026-10-19 12:17:28 +02:00
Sheraff
3ae87f2910
build: bump @rsbuild/plugin-solid to ^1.2.2 (solid-refresh 0.7 broke Solid hydration in Rsbuild dev)
@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>
2026-10-19 12:12:49 +02:00
Sheraff
83d46b5b5b
test(router-plugin): imported route options and dev/build split parity (V2-10, V2-16)
- 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>
2026-10-19 12:04:07 +02:00
Sheraff
4fe0a5b64b
test(start-plugin-core): compose the Start compiler, splitter and import protection on real served apps (V2-01/03/06/10/27)
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>
2026-10-19 12:03:48 +02:00
Sheraff
5d1e23d5e1
Merge branch 'compiler-tests/w3-start-v2' into compiler-tests/baseline
# Conflicts:
#	packages/start-plugin-core/tests/build-harness.ts
2026-10-19 11:47:08 +02:00
Sheraff
8418c4fefc
Merge branch 'compiler-tests/w3-infra' into compiler-tests/baseline 2026-10-19 11:33:05 +02:00
Sheraff
1267ec25ca
Merge branch 'compiler-tests/w3-hydrate' into compiler-tests/baseline
# Conflicts:
#	packages/start-plugin-core/tests/build-harness.ts
#	packages/start-plugin-core/tests/dev-server.ts
2026-10-19 11:26:50 +02:00
Sheraff
c9a856193f
test(start-plugin-core): real-build V2 gaps (V2-02, 05, 07, 08, 09, 11, 12, 15b, 17, 24, 25, 32)
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>
2026-10-19 11:22:00 +02:00
Sheraff
27150d6ce8
test(start-plugin-core): compiler-level V2 inputs (V2-02, V2-08, V2-11, V2-25, V2-31)
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>
2026-10-19 11:22:00 +02:00
Sheraff
fe73b1758c
test(start-plugin-core): buildStart takes extra app symlinks
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>
2026-10-19 11:22:00 +02:00
Sheraff
ec79d7366c
test(router-plugin): one pin for the loader-assigned shared let
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>
2026-10-19 11:19:20 +02:00
Sheraff
16295e60fd
test(react-start-rsc): the chained renderServerComponent pin is the only one of its root cause
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>
2026-10-19 11:19:19 +02:00
Sheraff
2730035bbd
test(router-plugin): delete the unused exportedNames helper
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 11:19:19 +02:00
Sheraff
7344c9ab21
test(compiler-test-utils): mentionsFile reads file names with brackets
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>
2026-10-19 11:19:19 +02:00
Sheraff
97d57dde7e
test(router-generator): one Vitest run for the unit and types projects
`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>
2026-10-19 11:19:19 +02:00
Sheraff
afc379fcc2
test(compiler-test-utils): remove the dev servers' saving directory with the app
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>
2026-10-19 11:19:19 +02:00
Sheraff
57f1af89ae
test(compiler-test-utils): dev servers bind their own port
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>
2026-10-19 11:19:19 +02:00
Sheraff
d31010470c
Merge branch 'compiler-tests/w3-ip' into compiler-tests/baseline 2026-10-19 11:18:15 +02:00
Sheraff
c28526162a
test(start-plugin-core): drop an MDX option @mdx-js/rollup sets itself
@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>
2026-10-19 11:16:19 +02:00
Sheraff
66cae39174
test(start-plugin-core): hydrate-dev reads a settled page after each edit; edit() type fits both dev harnesses
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>
2026-10-19 11:11:16 +02:00
Sheraff
6352ace55e
test(start-plugin-core): the shadowing location rows read the import like the shadows do
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>
2026-10-19 10:55:51 +02:00
Sheraff
d60d312a83
test(start-plugin-core): Hydrate rows on Rsbuild for Solid pages and React dev edits
- 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>
2026-10-19 10:53:47 +02:00
Sheraff
562fa93b9d
test(start-plugin-core): Rsbuild React/Solid/Babel plugins as devDeps for Hydrate rows on Rsbuild
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>
2026-10-19 10:45:22 +02:00
Sheraff
1a69ba8902
test(start-plugin-core): dev rows for dependency markers and the first-transforming environment
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>
2026-10-19 10:37:37 +02:00
Sheraff
0059ccaca9
test(start-plugin-core): type the parent-update page pair without indexed access
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:36:27 +02:00
Sheraff
d1b3ea09ba
test(start-plugin-core): real pages, requests and MDX for the dev import-protection rows
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>
2026-10-19 10:32:36 +02:00
Sheraff
f37ef721d3
test(start-plugin-core): hydrate-dev waits with the dev harness's event-based edit()/idle()
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:32:31 +02:00
Sheraff
f48bf691df
Merge branch 'compiler-tests/w3-start' into compiler-tests/baseline
# Conflicts:
#	packages/start-plugin-core/tests/integration/start-build-options.test.ts
#	packages/start-plugin-core/tests/known-bugs-start-compiler.test.ts
2026-10-19 10:24:34 +02:00
Sheraff
be278893a9
test(start-plugin-core): locations accept the import or any surviving use; internals out of the corpus
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>
2026-10-19 10:22:41 +02:00
Sheraff
168955ac2c
test(start-plugin-core): a *.client.* module only ClientOnly children use stays out of the server build
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>
2026-10-19 10:14:47 +02:00
Sheraff
e80fc904a9
test(start-plugin-core): Hydrate dev pages (React, Solid), splitter composition, build diagnostics
- 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>
2026-10-19 10:13:41 +02:00
Sheraff
e708d3d5ca
test(compiler-test-utils): diagnostics read a code frame quoted inside Rspack's report box
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>
2026-10-19 10:13:41 +02:00
Sheraff
b29a1dda5b
test(start-plugin-core): transformImport rows on the written specifier and the resolved target; actionable compile errors
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>
2026-10-19 10:13:13 +02:00
Sheraff
28cdaf003d
Merge branch 'compiler-tests/w3-hmr' into compiler-tests/baseline
# Conflicts:
#	packages/router-plugin/tests/react-refresh-route-components.test.ts
2026-10-19 10:10:27 +02:00
Sheraff
f2c2e84a16
test(start-plugin-core): replace the leading-comment rewrite pins with JSX pragma app twins
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>
2026-10-19 10:07:48 +02:00
Sheraff
e8179d37e5
test(start-plugin-core): move the trace and formatter internals out of the compiler corpus
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>
2026-10-19 10:07:43 +02:00
Sheraff
b74cc2186c
test(start-plugin-core): Hydrate HYD rows of wave 3 and namespace negatives
- 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>
2026-10-19 10:07:27 +02:00
Sheraff
52d06dd6c1
test(compiler-test-utils): captureConsole keeps its spies in a local (eslint)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:05:34 +02:00
Sheraff
f83c32f3bb
test(start-plugin-core): Hydrate pages on Rsbuild and Solid, parent updates, namespace pins
- 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>
2026-10-19 10:01:07 +02:00
Sheraff
5599b1ff5a
test(start-plugin-core): solid-js and vite-plugin-solid devDeps for real Solid Hydrate pages
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>
2026-10-19 10:00:58 +02:00
Sheraff
dde8881f99
test(start-plugin-core): read mock access diagnostics and report suggestions through the diagnostic oracle
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>
2026-10-19 10:00:25 +02:00
Sheraff
e3a5495580
test(start-plugin-core): format and lint the touched Start compiler tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 09:49:12 +02:00
Sheraff
69c2453d7e
test(start-plugin-core): runtime group loading, user-code builds, S35/S48
- 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>
2026-10-19 09:47:12 +02:00
Sheraff
cddb021e83
test(router-plugin): route HMR debug output tests outside the corpus, scoped to debug output (HMR-09)
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>
2026-10-19 09:46:40 +02:00
Sheraff
716a66a800
test(start-plugin-core): Start route HMR controls on real pages, HMR API checks of client and server output (HMR-08)
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>
2026-10-19 09:45:37 +02:00
Sheraff
50d4e1450f
test(router-plugin): React Refresh outcomes of route components on a real page (HMR-17)
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>
2026-10-19 09:41:50 +02:00
Sheraff
396a71a3db
test(router-plugin): dev-server pins render the served route and match the generated tree (HMR-18, HMR-27, HMR-29)
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>
2026-10-19 09:41:21 +02:00
Sheraff
efbc0d708e
test(start-plugin-core): determinism by repetition and relocation, behavioural resolver and pragma checks, #7213 rows
- 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>
2026-10-19 09:40:40 +02:00
Sheraff
c5431ecc37
test(start-plugin-core): Start compiler oracles without prose, inventories or the JSX stand-in
- 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>
2026-10-19 09:33:01 +02:00
Sheraff
352c4fbe0b
Merge branch 'compiler-tests/w3-rsc' into compiler-tests/baseline 2026-10-19 09:32:05 +02:00
Sheraff
bfef5d7ef1
test(router-plugin): handleRouteUpdate tests navigate a client router (HMR-24, HMR-25)
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>
2026-10-19 09:24:46 +02:00
Sheraff
68e9077440
test(router-plugin): route HMR page waits with settle() and reports warnings as diagnostics
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>
2026-10-19 09:20:09 +02:00
Sheraff
77fcefe60d
Merge branch 'compiler-tests/w3-split-1' into compiler-tests/baseline
# Conflicts:
#	packages/router-plugin/tests/code-splitter-imports-exports.test.ts
#	packages/router-plugin/tests/code-splitter-plugin-pipeline.test.ts
#	packages/router-plugin/tests/code-splitter-pragmas.test.ts
#	packages/router-plugin/tests/code-splitter-scope.test.ts
#	packages/router-plugin/tests/plugin-host.ts
2026-10-19 09:18:20 +02:00
Sheraff
4f4d5cbed2
test(react-start-rsc): production Vite build with RSC served by Start's preview server
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>
2026-10-19 09:16:47 +02:00
Sheraff
c9c90184f5
test(react-start-rsc): V2-12 (c) and V2-13 on Vite and Rsbuild RSC; settle the 'use client' pin
- 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>
2026-10-19 09:13:26 +02:00
Sheraff
b3449658e1
Merge branch 'compiler-tests/w3-split-2' into compiler-tests/baseline 2026-10-19 09:10:42 +02:00
Sheraff
ef39b52107
test(start-plugin-core): delete the S20 project re-export transform goal
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>
2026-10-19 09:08:03 +02:00
Sheraff
435e7b1e4b
test(react-start-rsc): RSC CSS rows as sections of one page; look-alike and unrecognised-form rows
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>
2026-10-19 09:07:32 +02:00
Sheraff
38fce59fa3
Merge branch 'compiler-tests/w2-f-fix' into compiler-tests/w3-start 2026-10-19 09:04:26 +02:00
Sheraff
25a1bf7970
Merge branch 'compiler-tests/w2-f-fix' into compiler-tests/w3-hmr 2026-10-19 09:04:13 +02:00
Sheraff
26498fe143
test(router-plugin): remove the plugin host's temporary projects after each test file
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>
2026-10-19 09:00:53 +02:00
Sheraff
e57adaa63f
Merge branch 'compiler-tests/w2-f-fix' into compiler-tests/baseline 2026-10-19 09:00:48 +02:00
Sheraff
d0e1a778f3
test(compiler-test-utils): dev-server harnesses save files atomically
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>
2026-10-19 08:58:54 +02:00
Sheraff
1968af0867
Merge branch 'compiler-tests/w3-gen' into compiler-tests/baseline 2026-10-19 02:47:59 +02:00
Sheraff
750f34cb96
test(router-plugin): dev source maps (V2-15a) and persistent bundler caches (V2-28)
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>
2026-10-19 02:45:23 +02:00
Sheraff
8e92f12777
test(router-plugin): production builds, source maps and build-level diagnostics by outcome (F22, F23, F24, F25, F32, F41, F42)
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>
2026-10-19 02:45:23 +02:00
Sheraff
1414bdc781
test(router-plugin): splitter diagnostics on the shared oracle, one route per file, scope cleanups (F11, F17, F18, F20, F21, F26, F27, F29, F39, F40)
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>
2026-10-19 02:45:23 +02:00
Sheraff
31baeb0c81
test(router-plugin): JSX pragmas and license comments by rendered outcome (F12, F13, F14, F15/R-14, D-04)
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>
2026-10-19 02:44:54 +02:00
Sheraff
dfb2527fab
test(router-plugin): a computed key that is the only read of a loader-reassigned binding (V4 astra/24)
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>
2026-10-19 02:44:54 +02:00
Sheraff
2c7a462864
test(react-start-rsc): type-check and lint tests/ (HYD-30, HYD-33, HYD-32)
- 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>
2026-10-19 02:35:12 +02:00
Sheraff
7545a3ee38
test(router-generator): split the fixture types over two slow-tier files
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>
2026-10-19 02:34:06 +02:00
Sheraff
4f7908755c
test(router-plugin): prettier on the changed test files
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 02:31:10 +02:00
Sheraff
454dad2889
test(router-generator): run the type tests in a project of their own
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>
2026-10-19 02:30:17 +02:00
Sheraff
b8f9308df4
test(router-generator): type the readdir listing-order spy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 02:26:32 +02:00
Sheraff
ffbc18b686
style(router-generator): format the test files
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 02:24:45 +02:00
Sheraff
3e3331caa3
test(router-generator): no quote pins on repaired ids in dev and race tests
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>
2026-10-19 02:23:08 +02:00
Sheraff
79a919b8ca
test(router-plugin): F37 unrelated factory comes from a real package of the app
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>
2026-10-19 02:22:42 +02:00
Sheraff
a7e311725f
test(router-plugin): share builds and drop transform-decided cells in split integration files (B2 6/7)
- 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>
2026-10-19 02:21:32 +02:00
Sheraff
b8c3b607dd
test(router-generator): type checks move to the slow tier; fixtures share a Vite server
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>
2026-10-19 02:19:10 +02:00
Sheraff
87d7845d67
test(start-plugin-core): router.codeSplittingOptions groups observed at run time (S47)
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>
2026-10-19 02:16:12 +02:00
Sheraff
32b03c6c32
test(router-plugin): Solid loader and component groups in a real build (H.5)
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>
2026-10-19 02:13:42 +02:00
Sheraff
54b4820a0b
test(router-generator): known-bugs warning checked with the diagnostics oracle
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 02:13:07 +02:00
Sheraff
29df8e153e
test(router-plugin): code splitting in Vite full-bundle dev mode (V2-29)
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>
2026-10-19 02:12:17 +02:00
Sheraff
d6150d39df
test(router-generator): helper tests become whole-generator scenarios; determinism; route group files
- 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>
2026-10-19 02:11:19 +02:00
Sheraff
2f5e098f8a
test(router-plugin): an already lazy route component renders without a waterfall once preloaded (OQ13)
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>
2026-10-19 02:09:27 +02:00
Sheraff
84fb48e1b9
test(router-plugin): a computed key that is the only read of a shared binding (V4 astra/24)
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>
2026-10-19 02:08:18 +02:00
Sheraff
3b8a3ef573
test(router-generator): dev runs compare routes, not tree bytes; broken edits need a located diagnostic
- 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>
2026-10-19 02:07:02 +02:00
Sheraff
1b85e67545
test(router-plugin): fixed-graph labelling controls, root route without options (F06, V2-30)
- 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>
2026-10-19 02:05:49 +02:00
Sheraff
c39942aba6
test(router-plugin): #__NO_SIDE_EFFECTS__ survives splitting, observed in production builds (F38)
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>
2026-10-19 02:05:49 +02:00
Sheraff
2d55f51183
test(router-plugin): real importers for route exports, typed wrappers removed strictly (F16, F19, F28, F30, F35)
- 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>
2026-10-19 02:05:37 +02:00
Sheraff
1f8053e7ba
test(router-generator): atomic publication with a reader and faults; EXDEV pin
- 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>
2026-10-19 02:05:36 +02:00
Sheraff
5fb030ebd3
test(router-generator): fixtures checked through the real router, types in a slow tier
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>
2026-10-19 02:02:29 +02:00
Sheraff
b9784dcb3e
test(react-start-rsc): reconcile w2-j with w2-f's event-based settle() (no replay mode)
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>
2026-10-19 02:00:32 +02:00
Sheraff
52398b9900
Merge branch 'compiler-tests/w2-j' into compiler-tests/baseline 2026-10-19 01:59:31 +02:00
Sheraff
4f5561c01d
test(router-plugin): drive the code splitter through a real Vite plugin host (F04, F05)
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>
2026-10-19 01:50:16 +02:00
Sheraff
1e06309271
test(router-generator): PIN-A and childless pathless layout pins; conflict diagnostics
- 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>
2026-10-19 01:48:57 +02:00
Sheraff
b2e9fa922b
test(router-generator): scaffolds render through the real router; pieces stay usable
- 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>
2026-10-19 01:48:35 +02:00
Sheraff
404f22dd73
test(router-generator): route file upkeep may change only what it owns
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>
2026-10-19 01:48:26 +02:00
Sheraff
b91a54f8b3
build(router-generator): add compiler-test-utils as a test devDependency
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>
2026-10-19 01:48:17 +02:00
Sheraff
ce1ac3b837
test(react-start-rsc): keep test:eslint on src (tests are outside the package tsconfig) 2026-10-19 01:47:30 +02:00
Sheraff
da04f393dc
test(rsc, start-plugin-core): RSC CSS on Rsbuild, real Start dev pages for route-tree and handler edits (A13)
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).
2026-10-19 01:42:43 +02:00
Sheraff
f60a3479aa
test(react-start-rsc): Start with a separate RSC provider on a real dev page (A13)
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).
2026-10-19 01:22:36 +02:00
Sheraff
891d9b92a9
test(react-start-rsc): RSC CSS delivery through the real transport (A3c)
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.
2026-10-19 01:11:10 +02:00
Sheraff
a23d3cd936
Merge branch 'compiler-tests/w2-h-1' into compiler-tests/baseline 2026-10-19 01:06:21 +02:00
Sheraff
ab93cd7cfa
Merge branch 'compiler-tests/w2-f' into compiler-tests/baseline 2026-10-19 00:49:59 +02:00
Sheraff
41a0100847
test(start-plugin-core): real SSR + hydrateRoot pages for <Hydrate> and <ClientOnly>
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>
2026-10-19 00:40:42 +02:00
Sheraff
dfc3c1dcc5
test(start-plugin-core): boundary forms, split modules and Hydrate pins on the real runtime
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>
2026-10-19 00:40:42 +02:00
Sheraff
eecc63a797
test(start-plugin-core): hydrate captures and ClientOnly server half on the real runtime
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>
2026-10-19 00:40:42 +02:00
Sheraff
9b2e2766f6
test(start-plugin-core): render <Hydrate> modules with the real React, router and Start Hydrate in process
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>
2026-10-19 00:40:41 +02:00
Sheraff
764d1ea70f
Merge branch 'compiler-tests/w2-h-2' into compiler-tests/baseline 2026-10-19 00:33:03 +02:00
Sheraff
83f057d5f5
test(router-generator): generator-dev keeps injected events as a supplement
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>
2026-10-19 00:24:14 +02:00
Sheraff
1ada3c89f4
test(router-plugin): the route generator in dev on a real page, Vite and Rsbuild
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>
2026-10-19 00:23:09 +02:00
Sheraff
5916dca3fa
test(compiler-test-utils): event-based settle() for the Rsbuild dev-server harness
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>
2026-10-19 00:23:09 +02:00
Sheraff
f3206be121
test(start-plugin-core): hydrate-build runs the real Start, React and router, and hydrates in Chromium
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>
2026-10-19 00:17:25 +02:00
Sheraff
1ba702ea33
wip(react-start-rsc): integration tier scaffold for real RSC tests (W2-j, in progress)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 00:05:30 +02:00
Sheraff
95f29f778b
Merge branch 'compiler-tests/w2-i' into compiler-tests/baseline 2026-10-19 00:04:39 +02:00
Sheraff
7711087ca3
test(start-plugin-core): name the Rsbuild custom module type for what it is
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-19 00:03:26 +02:00
Sheraff
1e8276300d
Merge branch 'compiler-tests/w2-e' into compiler-tests/baseline 2026-10-18 21:56:06 +02:00
Sheraff
561c2d9e8f
test(start-plugin-core): format and type the import-protection test changes
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-18 21:52:17 +02:00
Sheraff
cdbf47fc0b
test(compiler-test-utils): the real file watcher in the Vite dev-server harness
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>
2026-10-18 21:46:56 +02:00
Sheraff
0d437e6c27
test(start-plugin-core): import-protection app tests on the safe-mock oracle and the report adapter
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>
2026-10-18 21:46:45 +02:00
Sheraff
05cf0421fb
Merge branch 'compiler-tests/w2-d' into compiler-tests/baseline 2026-10-18 21:42:14 +02:00
Sheraff
f2c6a9b09e
Merge branch 'compiler-tests/w2-g' into compiler-tests/baseline
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.
2026-10-18 21:37:48 +02:00
Sheraff
3712f3acb7
test(router-plugin): D11 route-factory HMR rows accept the ruling's either/or; page reports warnings
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>
2026-10-18 21:32:38 +02:00
Sheraff
10658b44f8
test(start-plugin-core): the building test of the concurrent block registers cleanup through its own context
Vitest's global onTestFinished cannot tell which concurrent test runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 21:32:12 +02:00
Sheraff
2e290a48d6
Merge branch 'compiler-tests/w2-a' into compiler-tests/baseline
# Conflicts:
#	packages/compiler-test-utils/package.json
2026-10-18 21:27:56 +02:00
Sheraff
e819a0f35c
test(start-plugin-core): tell an import-protection mock by safe behaviour, read reports by their sections
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>
2026-10-18 21:27:24 +02:00
Sheraff
f95f2ad9ce
test(router-plugin): route HMR page suites: Solid/Vue on Rsbuild, plugin configurations, sharper pins
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>
2026-10-18 21:23:32 +02:00
Sheraff
d64142520b
test(router-plugin): delete the in-process HMR model; its consumers move to the real page
`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>
2026-10-18 21:23:13 +02:00
Sheraff
5aed121c41
test(router-plugin): route HMR page waits on the real tools' signals; Rsbuild Solid and Vue
`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>
2026-10-18 21:22:58 +02:00
Sheraff
faf59c5b49
docs(compiler-test-utils): list mismatches in the diagnostics API header
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 21:19:41 +02:00
Sheraff
de3c4a135a
test(router-generator): reuse the previous TypeScript program in type checks
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>
2026-10-18 21:17:22 +02:00
Sheraff
8242ade19b
test(router-generator): Solid trees and React/Solid pages through the real router
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>
2026-10-18 21:17:17 +02:00
Sheraff
53e7d68672
build(router-generator): add Solid and React DOM test devDependencies
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>
2026-10-18 21:17:05 +02:00
Sheraff
e03c6a8dda
test(compiler): webpack minify only where checked; parallel child runs
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>
2026-10-18 21:13:50 +02:00
Sheraff
c8b84f431a
test(compiler-test-utils): client runs in Chromium, project JSX settings and real target globals in the validators
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>
2026-10-18 21:13:46 +02:00
Sheraff
fb6bba327b
Merge branch 'compiler-tests/w2-b' into compiler-tests/baseline 2026-10-18 21:13:14 +02:00
Sheraff
b41f212a15
Merge branch 'compiler-tests/w2-c' into compiler-tests/baseline 2026-10-18 21:00:50 +02:00
Sheraff
13591a12df
test(start-plugin-core): environment-restriction throws through the shared oracle
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>
2026-10-18 20:59:45 +02:00
Sheraff
a01737851f
test(compiler-test-utils): shared oracles for diagnostics, importers, determinism and source maps
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>
2026-10-18 20:59:40 +02:00
Sheraff
ac80b9d3a3
test(router-plugin): keep the route HMR suites passing on the real router
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>
2026-10-18 20:53:14 +02:00
Sheraff
a1cae72bb2
test(router-plugin): splitter suites observe real renders and real loading
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>
2026-10-18 20:53:08 +02:00
Sheraff
dbcec2b8b1
test(router-plugin): load split routes with the real router and React
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>
2026-10-18 20:52:52 +02:00
Sheraff
cd267d3073
test(compiler-test-utils): real packages, React JSX and load observers in the module linker
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>
2026-10-18 20:52:41 +02:00
Sheraff
23372d1a37
test(router-generator): share modules across test files in a worker
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>
2026-10-18 20:51:18 +02:00
Sheraff
a7b30d362e
test(router-generator): empty-prefix physical mounts merge, real conflicts fail (GEN-30)
"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>
2026-10-18 20:51:01 +02:00
Sheraff
5dd6559245
test(router-generator): check generated route trees through the real router
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>
2026-10-18 20:50:52 +02:00
Sheraff
b8d7cbc361
test(router-plugin): the real router packages in the Vite dev-server harness
`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>
2026-10-18 20:37:50 +02:00
Sheraff
ce8553b9ed
test(start-plugin-core): the real router in the Start build and dev harnesses
`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>
2026-10-18 20:37:50 +02:00
Sheraff
656dd5bf17
test(compiler-test-utils): link built workspace packages into test apps
`@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>
2026-10-18 20:37:20 +02:00
Sheraff
5057dad449
build(compiler-tests): add approved test-only dependencies
FIX-PLAN prerequisites P1 / P1-V2 (DECISIONS "2026-10-18 approvals",
"P1-V2 dependencies"). None of these resolved from the package before.

- router-plugin (dev): @rsbuild/plugin-solid, @rsbuild/plugin-babel,
  @rsbuild/plugin-vue, @rsbuild/plugin-vue-jsx (A1 Rsbuild adapters),
  react-error-boundary (HMR-19), @emotion/react (split F13)
- router-generator (dev): @tanstack/vue-router (workspace:*), vue
  (catalog), @vitejs/plugin-vue (A2a; vue/compiler-sfc ships with vue)
- start-plugin-core (dev): @mdx-js/rollup, @mdx-js/loader (ip S22/S23),
  vite-tsconfig-paths (V2-04)
- compiler-test-utils: @jridgewell/trace-mapping (A12), in
  "dependencies" like the package's other helper deps

Versions reuse the workspace's existing specifiers where present.
No Nx project-graph cycle; one vite copy still serves ctu/spc/rp/rg.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 20:19:33 +02:00
Sheraff
5b477be247
test(router-plugin): split the client-build pins of known-bugs-code-splitter in two
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>
2026-10-18 19:48:18 +02:00
Sheraff
5497994332
docs(compiler): test tiers in AGENTS.md and CONTRIBUTING.md; point split suites at their other half
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 19:13:10 +02:00
Sheraff
7acb00fb1d
ci(compiler-platforms): fast tier plus a browser-free integration smoke set
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>
2026-10-18 19:13:10 +02:00
Sheraff
adb638c01a
test(compiler): Node compile cache and a report-only budget reporter
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>
2026-10-18 19:13:03 +02:00
Sheraff
78eeddbb36
test(compiler): split the regression helper modules by section
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>
2026-10-18 19:13:03 +02:00
Sheraff
3cb0682ab1
test(compiler): fast and slow test tiers
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>
2026-10-18 19:01:04 +02:00
Sheraff
0517895892
build: one sass in the workspace so every package resolves the same vite
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>
2026-10-18 18:00:16 +02:00
Sheraff
c81aadf797
test(start-plugin-core): type the server-fn file pick of the by-id build
`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>
2026-10-18 15:55:49 +02:00
Sheraff
fddb59070c
test(compiler-test-utils): Rsbuild dev harness reads each compile before Rspack drops it
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>
2026-10-18 15:45:46 +02:00
Sheraff
60f5126529
test(start-plugin-core): call server fns by id through Start's real server entry
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>
2026-10-18 15:19:08 +02:00
Sheraff
f211567bb8
Merge branch 'compiler-tests/real-start-build' into compiler-tests/merge-start-build
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>
2026-10-18 14:48:12 +02:00
Sheraff
953b24f622
test(start-plugin-core): build and dev tests run Start's real runtime
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>
2026-10-18 14:42:27 +02:00
Sheraff
ed455004fd
test(compiler-test-utils): absolute app symlinks, ES module chunks, Temporal
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>
2026-10-18 14:42:06 +02:00
Sheraff
ac3f8d5ac9
test(router-plugin): React Refresh outcomes in a real page; delete the refresh runtime model
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>
2026-10-18 14:09:35 +02:00
Sheraff
d14697f7b0
test(start-plugin-core): Start route HMR in a real page; delete the hand-applied update
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>
2026-10-18 14:09:35 +02:00
Sheraff
ba1f305675
Merge branch 'compiler-tests/hmr-real' into compiler-tests/merge-hmr
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>
2026-10-18 13:53:36 +02:00
Sheraff
3ad15c4860
test(router-plugin): route HMR tests drive real dev servers and a real page; delete the React Refresh model
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>
2026-10-18 13:51:47 +02:00
Sheraff
28d6924c27
test(compiler-test-utils): a real browser page on the Vite and Rsbuild dev-server harnesses
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>
2026-10-18 13:51:28 +02:00
Sheraff
5d35383f02
test(start-plugin-core): drop the reference to the deleted prerender build test
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>
2026-10-18 13:34:10 +02:00
Sheraff
c63cc9af82
Merge branch 'compiler-tests/w2-start' into compiler-tests/baseline 2026-10-18 13:26:58 +02:00
Sheraff
2006a1fcd2
Merge branch 'compiler-tests/w2-builddev' into compiler-tests/baseline 2026-10-18 13:26:28 +02:00
Sheraff
31a00458c3
test(start-plugin-core): pin the compiler/runtime contract; dev parity row
- 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>
2026-10-18 13:21:54 +02:00
Sheraff
a5d8d4aa96
test(start-plugin-core): save route files in distinct clock ticks in the Start router dev test
"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>
2026-10-18 13:21:01 +02:00
Sheraff
23b835bad1
test(start-plugin-core): make the Rsbuild dev hot-update test robust
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>
2026-10-18 13:16:31 +02:00
Sheraff
4d64e26ea7
test(react-start-rsc): undocumented renderToReadableStream inputs must not break
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>
2026-10-18 13:13:47 +02:00
Sheraff
9ff76611bc
test(start-plugin-core): server builds drop client-only imports import protection denies
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>
2026-10-18 13:12:36 +02:00
Sheraff
a945fe4563
test(start-plugin-core): apply the E1 audit to the Start compiler tests
- 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>
2026-10-18 13:10:31 +02:00
Sheraff
786d4a251b
test(start-plugin-core): one env-separation and one source-map row with Vite's default client target
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>
2026-10-18 13:10:04 +02:00
Sheraff
1ad2729522
test(start-plugin-core): read the Rsbuild Start dev hot update of a server fn module
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>
2026-10-18 13:08:44 +02:00
Sheraff
77a378a556
test(start-plugin-core): Start production client builds carry no route HMR code (R7)
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>
2026-10-18 13:04:48 +02:00
Sheraff
328253b11e
test(start-plugin-core): run the Vite dev middleware edit through Start's whole plugin
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>
2026-10-18 13:03:10 +02:00
Sheraff
59a77d528e
test(start-plugin-core): test the compiler warning channel on dev servers with Start's plugin
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>
2026-10-18 13:02:28 +02:00
Sheraff
000b5c38d8
test(start-plugin-core): run evaluated Start modules on the real runtime
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>
2026-10-18 13:02:21 +02:00
Sheraff
3ed85ecb05
test(start-plugin-core): run the Rsbuild dev factory edits through Start's plugin and the client
- 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>
2026-10-18 13:00:24 +02:00
Sheraff
eccb24c6b1
Merge branch 'compiler-tests/w2-ip' into compiler-tests/baseline 2026-10-18 12:58:13 +02:00
Sheraff
6085587336
test(start-plugin-core): format the import-protection tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 12:53:59 +02:00
Sheraff
fdaf332ece
test(start-plugin-core): app-level twins of the import-protection mock pins
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>
2026-10-18 12:53:14 +02:00
Sheraff
695c4c0a57
test(start-plugin-core): apply audit F to the import-protection internal tests
- 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>
2026-10-18 12:47:33 +02:00
Sheraff
709d940e63
test(start-plugin-core): check the #8554 dev pin and its control by loading the client
- 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>
2026-10-18 12:46:49 +02:00
Sheraff
1819808c93
test(start-plugin-core): realistic import-protection locations on four channels
- 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>
2026-10-18 12:45:35 +02:00
Sheraff
f854f9e60f
test(start-plugin-core): make the Start router dev tests outcome-level and robust
- "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>
2026-10-18 12:44:15 +02:00
Sheraff
c15f5d205e
test(start-plugin-core): apply audit F to the import-protection build tests
- 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>
2026-10-18 12:41:14 +02:00
Sheraff
6e6604d348
test(start-plugin-core): check Vite dev factory edits by running the client fn
- "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>
2026-10-18 12:38:45 +02:00
Sheraff
f3c5ae0575
test(start-plugin-core): delete the prerender build test
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>
2026-10-18 12:37:40 +02:00
Sheraff
4a7692668f
test(start-plugin-core): move manifest and define-only option tests out of the compiler corpus
- 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>
2026-10-18 12:37:40 +02:00
Sheraff
7507d8bfa6
test(start-plugin-core): accept a build error or distinct ids for colliding custom ids
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>
2026-10-18 12:37:40 +02:00
Sheraff
9387dd3784
test(start-plugin-core): apply audit F to the import-protection dev tests
- 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>
2026-10-18 12:37:39 +02:00
Sheraff
b7a8f1790c
test(start-plugin-core): make the build harness Start stub match the runtime
- 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>
2026-10-18 12:35:09 +02:00
Sheraff
2bef76d893
Merge branch 'compiler-tests/w2-hmr' into compiler-tests/baseline 2026-10-18 12:33:36 +02:00
Sheraff
1b46cd24ca
test(router-plugin): handle-route-update keeps the lazy options the route tree gave the route
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>
2026-10-18 12:27:57 +02:00
Sheraff
d1e97dff4e
test(router-plugin): realistic React Refresh rows; common user names next to the route HMR code
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>
2026-10-18 12:27:51 +02:00
Sheraff
60ef1af93a
Merge branch 'compiler-tests/w2-split' into compiler-tests/baseline 2026-10-18 12:27:44 +02:00
Sheraff
3612f0a519
test(router-plugin): route HMR hot updates run React Refresh and show the new code
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>
2026-10-18 12:27:41 +02:00
Sheraff
0e9a4152f2
test(router-plugin): type the side-effect hint of the Rsbuild placement builds
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 12:25:45 +02:00
Sheraff
60bbcef111
Merge branch 'compiler-tests/w2-gen' into compiler-tests/baseline 2026-10-18 12:22:56 +02:00
Sheraff
4437523cf6
test(router-plugin): React and route-file state in the framework build matrix; .jsx route builds
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>
2026-10-18 12:20:26 +02:00
Sheraff
0448519f03
test(router-plugin): Rsbuild production row in the router build matrix
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>
2026-10-18 12:18:53 +02:00
Sheraff
b45165dade
test(router-generator): format
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 12:16:20 +02:00
Sheraff
edc6117b90
test(router-generator): generated apps type-check with the real compiler
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>
2026-10-18 12:15:33 +02:00
Sheraff
a805983070
test(router-generator): apostrophe pin cites both unescaped string sites
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>
2026-10-18 12:14:19 +02:00
Sheraff
28108810ac
test(router-plugin): apply the final audit to the code-splitter and build tests
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>
2026-10-18 12:14:01 +02:00
Sheraff
e95b66fd75
test(router-generator): generated route trees loaded by the real router
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>
2026-10-18 12:13:25 +02:00
Sheraff
ea7309f68e
test(router-generator): renaming a route file in dev, both event orders
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>
2026-10-18 12:12:21 +02:00
Sheraff
a220a0579a
test(router-generator): route file upkeep through generate(), transform unit suite out of the corpus
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>
2026-10-18 12:11:08 +02:00
Sheraff
321034b562
test(react-start-rsc): realistic RSC CSS inputs, neutral plain-data model
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>
2026-10-18 12:09:41 +02:00
Sheraff
ce103bb7b4
test(start-plugin-core): realistic <Hydrate> inputs and name-aware chunk helpers
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>
2026-10-18 12:09:34 +02:00
Sheraff
0f9de68fcf
test(router-generator): scaffolded routes assert structure, follow quoteStyle/semicolons
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>
2026-10-18 12:06:25 +02:00
Sheraff
3001e15d2c
test(router-generator): known-bugs pins on reachable shapes, option keys through Start
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>
2026-10-18 12:04:07 +02:00
Sheraff
70e84ccc11
test(router-plugin): apply the final audit to known-bugs-code-splitter
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>
2026-10-18 12:02:57 +02:00
Sheraff
a0cdec4694
test(router-generator): apply audit D to option, path and error tests
- 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>
2026-10-18 12:01:57 +02:00
Sheraff
b5f4703d0c
test(router-generator): concurrent-save race and dev map tests assert outcomes only
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>
2026-10-18 12:01:57 +02:00
Sheraff
e2adf02429
test(router-generator): route tree helper places routes like router-core
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>
2026-10-18 11:56:30 +02:00
Sheraff
aabb82fead
test(compiler-test-utils): Rsbuild dev harness hmr option and hot-update chunks
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>
2026-10-18 11:34:10 +02:00
Sheraff
26669587dc
test(compiler-test-utils): webpack loader composes source maps; Vite SSR unminified; .ts without JSX
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>
2026-10-18 11:27:34 +02:00
Sheraff
9aa078e4d5
test(compiler-test-utils): dev-server settle() sees identical rewrites; event order options
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>
2026-10-18 11:21:41 +02:00
Sheraff
ee83be6ad7
test(compiler-test-utils): erase TypeScript like Vite under verbatimModuleSyntax
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>
2026-10-18 11:13:01 +02:00
Sheraff
5f4c390db7
test(compiler-test-utils): one fallback stub per specifier; cycle and TDZ controls
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>
2026-10-18 11:00:02 +02:00
Sheraff
f459ac0091
test(compiler-test-utils): let a typeof check exempt only the reads it guards
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>
2026-10-18 10:55:19 +02:00
Sheraff
b038174b54
test(router-plugin): delete tests of the removed enableRouteGeneration option
#8737 removed the option; its tests go with it (AGENTS.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 10:31:54 +02:00
Sheraff
3111a40b55
Merge remote-tracking branch 'origin/main' into compiler-tests/infra-fix 2026-10-18 10:31:34 +02:00
Sheraff
88f0b10930
test: format the r5-gaps test files
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 09:49:22 +02:00
Sheraff
33f1755096
test(start-plugin-core): load the shortest-trace dev app without pre-transforms
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>
2026-10-18 09:48:56 +02:00
Sheraff
1b9784e459
test(compiler-test-utils): keep Rsbuild's default development source maps in the Rsbuild dev harness
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>
2026-10-18 09:23:52 +02:00
Sheraff
3b9236cc1e
test(router-plugin, start-plugin-core): debug output off by default, generator factory, route code frames, perf report
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>
2026-10-18 09:20:28 +02:00
Sheraff
67a5c6346b
test(router-generator): close the piece and pathless-layout gaps, pin G1-G3
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>
2026-10-18 09:10:23 +02:00
Sheraff
2b9d1b918c
test(start-plugin-core): cover build traces with bundledDev, Rsbuild entry traces and Rsbuild dev ids
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>
2026-10-18 09:04:51 +02:00
Sheraff
d37d7d1924
test(start-plugin-core): close the Vite dev import-protection gaps of the final mutation pass
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>
2026-10-18 08:58:18 +02:00
Sheraff
9184990047
test(start-plugin-core): pin M1, a handler-only helper logged as a client violation
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>
2026-10-18 08:48:38 +02:00
Sheraff
69ab04aaa5
test(compiler-test-utils): keep Vite's default pre-transform requests in the dev harness
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>
2026-10-18 08:48:33 +02:00
Sheraff
081ef3ec44
Merge branch 'compiler-tests/baseline' (639d11a1c8) into compiler-tests/oracle-hardening
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 23:23:47 +02:00
Sheraff
639d11a1c8
test(start-plugin-core): pin fuzz round-2 F3 and Start compiler variants
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>
2026-10-17 23:13:25 +02:00
Sheraff
613fb80bd7
test(start-plugin-core): pin fuzz round-2 Hydrate findings F2, F4 and a nested children-prop id
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>
2026-10-17 23:13:25 +02:00
Sheraff
b3f52fbfb5
test(router-plugin): pin fuzz round-2 findings F1 and split-binding variants
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>
2026-10-17 23:13:25 +02:00
Sheraff
d4321e5cc9
test(compiler-test-utils): wait for the Rsbuild compile that includes an edit
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>
2026-10-17 22:56:23 +02:00
Sheraff
1f252dcf46
test(compiler-test-utils): narrow the known globals and check unminified Rspack and webpack builds as minified
- 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>
2026-10-17 22:22:24 +02:00
Sheraff
3179078138
test(compiler-test-utils): reject dangling names in production client builds
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>
2026-10-17 22:02:40 +02:00
Sheraff
ef4ed206e2
test(compiler-test-utils): clear free names only in code Rolldown tree-shakes away
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>
2026-10-17 22:02:40 +02:00
Sheraff
85dcde9b52
test(start-plugin-core): importers of a denied file excludeFiles matches get the real module
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>
2026-10-17 20:23:04 +02:00
Sheraff
9c4f41eda7
test(compiler-test-utils): check classic JSX pragma modules with the classic runtime
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>
2026-10-17 20:22:49 +02:00
Sheraff
ff0a4f6301
Merge commit 'cb66c6bba7' into compiler-tests/probe-fixes 2026-10-17 19:58:26 +02:00
Sheraff
d73bcdc4d4
test(router-plugin): type the rendered HTML of the duplicate Route build test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 19:58:23 +02:00
Sheraff
cb66c6bba7
Merge branch 'compiler-tests/r4-vite-a' into compiler-tests/r4-mutation
# Conflicts:
#	packages/start-plugin-core/tests/importProtection/dev.test.ts
#	packages/start-plugin-core/tests/importProtection/start-apps.ts
2026-10-17 19:49:07 +02:00
Sheraff
f53ea7ba37
test(start-plugin-core): one seam module for the compilerTransforms test transforms
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>
2026-10-17 19:47:19 +02:00
Sheraff
019fdc6794
Merge branch 'compiler-tests/r4-vite-b' into compiler-tests/r4-mutation 2026-10-17 19:46:19 +02:00
Sheraff
02c896188f
test: recall tests for source map names, the dev race and cached rebuilds
- 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>
2026-10-17 19:46:04 +02:00
Sheraff
0814bc3da2
test(start-plugin-core): Vite dev import protection gaps (onViolation, start entry, split routes, non-JS modules, edits, traces)
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>
2026-10-17 19:44:10 +02:00
Sheraff
0e8684b896
test: lone-CR positions, R-13 pragma row, import-protection exemptions
- 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>
2026-10-17 19:39:10 +02:00
Sheraff
f80fc35de5
test(start-plugin-core): pin dev error mode silencing modules a server fn factory imports
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>
2026-10-17 19:39:02 +02:00
Sheraff
4561f9fee5
test(start-plugin-core): build import protection reports only surviving imports, once, with their type
- 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>
2026-10-17 19:39:02 +02:00
Sheraff
6167ecd433
test(start-plugin-core): Vite dev import protection hooks (mockAccess, marker retro checks, traces, full-bundle dev)
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>
2026-10-17 19:38:54 +02:00
Sheraff
d7820f9ec1
test: apply the 2026-10-17 rulings (dead-code references, Route readers, R-09, L3)
- 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>
2026-10-17 19:31:29 +02:00
Sheraff
b335e17a37
test: fix corpus defects and weak pins found by the #8504 probe
A1 delete the invalid TS2300 "type re-export and value re-export" row.
A2 duplicate Route (TS2440): build fails naming Route, or the page renders.
A3 display-name: placement control kept; goal pin added (lazy and renders
   the property; main: entry throws "Page is not defined").
A4 merged namespace row reads Value.one (old input invalid without splitter).
A5 @jsxFrag row really uses a fragment.
A6 comment fixes (KB private call result, KB object-form handler,
   route-hmr lowercase pendingComponent, start-compiler renamed re-export,
   hydrate namespace hook).
B1-B5 counted write row; register/registry counts read after the chunk
   loads; split-or-reported for export list/alias/specifier/class rows;
   library server fn refusal uses misplacedServerFnRejection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 19:24:03 +02:00
Sheraff
6f86286491
Merge branch 'compiler-tests/r4-rsbuild' into compiler-tests/r4-mutation 2026-10-17 19:19:45 +02:00
Sheraff
7a03b4c8c9
test(start-plugin-core): type the Rsbuild dev behavior and mockAccess rows
ImportProtectionOptions includes undefined; index its NonNullable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 19:08:12 +02:00
Sheraff
600277bc82
Merge branch 'compiler-tests/r4-generator' into compiler-tests/r4-mutation 2026-10-17 19:04:23 +02:00
Sheraff
5b9853992c
test(start-plugin-core): Rsbuild dev keeps compiling after a server fn module is deleted
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>
2026-10-17 19:04:19 +02:00
Sheraff
80444e6653
test(start-plugin-core): watch rebuild test tolerates repeated client compiles
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>
2026-10-17 19:02:13 +02:00
Sheraff
361f4b631b
test(router-generator): route paths, conflicts, tokens and params edge cases
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>
2026-10-17 18:59:33 +02:00
Sheraff
ef5558a5df
test(router-generator): a Vue component piece keeps its route's children
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>
2026-10-17 18:59:33 +02:00
Sheraff
f05b32f099
test(start-plugin-core): Rsbuild build locates imports source.transformImport rewrote; pin two bugs
- 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>
2026-10-17 18:54:08 +02:00
Sheraff
27546d9520
test(start-plugin-core): Rsbuild build --watch rebuild fails on a violation again
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>
2026-10-17 18:50:23 +02:00
Sheraff
50e2a4d80f
test(start-plugin-core): cover Start's Vite dev hooks left by mutation round 3
- 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>
2026-10-17 18:48:37 +02:00
Sheraff
443cf26d9c
test(start-plugin-core): Rsbuild dev compile with a missing module reports only that
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>
2026-10-17 18:48:08 +02:00
Sheraff
deb72b6f37
test(start-plugin-core): onViolation gets the type and RegExp pattern of a specifier violation
- 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>
2026-10-17 18:44:21 +02:00
Sheraff
e9cea828a2
test(start-plugin-core): Rsbuild dev .mts/.cts importers, behavior and mockAccess
- 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>
2026-10-17 18:43:13 +02:00
Sheraff
0965ccae28
test(start-plugin-core): pin builder-variable and typeof-read validators in Vite and Rsbuild builds (fuzz N4, V1)
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>
2026-10-17 18:21:14 +02:00
Sheraff
1667b65f3b
test(start-plugin-core): pin fuzz findings N3, N4, N5, V1 and the classic JSX runtime at compiler level
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>
2026-10-17 18:21:06 +02:00
Sheraff
e395052be0
test(router-generator): pin the second createFileRoute import for a wrapper module (fuzz V2)
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>
2026-10-17 18:20:56 +02:00
Sheraff
3a10f18be0
test(router-plugin): pin fuzz findings N1, N2, N3 and V3 of the code splitter
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>
2026-10-17 18:20:50 +02:00
Sheraff
a38a259383
test(compiler-test-utils): lint fixes in the run-node control test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 15:04:16 +02:00
Sheraff
dff84ff95d
test(start-plugin-core): type the dev harness config option with the harness's Vite types
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>
2026-10-17 15:03:07 +02:00
Sheraff
94964ca6b0
test(start-plugin-core): a throwing onViolation fails the Rsbuild dev compile (the pin was a harness artefact)
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>
2026-10-17 15:00:22 +02:00
Sheraff
b15ec457a8
test(start-plugin-core): finish the original-source usage lookup rows and pin wrapped createServerOnlyFn
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>
2026-10-17 14:56:35 +02:00
Sheraff
565e59a08d
test(start-plugin-core): dev import protection when importer edges lack transform data
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>
2026-10-17 14:53:30 +02:00
Sheraff
10e55299a0
test(start-plugin-core): tell dev import protection's log 'always' from 'once' without an edit
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>
2026-10-17 14:47:49 +02:00
Sheraff
e0e3e0945b
test(router-plugin): webpack/Rspack watch test asserts the scaffolded route instead of timing out
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>
2026-10-17 14:47:43 +02:00
Sheraff
835b7b72a3
test(compiler-test-utils): child runs never outlive the test worker; lost build errors fail fast
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>
2026-10-17 14:47:38 +02:00
Sheraff
46bf9bf804
Merge compiler-tests round 3 (router-plugin, router-generator, start-plugin-core tests)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 07:24:32 +02:00
Sheraff
d9dad4804b
test(router-plugin): cover the webpack and Rspack generator watch mode
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>
2026-10-17 07:23:31 +02:00
Sheraff
754aa96719
test(router-plugin): cover route HMR outcomes found missing by mutation testing
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>
2026-10-17 07:23:19 +02:00
Sheraff
09e8f37f54
test(router-plugin): pin code-splitter main bugs found by mutation testing
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>
2026-10-17 07:23:09 +02:00
Sheraff
d16d032bf8
test(router-plugin): cover code-splitter outcomes found missing by mutation testing
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>
2026-10-17 07:23:01 +02:00
Sheraff
558995ff5a
test(router-plugin): root route ids come from the route generator, not the harness
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>
2026-10-17 07:22:46 +02:00
Sheraff
05e408c927
test(start-plugin-core): type the rows of the new import-protection build tables
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>
2026-10-17 07:05:27 +02:00
Sheraff
a086444806
test(start-plugin-core): source maps of a module whose denied import is mocked
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>
2026-10-17 07:05:27 +02:00
Sheraff
d360472adc
test(start-plugin-core): pin import-protection build bugs: dynamic import, non-JS and CommonJS denied files
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>
2026-10-17 07:05:27 +02:00
Sheraff
79ac508df5
test(start-plugin-core): cover the trace and code frame of build violation reports
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>
2026-10-17 07:05:06 +02:00
Sheraff
3b998c76b8
test(start-plugin-core): cover onViolation, log, excludeFiles and maxTraceDepth builds
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>
2026-10-17 07:05:06 +02:00
Sheraff
28f95a1c7e
test(start-plugin-core): cover mock-mode and marker outcomes of import-protection builds
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>
2026-10-17 07:05:06 +02:00
Sheraff
aa53dfaf45
test(start-plugin-core): type the new dev import-protection tests
`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>
2026-10-17 07:05:03 +02:00
Sheraff
c079f2e351
test(start-plugin-core): pin dev import-protection bugs (factory lookup, Rsbuild module types, throwing onViolation)
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>
2026-10-17 07:05:03 +02:00
Sheraff
20c891a337
test(start-plugin-core): register Start's entries in the Vite dev import-protection harness
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>
2026-10-17 07:05:03 +02:00
Sheraff
c3c846d2d1
test(start-plugin-core): cover Rsbuild dev import protection across rebuilds
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>
2026-10-17 07:05:03 +02:00
Sheraff
974aec9e1b
test(start-plugin-core): format the round 3 host tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 07:05:00 +02:00
Sheraff
00cd8464c5
test(start-plugin-core): SSR route splitting follows router.codeSplittingOptions
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>
2026-10-17 07:05:00 +02:00
Sheraff
4396935451
test(start-plugin-core): Rsbuild builds restored from the persistent cache resolve server fns
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>
2026-10-17 07:05:00 +02:00
Sheraff
2f7c14f2e9
test(start-plugin-core): Vite dev client route tree follows page/server-only edits
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>
2026-10-17 07:05:00 +02:00
Sheraff
6e7ac66b50
test(start-plugin-core): Vite dev with a server fn provider environment other than SSR
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>
2026-10-17 07:05:00 +02:00
Sheraff
206373081c
test(start-plugin-core): Vite compiles server fns when one builder builds an environment twice
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>
2026-10-17 07:05:00 +02:00
Sheraff
13df9b9f61
test(start-plugin-core): a server fn builder from a missing module fails the build
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>
2026-10-17 07:05:00 +02:00
Sheraff
35a8d0c700
test(start-plugin-core): build with a generateFunctionId that returns an id
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>
2026-10-17 07:05:00 +02:00
Sheraff
901a56df3f
test(start-plugin-core): type-check the Register types of the generated route tree
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>
2026-10-17 07:05:00 +02:00
Sheraff
74394b4bf7
test(start-plugin-core): prerender only the static pages of an app
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>
2026-10-17 07:05:00 +02:00
Sheraff
c88a861b44
test(start-plugin-core): prerender.enabled prerenders every static page
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>
2026-10-17 07:05:00 +02:00
Sheraff
2b2ec243e5
test(start-plugin-core): build the start manifest and the pruned client route tree
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>
2026-10-17 07:05:00 +02:00
Sheraff
683d62c3ed
test(start-plugin-core): Vite dev resolves server fns compiled after the resolver loaded
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>
2026-10-17 07:05:00 +02:00
Sheraff
f997747258
test(start-plugin-core): Rsbuild dev gives same-named server fns distinct ids
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>
2026-10-17 07:05:00 +02:00
Sheraff
84273eb31d
test(start-plugin-core): build a server fn whose builder comes from another module
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>
2026-10-17 07:05:00 +02:00
Sheraff
d2b854c730
test(start-plugin-core): run the real Rsbuild metadata loader in tests
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>
2026-10-17 07:05:00 +02:00
Sheraff
eaaf5df979
test(start-plugin-core): format the round-3 compiler core tests
`pnpm format` on the files this branch touched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 06:54:42 +02:00
Sheraff
59525c1ab5
test(start-plugin-core): pin browser-only provider exports and re-exported transform targets
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>
2026-10-17 06:54:42 +02:00
Sheraff
afd3d73b18
test(start-plugin-core): cover resolver order, SSR map sources and renamed ClientOnly forms
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>
2026-10-17 06:54:42 +02:00
Sheraff
a41a1db4d0
test(start-plugin-core): cover default-exported expressions and triple var redeclarations
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>
2026-10-17 06:54:41 +02:00
Sheraff
25c29a03ab
test(start-plugin-core): run the re-export transform test through the hosts' factory
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>
2026-10-17 06:54:41 +02:00
Sheraff
7fd68970b3
test(start-plugin-core): cover transforms, provider exports and cycles in the compiler
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>
2026-10-17 06:54:41 +02:00
Sheraff
3d6c0cc26c
test(start-plugin-core): keep wrapped server and env-only fns off the client
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>
2026-10-17 06:54:41 +02:00
Sheraff
60393fd4d3
test(start-plugin-core): compile isomorphic fns next to other code
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>
2026-10-17 06:54:41 +02:00
Sheraff
bbce328cb7
test(start-plugin-core): keep merged server fns client-callable, locate deep diagnostics
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>
2026-10-17 06:54:41 +02:00
Sheraff
0c24c41e2b
test(start-plugin-core): pair every server fn of a module with its own id
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>
2026-10-17 06:54:41 +02:00
Sheraff
56418a7148
test(start-plugin-core): cover where import protection reports a use
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>
2026-10-17 06:44:28 +02:00
Sheraff
912bd7fedb
test(start-plugin-core): cover mock runtime uses and Rsbuild mockAccess off
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>
2026-10-17 06:44:28 +02:00
Sheraff
37dd816965
test(start-plugin-core): pin export * as ns from a denied module
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>
2026-10-17 06:44:28 +02:00
Sheraff
a25ad67238
test(start-plugin-core): cover mock export names and split the ns pin
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>
2026-10-17 06:44:28 +02:00
Sheraff
44d69d9bc3
test(start-plugin-core): cover import discovery edge cases
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>
2026-10-17 06:44:28 +02:00
Sheraff
7e3060745f
test(start-plugin-core): pin Hydrate same-line whitespace mismatch and split the member-tag pin
- 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>
2026-10-17 06:44:28 +02:00
Sheraff
c4820915c1
test(start-plugin-core): cover Hydrate fallback stripping, boundary-prop hooks and chunk invalidation
- 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>
2026-10-17 06:44:28 +02:00
Sheraff
ba4282f84b
test(start-plugin-core): cover Hydrate captures through property values, member names and globals
- 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>
2026-10-17 06:44:28 +02:00
Sheraff
08611ce925
test(start-plugin-core): cover Hydrate expression children, chunk imports, spread preloads and React chunks from source
- 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>
2026-10-17 06:44:28 +02:00
Sheraff
c86011131d
test(router-generator): cite the jiti config loader in the virtualRouteConfig pin
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 06:42:57 +02:00
Sheraff
0a3df66587
test(router-generator): pin the 'a b' / 'ab' route variable collision too
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>
2026-10-17 06:42:43 +02:00
Sheraff
80ad26e34d
test(router-generator): route file upkeep edge cases in the transform
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>
2026-10-17 06:39:42 +02:00
Sheraff
1586643796
test(router-generator): route URLs, underscores, groups, tokens, param names
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>
2026-10-17 06:35:27 +02:00
Sheraff
53c3ff00fa
test(router-generator): a generator kept across edits, concurrent saves, file owners
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>
2026-10-17 06:30:42 +02:00
Sheraff
4f04ced49b
test(router-generator): Vue piece files, default ignore prefix, target packages, scaffolds
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>
2026-10-17 06:24:38 +02:00
Sheraff
f854a6a5e5
test: apply the 2026-10-16 rulings on Rsbuild pruning, recompiling Start output and enableRouteGeneration
- 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>
2026-10-16 23:14:59 +02:00
Sheraff
e05cf14d69
test(router-plugin): pin a Vite client crash on an unused object naming a split component
Also orders the validate-module import of the regression helpers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 23:14:59 +02:00
Sheraff
2e690182f4
test(router-plugin,start-plugin-core): map thrown errors through build source maps
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>
2026-10-16 23:14:59 +02:00
Sheraff
c29f47f697
test(start-plugin-core): Hydrate pins require rendering through the lazy chunks
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>
2026-10-16 23:14:59 +02:00
Sheraff
779edc6c72
test(start-plugin-core): check declarations through declaredNames instead of a regex
declarationOf had no other users and is removed from compiler-test-utils.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 23:14:59 +02:00
Sheraff
f521d3b4d1
Merge compiler-tests/r2-start-hydrate into compiler-tests/r2-router-coverage 2026-10-16 22:54:34 +02:00
Sheraff
c6a586e192
test(router-plugin): lint fixes in the build harness and determinism test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 22:51:45 +02:00
Sheraff
b91e50e75d
test(router-plugin): resolve the Solid router stub before Vite's resolver
@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>
2026-10-16 22:49:46 +02:00
Sheraff
52e1120447
test(router-plugin): hashbang route files and non-ASCII route file names
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>
2026-10-16 22:47:49 +02:00
Sheraff
b5d843c92a
test(router-plugin): the code splitter applied to its own output
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>
2026-10-16 22:46:24 +02:00
Sheraff
4d985701de
test(router-plugin): the React Compiler compiles split components
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>
2026-10-16 22:44:37 +02:00
Sheraff
5a352254d9
test(router-plugin): code splitting does not depend on roots, path spelling or build order
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>
2026-10-16 22:43:20 +02:00
Sheraff
07840f432f
test(router-plugin): exercise plugin options and entry points in real builds
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>
2026-10-16 22:40:02 +02:00
Sheraff
86dd4148ea
test(router-generator): cover generator options read through getConfig and tsr.config.json
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>
2026-10-16 22:35:39 +02:00
Sheraff
d74b698fbf
test(router-generator): cover route file fixes and scaffolding in full generator runs
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>
2026-10-16 22:35:39 +02:00
Sheraff
c0429acc9d
test(router-generator): evaluate route files with JSX in routeIdOf
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>
2026-10-16 22:35:39 +02:00
Sheraff
95921200fe
test(router-generator): add a routesOf helper that evaluates generated route trees
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>
2026-10-16 22:35:39 +02:00
Sheraff
d8e713d5bb
test(router-plugin): created routes in Vite dev (generator recovery, HMR)
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>
2026-10-16 22:35:39 +02:00
Sheraff
d8f692c13b
test(router-plugin): route generator cases on an Rsbuild dev server
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>
2026-10-16 22:35:39 +02:00
Sheraff
38da685fa6
test(router-plugin): production client bundles carry no dev-only code
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>
2026-10-16 22:34:42 +02:00
Sheraff
283bef46a9
Merge compiler-tests/r2-hydrate-rsc into compiler-tests/r2-start
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 22:31:01 +02:00
Sheraff
effcfb1523
test(router-plugin): build Solid and Vue apps for real with each bundler
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>
2026-10-16 22:30:37 +02:00
Sheraff
e7d3c1b499
test(start-plugin-core): mark the RSC D6 pin as compiler-level, with the build pin as oracle
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>
2026-10-16 22:28:21 +02:00
Sheraff
3b5d804873
test(start-plugin-core): env-specific functions compile idempotently
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>
2026-10-16 22:28:09 +02:00
Sheraff
80a8d49073
test(start-plugin-core): server fn ids are deterministic across roots and path styles
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>
2026-10-16 22:28:09 +02:00
Sheraff
60c6b29a09
test(start-plugin-core): wrapped middleware chain ending in .client() before .server()
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>
2026-10-16 22:28:09 +02:00
Sheraff
5a9b8c46a0
test(start-plugin-core): Start compiler unit tests assert outcomes, not printed code
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>
2026-10-16 22:28:09 +02:00
Sheraff
4476b5f541
test(start-plugin-core): SSR callers asserted by behaviour, provider content no longer pinned
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>
2026-10-16 22:28:09 +02:00
Sheraff
62b4cd365b
test(start-plugin-core): type the dev behavior rows with the defined options
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 22:24:55 +02:00
Sheraff
1ef05fb0f0
test(start-plugin-core): mock modules by behaviour, not their printed text
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>
2026-10-16 22:24:55 +02:00
Sheraff
743cd1d5cf
test(start-plugin-core): make the #8101 pin assert the outcome, with a control
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>
2026-10-16 22:24:55 +02:00
Sheraff
a3bdbe0564
test(start-plugin-core): import protection on a Vite dev server, including edits
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>
2026-10-16 22:24:55 +02:00
Sheraff
3ae6b0ca25
test(start-plugin-core): read the reported violation location from real apps
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>
2026-10-16 22:24:55 +02:00
Sheraff
c4ab049709
test(start-plugin-core): import protection's default rules and options in real builds
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>
2026-10-16 22:24:55 +02:00
Sheraff
c108415d7d
test(start-plugin-core): type fixes for the new Start tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 22:24:25 +02:00
Sheraff
13be7bb587
test(start-plugin-core): generated-name fixtures require the compiler to introduce names
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 22:22:45 +02:00
Sheraff
ab3342d152
test(start-plugin-core): stand-in server fns carry their extracted fn's id
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>
2026-10-16 22:22:09 +02:00
Sheraff
1f31f70b60
test(start-plugin-core): documented Start options have their effect in real builds
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>
2026-10-16 22:20:36 +02:00
Sheraff
ea4bfd673e
test(start-plugin-core): Start compiler warnings reach the user through the bundler
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>
2026-10-16 22:18:34 +02:00
Sheraff
bfccca62f5
test(start-plugin-core): Start builds are deterministic across directories and compile orders
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>
2026-10-16 22:16:27 +02:00
Sheraff
e997ce22c8
test(start-plugin-core): Hydrate boundaries in split route options, also in one grouping
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 22:15:53 +02:00
Sheraff
b944cbbc34
test(start-plugin-core): server fns from node_modules libraries in real builds
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>
2026-10-16 22:15:34 +02:00
Sheraff
92dffc8d84
test(react-start-rsc): stop asserting bug C9 as spec; cover the Rsbuild wiring
- 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>
2026-10-16 22:15:21 +02:00
Sheraff
88af0e5ad2
test(router-plugin): type the hot module's Route in handle-route-update
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 22:15:00 +02:00
Sheraff
f131b4b185
test(start-plugin-core): dev edits of middleware and isomorphic fns, and full-bundle dev
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>
2026-10-16 22:14:02 +02:00
Sheraff
f09e1af10b
test(start-plugin-core): Hydrate chunk and parent source maps point at the user's code
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>
2026-10-16 22:12:50 +02:00
Sheraff
63924053c3
test(start-plugin-core): Hydrate builds hydrate like the server renders, timing left open
- 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>
2026-10-16 22:12:16 +02:00
Sheraff
8a26fabc22
test(compiler-test-utils): serve the client in Vite's full-bundle dev mode
`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>
2026-10-16 22:11:29 +02:00
Sheraff
813af15706
test(start-plugin-core): Hydrate generated-name fixtures no longer depend on today's names
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>
2026-10-16 22:09:02 +02:00
Sheraff
c3518e7ac3
test(start-plugin-core): read server-only routes from real Start builds
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>
2026-10-16 22:07:29 +02:00
Sheraff
565fb2b62b
test(router-plugin): delete duplicates whose coverage now lives elsewhere
- 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>
2026-10-16 22:07:16 +02:00
Sheraff
7990e47d0d
test(start-plugin-core): cover more Hydrate boundary forms by outcome
- 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>
2026-10-16 22:05:53 +02:00
Sheraff
fb96dde1a3
test(router-generator): assert error outcomes and generator runs instead of internals
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>
2026-10-16 22:05:42 +02:00
Sheraff
afadad2afb
test(router-plugin): outcome-level HMR, context and JSX tests; pin lost cases
- 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>
2026-10-16 22:05:42 +02:00
Sheraff
9f2a9e467d
test(start-plugin-core): Hydrate pins require the children to render through their chunks
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>
2026-10-16 22:04:39 +02:00
Sheraff
ccdcbb9eba
test(start-plugin-core): assert SSR server fns after a factory edit by behaviour
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>
2026-10-16 22:03:50 +02:00
Sheraff
ac6e31c447
test(start-plugin-core): detect the pre-bundled dependency dev hang in about 1.5 s
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>
2026-10-16 22:02:33 +02:00
Sheraff
f3cdf451d6
test(start-plugin-core): render split Hydrate children through the page, not chunks alone
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>
2026-10-16 22:02:11 +02:00
Sheraff
f492b9d8a0
test(router-plugin): label lazy modules by the options that load them, assert outcomes
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>
2026-10-16 21:47:44 +02:00
Sheraff
2662e6752d
test(compiler-test-utils): probe dynamic imports and list declarations by syntax tree
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>
2026-10-16 21:47:37 +02:00
Sheraff
0e6116bbf9
test(start-plugin-core): pin Rsbuild failing on a middleware and an isomorphic fn in one module
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>
2026-10-16 21:44:52 +02:00
Sheraff
03c6198482
test(start-plugin-core): server code of each Start construct stays out of client builds
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>
2026-10-16 21:44:46 +02:00
Sheraff
566d92d657
test(start-plugin-core): build Start apps through Start's Vite and Rsbuild plugins
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>
2026-10-16 21:44:39 +02:00
Sheraff
107858bb69
test(compiler-test-utils): describe and run builds the harness did not run
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>
2026-10-16 21:43:53 +02:00
Sheraff
a19bd3efca
test(start-plugin-core): type the recorded Rsbuild violations for TypeScript 5.8/5.9
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>
2026-10-16 20:20:31 +02:00
Sheraff
444fcc097f
test(start-plugin-core): pin an unparenthesized split={false as boolean} too
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>
2026-10-16 20:18:35 +02:00
Sheraff
a2119a32f4
test(start-plugin-core): render the recompiled parent's chunk after a Hydrate edit
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>
2026-10-16 20:18:26 +02:00
Sheraff
32ce5df89d
test(start-plugin-core): match the Hydrate this/super rejection by what is captured
`/\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>
2026-10-16 20:18:06 +02:00
Sheraff
dab49048fb
test(start-plugin-core): build Hydrate children from a barrel without side-effect hints
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>
2026-10-16 20:17:01 +02:00
Sheraff
928c891ed3
test(start-plugin-core): check two Hydrate boundaries each load only their own code
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>
2026-10-16 20:16:53 +02:00
Sheraff
20f219db76
test(start-plugin-core): render the children prop of a self-closing Hydrate
`<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>
2026-10-16 20:16:30 +02:00
Sheraff
5c7ef580db
test(start-plugin-core): require Hydrate render tests to render through a chunk
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>
2026-10-16 20:15:45 +02:00
Sheraff
b020b02925
test(start-plugin-core): check the other Hydrate props survive the fallback strip
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>
2026-10-16 20:14:20 +02:00
Sheraff
e1fec8eeab
chore(start-plugin-core): remove the unused prettier devDependency
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>
2026-10-16 20:11:16 +02:00
Sheraff
a9bf6073b0
test(start-plugin-core): report .js, .jsx, .mjs and .cjs importers of a .server file on Rsbuild
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>
2026-10-16 20:09:47 +02:00
Sheraff
2fa6852f62
test(react-start-rsc): expose only the configured RSC provider on import.meta
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>
2026-10-16 20:05:23 +02:00
Sheraff
6bdea178b5
test(start-plugin-core): locate denied-import uses like the Vite plugin
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>
2026-10-16 20:04:10 +02:00
Sheraff
034963e50b
test(start-plugin-core): check a Hydrate chunk follows an edit on the Rsbuild dev server
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>
2026-10-16 19:57:15 +02:00
Sheraff
1e5d230cbd
test(start-plugin-core): drop the imports the Hydrate rewrites left unused
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 19:54:28 +02:00
Sheraff
adb4c4b477
test(start-plugin-core): delete getChunkParams and its control
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>
2026-10-16 19:54:08 +02:00
Sheraff
609eb35228
test(start-plugin-core): move the namespace hook pin into the hooks tests
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>
2026-10-16 19:53:57 +02:00
Sheraff
e69cf9594e
test(start-plugin-core): delete Hydrate split-module tests covered elsewhere or of internals
- '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>
2026-10-16 19:53:48 +02:00
Sheraff
631c228f39
test(start-plugin-core): delete the unused snapshot formatter
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>
2026-10-16 19:53:21 +02:00
Sheraff
fbd0473a07
test(start-plugin-core): delete the hydrateWhen snapshot suite
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>
2026-10-16 19:53:10 +02:00
Sheraff
e637fc8d97
test(start-plugin-core): delete hydrate-when-transform.test.ts
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>
2026-10-16 19:52:49 +02:00
Sheraff
ffd2631b37
test(start-plugin-core): add Vite build and dev-server tests of Hydrate
- 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>
2026-10-16 19:52:27 +02:00
Sheraff
075426f647
test(start-plugin-core): add outcome tests of the Hydrate boundary forms
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>
2026-10-16 19:48:37 +02:00
Sheraff
3783997568
test(start-plugin-core): fix the Hydrate pins and pin the main bugs of the #8504 ports
- 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>
2026-10-16 19:48:37 +02:00
Sheraff
644a584fdd
test(start-plugin-core): assert the Hydrate split-module tests by rendering, port the #8504 split-module tests
- 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>
2026-10-16 19:48:37 +02:00
Sheraff
f69cfa62b9
test(start-plugin-core): assert Hydrate captures by rendering the parent with its chunks
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>
2026-10-16 19:48:23 +02:00
Sheraff
f52f94a39b
test(start-plugin-core): let renderBoundaries take stubs and a runtime, allow the source's globals in loadClientModule
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>
2026-10-16 19:48:23 +02:00
Sheraff
1c596bcc18
test(start-plugin-core): delete the Rsbuild import-protection loader rule test
"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>
2026-10-16 19:27:38 +02:00
Sheraff
94561f9567
test(start-plugin-core): delete source-location caching tests
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>
2026-10-16 19:27:18 +02:00
Sheraff
8f6ee08df4
test(start-plugin-core): delete printed-output tests of the denied-import rewrite
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>
2026-10-16 19:26:47 +02:00
Sheraff
1208ce6d8a
test(start-plugin-core): delete usage-lookup preference and caching tests
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>
2026-10-16 19:26:12 +02:00
Sheraff
fc63722999
test(start-plugin-core): delete mechanism tests of mock export name collection
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>
2026-10-16 19:25:49 +02:00
Sheraff
091aec737d
test(e2e): pin RSC CSS of a server component a helper module renders
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>
2026-10-16 19:24:54 +02:00
Sheraff
635d7c3664
test(react-start-rsc): evaluate RSC CSS transform output and pin the D8 goals
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>
2026-10-16 19:20:10 +02:00
Sheraff
caf2ee641a
test(start-plugin-core): add import-protection build tests
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>
2026-10-16 19:14:48 +02:00
Sheraff
c4f4ba99de
test(start-plugin-core): pin dev mocks of names re-exported with export * from a denied module
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>
2026-10-16 19:13:45 +02:00
Sheraff
add4f1898e
test(start-plugin-core): tighten the import-protection pins and add their controls
- 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>
2026-10-16 19:11:11 +02:00
Sheraff
9c4c489209
test(start-plugin-core): evaluate rewritten denied imports in a module graph
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>
2026-10-16 19:09:29 +02:00
Sheraff
3685cf41a0
test(start-plugin-core): locate denied-import uses in real Start compiler output
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>
2026-10-16 19:07:49 +02:00
Sheraff
4146736f21
test(start-plugin-core): assert import-protection mocks by evaluating them
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>
2026-10-16 19:07:49 +02:00
Sheraff
a4fc4e5064
test(start-plugin-core): give the nested ClientOnly row child-only imports
The SSR output of nested boundaries must not import the modules only
their children use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 18:57:45 +02:00
Sheraff
44f8e96abd
test(start-plugin-core): add the goal pin for a server fn in another server fn's handler
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>
2026-10-16 18:57:45 +02:00
Sheraff
931a1c7e89
test(start-plugin-core): require RPC and env behaviour in builder resolution pins
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>
2026-10-16 18:57:45 +02:00
Sheraff
83c19bf54f
test(start-plugin-core): pin dev invalidation through an import and export re-export
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>
2026-10-16 18:57:44 +02:00
Sheraff
a6cf526abb
test(start-plugin-core): check a provider dependency edit is a hot update
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>
2026-10-16 18:57:36 +02:00
Sheraff
4ccb527f38
test(start-plugin-core): check isomorphic outputs import only their environment's modules
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>
2026-10-16 18:57:36 +02:00
Sheraff
3e9b713419
test(start-plugin-core): cover createClientOnlyFn returned by a factory
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>
2026-10-16 18:57:36 +02:00
Sheraff
d799536b1a
test(start-plugin-core): check server fn builder options survive and cover satisfies in the import forms
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>
2026-10-16 18:57:36 +02:00
Sheraff
5280195599
chore: drop unused test tooling from router-plugin and router-utils
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>
2026-10-16 18:42:09 +02:00
Sheraff
2e3632dd8b
test(start-plugin-core): check a type specifier import of a server module stays off the client
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>
2026-10-16 18:39:13 +02:00
Sheraff
1944887c59
test: cover type-only namespace imports and exports
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>
2026-10-16 18:39:13 +02:00
Sheraff
2335ff751a
test(router-plugin): drop no-HMR assertions that cannot fail
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>
2026-10-16 18:39:12 +02:00
Sheraff
b51ad179d0
test(router-plugin): pin component identity across hot updates of unsplit routes
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>
2026-10-16 18:39:12 +02:00
Sheraff
c4492ebe3c
test(router-plugin): check React route modules stay Fast Refresh boundaries with plugin-react's runtime
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>
2026-10-16 18:36:59 +02:00
Sheraff
7a7d554755
test(start-plugin-core): delete the dev transitive-importer and resolver source tests
- 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>
2026-10-16 18:27:29 +02:00
Sheraff
0691447a83
test(start-plugin-core): delete the middleware, isomorphic fn, env-only and ClientOnly snapshot suites
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>
2026-10-16 18:26:59 +02:00
Sheraff
86421a2195
test(start-plugin-core): delete the createServerFn snapshot suite and the tests of internal mechanisms
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>
2026-10-16 18:25:31 +02:00
Sheraff
b56d05f3c5
test(start-plugin-core): delete the compiler tests of internal detection and caching
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>
2026-10-16 18:24:19 +02:00
Sheraff
69424d9860
test(start-plugin-core): type the formatting table of the createServerFn tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 18:23:01 +02:00
Sheraff
65925564d0
test(start-plugin-core): add the Vite dev handler-edit and factory-edit tests (N15, N16, N17), loosen the build harness control
- 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>
2026-10-16 18:21:30 +02:00
Sheraff
80aff48e57
test(start-plugin-core): fix the returned-builder and computed-member pins, port the shadowed namespace receiver test
- 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>
2026-10-16 18:19:26 +02:00
Sheraff
b7eb2fbec9
test(start-plugin-core): add the import-forms table (N1) and behavioural replacements of the factory, route-file and formatting cases (N5, N6, N7)
- 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>
2026-10-16 18:17:16 +02:00
Sheraff
c383c45659
test(start-plugin-core): add behavioural replacements of the middleware, isomorphic fn and ClientOnly snapshot fixtures (N2, N3, N4)
- 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>
2026-10-16 18:14:27 +02:00
Sheraff
a38b1817fc
test(start-plugin-core): rewrite the createServerFn unit tests behaviourally, add the client-access round trip (N14) and the D6 pins
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>
2026-10-16 18:10:39 +02:00
Sheraff
cb98e144a8
test(start-plugin-core): find server fns by their metadata in the export and id tests, loosen the side-effect test, add N12
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>
2026-10-16 18:06:44 +02:00
Sheraff
b3fc1b8bd2
test(start-plugin-core): evaluate the callers of the handler-scope table, add N10, rewrite the dead-code cycle test, port the #8504 dead-code tests
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>
2026-10-16 18:04:59 +02:00
Sheraff
ed1b7eff5b
test(start-plugin-core): loosen the server fn placement tests, add the placement goal pins (N13, D13) and fix the placement pins
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>
2026-10-16 18:02:47 +02:00
Sheraff
c73e368901
test(start-plugin-core): evaluate the user-code preservation tests, port the #8504 pragma and user-code tests, pin their main bugs
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>
2026-10-16 17:57:29 +02:00
Sheraff
914bc61bb4
test(start-plugin-core): loosen and extend the factory tests, port the #8504 factory tests, pin their main bugs
- 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>
2026-10-16 17:55:03 +02:00
Sheraff
77406f35bf
test(start-plugin-core): evaluate compiler.test.ts outputs, port the #8504 external transform tests, pin three main bugs
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>
2026-10-16 17:50:48 +02:00
Sheraff
78ca5d2e57
test(router-plugin): type the route module export cases of the dev-server tests
`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>
2026-10-16 17:33:14 +02:00
Sheraff
c5f1a15a97
test(router-utils): delete the Babel helper unit tests
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>
2026-10-16 17:29:05 +02:00
Sheraff
9bd13dbe94
test(router-generator): delete the route option key tests moved to Start
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>
2026-10-16 17:28:26 +02:00
Sheraff
3b85a75b22
test(router-plugin): delete HMR tests of internal steps and plugin names
- 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>
2026-10-16 17:28:11 +02:00
Sheraff
4d5c7e03db
test(router-plugin): delete the snapshot formatter, its controls and the framework list
`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>
2026-10-16 17:27:30 +02:00
Sheraff
e3ecaddb69
test(router-plugin): delete the add-hmr snapshot suite
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>
2026-10-16 17:27:08 +02:00
Sheraff
d1561081b8
test(start-plugin-core): pin route option keys through Start's route tree and prerender consumers, add the #6480 case
- 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>
2026-10-16 17:26:46 +02:00
Sheraff
3e3d71dfc5
test(router-generator): assert route file rewrites by evaluation, port the #8504 transform tests, pin wrapper and type-only Route bugs
- `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>
2026-10-16 17:26:46 +02:00
Sheraff
3e3204a803
test(router-plugin): port the #8504 router-utils tests at compiler level, add the #6480 splitter case
- 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>
2026-10-16 17:26:46 +02:00
Sheraff
762261ab8c
test(router-plugin): route HMR outcome tests, rewritten HMR tests, fixed pins and #8504 ports
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>
2026-10-16 17:26:34 +02:00
Sheraff
5634f0f009
test(router-plugin): extend the route HMR harness
- `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>
2026-10-16 17:26:21 +02:00
Sheraff
2d84189760
test(router-plugin): restore splitter coverage lost with the snapshot suite
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>
2026-10-16 16:52:52 +02:00
Sheraff
d4d6ef509f
docs(router-utils): note that import assertion parsing can be dropped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 16:49:41 +02:00
Sheraff
c66c469198
test(router-plugin): port the #8504-only splitter tests as outcome tests and pins
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>
2026-10-16 16:49:41 +02:00
Sheraff
355ecf8644
docs(router-plugin): state the code-splitting test rules as outcomes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 16:20:42 +02:00
Sheraff
eb606cdb96
test(router-plugin): delete splitter tests of internal ids, helpers and duplicates
- 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>
2026-10-16 16:20:29 +02:00
Sheraff
5dd87fe95f
test(router-plugin): delete the deleteNodes snapshots and the splitter helper unit tests
- 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>
2026-10-16 16:18:19 +02:00
Sheraff
a29b305669
test(router-plugin): delete the code-splitter snapshot and invariant suite
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>
2026-10-16 16:18:11 +02:00
Sheraff
7ed418983d
test(router-plugin): pin that array-destructured components end up split or reported
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 16:17:40 +02:00
Sheraff
cf11216d41
test(router-plugin): keep the marker of the pure-initialiser placement row through minifiers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 16:16:09 +02:00
Sheraff
71c718e3d3
test(router-plugin): pin code-splitting goals at the level that decides them
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>
2026-10-16 16:14:36 +02:00
Sheraff
607e1959c8
test(router-plugin): assert code-splitting outcomes instead of shared-binding placement
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>
2026-10-16 16:06:11 +02:00
Sheraff
2d088cc265
test(compiler-test-utils): follow dynamic imports of static specifiers that contain $
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>
2026-10-16 16:06:02 +02:00
Sheraff
f38ead3443
test(router-generator): move routeIdOf into a shared test helper
`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>
2026-10-16 15:43:38 +02:00
Sheraff
d4e8be6fc1
test(router-plugin): share hotUpdate, take framework and plugin options, derive dev-server module URLs
- `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>
2026-10-16 15:43:38 +02:00
Sheraff
5dd7f8054f
test(react-start-rsc): let compileWithRscCssTransform compile for the client and collect warnings
`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>
2026-10-16 15:32:26 +02:00
Sheraff
31bb6912f1
test(start-plugin-core): evaluate providers in the SSR bundle graph, complete the runtime stub, add framework and preload helpers
- `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>
2026-10-16 15:32:26 +02:00
Sheraff
99ced6df49
test(compiler-test-utils): share the module validator, take a cleanup registrar, add evaluateServed
- 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>
2026-10-16 15:21:20 +02:00
Sheraff
9a25439e50
test(router-plugin,start-plugin-core): pin dev-server bugs found by the dev/HMR review
- 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>
2026-10-16 03:05:24 +02:00
Sheraff
662214200c
test(compiler-test-utils): add Vite and Rsbuild dev-server harnesses
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>
2026-10-16 03:05:24 +02:00
Sheraff
cbb3534ab0
Merge compiler-tests/pins-router into compiler-tests/baseline 2026-10-16 02:27:45 +02:00
Sheraff
b488ae5673
Merge compiler-tests/pins-start into compiler-tests/baseline 2026-10-16 02:27:45 +02:00
Sheraff
3cbbd6cbbb
test(router-plugin): pin router compiler bugs found by the coverage review
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>
2026-10-16 02:26:31 +02:00
Sheraff
0706fff440
test(start-plugin-core): pin Start compiler, Hydrate and import-protection bugs
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>
2026-10-16 02:23:22 +02:00
Sheraff
cc3a03c2cc
test(compiler-test-utils): share the module linker and build harness between the compiler suites
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>
2026-10-16 01:59:32 +02:00
Sheraff
16ba5a39ba
Merge compiler-tests/build-harness into compiler-tests/baseline
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>
2026-10-16 01:42:53 +02:00
Sheraff
0385542bc2
Merge compiler-tests/helpers-router-plugin into compiler-tests/baseline
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 01:42:21 +02:00
Sheraff
2216ebc9c2
Merge compiler-tests/helpers-start into compiler-tests/baseline
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 01:42:21 +02:00
Sheraff
f2f946aae3
test(router-plugin,start-plugin-core): add a real-build harness per bundler
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>
2026-10-16 01:41:08 +02:00
Sheraff
6d7f40753a
test(router-plugin): load route modules like a bundler and runtime in the regression helpers
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>
2026-10-16 01:35:58 +02:00
Sheraff
c9177a98aa
test(start-plugin-core): check compiler behaviour through public contracts in the shared helpers
- 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>
2026-10-16 01:25:37 +02:00
Sheraff
f0d9624bb1
test(router-utils): run the unit tests instead of exiting early
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 00:56:25 +02:00
Sheraff
126942024a
Merge origin/main (7a06725038, Vitest 5 upgrade #8723) into compiler-tests/baseline
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 00:56:22 +02:00
Sheraff
cf5f212268
Merge review/pr-8630 (PR #8630) into compiler-tests/baseline
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 00:53:48 +02:00
Sheraff
0455759068
Merge review/pr-8721 (PR #8721) into compiler-tests/baseline
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 00:53:48 +02:00
Sheraff
7afe254d66
test: pin a webpack hot update without React Refresh and a dev-server lookup deadlock
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>
2026-10-15 15:42:52 +02:00
Sheraff
c19e744c62
test(router-plugin): pin Vite route HMR accept that Vite does not detect
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>
2026-10-15 15:18:10 +02:00
Sheraff
301c1e165c
test: cover handler-named method calls in a server fn and .ts angle-bracket assertions
- 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>
2026-10-15 15:18:09 +02:00
Sheraff
d94a8db458
test: pin type-only re-exports and comments dropped by the import-protection rewrite
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>
2026-10-15 15:04:09 +02:00
Sheraff
bdad0941a0
test(router-plugin): pin a created JSX factory, an unused reference cycle and exported-binding bugs
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>
2026-10-15 14:39:58 +02:00
Sheraff
31f2a6bffa
test(router-plugin): cover the warning for an exported split target that is not code-split
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:31:53 +02:00
Sheraff
75e2ec6f3e
test(start-plugin-core): external compiler transforms run once, in their order's phase
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:31:16 +02:00
Sheraff
039ca8f440
test(start-plugin-core): cover createMiddleware validator errors and client-only middleware
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:31:16 +02:00
Sheraff
8f747ce5b0
test(router-plugin): detect codeSplitGroupings of a code-based createRoute
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:31:06 +02:00
Sheraff
44c71b3173
test(router-plugin): a split chunk exports only the file route's option next to a code-based route
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:31:06 +02:00
Sheraff
a01117a317
test(router-plugin): cover shared-binding removal around shadowing helpers and export lists
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:31:06 +02:00
Sheraff
dd2f92ee03
test(start-plugin-core): cover Hydrate spread props, boundary ids under other queries and the plugin's source cache
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:31:06 +02:00
Sheraff
28857bc15c
test(router-plugin): drop the pin for several routes created in one module
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>
2026-10-15 09:31:30 +02:00
Sheraff
f9115cc59b
test: cover more compiler behaviour for code splitting, route HMR and server functions
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>
2026-10-15 09:31:16 +02:00
Sheraff
2a2fc72b79
test: pin more known compiler bugs from fuzzing, mutation testing and a corpus diff
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>
2026-10-15 09:25:06 +02:00
Sheraff
c2d7e85a96
Merge branch 'main' into test/known-compiler-bugs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 09:19:33 +02:00
Sheraff
c6ae4945ae
test(router-plugin): pin React Refresh renames missing hoisted inline components
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>
2026-10-12 17:02:09 +02:00
Sheraff
e4999a503e
test(start-plugin-core): note the identifier check for the reserved-word mock pin
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 10:20:07 +02:00
Sheraff
7d66cb0f49
test(start-plugin-core): pin import-protection mocks of reserved-word exports
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>
2026-10-11 10:08:21 +02:00
Sheraff
4de3d49013
test(router-generator): keep the known-bug apps' temp files on their filesystem
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>
2026-10-10 20:25:33 +02:00
Sheraff
33afd1b078
test(router-plugin): pin a split object-form loader passed by reference
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 20:20:18 +02:00
Sheraff
21a9b8d29d
test(router-plugin): pin split route options read from a global or an ambient declaration
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>
2026-10-10 19:11:47 +02:00
Sheraff
cfedf1e576
test: pin more known compiler bugs from a differential hunt
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>
2026-10-08 21:02:38 +02:00
Sheraff
e4464cabc4
test(router-plugin): pin the React HMR rename of a lowercase component shared with the loader
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>
2026-10-08 19:31:24 +02:00
Sheraff
566a5224a0
test(react-start-rsc): make the RSC CSS comment pins notice a dropped JSX argument
`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>
2026-10-08 18:10:56 +02:00
Sheraff
a19b6d6a8c
test(router-plugin): close holes in the known-bug pins
- 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>
2026-10-08 18:10:56 +02:00
Sheraff
0ac83125f7
test(start-plugin-core): close holes in the known-bug pins
- 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>
2026-10-08 18:10:56 +02:00
Sheraff
6c4e866b3c
Merge branch 'main' into test/known-compiler-bugs
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 16:26:22 +02:00
Sheraff
2c567b8a1c
test: make known-bug pins fix-agnostic and drop unreachable ones
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 15:36:21 +02:00
Sheraff
b8911b543b
Merge branch 'test/compiler-regression-coverage' into test/known-compiler-bugs
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 15:30:50 +02:00
Sheraff
40af4c19ec
test(start-plugin-core): link Hydrate chunks to their parent however a fix imports it
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 15:30:43 +02:00
Sheraff
b92878bac5
test(start-plugin-core): link Hydrate pin chunks through the shared parent module stubs
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 15:04:11 +02:00
Sheraff
98d8bbb4eb
Merge branch 'test/compiler-regression-coverage' into test/known-compiler-bugs
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

# Conflicts:
#	packages/start-plugin-core/tests/regression-helpers.ts
2026-10-07 15:02:47 +02:00
Sheraff
02cf44706b
test(react-start-rsc): move known RSC CSS transform bugs next to the transform tests
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 15:02:38 +02:00
Sheraff
41a815bee2
test(start-plugin-core): consolidate known Start compiler, Hydrate and import protection bugs
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 15:02:38 +02:00
Sheraff
994d4e5e39
test(router-plugin): consolidate known code-splitter and route HMR bugs
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 15:02:38 +02:00
Sheraff
b7a76ee825
test: share the build and React Refresh helpers
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 15:02:29 +02:00
Sheraff
a23021d77a
test: keep regression tests valid once known compiler bugs are fixed
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 14:47:46 +02:00
Sheraff
bf0f6d27d0
Merge branch 'test/compiler-regression-coverage' into test/known-compiler-bugs
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 14:24:34 +02:00
Sheraff
a4bc82c52b
test(react-start-rsc): move RSC CSS transform edge cases into rscCssTransform.test.tsx
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>
2026-10-07 14:12:25 +02:00
Sheraff
004085d06e
test(router-generator): move transform edge cases into transform.test.ts
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>
2026-10-07 14:12:04 +02:00
Sheraff
b86e6467a8
test(start-plugin-core): regroup compiler regression tests by behaviour
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>
2026-10-07 14:12:04 +02:00
Sheraff
4a8a60df14
test(router-plugin): regroup compiler regression tests by behaviour
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>
2026-10-07 14:11:58 +02:00
Sheraff
9ec82ff6b1
test(router-plugin): keep covering configs without the router plugin
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>
2026-10-07 00:22:14 +02:00
Sheraff
94a67d0a7d
test(router-generator): merge the parenthesized route call transform tests
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>
2026-10-07 00:18:09 +02:00
Sheraff
b42763e3d1
test(start-plugin-core): merge duplicated compiler regression tests
- 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>
2026-10-07 00:18:09 +02:00
Sheraff
4e0c96a3db
test(router-plugin): merge duplicated compiler regression tests
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>
2026-10-07 00:18:09 +02:00
Sheraff
c3aa005f5c
test(react-start-rsc): share the RSC CSS transform compile helper
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>
2026-10-07 00:14:37 +02:00
Sheraff
a97add703d
test(start-plugin-core): share compiler regression test helpers
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>
2026-10-07 00:14:37 +02:00
Sheraff
0909bf5e0c
test(router-plugin): share compiler regression test helpers
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>
2026-10-07 00:14:31 +02:00
Sheraff
3b52f583a1
test(start-plugin-core): consolidate known Start compiler bugs
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>
2026-10-07 00:05:41 +02:00
Sheraff
bb6a087b70
test(start-plugin-core): consolidate known Hydrate bugs and share their helpers
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>
2026-10-07 00:03:35 +02:00
Sheraff
19c33deca7
test(router-plugin): group known bugs by area and merge shared root causes
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>
2026-10-07 00:03:24 +02:00
Sheraff
ef78d39703
test(router-plugin): pin shared helpers reading a var declared in a block
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>
2026-10-06 23:49:24 +02:00
Sheraff
2006c0a795
test: pin bugs found with babel-dead-code-elimination and Turbopack scenarios
- 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>
2026-10-06 23:24:22 +02:00
Sheraff
0f84f47db3
test(start-plugin-core): pin CommonJS parse failures found with @vitejs/plugin-rsc cases
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>
2026-10-06 23:24:22 +02:00
Sheraff
e1ca059d79
test: port babel-dead-code-elimination and Turbopack tree-shaker scenarios
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>
2026-10-06 23:24:20 +02:00
Sheraff
a7318fbab7
test(router-plugin, start-plugin-core, react-start-rsc): port @vitejs/plugin-rsc transform edge cases
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>
2026-10-06 23:24:19 +02:00
Sheraff
dd0c042752
test(router-plugin): pin React Refresh gaps in route HMR
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>
2026-10-06 23:22:22 +02:00
Sheraff
62ce5e0c4c
test(router-plugin): port React Refresh and solid-refresh scenarios to route HMR
Covers which route component shapes React Refresh registers after the HMR
transforms (checked with Vite's Oxc React Refresh transform), hook
signatures, @refresh reset, generated-name collisions, and the module shape
solid-refresh expects (registrable components, @refresh reload/skip,
top-level createContext).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-06 23:22:20 +02:00
Sheraff
4c7917c935
test(start-plugin-core): port SolidStart directive and Waku allowServer edge cases
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>
2026-10-06 23:19:49 +02:00
Sheraff
3f07e6722a
test(start-plugin-core): pin Hydrate capture bugs found with SolidStart directive checks
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>
2026-10-06 23:18:48 +02:00
Sheraff
4a74486937
test: cover exported route variables in split chunks and JSX pragma forms
- 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>
2026-10-06 23:14:07 +02:00
Sheraff
1cf725e83e
test(router-plugin, start-plugin-core): pin bugs found with React Compiler fixtures
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>
2026-10-06 22:31:35 +02:00
Sheraff
f6058e0788
test(router-plugin, start-plugin-core): port React Compiler fixture shapes
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>
2026-10-06 22:31:33 +02:00
Sheraff
a36449403a
test(router-plugin, start-plugin-core): cover real-world compiler shapes
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>
2026-10-06 22:31:33 +02:00
Sheraff
ebc44a64e6
test(start-plugin-core, router-plugin): pin compiler bugs found by porting Qwik optimizer tests
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>
2026-10-06 22:27:59 +02:00
Sheraff
28bfbb825b
test(start-plugin-core, router-plugin): port Qwik optimizer extraction edge cases
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>
2026-10-06 22:27:57 +02:00
Sheraff
16192655a4
test(router-plugin): pin splitting bugs found via Next.js and React Router fixtures
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>
2026-10-06 22:24:15 +02:00
Sheraff
faa5868f97
test(router-plugin): port Next.js SSG and React Router route-chunk splitting scenarios
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>
2026-10-06 22:22:46 +02:00
Sheraff
0b91de6c39
test(start-plugin-core): pin a 'use client' provider bug found via Next.js fixtures
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>
2026-10-06 22:19:00 +02:00
Sheraff
4c4912ff5a
test(start-plugin-core): port Next.js server actions fixtures to createServerFn
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>
2026-10-06 22:18:13 +02:00
Sheraff
966e54d01e
test(router-plugin, start-plugin-core, react-start-rsc): pin known compiler bugs as expected failures
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>
2026-10-06 21:48:00 +02:00
Sheraff
a1a870eaff
test(router-plugin, start-plugin-core, router-generator, react-start-rsc): cover compiler edge cases
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>
2026-10-06 20:48:44 +02:00
Sheraff
ed258f924b
test: require hoisting and declared bindings in compiler regression tests
- 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>
2026-10-06 20:07:27 +02:00
Sheraff
216ec30d70
test(router-plugin, start-plugin-core): cover compiler output regressions
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

Some files were not shown because too many files have changed in this diff Show more