Skip to content
Source
Sign inSign up
TanStack/router

perf(start): dispatch server-only routes without constructing a Router #8882

Opentombeckenhamwants to merge 1 commit intomain fromrefs/pull/8882/headopened

Showing 38 changed files with 54 additions and 0 deletions (loading 34).

x
0 of 38 viewed, 38 left
11 additions and 0 deletions.changeset/server-route-fast-path.mdAdded
View file
@@ -0,0 +1,11 @@
+---
+'@tanstack/start-server-core': minor
+'@tanstack/start-plugin-core': minor
+'@tanstack/router-core': minor
+---
+​
+perf(start): dispatch server-only routes without constructing a Router. The Start plugin builds a server-only route tree, and `createStartHandler` matches exact server-route requests against it before touching the router entry, which now loads lazily. Apps whose root route defines `server` options, or where a server-only param route would shadow a page, keep the Router path with a build warning.
+​
+Router-level `caseSensitive` and `rewrite` options are not applied to a request served from the server-only tree; route-level `caseSensitive` is. Only the Vite plugin builds the tree, so Rsbuild apps keep the Router path.
+​
+`@tanstack/router-core` now exports `processRouteTree`, `findRouteMatch` and the `ProcessRouteTreeResult` type.
24 additions and 0 deletionsbenchmarks/ssr/scenarios/server-routes-matrix/react/src/routes/__root.tsxAdded
View file
@@ -0,0 +1,24 @@
+import {
+ HeadContent,
+ Outlet,
+ Scripts,
+ createRootRoute,
+} from '@tanstack/react-router'
+​
+export const Route = createRootRoute({
+ component: RootComponent,
+})
+​
+function RootComponent() {
+ return (
+ <html>
+ <head>
+ <HeadContent />