diff --git a/.changeset/hide-router-internals.md b/.changeset/hide-router-internals.md
new file mode 100644
index 00000000000..6ba87d11e71
--- /dev/null
+++ b/.changeset/hide-router-internals.md
@@ -0,0 +1,29 @@
+---
+'@tanstack/router-core': patch
+'@tanstack/history': patch
+'@tanstack/react-router': patch
+'@tanstack/solid-router': patch
+'@tanstack/vue-router': patch
+---
+
+Remove undocumented internals from the published type declarations. Runtime behaviour is unchanged: every value is still exported from the same entry points and every property still exists at runtime. Only the types no longer name them. Code that used one of these names gets a type error and needs a cast. They are internal and can change in any release.
+
+Router (`RouterCore` and the framework `Router` classes): `_tx`, `_cache`, `_serverResult`, `_rendered`, `_scroll`, `_refreshRoute`, `_replaceRouteChunk`, `_lifecycleEnd`, `_flights`, `_preloads`, `_preflight`, `_handoff`, `_pending`, `_committed`, `_pendingLocation`, `_commitPromise`, `stores`, `batch`, `emit`, `subscribers`, `isServer`, `ssr`, `origin`, `basepath`, `rewrite`, `protocolAllowlist`, `startTransition`, `startViewTransition`, `shouldViewTransition`, `tempLocationKey`, `getStoreConfig`, `latestLocation`, `processedTree`, `resolvePathCache`, `lightweightCache`, `staticLocations`, `pathParamsDecoder`, `updateLatestLocation`, `buildRouteTree`, `setRoutes`, `parseLocation`, `matchRoutesInternal`, `getMatchedRoutes`, `matchRoutesLightweight`, `buildAndCommitLocation`, `resolveRedirect`, `serverSsrLifecycle`, `commitLocation` and `routesByPath`.
+
+Matches (`RouteMatch`): `index`, `loaderDeps`, `preload`, `invalid`, `headers`, `_strictParams`, `_strictSearch` and `_notFound`, and the `meta`, `links`, `scripts`, `styles` and `headScripts` fields that the framework packages add.
+
+Routes (`Route` and `BaseRoute`): `options`, `children`, `rank`, `init`, `isRoot`, `originalIndex` and `updateLoader`. `FileRoute`: `silent`.
+
+History (`RouterHistory`): `location`, `length`, `subscribe`, `subscribers`, `canGoBack`, `block`, `notify`, `flush`, `createHref`, `_getBlockers`, `_ignoreSubscribers` and `_ignoreNextBeforeUnload`. `history.go` and `history.forward` stay and are now documented. `HistoryState.__hashScrollIntoViewOptions` in the framework packages is hidden as well.
+
+Options: `_fromLocation`, `_isNavigate`, `_includeValidateSearch`, `_signal`, `_skipLocationUpdate`, `unsafeRelative`, the deprecated `startTransition` navigation option, and the router options `additionalContext`, `isServer`, `isShell` and `isPrerendering`.
+
+Exports of `@tanstack/router-core`: `TSR_DEFERRED_PROMISE`, `invariant`, `preloadWarning`, `DEV_STYLES_ATTR`, `appendUniqueUserTags`, `createInlineCssStyleAsset`, `getAssetCrossOrigin`, `getManifestScriptFormat`, `getScriptPreloadAttrs`, `getStylesheetHref`, `resolveManifestAssetLink`, `resolveManifestCssLink`, `_getAssetMatches`, `_getRenderedMatches`, `_isRouteDeparting`, `composeSsrBodyScripts`, `getSsrBodyScriptParts`, `joinPaths`, `cleanPath`, `trimPathLeft`, `trimPathRight`, `trimPath`, `removeTrailingSlash`, `exactPathTest`, `resolvePath`, `interpolatePath`, `getRouteSegments`, `hasMissingPathParams`, `encode`, `decode`, `createNonReactiveMutableStore`, `createNonReactiveReadonlyStore`, `defaultSerializeError`, `getLocationChangeInfo`, `getInitialRouterState`, `trailingSlashOptions`, `createRouterConfig`, `functionalUpdate`, `hasKeys`, `replaceEqualDeep`, `deepEqual`, `createControlledPromise`, `isPromise`, `isModuleNotFoundError`, `escapeHtml`, `getUrlScheme`, `isDangerousProtocol`, `buildDevStylesUrl`, `isResolvedRedirect`, `parseRedirect`, `defaultGetScrollRestorationKey`, `getElementScrollRestorationEntry`, `storageKey`, `setupScrollRestoration`, `makeSerovalPlugin` and `executeRewriteInput`.
+
+Exports of `@tanstack/router-core/ssr/server`: `waitForRequest`, `bindSsrResponseToRequest`, `createSsrStreamResponse`, `disposeSsrResponse`, `getSsrStatus`, `isSsrResponse`, `normalizeSsrResponse`, `replaceSsrResponse`, `stripSsrResponseBody`, `transformHtmlStringWithRouter`, `renderSsrHtmlResponse`, `getNormalizedURL`, `getOrigin`, `defaultSerovalDeserializerPlugins`, `createRawStreamRPCPlugin` and `makeSsrSerovalPlugin`. Of `@tanstack/router-core/ssr/client`: `createDefaultSerovalPlugins`, `defaultSerovalPlugins`, `makeSerovalPlugin` and `createRawStreamDeserializePlugin`. Of `@tanstack/router-core/isServer`: `isServer` and `loadServerRoute`. Of `@tanstack/router-core/scroll-restoration-script`: `getScrollRestorationScriptForRouter`.
+
+Exports of `@tanstack/history`: `createHistory`, `parseHref`, `normalizeProtocolRelative` and the `NavigationBlocker` type.
+
+Exports of the framework packages: `joinPaths`, `cleanPath`, `trimPath`, `trimPathLeft`, `trimPathRight`, `resolvePath`, `interpolatePath`, `functionalUpdate`, `replaceEqualDeep`, `deepEqual`, `createControlledPromise`, `createHistory`, `createRouterConfig`, `Matches`, `Match`, `Asset`, `useTags`, `RouterContextProvider` and `FileRouteLoader`, and in `@tanstack/react-router` also `useLayoutEffect` and `reactUse`.
+
+Types that no public declaration uses any more, from `@tanstack/router-core` and the framework packages that re-export them: `AnyRouteWithContext`, `AnyRouterWithContext`, `AnySearchValidator`, `AnyStandardSchemaValidateInput`, `AnyValidatorFn`, `CommitLocationFn`, `CommitLocationOptions`, `ControllablePromise`, `ControlledPromise`, `CreateLazyFileRoute`, `DefaultSearchValidator`, `EmitFn`, `ErrorRouteProps`, `GetMatchRoutesFn`, `IsAny`, `IsUnion`, `LoadRouteChunkFn`, `MatchLocation`, `MergeAll`, `MergeAllObjects`, `MetaDescriptor`, `ParseLocationFn`, `PickRequired`, `PreloadableObj`, `ResolvedRedirect`, `ResolveSearchSchema`, `ResolveSearchSchemaFn`, `ResolveSearchSchemaFnInput`, `ResolveSearchSchemaInput`, `RouteContextFn`, `RouteLinkEntry`, `RoutePathOptionsIntersection`, `RouterConfig`, `RouterConfigOptions`, `RouterConfigTypes`, `AnyRouterConfig`, `RouterListener`, `RouterManagedInlineCssTag`, `RouterStores`, `SearchValidator`, `StartTransitionFn`, `StringLiteral`, `Timeout`, `ValidateId`, `ValidateNavigateOptionsArray`, `ValidateParams`, `ValidateRedirectOptionsArray`, `ValidateSearch`, `ValidateToPath`, `ValidateUseParamsResult`, `ValidateUseSearchResult` and `WithoutEmpty`; in the framework packages also `ValidateUseSearchOptions` and `ValidateUseParamsOptions`, `InferStructuralSharing` in `@tanstack/react-router` and `VueNode` in `@tanstack/vue-router`.
diff --git a/benchmarks/bundle-size/scenarios/react-router-full/src/routes/__root.tsx b/benchmarks/bundle-size/scenarios/react-router-full/src/routes/__root.tsx
index d8948fdb7e3..c044b3922cd 100644
--- a/benchmarks/bundle-size/scenarios/react-router-full/src/routes/__root.tsx
+++ b/benchmarks/bundle-size/scenarios/react-router-full/src/routes/__root.tsx
@@ -1,5 +1,4 @@
import {
- Asset,
Await,
Block,
CatchBoundary,
@@ -9,12 +8,9 @@ import {
ErrorComponent,
HeadContent,
Link,
- Match,
MatchRoute,
- Matches,
Navigate,
Outlet,
- RouterContextProvider,
ScriptOnce,
Scripts,
ScrollRestoration,
@@ -41,7 +37,6 @@ import {
useRouter,
useRouterState,
useSearch,
- useTags,
} from '@tanstack/react-router'
export const Route = createRootRoute({
@@ -68,7 +63,6 @@ function RootComponent() {
const canGoBack = useCanGoBack()
const navigate = useNavigate()
const scrollEntry = useElementScrollRestoration({ id: 'root-scroll' })
- const tags = useTags()
useBlocker({
shouldBlockFn: () => false,
@@ -101,7 +95,6 @@ function RootComponent() {
useLocation,
useCanGoBack,
useElementScrollRestoration,
- useTags,
Await,
CatchBoundary,
CatchNotFound,
@@ -109,16 +102,12 @@ function RootComponent() {
DefaultGlobalNotFound,
ErrorComponent,
Link,
- Match,
MatchRoute,
- Matches,
Navigate,
Outlet,
- RouterContextProvider,
ScrollRestoration,
Block,
ScriptOnce,
- Asset,
HeadContent,
Scripts,
]
@@ -143,17 +132,12 @@ function RootComponent() {
void canGoBack
void navigate
void scrollEntry
- void tags
void routeMatchResult
return (
<>
{'window.__tsr_bundle_size = true'}
-
home
@@ -171,9 +155,6 @@ function RootComponent() {
}>
-
-
-
diff --git a/benchmarks/bundle-size/scenarios/react-start-full/src/routes/__root.tsx b/benchmarks/bundle-size/scenarios/react-start-full/src/routes/__root.tsx
index 07fd3a40be2..a81645fa264 100644
--- a/benchmarks/bundle-size/scenarios/react-start-full/src/routes/__root.tsx
+++ b/benchmarks/bundle-size/scenarios/react-start-full/src/routes/__root.tsx
@@ -1,5 +1,4 @@
import {
- Asset,
Await,
Block,
CatchBoundary,
@@ -9,12 +8,9 @@ import {
ErrorComponent,
HeadContent,
Link,
- Match,
MatchRoute,
- Matches,
Navigate,
Outlet,
- RouterContextProvider,
ScriptOnce,
Scripts,
ScrollRestoration,
@@ -41,7 +37,6 @@ import {
useRouter,
useRouterState,
useSearch,
- useTags,
} from '@tanstack/react-router'
import {
createMiddleware,
@@ -91,7 +86,6 @@ function RootComponent() {
const canGoBack = useCanGoBack()
const navigate = useNavigate()
const scrollEntry = useElementScrollRestoration({ id: 'root-scroll' })
- const tags = useTags()
const invokeServerFn = useServerFn(helloServerFn)
useBlocker({
@@ -126,7 +120,6 @@ function RootComponent() {
useLocation,
useCanGoBack,
useElementScrollRestoration,
- useTags,
Await,
CatchBoundary,
CatchNotFound,
@@ -134,16 +127,12 @@ function RootComponent() {
DefaultGlobalNotFound,
ErrorComponent,
Link,
- Match,
MatchRoute,
- Matches,
Navigate,
Outlet,
- RouterContextProvider,
ScrollRestoration,
Block,
ScriptOnce,
- Asset,
HeadContent,
Scripts,
]
@@ -169,7 +158,6 @@ function RootComponent() {
void canGoBack
void navigate
void scrollEntry
- void tags
void routeMatchResult
void invokeServerFn
@@ -180,10 +168,6 @@ function RootComponent() {
{'window.__tsr_bundle_size = true'}
-
home
@@ -201,9 +185,6 @@ function RootComponent() {
}>
-
-
-
diff --git a/benchmarks/bundle-size/scenarios/solid-router-full/src/routes/__root.tsx b/benchmarks/bundle-size/scenarios/solid-router-full/src/routes/__root.tsx
index f4c29060160..6e769e756d7 100644
--- a/benchmarks/bundle-size/scenarios/solid-router-full/src/routes/__root.tsx
+++ b/benchmarks/bundle-size/scenarios/solid-router-full/src/routes/__root.tsx
@@ -1,5 +1,4 @@
import {
- Asset,
Await,
Block,
CatchBoundary,
@@ -9,12 +8,9 @@ import {
ErrorComponent,
HeadContent,
Link,
- Match,
MatchRoute,
- Matches,
Navigate,
Outlet,
- RouterContextProvider,
ScriptOnce,
Scripts,
ScrollRestoration,
@@ -41,7 +37,6 @@ import {
useRouter,
useRouterState,
useSearch,
- useTags,
} from '@tanstack/solid-router'
export const Route = createRootRoute({
@@ -68,7 +63,6 @@ function RootComponent() {
const canGoBack = useCanGoBack()
const navigate = useNavigate()
const scrollEntry = useElementScrollRestoration({ id: 'root-scroll' })
- const tags = useTags()
useBlocker({
shouldBlockFn: () => false,
@@ -101,7 +95,6 @@ function RootComponent() {
useLocation,
useCanGoBack,
useElementScrollRestoration,
- useTags,
Await,
CatchBoundary,
CatchNotFound,
@@ -109,16 +102,12 @@ function RootComponent() {
DefaultGlobalNotFound,
ErrorComponent,
Link,
- Match,
MatchRoute,
- Matches,
Navigate,
Outlet,
- RouterContextProvider,
ScrollRestoration,
Block,
ScriptOnce,
- Asset,
HeadContent,
Scripts,
]
@@ -143,17 +132,12 @@ function RootComponent() {
void canGoBack()
void navigate
void scrollEntry
- void tags()
void routeMatchResult()
return (
<>
{'window.__tsr_bundle_size = true'}
-
home
@@ -171,9 +155,6 @@ function RootComponent() {
}>
-
- {() => }
-
diff --git a/benchmarks/bundle-size/scenarios/solid-start-full/src/routes/__root.tsx b/benchmarks/bundle-size/scenarios/solid-start-full/src/routes/__root.tsx
index 3daa0019c0b..172c1953fc1 100644
--- a/benchmarks/bundle-size/scenarios/solid-start-full/src/routes/__root.tsx
+++ b/benchmarks/bundle-size/scenarios/solid-start-full/src/routes/__root.tsx
@@ -1,5 +1,4 @@
import {
- Asset,
Await,
Block,
CatchBoundary,
@@ -9,12 +8,9 @@ import {
ErrorComponent,
HeadContent,
Link,
- Match,
MatchRoute,
- Matches,
Navigate,
Outlet,
- RouterContextProvider,
ScriptOnce,
Scripts,
ScrollRestoration,
@@ -41,7 +37,6 @@ import {
useRouter,
useRouterState,
useSearch,
- useTags,
} from '@tanstack/solid-router'
import {
createMiddleware,
@@ -100,7 +95,6 @@ function RootComponent() {
const canGoBack = useCanGoBack()
const navigate = useNavigate()
const scrollEntry = useElementScrollRestoration({ id: 'root-scroll' })
- const tags = useTags()
const invokeServerFn = useServerFn(helloServerFn)
useBlocker({
@@ -135,7 +129,6 @@ function RootComponent() {
useLocation,
useCanGoBack,
useElementScrollRestoration,
- useTags,
Await,
CatchBoundary,
CatchNotFound,
@@ -143,16 +136,12 @@ function RootComponent() {
DefaultGlobalNotFound,
ErrorComponent,
Link,
- Match,
MatchRoute,
- Matches,
Navigate,
Outlet,
- RouterContextProvider,
ScrollRestoration,
Block,
ScriptOnce,
- Asset,
HeadContent,
Scripts,
]
@@ -178,7 +167,6 @@ function RootComponent() {
void canGoBack()
void navigate
void scrollEntry
- void tags()
void routeMatchResult()
void invokeServerFn
@@ -189,10 +177,6 @@ function RootComponent() {
{'window.__tsr_bundle_size = true'}
-
home
@@ -210,9 +194,6 @@ function RootComponent() {
}>
-
- {() => }
-
diff --git a/benchmarks/bundle-size/scenarios/vue-router-full/src/routes/__root.tsx b/benchmarks/bundle-size/scenarios/vue-router-full/src/routes/__root.tsx
index 0ff40aebfc5..aa7524f8903 100644
--- a/benchmarks/bundle-size/scenarios/vue-router-full/src/routes/__root.tsx
+++ b/benchmarks/bundle-size/scenarios/vue-router-full/src/routes/__root.tsx
@@ -1,6 +1,5 @@
import { defineComponent } from 'vue'
import {
- Asset,
Await,
Block,
Body,
@@ -12,12 +11,9 @@ import {
HeadContent,
Html,
Link,
- Match,
MatchRoute,
- Matches,
Navigate,
Outlet,
- RouterContextProvider,
ScriptOnce,
Scripts,
ScrollRestoration,
@@ -43,7 +39,6 @@ import {
useRouter,
useRouterState,
useSearch,
- useTags,
} from '@tanstack/vue-router'
const RootComponent = defineComponent({
@@ -68,7 +63,6 @@ const RootComponent = defineComponent({
const canGoBack = useCanGoBack()
const navigate = useNavigate()
const scrollEntry = useElementScrollRestoration({ id: 'root-scroll' })
- const tags = useTags()
useBlocker({
shouldBlockFn: () => false,
@@ -100,7 +94,6 @@ const RootComponent = defineComponent({
useLocation,
useCanGoBack,
useElementScrollRestoration,
- useTags,
Await,
CatchBoundary,
CatchNotFound,
@@ -108,16 +101,12 @@ const RootComponent = defineComponent({
DefaultGlobalNotFound,
ErrorComponent,
Link,
- Match,
MatchRoute,
- Matches,
Navigate,
Outlet,
- RouterContextProvider,
ScrollRestoration,
Block,
ScriptOnce,
- Asset,
HeadContent,
Scripts,
Body,
@@ -145,17 +134,12 @@ const RootComponent = defineComponent({
void canGoBack.value
void navigate
void scrollEntry
- void tags()
void routeMatchResult.value
return (
<>
{'window.__tsr_bundle_size = true'}
-
home
@@ -176,9 +160,6 @@ const RootComponent = defineComponent({
}>
-
-
-
diff --git a/benchmarks/bundle-size/scenarios/vue-start-full/src/routes/__root.tsx b/benchmarks/bundle-size/scenarios/vue-start-full/src/routes/__root.tsx
index 8e8870a2ce7..3e6d21f48df 100644
--- a/benchmarks/bundle-size/scenarios/vue-start-full/src/routes/__root.tsx
+++ b/benchmarks/bundle-size/scenarios/vue-start-full/src/routes/__root.tsx
@@ -1,6 +1,5 @@
import { defineComponent } from 'vue'
import {
- Asset,
Await,
Block,
Body,
@@ -12,12 +11,9 @@ import {
HeadContent,
Html,
Link,
- Match,
MatchRoute,
- Matches,
Navigate,
Outlet,
- RouterContextProvider,
ScriptOnce,
Scripts,
ScrollRestoration,
@@ -43,7 +39,6 @@ import {
useRouter,
useRouterState,
useSearch,
- useTags,
} from '@tanstack/vue-router'
import {
createMiddleware,
@@ -91,7 +86,6 @@ const RootComponent = defineComponent({
const canGoBack = useCanGoBack()
const navigate = useNavigate()
const scrollEntry = useElementScrollRestoration({ id: 'root-scroll' })
- const tags = useTags()
const invokeServerFn = useServerFn(helloServerFn)
useBlocker({
@@ -125,7 +119,6 @@ const RootComponent = defineComponent({
useLocation,
useCanGoBack,
useElementScrollRestoration,
- useTags,
Await,
CatchBoundary,
CatchNotFound,
@@ -133,16 +126,12 @@ const RootComponent = defineComponent({
DefaultGlobalNotFound,
ErrorComponent,
Link,
- Match,
MatchRoute,
- Matches,
Navigate,
Outlet,
- RouterContextProvider,
ScrollRestoration,
Block,
ScriptOnce,
- Asset,
HeadContent,
Scripts,
Body,
@@ -171,7 +160,6 @@ const RootComponent = defineComponent({
void canGoBack.value
void navigate
void scrollEntry
- void tags()
void routeMatchResult.value
void invokeServerFn
@@ -182,10 +170,6 @@ const RootComponent = defineComponent({
{'window.__tsr_bundle_size = true'}
-
home
@@ -206,9 +190,6 @@ const RootComponent = defineComponent({
}>
-
-
-
diff --git a/benchmarks/client-nav/link-performance/project.json b/benchmarks/client-nav/link-performance/project.json
index fd1751c0818..1ed140497e9 100644
--- a/benchmarks/client-nav/link-performance/project.json
+++ b/benchmarks/client-nav/link-performance/project.json
@@ -86,12 +86,17 @@
"{workspaceRoot}/benchmarks/client-nav/scenarios/links/shared.ts",
"{workspaceRoot}/benchmarks/client-nav/setup-helpers.ts",
"{workspaceRoot}/benchmarks/client-nav/tsconfig.json",
- "{workspaceRoot}/benchmarks/client-nav/vitest.setup.ts"
+ "{workspaceRoot}/benchmarks/client-nav/vitest.setup.ts",
+ "{workspaceRoot}/packages/tsconfig.paths.json"
],
"dependsOn": [
{
"projects": ["@tanstack/react-router"],
"target": "build"
+ },
+ {
+ "projects": ["@tanstack/react-router"],
+ "target": "compile"
}
],
"options": {
diff --git a/benchmarks/client-nav/link-performance/tsconfig.json b/benchmarks/client-nav/link-performance/tsconfig.json
index fbf230c9770..13e6252504f 100644
--- a/benchmarks/client-nav/link-performance/tsconfig.json
+++ b/benchmarks/client-nav/link-performance/tsconfig.json
@@ -1,5 +1,5 @@
{
- "extends": "../tsconfig.json",
+ "extends": ["../tsconfig.json", "../../../packages/tsconfig.paths.json"],
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react",
diff --git a/benchmarks/client-nav/scenarios/history/react/project.json b/benchmarks/client-nav/scenarios/history/react/project.json
index a2fe0001be9..76b666c8e80 100644
--- a/benchmarks/client-nav/scenarios/history/react/project.json
+++ b/benchmarks/client-nav/scenarios/history/react/project.json
@@ -21,6 +21,10 @@
{
"projects": ["@tanstack/react-router", "@tanstack/router-plugin"],
"target": "build"
+ },
+ {
+ "projects": ["@tanstack/react-router", "@tanstack/router-plugin"],
+ "target": "compile"
}
],
"options": {
diff --git a/benchmarks/client-nav/scenarios/history/react/tsconfig.json b/benchmarks/client-nav/scenarios/history/react/tsconfig.json
index 1d59cbb4503..b7ca273c36d 100644
--- a/benchmarks/client-nav/scenarios/history/react/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/history/react/tsconfig.json
@@ -1,5 +1,8 @@
{
- "extends": "../../../../../tsconfig.json",
+ "extends": [
+ "../../../../../tsconfig.json",
+ "../../../../../packages/tsconfig.paths.json"
+ ],
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react",
diff --git a/benchmarks/client-nav/scenarios/history/solid/project.json b/benchmarks/client-nav/scenarios/history/solid/project.json
index 6f4bba1ca50..2661d03ca66 100644
--- a/benchmarks/client-nav/scenarios/history/solid/project.json
+++ b/benchmarks/client-nav/scenarios/history/solid/project.json
@@ -21,6 +21,10 @@
{
"projects": ["@tanstack/solid-router", "@tanstack/router-plugin"],
"target": "build"
+ },
+ {
+ "projects": ["@tanstack/solid-router", "@tanstack/router-plugin"],
+ "target": "compile"
}
],
"options": {
diff --git a/benchmarks/client-nav/scenarios/history/solid/tsconfig.json b/benchmarks/client-nav/scenarios/history/solid/tsconfig.json
index 98d76ad6b80..1ee968fbce1 100644
--- a/benchmarks/client-nav/scenarios/history/solid/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/history/solid/tsconfig.json
@@ -1,5 +1,8 @@
{
- "extends": "../../../../../tsconfig.json",
+ "extends": [
+ "../../../../../tsconfig.json",
+ "../../../../../packages/tsconfig.paths.json"
+ ],
"compilerOptions": {
"jsx": "preserve",
"jsxImportSource": "solid-js",
diff --git a/benchmarks/client-nav/scenarios/history/vue/project.json b/benchmarks/client-nav/scenarios/history/vue/project.json
index 17fca887caf..182d20d556b 100644
--- a/benchmarks/client-nav/scenarios/history/vue/project.json
+++ b/benchmarks/client-nav/scenarios/history/vue/project.json
@@ -21,6 +21,10 @@
{
"projects": ["@tanstack/vue-router", "@tanstack/router-plugin"],
"target": "build"
+ },
+ {
+ "projects": ["@tanstack/vue-router", "@tanstack/router-plugin"],
+ "target": "compile"
}
],
"options": {
diff --git a/benchmarks/client-nav/scenarios/history/vue/tsconfig.json b/benchmarks/client-nav/scenarios/history/vue/tsconfig.json
index 7786fc3da9a..a29b91fc508 100644
--- a/benchmarks/client-nav/scenarios/history/vue/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/history/vue/tsconfig.json
@@ -1,5 +1,8 @@
{
- "extends": "../../../../../tsconfig.json",
+ "extends": [
+ "../../../../../tsconfig.json",
+ "../../../../../packages/tsconfig.paths.json"
+ ],
"compilerOptions": {
"jsx": "preserve",
"jsxImportSource": "vue",
diff --git a/benchmarks/client-nav/scenarios/hydration/react/project.json b/benchmarks/client-nav/scenarios/hydration/react/project.json
index ca23838c0f3..1451d57c6af 100644
--- a/benchmarks/client-nav/scenarios/hydration/react/project.json
+++ b/benchmarks/client-nav/scenarios/hydration/react/project.json
@@ -6,7 +6,10 @@
"executor": "nx:run-commands",
"cache": false,
"dependsOn": [
- { "projects": ["@tanstack/react-router"], "target": "build" }
+ {
+ "projects": ["@tanstack/react-router"],
+ "target": "build"
+ }
],
"options": {
"command": "NODE_ENV=production vite build --config {projectRoot}/vite.server.config.ts && NODE_ENV=production node {projectRoot}/generate-fixture.mjs && NODE_ENV=production vite build --config {projectRoot}/vite.config.ts"
@@ -32,9 +35,18 @@
"test:types:client": {
"executor": "nx:run-commands",
"dependsOn": [
- { "projects": ["@tanstack/react-router"], "target": "build" }
+ {
+ "projects": ["@tanstack/react-router"],
+ "target": "build"
+ },
+ {
+ "projects": ["@tanstack/react-router"],
+ "target": "compile"
+ }
],
- "options": { "command": "tsc -p {projectRoot}/tsconfig.json --noEmit" }
+ "options": {
+ "command": "tsc -p {projectRoot}/tsconfig.json --noEmit"
+ }
}
}
}
diff --git a/benchmarks/client-nav/scenarios/hydration/react/src/client.tsx b/benchmarks/client-nav/scenarios/hydration/react/src/client.tsx
index 42c5a5104ed..18401e46a07 100644
--- a/benchmarks/client-nav/scenarios/hydration/react/src/client.tsx
+++ b/benchmarks/client-nav/scenarios/hydration/react/src/client.tsx
@@ -5,6 +5,7 @@ import { hydrate } from '@tanstack/react-router/ssr/client'
import { isServer } from '@tanstack/router-core/isServer'
import { createDiagnostics, hashLinkCount } from '../fixture'
import { createFixtureRouter } from './app'
+import type { AnyRouteMatch } from '@tanstack/react-router'
export const serverEnvironment = isServer
let router: ReturnType | undefined
@@ -64,11 +65,11 @@ export function ready() {
}
export function snapshot() {
- const matches = router?.stores.matches.get()
+ const matches: Array | undefined = router?.state.matches
return {
diagnostics: { ...diagnostics },
errors: [...errors],
- location: router?.stores.location.get().href,
+ location: router?.state.location.href,
matches: matches?.map((match) => ({
status: match.status,
context: match.context,
diff --git a/benchmarks/client-nav/scenarios/hydration/react/tsconfig.json b/benchmarks/client-nav/scenarios/hydration/react/tsconfig.json
index 23dd08de8b2..c9e9ee30cfa 100644
--- a/benchmarks/client-nav/scenarios/hydration/react/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/hydration/react/tsconfig.json
@@ -1,5 +1,8 @@
{
- "extends": "../../../../../tsconfig.json",
+ "extends": [
+ "../../../../../tsconfig.json",
+ "../../../../../packages/tsconfig.paths.json"
+ ],
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react",
diff --git a/benchmarks/client-nav/scenarios/hydration/solid/project.json b/benchmarks/client-nav/scenarios/hydration/solid/project.json
index 1fa162771b6..9bb3d2963f5 100644
--- a/benchmarks/client-nav/scenarios/hydration/solid/project.json
+++ b/benchmarks/client-nav/scenarios/hydration/solid/project.json
@@ -6,7 +6,10 @@
"executor": "nx:run-commands",
"cache": false,
"dependsOn": [
- { "projects": ["@tanstack/solid-router"], "target": "build" }
+ {
+ "projects": ["@tanstack/solid-router"],
+ "target": "build"
+ }
],
"options": {
"command": "NODE_ENV=production vite build --config {projectRoot}/vite.server.config.ts && NODE_ENV=production node {projectRoot}/generate-fixture.mjs && NODE_ENV=production vite build --config {projectRoot}/vite.config.ts"
@@ -32,9 +35,18 @@
"test:types:client": {
"executor": "nx:run-commands",
"dependsOn": [
- { "projects": ["@tanstack/solid-router"], "target": "build" }
+ {
+ "projects": ["@tanstack/solid-router"],
+ "target": "build"
+ },
+ {
+ "projects": ["@tanstack/solid-router"],
+ "target": "compile"
+ }
],
- "options": { "command": "tsc -p {projectRoot}/tsconfig.json --noEmit" }
+ "options": {
+ "command": "tsc -p {projectRoot}/tsconfig.json --noEmit"
+ }
}
}
}
diff --git a/benchmarks/client-nav/scenarios/hydration/solid/src/client.tsx b/benchmarks/client-nav/scenarios/hydration/solid/src/client.tsx
index ef0f5268d68..3c84c0753a5 100644
--- a/benchmarks/client-nav/scenarios/hydration/solid/src/client.tsx
+++ b/benchmarks/client-nav/scenarios/hydration/solid/src/client.tsx
@@ -5,6 +5,7 @@ import { hydrate } from '@tanstack/router-core/ssr/client'
import { isServer } from '@tanstack/router-core/isServer'
import { createDiagnostics, hashLinkCount } from '../fixture'
import { createFixtureRouter } from './app'
+import type { AnyRouteMatch } from '@tanstack/solid-router'
export const serverEnvironment = isServer
export const solidServerEnvironment = solidIsServer
@@ -45,7 +46,7 @@ export function ready() {
!diagnostics.mounted ||
!diagnostics.rendered ||
sharedConfig.context ||
- router?.stores.status.get() === 'pending'
+ router?.state.status === 'pending'
) {
return false
}
@@ -64,6 +65,7 @@ export function ready() {
}
export function snapshot() {
+ const matches: Array | undefined = router?.state.matches
return {
diagnostics: {
...diagnostics,
@@ -71,9 +73,9 @@ export function snapshot() {
hashStates: [...diagnostics.hashStates],
},
hydrating: !!sharedConfig.context,
- location: router?.stores.location.get().href,
- resolvedLocation: router?.stores.resolvedLocation.get()?.href,
- matches: router?.stores.matches.get().map((match) => ({
+ location: router?.state.location.href,
+ resolvedLocation: router?.state.resolvedLocation?.href,
+ matches: matches?.map((match) => ({
status: match.status,
context: match.context,
loaderData: match.loaderData,
diff --git a/benchmarks/client-nav/scenarios/hydration/solid/tsconfig.json b/benchmarks/client-nav/scenarios/hydration/solid/tsconfig.json
index daf27ddf12d..c56f42a226c 100644
--- a/benchmarks/client-nav/scenarios/hydration/solid/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/hydration/solid/tsconfig.json
@@ -1,5 +1,8 @@
{
- "extends": "../../../../../tsconfig.json",
+ "extends": [
+ "../../../../../tsconfig.json",
+ "../../../../../packages/tsconfig.paths.json"
+ ],
"compilerOptions": {
"jsx": "preserve",
"jsxImportSource": "solid-js",
diff --git a/benchmarks/client-nav/scenarios/rewrites/react/project.json b/benchmarks/client-nav/scenarios/rewrites/react/project.json
index d98c6e14128..4a00bb12a61 100644
--- a/benchmarks/client-nav/scenarios/rewrites/react/project.json
+++ b/benchmarks/client-nav/scenarios/rewrites/react/project.json
@@ -21,6 +21,10 @@
{
"projects": ["@tanstack/react-router", "@tanstack/router-plugin"],
"target": "build"
+ },
+ {
+ "projects": ["@tanstack/react-router", "@tanstack/router-plugin"],
+ "target": "compile"
}
],
"options": {
diff --git a/benchmarks/client-nav/scenarios/rewrites/react/tsconfig.json b/benchmarks/client-nav/scenarios/rewrites/react/tsconfig.json
index 1d59cbb4503..b7ca273c36d 100644
--- a/benchmarks/client-nav/scenarios/rewrites/react/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/rewrites/react/tsconfig.json
@@ -1,5 +1,8 @@
{
- "extends": "../../../../../tsconfig.json",
+ "extends": [
+ "../../../../../tsconfig.json",
+ "../../../../../packages/tsconfig.paths.json"
+ ],
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react",
diff --git a/benchmarks/client-nav/scenarios/rewrites/solid/project.json b/benchmarks/client-nav/scenarios/rewrites/solid/project.json
index 4b2f763032b..5fd7aa98d35 100644
--- a/benchmarks/client-nav/scenarios/rewrites/solid/project.json
+++ b/benchmarks/client-nav/scenarios/rewrites/solid/project.json
@@ -21,6 +21,10 @@
{
"projects": ["@tanstack/solid-router", "@tanstack/router-plugin"],
"target": "build"
+ },
+ {
+ "projects": ["@tanstack/solid-router", "@tanstack/router-plugin"],
+ "target": "compile"
}
],
"options": {
diff --git a/benchmarks/client-nav/scenarios/rewrites/solid/tsconfig.json b/benchmarks/client-nav/scenarios/rewrites/solid/tsconfig.json
index 98d76ad6b80..1ee968fbce1 100644
--- a/benchmarks/client-nav/scenarios/rewrites/solid/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/rewrites/solid/tsconfig.json
@@ -1,5 +1,8 @@
{
- "extends": "../../../../../tsconfig.json",
+ "extends": [
+ "../../../../../tsconfig.json",
+ "../../../../../packages/tsconfig.paths.json"
+ ],
"compilerOptions": {
"jsx": "preserve",
"jsxImportSource": "solid-js",
diff --git a/benchmarks/client-nav/scenarios/rewrites/vue/project.json b/benchmarks/client-nav/scenarios/rewrites/vue/project.json
index 9b7cb5d1989..88da9ac8c88 100644
--- a/benchmarks/client-nav/scenarios/rewrites/vue/project.json
+++ b/benchmarks/client-nav/scenarios/rewrites/vue/project.json
@@ -21,6 +21,10 @@
{
"projects": ["@tanstack/vue-router", "@tanstack/router-plugin"],
"target": "build"
+ },
+ {
+ "projects": ["@tanstack/vue-router", "@tanstack/router-plugin"],
+ "target": "compile"
}
],
"options": {
diff --git a/benchmarks/client-nav/scenarios/rewrites/vue/tsconfig.json b/benchmarks/client-nav/scenarios/rewrites/vue/tsconfig.json
index 7786fc3da9a..a29b91fc508 100644
--- a/benchmarks/client-nav/scenarios/rewrites/vue/tsconfig.json
+++ b/benchmarks/client-nav/scenarios/rewrites/vue/tsconfig.json
@@ -1,5 +1,8 @@
{
- "extends": "../../../../../tsconfig.json",
+ "extends": [
+ "../../../../../tsconfig.json",
+ "../../../../../packages/tsconfig.paths.json"
+ ],
"compilerOptions": {
"jsx": "preserve",
"jsxImportSource": "vue",
diff --git a/docs/router/api/router/RouteMatchType.md b/docs/router/api/router/RouteMatchType.md
index b5009ebe685..2dc7658ee79 100644
--- a/docs/router/api/router/RouteMatchType.md
+++ b/docs/router/api/router/RouteMatchType.md
@@ -9,6 +9,7 @@ The `RouteMatch` type represents a route match in TanStack Router.
interface RouteMatch {
id: string
routeId: string
+ fullPath: Route['fullPath']
pathname: string
params: Route['allParams']
status: 'pending' | 'success' | 'error' | 'notFound'
@@ -26,6 +27,8 @@ interface RouteMatch {
}
```
+`fullPath` is the full path of the matched route, such as `/posts/$postId`. You can pass it as the `from` of a `Link` or `navigate` call to resolve a relative path from that match.
+
`status` describes the match's render state. `isFetching` independently exposes
active `beforeLoad` or loader work. In particular, a successful match can report
`isFetching: 'loader'` while stale data remains visible during a background
diff --git a/docs/router/api/router/RouterType.md b/docs/router/api/router/RouterType.md
index 3fde90e32e5..847b6407bd1 100644
--- a/docs/router/api/router/RouterType.md
+++ b/docs/router/api/router/RouterType.md
@@ -75,49 +75,6 @@ Builds a new parsed location object that can be used later to navigate to a new
- Optional
- If `true`, the route mask will be removed when the page is reloaded. This can be overridden on a per-navigation basis by setting `mask.unmaskOnReload` in [`NavigateOptions`](./NavigateOptionsType.md).
-### `.commitLocation` method
-
-Commits a new location object to the browser history.
-
-- Type
- ```tsx
- type commitLocation = (
- location: ParsedLocation & {
- replace?: boolean
- resetScroll?: boolean
- hashScrollIntoView?: boolean | ScrollIntoViewOptions
- ignoreBlocker?: boolean
- },
- ) => Promise
- ```
-- Properties
- - `location`
- - Type: [`ParsedLocation`](./ParsedLocationType.md)
- - Required
- - The location to commit to the browser history.
- - `replace`
- - Type: `boolean`
- - Optional
- - Defaults to `false`.
- - If `true`, the location will be committed to the browser history using `history.replace` instead of `history.push`.
- - `resetScroll`
- - Type: `boolean`
- - Optional
- - Defaults to `true` so that the scroll position will be reset to 0,0 after the location is committed to the browser history.
- - If `false`, the scroll position will not be reset to 0,0 after the location is committed to history.
- - `hashScrollIntoView`
- - Type: `boolean | ScrollIntoViewOptions`
- - Optional
- - Defaults to `true` so the element with an id matching the hash will be scrolled into view after the location is committed to history.
- - If `false`, the element with an id matching the hash will not be scrolled into view after the location is committed to history.
- - If an object is provided, it will be passed to the `scrollIntoView` method as options.
- - See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView) for more information on `ScrollIntoViewOptions`.
- - `ignoreBlocker`
- - Type: `boolean`
- - Optional
- - Defaults to `false`.
- - If `true`, navigation will ignore any blockers that might prevent it.
-
### `.navigate` method
Navigates to a new location.
diff --git a/docs/router/guide/history-types.md b/docs/router/guide/history-types.md
index 0c6a914fb61..66e256c4f69 100644
--- a/docs/router/guide/history-types.md
+++ b/docs/router/guide/history-types.md
@@ -105,4 +105,23 @@ const router = createRouter({ routeTree, history: memoryHistory })
+## Moving Through the History
+
+The router's history instance is available as `router.history`. Like the browser's history, it can move to entries the user has already visited:
+
+- `back()` goes to the previous entry.
+- `forward()` goes to the next entry.
+- `go(delta)` moves `delta` entries. A negative number goes back and a positive number goes forward, so `go(-1)` moves to the same entry as `back()`.
+
+Each of them takes an optional `{ ignoreBlocker: true }` object to skip any [navigation blockers](./navigation-blocking.md).
+
+```ts
+const router = useRouter()
+
+router.history.back()
+router.history.forward()
+router.history.go(-2) // two entries back
+router.history.go(1, { ignoreBlocker: true })
+```
+
Refer to the [SSR Guide](./ssr.md#automatic-server-history) for usage on the server for server-side rendering.
diff --git a/docs/router/guide/preloading.md b/docs/router/guide/preloading.md
index 7f48412ce68..02eff812ed8 100644
--- a/docs/router/guide/preloading.md
+++ b/docs/router/guide/preloading.md
@@ -278,24 +278,26 @@ function Component() {
-If you need to preload only the JS chunk of a route, you can use the router's `loadRouteChunk` method. It accepts a route object and returns a promise that resolves when the route chunk is loaded.
+If you need to preload only the JS chunk of a route, you can use the router's `loadRouteChunk` method. It accepts a route object, such as the `Route` a route file exports, and returns a promise that resolves when the route chunk is loaded.
# React
```tsx
+import { Route as IndexRoute } from './routes/index'
+import { Route as PostsRoute } from './routes/posts'
+
function Component() {
const router = useRouter()
useEffect(() => {
async function preloadRouteChunks() {
try {
- const postsRoute = router.routesByPath['/posts']
await Promise.all([
- router.loadRouteChunk(router.routesByPath['/']),
- router.loadRouteChunk(postsRoute),
- router.loadRouteChunk(postsRoute.parentRoute),
+ router.loadRouteChunk(IndexRoute),
+ router.loadRouteChunk(PostsRoute),
+ router.loadRouteChunk(PostsRoute.parentRoute),
])
} catch (err) {
// Failed to preload route chunk
@@ -312,17 +314,19 @@ function Component() {
# Solid
```tsx
+import { Route as IndexRoute } from './routes/index'
+import { Route as PostsRoute } from './routes/posts'
+
function Component() {
const router = useRouter()
createEffect(() => {
async function preloadRouteChunks() {
try {
- const postsRoute = router.routesByPath['/posts']
await Promise.all([
- router.loadRouteChunk(router.routesByPath['/']),
- router.loadRouteChunk(postsRoute),
- router.loadRouteChunk(postsRoute.parentRoute),
+ router.loadRouteChunk(IndexRoute),
+ router.loadRouteChunk(PostsRoute),
+ router.loadRouteChunk(PostsRoute.parentRoute),
])
} catch (err) {
// Failed to preload route chunk
diff --git a/docs/router/guide/ssr.md b/docs/router/guide/ssr.md
index 46a0941e7c6..24ab251fa1f 100644
--- a/docs/router/guide/ssr.md
+++ b/docs/router/guide/ssr.md
@@ -62,7 +62,7 @@ To implement non-streaming SSR with TanStack Router, you will need the following
On the client, Router defaults to using an instance of `createBrowserHistory`. On the server, the Router SSR request handler and TanStack Start automatically create a lightweight history containing only the request URL. This history does not keep a navigation stack or respond to `push`, `replace`, `go`, `back`, or `forward` calls.
-Server-side calls to `router.navigate()` and `router.commitLocation()` are also no-ops: their promises resolve without changing the request location or running another load. To redirect a request, use the dedicated [redirect API](../api/router/redirectFunction.md), such as `throw redirect({ to: '/login' })` in `beforeLoad` or a loader.
+Server-side calls to `router.navigate()` are also no-ops: the promise resolves without changing the request location or running another load. To redirect a request, use the dedicated [redirect API](../api/router/redirectFunction.md), such as `throw redirect({ to: '/login' })` in `beforeLoad` or a loader.
### Automatic Loader Dehydration/Hydration
diff --git a/docs/router/how-to/debug-router-issues.md b/docs/router/how-to/debug-router-issues.md
index 27dadd361f3..56ea4d8aa19 100644
--- a/docs/router/how-to/debug-router-issues.md
+++ b/docs/router/how-to/debug-router-issues.md
@@ -109,7 +109,6 @@ const route = createRoute({
```tsx
// Debug route tree in console
console.log('Route tree:', router.routeTree)
-console.log('All routes:', router.routesById)
```
3. **Check Parent Route Configuration**
@@ -667,9 +666,6 @@ router.getRoute('/users/$userId')
// Check if route exists
router.buildLocation({ to: '/some-path' })
-
-// View all registered routes
-Object.keys(router.routesById)
```
### Network Tab
diff --git a/e2e/react-start/dev-ssr-styles/package.json b/e2e/react-start/dev-ssr-styles/package.json
index a5300e836eb..b47b64998b4 100644
--- a/e2e/react-start/dev-ssr-styles/package.json
+++ b/e2e/react-start/dev-ssr-styles/package.json
@@ -11,7 +11,7 @@
"dev:e2e:nitro": "VITE_USE_NITRO=true vite dev --port $PORT",
"dev:e2e:disabled:nitro": "SSR_STYLES=disabled VITE_USE_NITRO=true vite dev --port $PORT",
"dev:e2e:custom-basepath:nitro": "SSR_STYLES=custom-basepath VITE_USE_NITRO=true vite dev --port $PORT",
- "build": "vite build && tsc --noEmit",
+ "build": "vite build && tsc --noEmit && tsc --noEmit -p tests",
"start": "pnpx srvx --prod -s ../client dist/server/server.js",
"test:e2e:dev": "MODE=dev playwright test --project=chromium",
"test:e2e:dev:disabled": "MODE=dev SSR_STYLES=disabled playwright test --project=chromium",
@@ -46,5 +46,15 @@
"typescript": "npm:@typescript/typescript6@^6.0.2",
"vite": "^8.0.14",
"zod": "^4.4.3"
+ },
+ "nx": {
+ "targets": {
+ "build": {
+ "dependsOn": [
+ "^build",
+ "^compile"
+ ]
+ }
+ }
}
}
diff --git a/e2e/react-start/dev-ssr-styles/tests/tsconfig.json b/e2e/react-start/dev-ssr-styles/tests/tsconfig.json
new file mode 100644
index 00000000000..f294c8e39a4
--- /dev/null
+++ b/e2e/react-start/dev-ssr-styles/tests/tsconfig.json
@@ -0,0 +1,11 @@
+{
+ // These tests import `DEV_STYLES_ATTR`, which is not in the published
+ // declarations of @tanstack/router-core. The map selects the internal
+ // declarations of the workspace packages; it has no effect at runtime.
+ "extends": ["../tsconfig.json", "../../../../packages/tsconfig.paths.json"],
+ "compilerOptions": {
+ "types": ["node"]
+ },
+ "include": ["."],
+ "exclude": []
+}
diff --git a/e2e/react-start/dev-ssr-styles/tsconfig.json b/e2e/react-start/dev-ssr-styles/tsconfig.json
index cef9369516a..f90e7decc27 100644
--- a/e2e/react-start/dev-ssr-styles/tsconfig.json
+++ b/e2e/react-start/dev-ssr-styles/tsconfig.json
@@ -1,5 +1,6 @@
{
"include": ["**/*.ts", "**/*.tsx"],
+ "exclude": ["tests"],
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
diff --git a/e2e/react-start/server-functions/src/routes/factory/index.tsx b/e2e/react-start/server-functions/src/routes/factory/index.tsx
index f8ef467e681..658d8d2a6e1 100644
--- a/e2e/react-start/server-functions/src/routes/factory/index.tsx
+++ b/e2e/react-start/server-functions/src/routes/factory/index.tsx
@@ -1,4 +1,5 @@
-import { createFileRoute, deepEqual } from '@tanstack/react-router'
+import { createFileRoute } from '@tanstack/react-router'
+import { isEqualData } from '~/utils/isEqualData'
import React from 'react'
import { createServerFn } from '@tanstack/react-start'
@@ -189,7 +190,7 @@ function Test({ fn, type, expected }: TestCase) {
const [result, setResult] = React.useState(null)
function comparison() {
if (result) {
- const isEqual = deepEqual(result, expected)
+ const isEqual = isEqualData(result, expected)
return isEqual ? 'equal' : 'not equal'
}
return 'Loading...'
diff --git a/e2e/react-start/server-functions/src/routes/function-method/index.tsx b/e2e/react-start/server-functions/src/routes/function-method/index.tsx
index 29a34d97d40..98c1109b615 100644
--- a/e2e/react-start/server-functions/src/routes/function-method/index.tsx
+++ b/e2e/react-start/server-functions/src/routes/function-method/index.tsx
@@ -1,4 +1,5 @@
-import { Link, createFileRoute, deepEqual } from '@tanstack/react-router'
+import { Link, createFileRoute } from '@tanstack/react-router'
+import { isEqualData } from '~/utils/isEqualData'
import { useState } from 'react'
import {
getServerFnCallingPost,
@@ -56,7 +57,7 @@ function Test({ fn, expected }: TestCase) {
const [result, setResult] = useState(null)
function comparison() {
if (result) {
- const isEqual = deepEqual(result, expected)
+ const isEqual = isEqualData(result, expected)
return isEqual ? 'equal' : 'not equal'
}
return 'Loading...'
diff --git a/e2e/react-start/server-functions/src/utils/isEqualData.ts b/e2e/react-start/server-functions/src/utils/isEqualData.ts
new file mode 100644
index 00000000000..d36c825aab0
--- /dev/null
+++ b/e2e/react-start/server-functions/src/utils/isEqualData.ts
@@ -0,0 +1,27 @@
+/**
+ * Compares plain data structurally. Key order and keys whose value is
+ * `undefined` do not matter.
+ */
+export function isEqualData(a: unknown, b: unknown): boolean {
+ if (a === b) {
+ return true
+ }
+ if (
+ typeof a !== 'object' ||
+ typeof b !== 'object' ||
+ a === null ||
+ b === null ||
+ Array.isArray(a) !== Array.isArray(b)
+ ) {
+ return false
+ }
+ const left = a as Record
+ const right = b as Record
+ const keys = (value: Record) =>
+ Object.keys(value).filter((key) => value[key] !== undefined)
+ const leftKeys = keys(left)
+ return (
+ leftKeys.length === keys(right).length &&
+ leftKeys.every((key) => isEqualData(left[key], right[key]))
+ )
+}
diff --git a/e2e/react-start/vitest-app/tests/route-files.client.test.ts b/e2e/react-start/vitest-app/tests/route-files.client.test.ts
index 5fa2dc48209..c9404715c66 100644
--- a/e2e/react-start/vitest-app/tests/route-files.client.test.ts
+++ b/e2e/react-start/vitest-app/tests/route-files.client.test.ts
@@ -1,10 +1,14 @@
import { expect, test } from 'vitest'
import { Route as HealthRoute } from '../src/routes/api/health'
import { Route as PostRoute } from '../src/routes/posts.$postId'
+import { routeOptions } from './routeOptions'
test('the options that only the server uses are not in client code', () => {
- expect(Object.keys(PostRoute.options).sort()).toEqual(['component', 'loader'])
- expect(Object.keys(HealthRoute.options)).toEqual([])
+ expect(Object.keys(routeOptions(PostRoute)).sort()).toEqual([
+ 'component',
+ 'loader',
+ ])
+ expect(Object.keys(routeOptions(HealthRoute))).toEqual([])
})
test('the module that only server code uses is never loaded', () => {
diff --git a/e2e/react-start/vitest-app/tests/route-files.server.test.ts b/e2e/react-start/vitest-app/tests/route-files.server.test.ts
index c3b4d601134..d433492f820 100644
--- a/e2e/react-start/vitest-app/tests/route-files.server.test.ts
+++ b/e2e/react-start/vitest-app/tests/route-files.server.test.ts
@@ -1,9 +1,10 @@
import { expect, test } from 'vitest'
import { Route as HealthRoute } from '../src/routes/api/health'
import { Route as PostRoute } from '../src/routes/posts.$postId'
+import { routeOptions } from './routeOptions'
test('the options that only the server uses are in server code', () => {
- expect(Object.keys(PostRoute.options).sort()).toEqual([
+ expect(Object.keys(routeOptions(PostRoute)).sort()).toEqual([
'component',
'headers',
'loader',
@@ -13,7 +14,7 @@ test('the options that only the server uses are in server code', () => {
})
test('a server route handler can be called', async () => {
- const { handlers } = (HealthRoute.options as any).server
+ const { handlers } = routeOptions(HealthRoute).server
const response: Response = await handlers.GET({
request: new Request('http://localhost/api/health'),
})
diff --git a/e2e/react-start/vitest-app/tests/route-modules.client.test.ts b/e2e/react-start/vitest-app/tests/route-modules.client.test.ts
index 22db660d3b6..30480a4de47 100644
--- a/e2e/react-start/vitest-app/tests/route-modules.client.test.ts
+++ b/e2e/react-start/vitest-app/tests/route-modules.client.test.ts
@@ -1,8 +1,9 @@
import { expect, test } from 'vitest'
import { Route } from '../src/embedded/root'
+import { routeOptions } from './routeOptions'
test('a route module outside the routes directory has no server-only options in client code', () => {
- expect(Object.keys(Route.options)).toEqual(['component'])
+ expect(Object.keys(routeOptions(Route))).toEqual(['component'])
})
test('the module that only server code uses is never loaded', () => {
diff --git a/e2e/react-start/vitest-app/tests/route-modules.server.test.ts b/e2e/react-start/vitest-app/tests/route-modules.server.test.ts
index 231372b0fb8..b17980e9898 100644
--- a/e2e/react-start/vitest-app/tests/route-modules.server.test.ts
+++ b/e2e/react-start/vitest-app/tests/route-modules.server.test.ts
@@ -1,8 +1,9 @@
import { expect, test } from 'vitest'
import { Route } from '../src/embedded/root'
+import { routeOptions } from './routeOptions'
test('a route module outside the routes directory keeps its server-only options in server code', () => {
- expect(Object.keys(Route.options).sort()).toEqual([
+ expect(Object.keys(routeOptions(Route)).sort()).toEqual([
'component',
'headers',
'server',
diff --git a/e2e/react-start/vitest-app/tests/routeOptions.ts b/e2e/react-start/vitest-app/tests/routeOptions.ts
new file mode 100644
index 00000000000..0ddeb3b2f4c
--- /dev/null
+++ b/e2e/react-start/vitest-app/tests/routeOptions.ts
@@ -0,0 +1,8 @@
+/**
+ * Reads the options a route object was created with. `options` is not part of
+ * a route's public type; these tests read it to see which options the Start
+ * compiler kept in each build.
+ */
+export function routeOptions(route: object): Record {
+ return (route as { options: Record }).options
+}
diff --git a/e2e/solid-start/dev-ssr-styles/package.json b/e2e/solid-start/dev-ssr-styles/package.json
index 6ca79c15c6d..bffc18749fb 100644
--- a/e2e/solid-start/dev-ssr-styles/package.json
+++ b/e2e/solid-start/dev-ssr-styles/package.json
@@ -6,7 +6,7 @@
"scripts": {
"dev": "vite dev --port 3000",
"dev:e2e": "vite dev --port 0",
- "build": "vite build && tsc --noEmit",
+ "build": "vite build && tsc --noEmit && tsc --noEmit -p tests",
"start": "pnpx srvx --prod -s ../client dist/server/server.js",
"test:e2e:dev": "MODE=dev playwright test --project=chromium",
"test:e2e": "pnpm run test:e2e:dev && pnpm run test:e2e:dev:bundled-dev",
@@ -27,5 +27,15 @@
"vite": "^8.0.14",
"vite-plugin-solid": "^2.11.11",
"@typescript/native": "npm:typescript@^7.0.2"
+ },
+ "nx": {
+ "targets": {
+ "build": {
+ "dependsOn": [
+ "^build",
+ "^compile"
+ ]
+ }
+ }
}
}
diff --git a/e2e/solid-start/dev-ssr-styles/tests/tsconfig.json b/e2e/solid-start/dev-ssr-styles/tests/tsconfig.json
new file mode 100644
index 00000000000..f294c8e39a4
--- /dev/null
+++ b/e2e/solid-start/dev-ssr-styles/tests/tsconfig.json
@@ -0,0 +1,11 @@
+{
+ // These tests import `DEV_STYLES_ATTR`, which is not in the published
+ // declarations of @tanstack/router-core. The map selects the internal
+ // declarations of the workspace packages; it has no effect at runtime.
+ "extends": ["../tsconfig.json", "../../../../packages/tsconfig.paths.json"],
+ "compilerOptions": {
+ "types": ["node"]
+ },
+ "include": ["."],
+ "exclude": []
+}
diff --git a/e2e/solid-start/dev-ssr-styles/tsconfig.json b/e2e/solid-start/dev-ssr-styles/tsconfig.json
index c34f9d7c361..165346b7457 100644
--- a/e2e/solid-start/dev-ssr-styles/tsconfig.json
+++ b/e2e/solid-start/dev-ssr-styles/tsconfig.json
@@ -1,5 +1,6 @@
{
"include": ["**/*.ts", "**/*.tsx"],
+ "exclude": ["tests"],
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
diff --git a/e2e/solid-start/server-functions/src/routes/factory/index.tsx b/e2e/solid-start/server-functions/src/routes/factory/index.tsx
index b637f4f91b8..b8dde063d45 100644
--- a/e2e/solid-start/server-functions/src/routes/factory/index.tsx
+++ b/e2e/solid-start/server-functions/src/routes/factory/index.tsx
@@ -1,4 +1,5 @@
-import { createFileRoute, deepEqual } from '@tanstack/solid-router'
+import { createFileRoute } from '@tanstack/solid-router'
+import { isEqualData } from '~/utils/isEqualData'
import { createSignal, For } from 'solid-js'
import { createServerFn } from '@tanstack/solid-start'
@@ -153,7 +154,7 @@ function Test(props: TestCase) {
const [result, setResult] = createSignal(null)
function comparison() {
if (result()) {
- const isEqual = deepEqual(result(), props.expected)
+ const isEqual = isEqualData(result(), props.expected)
return isEqual ? 'equal' : 'not equal'
}
return 'Loading...'
diff --git a/e2e/solid-start/server-functions/src/routes/function-method/index.tsx b/e2e/solid-start/server-functions/src/routes/function-method/index.tsx
index 801e6e3083e..2d5c6fe6e67 100644
--- a/e2e/solid-start/server-functions/src/routes/function-method/index.tsx
+++ b/e2e/solid-start/server-functions/src/routes/function-method/index.tsx
@@ -1,5 +1,6 @@
import { For, createSignal } from 'solid-js'
-import { Link, createFileRoute, deepEqual } from '@tanstack/solid-router'
+import { Link, createFileRoute } from '@tanstack/solid-router'
+import { isEqualData } from '~/utils/isEqualData'
import {
getServerFnCallingPost,
postServerFnCallingGet,
@@ -56,7 +57,7 @@ function Test({ fn, expected }: TestCase) {
const [result, setResult] = createSignal(null)
function comparison() {
if (result()) {
- const isEqual = deepEqual(result(), expected)
+ const isEqual = isEqualData(result(), expected)
return isEqual ? 'equal' : 'not equal'
}
return 'Loading...'
diff --git a/e2e/solid-start/server-functions/src/utils/isEqualData.ts b/e2e/solid-start/server-functions/src/utils/isEqualData.ts
new file mode 100644
index 00000000000..d36c825aab0
--- /dev/null
+++ b/e2e/solid-start/server-functions/src/utils/isEqualData.ts
@@ -0,0 +1,27 @@
+/**
+ * Compares plain data structurally. Key order and keys whose value is
+ * `undefined` do not matter.
+ */
+export function isEqualData(a: unknown, b: unknown): boolean {
+ if (a === b) {
+ return true
+ }
+ if (
+ typeof a !== 'object' ||
+ typeof b !== 'object' ||
+ a === null ||
+ b === null ||
+ Array.isArray(a) !== Array.isArray(b)
+ ) {
+ return false
+ }
+ const left = a as Record
+ const right = b as Record
+ const keys = (value: Record) =>
+ Object.keys(value).filter((key) => value[key] !== undefined)
+ const leftKeys = keys(left)
+ return (
+ leftKeys.length === keys(right).length &&
+ leftKeys.every((key) => isEqualData(left[key], right[key]))
+ )
+}
diff --git a/e2e/vue-start/dev-ssr-styles/package.json b/e2e/vue-start/dev-ssr-styles/package.json
index 0033a0a5cc7..36a168cf72c 100644
--- a/e2e/vue-start/dev-ssr-styles/package.json
+++ b/e2e/vue-start/dev-ssr-styles/package.json
@@ -6,7 +6,7 @@
"scripts": {
"dev": "vite dev --port 3000",
"dev:e2e": "vite dev --port 0",
- "build": "vite build && tsc --noEmit",
+ "build": "vite build && tsc --noEmit && tsc --noEmit -p tests",
"start": "pnpx srvx --prod -s ../client dist/server/server.js",
"test:e2e:dev": "MODE=dev playwright test --project=chromium",
"test:e2e": "pnpm run test:e2e:dev && pnpm run test:e2e:dev:bundled-dev",
@@ -28,5 +28,15 @@
"typescript": "npm:@typescript/typescript6@^6.0.2",
"vite": "^8.0.14",
"@typescript/native": "npm:typescript@^7.0.2"
+ },
+ "nx": {
+ "targets": {
+ "build": {
+ "dependsOn": [
+ "^build",
+ "^compile"
+ ]
+ }
+ }
}
}
diff --git a/e2e/vue-start/dev-ssr-styles/tests/tsconfig.json b/e2e/vue-start/dev-ssr-styles/tests/tsconfig.json
new file mode 100644
index 00000000000..f294c8e39a4
--- /dev/null
+++ b/e2e/vue-start/dev-ssr-styles/tests/tsconfig.json
@@ -0,0 +1,11 @@
+{
+ // These tests import `DEV_STYLES_ATTR`, which is not in the published
+ // declarations of @tanstack/router-core. The map selects the internal
+ // declarations of the workspace packages; it has no effect at runtime.
+ "extends": ["../tsconfig.json", "../../../../packages/tsconfig.paths.json"],
+ "compilerOptions": {
+ "types": ["node"]
+ },
+ "include": ["."],
+ "exclude": []
+}
diff --git a/e2e/vue-start/dev-ssr-styles/tsconfig.json b/e2e/vue-start/dev-ssr-styles/tsconfig.json
index 898ea214b19..a9d7f003153 100644
--- a/e2e/vue-start/dev-ssr-styles/tsconfig.json
+++ b/e2e/vue-start/dev-ssr-styles/tsconfig.json
@@ -1,5 +1,6 @@
{
"include": ["**/*.ts", "**/*.tsx", "**/*.vue"],
+ "exclude": ["tests"],
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
diff --git a/e2e/vue-start/server-functions/src/routes/factory/index.tsx b/e2e/vue-start/server-functions/src/routes/factory/index.tsx
index c02bb1338ef..54caf9859b2 100644
--- a/e2e/vue-start/server-functions/src/routes/factory/index.tsx
+++ b/e2e/vue-start/server-functions/src/routes/factory/index.tsx
@@ -1,4 +1,5 @@
-import { createFileRoute, deepEqual } from '@tanstack/vue-router'
+import { createFileRoute } from '@tanstack/vue-router'
+import { isEqualData } from '~/utils/isEqualData'
import { createServerFn } from '@tanstack/vue-start'
import { fooFnInsideFactoryFile } from './-functions/createFooServerFn'
@@ -164,7 +165,7 @@ const Test = defineComponent({
const result = ref(null)
const comparison = computed(() => {
if (result.value) {
- const isEqual = deepEqual(result.value, props.expected)
+ const isEqual = isEqualData(result.value, props.expected)
return isEqual ? 'equal' : 'not equal'
}
return 'Loading...'
diff --git a/e2e/vue-start/server-functions/src/routes/function-method/index.tsx b/e2e/vue-start/server-functions/src/routes/function-method/index.tsx
index a4cb3951d53..efeff2da779 100644
--- a/e2e/vue-start/server-functions/src/routes/function-method/index.tsx
+++ b/e2e/vue-start/server-functions/src/routes/function-method/index.tsx
@@ -1,4 +1,5 @@
-import { Link, createFileRoute, deepEqual } from '@tanstack/vue-router'
+import { Link, createFileRoute } from '@tanstack/vue-router'
+import { isEqualData } from '~/utils/isEqualData'
import { computed, defineComponent, ref } from 'vue'
import {
getServerFnCallingPost,
@@ -48,7 +49,7 @@ const Test = defineComponent({
const result = ref(null)
const comparison = computed(() => {
if (result.value) {
- const isEqual = deepEqual(result.value, props.expected)
+ const isEqual = isEqualData(result.value, props.expected)
return isEqual ? 'equal' : 'not equal'
}
return 'Loading...'
diff --git a/e2e/vue-start/server-functions/src/utils/isEqualData.ts b/e2e/vue-start/server-functions/src/utils/isEqualData.ts
new file mode 100644
index 00000000000..d36c825aab0
--- /dev/null
+++ b/e2e/vue-start/server-functions/src/utils/isEqualData.ts
@@ -0,0 +1,27 @@
+/**
+ * Compares plain data structurally. Key order and keys whose value is
+ * `undefined` do not matter.
+ */
+export function isEqualData(a: unknown, b: unknown): boolean {
+ if (a === b) {
+ return true
+ }
+ if (
+ typeof a !== 'object' ||
+ typeof b !== 'object' ||
+ a === null ||
+ b === null ||
+ Array.isArray(a) !== Array.isArray(b)
+ ) {
+ return false
+ }
+ const left = a as Record
+ const right = b as Record
+ const keys = (value: Record) =>
+ Object.keys(value).filter((key) => value[key] !== undefined)
+ const leftKeys = keys(left)
+ return (
+ leftKeys.length === keys(right).length &&
+ leftKeys.every((key) => isEqualData(left[key], right[key]))
+ )
+}
diff --git a/packages/history/api/index.api.md b/packages/history/api/index.api.md
index 5d1ac0226c0..9c811decb36 100644
--- a/packages/history/api/index.api.md
+++ b/packages/history/api/index.api.md
@@ -34,24 +34,6 @@ export function createHashHistory(opts?: {
window?: any;
}): RouterHistory;
-// @public (undocumented)
-export function createHistory(opts: {
- getLocation: () => HistoryLocation;
- getLength: () => number;
- pushState: (path: string, state: any) => void;
- replaceState: (path: string, state: any) => void;
- go: (n: number, ignoreBlocker: boolean) => void;
- back: (ignoreBlocker: boolean) => void;
- forward: (ignoreBlocker: boolean) => void;
- createHref: (path: string) => string;
- flush?: () => void;
- destroy?: () => void;
- onBlocked?: () => void;
- getBlockers?: () => Array;
- setBlockers?: (blockers: Array) => void;
- notifyOnIndexChange?: boolean;
-}): RouterHistory;
-
// @public
export function createMemoryHistory(opts?: {
initialEntries: Array;
@@ -80,15 +62,6 @@ export interface NavigateOptions {
ignoreBlocker?: boolean;
}
-// @public (undocumented)
-export type NavigationBlocker = {
- blockerFn: BlockerFn;
- enableBeforeUnload?: (() => boolean) | boolean;
-};
-
-// @public (undocumented)
-export function normalizeProtocolRelative(url: string): string;
-
// @public (undocumented)
export type ParsedHistoryState = HistoryState & {
key?: string;
@@ -108,51 +81,20 @@ export interface ParsedPath {
search: string;
}
-// @public (undocumented)
-export function parseHref(href: string, state: ParsedHistoryState | undefined): HistoryLocation;
-
// @public (undocumented)
export interface RouterHistory {
// (undocumented)
back: (navigateOpts?: NavigateOptions) => void;
// (undocumented)
- block: (blocker: NavigationBlocker) => () => void;
- // (undocumented)
- canGoBack: () => boolean;
- // (undocumented)
- createHref: (href: string) => string;
- // (undocumented)
destroy: () => void;
// (undocumented)
- flush: () => void;
- // (undocumented)
forward: (navigateOpts?: NavigateOptions) => void;
// (undocumented)
- _getBlockers: () => Array;
- // (undocumented)
go: (index: number, navigateOpts?: NavigateOptions) => void;
// (undocumented)
- _ignoreNextBeforeUnload?: (href: string) => void;
- // (undocumented)
- _ignoreSubscribers?: boolean;
- // (undocumented)
- length: number;
- // (undocumented)
- location: HistoryLocation;
- // Warning: (ae-forgotten-export) The symbol "SubscriberHistoryAction" needs to be exported by the entry point index.d.ts
- //
- // (undocumented)
- notify: (action: SubscriberHistoryAction) => void;
- // (undocumented)
push: (path: string, state?: any, navigateOpts?: NavigateOptions) => void;
// (undocumented)
replace: (path: string, state?: any, navigateOpts?: NavigateOptions) => void;
- // (undocumented)
- subscribe: (cb: (opts: SubscriberArgs) => void) => () => void;
- // Warning: (ae-forgotten-export) The symbol "SubscriberArgs" needs to be exported by the entry point index.d.ts
- //
- // (undocumented)
- subscribers: Set<(opts: SubscriberArgs) => void>;
}
// (No @packageDocumentation comment for this package)
diff --git a/packages/history/src/index.ts b/packages/history/src/index.ts
index d2f80581b9a..562329e1f28 100644
--- a/packages/history/src/index.ts
+++ b/packages/history/src/index.ts
@@ -21,23 +21,35 @@ type SubscriberArgs = {
}
export interface RouterHistory {
+ /** @internal */
location: HistoryLocation
+ /** @internal */
length: number
+ /** @internal */
subscribers: Set<(opts: SubscriberArgs) => void>
+ /** @internal */
subscribe: (cb: (opts: SubscriberArgs) => void) => () => void
push: (path: string, state?: any, navigateOpts?: NavigateOptions) => void
replace: (path: string, state?: any, navigateOpts?: NavigateOptions) => void
go: (index: number, navigateOpts?: NavigateOptions) => void
back: (navigateOpts?: NavigateOptions) => void
forward: (navigateOpts?: NavigateOptions) => void
+ /** @internal */
canGoBack: () => boolean
+ /** @internal */
createHref: (href: string) => string
+ /** @internal */
block: (blocker: NavigationBlocker) => () => void
+ /** @internal */
flush: () => void
destroy: () => void
+ /** @internal */
notify: (action: SubscriberHistoryAction) => void
+ /** @internal */
_getBlockers: () => Array
+ /** @internal */
_ignoreSubscribers?: boolean
+ /** @internal */
_ignoreNextBeforeUnload?: (href: string) => void
}
@@ -74,6 +86,7 @@ export type BlockerFn = (
args: BlockerFnArgs,
) => Promise | ShouldAllowNavigation
+/** @internal */
export type NavigationBlocker = {
blockerFn: BlockerFn
enableBeforeUnload?: (() => boolean) | boolean
@@ -110,6 +123,7 @@ const beforeUnloadEvent = 'beforeunload'
// eslint-disable-next-line no-control-regex
const protocolRelativePrefix = /^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/
+// @internal
export function normalizeProtocolRelative(url: string): string {
const match = protocolRelativePrefix.exec(url)
return match ? '/' + url.slice(match[0].length) : url
@@ -126,6 +140,7 @@ function normalizeHref(href: string): string {
return normalizeProtocolRelative(href)
}
+// @internal
export function createHistory(opts: {
getLocation: () => HistoryLocation
getLength: () => number
@@ -736,6 +751,7 @@ export function createServerHistory(href: string): RouterHistory {
return new ServerHistory(parseHref(href, undefined))
}
+// @internal
export function parseHref(
href: string,
state: ParsedHistoryState | undefined,
diff --git a/packages/react-router/api/index.api.md b/packages/react-router/api/index.api.md
index 4c4726b77c5..99c4517eaf5 100644
--- a/packages/react-router/api/index.api.md
+++ b/packages/react-router/api/index.api.md
@@ -18,13 +18,10 @@ import { AnyRedirect } from '@tanstack/router-core';
import { AnyRoute } from '@tanstack/router-core';
import { AnyRouteMatch } from '@tanstack/router-core';
import { AnyRouter } from '@tanstack/router-core';
-import { AnyRouterWithContext } from '@tanstack/router-core';
-import { AnyRouteWithContext } from '@tanstack/router-core';
import { AnySchema } from '@tanstack/router-core';
import { AnySerializationAdapter } from '@tanstack/router-core';
import { AnyValidator } from '@tanstack/router-core';
import { AnyValidatorAdapter } from '@tanstack/router-core';
-import { AnyValidatorFn } from '@tanstack/router-core';
import { AnyValidatorObj } from '@tanstack/router-core';
import { AssetCrossOriginConfig } from '@tanstack/router-core';
import { Assign } from '@tanstack/router-core';
@@ -37,27 +34,18 @@ import { BeforeLoadContextParameter } from '@tanstack/router-core';
import { BlockerFn } from '@tanstack/history';
import { BuildLocationFn } from '@tanstack/router-core';
import { BuildNextOptions } from '@tanstack/router-core';
-import { cleanPath } from '@tanstack/router-core';
-import { CommitLocationOptions } from '@tanstack/router-core';
import { composeRewrites } from '@tanstack/router-core';
import { Constrain } from '@tanstack/router-core';
import { ConstrainLiteral } from '@tanstack/router-core';
import { ContextAsyncReturnType } from '@tanstack/router-core';
import { ContextOptions } from '@tanstack/router-core';
import { ContextReturnType } from '@tanstack/router-core';
-import { ControllablePromise } from '@tanstack/router-core';
-import { ControlledPromise } from '@tanstack/router-core';
import { createBrowserHistory } from '@tanstack/history';
-import { createControlledPromise } from '@tanstack/router-core';
import { CreateFileRoute } from '@tanstack/router-core';
import { createHashHistory } from '@tanstack/history';
-import { createHistory } from '@tanstack/history';
-import { CreateLazyFileRoute } from '@tanstack/router-core';
import { createMemoryHistory } from '@tanstack/history';
-import { createRouterConfig } from '@tanstack/router-core';
import { CreateRouterFn } from '@tanstack/router-core';
import { createSerializationAdapter } from '@tanstack/router-core';
-import { deepEqual } from '@tanstack/router-core';
import { DeepPartial } from '@tanstack/router-core';
import { default as default_2 } from 'react';
import { DEFAULT_PROTOCOL_ALLOWLIST } from '@tanstack/router-core';
@@ -69,14 +57,12 @@ import { DeferredPromise } from '@tanstack/router-core';
import { DeferredPromiseState } from '@tanstack/router-core';
import { ErrorComponentProps } from '@tanstack/router-core';
import { ErrorInfo } from 'react';
-import { ErrorRouteProps } from '@tanstack/router-core';
import { Expand } from '@tanstack/router-core';
import { FileBaseRouteOptions } from '@tanstack/router-core';
import { FileRoutesByPath } from '@tanstack/router-core';
import { FileRouteTypes } from '@tanstack/router-core';
import { FromPathOption } from '@tanstack/router-core';
import { FullSearchSchemaOption } from '@tanstack/router-core';
-import { functionalUpdate } from '@tanstack/router-core';
import { HistoryAction } from '@tanstack/history';
import { HistoryLocation } from '@tanstack/history';
import { HistoryState } from '@tanstack/history';
@@ -92,12 +78,10 @@ import { InferSelected } from '@tanstack/router-core';
import { InferShouldThrow } from '@tanstack/router-core';
import { InferStrict } from '@tanstack/router-core';
import { InferTo } from '@tanstack/router-core';
-import { interpolatePath } from '@tanstack/router-core';
import { IntersectAssign } from '@tanstack/router-core';
import { isMatch } from '@tanstack/router-core';
import { isNotFound } from '@tanstack/router-core';
import { isRedirect } from '@tanstack/router-core';
-import { joinPaths } from '@tanstack/router-core';
import { JSX } from 'react/jsx-runtime';
import { lazyFn } from '@tanstack/router-core';
import { LazyRouteOptions } from '@tanstack/router-core';
@@ -115,10 +99,7 @@ import { MakeRouteMatch } from '@tanstack/router-core';
import { MakeRouteMatchUnion } from '@tanstack/router-core';
import { Manifest } from '@tanstack/router-core';
import { MaskOptions } from '@tanstack/router-core';
-import { MatchLocation } from '@tanstack/router-core';
import { MatchRouteOptions } from '@tanstack/router-core';
-import { MergeAll } from '@tanstack/router-core';
-import { MetaDescriptor } from '@tanstack/router-core';
import { NavigateFn } from '@tanstack/router-core';
import { NavigateOptions } from '@tanstack/router-core';
import { notFound } from '@tanstack/router-core';
@@ -132,7 +113,6 @@ import { ParseParamsFn } from '@tanstack/router-core';
import { ParseRoute } from '@tanstack/router-core';
import { parseSearchWith } from '@tanstack/router-core';
import { PathParamOptions } from '@tanstack/router-core';
-import { PreloadableObj } from '@tanstack/router-core';
import * as React_2 from 'react';
import { ReactNode } from 'react';
import { Redirect } from '@tanstack/router-core';
@@ -148,10 +128,8 @@ import { RelativeToPathAutoComplete } from '@tanstack/router-core';
import { RemountDepsOptions } from '@tanstack/router-core';
import { RemoveLeadingSlashes } from '@tanstack/router-core';
import { RemoveTrailingSlashes } from '@tanstack/router-core';
-import { replaceEqualDeep } from '@tanstack/router-core';
import { ResolveAllContext } from '@tanstack/router-core';
import { ResolveAllParamsFromParent } from '@tanstack/router-core';
-import { ResolvedRedirect } from '@tanstack/router-core';
import { ResolveFullPath } from '@tanstack/router-core';
import { ResolveFullSearchSchema } from '@tanstack/router-core';
import { ResolveFullSearchSchemaInput } from '@tanstack/router-core';
@@ -159,7 +137,6 @@ import { ResolveId } from '@tanstack/router-core';
import { ResolveLoaderData } from '@tanstack/router-core';
import { ResolveOptionalParams } from '@tanstack/router-core';
import { ResolveParams } from '@tanstack/router-core';
-import { resolvePath } from '@tanstack/router-core';
import { ResolveRelativePath } from '@tanstack/router-core';
import { ResolveRequiredParams } from '@tanstack/router-core';
import { ResolveRoute } from '@tanstack/router-core';
@@ -183,18 +160,14 @@ import { Route as Route_2 } from '@tanstack/router-core';
import { RouteById } from '@tanstack/router-core';
import { RouteConstraints } from '@tanstack/router-core';
import { RouteContext } from '@tanstack/router-core';
-import { RouteContextFn } from '@tanstack/router-core';
import { RouteContextOptions } from '@tanstack/router-core';
import { RouteContextParameter } from '@tanstack/router-core';
import { RouteIds } from '@tanstack/router-core';
-import { RouteLinkEntry } from '@tanstack/router-core';
-import { RouteLoaderEntry } from '@tanstack/router-core';
import { RouteLoaderFn } from '@tanstack/router-core';
import { RouteMask } from '@tanstack/router-core';
import { RouteMatch } from '@tanstack/router-core';
import { RouteOptions } from '@tanstack/router-core';
import { RoutePathOptions } from '@tanstack/router-core';
-import { RoutePathOptionsIntersection } from '@tanstack/router-core';
import { RoutePaths } from '@tanstack/router-core';
import { RouterConstructorOptions } from '@tanstack/router-core';
import { RouterContextOptions } from '@tanstack/router-core';
@@ -202,7 +175,6 @@ import { RouterCore } from '@tanstack/router-core';
import { RouterEvent } from '@tanstack/router-core';
import { RouterEvents } from '@tanstack/router-core';
import { RouterHistory } from '@tanstack/history';
-import { RouterListener } from '@tanstack/router-core';
import { RouterManagedTag } from '@tanstack/router-core';
import { RouterOptions } from '@tanstack/router-core';
import { RouterState } from '@tanstack/router-core';
@@ -234,11 +206,8 @@ import { ToSubOptions } from '@tanstack/router-core';
import { ToSubOptionsProps } from '@tanstack/router-core';
import { TrailingSlashOption } from '@tanstack/router-core';
import { TrimPath } from '@tanstack/router-core';
-import { trimPath } from '@tanstack/router-core';
import { TrimPathLeft } from '@tanstack/router-core';
-import { trimPathLeft } from '@tanstack/router-core';
import { TrimPathRight } from '@tanstack/router-core';
-import { trimPathRight } from '@tanstack/router-core';
import { UpdatableRouteOptions } from '@tanstack/router-core';
import { UpdatableStaticRouteOption } from '@tanstack/router-core';
import { UseLoaderDataResult } from '@tanstack/router-core';
@@ -250,17 +219,9 @@ import { UseRouteContextOptions } from '@tanstack/router-core';
import { UseRouteContextResult } from '@tanstack/router-core';
import { UseSearchResult } from '@tanstack/router-core';
import { ValidateFromPath } from '@tanstack/router-core';
-import { ValidateId } from '@tanstack/router-core';
import { ValidateJSON } from '@tanstack/router-core';
import { ValidateNavigateOptions } from '@tanstack/router-core';
-import { ValidateNavigateOptionsArray } from '@tanstack/router-core';
-import { ValidateParams } from '@tanstack/router-core';
import { ValidateRedirectOptions } from '@tanstack/router-core';
-import { ValidateRedirectOptionsArray } from '@tanstack/router-core';
-import { ValidateSearch } from '@tanstack/router-core';
-import { ValidateToPath } from '@tanstack/router-core';
-import { ValidateUseParamsResult } from '@tanstack/router-core';
-import { ValidateUseSearchResult } from '@tanstack/router-core';
import { Validator } from '@tanstack/router-core';
import { ValidatorAdapter } from '@tanstack/router-core';
import { ValidatorFn } from '@tanstack/router-core';
@@ -290,10 +251,6 @@ export { AnyRouteMatch }
export { AnyRouter }
-export { AnyRouterWithContext }
-
-export { AnyRouteWithContext }
-
export { AnySchema }
export { AnySerializationAdapter }
@@ -302,16 +259,8 @@ export { AnyValidator }
export { AnyValidatorAdapter }
-export { AnyValidatorFn }
-
export { AnyValidatorObj }
-// @public (undocumented)
-export function Asset(asset: RouterManagedTag & {
- nonce?: string;
- preventScriptHoist?: boolean;
-}): React_2.ReactElement | null;
-
export { Assign }
// @public (undocumented)
@@ -396,15 +345,11 @@ export function CatchNotFound(props: {
children: React_2.ReactNode;
}): JSX.Element;
-export { cleanPath }
-
// Warning: (ae-forgotten-export) The symbol "ClientOnlyProps" needs to be exported by the entry point index.d.ts
//
// @public
export function ClientOnly(input: ClientOnlyProps): JSX.Element;
-export { CommitLocationOptions }
-
export { composeRewrites }
export { Constrain }
@@ -415,14 +360,8 @@ export { ContextOptions }
export { ContextReturnType }
-export { ControllablePromise }
-
-export { ControlledPromise }
-
export { createBrowserHistory }
-export { createControlledPromise }
-
export { CreateFileRoute }
// @public
@@ -430,10 +369,6 @@ export function createFileRoute(id: TFilePath): (opts: LazyRouteOptions) => LazyRoute;
@@ -465,12 +400,8 @@ export function createRouteMask;
-export { ErrorRouteProps }
-
export { Expand }
export { FileBaseRouteOptions }
@@ -519,21 +448,14 @@ export class FileRoute, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TLoaderDeps extends Record = {}, TLoaderFn = undefined, TChildren = unknown, TSSR = unknown, const TMiddlewares = unknown, THandlers = undefined>(options?: FileBaseRouteOptions & UpdatableRouteOptions) => Route_2;
// (undocumented)
path?: TFilePath | undefined;
- // (undocumented)
- silent?: boolean;
}
-// @public @deprecated (undocumented)
-export function FileRouteLoader(_path: TFilePath): (loaderFn: Constrain>) => TLoaderFn;
-
export { FileRoutesByPath }
export { FileRouteTypes }
export { FullSearchSchemaOption }
-export { functionalUpdate }
-
// @public
export function getRouteApi(id: ConstrainLiteral>): RouteApi;
@@ -568,15 +490,8 @@ export { InferShouldThrow }
export { InferStrict }
-// @public (undocumented)
-export type InferStructuralSharing = TOptions extends {
- structuralSharing: infer TStructuralSharing;
-} ? TStructuralSharing : unknown;
-
export { InferTo }
-export { interpolatePath }
-
export { IntersectAssign }
export { isMatch }
@@ -585,8 +500,6 @@ export { isNotFound }
export { isRedirect }
-export { joinPaths }
-
export { lazyFn }
// @public (undocumented)
@@ -681,25 +594,11 @@ export { MakeRouteMatchUnion }
export { Manifest }
-// @public (undocumented)
-export const Match: React_2.MemoExoticComponent<(input: {
- routeId: string;
-}) => JSX.Element>;
-
-// @public
-export function Matches(): JSX.Element;
-
-export { MatchLocation }
-
// @public
export function MatchRoute(props: MakeMatchRouteOptions): any;
export { MatchRouteOptions }
-export { MergeAll }
-
-export { MetaDescriptor }
-
// @public
export function Navigate(props: NavigateOptions): null;
@@ -736,11 +635,6 @@ export { parseSearchWith }
export { PathParamOptions }
-export { PreloadableObj }
-
-// @public
-export const reactUse: ((usable: Promise | React_2.Context) => T) | undefined;
-
export { Redirect }
export { redirect }
@@ -767,14 +661,10 @@ export { RemoveLeadingSlashes }
export { RemoveTrailingSlashes }
-export { replaceEqualDeep }
-
export { ResolveAllContext }
export { ResolveAllParamsFromParent }
-export { ResolvedRedirect }
-
export { ResolveFullPath }
export { ResolveFullSearchSchema }
@@ -789,8 +679,6 @@ export { ResolveOptionalParams }
export { ResolveParams }
-export { resolvePath }
-
export { ResolveRelativePath }
export { ResolveRequiredParams }
@@ -903,16 +791,12 @@ export { RouteConstraints }
export { RouteContext }
-export { RouteContextFn }
-
export { RouteContextOptions }
export { RouteContextParameter }
export { RouteIds }
-export { RouteLinkEntry }
-
export { RouteLoaderFn }
export { RouteMask }
@@ -923,8 +807,6 @@ export { RouteOptions }
export { RoutePathOptions }
-export { RoutePathOptionsIntersection }
-
// @public (undocumented)
export class Router = Record> extends RouterCore {
constructor(options: RouterConstructorOptions);
@@ -934,19 +816,12 @@ export { RouterConstructorOptions }
export { RouterContextOptions }
-// @public
-export function RouterContextProvider = Record>(input: RouterProps & {
- children: React_2.ReactNode;
-}): JSX.Element;
-
export { RouterEvent }
export { RouterEvents }
export { RouterHistory }
-export { RouterListener }
-
export { RouterManagedTag }
export { RouterOptions }
@@ -1025,16 +900,10 @@ export { TrailingSlashOption }
export { TrimPath }
-export { trimPath }
-
export { TrimPathLeft }
-export { trimPathLeft }
-
export { TrimPathRight }
-export { trimPathRight }
-
export { UpdatableRouteOptions }
export { UpdatableStaticRouteOption }
@@ -1089,9 +958,6 @@ export function useElementScrollRestoration(options: ({
// @public
export function useHydrated(): boolean;
-// @public (undocumented)
-export const useLayoutEffect: typeof React_2.useEffect;
-
// @public
export function useLinkProps(options: UseLinkPropsOptions, forwardedRef?: React_2.ForwardedRef): React_2.ComponentPropsWithRef<'a'>;
@@ -1165,13 +1031,8 @@ export function useRouterState(opts: UseSearchOptions, TSelected, TStructuralSharing>): ThrowOrOptional, TThrow>;
-// @public
-export const useTags: (assetCrossOrigin?: AssetCrossOriginConfig) => RouterManagedTag[];
-
export { ValidateFromPath }
-export { ValidateId }
-
// @public (undocumented)
export type ValidateLinkOptions = Constrain, InferTo, InferMaskFrom, InferMaskTo>>;
@@ -1182,28 +1043,8 @@ export type ValidateLinkOptionsArray = Constrain, InferStrict, InferShouldThrow, InferSelected, InferSelected>>;
-
-export { ValidateUseParamsResult }
-
-// @public (undocumented)
-export type ValidateUseSearchOptions = Constrain, InferStrict, InferShouldThrow, InferSelected, InferStructuralSharing>>;
-
-export { ValidateUseSearchResult }
-
export { Validator }
export { ValidatorAdapter }
@@ -1227,18 +1068,12 @@ declare module "@tanstack/history" {
interface HistoryState {
__tempLocation?: HistoryLocation;
__tempKey?: string;
- __hashScrollIntoViewOptions?: boolean | ScrollIntoViewOptions;
}
}
// Matches.d.ts
declare module "@tanstack/router-core" {
interface RouteMatchExtensions {
- meta?: Array;
- links?: Array;
- scripts?: Array;
- styles?: Array;
- headScripts?: Array;
}
}
diff --git a/packages/react-router/api/index.rsc.api.md b/packages/react-router/api/index.rsc.api.md
index f2d0f4945c2..cb63465d971 100644
--- a/packages/react-router/api/index.rsc.api.md
+++ b/packages/react-router/api/index.rsc.api.md
@@ -18,13 +18,10 @@ import { AnyRedirect } from '@tanstack/router-core';
import { AnyRoute } from '@tanstack/router-core';
import { AnyRouteMatch } from '@tanstack/router-core';
import { AnyRouter } from '@tanstack/router-core';
-import { AnyRouterWithContext } from '@tanstack/router-core';
-import { AnyRouteWithContext } from '@tanstack/router-core';
import { AnySchema } from '@tanstack/router-core';
import { AnySerializationAdapter } from '@tanstack/router-core';
import { AnyValidator } from '@tanstack/router-core';
import { AnyValidatorAdapter } from '@tanstack/router-core';
-import { AnyValidatorFn } from '@tanstack/router-core';
import { AnyValidatorObj } from '@tanstack/router-core';
import { AssetCrossOriginConfig } from '@tanstack/router-core';
import { Assign } from '@tanstack/router-core';
@@ -37,27 +34,18 @@ import { BeforeLoadContextParameter } from '@tanstack/router-core';
import { BlockerFn } from '@tanstack/history';
import { BuildLocationFn } from '@tanstack/router-core';
import { BuildNextOptions } from '@tanstack/router-core';
-import { cleanPath } from '@tanstack/router-core';
-import { CommitLocationOptions } from '@tanstack/router-core';
import { composeRewrites } from '@tanstack/router-core';
import { Constrain } from '@tanstack/router-core';
import { ConstrainLiteral } from '@tanstack/router-core';
import { ContextAsyncReturnType } from '@tanstack/router-core';
import { ContextOptions } from '@tanstack/router-core';
import { ContextReturnType } from '@tanstack/router-core';
-import { ControllablePromise } from '@tanstack/router-core';
-import { ControlledPromise } from '@tanstack/router-core';
import { createBrowserHistory } from '@tanstack/history';
-import { createControlledPromise } from '@tanstack/router-core';
import { CreateFileRoute } from '@tanstack/router-core';
import { createHashHistory } from '@tanstack/history';
-import { createHistory } from '@tanstack/history';
-import { CreateLazyFileRoute } from '@tanstack/router-core';
import { createMemoryHistory } from '@tanstack/history';
-import { createRouterConfig } from '@tanstack/router-core';
import { CreateRouterFn } from '@tanstack/router-core';
import { createSerializationAdapter } from '@tanstack/router-core';
-import { deepEqual } from '@tanstack/router-core';
import { DeepPartial } from '@tanstack/router-core';
import { default as default_2 } from 'react';
import { DEFAULT_PROTOCOL_ALLOWLIST } from '@tanstack/router-core';
@@ -69,14 +57,12 @@ import { DeferredPromise } from '@tanstack/router-core';
import { DeferredPromiseState } from '@tanstack/router-core';
import { ErrorComponentProps } from '@tanstack/router-core';
import { ErrorInfo } from 'react';
-import { ErrorRouteProps } from '@tanstack/router-core';
import { Expand } from '@tanstack/router-core';
import { FileBaseRouteOptions } from '@tanstack/router-core';
import { FileRoutesByPath } from '@tanstack/router-core';
import { FileRouteTypes } from '@tanstack/router-core';
import { FromPathOption } from '@tanstack/router-core';
import { FullSearchSchemaOption } from '@tanstack/router-core';
-import { functionalUpdate } from '@tanstack/router-core';
import { HistoryAction } from '@tanstack/history';
import { HistoryLocation } from '@tanstack/history';
import { HistoryState } from '@tanstack/history';
@@ -92,12 +78,10 @@ import { InferSelected } from '@tanstack/router-core';
import { InferShouldThrow } from '@tanstack/router-core';
import { InferStrict } from '@tanstack/router-core';
import { InferTo } from '@tanstack/router-core';
-import { interpolatePath } from '@tanstack/router-core';
import { IntersectAssign } from '@tanstack/router-core';
import { isMatch } from '@tanstack/router-core';
import { isNotFound } from '@tanstack/router-core';
import { isRedirect } from '@tanstack/router-core';
-import { joinPaths } from '@tanstack/router-core';
import { JSX } from 'react/jsx-runtime';
import { lazyFn } from '@tanstack/router-core';
import { LazyRouteOptions } from '@tanstack/router-core';
@@ -115,10 +99,7 @@ import { MakeRouteMatch } from '@tanstack/router-core';
import { MakeRouteMatchUnion } from '@tanstack/router-core';
import { Manifest } from '@tanstack/router-core';
import { MaskOptions } from '@tanstack/router-core';
-import { MatchLocation } from '@tanstack/router-core';
import { MatchRouteOptions } from '@tanstack/router-core';
-import { MergeAll } from '@tanstack/router-core';
-import { MetaDescriptor } from '@tanstack/router-core';
import { NavigateFn } from '@tanstack/router-core';
import { NavigateOptions } from '@tanstack/router-core';
import { notFound } from '@tanstack/router-core';
@@ -132,7 +113,6 @@ import { ParseParamsFn } from '@tanstack/router-core';
import { ParseRoute } from '@tanstack/router-core';
import { parseSearchWith } from '@tanstack/router-core';
import { PathParamOptions } from '@tanstack/router-core';
-import { PreloadableObj } from '@tanstack/router-core';
import * as React_2 from 'react';
import { ReactNode } from 'react';
import { Redirect } from '@tanstack/router-core';
@@ -148,10 +128,8 @@ import { RelativeToPathAutoComplete } from '@tanstack/router-core';
import { RemountDepsOptions } from '@tanstack/router-core';
import { RemoveLeadingSlashes } from '@tanstack/router-core';
import { RemoveTrailingSlashes } from '@tanstack/router-core';
-import { replaceEqualDeep } from '@tanstack/router-core';
import { ResolveAllContext } from '@tanstack/router-core';
import { ResolveAllParamsFromParent } from '@tanstack/router-core';
-import { ResolvedRedirect } from '@tanstack/router-core';
import { ResolveFullPath } from '@tanstack/router-core';
import { ResolveFullSearchSchema } from '@tanstack/router-core';
import { ResolveFullSearchSchemaInput } from '@tanstack/router-core';
@@ -159,7 +137,6 @@ import { ResolveId } from '@tanstack/router-core';
import { ResolveLoaderData } from '@tanstack/router-core';
import { ResolveOptionalParams } from '@tanstack/router-core';
import { ResolveParams } from '@tanstack/router-core';
-import { resolvePath } from '@tanstack/router-core';
import { ResolveRelativePath } from '@tanstack/router-core';
import { ResolveRequiredParams } from '@tanstack/router-core';
import { ResolveRoute } from '@tanstack/router-core';
@@ -183,18 +160,14 @@ import { Route as Route_2 } from '@tanstack/router-core';
import { RouteById } from '@tanstack/router-core';
import { RouteConstraints } from '@tanstack/router-core';
import { RouteContext } from '@tanstack/router-core';
-import { RouteContextFn } from '@tanstack/router-core';
import { RouteContextOptions } from '@tanstack/router-core';
import { RouteContextParameter } from '@tanstack/router-core';
import { RouteIds } from '@tanstack/router-core';
-import { RouteLinkEntry } from '@tanstack/router-core';
-import { RouteLoaderEntry } from '@tanstack/router-core';
import { RouteLoaderFn } from '@tanstack/router-core';
import { RouteMask } from '@tanstack/router-core';
import { RouteMatch } from '@tanstack/router-core';
import { RouteOptions } from '@tanstack/router-core';
import { RoutePathOptions } from '@tanstack/router-core';
-import { RoutePathOptionsIntersection } from '@tanstack/router-core';
import { RoutePaths } from '@tanstack/router-core';
import { RouterConstructorOptions } from '@tanstack/router-core';
import { RouterContextOptions } from '@tanstack/router-core';
@@ -202,7 +175,6 @@ import { RouterCore } from '@tanstack/router-core';
import { RouterEvent } from '@tanstack/router-core';
import { RouterEvents } from '@tanstack/router-core';
import { RouterHistory } from '@tanstack/history';
-import { RouterListener } from '@tanstack/router-core';
import { RouterManagedTag } from '@tanstack/router-core';
import { RouterOptions } from '@tanstack/router-core';
import { RouterState } from '@tanstack/router-core';
@@ -234,11 +206,8 @@ import { ToSubOptions } from '@tanstack/router-core';
import { ToSubOptionsProps } from '@tanstack/router-core';
import { TrailingSlashOption } from '@tanstack/router-core';
import { TrimPath } from '@tanstack/router-core';
-import { trimPath } from '@tanstack/router-core';
import { TrimPathLeft } from '@tanstack/router-core';
-import { trimPathLeft } from '@tanstack/router-core';
import { TrimPathRight } from '@tanstack/router-core';
-import { trimPathRight } from '@tanstack/router-core';
import { UpdatableRouteOptions } from '@tanstack/router-core';
import { UpdatableStaticRouteOption } from '@tanstack/router-core';
import { UseLoaderDataResult } from '@tanstack/router-core';
@@ -250,17 +219,9 @@ import { UseRouteContextOptions } from '@tanstack/router-core';
import { UseRouteContextResult } from '@tanstack/router-core';
import { UseSearchResult } from '@tanstack/router-core';
import { ValidateFromPath } from '@tanstack/router-core';
-import { ValidateId } from '@tanstack/router-core';
import { ValidateJSON } from '@tanstack/router-core';
import { ValidateNavigateOptions } from '@tanstack/router-core';
-import { ValidateNavigateOptionsArray } from '@tanstack/router-core';
-import { ValidateParams } from '@tanstack/router-core';
import { ValidateRedirectOptions } from '@tanstack/router-core';
-import { ValidateRedirectOptionsArray } from '@tanstack/router-core';
-import { ValidateSearch } from '@tanstack/router-core';
-import { ValidateToPath } from '@tanstack/router-core';
-import { ValidateUseParamsResult } from '@tanstack/router-core';
-import { ValidateUseSearchResult } from '@tanstack/router-core';
import { Validator } from '@tanstack/router-core';
import { ValidatorAdapter } from '@tanstack/router-core';
import { ValidatorFn } from '@tanstack/router-core';
@@ -290,10 +251,6 @@ export { AnyRouteMatch }
export { AnyRouter }
-export { AnyRouterWithContext }
-
-export { AnyRouteWithContext }
-
export { AnySchema }
export { AnySerializationAdapter }
@@ -302,16 +259,8 @@ export { AnyValidator }
export { AnyValidatorAdapter }
-export { AnyValidatorFn }
-
export { AnyValidatorObj }
-// @public (undocumented)
-export function Asset(asset: RouterManagedTag & {
- nonce?: string;
- preventScriptHoist?: boolean;
-}): React_2.ReactElement | null;
-
export { Assign }
// @public (undocumented)
@@ -396,15 +345,11 @@ export function CatchNotFound(props: {
children: React_2.ReactNode;
}): JSX.Element;
-export { cleanPath }
-
// Warning: (ae-forgotten-export) The symbol "ClientOnlyProps" needs to be exported by the entry point index.rsc.d.ts
//
// @public
export function ClientOnly(input: ClientOnlyProps): JSX.Element;
-export { CommitLocationOptions }
-
export { composeRewrites }
export { Constrain }
@@ -415,14 +360,8 @@ export { ContextOptions }
export { ContextReturnType }
-export { ControllablePromise }
-
-export { ControlledPromise }
-
export { createBrowserHistory }
-export { createControlledPromise }
-
export { CreateFileRoute }
// @public
@@ -430,10 +369,6 @@ export function createFileRoute(id: TFilePath): (opts: LazyRouteOptions) => LazyRoute;
@@ -465,12 +400,8 @@ export function createRouteMask;
-export { ErrorRouteProps }
-
export { Expand }
export { FileBaseRouteOptions }
@@ -519,21 +448,14 @@ export class FileRoute, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TLoaderDeps extends Record = {}, TLoaderFn = undefined, TChildren = unknown, TSSR = unknown, const TMiddlewares = unknown, THandlers = undefined>(options?: FileBaseRouteOptions & UpdatableRouteOptions) => Route_2;
// (undocumented)
path?: TFilePath | undefined;
- // (undocumented)
- silent?: boolean;
}
-// @public @deprecated (undocumented)
-export function FileRouteLoader(_path: TFilePath): (loaderFn: Constrain>) => TLoaderFn;
-
export { FileRoutesByPath }
export { FileRouteTypes }
export { FullSearchSchemaOption }
-export { functionalUpdate }
-
// @public
export function getRouteApi(id: ConstrainLiteral>): RouteApi;
@@ -568,15 +490,8 @@ export { InferShouldThrow }
export { InferStrict }
-// @public (undocumented)
-export type InferStructuralSharing = TOptions extends {
- structuralSharing: infer TStructuralSharing;
-} ? TStructuralSharing : unknown;
-
export { InferTo }
-export { interpolatePath }
-
export { IntersectAssign }
export { isMatch }
@@ -585,8 +500,6 @@ export { isNotFound }
export { isRedirect }
-export { joinPaths }
-
export { lazyFn }
// @public (undocumented)
@@ -681,25 +594,11 @@ export { MakeRouteMatchUnion }
export { Manifest }
-// @public (undocumented)
-export const Match: React_2.MemoExoticComponent<(input: {
- routeId: string;
-}) => JSX.Element>;
-
-// @public
-export function Matches(): JSX.Element;
-
-export { MatchLocation }
-
// @public
export function MatchRoute(props: MakeMatchRouteOptions): any;
export { MatchRouteOptions }
-export { MergeAll }
-
-export { MetaDescriptor }
-
// @public
export function Navigate(props: NavigateOptions): null;
@@ -736,11 +635,6 @@ export { parseSearchWith }
export { PathParamOptions }
-export { PreloadableObj }
-
-// @public
-export const reactUse: ((usable: Promise | React_2.Context) => T) | undefined;
-
export { Redirect }
export { redirect }
@@ -767,14 +661,10 @@ export { RemoveLeadingSlashes }
export { RemoveTrailingSlashes }
-export { replaceEqualDeep }
-
export { ResolveAllContext }
export { ResolveAllParamsFromParent }
-export { ResolvedRedirect }
-
export { ResolveFullPath }
export { ResolveFullSearchSchema }
@@ -789,8 +679,6 @@ export { ResolveOptionalParams }
export { ResolveParams }
-export { resolvePath }
-
export { ResolveRelativePath }
export { ResolveRequiredParams }
@@ -903,16 +791,12 @@ export { RouteConstraints }
export { RouteContext }
-export { RouteContextFn }
-
export { RouteContextOptions }
export { RouteContextParameter }
export { RouteIds }
-export { RouteLinkEntry }
-
export { RouteLoaderFn }
export { RouteMask }
@@ -923,8 +807,6 @@ export { RouteOptions }
export { RoutePathOptions }
-export { RoutePathOptionsIntersection }
-
// @public (undocumented)
export class Router = Record> extends RouterCore {
constructor(options: RouterConstructorOptions);
@@ -934,19 +816,12 @@ export { RouterConstructorOptions }
export { RouterContextOptions }
-// @public
-export function RouterContextProvider = Record>(input: RouterProps & {
- children: React_2.ReactNode;
-}): JSX.Element;
-
export { RouterEvent }
export { RouterEvents }
export { RouterHistory }
-export { RouterListener }
-
export { RouterManagedTag }
export { RouterOptions }
@@ -1025,16 +900,10 @@ export { TrailingSlashOption }
export { TrimPath }
-export { trimPath }
-
export { TrimPathLeft }
-export { trimPathLeft }
-
export { TrimPathRight }
-export { trimPathRight }
-
export { UpdatableRouteOptions }
export { UpdatableStaticRouteOption }
@@ -1089,9 +958,6 @@ export function useElementScrollRestoration(options: ({
// @public
export function useHydrated(): boolean;
-// @public (undocumented)
-export const useLayoutEffect: typeof React_2.useEffect;
-
// @public
export function useLinkProps(options: UseLinkPropsOptions, forwardedRef?: React_2.ForwardedRef): React_2.ComponentPropsWithRef<'a'>;
@@ -1165,13 +1031,8 @@ export function useRouterState(opts: UseSearchOptions, TSelected, TStructuralSharing>): ThrowOrOptional, TThrow>;
-// @public
-export const useTags: (assetCrossOrigin?: AssetCrossOriginConfig) => RouterManagedTag[];
-
export { ValidateFromPath }
-export { ValidateId }
-
// @public (undocumented)
export type ValidateLinkOptions = Constrain, InferTo, InferMaskFrom, InferMaskTo>>;
@@ -1182,28 +1043,8 @@ export type ValidateLinkOptionsArray = Constrain, InferStrict, InferShouldThrow, InferSelected, InferSelected>>;
-
-export { ValidateUseParamsResult }
-
-// @public (undocumented)
-export type ValidateUseSearchOptions = Constrain, InferStrict, InferShouldThrow, InferSelected, InferStructuralSharing>>;
-
-export { ValidateUseSearchResult }
-
export { Validator }
export { ValidatorAdapter }
@@ -1227,18 +1068,12 @@ declare module "@tanstack/history" {
interface HistoryState {
__tempLocation?: HistoryLocation;
__tempKey?: string;
- __hashScrollIntoViewOptions?: boolean | ScrollIntoViewOptions;
}
}
// Matches.d.ts
declare module "@tanstack/router-core" {
interface RouteMatchExtensions {
- meta?: Array;
- links?: Array;
- scripts?: Array;
- styles?: Array;
- headScripts?: Array;
}
}
diff --git a/packages/react-router/src/Matches.tsx b/packages/react-router/src/Matches.tsx
index a20c862b238..7e4d02863d3 100644
--- a/packages/react-router/src/Matches.tsx
+++ b/packages/react-router/src/Matches.tsx
@@ -32,10 +32,15 @@ import type {
declare module '@tanstack/router-core' {
export interface RouteMatchExtensions {
+ /** @internal */
meta?: Array
+ /** @internal */
links?: Array
+ /** @internal */
scripts?: Array
+ /** @internal */
styles?: Array
+ /** @internal */
headScripts?: Array
}
}
diff --git a/packages/react-router/src/Transitioner.tsx b/packages/react-router/src/Transitioner.tsx
index ddf8afea2e1..fe45709a6de 100644
--- a/packages/react-router/src/Transitioner.tsx
+++ b/packages/react-router/src/Transitioner.tsx
@@ -6,6 +6,7 @@ import { useLayoutEffect } from './utils'
import { useRouter } from './useRouter'
import type { AnyRouter } from '@tanstack/router-core'
+// @internal
export function settleOwner(
owner: NonNullable,
rendered: boolean,
diff --git a/packages/react-router/src/fileRoute.ts b/packages/react-router/src/fileRoute.ts
index f4d8c9b9676..c829c5df32e 100644
--- a/packages/react-router/src/fileRoute.ts
+++ b/packages/react-router/src/fileRoute.ts
@@ -76,6 +76,7 @@ export class FileRoute<
TFullPath extends RouteConstraints['TFullPath'] =
FileRoutesByPath[TFilePath]['fullPath'],
> {
+ /** @internal */
silent?: boolean
constructor(
diff --git a/packages/react-router/src/history.ts b/packages/react-router/src/history.ts
index 2271af692cd..190b60e4ed0 100644
--- a/packages/react-router/src/history.ts
+++ b/packages/react-router/src/history.ts
@@ -4,6 +4,7 @@ declare module '@tanstack/history' {
interface HistoryState {
__tempLocation?: HistoryLocation
__tempKey?: string
+ /** @internal */
__hashScrollIntoViewOptions?: boolean | ScrollIntoViewOptions
}
}
diff --git a/packages/react-router/src/index.tsx b/packages/react-router/src/index.tsx
index 23ebf57938f..b5d0236c972 100644
--- a/packages/react-router/src/index.tsx
+++ b/packages/react-router/src/index.tsx
@@ -3,6 +3,17 @@
export {
defer,
isMatch,
+ rootRouteId,
+ defaultParseSearch,
+ defaultStringifySearch,
+ parseSearchWith,
+ stringifySearchWith,
+ retainSearchParams,
+ stripSearchParams,
+ createSerializationAdapter,
+} from '@tanstack/router-core'
+/** @internal */
+export {
joinPaths,
cleanPath,
trimPathLeft,
@@ -10,18 +21,10 @@ export {
trimPath,
resolvePath,
interpolatePath,
- rootRouteId,
- defaultParseSearch,
- defaultStringifySearch,
- parseSearchWith,
- stringifySearchWith,
functionalUpdate,
replaceEqualDeep,
deepEqual,
createControlledPromise,
- retainSearchParams,
- stripSearchParams,
- createSerializationAdapter,
} from '@tanstack/router-core'
export type {
@@ -41,19 +44,14 @@ export type {
SearchSchemaInput,
AnyContext,
RouteContext,
- PreloadableObj,
RoutePathOptions,
StaticDataRouteOption,
- RoutePathOptionsIntersection,
UpdatableStaticRouteOption,
- MetaDescriptor,
- RouteLinkEntry,
ParseParamsFn,
SearchFilter,
ResolveId,
InferFullSearchSchema,
InferFullSearchSchemaInput,
- ErrorRouteProps,
ErrorComponentProps,
NotFoundRouteProps,
TrimPath,
@@ -75,13 +73,10 @@ export type {
TrailingSlashOption,
Manifest,
RouterManagedTag,
- ControlledPromise,
Constrain,
Expand,
- MergeAll,
Assign,
IntersectAssign,
- ResolveValidatorInput,
ResolveValidatorOutput,
Register,
AnyValidator,
@@ -89,9 +84,7 @@ export type {
ValidatorFn,
AnySchema,
AnyValidatorAdapter,
- AnyValidatorFn,
AnyValidatorObj,
- ResolveValidatorInputFn,
ResolveValidatorOutputFn,
ResolveSearchValidatorInput,
ResolveSearchValidatorInputFn,
@@ -101,18 +94,32 @@ export type {
FileRoutesByPath,
RouteById,
RootRouteOptions,
- CreateFileRoute,
SerializationAdapter,
AnySerializationAdapter,
SerializableExtensions,
+ CreateFileRoute,
+ ResolveValidatorInput,
+ ResolveValidatorInputFn,
+} from '@tanstack/router-core'
+/** @internal */
+export type {
+ PreloadableObj,
+ RoutePathOptionsIntersection,
+ MetaDescriptor,
+ RouteLinkEntry,
+ ErrorRouteProps,
+ ControlledPromise,
+ MergeAll,
+ AnyValidatorFn,
} from '@tanstack/router-core'
export {
- createHistory,
createBrowserHistory,
createHashHistory,
createMemoryHistory,
} from '@tanstack/history'
+/** @internal */
+export { createHistory } from '@tanstack/history'
export type {
BlockerFn,
@@ -127,16 +134,18 @@ export type { AwaitOptions } from './awaited'
export { CatchBoundary, ErrorComponent } from './CatchBoundary'
export { ClientOnly, useHydrated } from './ClientOnly'
+/** @internal */
export { reactUse, useLayoutEffect } from './utils'
export {
FileRoute,
createFileRoute,
- FileRouteLoader,
LazyRoute,
createLazyRoute,
createLazyFileRoute,
} from './fileRoute'
+/** @internal */
+export { FileRouteLoader } from './fileRoute'
export * from './history'
@@ -174,20 +183,14 @@ export type {
MakeRemountDepsOptionsUnion,
RemountDepsOptions,
ResolveFullPath,
- AnyRouteWithContext,
- AnyRouterWithContext,
- CommitLocationOptions,
- MatchLocation,
UseNavigateResult,
AnyRedirect,
Redirect,
RedirectOptions,
- ResolvedRedirect,
MakeRouteMatch,
MakeRouteMatchUnion,
RouteMatch,
AnyRouteMatch,
- RouteContextFn,
RouteContextOptions,
BeforeLoadContextOptions,
ContextOptions,
@@ -201,7 +204,6 @@ export type {
AnyRouter,
RegisteredRouter,
RouterContextOptions,
- ControllablePromise,
RouterOptions,
RouterState,
ListenerFn,
@@ -209,10 +211,20 @@ export type {
RouterConstructorOptions,
RouterEvents,
RouterEvent,
- RouterListener,
RouteConstraints,
RouteMask,
MatchRouteOptions,
+} from '@tanstack/router-core'
+/** @internal */
+export type {
+ AnyRouteWithContext,
+ AnyRouterWithContext,
+ CommitLocationOptions,
+ MatchLocation,
+ ResolvedRedirect,
+ RouteContextFn,
+ ControllablePromise,
+ RouterListener,
CreateLazyFileRoute,
} from '@tanstack/router-core'
export type {
@@ -225,17 +237,20 @@ export type {
} from './link'
export {
- Matches,
useMatchRoute,
MatchRoute,
useMatches,
useParentMatches,
useChildMatches,
} from './Matches'
+/** @internal */
+export { Matches } from './Matches'
export type { UseMatchRouteOptions, MakeMatchRouteOptions } from './Matches'
-export { Match, Outlet } from './Match'
+export { Outlet } from './Match'
+/** @internal */
+export { Match } from './Match'
export { useMatch } from './useMatch'
export { useLoaderDeps } from './useLoaderDeps'
@@ -244,9 +259,10 @@ export { useLoaderData } from './useLoaderData'
export {
redirect,
isRedirect,
- createRouterConfig,
DEFAULT_PROTOCOL_ALLOWLIST,
} from '@tanstack/router-core'
+/** @internal */
+export { createRouterConfig } from '@tanstack/router-core'
export {
RouteApi,
@@ -274,7 +290,9 @@ export { createRouter, Router } from './router'
export { lazyFn, SearchParamError } from '@tanstack/router-core'
-export { RouterProvider, RouterContextProvider } from './RouterProvider'
+export { RouterProvider } from './RouterProvider'
+/** @internal */
+export { RouterContextProvider } from './RouterProvider'
export type { RouterProps } from './RouterProvider'
export {
@@ -302,39 +320,47 @@ export type { NotFoundError } from '@tanstack/router-core'
export type {
ValidateLinkOptions,
+ ValidateLinkOptionsArray,
+} from './typePrimitives'
+/** @internal */
+export type {
InferStructuralSharing,
ValidateUseSearchOptions,
ValidateUseParamsOptions,
- ValidateLinkOptionsArray,
} from './typePrimitives'
export type {
ValidateFromPath,
- ValidateToPath,
- ValidateSearch,
- ValidateParams,
InferFrom,
InferTo,
InferMaskTo,
InferMaskFrom,
ValidateNavigateOptions,
- ValidateNavigateOptionsArray,
ValidateRedirectOptions,
+ SerializerExtensions,
+ RegisteredSerializableInput,
+ Serializable,
+ InferSelected,
+ InferShouldThrow,
+ InferStrict,
+} from '@tanstack/router-core'
+/** @internal */
+export type {
+ ValidateToPath,
+ ValidateSearch,
+ ValidateParams,
+ ValidateNavigateOptionsArray,
ValidateRedirectOptionsArray,
ValidateId,
- InferStrict,
- InferShouldThrow,
- InferSelected,
ValidateUseSearchResult,
ValidateUseParamsResult,
- SerializerExtensions,
- RegisteredSerializableInput,
- Serializable,
} from '@tanstack/router-core'
export { ScriptOnce } from './ScriptOnce'
+/** @internal */
export { Asset } from './Asset'
export { HeadContent } from './HeadContent'
+/** @internal */
export { useTags } from './headContentUtils'
export { Scripts } from './Scripts'
export type * from './ssr/serializer'
diff --git a/packages/react-router/src/matchContext.tsx b/packages/react-router/src/matchContext.tsx
index 12db4dbadaf..63c4788cb14 100644
--- a/packages/react-router/src/matchContext.tsx
+++ b/packages/react-router/src/matchContext.tsx
@@ -12,6 +12,7 @@ declare module '@tanstack/router-core' {
* The link scope of each route id that rendered links, keyed `undefined`
* for links outside every match (route ids start with `/` or are the
* root id). A scope without links holds no location.
+ * @internal
*/
_linkScopes?: Record
}
diff --git a/packages/router-core/api/index.api.md b/packages/router-core/api/index.api.md
index 024ac8dd674..c50d2d3a949 100644
--- a/packages/router-core/api/index.api.md
+++ b/packages/router-core/api/index.api.md
@@ -11,13 +11,9 @@
```ts
import { HistoryAction } from '@tanstack/history';
-import { HistoryLocation } from '@tanstack/history';
import { HistoryState } from '@tanstack/history';
import { ParsedHistoryState } from '@tanstack/history';
-import { Plugin as Plugin_2 } from 'seroval';
-import { PluginInfo } from 'seroval';
import { RouterHistory } from '@tanstack/history';
-import { SerovalNode } from 'seroval';
// Warning: (ae-forgotten-export) The symbol "CurrentPath" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "ParentPath" needs to be exported by the entry point index.d.ts
@@ -72,25 +68,9 @@ export type AnyRouteMatch = RouteMatch;
// @public (undocumented)
export type AnyRouter = RouterCore;
-// @public (undocumented)
-export type AnyRouterConfig = RouterConfig;
-
-// @public (undocumented)
-export type AnyRouterWithContext = RouterCore, any, any, any, any>;
-
-// @public (undocumented)
-export type AnyRouteWithContext = AnyRoute & {
- types: {
- allContext: TContext;
- };
-};
-
// @public (undocumented)
export type AnySchema = {};
-// @public (undocumented)
-export type AnySearchValidator = SearchValidator;
-
// @public (undocumented)
export type AnySerializationAdapter = SerializationAdapter;
@@ -103,12 +83,6 @@ export interface AnyStandardSchemaValidateFailure {
readonly issues: ReadonlyArray;
}
-// @public (undocumented)
-export interface AnyStandardSchemaValidateInput {
- // (undocumented)
- readonly value: any;
-}
-
// @public (undocumented)
export interface AnyStandardSchemaValidateIssue {
// (undocumented)
@@ -132,15 +106,9 @@ export type AnyValidator = Validator;
// @public (undocumented)
export type AnyValidatorAdapter = ValidatorAdapter;
-// @public (undocumented)
-export type AnyValidatorFn = ValidatorFn;
-
// @public (undocumented)
export type AnyValidatorObj = ValidatorObj;
-// @public (undocumented)
-export function appendUniqueUserTags(target: Array, tags: Array): void;
-
// @public (undocumented)
export type AssetCrossOrigin = 'anonymous' | 'use-credentials';
@@ -176,29 +144,17 @@ export class BaseRoute;
// (undocumented)
- children?: TChildren;
- // (undocumented)
get fullPath(): TFullPath;
// (undocumented)
get id(): TId;
// (undocumented)
- init: (originalIndex: number) => void;
- // (undocumented)
- isRoot: TParentRoute extends AnyRoute ? true : false;
- // (undocumented)
lazy: RouteLazyFn>;
// (undocumented)
lazyFn?: () => Promise>>;
// (undocumented)
- options: RouteOptions;
- // (undocumented)
- originalIndex?: number;
- // (undocumented)
parentRoute: TParentRoute;
// (undocumented)
get path(): TPath;
- // (undocumented)
- rank: number;
redirect: RedirectFnRoute;
// (undocumented)
get to(): TrimPathRight;
@@ -206,10 +162,6 @@ export class BaseRoute;
// (undocumented)
update: (options: UpdatableRouteOptions) => this;
- // (undocumented)
- updateLoader: (options: {
- loader: Constrain>;
- }) => BaseRoute;
}
// @public (undocumented)
@@ -238,14 +190,9 @@ export interface BeforeLoadContextOptions = Assign, ContextReturnType>;
-// @public
-export function buildDevStylesUrl(basepath: string, routeIds: Array): string;
-
// @public (undocumented)
export type BuildLocationFn = | string = string, TMaskFrom extends RoutePaths | string = TFrom, TMaskTo extends string = ''>(opts: ToOptions & {
leaveParams?: boolean;
- _includeValidateSearch?: boolean;
- _isNavigate?: boolean;
}) => ParsedLocation;
// @public (undocumented)
@@ -253,14 +200,10 @@ export interface BuildNextOptions {
// (undocumented)
from?: string;
// (undocumented)
- _fromLocation?: ParsedLocation;
- // (undocumented)
hash?: true | Updater;
// (undocumented)
href?: string;
// (undocumented)
- _isNavigate?: boolean;
- // (undocumented)
mask?: {
to?: string | number | null;
params?: true | Updater;
@@ -277,13 +220,8 @@ export interface BuildNextOptions {
state?: true | NonNullableUpdater;
// (undocumented)
to?: string | number | null;
- // (undocumented)
- unsafeRelative?: 'path';
}
-// @public
-export function cleanPath(path: string): string;
-
// @public (undocumented)
export type ClearCacheFn = (opts?: {
filter?: (d: MakeRouteMatchUnion) => boolean;
@@ -295,25 +233,6 @@ export type ClearCacheFn = (opts?: {
// @public (undocumented)
export type CodeRouteToPath = ParseRouteWithoutBranches extends infer TRoute extends AnyRoute ? TRoute extends any ? RouteToByRouter : never : never;
-// @public (undocumented)
-export type CommitLocationFn = (input: ParsedLocation & CommitLocationOptions) => Promise;
-
-// @public (undocumented)
-export interface CommitLocationOptions {
- // (undocumented)
- hashScrollIntoView?: boolean | ScrollIntoViewOptions;
- // (undocumented)
- ignoreBlocker?: boolean;
- // (undocumented)
- replace?: boolean;
- // (undocumented)
- resetScroll?: boolean;
- // @deprecated (undocumented)
- startTransition?: boolean;
- // (undocumented)
- viewTransition?: boolean | ViewTransitionOptions;
-}
-
// @public
export function composeRewrites(rewrites: Array): {
input: (input: {
@@ -324,12 +243,6 @@ export function composeRewrites(rewrites: Array): {
}) => URL;
};
-// Warning: (ae-forgotten-export) The symbol "SsrBodyScriptParts" needs to be exported by the entry point index.d.ts
-// Warning: (ae-forgotten-export) The symbol "InitialHydrationScriptTags" needs to be exported by the entry point index.d.ts
-//
-// @public (undocumented)
-export function composeSsrBodyScripts(input: SsrBodyScriptParts, initialHydrationScripts?: InitialHydrationScriptTags): Array;
-
// @public (undocumented)
export type Constrain = (T extends TConstraint ? T : never) | TDefault;
@@ -364,49 +277,17 @@ export interface ContextOptions = unknown extends TContextFn ? TContextFn : LooseReturnType extends never ? AnyContext : LooseReturnType;
-// @public (undocumented)
-export type ControllablePromise = Promise & {
- resolve: (value: T) => void;
- reject: (value?: any) => void;
-};
-
-// @public (undocumented)
-export type ControlledPromise = Promise & {
- resolve: (value: T) => void;
- reject: (value: any) => void;
- status: 'pending' | 'resolved' | 'rejected';
- value?: T;
-};
-
-// @public
-export function createControlledPromise(onResolve?: (value: T) => void): ControlledPromise;
-
// Warning: (ae-forgotten-export) The symbol "FileRouteOptions" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export type CreateFileRoute = , TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TLoaderDeps extends Record = {}, TLoaderFn = undefined, TSSR = unknown, TServerMiddlewares = unknown, THandlers = undefined>(options?: FileRouteOptions) => Route;
-// @public (undocumented)
-export function createInlineCssStyleAsset(css: string): ManifestInlineCss;
-
-// @public (undocumented)
-export type CreateLazyFileRoute = (opts: LazyRouteOptions) => LazyRoute;
-
// @public (undocumented)
export type CreateMatchAndValue = TValue extends any ? {
match: TMatch;
value: TValue;
} : never;
-// @public
-export function createNonReactiveMutableStore(initialValue: TValue): RouterWritableStore;
-
-// @public
-export function createNonReactiveReadonlyStore(read: () => TValue): RouterReadableStore;
-
-// @public (undocumented)
-export const createRouterConfig: = [], TDefaultSsr extends SSROption = SSROption>(options: RouterConfigOptions) => RouterConfig;
-
// @public (undocumented)
export type CreateRouterFn = = Record>(options: undefined extends number ? 'strictNullChecks must be enabled in tsconfig.json' : RouterConstructorOptions) => RouterCore;
@@ -415,12 +296,6 @@ export type CreateRouterFn = | never = never>(opts: CreateSerializationAdapterOptions): SerializationAdapter;
-// @public
-export function decode(str: any): any;
-
-// @public
-export function deepEqual(a: any, b: any, partial?: boolean, explicitUndefined?: boolean): boolean;
-
// @public (undocumented)
export type DeepPartial = T extends object ? {
[P in keyof T]?: DeepPartial;
@@ -435,18 +310,12 @@ export interface DefaultErrorBoundaryTypes {
error: unknown;
}
-// @public
-export const defaultGetScrollRestorationKey: (location: ParsedLocation) => string;
-
// @public
export const defaultParseSearch: (searchStr: string) => AnySchema;
// @public (undocumented)
export type DefaultRemountDepsFn = (opts: MakeRemountDepsOptionsUnion) => any;
-// @public (undocumented)
-export type DefaultSearchValidator = SearchValidator, AnySchema>;
-
// @public (undocumented)
export interface DefaultSerializable {
// (undocumented)
@@ -473,14 +342,6 @@ export interface DefaultSerializable {
void: void;
}
-// @public
-export function defaultSerializeError(err: unknown): {
- name: string;
- message: string;
-} | {
- data: unknown;
-};
-
// @public
export const defaultStringifySearch: (search: Record) => string;
@@ -511,15 +372,6 @@ export type DeferredPromiseState = {
error: unknown;
};
-// @public (undocumented)
-export const DEV_STYLES_ATTR = "data-tanstack-router-dev-styles";
-
-// @public (undocumented)
-export type EmitFn = (routerEvent: RouterEvent) => void;
-
-// @public
-export function encode(obj: Record, stringify?: (value: any) => string): string;
-
// @public
export interface ErrorBoundaryTypes extends DefaultErrorBoundaryTypes {
}
@@ -533,24 +385,6 @@ export type ErrorComponentProps = {
reset: () => void;
};
-// @public @deprecated (undocumented)
-export type ErrorRouteProps = {
- error: unknown;
- info?: {
- componentStack: string;
- };
- reset: () => void;
-};
-
-// @public
-export function escapeHtml(str: string): string;
-
-// @public
-export function exactPathTest(pathName1: string, pathName2: string, basepath: string): boolean;
-
-// @public
-export function executeRewriteInput(rewrite: LocationRewrite | undefined, url: URL): URL;
-
// @public (undocumented)
export type Expand = T extends object ? T extends infer O ? O extends Function ? O : {
[K in keyof O]: O[K];
@@ -633,72 +467,6 @@ export interface FullSearchSchemaOption>;
}
-// @public
-export function functionalUpdate(updater: Updater | NonNullableUpdater, previous: TPrevious): TResult;
-
-// @public (undocumented)
-export function getAssetCrossOrigin(assetCrossOrigin: AssetCrossOriginConfig | undefined, kind: 'script' | 'stylesheet'): AssetCrossOrigin | undefined;
-
-// @public
-export function _getAssetMatches(matches: Array): Array;
-
-// @public (undocumented)
-export function getElementScrollRestorationEntry(router: AnyRouter, options: ({
- id: string;
- getElement?: () => Window | Element | undefined | null;
-} | {
- id?: string;
- getElement: () => Window | Element | undefined | null;
-}) & {
- getKey?: (location: ParsedLocation) => string;
-}): ScrollRestorationEntry | undefined;
-
-// @public
-export function getInitialRouterState(location: ParsedLocation): RouterState;
-
-// @public
-export function getLocationChangeInfo(location: ParsedLocation, resolvedLocation?: ParsedLocation): {
- fromLocation: ParsedLocation<{}> | undefined;
- toLocation: ParsedLocation<{}>;
- pathChanged: boolean;
- hrefChanged: boolean;
- hashChanged: boolean;
-};
-
-// @public (undocumented)
-export function getManifestScriptFormat(manifest: {
- scriptFormat?: ScriptFormat;
-} | undefined): ScriptFormat;
-
-// @public (undocumented)
-export type GetMatchRoutesFn = (pathname: string) => [
-matchedRoutes: ReadonlyArray,
-rawParams: Record,
-foundRoute: AnyRoute | undefined
-];
-
-// @public
-export function _getRenderedMatches(matches: Array): Array;
-
-// Warning: (ae-forgotten-export) The symbol "RouteInterpolation" needs to be exported by the entry point index.d.ts
-//
-// @public (undocumented)
-export function getRouteSegments(route: AnyRoute): RouteInterpolation | undefined;
-
-// @public (undocumented)
-export function getScriptPreloadAttrs(manifest: {
- scriptFormat?: ScriptFormat;
-} | undefined, link: ManifestAssetLink, assetCrossOrigin?: AssetCrossOriginConfig): {
- rel: 'modulepreload' | 'preload';
- as?: 'script';
- href: string;
- fetchPriority: 'low';
- crossOrigin?: AssetCrossOrigin;
-};
-
-// @public (undocumented)
-export function getSsrBodyScriptParts(matches: Array, manifest: Manifest | undefined, nonce: string | undefined, routeScriptAttrs?: Record