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>
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>
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>
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>
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>
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>
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>
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>
- 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>