* fix(start-plugin-core): define TSS_SHELL in Rsbuild dev for SPA mode
In Rsbuild dev mode, `source.define` now sets `process.env.TSS_SHELL` and `import.meta.env.TSS_SHELL` from `startConfig.spa?.enabled` (`"true"` when SPA mode is enabled, `"false"` otherwise). Before this, Rsbuild dev never defined `TSS_SHELL`, so with `spa: { enabled: true }` it server-rendered the matched route and ran its loader on the server instead of serving only the shell. Build and preview are unchanged: the define is added only when `isDev` is true.
Changes:
- `packages/start-plugin-core/src/rsbuild/plugin.ts`: add the dev-only `TSS_SHELL` defines to the Rsbuild define block.
- `packages/start-plugin-core/tests/rsbuild/spa-shell-define.test.ts`: new test that calls the plugin's `modifyRsbuildConfig` hook. It checks that `TSS_SHELL` is `"true"` in dev with SPA enabled, `"false"` in dev without SPA, and not defined in build.
- `.changeset/rsbuild-spa-dev-shell.md`: patch changeset for `@tanstack/start-plugin-core`.
Fixes#8543
Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Assisted-by: claude-sonnet-5-5 (via Claude Code)
* test(start-plugin-core): check the SPA shell on a real Rsbuild dev server
- `src/rsbuild/plugin.ts`: the `TSS_SHELL` define gets #8817's comment.
- The regression test serves a real app with `rsbuild dev` (a new
`startRsbuildDevServer` in `tests/integration/start-app.ts`) and fetches
its `/` route: with `spa.enabled` the loader no longer runs on the
server; without it, the control still renders the route there. This is
#8817's `integration/rsbuild/dev-server-config.test.ts` scenario, and it
replaces the unit test that stubbed the plugin API.
- The changeset says what users see.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(start-plugin-core): the SPA dev test checks the shell and counts loader runs
The SPA test only checked a 200 without `MARK_SERVER`, which an empty
answer or a loader run whose output the shell drops would also pass.
The root route now renders its own text, so the SPA answer must hold it
without the `/` route's; the loader counts its runs on `globalThis`
(Rsbuild dev runs the server bundle in the test's process), so the SPA
test asserts none and the control asserts one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(react-start): check the dev SPA shell with an e2e on Vite and Rsbuild
Replace the synthetic Rsbuild integration test with one e2e in
e2e/react-start/basic, run against both dev servers:
test:e2e--vite-spa--dev and test:e2e--rsbuild-spa--dev
(playwrightModes with E2E_DEV_SERVER, no app build, the shared dev
server prewarm). spa-shell.spec.ts checks that the raw document is the
shell, that the route's loader and beforeLoad run in the browser, and
that client navigation works from the shell. It runs in the prod SPA
mode too.
tests/integration/start-app.ts is back to main's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Co-authored-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Co-authored-by: Sheraff <me@florianpellet.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* perf: lower manifest script preload priority
* fix(start-server-core): forward fetchPriority into static Early Hints
Static script hints were built from getScriptPreloadAttrs but copied only
href, rel, as and crossOrigin, so Chromium started hinted preloads at
MEDIUM before the HTML's fetchPriority="low" arrived. Build them with the
shared addEarlyHintFetchAttrs helper, which the dynamic hint path already
uses, so fetchPriority (and crossOrigin) are carried into 103 hints and the
response Link header.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test: cover low-priority manifest preloads in Solid and Vue
Add a Solid server-suite SSR test for module and IIFE preloads and assert
fetchpriority="low" on rendered preloads in the Solid and Vue HeadContent
tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs: note low-priority JavaScript Early Hints
Mention that JavaScript Early Hints carry fetchpriority=low and extend the
changeset to start-server-core.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Manuel Schiller <6340397+schiller-manuel@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* chore(deps): bump srvx to ^1.0.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(deps): bump @vitejs/plugin-rsc to ^0.5.37
0.5.37 depends on srvx ^1.0.5, which drops the last srvx 0.11 copy from
the lockfile. It is temporarily excluded from minimumReleaseAge until it
is 24h old.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore: drop minimumReleaseAge exclusion for @vitejs/plugin-rsc
0.5.37 is now older than the 24h minimum release age.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(ci): TEMP experiment - rsc e2e on srvx 0.10 (revert before merge)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Revert "test(ci): TEMP experiment - rsc e2e on srvx 0.10 (revert before merge)"
This reverts commit 2c7279a0b9.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
test(rsc): wait for streamed notifications instead of fixed sleeps
The progressive-streaming tests slept 500ms and expected the initial batch
of 3 notifications to be rendered. React throttles Suspense reveals by
300ms, so the batch can legitimately land after that window. Wait for the
3rd notification, assert the stream is still open with fewer than all
notifications, then wait for the next one and for completion.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(start-plugin-core): preload transitive static imports and fix Rsbuild shared-chunk CSS
Route preloads read a chunk's `imports` as a complete list, which only
holds when the bundler hoists transitive imports. Walk the static import
graph instead, and derive Rsbuild chunk imports from the module graph
rather than chunk-group siblings so shared chunks stop attaching
unrelated route CSS to the SSR response.
Fixes#8415Fixes#8511
* refactor(start-plugin-core): share one static import walk for preloads and CSS
The manifest builder walked the static import graph twice, once breadth-first
for preloads and once recursively for stylesheets. A single memoized
depth-first walk now records discovered file names for preloads and chunks in
post-order for stylesheets, which also keeps every chunk in an import cycle
seeing the whole cycle instead of a partially cached result.
The Rsbuild adapter resolved static dependency chunks again for every CSS-only
chunk reached from each importer; the resolution is now memoized per chunk.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* docs(start-plugin-core): drop Rollup from the imports contract comments
Rollup is no longer a supported client bundler, so the `imports` contract is
described in terms of the direct-imports-only lists Rolldown and Rsbuild emit.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: Manuel Schiller <6340397+schiller-manuel@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
* fix(start): preserve dev SSR CSS order
fixes#7794
* add e2e tests for solid and vue, handle vue style urls
* test(start): cover bundled dev styles and SSR reload lifecycle
* fix(start): use completed bundled graph for dev SSR styles
* fix(start): preserve import reachability across bundled dev variants
* test(start): cover layered inline CSS without build observers
* test(start): wait for bundled HMR route registration
* test(start): await HMR readiness in both Vite modes
* test(start): trace initial bundled HMR update in CI
* test(start): trace native bundled HMR watcher in CI
* test(start): inspect initial native watch registrations
* fix(start): support the latest bundled dev toolchain
/lazy-css-lazy and /lazy-css-static both render `shared-widget`, and the URL
updates before the departing route unmounts, so assertions after `waitForURL`
could hit the old widget while it was being detached and read `""`. Wait for a
destination-only marker and use retrying `toHaveCSS` assertions instead.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* docs(start): correct authentication server function examples
* docs(start): prevent caching session-specific auth pages
* docs(start): guard login forms until hydration
* test(start): assert authentication behavior in SSR and SPA modes
Use the Start storage context for request cancellation and focused server entrypoints to keep unrelated route dependencies out of the RSC module graph. Add emitted-build regression coverage for the boundary.
fixes#7938
* fix(router-core): preserve percent-encoded URL-unsafe chars in decodeSegment
Replace sanitizePathSegment (which stripped control characters) with a
re-encode step that keeps WHATWG path percent-encode set characters and
control characters in their encoded form after decodeURI.
This preserves the existing decodeURI-based approach which correctly
handles multi-byte UTF-8 sequences, while fixing the mismatch between
the original request URL and the router's internal representation that
caused infinite 307 redirect loops on paths containing these characters.
Fixes#7587.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* ci: apply automated fixes
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Flo <me@florianpellet.com>
* fix(start-plugin-core): support rsbuild preview SSR
* fix(start-plugin-core): always install rsbuild SSR middleware in preview
Preview is the only SSR handler in `rsbuild preview`, so gate the opt-out
to dev only and keep the option named `installDevServerMiddleware`.