@tanstack/vue-router 1.168.0 → 1.168.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/Match.js +14 -7
- package/dist/esm/Match.js.map +1 -1
- package/dist/esm/Matches.js +2 -3
- package/dist/esm/Matches.js.map +1 -1
- package/dist/esm/fileRoute.js +4 -3
- package/dist/esm/fileRoute.js.map +1 -1
- package/dist/esm/renderRouteNotFound.js +3 -2
- package/dist/esm/renderRouteNotFound.js.map +1 -1
- package/dist/esm/useMatch.js +9 -3
- package/dist/esm/useMatch.js.map +1 -1
- package/dist/esm/useRouter.js +3 -2
- package/dist/esm/useRouter.js.map +1 -1
- package/dist/source/Match.jsx +22 -7
- package/dist/source/Match.jsx.map +1 -1
- package/dist/source/Matches.jsx +2 -3
- package/dist/source/Matches.jsx.map +1 -1
- package/dist/source/fileRoute.js +4 -3
- package/dist/source/fileRoute.js.map +1 -1
- package/dist/source/renderRouteNotFound.jsx +4 -3
- package/dist/source/renderRouteNotFound.jsx.map +1 -1
- package/dist/source/useMatch.jsx +14 -4
- package/dist/source/useMatch.jsx.map +1 -1
- package/dist/source/useRouter.jsx +5 -2
- package/dist/source/useRouter.jsx.map +1 -1
- package/package.json +3 -5
- package/src/Match.tsx +27 -9
- package/src/Matches.tsx +3 -5
- package/src/fileRoute.ts +7 -8
- package/src/renderRouteNotFound.tsx +6 -6
- package/src/useMatch.tsx +23 -13
- package/src/useRouter.tsx +7 -5
package/dist/esm/Match.js
CHANGED
|
@@ -5,12 +5,10 @@ import { ClientOnly } from "./ClientOnly.js";
|
|
|
5
5
|
import { CatchNotFound } from "./not-found.js";
|
|
6
6
|
import { renderRouteNotFound } from "./renderRouteNotFound.js";
|
|
7
7
|
import { ScrollRestoration } from "./scroll-restoration.js";
|
|
8
|
-
import { createControlledPromise, getLocationChangeInfo, isNotFound, isRedirect, rootRouteId } from "@tanstack/router-core";
|
|
8
|
+
import { createControlledPromise, getLocationChangeInfo, invariant, isNotFound, isRedirect, rootRouteId } from "@tanstack/router-core";
|
|
9
9
|
import * as Vue from "vue";
|
|
10
|
-
import warning from "tiny-warning";
|
|
11
10
|
import { isServer } from "@tanstack/router-core/isServer";
|
|
12
11
|
import { useStore } from "@tanstack/vue-store";
|
|
13
|
-
import invariant from "tiny-invariant";
|
|
14
12
|
//#region src/Match.tsx
|
|
15
13
|
var Match = Vue.defineComponent({
|
|
16
14
|
name: "Match",
|
|
@@ -21,7 +19,10 @@ var Match = Vue.defineComponent({
|
|
|
21
19
|
setup(props) {
|
|
22
20
|
const router = useRouter();
|
|
23
21
|
const routeId = router.stores.activeMatchStoresById.get(props.matchId)?.routeId;
|
|
24
|
-
|
|
22
|
+
if (!routeId) {
|
|
23
|
+
if (process.env.NODE_ENV !== "production") throw new Error(`Invariant failed: Could not find routeId for matchId "${props.matchId}". Please file an issue!`);
|
|
24
|
+
invariant();
|
|
25
|
+
}
|
|
25
26
|
const isChildOfRoot = router.routesById[routeId]?.parentRoute?.id === rootRouteId;
|
|
26
27
|
const activeMatch = useStore(router.stores.getMatchStoreByRouteId(routeId), (value) => value);
|
|
27
28
|
const isPendingMatchRef = useStore(router.stores.pendingRouteIds, (pendingRouteIds) => Boolean(pendingRouteIds[routeId]), { equal: Object.is });
|
|
@@ -70,7 +71,7 @@ var Match = Vue.defineComponent({
|
|
|
70
71
|
errorComponent: routeErrorComponent.value || ErrorComponent,
|
|
71
72
|
onCatch: (error) => {
|
|
72
73
|
if (isNotFound(error)) throw error;
|
|
73
|
-
|
|
74
|
+
if (process.env.NODE_ENV !== "production") console.warn(`Warning: Error in route match: ${actualMatchId}`);
|
|
74
75
|
routeOnCatch.value?.(error);
|
|
75
76
|
},
|
|
76
77
|
children: content
|
|
@@ -160,11 +161,17 @@ var MatchInner = Vue.defineComponent({
|
|
|
160
161
|
return PendingComponent ? Vue.h(PendingComponent) : null;
|
|
161
162
|
}
|
|
162
163
|
if (match.value.status === "notFound") {
|
|
163
|
-
|
|
164
|
+
if (!isNotFound(match.value.error)) {
|
|
165
|
+
if (process.env.NODE_ENV !== "production") throw new Error("Invariant failed: Expected a notFound error");
|
|
166
|
+
invariant();
|
|
167
|
+
}
|
|
164
168
|
return renderRouteNotFound(router, route.value, match.value.error);
|
|
165
169
|
}
|
|
166
170
|
if (match.value.status === "redirected") {
|
|
167
|
-
|
|
171
|
+
if (!isRedirect(match.value.error)) {
|
|
172
|
+
if (process.env.NODE_ENV !== "production") throw new Error("Invariant failed: Expected a redirect error");
|
|
173
|
+
invariant();
|
|
174
|
+
}
|
|
168
175
|
throw router.getMatch(match.value.id)?._nonReactive.loadPromise;
|
|
169
176
|
}
|
|
170
177
|
if (match.value.status === "error") {
|
package/dist/esm/Match.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Match.js","names":["Vue","invariant","warning","createControlledPromise","getLocationChangeInfo","isNotFound","isRedirect","rootRouteId","isServer","useStore","CatchBoundary","ErrorComponent","ClientOnly","useRouter","CatchNotFound","matchContext","pendingMatchContext","routeIdContext","renderRouteNotFound","ScrollRestoration","Match","defineComponent","name","props","matchId","type","String","required","setup","router","routeId","stores","activeMatchStoresById","get","isChildOfRoot","routesById","parentRoute","id","activeMatch","getMatchStoreByRouteId","value","isPendingMatchRef","pendingRouteIds","Boolean","equal","Object","is","loadedAt","matchData","computed","match","ssr","_displayPending","route","PendingComponent","options","pendingComponent","defaultPendingComponent","pendingElement","h","undefined","routeErrorComponent","errorComponent","defaultErrorComponent","routeOnCatch","onCatch","defaultOnCatch","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","hasShellComponent","shellComponent","ShellComponent","provide","matchIdRef","actualMatchId","resolvedNoSsr","shouldClientOnly","renderMatchContent","matchInner","MatchInner","content","fallback","default","error","children","getResetKey","withScrollRestoration","scrollRestoration","Fragment","OnRendered","filter","length","location","resolvedLocation","state","__TSR_key","prevHref","watch","currentHref","latestLocation","href","emit","immediate","inject","combinedState","matchRouteId","remountFn","remountDeps","defaultRemountDeps","remountKey","loaderDeps","params","_strictParams","search","_strictSearch","JSON","stringify","status","_forcePending","getMatch","_nonReactive","loadPromise","RouteErrorComponent","reset","invalidate","info","componentStack","pendingMinMs","defaultPendingMinMs","routerMatch","minPendingPromise","setTimeout","resolve","Comp","defaultComponent","key","Outlet","parentRouteId","parentMatch","v","parentGlobalNotFound","globalNotFound","childMatchIdMap","childMatchIdByRouteId","childMatchData","childId","child","paramsKey","nextMatch"],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport invariant from 'tiny-invariant'\nimport warning from 'tiny-warning'\nimport {\n createControlledPromise,\n getLocationChangeInfo,\n isNotFound,\n isRedirect,\n rootRouteId,\n} from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useStore } from '@tanstack/vue-store'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { ClientOnly } from './ClientOnly'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound } from './not-found'\nimport {\n matchContext,\n pendingMatchContext,\n routeIdContext,\n} from './matchContext'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport type { VNode } from 'vue'\nimport type { AnyRoute, RootRouteOptions } from '@tanstack/router-core'\n\nexport const Match = Vue.defineComponent({\n name: 'Match',\n props: {\n matchId: {\n type: String,\n required: true,\n },\n },\n setup(props) {\n const router = useRouter()\n\n // Derive routeId from initial props.matchId — stable for this component's\n // lifetime. The routeId never changes for a given route position in the\n // tree, even when matchId changes (loaderDepsHash, etc).\n const routeId = router.stores.activeMatchStoresById.get(\n props.matchId,\n )?.routeId\n\n invariant(\n routeId,\n `Could not find routeId for matchId \"${props.matchId}\". Please file an issue!`,\n )\n\n // Static route-tree check: is this route a direct child of the root?\n // parentRoute is set at build time, so no reactive tracking needed.\n const isChildOfRoot =\n (router.routesById[routeId] as AnyRoute)?.parentRoute?.id === rootRouteId\n\n // Single stable store subscription — getMatchStoreByRouteId returns a\n // cached computed store that resolves routeId → current match state\n // through the signal graph. No bridge needed.\n const activeMatch = useStore(\n router.stores.getMatchStoreByRouteId(routeId),\n (value) => value,\n )\n const isPendingMatchRef = useStore(\n router.stores.pendingRouteIds,\n (pendingRouteIds) => Boolean(pendingRouteIds[routeId]),\n { equal: Object.is },\n )\n const loadedAt = useStore(router.stores.loadedAt, (value) => value)\n\n const matchData = Vue.computed(() => {\n const match = activeMatch.value\n if (!match) {\n return null\n }\n\n return {\n matchId: match.id,\n routeId,\n loadedAt: loadedAt.value,\n ssr: match.ssr,\n _displayPending: match._displayPending,\n }\n })\n\n const route = Vue.computed(() =>\n matchData.value ? router.routesById[matchData.value.routeId] : null,\n )\n\n const PendingComponent = Vue.computed(\n () =>\n route.value?.options?.pendingComponent ??\n router?.options?.defaultPendingComponent,\n )\n\n const pendingElement = Vue.computed(() =>\n PendingComponent.value ? Vue.h(PendingComponent.value) : undefined,\n )\n\n const routeErrorComponent = Vue.computed(\n () =>\n route.value?.options?.errorComponent ??\n router?.options?.defaultErrorComponent,\n )\n\n const routeOnCatch = Vue.computed(\n () => route.value?.options?.onCatch ?? router?.options?.defaultOnCatch,\n )\n\n const routeNotFoundComponent = Vue.computed(() =>\n route.value?.isRoot\n ? // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component\n (route.value?.options?.notFoundComponent ??\n router?.options?.notFoundRoute?.options?.component)\n : route.value?.options?.notFoundComponent,\n )\n\n const hasShellComponent = Vue.computed(() => {\n if (!route.value?.isRoot) return false\n return !!(route.value.options as RootRouteOptions).shellComponent\n })\n\n const ShellComponent = Vue.computed(() =>\n hasShellComponent.value\n ? ((route.value!.options as RootRouteOptions).shellComponent as any)\n : null,\n )\n\n // Provide routeId context (stable string) for children.\n // MatchInner, Outlet, and useMatch all consume this.\n Vue.provide(routeIdContext, routeId)\n\n // Provide reactive nearest-match context for hooks that slice the active\n // matches array relative to the current match.\n const matchIdRef = Vue.computed(\n () => activeMatch.value?.id ?? props.matchId,\n )\n Vue.provide(matchContext, matchIdRef)\n\n Vue.provide(pendingMatchContext, isPendingMatchRef)\n\n return (): VNode => {\n const actualMatchId = matchData.value?.matchId ?? props.matchId\n\n const resolvedNoSsr =\n matchData.value?.ssr === false || matchData.value?.ssr === 'data-only'\n const shouldClientOnly =\n resolvedNoSsr || !!matchData.value?._displayPending\n\n const renderMatchContent = (): VNode => {\n const matchInner = Vue.h(MatchInner, { matchId: actualMatchId })\n\n let content: VNode = shouldClientOnly\n ? Vue.h(\n ClientOnly,\n {\n fallback: pendingElement.value,\n },\n {\n default: () => matchInner,\n },\n )\n : matchInner\n\n // Wrap in NotFound boundary if needed\n if (routeNotFoundComponent.value) {\n content = Vue.h(CatchNotFound, {\n fallback: (error: any) => {\n // If the current not found handler doesn't exist or it has a\n // route ID which doesn't match the current route, rethrow the error\n if (\n !routeNotFoundComponent.value ||\n (error.routeId && error.routeId !== matchData.value?.routeId) ||\n (!error.routeId && route.value && !route.value.isRoot)\n )\n throw error\n\n return Vue.h(routeNotFoundComponent.value, error)\n },\n children: content,\n })\n }\n\n // Wrap in error boundary if needed\n if (routeErrorComponent.value) {\n content = CatchBoundary({\n getResetKey: () => matchData.value?.loadedAt ?? 0,\n errorComponent: routeErrorComponent.value || ErrorComponent,\n onCatch: (error: Error) => {\n // Forward not found errors (we don't want to show the error component for these)\n if (isNotFound(error)) throw error\n warning(false, `Error in route match: ${actualMatchId}`)\n routeOnCatch.value?.(error)\n },\n children: content,\n })\n }\n\n // Add scroll restoration if needed\n const withScrollRestoration: Array<VNode> = [\n content,\n isChildOfRoot && router.options.scrollRestoration\n ? Vue.h(Vue.Fragment, null, [\n Vue.h(OnRendered),\n Vue.h(ScrollRestoration),\n ])\n : null,\n ].filter(Boolean) as Array<VNode>\n\n // Return single child directly to avoid Fragment wrapper that causes hydration mismatch\n if (withScrollRestoration.length === 1) {\n return withScrollRestoration[0]!\n }\n\n return Vue.h(Vue.Fragment, null, withScrollRestoration)\n }\n\n if (!hasShellComponent.value) {\n return renderMatchContent()\n }\n\n return Vue.h(ShellComponent.value, null, {\n // Important: return a fresh VNode on each slot invocation so that shell\n // components can re-render without reusing a cached VNode instance.\n default: () => renderMatchContent(),\n })\n }\n },\n})\n\n// On Rendered can't happen above the root layout because it actually\n// renders a dummy dom element to track the rendered state of the app.\n// We render a script tag with a key that changes based on the current\n// location state.__TSR_key. Also, because it's below the root layout, it\n// allows us to fire onRendered events even after a hydration mismatch\n// error that occurred above the root layout (like bad head/link tags,\n// which is common).\nconst OnRendered = Vue.defineComponent({\n name: 'OnRendered',\n setup() {\n const router = useRouter()\n\n const location = useStore(\n router.stores.resolvedLocation,\n (resolvedLocation) => resolvedLocation?.state.__TSR_key,\n )\n\n let prevHref: string | undefined\n\n Vue.watch(\n location,\n () => {\n if (location.value) {\n const currentHref = router.latestLocation.href\n if (prevHref === undefined || prevHref !== currentHref) {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(\n router.stores.location.state,\n router.stores.resolvedLocation.state,\n ),\n })\n prevHref = currentHref\n }\n }\n },\n { immediate: true },\n )\n\n return () => null\n },\n})\n\nexport const MatchInner = Vue.defineComponent({\n name: 'MatchInner',\n props: {\n matchId: {\n type: String,\n required: true,\n },\n },\n setup(props) {\n const router = useRouter()\n\n // Use routeId from context (provided by parent Match) — stable string.\n const routeId = Vue.inject(routeIdContext)!\n const activeMatch = useStore(\n router.stores.getMatchStoreByRouteId(routeId),\n (value) => value,\n )\n\n // Combined selector for match state AND remount key\n // This ensures both are computed in the same selector call with consistent data\n const combinedState = Vue.computed(() => {\n const match = activeMatch.value\n if (!match) {\n // Route no longer exists - truly navigating away\n return null\n }\n\n const matchRouteId = match.routeId as string\n\n // Compute remount key\n const remountFn =\n (router.routesById[matchRouteId] as AnyRoute).options.remountDeps ??\n router.options.defaultRemountDeps\n\n let remountKey: string | undefined\n if (remountFn) {\n const remountDeps = remountFn({\n routeId: matchRouteId,\n loaderDeps: match.loaderDeps,\n params: match._strictParams,\n search: match._strictSearch,\n })\n remountKey = remountDeps ? JSON.stringify(remountDeps) : undefined\n }\n\n return {\n routeId: matchRouteId,\n match: {\n id: match.id,\n status: match.status,\n error: match.error,\n ssr: match.ssr,\n _forcePending: match._forcePending,\n _displayPending: match._displayPending,\n },\n remountKey,\n }\n })\n\n const route = Vue.computed(() => {\n if (!combinedState.value) return null\n return router.routesById[combinedState.value.routeId]!\n })\n\n const match = Vue.computed(() => combinedState.value?.match)\n const remountKey = Vue.computed(() => combinedState.value?.remountKey)\n\n return (): VNode | null => {\n // If match doesn't exist, return null (component is being unmounted or not ready)\n if (!combinedState.value || !match.value || !route.value) return null\n\n // Handle different match statuses\n if (match.value._displayPending) {\n const PendingComponent =\n route.value.options.pendingComponent ??\n router.options.defaultPendingComponent\n\n return PendingComponent ? Vue.h(PendingComponent) : null\n }\n\n if (match.value._forcePending) {\n const PendingComponent =\n route.value.options.pendingComponent ??\n router.options.defaultPendingComponent\n\n return PendingComponent ? Vue.h(PendingComponent) : null\n }\n\n if (match.value.status === 'notFound') {\n invariant(isNotFound(match.value.error), 'Expected a notFound error')\n return renderRouteNotFound(router, route.value, match.value.error)\n }\n\n if (match.value.status === 'redirected') {\n invariant(isRedirect(match.value.error), 'Expected a redirect error')\n throw router.getMatch(match.value.id)?._nonReactive.loadPromise\n }\n\n if (match.value.status === 'error') {\n // Check if this route or any parent has an error component\n const RouteErrorComponent =\n route.value.options.errorComponent ??\n router.options.defaultErrorComponent\n\n // If this route has an error component, render it directly\n // This is more reliable than relying on Vue's error boundary\n if (RouteErrorComponent) {\n return Vue.h(RouteErrorComponent, {\n error: match.value.error,\n reset: () => {\n router.invalidate()\n },\n info: {\n componentStack: '',\n },\n })\n }\n\n // If there's no error component for this route, throw the error\n // so it can bubble up to the nearest parent with an error component\n throw match.value.error\n }\n\n if (match.value.status === 'pending') {\n const pendingMinMs =\n route.value.options.pendingMinMs ?? router.options.defaultPendingMinMs\n\n const routerMatch = router.getMatch(match.value.id)\n if (\n pendingMinMs &&\n routerMatch &&\n !routerMatch._nonReactive.minPendingPromise\n ) {\n // Create a promise that will resolve after the minPendingMs\n if (!(isServer ?? router.isServer)) {\n const minPendingPromise = createControlledPromise<void>()\n\n routerMatch._nonReactive.minPendingPromise = minPendingPromise\n\n setTimeout(() => {\n minPendingPromise.resolve()\n // We've handled the minPendingPromise, so we can delete it\n routerMatch._nonReactive.minPendingPromise = undefined\n }, pendingMinMs)\n }\n }\n\n // In Vue, we render the pending component directly instead of throwing a promise\n // because Vue's Suspense doesn't catch thrown promises like React does\n const PendingComponent =\n route.value.options.pendingComponent ??\n router.options.defaultPendingComponent\n\n if (PendingComponent) {\n return Vue.h(PendingComponent)\n }\n\n // If no pending component, return null while loading\n return null\n }\n\n // Success status - render the component with remount key\n const Comp =\n route.value.options.component ?? router.options.defaultComponent\n const key = remountKey.value\n\n if (Comp) {\n // Pass key as a prop - Vue.h properly handles 'key' as a special prop\n return Vue.h(Comp, key !== undefined ? { key } : undefined)\n }\n\n return Vue.h(Outlet, key !== undefined ? { key } : undefined)\n }\n },\n})\n\nexport const Outlet = Vue.defineComponent({\n name: 'Outlet',\n setup() {\n const router = useRouter()\n const parentRouteId = Vue.inject(routeIdContext)\n\n if (!parentRouteId) {\n return (): VNode | null => null\n }\n\n // Parent state via stable routeId store — single subscription\n const parentMatch = useStore(\n router.stores.getMatchStoreByRouteId(parentRouteId),\n (v) => v,\n )\n\n const route = Vue.computed(() =>\n parentMatch.value\n ? router.routesById[parentMatch.value.routeId as string]!\n : undefined,\n )\n\n const parentGlobalNotFound = Vue.computed(\n () => parentMatch.value?.globalNotFound ?? false,\n )\n\n // Child match lookup: read the child matchId from the shared derived\n // map (one reactive node for the whole tree), then grab match state\n // directly from the pool.\n const childMatchIdMap = useStore(\n router.stores.childMatchIdByRouteId,\n (v) => v,\n )\n\n const childMatchData = Vue.computed(() => {\n const childId = childMatchIdMap.value[parentRouteId]\n if (!childId) return null\n const child = router.stores.activeMatchStoresById.get(childId)?.state\n if (!child) return null\n\n return {\n id: child.id,\n // Key based on routeId + params only (not loaderDeps)\n // This ensures component recreates when params change,\n // but NOT when only loaderDeps change\n paramsKey: child.routeId + JSON.stringify(child._strictParams),\n }\n })\n\n return (): VNode | null => {\n if (parentGlobalNotFound.value) {\n if (!route.value) {\n return null\n }\n return renderRouteNotFound(router, route.value, undefined)\n }\n\n if (!childMatchData.value) {\n return null\n }\n\n const nextMatch = Vue.h(Match, {\n matchId: childMatchData.value.id,\n key: childMatchData.value.paramsKey,\n })\n\n // Note: We intentionally do NOT wrap in Suspense here.\n // The top-level Suspense in Matches already covers the root.\n // The old code compared matchId (e.g. \"__root__/\") with rootRouteId (\"__root__\")\n // which never matched, so this Suspense was effectively dead code.\n // With routeId-based lookup, parentRouteId === rootRouteId would match,\n // causing a double-Suspense that corrupts Vue's DOM during updates.\n return nextMatch\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;AA0BA,IAAaoB,QAAQpB,IAAIqB,gBAAgB;CACvCC,MAAM;CACNC,OAAO,EACLC,SAAS;EACPC,MAAMC;EACNC,UAAU;EACZ,EACD;CACDC,MAAML,OAAO;EACX,MAAMM,SAAShB,WAAW;EAK1B,MAAMiB,UAAUD,OAAOE,OAAOC,sBAAsBC,IAClDV,MAAMC,QACP,EAAEM;AAEH7B,YACE6B,SACA,uCAAuCP,MAAMC,QAAO,0BACrD;EAID,MAAMU,gBACHL,OAAOM,WAAWL,UAAuBM,aAAaC,OAAO9B;EAKhE,MAAM+B,cAAc7B,SAClBoB,OAAOE,OAAOQ,uBAAuBT,QAAQ,GAC5CU,UAAUA,MACZ;EACD,MAAMC,oBAAoBhC,SACxBoB,OAAOE,OAAOW,kBACbA,oBAAoBC,QAAQD,gBAAgBZ,SAAS,EACtD,EAAEc,OAAOC,OAAOC,IAClB,CAAC;EACD,MAAMC,WAAWtC,SAASoB,OAAOE,OAAOgB,WAAWP,UAAUA,MAAM;EAEnE,MAAMQ,YAAYhD,IAAIiD,eAAe;GACnC,MAAMC,QAAQZ,Y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U;;AAG5D,OAAI,CAACuF,eAAe3G,MAClB,QAAO;AAcT,UAXkBxC,IAAI2D,EAAEvC,OAAO;IAC7BI,SAAS2H,eAAe3G,MAAMH;IAC9BqG,KAAKS,eAAe3G,MAAM8G;IAC3B,CAAC;;;CAWP,CAAC"}
|
|
1
|
+
{"version":3,"file":"Match.js","names":["Vue","createControlledPromise","getLocationChangeInfo","invariant","isNotFound","isRedirect","rootRouteId","isServer","useStore","CatchBoundary","ErrorComponent","ClientOnly","useRouter","CatchNotFound","matchContext","pendingMatchContext","routeIdContext","renderRouteNotFound","ScrollRestoration","Match","defineComponent","name","props","matchId","type","String","required","setup","router","routeId","stores","activeMatchStoresById","get","process","env","NODE_ENV","Error","isChildOfRoot","routesById","parentRoute","id","activeMatch","getMatchStoreByRouteId","value","isPendingMatchRef","pendingRouteIds","Boolean","equal","Object","is","loadedAt","matchData","computed","match","ssr","_displayPending","route","PendingComponent","options","pendingComponent","defaultPendingComponent","pendingElement","h","undefined","routeErrorComponent","errorComponent","defaultErrorComponent","routeOnCatch","onCatch","defaultOnCatch","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","hasShellComponent","shellComponent","ShellComponent","provide","matchIdRef","actualMatchId","resolvedNoSsr","shouldClientOnly","renderMatchContent","matchInner","MatchInner","content","fallback","default","error","children","getResetKey","console","warn","withScrollRestoration","scrollRestoration","Fragment","OnRendered","filter","length","location","resolvedLocation","state","__TSR_key","prevHref","watch","currentHref","latestLocation","href","emit","immediate","inject","combinedState","matchRouteId","remountFn","remountDeps","defaultRemountDeps","remountKey","loaderDeps","params","_strictParams","search","_strictSearch","JSON","stringify","status","_forcePending","getMatch","_nonReactive","loadPromise","RouteErrorComponent","reset","invalidate","info","componentStack","pendingMinMs","defaultPendingMinMs","routerMatch","minPendingPromise","setTimeout","resolve","Comp","defaultComponent","key","Outlet","parentRouteId","parentMatch","v","parentGlobalNotFound","globalNotFound","childMatchIdMap","childMatchIdByRouteId","childMatchData","childId","child","paramsKey","nextMatch"],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport {\n createControlledPromise,\n getLocationChangeInfo,\n invariant,\n isNotFound,\n isRedirect,\n rootRouteId,\n} from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useStore } from '@tanstack/vue-store'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { ClientOnly } from './ClientOnly'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound } from './not-found'\nimport {\n matchContext,\n pendingMatchContext,\n routeIdContext,\n} from './matchContext'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport type { VNode } from 'vue'\nimport type { AnyRoute, RootRouteOptions } from '@tanstack/router-core'\n\nexport const Match = Vue.defineComponent({\n name: 'Match',\n props: {\n matchId: {\n type: String,\n required: true,\n },\n },\n setup(props) {\n const router = useRouter()\n\n // Derive routeId from initial props.matchId — stable for this component's\n // lifetime. The routeId never changes for a given route position in the\n // tree, even when matchId changes (loaderDepsHash, etc).\n const routeId = router.stores.activeMatchStoresById.get(\n props.matchId,\n )?.routeId\n\n if (!routeId) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Invariant failed: Could not find routeId for matchId \"${props.matchId}\". Please file an issue!`,\n )\n }\n\n invariant()\n }\n\n // Static route-tree check: is this route a direct child of the root?\n // parentRoute is set at build time, so no reactive tracking needed.\n const isChildOfRoot =\n (router.routesById[routeId] as AnyRoute)?.parentRoute?.id === rootRouteId\n\n // Single stable store subscription — getMatchStoreByRouteId returns a\n // cached computed store that resolves routeId → current match state\n // through the signal graph. No bridge needed.\n const activeMatch = useStore(\n router.stores.getMatchStoreByRouteId(routeId),\n (value) => value,\n )\n const isPendingMatchRef = useStore(\n router.stores.pendingRouteIds,\n (pendingRouteIds) => Boolean(pendingRouteIds[routeId]),\n { equal: Object.is },\n )\n const loadedAt = useStore(router.stores.loadedAt, (value) => value)\n\n const matchData = Vue.computed(() => {\n const match = activeMatch.value\n if (!match) {\n return null\n }\n\n return {\n matchId: match.id,\n routeId,\n loadedAt: loadedAt.value,\n ssr: match.ssr,\n _displayPending: match._displayPending,\n }\n })\n\n const route = Vue.computed(() =>\n matchData.value ? router.routesById[matchData.value.routeId] : null,\n )\n\n const PendingComponent = Vue.computed(\n () =>\n route.value?.options?.pendingComponent ??\n router?.options?.defaultPendingComponent,\n )\n\n const pendingElement = Vue.computed(() =>\n PendingComponent.value ? Vue.h(PendingComponent.value) : undefined,\n )\n\n const routeErrorComponent = Vue.computed(\n () =>\n route.value?.options?.errorComponent ??\n router?.options?.defaultErrorComponent,\n )\n\n const routeOnCatch = Vue.computed(\n () => route.value?.options?.onCatch ?? router?.options?.defaultOnCatch,\n )\n\n const routeNotFoundComponent = Vue.computed(() =>\n route.value?.isRoot\n ? // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component\n (route.value?.options?.notFoundComponent ??\n router?.options?.notFoundRoute?.options?.component)\n : route.value?.options?.notFoundComponent,\n )\n\n const hasShellComponent = Vue.computed(() => {\n if (!route.value?.isRoot) return false\n return !!(route.value.options as RootRouteOptions).shellComponent\n })\n\n const ShellComponent = Vue.computed(() =>\n hasShellComponent.value\n ? ((route.value!.options as RootRouteOptions).shellComponent as any)\n : null,\n )\n\n // Provide routeId context (stable string) for children.\n // MatchInner, Outlet, and useMatch all consume this.\n Vue.provide(routeIdContext, routeId)\n\n // Provide reactive nearest-match context for hooks that slice the active\n // matches array relative to the current match.\n const matchIdRef = Vue.computed(\n () => activeMatch.value?.id ?? props.matchId,\n )\n Vue.provide(matchContext, matchIdRef)\n\n Vue.provide(pendingMatchContext, isPendingMatchRef)\n\n return (): VNode => {\n const actualMatchId = matchData.value?.matchId ?? props.matchId\n\n const resolvedNoSsr =\n matchData.value?.ssr === false || matchData.value?.ssr === 'data-only'\n const shouldClientOnly =\n resolvedNoSsr || !!matchData.value?._displayPending\n\n const renderMatchContent = (): VNode => {\n const matchInner = Vue.h(MatchInner, { matchId: actualMatchId })\n\n let content: VNode = shouldClientOnly\n ? Vue.h(\n ClientOnly,\n {\n fallback: pendingElement.value,\n },\n {\n default: () => matchInner,\n },\n )\n : matchInner\n\n // Wrap in NotFound boundary if needed\n if (routeNotFoundComponent.value) {\n content = Vue.h(CatchNotFound, {\n fallback: (error: any) => {\n // If the current not found handler doesn't exist or it has a\n // route ID which doesn't match the current route, rethrow the error\n if (\n !routeNotFoundComponent.value ||\n (error.routeId && error.routeId !== matchData.value?.routeId) ||\n (!error.routeId && route.value && !route.value.isRoot)\n )\n throw error\n\n return Vue.h(routeNotFoundComponent.value, error)\n },\n children: content,\n })\n }\n\n // Wrap in error boundary if needed\n if (routeErrorComponent.value) {\n content = CatchBoundary({\n getResetKey: () => matchData.value?.loadedAt ?? 0,\n errorComponent: routeErrorComponent.value || ErrorComponent,\n onCatch: (error: Error) => {\n // Forward not found errors (we don't want to show the error component for these)\n if (isNotFound(error)) throw error\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Warning: Error in route match: ${actualMatchId}`)\n }\n routeOnCatch.value?.(error)\n },\n children: content,\n })\n }\n\n // Add scroll restoration if needed\n const withScrollRestoration: Array<VNode> = [\n content,\n isChildOfRoot && router.options.scrollRestoration\n ? Vue.h(Vue.Fragment, null, [\n Vue.h(OnRendered),\n Vue.h(ScrollRestoration),\n ])\n : null,\n ].filter(Boolean) as Array<VNode>\n\n // Return single child directly to avoid Fragment wrapper that causes hydration mismatch\n if (withScrollRestoration.length === 1) {\n return withScrollRestoration[0]!\n }\n\n return Vue.h(Vue.Fragment, null, withScrollRestoration)\n }\n\n if (!hasShellComponent.value) {\n return renderMatchContent()\n }\n\n return Vue.h(ShellComponent.value, null, {\n // Important: return a fresh VNode on each slot invocation so that shell\n // components can re-render without reusing a cached VNode instance.\n default: () => renderMatchContent(),\n })\n }\n },\n})\n\n// On Rendered can't happen above the root layout because it actually\n// renders a dummy dom element to track the rendered state of the app.\n// We render a script tag with a key that changes based on the current\n// location state.__TSR_key. Also, because it's below the root layout, it\n// allows us to fire onRendered events even after a hydration mismatch\n// error that occurred above the root layout (like bad head/link tags,\n// which is common).\nconst OnRendered = Vue.defineComponent({\n name: 'OnRendered',\n setup() {\n const router = useRouter()\n\n const location = useStore(\n router.stores.resolvedLocation,\n (resolvedLocation) => resolvedLocation?.state.__TSR_key,\n )\n\n let prevHref: string | undefined\n\n Vue.watch(\n location,\n () => {\n if (location.value) {\n const currentHref = router.latestLocation.href\n if (prevHref === undefined || prevHref !== currentHref) {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(\n router.stores.location.state,\n router.stores.resolvedLocation.state,\n ),\n })\n prevHref = currentHref\n }\n }\n },\n { immediate: true },\n )\n\n return () => null\n },\n})\n\nexport const MatchInner = Vue.defineComponent({\n name: 'MatchInner',\n props: {\n matchId: {\n type: String,\n required: true,\n },\n },\n setup(props) {\n const router = useRouter()\n\n // Use routeId from context (provided by parent Match) — stable string.\n const routeId = Vue.inject(routeIdContext)!\n const activeMatch = useStore(\n router.stores.getMatchStoreByRouteId(routeId),\n (value) => value,\n )\n\n // Combined selector for match state AND remount key\n // This ensures both are computed in the same selector call with consistent data\n const combinedState = Vue.computed(() => {\n const match = activeMatch.value\n if (!match) {\n // Route no longer exists - truly navigating away\n return null\n }\n\n const matchRouteId = match.routeId as string\n\n // Compute remount key\n const remountFn =\n (router.routesById[matchRouteId] as AnyRoute).options.remountDeps ??\n router.options.defaultRemountDeps\n\n let remountKey: string | undefined\n if (remountFn) {\n const remountDeps = remountFn({\n routeId: matchRouteId,\n loaderDeps: match.loaderDeps,\n params: match._strictParams,\n search: match._strictSearch,\n })\n remountKey = remountDeps ? JSON.stringify(remountDeps) : undefined\n }\n\n return {\n routeId: matchRouteId,\n match: {\n id: match.id,\n status: match.status,\n error: match.error,\n ssr: match.ssr,\n _forcePending: match._forcePending,\n _displayPending: match._displayPending,\n },\n remountKey,\n }\n })\n\n const route = Vue.computed(() => {\n if (!combinedState.value) return null\n return router.routesById[combinedState.value.routeId]!\n })\n\n const match = Vue.computed(() => combinedState.value?.match)\n const remountKey = Vue.computed(() => combinedState.value?.remountKey)\n\n return (): VNode | null => {\n // If match doesn't exist, return null (component is being unmounted or not ready)\n if (!combinedState.value || !match.value || !route.value) return null\n\n // Handle different match statuses\n if (match.value._displayPending) {\n const PendingComponent =\n route.value.options.pendingComponent ??\n router.options.defaultPendingComponent\n\n return PendingComponent ? Vue.h(PendingComponent) : null\n }\n\n if (match.value._forcePending) {\n const PendingComponent =\n route.value.options.pendingComponent ??\n router.options.defaultPendingComponent\n\n return PendingComponent ? Vue.h(PendingComponent) : null\n }\n\n if (match.value.status === 'notFound') {\n if (!isNotFound(match.value.error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Invariant failed: Expected a notFound error')\n }\n\n invariant()\n }\n return renderRouteNotFound(router, route.value, match.value.error)\n }\n\n if (match.value.status === 'redirected') {\n if (!isRedirect(match.value.error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Invariant failed: Expected a redirect error')\n }\n\n invariant()\n }\n throw router.getMatch(match.value.id)?._nonReactive.loadPromise\n }\n\n if (match.value.status === 'error') {\n // Check if this route or any parent has an error component\n const RouteErrorComponent =\n route.value.options.errorComponent ??\n router.options.defaultErrorComponent\n\n // If this route has an error component, render it directly\n // This is more reliable than relying on Vue's error boundary\n if (RouteErrorComponent) {\n return Vue.h(RouteErrorComponent, {\n error: match.value.error,\n reset: () => {\n router.invalidate()\n },\n info: {\n componentStack: '',\n },\n })\n }\n\n // If there's no error component for this route, throw the error\n // so it can bubble up to the nearest parent with an error component\n throw match.value.error\n }\n\n if (match.value.status === 'pending') {\n const pendingMinMs =\n route.value.options.pendingMinMs ?? router.options.defaultPendingMinMs\n\n const routerMatch = router.getMatch(match.value.id)\n if (\n pendingMinMs &&\n routerMatch &&\n !routerMatch._nonReactive.minPendingPromise\n ) {\n // Create a promise that will resolve after the minPendingMs\n if (!(isServer ?? router.isServer)) {\n const minPendingPromise = createControlledPromise<void>()\n\n routerMatch._nonReactive.minPendingPromise = minPendingPromise\n\n setTimeout(() => {\n minPendingPromise.resolve()\n // We've handled the minPendingPromise, so we can delete it\n routerMatch._nonReactive.minPendingPromise = undefined\n }, pendingMinMs)\n }\n }\n\n // In Vue, we render the pending component directly instead of throwing a promise\n // because Vue's Suspense doesn't catch thrown promises like React does\n const PendingComponent =\n route.value.options.pendingComponent ??\n router.options.defaultPendingComponent\n\n if (PendingComponent) {\n return Vue.h(PendingComponent)\n }\n\n // If no pending component, return null while loading\n return null\n }\n\n // Success status - render the component with remount key\n const Comp =\n route.value.options.component ?? router.options.defaultComponent\n const key = remountKey.value\n\n if (Comp) {\n // Pass key as a prop - Vue.h properly handles 'key' as a special prop\n return Vue.h(Comp, key !== undefined ? { key } : undefined)\n }\n\n return Vue.h(Outlet, key !== undefined ? { key } : undefined)\n }\n },\n})\n\nexport const Outlet = Vue.defineComponent({\n name: 'Outlet',\n setup() {\n const router = useRouter()\n const parentRouteId = Vue.inject(routeIdContext)\n\n if (!parentRouteId) {\n return (): VNode | null => null\n }\n\n // Parent state via stable routeId store — single subscription\n const parentMatch = useStore(\n router.stores.getMatchStoreByRouteId(parentRouteId),\n (v) => v,\n )\n\n const route = Vue.computed(() =>\n parentMatch.value\n ? router.routesById[parentMatch.value.routeId as string]!\n : undefined,\n )\n\n const parentGlobalNotFound = Vue.computed(\n () => parentMatch.value?.globalNotFound ?? false,\n )\n\n // Child match lookup: read the child matchId from the shared derived\n // map (one reactive node for the whole tree), then grab match state\n // directly from the pool.\n const childMatchIdMap = useStore(\n router.stores.childMatchIdByRouteId,\n (v) => v,\n )\n\n const childMatchData = Vue.computed(() => {\n const childId = childMatchIdMap.value[parentRouteId]\n if (!childId) return null\n const child = router.stores.activeMatchStoresById.get(childId)?.state\n if (!child) return null\n\n return {\n id: child.id,\n // Key based on routeId + params only (not loaderDeps)\n // This ensures component recreates when params change,\n // but NOT when only loaderDeps change\n paramsKey: child.routeId + JSON.stringify(child._strictParams),\n }\n })\n\n return (): VNode | null => {\n if (parentGlobalNotFound.value) {\n if (!route.value) {\n return null\n }\n return renderRouteNotFound(router, route.value, undefined)\n }\n\n if (!childMatchData.value) {\n return null\n }\n\n const nextMatch = Vue.h(Match, {\n matchId: childMatchData.value.id,\n key: childMatchData.value.paramsKey,\n })\n\n // Note: We intentionally do NOT wrap in Suspense here.\n // The top-level Suspense in Matches already covers the root.\n // The old code compared matchId (e.g. \"__root__/\") with rootRouteId (\"__root__\")\n // which never matched, so this Suspense was effectively dead code.\n // With routeId-based lookup, parentRouteId === rootRouteId would match,\n // causing a double-Suspense that corrupts Vue's DOM during updates.\n return nextMatch\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;AAyBA,IAAamB,QAAQnB,IAAIoB,gBAAgB;CACvCC,MAAM;CACNC,OAAO,EACLC,SAAS;EACPC,MAAMC;EACNC,UAAU;EACZ,EACD;CACDC,MAAML,OAAO;EACX,MAAMM,SAAShB,WAAW;EAK1B,MAAMiB,UAAUD,OAAOE,OAAOC,sBAAsBC,IAClDV,MAAMC,QACP,EAAEM;AAEH,MAAI,CAACA,SAAS;AACZ,OAAA,QAAA,IAAA,aAA6B,aAC3B,OAAM,IAAIO,MACR,yDAAyDd,MAAMC,QAAO,0BACvE;AAGHpB,cAAW;;EAKb,MAAMkC,gBACHT,OAAOU,WAAWT,UAAuBU,aAAaC,OAAOlC;EAKhE,MAAMmC,cAAcjC,SAClBoB,OAAOE,OAAOY,uBAAuBb,QAAQ,GAC5Cc,UAAUA,MACZ;EACD,MAAMC,oBAAoBpC,SACxBoB,OAAOE,OAAOe,kBACbA,oBAAoBC,QAAQD,gBAAgBhB,SAAS,EACtD,EAAEkB,OAAOC,OAAOC,IAClB,CAAC;EACD,MAAMC,WAAW1C,SAASoB,OAAOE,OAAOoB,WAAWP,UAAUA,MAAM;EAEnE,MAAMQ,YAAYnD,IAAIoD,eAAe;GACnC,MAAMC,QAAQZ,YAAYE;AAC1B,OAAI,CAACU,MACH,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MAAMlC,cAAa;IAC9D;IACD;AAEF,eAA2B;AACzB,OAAI4B,qBAAqBzG,OAAO;AAC9B,QAAI,CAACa,MAAMb,MACT,QAAO;AAET,WAAO1B,oBAAoBW,QAAQ4B,MAAMb,OAAOoB,KAAAA,EAAU;;AAG5D,OAAI,CAACyF,eAAe7G,MAClB,QAAO;AAcT,UAXkB3C,IAAI8D,EAAE3C,OAAO;IAC7BI,SAASiI,eAAe7G,MAAMH;IAC9BuG,KAAKS,eAAe7G,MAAMgH;IAC3B,CAAC;;;CAWP,CAAC"}
|
package/dist/esm/Matches.js
CHANGED
|
@@ -4,7 +4,6 @@ import { matchContext } from "./matchContext.js";
|
|
|
4
4
|
import { Match } from "./Match.js";
|
|
5
5
|
import { useTransitionerSetup } from "./Transitioner.js";
|
|
6
6
|
import * as Vue from "vue";
|
|
7
|
-
import warning from "tiny-warning";
|
|
8
7
|
import { isServer } from "@tanstack/router-core/isServer";
|
|
9
8
|
import { useStore } from "@tanstack/vue-store";
|
|
10
9
|
//#region src/Matches.tsx
|
|
@@ -48,8 +47,8 @@ var MatchesInner = Vue.defineComponent({
|
|
|
48
47
|
getResetKey: () => resetKey.value,
|
|
49
48
|
errorComponent: errorComponentFn,
|
|
50
49
|
onCatch: process.env.NODE_ENV !== "production" ? (error) => {
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
console.warn(`Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`);
|
|
51
|
+
console.warn(`Warning: ${error.message || error.toString()}`);
|
|
53
52
|
} : void 0,
|
|
54
53
|
children: childElement
|
|
55
54
|
});
|
package/dist/esm/Matches.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Matches.js","names":["Vue","warning","isServer","useStore","CatchBoundary","useRouter","useTransitionerSetup","matchContext","Match","MatchesContent","defineComponent","name","setup","h","MatchesInner","Matches","router","pendingElement","options","defaultPendingComponent","inner","document","ssr","Suspense","fallback","default","InnerWrap","errorComponentFn","props","class","error","message","String","onClick","reset","matchId","stores","firstMatchId","id","resetKey","loadedAt","matchIdRef","computed","value","provide","childElement","disableGlobalCatchBoundary","getResetKey","errorComponent","onCatch","process","env","NODE_ENV","toString","undefined","children","useMatchRoute","routerState","matchRouteReactivity","opts","pending","caseSensitive","fuzzy","includeSearch","rest","matchRoute","MatchRoute","from","type","required","to","Boolean","slots","status","params","Fragment","useMatches","activeMatchesSnapshot","matches","select","useParentMatches","contextMatchId","inject","safeMatchId","slice","findIndex","d","useChildMatches"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport warning from 'tiny-warning'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useStore } from '@tanstack/vue-store'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { useTransitionerSetup } from './Transitioner'\nimport { matchContext } from './matchContext'\nimport { Match } from './Match'\nimport type {\n AnyRouter,\n DeepPartial,\n ErrorComponentProps,\n MakeOptionalPathParams,\n MakeOptionalSearchParams,\n MakeRouteMatchUnion,\n MaskOptions,\n MatchRouteOptions,\n NoInfer,\n RegisteredRouter,\n ResolveRelativePath,\n ResolveRoute,\n RouteByPath,\n ToSubOptionsProps,\n} from '@tanstack/router-core'\n\n// Define a type for the error component function\ntype ErrorRouteComponentType = (props: ErrorComponentProps) => Vue.VNode\n\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<Vue.ComponentOptions['meta'] | undefined>\n links?: Array<Vue.ComponentOptions['link'] | undefined>\n scripts?: Array<Vue.ComponentOptions['script'] | undefined>\n headScripts?: Array<Vue.ComponentOptions['script'] | undefined>\n }\n}\n\n// Create a component that renders MatchesInner with Transitioner's setup logic inlined.\n// This is critical for proper hydration - we call useTransitionerSetup() as a composable\n// rather than rendering it as a component, which avoids Fragment/element mismatches.\nconst MatchesContent = Vue.defineComponent({\n name: 'MatchesContent',\n setup() {\n // IMPORTANT: We need to ensure Transitioner's setup() runs.\n // Transitioner sets up critical functionality:\n // - router.startTransition\n // - History subscription via router.history.subscribe(router.load)\n // - Watchers for router events\n //\n // We inline Transitioner's setup logic here. Since Transitioner returns null,\n // we can call its setup function directly without affecting the render tree.\n // This is done by importing and calling useTransitionerSetup.\n useTransitionerSetup()\n\n return () => Vue.h(MatchesInner)\n },\n})\n\nexport const Matches = Vue.defineComponent({\n name: 'Matches',\n setup() {\n const router = useRouter()\n\n return () => {\n const pendingElement = router?.options?.defaultPendingComponent\n ? Vue.h(router.options.defaultPendingComponent)\n : null\n\n // Do not render a root Suspense during SSR or hydrating from SSR\n const inner =\n (isServer ?? router?.isServer ?? false) ||\n (typeof document !== 'undefined' && router?.ssr)\n ? Vue.h(MatchesContent)\n : Vue.h(\n Vue.Suspense,\n { fallback: pendingElement },\n {\n default: () => Vue.h(MatchesContent),\n },\n )\n\n return router?.options?.InnerWrap\n ? Vue.h(router.options.InnerWrap, null, { default: () => inner })\n : inner\n }\n },\n})\n\n// Create a simple error component function that matches ErrorRouteComponent\nconst errorComponentFn: ErrorRouteComponentType = (\n props: ErrorComponentProps,\n) => {\n return Vue.h('div', { class: 'error' }, [\n Vue.h('h1', null, 'Error'),\n Vue.h('p', null, props.error.message || String(props.error)),\n Vue.h('button', { onClick: props.reset }, 'Try Again'),\n ])\n}\n\nconst MatchesInner = Vue.defineComponent({\n name: 'MatchesInner',\n setup() {\n const router = useRouter()\n\n const matchId = useStore(router.stores.firstMatchId, (id) => id)\n const resetKey = useStore(router.stores.loadedAt, (loadedAt) => loadedAt)\n\n // Create a ref for the match id to provide\n const matchIdRef = Vue.computed(() => matchId.value)\n\n // Provide the matchId for child components using the InjectionKey\n Vue.provide(matchContext, matchIdRef)\n\n return () => {\n // Generate a placeholder element if matchId.value is not present\n const childElement = matchId.value\n ? Vue.h(Match, { matchId: matchId.value })\n : Vue.h('div')\n\n // If disableGlobalCatchBoundary is true, don't wrap in CatchBoundary\n if (router.options.disableGlobalCatchBoundary) {\n return childElement\n }\n\n return Vue.h(CatchBoundary, {\n getResetKey: () => resetKey.value,\n errorComponent: errorComponentFn,\n onCatch:\n process.env.NODE_ENV !== 'production'\n ? (error: Error) => {\n warning(\n false,\n `The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,\n )\n warning(false, error.message || error.toString())\n }\n : undefined,\n children: childElement,\n })\n }\n },\n})\n\nexport type UseMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = ToSubOptionsProps<TRouter, TFrom, TTo> &\n DeepPartial<MakeOptionalSearchParams<TRouter, TFrom, TTo>> &\n DeepPartial<MakeOptionalPathParams<TRouter, TFrom, TTo>> &\n MaskOptions<TRouter, TMaskFrom, TMaskTo> &\n MatchRouteOptions\n\nexport function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>() {\n const router = useRouter()\n\n const routerState = useStore(\n router.stores.matchRouteReactivity,\n (value) => value,\n )\n\n return <\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n >(\n opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n ): Vue.Ref<\n false | ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']\n > => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n const matchRoute = Vue.computed(() => {\n // Access routerState to establish dependency\n\n routerState.value\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\n\n return matchRoute\n }\n}\n\nexport type MakeMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | ((\n params?: RouteByPath<\n TRouter['routeTree'],\n ResolveRelativePath<TFrom, NoInfer<TTo>>\n >['types']['allParams'],\n ) => Vue.VNode)\n | Vue.VNode\n}\n\n// Create a type for the MatchRoute component that includes the generics\nexport interface MatchRouteComponentType {\n <\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n >(\n props: MakeMatchRouteOptions<TRouter, TFrom, TTo>,\n ): Vue.VNode\n new (): {\n $props: {\n from?: string\n to?: string\n fuzzy?: boolean\n caseSensitive?: boolean\n includeSearch?: boolean\n pending?: boolean\n }\n }\n}\n\nexport const MatchRoute = Vue.defineComponent({\n name: 'MatchRoute',\n props: {\n // Define props to match MakeMatchRouteOptions\n from: {\n type: String,\n required: false,\n },\n to: {\n type: String,\n required: false,\n },\n fuzzy: {\n type: Boolean,\n required: false,\n },\n caseSensitive: {\n type: Boolean,\n required: false,\n },\n includeSearch: {\n type: Boolean,\n required: false,\n },\n pending: {\n type: Boolean,\n required: false,\n },\n },\n setup(props, { slots }) {\n const router = useRouter()\n const status = useStore(\n router.stores.matchRouteReactivity,\n (value) => value.status,\n )\n\n return () => {\n if (!status.value) return null\n\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any).value as boolean\n\n // Create a component that renders the slot in a reactive manner\n if (!params || !slots.default) {\n return null\n }\n\n // For function slots, pass the params\n if (typeof slots.default === 'function') {\n // Use h to create a wrapper component that will call the slot function\n return Vue.h(Vue.Fragment, null, slots.default(params))\n }\n\n // For normal slots, just render them\n return Vue.h(Vue.Fragment, null, slots.default)\n }\n },\n}) as unknown as MatchRouteComponentType\n\nexport interface UseMatchesBaseOptions<TRouter extends AnyRouter, TSelected> {\n select?: (matches: Array<MakeRouteMatchUnion<TRouter>>) => TSelected\n}\n\nexport type UseMatchesResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? Array<MakeRouteMatchUnion<TRouter>> : TSelected\n\nexport function useMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Vue.Ref<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return useStore(router.stores.activeMatchesSnapshot, (matches) => {\n return opts?.select\n ? opts.select(matches as Array<MakeRouteMatchUnion<TRouter>>)\n : (matches as any)\n })\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Vue.Ref<UseMatchesResult<TRouter, TSelected>> {\n // Use matchContext with proper type\n const contextMatchId = Vue.inject<Vue.Ref<string | undefined>>(matchContext)\n const safeMatchId = Vue.computed(() => contextMatchId?.value || '')\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n 0,\n matches.findIndex((d) => d.id === safeMatchId.value),\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n\nexport function useChildMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Vue.Ref<UseMatchesResult<TRouter, TSelected>> {\n // Use matchContext with proper type\n const contextMatchId = Vue.inject<Vue.Ref<string | undefined>>(matchContext)\n const safeMatchId = Vue.computed(() => contextMatchId?.value || '')\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n matches.findIndex((d) => d.id === safeMatchId.value) + 1,\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n"],"mappings":";;;;;;;;;;AAyCA,IAAMS,iBAAiBT,IAAIU,gBAAgB;CACzCC,MAAM;CACNC,QAAQ;AAUNN,wBAAsB;AAEtB,eAAaN,IAAIa,EAAEC,aAAa;;CAEnC,CAAC;AAEF,IAAaC,UAAUf,IAAIU,gBAAgB;CACzCC,MAAM;CACNC,QAAQ;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YAAY,WAE3B,QAAOzB,IAAIa,EAAEb,IAAI2E,UAAU,MAAMH,MAAM/C,QAAQiD,OAAO,CAAC;AAIzD,UAAO1E,IAAIa,EAAEb,IAAI2E,UAAU,MAAMH,MAAM/C,QAAQ;;;CAGpD,CAAuC;AAWxC,SAAgBmD,WAIdjB,MAC+C;AAE/C,QAAOxD,SADQE,WAAoB,CACZ+B,OAAOyC,wBAAwBC,YAAY;AAChE,SAAOnB,MAAMoB,SACTpB,KAAKoB,OAAOD,QAA+C,GAC1DA;GACL;;AAGJ,SAAgBE,iBAIdrB,MAC+C;CAE/C,MAAMsB,iBAAiBjF,IAAIkF,OAAoC3E,aAAa;CAC5E,MAAM4E,cAAcnF,IAAI0C,eAAeuC,gBAAgBtC,SAAS,GAAG;AAEnE,QAAOiC,WAAW,EAChBG,SAASD,YAAiD;AACxDA,YAAUA,QAAQM,MAChB,GACAN,QAAQO,WAAWC,MAAMA,EAAEhD,OAAO6C,YAAYxC,MAChD,CAAC;AACD,SAAOgB,MAAMoB,SAASpB,KAAKoB,OAAOD,QAAQ,GAAGA;IAEzC,CAAC;;AAGX,SAAgBS,gBAId5B,MAC+C;CAE/C,MAAMsB,iBAAiBjF,IAAIkF,OAAoC3E,aAAa;CAC5E,MAAM4E,cAAcnF,IAAI0C,eAAeuC,gBAAgBtC,SAAS,GAAG;AAEnE,QAAOiC,WAAW,EAChBG,SAASD,YAAiD;AACxDA,YAAUA,QAAQM,MAChBN,QAAQO,WAAWC,MAAMA,EAAEhD,OAAO6C,YAAYxC,MAAM,GAAG,EACxD;AACD,SAAOgB,MAAMoB,SAASpB,KAAKoB,OAAOD,QAAQ,GAAGA;IAEzC,CAAC"}
|
|
1
|
+
{"version":3,"file":"Matches.js","names":["Vue","isServer","useStore","CatchBoundary","useRouter","useTransitionerSetup","matchContext","Match","MatchesContent","defineComponent","name","setup","h","MatchesInner","Matches","router","pendingElement","options","defaultPendingComponent","inner","document","ssr","Suspense","fallback","default","InnerWrap","errorComponentFn","props","class","error","message","String","onClick","reset","matchId","stores","firstMatchId","id","resetKey","loadedAt","matchIdRef","computed","value","provide","childElement","disableGlobalCatchBoundary","getResetKey","errorComponent","onCatch","process","env","NODE_ENV","console","warn","toString","undefined","children","useMatchRoute","routerState","matchRouteReactivity","opts","pending","caseSensitive","fuzzy","includeSearch","rest","matchRoute","MatchRoute","from","type","required","to","Boolean","slots","status","params","Fragment","useMatches","activeMatchesSnapshot","matches","select","useParentMatches","contextMatchId","inject","safeMatchId","slice","findIndex","d","useChildMatches"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { useStore } from '@tanstack/vue-store'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { useTransitionerSetup } from './Transitioner'\nimport { matchContext } from './matchContext'\nimport { Match } from './Match'\nimport type {\n AnyRouter,\n DeepPartial,\n ErrorComponentProps,\n MakeOptionalPathParams,\n MakeOptionalSearchParams,\n MakeRouteMatchUnion,\n MaskOptions,\n MatchRouteOptions,\n NoInfer,\n RegisteredRouter,\n ResolveRelativePath,\n ResolveRoute,\n RouteByPath,\n ToSubOptionsProps,\n} from '@tanstack/router-core'\n\n// Define a type for the error component function\ntype ErrorRouteComponentType = (props: ErrorComponentProps) => Vue.VNode\n\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<Vue.ComponentOptions['meta'] | undefined>\n links?: Array<Vue.ComponentOptions['link'] | undefined>\n scripts?: Array<Vue.ComponentOptions['script'] | undefined>\n headScripts?: Array<Vue.ComponentOptions['script'] | undefined>\n }\n}\n\n// Create a component that renders MatchesInner with Transitioner's setup logic inlined.\n// This is critical for proper hydration - we call useTransitionerSetup() as a composable\n// rather than rendering it as a component, which avoids Fragment/element mismatches.\nconst MatchesContent = Vue.defineComponent({\n name: 'MatchesContent',\n setup() {\n // IMPORTANT: We need to ensure Transitioner's setup() runs.\n // Transitioner sets up critical functionality:\n // - router.startTransition\n // - History subscription via router.history.subscribe(router.load)\n // - Watchers for router events\n //\n // We inline Transitioner's setup logic here. Since Transitioner returns null,\n // we can call its setup function directly without affecting the render tree.\n // This is done by importing and calling useTransitionerSetup.\n useTransitionerSetup()\n\n return () => Vue.h(MatchesInner)\n },\n})\n\nexport const Matches = Vue.defineComponent({\n name: 'Matches',\n setup() {\n const router = useRouter()\n\n return () => {\n const pendingElement = router?.options?.defaultPendingComponent\n ? Vue.h(router.options.defaultPendingComponent)\n : null\n\n // Do not render a root Suspense during SSR or hydrating from SSR\n const inner =\n (isServer ?? router?.isServer ?? false) ||\n (typeof document !== 'undefined' && router?.ssr)\n ? Vue.h(MatchesContent)\n : Vue.h(\n Vue.Suspense,\n { fallback: pendingElement },\n {\n default: () => Vue.h(MatchesContent),\n },\n )\n\n return router?.options?.InnerWrap\n ? Vue.h(router.options.InnerWrap, null, { default: () => inner })\n : inner\n }\n },\n})\n\n// Create a simple error component function that matches ErrorRouteComponent\nconst errorComponentFn: ErrorRouteComponentType = (\n props: ErrorComponentProps,\n) => {\n return Vue.h('div', { class: 'error' }, [\n Vue.h('h1', null, 'Error'),\n Vue.h('p', null, props.error.message || String(props.error)),\n Vue.h('button', { onClick: props.reset }, 'Try Again'),\n ])\n}\n\nconst MatchesInner = Vue.defineComponent({\n name: 'MatchesInner',\n setup() {\n const router = useRouter()\n\n const matchId = useStore(router.stores.firstMatchId, (id) => id)\n const resetKey = useStore(router.stores.loadedAt, (loadedAt) => loadedAt)\n\n // Create a ref for the match id to provide\n const matchIdRef = Vue.computed(() => matchId.value)\n\n // Provide the matchId for child components using the InjectionKey\n Vue.provide(matchContext, matchIdRef)\n\n return () => {\n // Generate a placeholder element if matchId.value is not present\n const childElement = matchId.value\n ? Vue.h(Match, { matchId: matchId.value })\n : Vue.h('div')\n\n // If disableGlobalCatchBoundary is true, don't wrap in CatchBoundary\n if (router.options.disableGlobalCatchBoundary) {\n return childElement\n }\n\n return Vue.h(CatchBoundary, {\n getResetKey: () => resetKey.value,\n errorComponent: errorComponentFn,\n onCatch:\n process.env.NODE_ENV !== 'production'\n ? (error: Error) => {\n console.warn(\n `Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,\n )\n console.warn(`Warning: ${error.message || error.toString()}`)\n }\n : undefined,\n children: childElement,\n })\n }\n },\n})\n\nexport type UseMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = ToSubOptionsProps<TRouter, TFrom, TTo> &\n DeepPartial<MakeOptionalSearchParams<TRouter, TFrom, TTo>> &\n DeepPartial<MakeOptionalPathParams<TRouter, TFrom, TTo>> &\n MaskOptions<TRouter, TMaskFrom, TMaskTo> &\n MatchRouteOptions\n\nexport function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>() {\n const router = useRouter()\n\n const routerState = useStore(\n router.stores.matchRouteReactivity,\n (value) => value,\n )\n\n return <\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n >(\n opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n ): Vue.Ref<\n false | ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']\n > => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n const matchRoute = Vue.computed(() => {\n // Access routerState to establish dependency\n\n routerState.value\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\n\n return matchRoute\n }\n}\n\nexport type MakeMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | ((\n params?: RouteByPath<\n TRouter['routeTree'],\n ResolveRelativePath<TFrom, NoInfer<TTo>>\n >['types']['allParams'],\n ) => Vue.VNode)\n | Vue.VNode\n}\n\n// Create a type for the MatchRoute component that includes the generics\nexport interface MatchRouteComponentType {\n <\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n >(\n props: MakeMatchRouteOptions<TRouter, TFrom, TTo>,\n ): Vue.VNode\n new (): {\n $props: {\n from?: string\n to?: string\n fuzzy?: boolean\n caseSensitive?: boolean\n includeSearch?: boolean\n pending?: boolean\n }\n }\n}\n\nexport const MatchRoute = Vue.defineComponent({\n name: 'MatchRoute',\n props: {\n // Define props to match MakeMatchRouteOptions\n from: {\n type: String,\n required: false,\n },\n to: {\n type: String,\n required: false,\n },\n fuzzy: {\n type: Boolean,\n required: false,\n },\n caseSensitive: {\n type: Boolean,\n required: false,\n },\n includeSearch: {\n type: Boolean,\n required: false,\n },\n pending: {\n type: Boolean,\n required: false,\n },\n },\n setup(props, { slots }) {\n const router = useRouter()\n const status = useStore(\n router.stores.matchRouteReactivity,\n (value) => value.status,\n )\n\n return () => {\n if (!status.value) return null\n\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any).value as boolean\n\n // Create a component that renders the slot in a reactive manner\n if (!params || !slots.default) {\n return null\n }\n\n // For function slots, pass the params\n if (typeof slots.default === 'function') {\n // Use h to create a wrapper component that will call the slot function\n return Vue.h(Vue.Fragment, null, slots.default(params))\n }\n\n // For normal slots, just render them\n return Vue.h(Vue.Fragment, null, slots.default)\n }\n },\n}) as unknown as MatchRouteComponentType\n\nexport interface UseMatchesBaseOptions<TRouter extends AnyRouter, TSelected> {\n select?: (matches: Array<MakeRouteMatchUnion<TRouter>>) => TSelected\n}\n\nexport type UseMatchesResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? Array<MakeRouteMatchUnion<TRouter>> : TSelected\n\nexport function useMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Vue.Ref<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return useStore(router.stores.activeMatchesSnapshot, (matches) => {\n return opts?.select\n ? opts.select(matches as Array<MakeRouteMatchUnion<TRouter>>)\n : (matches as any)\n })\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Vue.Ref<UseMatchesResult<TRouter, TSelected>> {\n // Use matchContext with proper type\n const contextMatchId = Vue.inject<Vue.Ref<string | undefined>>(matchContext)\n const safeMatchId = Vue.computed(() => contextMatchId?.value || '')\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n 0,\n matches.findIndex((d) => d.id === safeMatchId.value),\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n\nexport function useChildMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Vue.Ref<UseMatchesResult<TRouter, TSelected>> {\n // Use matchContext with proper type\n const contextMatchId = Vue.inject<Vue.Ref<string | undefined>>(matchContext)\n const safeMatchId = Vue.computed(() => contextMatchId?.value || '')\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n matches.findIndex((d) => d.id === safeMatchId.value) + 1,\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n"],"mappings":";;;;;;;;;AAwCA,IAAMQ,iBAAiBR,IAAIS,gBAAgB;CACzCC,MAAM;CACNC,QAAQ;AAUNN,wBAAsB;AAEtB,eAAaL,IAAIY,EAAEC,aAAa;;CAEnC,CAAC;AAEF,IAAaC,UAAUd,IAAIS,gBAAgB;CACzCC,MAAM;CACNC,QAAQ;EACN,M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iD,MAAMjD,YAAY,WAE3B,QAAOxB,IAAIY,EAAEZ,IAAI4E,UAAU,MAAMH,MAAMjD,QAAQmD,OAAO,CAAC;AAIzD,UAAO3E,IAAIY,EAAEZ,IAAI4E,UAAU,MAAMH,MAAMjD,QAAQ;;;CAGpD,CAAuC;AAWxC,SAAgBqD,WAIdjB,MAC+C;AAE/C,QAAO1D,SADQE,WAAoB,CACZ+B,OAAO2C,wBAAwBC,YAAY;AAChE,SAAOnB,MAAMoB,SACTpB,KAAKoB,OAAOD,QAA+C,GAC1DA;GACL;;AAGJ,SAAgBE,iBAIdrB,MAC+C;CAE/C,MAAMsB,iBAAiBlF,IAAImF,OAAoC7E,aAAa;CAC5E,MAAM8E,cAAcpF,IAAIyC,eAAeyC,gBAAgBxC,SAAS,GAAG;AAEnE,QAAOmC,WAAW,EAChBG,SAASD,YAAiD;AACxDA,YAAUA,QAAQM,MAChB,GACAN,QAAQO,WAAWC,MAAMA,EAAElD,OAAO+C,YAAY1C,MAChD,CAAC;AACD,SAAOkB,MAAMoB,SAASpB,KAAKoB,OAAOD,QAAQ,GAAGA;IAEzC,CAAC;;AAGX,SAAgBS,gBAId5B,MAC+C;CAE/C,MAAMsB,iBAAiBlF,IAAImF,OAAoC7E,aAAa;CAC5E,MAAM8E,cAAcpF,IAAIyC,eAAeyC,gBAAgBxC,SAAS,GAAG;AAEnE,QAAOmC,WAAW,EAChBG,SAASD,YAAiD;AACxDA,YAAUA,QAAQM,MAChBN,QAAQO,WAAWC,MAAMA,EAAElD,OAAO+C,YAAY1C,MAAM,GAAG,EACxD;AACD,SAAOkB,MAAMoB,SAASpB,KAAKoB,OAAOD,QAAQ,GAAGA;IAEzC,CAAC"}
|
package/dist/esm/fileRoute.js
CHANGED
|
@@ -7,7 +7,6 @@ import { useSearch } from "./useSearch.js";
|
|
|
7
7
|
import { useNavigate } from "./useNavigate.js";
|
|
8
8
|
import { useRouteContext } from "./useRouteContext.js";
|
|
9
9
|
import { createRoute } from "./route.js";
|
|
10
|
-
import warning from "tiny-warning";
|
|
11
10
|
//#region src/fileRoute.ts
|
|
12
11
|
function createFileRoute(path) {
|
|
13
12
|
if (typeof path === "object") return new FileRoute(path, { silent: true }).createRoute(path);
|
|
@@ -21,7 +20,9 @@ var FileRoute = class {
|
|
|
21
20
|
constructor(path, _opts) {
|
|
22
21
|
this.path = path;
|
|
23
22
|
this.createRoute = (options) => {
|
|
24
|
-
if (process.env.NODE_ENV !== "production")
|
|
23
|
+
if (process.env.NODE_ENV !== "production") {
|
|
24
|
+
if (!this.silent) console.warn("Warning: FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.");
|
|
25
|
+
}
|
|
25
26
|
const route = createRoute(options);
|
|
26
27
|
route.isRoot = false;
|
|
27
28
|
return route;
|
|
@@ -35,7 +36,7 @@ Instead, place the loader function in the the main route file, inside the
|
|
|
35
36
|
`createFileRoute('/path/to/file)(options)` options.
|
|
36
37
|
*/
|
|
37
38
|
function FileRouteLoader(_path) {
|
|
38
|
-
if (process.env.NODE_ENV !== "production")
|
|
39
|
+
if (process.env.NODE_ENV !== "production") console.warn(`Warning: FileRouteLoader is deprecated and will be removed in the next major version. Please place the loader function in the the main route file, inside the \`createFileRoute('/path/to/file')(options)\` options`);
|
|
39
40
|
return (loaderFn) => loaderFn;
|
|
40
41
|
}
|
|
41
42
|
var LazyRoute = class {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileRoute.js","names":[],"sources":["../../src/fileRoute.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"fileRoute.js","names":[],"sources":["../../src/fileRoute.ts"],"sourcesContent":["import { createRoute } from './route'\n\nimport { useMatch } from './useMatch'\nimport { useLoaderDeps } from './useLoaderDeps'\nimport { useLoaderData } from './useLoaderData'\nimport { useSearch } from './useSearch'\nimport { useParams } from './useParams'\nimport { useNavigate } from './useNavigate'\nimport { useRouter } from './useRouter'\nimport { useRouteContext } from './useRouteContext'\nimport type { UseParamsRoute } from './useParams'\nimport type { UseMatchRoute } from './useMatch'\nimport type { UseSearchRoute } from './useSearch'\nimport type {\n AnyContext,\n AnyRoute,\n AnyRouter,\n Constrain,\n ConstrainLiteral,\n FileBaseRouteOptions,\n FileRoutesByPath,\n LazyRouteOptions,\n Register,\n RegisteredRouter,\n ResolveParams,\n Route,\n RouteById,\n RouteConstraints,\n RouteIds,\n RouteLoaderEntry,\n UpdatableRouteOptions,\n UseNavigateResult,\n} from '@tanstack/router-core'\nimport type { UseLoaderDepsRoute } from './useLoaderDeps'\nimport type { UseLoaderDataRoute } from './useLoaderData'\nimport type { UseRouteContextRoute } from './useRouteContext'\n\nexport function createFileRoute<\n TFilePath extends keyof FileRoutesByPath,\n TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],\n TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'],\n TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'],\n TFullPath extends RouteConstraints['TFullPath'] =\n FileRoutesByPath[TFilePath]['fullPath'],\n>(\n path?: TFilePath,\n): FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>['createRoute'] {\n if (typeof path === 'object') {\n return new FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>(path, {\n silent: true,\n }).createRoute(path) as any\n }\n return new FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>(path, {\n silent: true,\n }).createRoute\n}\n\n/**\n @deprecated It's no longer recommended to use the `FileRoute` class directly.\n Instead, use `createFileRoute('/path/to/file')(options)` to create a file route.\n*/\nexport class FileRoute<\n TFilePath extends keyof FileRoutesByPath,\n TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],\n TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'],\n TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'],\n TFullPath extends RouteConstraints['TFullPath'] =\n FileRoutesByPath[TFilePath]['fullPath'],\n> {\n silent?: boolean\n\n constructor(\n public path?: TFilePath,\n _opts?: { silent: boolean },\n ) {\n this.silent = _opts?.silent\n }\n\n createRoute = <\n TRegister = Register,\n TSearchValidator = undefined,\n TParams = ResolveParams<TPath>,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n TSSR = unknown,\n TMiddlewares = unknown,\n THandlers = undefined,\n >(\n options?: FileBaseRouteOptions<\n TRegister,\n TParentRoute,\n TId,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n AnyContext,\n TSSR,\n TMiddlewares,\n THandlers\n > &\n UpdatableRouteOptions<\n TParentRoute,\n TId,\n TFullPath,\n TParams,\n TSearchValidator,\n TLoaderFn,\n TLoaderDeps,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn\n >,\n ): Route<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TFilePath,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown,\n TSSR,\n TMiddlewares,\n THandlers\n > => {\n if (process.env.NODE_ENV !== 'production') {\n if (!this.silent) {\n console.warn(\n 'Warning: FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.',\n )\n }\n }\n const route = createRoute(options as any)\n ;(route as any).isRoot = false\n return route as any\n }\n}\n\n/**\n @deprecated It's recommended not to split loaders into separate files.\n Instead, place the loader function in the the main route file, inside the\n `createFileRoute('/path/to/file)(options)` options.\n*/\nexport function FileRouteLoader<\n TFilePath extends keyof FileRoutesByPath,\n TRoute extends FileRoutesByPath[TFilePath]['preLoaderRoute'],\n>(\n _path: TFilePath,\n): <TLoaderFn>(\n loaderFn: Constrain<\n TLoaderFn,\n RouteLoaderEntry<\n Register,\n TRoute['parentRoute'],\n TRoute['types']['id'],\n TRoute['types']['params'],\n TRoute['types']['loaderDeps'],\n TRoute['types']['routerContext'],\n TRoute['types']['routeContextFn'],\n TRoute['types']['beforeLoadFn']\n >\n >,\n) => TLoaderFn {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Warning: FileRouteLoader is deprecated and will be removed in the next major version. Please place the loader function in the the main route file, inside the \\`createFileRoute('/path/to/file')(options)\\` options`,\n )\n }\n return (loaderFn) => loaderFn as any\n}\n\ndeclare module '@tanstack/router-core' {\n export interface LazyRoute<in out TRoute extends AnyRoute> {\n useMatch: UseMatchRoute<TRoute['id']>\n useRouteContext: UseRouteContextRoute<TRoute['id']>\n useSearch: UseSearchRoute<TRoute['id']>\n useParams: UseParamsRoute<TRoute['id']>\n useLoaderDeps: UseLoaderDepsRoute<TRoute['id']>\n useLoaderData: UseLoaderDataRoute<TRoute['id']>\n useNavigate: () => UseNavigateResult<TRoute['fullPath']>\n }\n}\n\nexport class LazyRoute<TRoute extends AnyRoute> {\n options: {\n id: string\n } & LazyRouteOptions\n\n constructor(\n opts: {\n id: string\n } & LazyRouteOptions,\n ) {\n this.options = opts\n }\n\n useMatch: UseMatchRoute<TRoute['id']> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.options.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TRoute['id']> = (opts) => {\n return useRouteContext({ ...(opts as any), from: this.options.id }) as any\n }\n\n useSearch: UseSearchRoute<TRoute['id']> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.options.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TRoute['id']> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.options.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TRoute['id']> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.options.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TRoute['id']> = (opts) => {\n return useLoaderData({ ...opts, from: this.options.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<TRoute['fullPath']> => {\n const router = useRouter()\n return useNavigate({ from: router.routesById[this.options.id].fullPath })\n }\n}\n\nexport function createLazyRoute<\n TRouter extends AnyRouter = RegisteredRouter,\n TId extends string = string,\n TRoute extends AnyRoute = RouteById<TRouter['routeTree'], TId>,\n>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>) {\n return (opts: LazyRouteOptions) => {\n return new LazyRoute<TRoute>({\n id: id,\n ...opts,\n })\n }\n}\nexport function createLazyFileRoute<\n TFilePath extends keyof FileRoutesByPath,\n TRoute extends FileRoutesByPath[TFilePath]['preLoaderRoute'],\n>(id: TFilePath): (opts: LazyRouteOptions) => LazyRoute<TRoute> {\n if (typeof id === 'object') {\n return new LazyRoute<TRoute>(id) as any\n }\n\n return (opts: LazyRouteOptions) => new LazyRoute<TRoute>({ id, ...opts })\n}\n"],"mappings":";;;;;;;;;;AAqCA,SAAgB,gBAQd,MAC0E;AAC1E,KAAI,OAAO,SAAS,SAClB,QAAO,IAAI,UAA0D,MAAM,EACzE,QAAQ,MACT,CAAC,CAAC,YAAY,KAAK;AAEtB,QAAO,IAAI,UAA0D,MAAM,EACzE,QAAQ,MACT,CAAC,CAAC;;;;;;AAOL,IAAa,YAAb,MAOE;CAGA,YACE,MACA,OACA;AAFO,OAAA,OAAA;sBAmBP,YAgDG;AACH,OAAA,QAAA,IAAA,aAA6B;QACvB,CAAC,KAAK,OACR,SAAQ,KACN,2IACD;;GAGL,MAAM,QAAQ,YAAY,QAAe;AACvC,SAAc,SAAS;AACzB,UAAO;;AA1EP,OAAK,SAAS,OAAO;;;;;;;;AAmFzB,SAAgB,gBAId,OAea;AACb,KAAA,QAAA,IAAA,aAA6B,aAC3B,SAAQ,KACN,sNACD;AAEH,SAAQ,aAAa;;AAevB,IAAa,YAAb,MAAgD;CAK9C,YACE,MAGA;mBAIuC,SAAS;AAChD,UAAO,SAAS;IACd,QAAQ,MAAM;IACd,MAAM,KAAK,QAAQ;IACpB,CAAQ;;0BAG4C,SAAS;AAC9D,UAAO,gBAAgB;IAAE,GAAI;IAAc,MAAM,KAAK,QAAQ;IAAI,CAAC;;oBAG1B,SAAS;AAClD,UAAO,UAAU;IACf,QAAQ,MAAM;IACd,MAAM,KAAK,QAAQ;IACpB,CAAQ;;oBAGgC,SAAS;AAClD,UAAO,UAAU;IACf,QAAQ,MAAM;IACd,MAAM,KAAK,QAAQ;IACpB,CAAQ;;wBAGwC,SAAS;AAC1D,UAAO,cAAc;IAAE,GAAG;IAAM,MAAM,KAAK,QAAQ;IAAI,CAAQ;;wBAGd,SAAS;AAC1D,UAAO,cAAc;IAAE,GAAG;IAAM,MAAM,KAAK,QAAQ;IAAI,CAAQ;;2BAGN;AAEzD,UAAO,YAAY,EAAE,MADN,WAAW,CACQ,WAAW,KAAK,QAAQ,IAAI,UAAU,CAAC;;AAtCzE,OAAK,UAAU;;;AA0CnB,SAAgB,gBAId,IAA2D;AAC3D,SAAQ,SAA2B;AACjC,SAAO,IAAI,UAAkB;GACvB;GACJ,GAAG;GACJ,CAAC;;;AAGN,SAAgB,oBAGd,IAA8D;AAC9D,KAAI,OAAO,OAAO,SAChB,QAAO,IAAI,UAAkB,GAAG;AAGlC,SAAQ,SAA2B,IAAI,UAAkB;EAAE;EAAI,GAAG;EAAM,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DefaultGlobalNotFound } from "./not-found.js";
|
|
2
2
|
import * as Vue from "vue";
|
|
3
|
-
import warning from "tiny-warning";
|
|
4
3
|
//#region src/renderRouteNotFound.tsx
|
|
5
4
|
/**
|
|
6
5
|
* Renders a not found component for a route when no matching route is found.
|
|
@@ -13,7 +12,9 @@ import warning from "tiny-warning";
|
|
|
13
12
|
function renderRouteNotFound(router, route, data) {
|
|
14
13
|
if (!route.options.notFoundComponent) {
|
|
15
14
|
if (router.options.defaultNotFoundComponent) return Vue.h(router.options.defaultNotFoundComponent, data);
|
|
16
|
-
if (process.env.NODE_ENV
|
|
15
|
+
if (process.env.NODE_ENV !== "production") {
|
|
16
|
+
if (!route.options.notFoundComponent) console.warn(`Warning: A notFoundError was encountered on the route with ID "${route.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`);
|
|
17
|
+
}
|
|
17
18
|
return Vue.h(DefaultGlobalNotFound);
|
|
18
19
|
}
|
|
19
20
|
return Vue.h(route.options.notFoundComponent, data);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderRouteNotFound.js","names":["Vue","
|
|
1
|
+
{"version":3,"file":"renderRouteNotFound.js","names":["Vue","DefaultGlobalNotFound","renderRouteNotFound","router","route","data","options","notFoundComponent","defaultNotFoundComponent","h","process","env","NODE_ENV","console","warn","id"],"sources":["../../src/renderRouteNotFound.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport { DefaultGlobalNotFound } from './not-found'\nimport type { AnyRoute, AnyRouter } from '@tanstack/router-core'\n\n/**\n * Renders a not found component for a route when no matching route is found.\n *\n * @param router - The router instance containing the route configuration\n * @param route - The route that triggered the not found state\n * @param data - Additional data to pass to the not found component\n * @returns The rendered not found component or a default fallback component\n */\nexport function renderRouteNotFound(\n router: AnyRouter,\n route: AnyRoute,\n data: any,\n): Vue.VNode {\n if (!route.options.notFoundComponent) {\n if (router.options.defaultNotFoundComponent) {\n return Vue.h(router.options.defaultNotFoundComponent as any, data)\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!route.options.notFoundComponent) {\n console.warn(\n `Warning: A notFoundError was encountered on the route with ID \"${route.id}\", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`,\n )\n }\n }\n\n return Vue.h(DefaultGlobalNotFound)\n }\n\n return Vue.h(route.options.notFoundComponent as any, data)\n}\n"],"mappings":";;;;;;;;;;;AAYA,SAAgBE,oBACdC,QACAC,OACAC,MACW;AACX,KAAI,CAACD,MAAME,QAAQC,mBAAmB;AACpC,MAAIJ,OAAOG,QAAQE,yBACjB,QAAOR,IAAIS,EAAEN,OAAOG,QAAQE,0BAAiCH,KAAK;AAGpE,MAAA,QAAA,IAAA,aAA6B;OACvB,CAACD,MAAME,QAAQC,kBACjBM,SAAQC,KACN,kEAAkEV,MAAMW,GAAE,oPAC3E;;AAIL,SAAOf,IAAIS,EAAER,sBAAsB;;AAGrC,QAAOD,IAAIS,EAAEL,MAAME,QAAQC,mBAA0BF,KAAK"}
|
package/dist/esm/useMatch.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { useRouter } from "./useRouter.js";
|
|
2
2
|
import { injectDummyPendingMatch, injectPendingMatch, routeIdContext } from "./matchContext.js";
|
|
3
|
+
import { invariant } from "@tanstack/router-core";
|
|
3
4
|
import * as Vue from "vue";
|
|
4
5
|
import { isServer } from "@tanstack/router-core/isServer";
|
|
5
6
|
import { useStore } from "@tanstack/vue-store";
|
|
6
|
-
import invariant from "tiny-invariant";
|
|
7
7
|
//#region src/useMatch.tsx
|
|
8
8
|
function useMatch(opts) {
|
|
9
9
|
const router = useRouter();
|
|
10
10
|
if (isServer ?? router.isServer) {
|
|
11
11
|
const nearestRouteId = opts.from ? void 0 : Vue.inject(routeIdContext);
|
|
12
12
|
const match = (opts.from ?? nearestRouteId ? router.stores.getMatchStoreByRouteId(opts.from ?? nearestRouteId) : void 0)?.state;
|
|
13
|
-
|
|
13
|
+
if ((opts.shouldThrow ?? true) && !match) {
|
|
14
|
+
if (process.env.NODE_ENV !== "production") throw new Error(`Invariant failed: Could not find ${opts.from ? `an active match from "${opts.from}"` : "a nearest match!"}`);
|
|
15
|
+
invariant();
|
|
16
|
+
}
|
|
14
17
|
if (match === void 0) return Vue.ref(void 0);
|
|
15
18
|
return Vue.ref(opts.select ? opts.select(match) : match);
|
|
16
19
|
}
|
|
@@ -27,7 +30,10 @@ function useMatch(opts) {
|
|
|
27
30
|
const result = Vue.computed(() => {
|
|
28
31
|
const selectedMatch = match.value;
|
|
29
32
|
if (selectedMatch === void 0) {
|
|
30
|
-
|
|
33
|
+
if (!(opts.from ? Boolean(hasPendingRouteMatch?.value[opts.from]) : hasPendingNearestMatch.value) && !isTransitioning.value && (opts.shouldThrow ?? true)) {
|
|
34
|
+
if (process.env.NODE_ENV !== "production") throw new Error(`Invariant failed: Could not find ${opts.from ? `an active match from "${opts.from}"` : "a nearest match!"}`);
|
|
35
|
+
invariant();
|
|
36
|
+
}
|
|
31
37
|
return;
|
|
32
38
|
}
|
|
33
39
|
return opts.select ? opts.select(selectedMatch) : selectedMatch;
|
package/dist/esm/useMatch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMatch.js","names":["Vue","
|
|
1
|
+
{"version":3,"file":"useMatch.js","names":["Vue","invariant","useStore","isServer","injectDummyPendingMatch","injectPendingMatch","routeIdContext","useRouter","useMatch","opts","router","nearestRouteId","from","undefined","inject","matchStore","stores","getMatchStoreByRouteId","match","state","shouldThrow","process","env","NODE_ENV","Error","ref","select","hasPendingNearestMatch","value","hasPendingRouteMatch","pendingRouteIds","ids","isTransitioning","equal","Object","is","result","computed","selectedMatch","hasPendingMatch","Boolean"],"sources":["../../src/useMatch.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport { invariant } from '@tanstack/router-core'\nimport { useStore } from '@tanstack/vue-store'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport {\n injectDummyPendingMatch,\n injectPendingMatch,\n routeIdContext,\n} from './matchContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n MakeRouteMatch,\n MakeRouteMatchUnion,\n RegisteredRouter,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n} from '@tanstack/router-core'\n\nexport interface UseMatchBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (\n match: MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>,\n ) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseMatchRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchBaseOptions<TRouter, TFrom, true, true, TSelected>,\n) => Vue.Ref<UseMatchResult<TRouter, TFrom, true, TSelected>>\n\nexport type UseMatchOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseMatchBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseMatchResult<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TSelected,\n> = unknown extends TSelected\n ? TStrict extends true\n ? MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>\n : MakeRouteMatchUnion<TRouter>\n : TSelected\n\nexport function useMatch<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseMatchOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Vue.Ref<\n ThrowOrOptional<UseMatchResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n const router = useRouter<TRouter>()\n\n // During SSR we render exactly once and do not need reactivity.\n // Avoid store subscriptions and pending/transition bookkeeping on the server.\n if (isServer ?? router.isServer) {\n const nearestRouteId = opts.from ? undefined : Vue.inject(routeIdContext)\n const matchStore =\n (opts.from ?? nearestRouteId)\n ? router.stores.getMatchStoreByRouteId(opts.from ?? nearestRouteId!)\n : undefined\n const match = matchStore?.state\n\n if ((opts.shouldThrow ?? true) && !match) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Invariant failed: Could not find ${opts.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'}`,\n )\n }\n\n invariant()\n }\n\n if (match === undefined) {\n return Vue.ref(undefined) as Vue.Ref<\n ThrowOrOptional<\n UseMatchResult<TRouter, TFrom, TStrict, TSelected>,\n TThrow\n >\n >\n }\n\n return Vue.ref(opts.select ? opts.select(match) : match) as Vue.Ref<\n ThrowOrOptional<\n UseMatchResult<TRouter, TFrom, TStrict, TSelected>,\n TThrow\n >\n >\n }\n\n const hasPendingNearestMatch = opts.from\n ? injectDummyPendingMatch()\n : injectPendingMatch()\n // Set up reactive match value based on lookup strategy.\n let match: Readonly<Vue.Ref<any>>\n\n if (opts.from) {\n // routeId case: single subscription via per-routeId computed store.\n // The store reference is stable (cached by routeId).\n const matchStore = router.stores.getMatchStoreByRouteId(opts.from)\n match = useStore(matchStore, (value) => value)\n } else {\n // matchId case: use routeId from context for stable store lookup.\n // The routeId is provided by the nearest Match component and doesn't\n // change for the component's lifetime, so the store is stable.\n const nearestRouteId = Vue.inject(routeIdContext)\n if (nearestRouteId) {\n match = useStore(\n router.stores.getMatchStoreByRouteId(nearestRouteId),\n (value) => value,\n )\n } else {\n // No route context — will fall through to error handling below\n match = Vue.ref(undefined) as Readonly<Vue.Ref<undefined>>\n }\n }\n\n const hasPendingRouteMatch = opts.from\n ? useStore(router.stores.pendingRouteIds, (ids) => ids)\n : undefined\n const isTransitioning = useStore(\n router.stores.isTransitioning,\n (value) => value,\n { equal: Object.is },\n )\n\n const result = Vue.computed(() => {\n const selectedMatch = match.value\n if (selectedMatch === undefined) {\n const hasPendingMatch = opts.from\n ? Boolean(hasPendingRouteMatch?.value[opts.from!])\n : hasPendingNearestMatch.value\n if (\n !hasPendingMatch &&\n !isTransitioning.value &&\n (opts.shouldThrow ?? true)\n ) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Invariant failed: Could not find ${opts.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'}`,\n )\n }\n\n invariant()\n }\n\n return undefined\n }\n\n return opts.select ? opts.select(selectedMatch) : selectedMatch\n })\n\n // Keep eager throw behavior for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CAED,MAAMC,SAASpC,IAAIqC,eAAe;EAChC,MAAMC,gBAAgBpB,MAAMU;AAC5B,MAAIU,kBAAkBzB,KAAAA,GAAW;AAI/B,OACE,EAJsBJ,KAAKG,OACzB4B,QAAQX,sBAAsBD,MAAMnB,KAAKG,MAAO,GAChDe,uBAAuBC,UAGzB,CAACI,gBAAgBJ,UAChBnB,KAAKW,eAAe,OACrB;AACA,QAAA,QAAA,IAAA,aAA6B,aAC3B,OAAM,IAAII,MACR,oCAAoCf,KAAKG,OAAO,yBAAyBH,KAAKG,KAAI,KAAM,qBACzF;AAGHX,eAAW;;AAGb;;AAGF,SAAOQ,KAAKiB,SAASjB,KAAKiB,OAAOY,cAAc,GAAGA;GAClD;AAGFF,QAAOR;AAEP,QAAOQ"}
|
package/dist/esm/useRouter.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { routerContext } from "./routerContext.js";
|
|
2
2
|
import * as Vue from "vue";
|
|
3
|
-
import warning from "tiny-warning";
|
|
4
3
|
//#region src/useRouter.tsx
|
|
5
4
|
function useRouter(opts) {
|
|
6
5
|
const value = Vue.inject(routerContext, null);
|
|
7
|
-
|
|
6
|
+
if (process.env.NODE_ENV !== "production") {
|
|
7
|
+
if ((opts?.warn ?? true) && !value) console.warn("Warning: useRouter must be used inside a <RouterProvider> component!");
|
|
8
|
+
}
|
|
8
9
|
return value;
|
|
9
10
|
}
|
|
10
11
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRouter.js","names":["Vue","
|
|
1
|
+
{"version":3,"file":"useRouter.js","names":["Vue","routerContext","useRouter","opts","value","inject","process","env","NODE_ENV","warn","console"],"sources":["../../src/useRouter.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport { routerContext } from './routerContext'\nimport type { AnyRouter, RegisteredRouter } from '@tanstack/router-core'\n\nexport function useRouter<TRouter extends AnyRouter = RegisteredRouter>(opts?: {\n warn?: boolean\n}): TRouter {\n const value = Vue.inject(routerContext as any, null)\n if (process.env.NODE_ENV !== 'production') {\n if ((opts?.warn ?? true) && !value) {\n console.warn(\n 'Warning: useRouter must be used inside a <RouterProvider> component!',\n )\n }\n }\n return value as any\n}\n"],"mappings":";;;AAIA,SAAgBE,UAAwDC,MAE5D;CACV,MAAMC,QAAQJ,IAAIK,OAAOJ,eAAsB,KAAK;AACpD,KAAA,QAAA,IAAA,aAA6B;OACtBE,MAAMM,QAAQ,SAAS,CAACL,MAC3BM,SAAQD,KACN,uEACD;;AAGL,QAAOL"}
|
package/dist/source/Match.jsx
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as Vue from 'vue';
|
|
2
|
-
import invariant from '
|
|
3
|
-
import warning from 'tiny-warning';
|
|
4
|
-
import { createControlledPromise, getLocationChangeInfo, isNotFound, isRedirect, rootRouteId, } from '@tanstack/router-core';
|
|
2
|
+
import { createControlledPromise, getLocationChangeInfo, invariant, isNotFound, isRedirect, rootRouteId, } from '@tanstack/router-core';
|
|
5
3
|
import { isServer } from '@tanstack/router-core/isServer';
|
|
6
4
|
import { useStore } from '@tanstack/vue-store';
|
|
7
5
|
import { CatchBoundary, ErrorComponent } from './CatchBoundary';
|
|
@@ -25,7 +23,12 @@ export const Match = Vue.defineComponent({
|
|
|
25
23
|
// lifetime. The routeId never changes for a given route position in the
|
|
26
24
|
// tree, even when matchId changes (loaderDepsHash, etc).
|
|
27
25
|
const routeId = router.stores.activeMatchStoresById.get(props.matchId)?.routeId;
|
|
28
|
-
|
|
26
|
+
if (!routeId) {
|
|
27
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
28
|
+
throw new Error(`Invariant failed: Could not find routeId for matchId "${props.matchId}". Please file an issue!`);
|
|
29
|
+
}
|
|
30
|
+
invariant();
|
|
31
|
+
}
|
|
29
32
|
// Static route-tree check: is this route a direct child of the root?
|
|
30
33
|
// parentRoute is set at build time, so no reactive tracking needed.
|
|
31
34
|
const isChildOfRoot = router.routesById[routeId]?.parentRoute?.id === rootRouteId;
|
|
@@ -113,7 +116,9 @@ export const Match = Vue.defineComponent({
|
|
|
113
116
|
// Forward not found errors (we don't want to show the error component for these)
|
|
114
117
|
if (isNotFound(error))
|
|
115
118
|
throw error;
|
|
116
|
-
|
|
119
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
120
|
+
console.warn(`Warning: Error in route match: ${actualMatchId}`);
|
|
121
|
+
}
|
|
117
122
|
routeOnCatch.value?.(error);
|
|
118
123
|
},
|
|
119
124
|
children: content,
|
|
@@ -245,11 +250,21 @@ export const MatchInner = Vue.defineComponent({
|
|
|
245
250
|
return PendingComponent ? Vue.h(PendingComponent) : null;
|
|
246
251
|
}
|
|
247
252
|
if (match.value.status === 'notFound') {
|
|
248
|
-
|
|
253
|
+
if (!isNotFound(match.value.error)) {
|
|
254
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
255
|
+
throw new Error('Invariant failed: Expected a notFound error');
|
|
256
|
+
}
|
|
257
|
+
invariant();
|
|
258
|
+
}
|
|
249
259
|
return renderRouteNotFound(router, route.value, match.value.error);
|
|
250
260
|
}
|
|
251
261
|
if (match.value.status === 'redirected') {
|
|
252
|
-
|
|
262
|
+
if (!isRedirect(match.value.error)) {
|
|
263
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
264
|
+
throw new Error('Invariant failed: Expected a redirect error');
|
|
265
|
+
}
|
|
266
|
+
invariant();
|
|
267
|
+
}
|
|
253
268
|
throw router.getMatch(match.value.id)?._nonReactive.loadPromise;
|
|
254
269
|
}
|
|
255
270
|
if (match.value.status === 'error') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Match.jsx","sourceRoot":"","sources":["../../src/Match.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,OAAO,MAAM,cAAc,CAAA;AAClC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,UAAU,EAC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ue';
|
|
2
|
-
import warning from 'tiny-warning';
|
|
3
2
|
import { isServer } from '@tanstack/router-core/isServer';
|
|
4
3
|
import { useStore } from '@tanstack/vue-store';
|
|
5
4
|
import { CatchBoundary } from './CatchBoundary';
|
|
@@ -79,8 +78,8 @@ const MatchesInner = Vue.defineComponent({
|
|
|
79
78
|
errorComponent: errorComponentFn,
|
|
80
79
|
onCatch: process.env.NODE_ENV !== 'production'
|
|
81
80
|
? (error) => {
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
console.warn(`Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`);
|
|
82
|
+
console.warn(`Warning: ${error.message || error.toString()}`);
|
|
84
83
|
}
|
|
85
84
|
: undefined,
|
|
86
85
|
children: childElement,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Matches.jsx","sourceRoot":"","sources":["../../src/Matches.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"Matches.jsx","sourceRoot":"","sources":["../../src/Matches.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AA8B/B,wFAAwF;AACxF,yFAAyF;AACzF,qFAAqF;AACrF,MAAM,cAAc,GAAG,GAAG,CAAC,eAAe,CAAC;IACzC,IAAI,EAAE,gBAA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C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;QACtD,CAAC;KACK,CAAC,CAAA;AACX,CAAC;AAED,MAAM,UAAU,eAAe,CAI7B,IAAgD;IAEhD,oCAAoC;IACpC,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,CAA8B,YAAY,CAAC,CAAA;IAC5E,MAAM,WAAW,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,CAAA;IAEnE,OAAO,UAAU,CAAC;QAChB,MAAM,EAAE,CAAC,OAA4C,EAAE,EAAE;YACvD,OAAO,GAAG,OAAO,CAAC,KAAK,CACrB,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CACzD,CAAA;YACD,OAAO,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;QACtD,CAAC;KACK,CAAC,CAAA;AACX,CAAC"}
|
package/dist/source/fileRoute.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import warning from 'tiny-warning';
|
|
2
1
|
import { createRoute } from './route';
|
|
3
2
|
import { useMatch } from './useMatch';
|
|
4
3
|
import { useLoaderDeps } from './useLoaderDeps';
|
|
@@ -27,7 +26,9 @@ export class FileRoute {
|
|
|
27
26
|
this.path = path;
|
|
28
27
|
this.createRoute = (options) => {
|
|
29
28
|
if (process.env.NODE_ENV !== 'production') {
|
|
30
|
-
|
|
29
|
+
if (!this.silent) {
|
|
30
|
+
console.warn('Warning: FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.');
|
|
31
|
+
}
|
|
31
32
|
}
|
|
32
33
|
const route = createRoute(options);
|
|
33
34
|
route.isRoot = false;
|
|
@@ -43,7 +44,7 @@ export class FileRoute {
|
|
|
43
44
|
*/
|
|
44
45
|
export function FileRouteLoader(_path) {
|
|
45
46
|
if (process.env.NODE_ENV !== 'production') {
|
|
46
|
-
|
|
47
|
+
console.warn(`Warning: FileRouteLoader is deprecated and will be removed in the next major version. Please place the loader function in the the main route file, inside the \`createFileRoute('/path/to/file')(options)\` options`);
|
|
47
48
|
}
|
|
48
49
|
return (loaderFn) => loaderFn;
|
|
49
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileRoute.js","sourceRoot":"","sources":["../../src/fileRoute.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"fileRoute.js","sourceRoot":"","sources":["../../src/fileRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AA4BnD,MAAM,UAAU,eAAe,CAQ7B,IAAgB;IAEhB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,SAAS,CAAiD,IAAI,EAAE;YACzE,MAAM,EAAE,IAAI;SACb,CAAC,CAAC,WAAW,CAAC,IAAI,CAAQ,CAAA;IAC7B,CAAC;IACD,OAAO,IAAI,SAAS,CAAiD,IAAI,EAAE;QACzE,MAAM,EAAE,IAAI;KACb,CAAC,CAAC,WAA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AAa;IACb,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,IAAI,SAAS,CAAS,EAAE,CAAQ,CAAA;IACzC,CAAC;IAED,OAAO,CAAC,IAAsB,EAAE,EAAE,CAAC,IAAI,SAAS,CAAS,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,CAAA;AAC3E,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as Vue from 'vue';
|
|
2
|
-
import warning from 'tiny-warning';
|
|
3
2
|
import { DefaultGlobalNotFound } from './not-found';
|
|
4
3
|
/**
|
|
5
4
|
* Renders a not found component for a route when no matching route is found.
|
|
@@ -14,8 +13,10 @@ export function renderRouteNotFound(router, route, data) {
|
|
|
14
13
|
if (router.options.defaultNotFoundComponent) {
|
|
15
14
|
return Vue.h(router.options.defaultNotFoundComponent, data);
|
|
16
15
|
}
|
|
17
|
-
if (process.env.NODE_ENV
|
|
18
|
-
|
|
16
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
17
|
+
if (!route.options.notFoundComponent) {
|
|
18
|
+
console.warn(`Warning: A notFoundError was encountered on the route with ID "${route.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`);
|
|
19
|
+
}
|
|
19
20
|
}
|
|
20
21
|
return Vue.h(DefaultGlobalNotFound);
|
|
21
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderRouteNotFound.jsx","sourceRoot":"","sources":["../../src/renderRouteNotFound.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"renderRouteNotFound.jsx","sourceRoot":"","sources":["../../src/renderRouteNotFound.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAGnD;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAiB,EACjB,KAAe,EACf,IAAS;IAET,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;QACrC,IAAI,MAAM,CAAC,OAAO,CAAC,wBAAwB,EAAE,CAAC;YAC5C,OAAO,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,wBAA+B,EAAE,IAAI,CAAC,CAAA;QACpE,CAAC;QAED,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;YAC1C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;gBACrC,OAAO,CAAC,IAAI,CACV,kEAAkE,KAAK,CAAC,EAAE,oPAAoP,CAC/T,CAAA;YACH,CAAC;QACH,CAAC;QAED,OAAO,GAAG,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAA;IACrC,CAAC;IAED,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAwB,EAAE,IAAI,CAAC,CAAA;AAC5D,CAAC"}
|
package/dist/source/useMatch.jsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Vue from 'vue';
|
|
2
|
+
import { invariant } from '@tanstack/router-core';
|
|
2
3
|
import { useStore } from '@tanstack/vue-store';
|
|
3
4
|
import { isServer } from '@tanstack/router-core/isServer';
|
|
4
|
-
import invariant from 'tiny-invariant';
|
|
5
5
|
import { injectDummyPendingMatch, injectPendingMatch, routeIdContext, } from './matchContext';
|
|
6
6
|
import { useRouter } from './useRouter';
|
|
7
7
|
export function useMatch(opts) {
|
|
@@ -14,7 +14,12 @@ export function useMatch(opts) {
|
|
|
14
14
|
? router.stores.getMatchStoreByRouteId(opts.from ?? nearestRouteId)
|
|
15
15
|
: undefined;
|
|
16
16
|
const match = matchStore?.state;
|
|
17
|
-
|
|
17
|
+
if ((opts.shouldThrow ?? true) && !match) {
|
|
18
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
19
|
+
throw new Error(`Invariant failed: Could not find ${opts.from ? `an active match from "${opts.from}"` : 'a nearest match!'}`);
|
|
20
|
+
}
|
|
21
|
+
invariant();
|
|
22
|
+
}
|
|
18
23
|
if (match === undefined) {
|
|
19
24
|
return Vue.ref(undefined);
|
|
20
25
|
}
|
|
@@ -54,9 +59,14 @@ export function useMatch(opts) {
|
|
|
54
59
|
const hasPendingMatch = opts.from
|
|
55
60
|
? Boolean(hasPendingRouteMatch?.value[opts.from])
|
|
56
61
|
: hasPendingNearestMatch.value;
|
|
57
|
-
|
|
62
|
+
if (!hasPendingMatch &&
|
|
58
63
|
!isTransitioning.value &&
|
|
59
|
-
(opts.shouldThrow ?? true))
|
|
64
|
+
(opts.shouldThrow ?? true)) {
|
|
65
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
66
|
+
throw new Error(`Invariant failed: Could not find ${opts.from ? `an active match from "${opts.from}"` : 'a nearest match!'}`);
|
|
67
|
+
}
|
|
68
|
+
invariant();
|
|
69
|
+
}
|
|
60
70
|
return undefined;
|
|
61
71
|
}
|
|
62
72
|
return opts.select ? opts.select(selectedMatch) : selectedMatch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMatch.jsx","sourceRoot":"","sources":["../../src/useMatch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useMatch.jsx","sourceRoot":"","sources":["../../src/useMatch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AAC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MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE;QAC/B,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAA;QACjC,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YAChC,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI;gBAC/B,CAAC,CAAC,OAAO,CAAC,oBAAoB,EAAE,KAAK,CAAC,IAAI,CAAC,IAAK,CAAC,CAAC;gBAClD,CAAC,CAAC,sBAAsB,CAAC,KAAK,CAAA;YAChC,IACE,CAAC,eAAe;gBAChB,CAAC,eAAe,CAAC,KAAK;gBACtB,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,EAC1B,CAAC;gBACD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;oBAC1C,MAAM,IAAI,KAAK,CACb,oCAAoC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,yBAAyB,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAC7G,CAAA;gBACH,CAAC;gBAED,SAAS,EAAE,CAAA;YACb,CAAC;YAED,OAAO,SAAS,CAAA;QAClB,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAA;IACjE,CAAC,CAAC,CAAA;IAEF,iFAAiF;IACjF,MAAM,CAAC,KAAK,CAAA;IAEZ,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import * as Vue from 'vue';
|
|
2
|
-
import warning from 'tiny-warning';
|
|
3
2
|
import { routerContext } from './routerContext';
|
|
4
3
|
export function useRouter(opts) {
|
|
5
4
|
const value = Vue.inject(routerContext, null);
|
|
6
|
-
|
|
5
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6
|
+
if ((opts?.warn ?? true) && !value) {
|
|
7
|
+
console.warn('Warning: useRouter must be used inside a <RouterProvider> component!');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
7
10
|
return value;
|
|
8
11
|
}
|
|
9
12
|
//# sourceMappingURL=useRouter.jsx.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRouter.jsx","sourceRoot":"","sources":["../../src/useRouter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"useRouter.jsx","sourceRoot":"","sources":["../../src/useRouter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG/C,MAAM,UAAU,SAAS,CAA+C,IAEvE;IACC,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,aAAoB,EAAE,IAAI,CAAC,CAAA;IACpD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;QAC1C,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YACnC,OAAO,CAAC,IAAI,CACV,sEAAsE,CACvE,CAAA;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAY,CAAA;AACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/vue-router",
|
|
3
|
-
"version": "1.168.
|
|
3
|
+
"version": "1.168.2",
|
|
4
4
|
"description": "Modern and scalable routing for Vue applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -60,14 +60,12 @@
|
|
|
60
60
|
"node": ">=20.19"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@tanstack/vue-store": "^0.9.
|
|
63
|
+
"@tanstack/vue-store": "^0.9.2",
|
|
64
64
|
"@vue/runtime-dom": "^3.5.25",
|
|
65
65
|
"isbot": "^5.1.22",
|
|
66
66
|
"jsesc": "^3.0.2",
|
|
67
|
-
"tiny-invariant": "^1.3.3",
|
|
68
|
-
"tiny-warning": "^1.0.3",
|
|
69
67
|
"@tanstack/history": "1.161.6",
|
|
70
|
-
"@tanstack/router-core": "1.168.
|
|
68
|
+
"@tanstack/router-core": "1.168.2"
|
|
71
69
|
},
|
|
72
70
|
"devDependencies": {
|
|
73
71
|
"@tanstack/intent": "^0.0.14",
|
package/src/Match.tsx
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as Vue from 'vue'
|
|
2
|
-
import invariant from 'tiny-invariant'
|
|
3
|
-
import warning from 'tiny-warning'
|
|
4
2
|
import {
|
|
5
3
|
createControlledPromise,
|
|
6
4
|
getLocationChangeInfo,
|
|
5
|
+
invariant,
|
|
7
6
|
isNotFound,
|
|
8
7
|
isRedirect,
|
|
9
8
|
rootRouteId,
|
|
@@ -42,10 +41,15 @@ export const Match = Vue.defineComponent({
|
|
|
42
41
|
props.matchId,
|
|
43
42
|
)?.routeId
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
if (!routeId) {
|
|
45
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`Invariant failed: Could not find routeId for matchId "${props.matchId}". Please file an issue!`,
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
invariant()
|
|
52
|
+
}
|
|
49
53
|
|
|
50
54
|
// Static route-tree check: is this route a direct child of the root?
|
|
51
55
|
// parentRoute is set at build time, so no reactive tracking needed.
|
|
@@ -187,7 +191,9 @@ export const Match = Vue.defineComponent({
|
|
|
187
191
|
onCatch: (error: Error) => {
|
|
188
192
|
// Forward not found errors (we don't want to show the error component for these)
|
|
189
193
|
if (isNotFound(error)) throw error
|
|
190
|
-
|
|
194
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
195
|
+
console.warn(`Warning: Error in route match: ${actualMatchId}`)
|
|
196
|
+
}
|
|
191
197
|
routeOnCatch.value?.(error)
|
|
192
198
|
},
|
|
193
199
|
children: content,
|
|
@@ -358,12 +364,24 @@ export const MatchInner = Vue.defineComponent({
|
|
|
358
364
|
}
|
|
359
365
|
|
|
360
366
|
if (match.value.status === 'notFound') {
|
|
361
|
-
|
|
367
|
+
if (!isNotFound(match.value.error)) {
|
|
368
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
369
|
+
throw new Error('Invariant failed: Expected a notFound error')
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
invariant()
|
|
373
|
+
}
|
|
362
374
|
return renderRouteNotFound(router, route.value, match.value.error)
|
|
363
375
|
}
|
|
364
376
|
|
|
365
377
|
if (match.value.status === 'redirected') {
|
|
366
|
-
|
|
378
|
+
if (!isRedirect(match.value.error)) {
|
|
379
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
380
|
+
throw new Error('Invariant failed: Expected a redirect error')
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
invariant()
|
|
384
|
+
}
|
|
367
385
|
throw router.getMatch(match.value.id)?._nonReactive.loadPromise
|
|
368
386
|
}
|
|
369
387
|
|
package/src/Matches.tsx
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as Vue from 'vue'
|
|
2
|
-
import warning from 'tiny-warning'
|
|
3
2
|
import { isServer } from '@tanstack/router-core/isServer'
|
|
4
3
|
import { useStore } from '@tanstack/vue-store'
|
|
5
4
|
import { CatchBoundary } from './CatchBoundary'
|
|
@@ -129,11 +128,10 @@ const MatchesInner = Vue.defineComponent({
|
|
|
129
128
|
onCatch:
|
|
130
129
|
process.env.NODE_ENV !== 'production'
|
|
131
130
|
? (error: Error) => {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
`The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,
|
|
131
|
+
console.warn(
|
|
132
|
+
`Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,
|
|
135
133
|
)
|
|
136
|
-
|
|
134
|
+
console.warn(`Warning: ${error.message || error.toString()}`)
|
|
137
135
|
}
|
|
138
136
|
: undefined,
|
|
139
137
|
children: childElement,
|
package/src/fileRoute.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import warning from 'tiny-warning'
|
|
2
1
|
import { createRoute } from './route'
|
|
3
2
|
|
|
4
3
|
import { useMatch } from './useMatch'
|
|
@@ -140,10 +139,11 @@ export class FileRoute<
|
|
|
140
139
|
THandlers
|
|
141
140
|
> => {
|
|
142
141
|
if (process.env.NODE_ENV !== 'production') {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
if (!this.silent) {
|
|
143
|
+
console.warn(
|
|
144
|
+
'Warning: FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.',
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
147
|
}
|
|
148
148
|
const route = createRoute(options as any)
|
|
149
149
|
;(route as any).isRoot = false
|
|
@@ -177,9 +177,8 @@ export function FileRouteLoader<
|
|
|
177
177
|
>,
|
|
178
178
|
) => TLoaderFn {
|
|
179
179
|
if (process.env.NODE_ENV !== 'production') {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
`FileRouteLoader is deprecated and will be removed in the next major version. Please place the loader function in the the main route file, inside the \`createFileRoute('/path/to/file')(options)\` options`,
|
|
180
|
+
console.warn(
|
|
181
|
+
`Warning: FileRouteLoader is deprecated and will be removed in the next major version. Please place the loader function in the the main route file, inside the \`createFileRoute('/path/to/file')(options)\` options`,
|
|
183
182
|
)
|
|
184
183
|
}
|
|
185
184
|
return (loaderFn) => loaderFn as any
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as Vue from 'vue'
|
|
2
|
-
import warning from 'tiny-warning'
|
|
3
2
|
import { DefaultGlobalNotFound } from './not-found'
|
|
4
3
|
import type { AnyRoute, AnyRouter } from '@tanstack/router-core'
|
|
5
4
|
|
|
@@ -21,11 +20,12 @@ export function renderRouteNotFound(
|
|
|
21
20
|
return Vue.h(router.options.defaultNotFoundComponent as any, data)
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
if (process.env.NODE_ENV
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
24
|
+
if (!route.options.notFoundComponent) {
|
|
25
|
+
console.warn(
|
|
26
|
+
`Warning: A notFoundError was encountered on the route with ID "${route.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`,
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
return Vue.h(DefaultGlobalNotFound)
|
package/src/useMatch.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Vue from 'vue'
|
|
2
|
+
import { invariant } from '@tanstack/router-core'
|
|
2
3
|
import { useStore } from '@tanstack/vue-store'
|
|
3
4
|
import { isServer } from '@tanstack/router-core/isServer'
|
|
4
|
-
import invariant from 'tiny-invariant'
|
|
5
5
|
import {
|
|
6
6
|
injectDummyPendingMatch,
|
|
7
7
|
injectPendingMatch,
|
|
@@ -87,10 +87,15 @@ export function useMatch<
|
|
|
87
87
|
: undefined
|
|
88
88
|
const match = matchStore?.state
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
if ((opts.shouldThrow ?? true) && !match) {
|
|
91
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
92
|
+
throw new Error(
|
|
93
|
+
`Invariant failed: Could not find ${opts.from ? `an active match from "${opts.from}"` : 'a nearest match!'}`,
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
invariant()
|
|
98
|
+
}
|
|
94
99
|
|
|
95
100
|
if (match === undefined) {
|
|
96
101
|
return Vue.ref(undefined) as Vue.Ref<
|
|
@@ -151,14 +156,19 @@ export function useMatch<
|
|
|
151
156
|
const hasPendingMatch = opts.from
|
|
152
157
|
? Boolean(hasPendingRouteMatch?.value[opts.from!])
|
|
153
158
|
: hasPendingNearestMatch.value
|
|
154
|
-
|
|
155
|
-
!
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
)
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
if (
|
|
160
|
+
!hasPendingMatch &&
|
|
161
|
+
!isTransitioning.value &&
|
|
162
|
+
(opts.shouldThrow ?? true)
|
|
163
|
+
) {
|
|
164
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
165
|
+
throw new Error(
|
|
166
|
+
`Invariant failed: Could not find ${opts.from ? `an active match from "${opts.from}"` : 'a nearest match!'}`,
|
|
167
|
+
)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
invariant()
|
|
171
|
+
}
|
|
162
172
|
|
|
163
173
|
return undefined
|
|
164
174
|
}
|
package/src/useRouter.tsx
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as Vue from 'vue'
|
|
2
|
-
import warning from 'tiny-warning'
|
|
3
2
|
import { routerContext } from './routerContext'
|
|
4
3
|
import type { AnyRouter, RegisteredRouter } from '@tanstack/router-core'
|
|
5
4
|
|
|
@@ -7,9 +6,12 @@ export function useRouter<TRouter extends AnyRouter = RegisteredRouter>(opts?: {
|
|
|
7
6
|
warn?: boolean
|
|
8
7
|
}): TRouter {
|
|
9
8
|
const value = Vue.inject(routerContext as any, null)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
10
|
+
if ((opts?.warn ?? true) && !value) {
|
|
11
|
+
console.warn(
|
|
12
|
+
'Warning: useRouter must be used inside a <RouterProvider> component!',
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
14
16
|
return value as any
|
|
15
17
|
}
|