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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
`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>
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>
* chore(pnpm): upgrade to pnpm 12
* ci: use native pnpm 12 bootstrap for compiler jobs
* fix(benchmarks): invoke the Nx CLI directly
* refactor(benchmarks): run Nx through pnpm exec
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>
Start's compiler transform is ordered `pre` at the hook level, so it reads
every module before the framework plugins' own `pre` transforms wherever
the app lists `tanstackStart()`. With Start after `vite-plugin-solid`,
Solid's dev hot-update wrapper turned each route component into a call
before the compiler saw it: the dev client kept components in the route
module while SSR split them (hydration mismatch, route edits reloading,
server fn calls failing). main refused that order through router-plugin's
code-splitter check, which Start no longer installs.
Tests: Start listed after the framework plugin, Vite dev (Solid, React,
Vue), Vite build (Solid, React) and Rsbuild dev (Solid): the route splits
in the client, the page hydrates, a route edit applies in place.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A 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>
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>
* refactor(start-plugin-core): derive server-fn ids from the stable key, with 22-character defaults
`serverFns.generateFunctionId` now receives the server function's
stable name (`greetUser`) as `functionName` instead of the generated
handler name (`greetUser_createServerFn_handler`). Repeats of the same
variable name in one file get `#1`, `#2`, ...
Default production ids are the first 22 base64url characters of the
SHA256 of `<file>#<stable key>` instead of the full 64-character hex
digest.
Split out of #8817, which derives ids the same way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(start-plugin-core): keep generateFunctionId's handler-name input, reject custom ids that aren't one URL path segment
Follows #8817's current id contract:
- `generateFunctionId` receives the generated handler name again
(`greetUser_createServerFn_handler`, `_1`, `_2`… for repeats), with
characters outside `[A-Za-z0-9_$]` as `_`. The handler export keeps its
name.
- The default id stays 22 base64url characters of
`sha256("<root-relative file>#<variable name>")`, `#n` for repeats.
- A custom id outside RFC 3986's unreserved characters and `$` (or `.`,
`..`, empty) fails the build, naming the file, the function and the id.
- The e2e id maps return to main's keys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(start-plugin-core): a repeated server function name loses leading and doubled underscores
The generator's `functionName` for a repeated name goes through the old
increment rule, which strips leading underscores and collapses runs of
underscores (a second `_x` gets `x_createServerFn_handler_1`). Say so,
and pin it with `_x` twice and `café` then `caf_`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(start-plugin-core): names that become equal after the `_` replacement get suffixes too
`café` and `caf_` both give `caf__createServerFn_handler`, so the later
one gets `caf_createServerFn_handler_1`, like a repeated variable name.
Describe the replacement first, then the suffix rule for any resulting
duplicate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(start-plugin-core): keep main's server-fn ids; refuse custom ids that never worked over HTTP
#8817 now prints main's default ids and passes main's functionName to
generateFunctionId, so this reverts the shorter default ids, the
generator-name split and the empty-id failure. What stays is #8817's
custom-id check: an id the URL never carries whole fails the build, one
with other characters outside the unreserved set and $ builds with a
deprecation warning, and the resolver manifest escapes a `'` in an id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The samples are a real build's output: the trace starts at the app's router,
the server-side suggestion is <ClientOnly> from how the import is used, the
fourth client suggestion splits the file. Adds the negative-pattern fix of a
pattern import and the Vue SFC form of a client-only component.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start's Vite plugin crawls the app's dependencies with vitefu to bundle
the packages that use Start on the server (ssr.noExternal). Its predicate
only read peerDependencies, so an installed kit listing Start under
dependencies stayed external: Node loaded it uncompiled, its server fns
threw on the server and client calls answered 500. The predicate reads
dependencies too, Start's own packages aside (the resolve.noExternal
patterns bundle them already). Docs: server fns in packages, with
peerDependencies recommended.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A <Hydrate> imported from an app module re-exporting it (a named
re-export, an imported binding exported again, export *, a namespace
import, chains) deferred hydration but never split: the children's code
loaded with the page. The recognizer now lists Hydrate as a kind of the
React and Solid Start packages (as ClientOnly is), so summaries and the
re-export walk recognise it; start-env ignores the kind. The hydrate
planner's prefetch reads its candidates through Start's value reader,
shared with start-env's prefetch, restricted to app modules (a Vite
server resolves no package it externalises). Boundary ids count every
element imported as Hydrate, so no per-environment resolution shifts
another boundary's id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The client puts a server function's id after the server function base
unencoded and the server reads the path segment back, so an id from a
custom `generateFunctionId` with `/`, `#`, `?`, whitespace, a control or
non-ASCII character silently called another function of the file or
none. The build now fails for an id outside RFC 3986's unreserved
characters and `$` (or `.`/`..`), naming the file, the function and the
id; the docs say what an id may contain.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A custom generator received the compiler's internal key as `functionName`
(`twice#1` for a name a module repeats, `fn@outer/inner` for a nested
server function). An id that embeds it reached the URL unencoded: the
browser dropped `#1` as a fragment and the server cut the id at `/`, so a
call silently ran another server function of the module.
`functionName` is again the handler name earlier versions generated
(`<name>_createServerFn_handler`, `_1`, `_2`… in source order, with the
same increment rules), so custom ids survive the upgrade; characters
outside `[A-Za-z0-9_$]` become `_`. The e2e id maps return to the old keys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
`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>
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>
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>
One file-or-marker verdict for edges, a module's own violation and asset queries
(excludeFiles skips both). A denied file exclude matches is judged too. A virtual
asset is never read back through the host. On Rsbuild only an asset that can be
denied meets the loader, on clients. Docs say what is covered; the asset-query
tests split at the file budget.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scope is about importers: a pattern reaching a file outside it, a plain glob of
a denied data file and Rsbuild's new URL of a text file are mocked and reported, as
main reports them. An app file outside the scope is indexed like an exempt
importer: it keeps the real module of a denied file outside the scope too (J6.7),
and the mock of one inside it (R89).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>