* fix(router): final-review regressions, changeset, and byte recovery
Fixes the regressions vs main found in the final review of #7805:
- restore history-subscription cleanup on router provider unmount in all
three adapters (react returns the unsubscribe unconditionally, solid
uses onCleanup, vue uses onUnmounted), pinned by new
transitioner-remount tests — a discarded router could previously keep
loading on back/forward as a zombie
- same-destination navigations now join the in-flight transaction
instead of aborting and restarting it (double-click no longer reruns
loaders); reloads and same-location redirects keep restart semantics
- commitMatches cache retention can no longer resurrect a
one-generation-old loaderData when a newer committed success exists
for the same match id
- same-location dedup keeps __tempLocation/__tempKey so masked vs real
same-href navigations commit their state again
Adds the missing release changeset enumerating the removed/changed
public API with migration hints.
Byte recovery: merges rendered-matches.ts, route-chunks.ts and
hydrate.ts into load-client.ts so the client bundle shares gzip
dictionary context across what were separate module boundaries
(-104..-186 gzip B per start scenario; plain router scenarios remain
net-negative vs main and hydration still tree-shakes out of them).
The solid/vue store-update-count pins were re-adjusted after verifying
the published update sequences are byte-identical: the counts only
shifted because a one-microtask timing change moves the tests'
waitFor-sampled window boundary (5 of 7 counts decreased).
* test(router-devtools-core): keep panel chunk warm-up out of the test budget
The cache-replacement test warmed Vite's lazy transform of
BaseTanStackRouterDevtoolsPanel inside the test body, so on slow CI
runners the transform alone could blow the 5s test timeout (observed at
5.89s). Move the warm-up to a beforeAll with its own generous timeout
and give the test itself explicit headroom. Pre-existing flake on the
lane branch tip, surfaced by this PR's CI being the first to run on it.
* refactor(router-core): extend lane typestate to matches and commits
The lane pipeline already carried phase brands at lane granularity
(Lane<'matched'|'contextualized'|'reduced'|'projected'>); this finishes
the pattern at the two granularities it was missing, at zero runtime
cost (all emitted dist JS verified byte-identical):
- settleInto becomes the sole granter of a SettledMatch brand via an
assertion signature, and cacheLoaderMatch requires it — the
loader -> settle -> cache ordering is now compiler-enforced. The one
legitimate phase jump (hydration cache-seeding of already-settled
dehydrated data) is a single named, commented boundary cast.
- commitMatches/commitRefreshMatches only accept a projected lane's
matches (LaneMatches<'projected'>), so committing an earlier-phase
lane no longer compiles.
- LoadTransaction's dev-only refresh triple collapses into one optional
slot [presentation, handoff?], making a half-armed refresh state
unrepresentable and shrinking the clear/read sites.
* 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>
extractFlattened() always allocated a new Uint8Array and copied `count`
bytes, even when the requested bytes were fully contained in the first
buffered chunk (the common case, since most frames arrive within a single
network read).
Add a fast path that returns a subarray view of the first chunk when the
bytes are contiguous, avoiding the allocation and the byte copy. The
multi-chunk path is unchanged. The returned view shares the chunk's
backing ArrayBuffer, which is safe because buffered chunks are never
mutated in place after being read.
This is on the hot path for decoding every streamed server-function
response and RawStream binary payload on the client. A micro-benchmark
shows ~3x faster extraction for 1KB frames and ~27x for 64KB frames (the
win scales with payload size).
* 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`.