@tanstack/solid-router 1.168.10 → 1.168.12
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/cjs/Match.cjs +6 -1
- package/dist/cjs/Match.cjs.map +1 -1
- package/dist/cjs/Matches.cjs.map +1 -1
- package/dist/cjs/Matches.d.cts +2 -2
- package/dist/esm/Match.js +6 -1
- package/dist/esm/Match.js.map +1 -1
- package/dist/esm/Matches.d.ts +2 -2
- package/dist/esm/Matches.js.map +1 -1
- package/dist/source/Match.jsx +7 -2
- package/dist/source/Match.jsx.map +1 -1
- package/dist/source/Matches.d.ts +2 -2
- package/dist/source/Matches.jsx.map +1 -1
- package/package.json +1 -1
- package/src/Match.tsx +20 -2
- package/src/Matches.tsx +3 -7
package/dist/cjs/Match.cjs
CHANGED
|
@@ -186,6 +186,9 @@ var MatchInner = () => {
|
|
|
186
186
|
if (Comp) return (0, solid_js_web.createComponent)(Comp, {});
|
|
187
187
|
return (0, solid_js_web.createComponent)(Outlet, {});
|
|
188
188
|
};
|
|
189
|
+
const getLoadPromise = (matchId, fallbackMatch) => {
|
|
190
|
+
return router.getMatch(matchId)?._nonReactive.loadPromise ?? fallbackMatch?._nonReactive.loadPromise;
|
|
191
|
+
};
|
|
189
192
|
const keyedOut = () => (0, solid_js_web.createComponent)(solid_js.Show, {
|
|
190
193
|
get when() {
|
|
191
194
|
return componentKey();
|
|
@@ -263,13 +266,15 @@ var MatchInner = () => {
|
|
|
263
266
|
return currentMatch().status === "redirected";
|
|
264
267
|
},
|
|
265
268
|
children: (_) => {
|
|
269
|
+
const matchId = currentMatch().id;
|
|
270
|
+
const routerMatch = router.getMatch(matchId);
|
|
266
271
|
if (!(0, _tanstack_router_core.isRedirect)(currentMatch().error)) {
|
|
267
272
|
if (process.env.NODE_ENV !== "production") throw new Error("Invariant failed: Expected a redirect error");
|
|
268
273
|
(0, _tanstack_router_core.invariant)();
|
|
269
274
|
}
|
|
270
275
|
const [loaderResult] = solid_js.createResource(async () => {
|
|
271
276
|
await new Promise((r) => setTimeout(r, 0));
|
|
272
|
-
return
|
|
277
|
+
return getLoadPromise(matchId, routerMatch);
|
|
273
278
|
});
|
|
274
279
|
return (0, solid_js_web.memo)(loaderResult);
|
|
275
280
|
}
|
package/dist/cjs/Match.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Match.cjs","names":["Solid","createControlledPromise","getLocationChangeInfo","invariant","isNotFound","isRedirect","rootRouteId","isServer","Dynamic","CatchBoundary","ErrorComponent","useRouter","CatchNotFound","getNotFound","nearestMatchContext","SafeFragment","renderRouteNotFound","ScrollRestoration","AnyRoute","RootRouteOptions","Match","props","matchId","router","match","createMemo","id","undefined","stores","activeMatchStoresById","get","state","rawMatchState","currentMatch","routeId","parentRouteId","routesById","parentRoute","ssr","_displayPending","hasPendingMatch","currentRouteId","Boolean","pendingRouteIds","nearestMatch","hasPending","_$createComponent","Show","when","children","currentMatchState","route","resolvePendingComponent","options","pendingComponent","defaultPendingComponent","routeErrorComponent","errorComponent","defaultErrorComponent","routeOnCatch","onCatch","defaultOnCatch","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","resolvedNoSsr","ResolvedSuspenseBoundary","Suspense","ResolvedCatchBoundary","ResolvedNotFoundBoundary","ShellComponent","shellComponent","Provider","value","fallback","_$memo","getResetKey","loadedAt","error","Error","notFoundError","process","env","NODE_ENV","console","warn","_$mergeProps","Switch","MatchInner","OnRendered","scrollRestoration","location","resolvedLocation","__TSR_key","createEffect","on","emit","type","useContext","remountFn","remountDeps","defaultRemountDeps","loaderDeps","params","_strictParams","search","_strictSearch","key","JSON","stringify","status","_forcePending","componentKey","out","Comp","defaultComponent","Outlet","keyedOut","keyed","_key","_","displayPendingResult","createResource","getMatch","_nonReactive","displayPendingPromise","minPendingResult","minPendingPromise","pendingMinMs","defaultPendingMinMs","routerMatch","setTimeout","resolve","loaderResult","Promise","r","loadPromise","FallbackComponent","_routeId","RouteErrorComponent","info","componentStack","nearestParentMatch","parentMatch","parentGlobalNotFound","globalNotFound","childMatchId","childMatchIdByRouteId","childMatchStatus","shouldShowNotFound","resolvedRoute","childMatchIdAccessor","currentMatchId"],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\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 { Dynamic } from 'solid-js/web'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound, getNotFound } from './not-found'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport type { AnyRoute, RootRouteOptions } from '@tanstack/router-core'\n\nexport const Match = (props: { matchId: string }) => {\n const router = useRouter()\n\n const match = Solid.createMemo(() => {\n const id = props.matchId\n if (!id) return undefined\n return router.stores.activeMatchStoresById.get(id)?.state\n })\n\n const rawMatchState = Solid.createMemo(() => {\n const currentMatch = match()\n if (!currentMatch) {\n return null\n }\n\n const routeId = currentMatch.routeId as string\n const parentRouteId = (router.routesById[routeId] as AnyRoute)?.parentRoute\n ?.id\n\n return {\n matchId: currentMatch.id,\n routeId,\n ssr: currentMatch.ssr,\n _displayPending: currentMatch._displayPending,\n parentRouteId: parentRouteId as string | undefined,\n }\n })\n\n const hasPendingMatch = Solid.createMemo(() => {\n const currentRouteId = rawMatchState()?.routeId\n return currentRouteId\n ? Boolean(router.stores.pendingRouteIds.state[currentRouteId])\n : false\n })\n const nearestMatch = {\n matchId: () => rawMatchState()?.matchId,\n routeId: () => rawMatchState()?.routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n return (\n <Solid.Show when={rawMatchState()}>\n {(currentMatchState) => {\n const route: () => AnyRoute = () =>\n router.routesById[currentMatchState().routeId]\n\n const resolvePendingComponent = () =>\n route().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const routeErrorComponent = () =>\n route().options.errorComponent ?? router.options.defaultErrorComponent\n\n const routeOnCatch = () =>\n route().options.onCatch ?? router.options.defaultOnCatch\n\n const routeNotFoundComponent = () =>\n route().isRoot\n ? // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component\n (route().options.notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : route().options.notFoundComponent\n\n const resolvedNoSsr =\n currentMatchState().ssr === false ||\n currentMatchState().ssr === 'data-only'\n\n const ResolvedSuspenseBoundary = () => Solid.Suspense\n\n const ResolvedCatchBoundary = () =>\n routeErrorComponent() ? CatchBoundary : SafeFragment\n\n const ResolvedNotFoundBoundary = () =>\n routeNotFoundComponent() ? CatchNotFound : SafeFragment\n\n const ShellComponent = route().isRoot\n ? ((route().options as RootRouteOptions).shellComponent ??\n SafeFragment)\n : SafeFragment\n\n return (\n <ShellComponent>\n <nearestMatchContext.Provider value={nearestMatch}>\n <Dynamic\n component={ResolvedSuspenseBoundary()}\n fallback={\n // Don't show fallback on server when using no-ssr mode to avoid hydration mismatch\n (isServer ?? router.isServer) && resolvedNoSsr ? undefined : (\n <Dynamic component={resolvePendingComponent()} />\n )\n }\n >\n <Dynamic\n component={ResolvedCatchBoundary()}\n getResetKey={() => router.stores.loadedAt.state}\n errorComponent={routeErrorComponent() || ErrorComponent}\n onCatch={(error: Error) => {\n // Forward not found errors (we don't want to show the error component for these)\n const notFoundError = getNotFound(error)\n if (notFoundError) {\n notFoundError.routeId ??= currentMatchState()\n .routeId as any\n throw notFoundError\n }\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Warning: Error in route match: ${currentMatchState().routeId}`,\n )\n }\n routeOnCatch()?.(error)\n }}\n >\n <Dynamic\n component={ResolvedNotFoundBoundary()}\n fallback={(error: any) => {\n const notFoundError = getNotFound(error) ?? error\n\n notFoundError.routeId ??= currentMatchState()\n .routeId as any\n\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() ||\n (notFoundError.routeId &&\n notFoundError.routeId !==\n currentMatchState().routeId) ||\n (!notFoundError.routeId && !route().isRoot)\n )\n throw notFoundError\n\n return (\n <Dynamic\n component={routeNotFoundComponent()}\n {...notFoundError}\n />\n )\n }}\n >\n <Solid.Switch>\n <Solid.Match when={resolvedNoSsr}>\n <Solid.Show\n when={!(isServer ?? router.isServer)}\n fallback={\n <Dynamic component={resolvePendingComponent()} />\n }\n >\n <MatchInner />\n </Solid.Show>\n </Solid.Match>\n <Solid.Match when={!resolvedNoSsr}>\n <MatchInner />\n </Solid.Match>\n </Solid.Switch>\n </Dynamic>\n </Dynamic>\n </Dynamic>\n </nearestMatchContext.Provider>\n\n {currentMatchState().parentRouteId === rootRouteId ? (\n <>\n <OnRendered />\n {router.options.scrollRestoration &&\n (isServer ?? router.isServer) ? (\n <ScrollRestoration />\n ) : null}\n </>\n ) : null}\n </ShellComponent>\n )\n }}\n </Solid.Show>\n )\n}\n\n// On Rendered can't happen above the root layout because it needs to run\n// after the app has committed below the root layout. Keeping it here lets us\n// fire onRendered even after a hydration mismatch above the root layout\n// (like bad head/link tags, which is common).\nfunction OnRendered() {\n const router = useRouter()\n\n const location = Solid.createMemo(\n () => router.stores.resolvedLocation.state?.state.__TSR_key,\n )\n Solid.createEffect(\n Solid.on([location], () => {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(\n router.stores.location.state,\n router.stores.resolvedLocation.state,\n ),\n })\n }),\n )\n return null\n}\n\nexport const MatchInner = (): any => {\n const router = useRouter()\n const match = Solid.useContext(nearestMatchContext).match\n\n const rawMatchState = Solid.createMemo(() => {\n const currentMatch = match()\n if (!currentMatch) {\n return null\n }\n\n const routeId = currentMatch.routeId as string\n\n const remountFn =\n (router.routesById[routeId] as AnyRoute).options.remountDeps ??\n router.options.defaultRemountDeps\n const remountDeps = remountFn?.({\n routeId,\n loaderDeps: currentMatch.loaderDeps,\n params: currentMatch._strictParams,\n search: currentMatch._strictSearch,\n })\n const key = remountDeps ? JSON.stringify(remountDeps) : undefined\n\n return {\n key,\n routeId,\n match: {\n id: currentMatch.id,\n status: currentMatch.status,\n error: currentMatch.error,\n _forcePending: currentMatch._forcePending ?? false,\n _displayPending: currentMatch._displayPending ?? false,\n },\n }\n })\n\n return (\n <Solid.Show when={rawMatchState()}>\n {(currentMatchState) => {\n const route = () => router.routesById[currentMatchState().routeId]!\n\n const currentMatch = () => currentMatchState().match\n\n const componentKey = () =>\n currentMatchState().key ?? currentMatchState().match.id\n\n const out = () => {\n const Comp =\n route().options.component ?? router.options.defaultComponent\n if (Comp) {\n return <Comp />\n }\n return <Outlet />\n }\n\n const keyedOut = () => (\n <Solid.Show when={componentKey()} keyed>\n {(_key) => out()}\n </Solid.Show>\n )\n\n return (\n <Solid.Switch>\n <Solid.Match when={currentMatch()._displayPending}>\n {(_) => {\n const [displayPendingResult] = Solid.createResource(\n () =>\n router.getMatch(currentMatch().id)?._nonReactive\n .displayPendingPromise,\n )\n\n return <>{displayPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch()._forcePending}>\n {(_) => {\n const [minPendingResult] = Solid.createResource(\n () =>\n router.getMatch(currentMatch().id)?._nonReactive\n .minPendingPromise,\n )\n\n return <>{minPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'pending'}>\n {(_) => {\n const pendingMinMs =\n route().options.pendingMinMs ??\n router.options.defaultPendingMinMs\n\n if (pendingMinMs) {\n const routerMatch = router.getMatch(currentMatch().id)\n if (\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 =\n 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\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(currentMatch().id)?._nonReactive\n .loadPromise\n })\n\n const FallbackComponent =\n route().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n return (\n <>\n {FallbackComponent && pendingMinMs > 0 ? (\n <Dynamic component={FallbackComponent} />\n ) : null}\n {loaderResult()}\n </>\n )\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'notFound'}>\n {(_) => {\n if (!isNotFound(currentMatch().error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'Invariant failed: Expected a notFound error',\n )\n }\n\n invariant()\n }\n\n // Use Show with keyed to ensure re-render when routeId changes\n return (\n <Solid.Show when={currentMatchState().routeId} keyed>\n {(_routeId) =>\n renderRouteNotFound(router, route(), currentMatch().error)\n }\n </Solid.Show>\n )\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'redirected'}>\n {(_) => {\n if (!isRedirect(currentMatch().error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'Invariant failed: Expected a redirect error',\n )\n }\n\n invariant()\n }\n\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(currentMatch().id)?._nonReactive\n .loadPromise\n })\n\n return <>{loaderResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'error'}>\n {(_) => {\n if (isServer ?? router.isServer) {\n const RouteErrorComponent =\n (route().options.errorComponent ??\n router.options.defaultErrorComponent) ||\n ErrorComponent\n\n return (\n <RouteErrorComponent\n error={currentMatch().error}\n info={{\n componentStack: '',\n }}\n />\n )\n }\n\n throw currentMatch().error\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'success'}>\n {keyedOut()}\n </Solid.Match>\n </Solid.Switch>\n )\n }}\n </Solid.Show>\n )\n}\n\nexport const Outlet = () => {\n const router = useRouter()\n const nearestParentMatch = Solid.useContext(nearestMatchContext)\n const parentMatch = nearestParentMatch.match\n const routeId = nearestParentMatch.routeId\n const route = Solid.createMemo(() =>\n routeId() ? router.routesById[routeId()!] : undefined,\n )\n\n const parentGlobalNotFound = Solid.createMemo(\n () => parentMatch()?.globalNotFound ?? false,\n )\n\n const childMatchId = Solid.createMemo(() => {\n const currentRouteId = routeId()\n return currentRouteId\n ? router.stores.childMatchIdByRouteId.state[currentRouteId]\n : undefined\n })\n\n const childMatchStatus = Solid.createMemo(() => {\n const id = childMatchId()\n if (!id) return undefined\n return router.stores.activeMatchStoresById.get(id)?.state.status\n })\n\n // Only show not-found if we're not in a redirected state\n const shouldShowNotFound = () =>\n childMatchStatus() !== 'redirected' && parentGlobalNotFound()\n\n return (\n <Solid.Show\n when={!shouldShowNotFound() && childMatchId()}\n fallback={\n <Solid.Show when={shouldShowNotFound() && route()}>\n {(resolvedRoute) =>\n renderRouteNotFound(router, resolvedRoute(), undefined)\n }\n </Solid.Show>\n }\n >\n {(childMatchIdAccessor) => {\n const currentMatchId = Solid.createMemo(() => childMatchIdAccessor())\n\n return (\n <Solid.Show\n when={routeId() === rootRouteId}\n fallback={<Match matchId={currentMatchId()} />}\n >\n <Solid.Suspense\n fallback={\n <Dynamic component={router.options.defaultPendingComponent} />\n }\n >\n <Match matchId={currentMatchId()} />\n </Solid.Suspense>\n </Solid.Show>\n )\n }}\n </Solid.Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,IAAaoB,SAASC,UAA+B;CACnD,MAAME,SAASZ,kBAAAA,WAAW;CAE1B,MAAMa,QAAQxB,SAAMyB,iBAAiB;EACnC,MAAMC,KAAKL,MAAMC;AACjB,MAAI,CAACI,GAAI,QAAOC,KAAAA;AAChB,SAAOJ,OAAOK,OAAOC,sBAAsBC,IAAIJ,GAAG,EAAEK;GACpD;CAEF,MAAMC,gBAAgBhC,SAAMyB,iBAAiB;EAC3C,MAAMQ,eAAeT,OAAO;AAC5B,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zJ,SAAM+C,MAAI;IAAA,IACTC,OAAI;AAAA,YAAEd,SAAS,KAAK5B,sBAAAA;;IAAW,IAC/BsE,WAAQ;AAAA,aAAA,GAAA,aAAA,iBAAGxD,OAAK,EAAA,IAACE,UAAO;AAAA,aAAEoI,gBAAgB;QAAA,CAAA;;IAAA,IAAAzG,WAAA;AAAA,aAAA,GAAA,aAAA,iBAEzCjD,SAAMqE,UAAQ;MAAA,IACbO,WAAQ;AAAA,eAAA,GAAA,aAAA,iBACLpE,aAAAA,SAAO,EAAA,IAAC0D,YAAS;AAAA,eAAE3C,OAAO8B,QAAQE;UAAuB,CAAA;;MAAA,IAAAN,WAAA;AAAA,eAAA,GAAA,aAAA,iBAG3D7B,OAAK,EAAA,IAACE,UAAO;AAAA,eAAEoI,gBAAgB;UAAA,CAAA;;MAAA,CAAA;;IAAA,CAAA;;EAIvC,CAAA"}
|
|
1
|
+
{"version":3,"file":"Match.cjs","names":["Solid","createControlledPromise","getLocationChangeInfo","invariant","isNotFound","isRedirect","rootRouteId","isServer","Dynamic","CatchBoundary","ErrorComponent","useRouter","CatchNotFound","getNotFound","nearestMatchContext","SafeFragment","renderRouteNotFound","ScrollRestoration","AnyRoute","RootRouteOptions","Match","props","matchId","router","match","createMemo","id","undefined","stores","activeMatchStoresById","get","state","rawMatchState","currentMatch","routeId","parentRouteId","routesById","parentRoute","ssr","_displayPending","hasPendingMatch","currentRouteId","Boolean","pendingRouteIds","nearestMatch","hasPending","_$createComponent","Show","when","children","currentMatchState","route","resolvePendingComponent","options","pendingComponent","defaultPendingComponent","routeErrorComponent","errorComponent","defaultErrorComponent","routeOnCatch","onCatch","defaultOnCatch","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","resolvedNoSsr","ResolvedSuspenseBoundary","Suspense","ResolvedCatchBoundary","ResolvedNotFoundBoundary","ShellComponent","shellComponent","Provider","value","fallback","_$memo","getResetKey","loadedAt","error","Error","notFoundError","process","env","NODE_ENV","console","warn","_$mergeProps","Switch","MatchInner","OnRendered","scrollRestoration","location","resolvedLocation","__TSR_key","createEffect","on","emit","type","useContext","remountFn","remountDeps","defaultRemountDeps","loaderDeps","params","_strictParams","search","_strictSearch","key","JSON","stringify","status","_forcePending","componentKey","out","Comp","defaultComponent","Outlet","getLoadPromise","fallbackMatch","_nonReactive","loadPromise","Promise","getMatch","keyedOut","keyed","_key","_","displayPendingResult","createResource","displayPendingPromise","minPendingResult","minPendingPromise","pendingMinMs","defaultPendingMinMs","routerMatch","setTimeout","resolve","loaderResult","r","FallbackComponent","_routeId","RouteErrorComponent","info","componentStack","nearestParentMatch","parentMatch","parentGlobalNotFound","globalNotFound","childMatchId","childMatchIdByRouteId","childMatchStatus","shouldShowNotFound","resolvedRoute","childMatchIdAccessor","currentMatchId"],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\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 { Dynamic } from 'solid-js/web'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound, getNotFound } from './not-found'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport type { AnyRoute, RootRouteOptions } from '@tanstack/router-core'\n\nexport const Match = (props: { matchId: string }) => {\n const router = useRouter()\n\n const match = Solid.createMemo(() => {\n const id = props.matchId\n if (!id) return undefined\n return router.stores.activeMatchStoresById.get(id)?.state\n })\n\n const rawMatchState = Solid.createMemo(() => {\n const currentMatch = match()\n if (!currentMatch) {\n return null\n }\n\n const routeId = currentMatch.routeId as string\n const parentRouteId = (router.routesById[routeId] as AnyRoute)?.parentRoute\n ?.id\n\n return {\n matchId: currentMatch.id,\n routeId,\n ssr: currentMatch.ssr,\n _displayPending: currentMatch._displayPending,\n parentRouteId: parentRouteId as string | undefined,\n }\n })\n\n const hasPendingMatch = Solid.createMemo(() => {\n const currentRouteId = rawMatchState()?.routeId\n return currentRouteId\n ? Boolean(router.stores.pendingRouteIds.state[currentRouteId])\n : false\n })\n const nearestMatch = {\n matchId: () => rawMatchState()?.matchId,\n routeId: () => rawMatchState()?.routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n return (\n <Solid.Show when={rawMatchState()}>\n {(currentMatchState) => {\n const route: () => AnyRoute = () =>\n router.routesById[currentMatchState().routeId]\n\n const resolvePendingComponent = () =>\n route().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const routeErrorComponent = () =>\n route().options.errorComponent ?? router.options.defaultErrorComponent\n\n const routeOnCatch = () =>\n route().options.onCatch ?? router.options.defaultOnCatch\n\n const routeNotFoundComponent = () =>\n route().isRoot\n ? // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component\n (route().options.notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : route().options.notFoundComponent\n\n const resolvedNoSsr =\n currentMatchState().ssr === false ||\n currentMatchState().ssr === 'data-only'\n\n const ResolvedSuspenseBoundary = () => Solid.Suspense\n\n const ResolvedCatchBoundary = () =>\n routeErrorComponent() ? CatchBoundary : SafeFragment\n\n const ResolvedNotFoundBoundary = () =>\n routeNotFoundComponent() ? CatchNotFound : SafeFragment\n\n const ShellComponent = route().isRoot\n ? ((route().options as RootRouteOptions).shellComponent ??\n SafeFragment)\n : SafeFragment\n\n return (\n <ShellComponent>\n <nearestMatchContext.Provider value={nearestMatch}>\n <Dynamic\n component={ResolvedSuspenseBoundary()}\n fallback={\n // Don't show fallback on server when using no-ssr mode to avoid hydration mismatch\n (isServer ?? router.isServer) && resolvedNoSsr ? undefined : (\n <Dynamic component={resolvePendingComponent()} />\n )\n }\n >\n <Dynamic\n component={ResolvedCatchBoundary()}\n getResetKey={() => router.stores.loadedAt.state}\n errorComponent={routeErrorComponent() || ErrorComponent}\n onCatch={(error: Error) => {\n // Forward not found errors (we don't want to show the error component for these)\n const notFoundError = getNotFound(error)\n if (notFoundError) {\n notFoundError.routeId ??= currentMatchState()\n .routeId as any\n throw notFoundError\n }\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Warning: Error in route match: ${currentMatchState().routeId}`,\n )\n }\n routeOnCatch()?.(error)\n }}\n >\n <Dynamic\n component={ResolvedNotFoundBoundary()}\n fallback={(error: any) => {\n const notFoundError = getNotFound(error) ?? error\n\n notFoundError.routeId ??= currentMatchState()\n .routeId as any\n\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() ||\n (notFoundError.routeId &&\n notFoundError.routeId !==\n currentMatchState().routeId) ||\n (!notFoundError.routeId && !route().isRoot)\n )\n throw notFoundError\n\n return (\n <Dynamic\n component={routeNotFoundComponent()}\n {...notFoundError}\n />\n )\n }}\n >\n <Solid.Switch>\n <Solid.Match when={resolvedNoSsr}>\n <Solid.Show\n when={!(isServer ?? router.isServer)}\n fallback={\n <Dynamic component={resolvePendingComponent()} />\n }\n >\n <MatchInner />\n </Solid.Show>\n </Solid.Match>\n <Solid.Match when={!resolvedNoSsr}>\n <MatchInner />\n </Solid.Match>\n </Solid.Switch>\n </Dynamic>\n </Dynamic>\n </Dynamic>\n </nearestMatchContext.Provider>\n\n {currentMatchState().parentRouteId === rootRouteId ? (\n <>\n <OnRendered />\n {router.options.scrollRestoration &&\n (isServer ?? router.isServer) ? (\n <ScrollRestoration />\n ) : null}\n </>\n ) : null}\n </ShellComponent>\n )\n }}\n </Solid.Show>\n )\n}\n\n// On Rendered can't happen above the root layout because it needs to run\n// after the app has committed below the root layout. Keeping it here lets us\n// fire onRendered even after a hydration mismatch above the root layout\n// (like bad head/link tags, which is common).\nfunction OnRendered() {\n const router = useRouter()\n\n const location = Solid.createMemo(\n () => router.stores.resolvedLocation.state?.state.__TSR_key,\n )\n Solid.createEffect(\n Solid.on([location], () => {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(\n router.stores.location.state,\n router.stores.resolvedLocation.state,\n ),\n })\n }),\n )\n return null\n}\n\nexport const MatchInner = (): any => {\n const router = useRouter()\n const match = Solid.useContext(nearestMatchContext).match\n\n const rawMatchState = Solid.createMemo(() => {\n const currentMatch = match()\n if (!currentMatch) {\n return null\n }\n\n const routeId = currentMatch.routeId as string\n\n const remountFn =\n (router.routesById[routeId] as AnyRoute).options.remountDeps ??\n router.options.defaultRemountDeps\n const remountDeps = remountFn?.({\n routeId,\n loaderDeps: currentMatch.loaderDeps,\n params: currentMatch._strictParams,\n search: currentMatch._strictSearch,\n })\n const key = remountDeps ? JSON.stringify(remountDeps) : undefined\n\n return {\n key,\n routeId,\n match: {\n id: currentMatch.id,\n status: currentMatch.status,\n error: currentMatch.error,\n _forcePending: currentMatch._forcePending ?? false,\n _displayPending: currentMatch._displayPending ?? false,\n },\n }\n })\n\n return (\n <Solid.Show when={rawMatchState()}>\n {(currentMatchState) => {\n const route = () => router.routesById[currentMatchState().routeId]!\n\n const currentMatch = () => currentMatchState().match\n\n const componentKey = () =>\n currentMatchState().key ?? currentMatchState().match.id\n\n const out = () => {\n const Comp =\n route().options.component ?? router.options.defaultComponent\n if (Comp) {\n return <Comp />\n }\n return <Outlet />\n }\n\n const getLoadPromise = (\n matchId: string,\n fallbackMatch:\n | {\n _nonReactive: {\n loadPromise?: Promise<void>\n }\n }\n | undefined,\n ) => {\n return (\n router.getMatch(matchId)?._nonReactive.loadPromise ??\n fallbackMatch?._nonReactive.loadPromise\n )\n }\n\n const keyedOut = () => (\n <Solid.Show when={componentKey()} keyed>\n {(_key) => out()}\n </Solid.Show>\n )\n\n return (\n <Solid.Switch>\n <Solid.Match when={currentMatch()._displayPending}>\n {(_) => {\n const [displayPendingResult] = Solid.createResource(\n () =>\n router.getMatch(currentMatch().id)?._nonReactive\n .displayPendingPromise,\n )\n\n return <>{displayPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch()._forcePending}>\n {(_) => {\n const [minPendingResult] = Solid.createResource(\n () =>\n router.getMatch(currentMatch().id)?._nonReactive\n .minPendingPromise,\n )\n\n return <>{minPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'pending'}>\n {(_) => {\n const pendingMinMs =\n route().options.pendingMinMs ??\n router.options.defaultPendingMinMs\n\n if (pendingMinMs) {\n const routerMatch = router.getMatch(currentMatch().id)\n if (\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 =\n 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\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(currentMatch().id)?._nonReactive\n .loadPromise\n })\n\n const FallbackComponent =\n route().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n return (\n <>\n {FallbackComponent && pendingMinMs > 0 ? (\n <Dynamic component={FallbackComponent} />\n ) : null}\n {loaderResult()}\n </>\n )\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'notFound'}>\n {(_) => {\n if (!isNotFound(currentMatch().error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'Invariant failed: Expected a notFound error',\n )\n }\n\n invariant()\n }\n\n // Use Show with keyed to ensure re-render when routeId changes\n return (\n <Solid.Show when={currentMatchState().routeId} keyed>\n {(_routeId) =>\n renderRouteNotFound(router, route(), currentMatch().error)\n }\n </Solid.Show>\n )\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'redirected'}>\n {(_) => {\n const matchId = currentMatch().id\n const routerMatch = router.getMatch(matchId)\n\n if (!isRedirect(currentMatch().error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'Invariant failed: Expected a redirect error',\n )\n }\n\n invariant()\n }\n\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return getLoadPromise(matchId, routerMatch)\n })\n\n return <>{loaderResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'error'}>\n {(_) => {\n if (isServer ?? router.isServer) {\n const RouteErrorComponent =\n (route().options.errorComponent ??\n router.options.defaultErrorComponent) ||\n ErrorComponent\n\n return (\n <RouteErrorComponent\n error={currentMatch().error}\n info={{\n componentStack: '',\n }}\n />\n )\n }\n\n throw currentMatch().error\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'success'}>\n {keyedOut()}\n </Solid.Match>\n </Solid.Switch>\n )\n }}\n </Solid.Show>\n )\n}\n\nexport const Outlet = () => {\n const router = useRouter()\n const nearestParentMatch = Solid.useContext(nearestMatchContext)\n const parentMatch = nearestParentMatch.match\n const routeId = nearestParentMatch.routeId\n const route = Solid.createMemo(() =>\n routeId() ? router.routesById[routeId()!] : undefined,\n )\n\n const parentGlobalNotFound = Solid.createMemo(\n () => parentMatch()?.globalNotFound ?? false,\n )\n\n const childMatchId = Solid.createMemo(() => {\n const currentRouteId = routeId()\n return currentRouteId\n ? router.stores.childMatchIdByRouteId.state[currentRouteId]\n : undefined\n })\n\n const childMatchStatus = Solid.createMemo(() => {\n const id = childMatchId()\n if (!id) return undefined\n return router.stores.activeMatchStoresById.get(id)?.state.status\n })\n\n // Only show not-found if we're not in a redirected state\n const shouldShowNotFound = () =>\n childMatchStatus() !== 'redirected' && parentGlobalNotFound()\n\n return (\n <Solid.Show\n when={!shouldShowNotFound() && childMatchId()}\n fallback={\n <Solid.Show when={shouldShowNotFound() && route()}>\n {(resolvedRoute) =>\n renderRouteNotFound(router, resolvedRoute(), undefined)\n }\n </Solid.Show>\n }\n >\n {(childMatchIdAccessor) => {\n const currentMatchId = Solid.createMemo(() => childMatchIdAccessor())\n\n return (\n <Solid.Show\n when={routeId() === rootRouteId}\n fallback={<Match matchId={currentMatchId()} />}\n >\n <Solid.Suspense\n fallback={\n <Dynamic component={router.options.defaultPendingComponent} />\n }\n >\n <Match matchId={currentMatchId()} />\n </Solid.Suspense>\n </Solid.Show>\n )\n }}\n </Solid.Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,IAAaoB,SAASC,UAA+B;CACnD,MAAME,SAASZ,kBAAAA,WAAW;CAE1B,MAAMa,QAAQxB,SAAMyB,iBAAiB;EACnC,MAAMC,KAAKL,MAAMC;AACjB,MAAI,CAACI,GAAI,QAAOC,KAAAA;AAChB,SAAOJ,OAAOK,OAAOC,sBAAsBC,IAAIJ,GAAG,EAAEK;GACpD;CAEF,MAAMC,gBAAgBhC,SAAMyB,iBAAiB;EAC3C,MAAMQ,eAAeT,OAAO;AAC5B,MAAI,CAACS,aACH,QAAO;EAGT,MAAMC,UAAUD,aAAaC;EAC7B,MAAMC,gBAAiBZ,OAAOa,WAAWF,UAAuBG,aAC5DX;AAEJ,SAAO;GACLJ,SAASW,aAAaP;GACtBQ;GACAI,KAAKL,aAAaK;GAClBC,iBAAiBN,aAAaM;GACfJ;GAChB;GACD;CAQF,MAAMS,eAAe;EACnBtB,eAAeU,eAAe,EAAEV;EAChCY,eAAeF,eAAe,EAAEE;EAChCV;EACAqB,YAVsB7C,SAAMyB,iBAAiB;GAC7C,MAAMgB,iBAAiBT,eAAe,EAAEE;AACxC,UAAOO,iBACHC,QAAQnB,OAAOK,OAAOe,gBAAgBZ,MAAMU,gBAAgB,GAC5D;IACJ;EAMD;AAED,SAAA,GAAA,aAAA,iBACGzC,SAAM+C,MAAI;EAAA,IAACC,OAAI;AAAA,UAAEhB,eAAe;;EAAAiB,WAC7BC,sBAAsB;GACtB,MAAMC,cACJ5B,OAAOa,WAAWc,mBAAmB,CAAChB;GAExC,MAAMkB,gCACJD,OAAO,CAACE,QAAQC,oBAChB/B,OAAO8B,QAAQE;GAEjB,MA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AIvC,CAAA"}
|
package/dist/cjs/Matches.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Matches.cjs","names":["Solid","replaceEqualDeep","rootRouteId","isServer","CatchBoundary","ErrorComponent","useRouter","Transitioner","nearestMatchContext","SafeFragment","Match","AnyRoute","AnyRouter","DeepPartial","Expand","MakeOptionalPathParams","MakeOptionalSearchParams","MakeRouteMatchUnion","MaskOptions","MatchRouteOptions","NoInfer","RegisteredRouter","ResolveRelativePath","ResolveRoute","RouteByPath","ToSubOptionsProps","RouteMatchExtensions","meta","Array","JSX","IntrinsicElements","links","scripts","styles","headScripts","Matches","router","ResolvedSuspense","document","ssr","Suspense","rootRoute","routesById","PendingComponent","options","pendingComponent","defaultPendingComponent","OptionalWrapper","InnerWrap","_$createComponent","children","fallback","MatchesInner","matchId","stores","firstMatchId","state","routeId","undefined","match","getMatchStoreByRouteId","hasPendingMatch","Boolean","pendingRouteIds","resetKey","loadedAt","nearestMatch","hasPending","matchComponent","Show","when","Provider","value","_$memo","disableGlobalCatchBoundary","getResetKey","errorComponent","onCatch","process","env","NODE_ENV","error","console","warn","message","toString","UseMatchRouteOptions","TFrom","TRouter","TTo","TMaskFrom","TMaskTo","useMatchRoute","opts","Accessor","createMemo","pending","caseSensitive","fuzzy","includeSearch","rest","matchRouteReactivity","matchRoute","MakeMatchRouteOptions","params","Element","MatchRoute","props","renderedChild","matchedParams","child","UseMatchesBaseOptions","select","matches","TSelected","UseMatchesResult","useMatches","prev","activeMatchesSnapshot","res","useParentMatches","contextMatchId","useContext","slice","findIndex","d","id","useChildMatches"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep, rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { Transitioner } from './Transitioner'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Match } from './Match'\nimport type {\n AnyRoute,\n AnyRouter,\n DeepPartial,\n Expand,\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\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<Solid.JSX.IntrinsicElements['meta'] | undefined>\n links?: Array<Solid.JSX.IntrinsicElements['link'] | undefined>\n scripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n styles?: Array<Solid.JSX.IntrinsicElements['style'] | undefined>\n headScripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n }\n}\n\nexport function Matches() {\n const router = useRouter()\n\n const ResolvedSuspense =\n (isServer ?? router.isServer) ||\n (typeof document !== 'undefined' && router.ssr)\n ? SafeFragment\n : Solid.Suspense\n\n const rootRoute: () => AnyRoute = () => router.routesById[rootRouteId]\n const PendingComponent =\n rootRoute().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const OptionalWrapper = router.options.InnerWrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <ResolvedSuspense\n fallback={PendingComponent ? <PendingComponent /> : null}\n >\n <Transitioner />\n <MatchesInner />\n </ResolvedSuspense>\n </OptionalWrapper>\n )\n}\n\nfunction MatchesInner() {\n const router = useRouter()\n const matchId = () => router.stores.firstMatchId.state\n const routeId = () => (matchId() ? rootRouteId : undefined)\n const match = () =>\n routeId()\n ? router.stores.getMatchStoreByRouteId(rootRouteId).state\n : undefined\n const hasPendingMatch = () =>\n routeId()\n ? Boolean(router.stores.pendingRouteIds.state[rootRouteId])\n : false\n const resetKey = () => router.stores.loadedAt.state\n const nearestMatch = {\n matchId,\n routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n const matchComponent = () => {\n return (\n <Solid.Show when={matchId()}>\n <Match matchId={matchId()!} />\n </Solid.Show>\n )\n }\n\n return (\n <nearestMatchContext.Provider value={nearestMatch}>\n {router.options.disableGlobalCatchBoundary ? (\n matchComponent()\n ) : (\n <CatchBoundary\n getResetKey={() => resetKey()}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (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 }\n >\n {matchComponent()}\n </CatchBoundary>\n )}\n </nearestMatchContext.Provider>\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 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 ): Solid.Accessor<\n false | Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>\n > => {\n return Solid.createMemo(() => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n router.stores.matchRouteReactivity.state\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\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 ) => Solid.JSX.Element)\n | Solid.JSX.Element\n}\n\nexport function MatchRoute<\n TRouter extends AnyRouter = RegisteredRouter,\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>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any)\n\n const renderedChild = Solid.createMemo(() => {\n const matchedParams = params()\n const child = props.children\n\n if (typeof child === 'function') {\n return (child as any)(matchedParams)\n }\n\n return matchedParams ? child : null\n })\n\n return <>{renderedChild()}</>\n}\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): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return Solid.createMemo((prev: TSelected | undefined) => {\n const matches = router.stores.activeMatchesSnapshot.state as Array<\n MakeRouteMatchUnion<TRouter>\n >\n const res = opts?.select ? opts.select(matches) : matches\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res) as any\n }) as Solid.Accessor<UseMatchesResult<TRouter, TSelected>>\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n 0,\n matches.findIndex((d) => d.id === contextMatchId()),\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): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n matches.findIndex((d) => d.id === contextMatchId()) + 1,\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n"],"mappings":";;;;;;;;;;;;;AAqCA,SAAgBmC,UAAU;CACxB,MAAMC,SAAS9B,kBAAAA,WAAW;CAE1B,MAAM+B,oBACHlC,+BAAAA,YAAYiC,OAAOjC,aACnB,OAAOmC,aAAa,eAAeF,OAAOG,MACvC9B,qBAAAA,eACAT,SAAMwC;CAEZ,MAAMC,kBAAkCL,OAAOM,WAAWxC,sBAAAA;CAC1D,MAAMyC,mBACJF,WAAW,CAACG,QAAQC,oBACpBT,OAAOQ,QAAQE;AAIjB,SAAA,GAAA,aAAA,iBAFwBV,OAAOQ,QAAQI,aAAavC,qBAAAA,cAGlC,EAAA,IAAAyC,WAAA;AAAA,UAAA,GAAA,aAAA,iBACbb,kBAAgB;GAAA,IACfc,WAAQ;AAAA,WAAER,oBAAAA,GAAAA,aAAAA,iBAAoBA,kBAAgB,EAAA,CAAA,GAAM;;GAAI,IAAAO,WAAA;AAAA,WAAA,EAAA,GAAA,aAAA,iBAEvD3C,qBAAAA,cAAY,EAAA,CAAA,GAAA,GAAA,aAAA,iBACZ6C,cAAY,EAAA,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AAGX,SAAgBc,gBAIdlC,MACsD;CACtD,MAAM4B,iBAAiBzH,SAAM0H,WAAWlH,qBAAAA,oBAAoB,CAAC6C;AAE7D,QAAO+D,WAAW,EAChBJ,SAASC,YAAiD;AACxDA,YAAUA,QAAQU,MAChBV,QAAQW,WAAWC,MAAMA,EAAEC,OAAOL,gBAAgB,CAAC,GAAG,EACvD;AACD,SAAO5B,MAAMmB,SAASnB,KAAKmB,OAAOC,QAAQ,GAAGA;IAEhD,CAAQ"}
|
|
1
|
+
{"version":3,"file":"Matches.cjs","names":["Solid","replaceEqualDeep","rootRouteId","isServer","CatchBoundary","ErrorComponent","useRouter","Transitioner","nearestMatchContext","SafeFragment","Match","AnyRoute","AnyRouter","DeepPartial","Expand","MakeOptionalPathParams","MakeOptionalSearchParams","MakeRouteMatchUnion","MaskOptions","MatchRouteOptions","RegisteredRouter","ResolveRoute","ToSubOptionsProps","RouteMatchExtensions","meta","Array","JSX","IntrinsicElements","links","scripts","styles","headScripts","Matches","router","ResolvedSuspense","document","ssr","Suspense","rootRoute","routesById","PendingComponent","options","pendingComponent","defaultPendingComponent","OptionalWrapper","InnerWrap","_$createComponent","children","fallback","MatchesInner","matchId","stores","firstMatchId","state","routeId","undefined","match","getMatchStoreByRouteId","hasPendingMatch","Boolean","pendingRouteIds","resetKey","loadedAt","nearestMatch","hasPending","matchComponent","Show","when","Provider","value","_$memo","disableGlobalCatchBoundary","getResetKey","errorComponent","onCatch","process","env","NODE_ENV","error","console","warn","message","toString","UseMatchRouteOptions","TFrom","TRouter","TTo","TMaskFrom","TMaskTo","useMatchRoute","opts","Accessor","createMemo","pending","caseSensitive","fuzzy","includeSearch","rest","matchRouteReactivity","matchRoute","MakeMatchRouteOptions","params","Element","MatchRoute","props","renderedChild","matchedParams","child","UseMatchesBaseOptions","select","matches","TSelected","UseMatchesResult","useMatches","prev","activeMatchesSnapshot","res","useParentMatches","contextMatchId","useContext","slice","findIndex","d","id","useChildMatches"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep, rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { Transitioner } from './Transitioner'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Match } from './Match'\nimport type {\n AnyRoute,\n AnyRouter,\n DeepPartial,\n Expand,\n MakeOptionalPathParams,\n MakeOptionalSearchParams,\n MakeRouteMatchUnion,\n MaskOptions,\n MatchRouteOptions,\n RegisteredRouter,\n ResolveRoute,\n ToSubOptionsProps,\n} from '@tanstack/router-core'\n\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<Solid.JSX.IntrinsicElements['meta'] | undefined>\n links?: Array<Solid.JSX.IntrinsicElements['link'] | undefined>\n scripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n styles?: Array<Solid.JSX.IntrinsicElements['style'] | undefined>\n headScripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n }\n}\n\nexport function Matches() {\n const router = useRouter()\n\n const ResolvedSuspense =\n (isServer ?? router.isServer) ||\n (typeof document !== 'undefined' && router.ssr)\n ? SafeFragment\n : Solid.Suspense\n\n const rootRoute: () => AnyRoute = () => router.routesById[rootRouteId]\n const PendingComponent =\n rootRoute().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const OptionalWrapper = router.options.InnerWrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <ResolvedSuspense\n fallback={PendingComponent ? <PendingComponent /> : null}\n >\n <Transitioner />\n <MatchesInner />\n </ResolvedSuspense>\n </OptionalWrapper>\n )\n}\n\nfunction MatchesInner() {\n const router = useRouter()\n const matchId = () => router.stores.firstMatchId.state\n const routeId = () => (matchId() ? rootRouteId : undefined)\n const match = () =>\n routeId()\n ? router.stores.getMatchStoreByRouteId(rootRouteId).state\n : undefined\n const hasPendingMatch = () =>\n routeId()\n ? Boolean(router.stores.pendingRouteIds.state[rootRouteId])\n : false\n const resetKey = () => router.stores.loadedAt.state\n const nearestMatch = {\n matchId,\n routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n const matchComponent = () => {\n return (\n <Solid.Show when={matchId()}>\n <Match matchId={matchId()!} />\n </Solid.Show>\n )\n }\n\n return (\n <nearestMatchContext.Provider value={nearestMatch}>\n {router.options.disableGlobalCatchBoundary ? (\n matchComponent()\n ) : (\n <CatchBoundary\n getResetKey={() => resetKey()}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (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 }\n >\n {matchComponent()}\n </CatchBoundary>\n )}\n </nearestMatchContext.Provider>\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 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 ): Solid.Accessor<\n false | Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>\n > => {\n return Solid.createMemo(() => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n router.stores.matchRouteReactivity.state\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\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?: Expand<\n ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']\n >,\n ) => Solid.JSX.Element)\n | Solid.JSX.Element\n}\n\nexport function MatchRoute<\n TRouter extends AnyRouter = RegisteredRouter,\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>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any)\n\n const renderedChild = Solid.createMemo(() => {\n const matchedParams = params()\n const child = props.children\n\n if (typeof child === 'function') {\n return (child as any)(matchedParams)\n }\n\n return matchedParams ? child : null\n })\n\n return <>{renderedChild()}</>\n}\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): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return Solid.createMemo((prev: TSelected | undefined) => {\n const matches = router.stores.activeMatchesSnapshot.state as Array<\n MakeRouteMatchUnion<TRouter>\n >\n const res = opts?.select ? opts.select(matches) : matches\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res) as any\n }) as Solid.Accessor<UseMatchesResult<TRouter, TSelected>>\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n 0,\n matches.findIndex((d) => d.id === contextMatchId()),\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): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n matches.findIndex((d) => d.id === contextMatchId()) + 1,\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n"],"mappings":";;;;;;;;;;;;;AAkCA,SAAgBgC,UAAU;CACxB,MAAMC,SAAS3B,kBAAAA,WAAW;CAE1B,MAAM4B,oBACH/B,+BAAAA,YAAY8B,OAAO9B,aACnB,OAAOgC,aAAa,eAAeF,OAAOG,MACvC3B,qBAAAA,eACAT,SAAMqC;CAEZ,MAAMC,kBAAkCL,OAAOM,WAAWrC,sBAAAA;CAC1D,MAAMsC,mBACJF,WAAW,CAACG,QAAQC,oBACpBT,OAAOQ,QAAQE;AAIjB,SAAA,GAAA,aAAA,iBAFwBV,OAAOQ,QAAQI,aAAapC,qBAAAA,cAGlC,EAAA,IAAAsC,WAAA;AAAA,UAAA,GAAA,aAAA,iBACbb,kBAAgB;GAAA,IACfc,WAAQ;AAAA,WAAER,oBAAAA,GAAAA,aAAAA,iBAAoBA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UA,QAAQU,MAChB,GACAV,QAAQW,WAAWC,MAAMA,EAAEC,OAAOL,gBAAgB,CACpD,CAAC;AACD,SAAO5B,MAAMmB,SAASnB,KAAKmB,OAAOC,QAAQ,GAAGA;IAEhD,CAAQ;;AAGX,SAAgBc,gBAIdlC,MACsD;CACtD,MAAM4B,iBAAiBtH,SAAMuH,WAAW/G,qBAAAA,oBAAoB,CAAC0C;AAE7D,QAAO+D,WAAW,EAChBJ,SAASC,YAAiD;AACxDA,YAAUA,QAAQU,MAChBV,QAAQW,WAAWC,MAAMA,EAAEC,OAAOL,gBAAgB,CAAC,GAAG,EACvD;AACD,SAAO5B,MAAMmB,SAASnB,KAAKmB,OAAOC,QAAQ,GAAGA;IAEhD,CAAQ"}
|
package/dist/cjs/Matches.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyRouter, DeepPartial, Expand, MakeOptionalPathParams, MakeOptionalSearchParams, MakeRouteMatchUnion, MaskOptions, MatchRouteOptions,
|
|
1
|
+
import { AnyRouter, DeepPartial, Expand, MakeOptionalPathParams, MakeOptionalSearchParams, MakeRouteMatchUnion, MaskOptions, MatchRouteOptions, RegisteredRouter, ResolveRoute, ToSubOptionsProps } from '@tanstack/router-core';
|
|
2
2
|
import * as Solid from 'solid-js';
|
|
3
3
|
declare module '@tanstack/router-core' {
|
|
4
4
|
interface RouteMatchExtensions {
|
|
@@ -13,7 +13,7 @@ export declare function Matches(): Solid.JSX.Element;
|
|
|
13
13
|
export type UseMatchRouteOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = undefined, TMaskFrom extends string = TFrom, TMaskTo extends string = ''> = ToSubOptionsProps<TRouter, TFrom, TTo> & DeepPartial<MakeOptionalSearchParams<TRouter, TFrom, TTo>> & DeepPartial<MakeOptionalPathParams<TRouter, TFrom, TTo>> & MaskOptions<TRouter, TMaskFrom, TMaskTo> & MatchRouteOptions;
|
|
14
14
|
export declare function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>(): <const TFrom extends string = string, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, const TMaskTo extends string = "">(opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>) => Solid.Accessor<false | Expand<ResolveRoute<TRouter, TFrom, TTo>["types"]["allParams"]>>;
|
|
15
15
|
export type MakeMatchRouteOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = undefined, TMaskFrom extends string = TFrom, TMaskTo extends string = ''> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {
|
|
16
|
-
children?: ((params?:
|
|
16
|
+
children?: ((params?: Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>) => Solid.JSX.Element) | Solid.JSX.Element;
|
|
17
17
|
};
|
|
18
18
|
export declare function MatchRoute<TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string = string, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, const TMaskTo extends string = ''>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any;
|
|
19
19
|
export interface UseMatchesBaseOptions<TRouter extends AnyRouter, TSelected> {
|
package/dist/esm/Match.js
CHANGED
|
@@ -184,6 +184,9 @@ var MatchInner = () => {
|
|
|
184
184
|
if (Comp) return createComponent(Comp, {});
|
|
185
185
|
return createComponent(Outlet, {});
|
|
186
186
|
};
|
|
187
|
+
const getLoadPromise = (matchId, fallbackMatch) => {
|
|
188
|
+
return router.getMatch(matchId)?._nonReactive.loadPromise ?? fallbackMatch?._nonReactive.loadPromise;
|
|
189
|
+
};
|
|
187
190
|
const keyedOut = () => createComponent(Solid.Show, {
|
|
188
191
|
get when() {
|
|
189
192
|
return componentKey();
|
|
@@ -261,13 +264,15 @@ var MatchInner = () => {
|
|
|
261
264
|
return currentMatch().status === "redirected";
|
|
262
265
|
},
|
|
263
266
|
children: (_) => {
|
|
267
|
+
const matchId = currentMatch().id;
|
|
268
|
+
const routerMatch = router.getMatch(matchId);
|
|
264
269
|
if (!isRedirect(currentMatch().error)) {
|
|
265
270
|
if (process.env.NODE_ENV !== "production") throw new Error("Invariant failed: Expected a redirect error");
|
|
266
271
|
invariant();
|
|
267
272
|
}
|
|
268
273
|
const [loaderResult] = Solid.createResource(async () => {
|
|
269
274
|
await new Promise((r) => setTimeout(r, 0));
|
|
270
|
-
return
|
|
275
|
+
return getLoadPromise(matchId, routerMatch);
|
|
271
276
|
});
|
|
272
277
|
return memo(loaderResult);
|
|
273
278
|
}
|
package/dist/esm/Match.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Match.js","names":["Solid","createControlledPromise","getLocationChangeInfo","invariant","isNotFound","isRedirect","rootRouteId","isServer","Dynamic","CatchBoundary","ErrorComponent","useRouter","CatchNotFound","getNotFound","nearestMatchContext","SafeFragment","renderRouteNotFound","ScrollRestoration","AnyRoute","RootRouteOptions","Match","props","matchId","router","match","createMemo","id","undefined","stores","activeMatchStoresById","get","state","rawMatchState","currentMatch","routeId","parentRouteId","routesById","parentRoute","ssr","_displayPending","hasPendingMatch","currentRouteId","Boolean","pendingRouteIds","nearestMatch","hasPending","_$createComponent","Show","when","children","currentMatchState","route","resolvePendingComponent","options","pendingComponent","defaultPendingComponent","routeErrorComponent","errorComponent","defaultErrorComponent","routeOnCatch","onCatch","defaultOnCatch","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","resolvedNoSsr","ResolvedSuspenseBoundary","Suspense","ResolvedCatchBoundary","ResolvedNotFoundBoundary","ShellComponent","shellComponent","Provider","value","fallback","_$memo","getResetKey","loadedAt","error","Error","notFoundError","process","env","NODE_ENV","console","warn","_$mergeProps","Switch","MatchInner","OnRendered","scrollRestoration","location","resolvedLocation","__TSR_key","createEffect","on","emit","type","useContext","remountFn","remountDeps","defaultRemountDeps","loaderDeps","params","_strictParams","search","_strictSearch","key","JSON","stringify","status","_forcePending","componentKey","out","Comp","defaultComponent","Outlet","keyedOut","keyed","_key","_","displayPendingResult","createResource","getMatch","_nonReactive","displayPendingPromise","minPendingResult","minPendingPromise","pendingMinMs","defaultPendingMinMs","routerMatch","setTimeout","resolve","loaderResult","Promise","r","loadPromise","FallbackComponent","_routeId","RouteErrorComponent","info","componentStack","nearestParentMatch","parentMatch","parentGlobalNotFound","globalNotFound","childMatchId","childMatchIdByRouteId","childMatchStatus","shouldShowNotFound","resolvedRoute","childMatchIdAccessor","currentMatchId"],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\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 { Dynamic } from 'solid-js/web'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound, getNotFound } from './not-found'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport type { AnyRoute, RootRouteOptions } from '@tanstack/router-core'\n\nexport const Match = (props: { matchId: string }) => {\n const router = useRouter()\n\n const match = Solid.createMemo(() => {\n const id = props.matchId\n if (!id) return undefined\n return router.stores.activeMatchStoresById.get(id)?.state\n })\n\n const rawMatchState = Solid.createMemo(() => {\n const currentMatch = match()\n if (!currentMatch) {\n return null\n }\n\n const routeId = currentMatch.routeId as string\n const parentRouteId = (router.routesById[routeId] as AnyRoute)?.parentRoute\n ?.id\n\n return {\n matchId: currentMatch.id,\n routeId,\n ssr: currentMatch.ssr,\n _displayPending: currentMatch._displayPending,\n parentRouteId: parentRouteId as string | undefined,\n }\n })\n\n const hasPendingMatch = Solid.createMemo(() => {\n const currentRouteId = rawMatchState()?.routeId\n return currentRouteId\n ? Boolean(router.stores.pendingRouteIds.state[currentRouteId])\n : false\n })\n const nearestMatch = {\n matchId: () => rawMatchState()?.matchId,\n routeId: () => rawMatchState()?.routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n return (\n <Solid.Show when={rawMatchState()}>\n {(currentMatchState) => {\n const route: () => AnyRoute = () =>\n router.routesById[currentMatchState().routeId]\n\n const resolvePendingComponent = () =>\n route().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const routeErrorComponent = () =>\n route().options.errorComponent ?? router.options.defaultErrorComponent\n\n const routeOnCatch = () =>\n route().options.onCatch ?? router.options.defaultOnCatch\n\n const routeNotFoundComponent = () =>\n route().isRoot\n ? // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component\n (route().options.notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : route().options.notFoundComponent\n\n const resolvedNoSsr =\n currentMatchState().ssr === false ||\n currentMatchState().ssr === 'data-only'\n\n const ResolvedSuspenseBoundary = () => Solid.Suspense\n\n const ResolvedCatchBoundary = () =>\n routeErrorComponent() ? CatchBoundary : SafeFragment\n\n const ResolvedNotFoundBoundary = () =>\n routeNotFoundComponent() ? CatchNotFound : SafeFragment\n\n const ShellComponent = route().isRoot\n ? ((route().options as RootRouteOptions).shellComponent ??\n SafeFragment)\n : SafeFragment\n\n return (\n <ShellComponent>\n <nearestMatchContext.Provider value={nearestMatch}>\n <Dynamic\n component={ResolvedSuspenseBoundary()}\n fallback={\n // Don't show fallback on server when using no-ssr mode to avoid hydration mismatch\n (isServer ?? router.isServer) && resolvedNoSsr ? undefined : (\n <Dynamic component={resolvePendingComponent()} />\n )\n }\n >\n <Dynamic\n component={ResolvedCatchBoundary()}\n getResetKey={() => router.stores.loadedAt.state}\n errorComponent={routeErrorComponent() || ErrorComponent}\n onCatch={(error: Error) => {\n // Forward not found errors (we don't want to show the error component for these)\n const notFoundError = getNotFound(error)\n if (notFoundError) {\n notFoundError.routeId ??= currentMatchState()\n .routeId as any\n throw notFoundError\n }\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Warning: Error in route match: ${currentMatchState().routeId}`,\n )\n }\n routeOnCatch()?.(error)\n }}\n >\n <Dynamic\n component={ResolvedNotFoundBoundary()}\n fallback={(error: any) => {\n const notFoundError = getNotFound(error) ?? error\n\n notFoundError.routeId ??= currentMatchState()\n .routeId as any\n\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() ||\n (notFoundError.routeId &&\n notFoundError.routeId !==\n currentMatchState().routeId) ||\n (!notFoundError.routeId && !route().isRoot)\n )\n throw notFoundError\n\n return (\n <Dynamic\n component={routeNotFoundComponent()}\n {...notFoundError}\n />\n )\n }}\n >\n <Solid.Switch>\n <Solid.Match when={resolvedNoSsr}>\n <Solid.Show\n when={!(isServer ?? router.isServer)}\n fallback={\n <Dynamic component={resolvePendingComponent()} />\n }\n >\n <MatchInner />\n </Solid.Show>\n </Solid.Match>\n <Solid.Match when={!resolvedNoSsr}>\n <MatchInner />\n </Solid.Match>\n </Solid.Switch>\n </Dynamic>\n </Dynamic>\n </Dynamic>\n </nearestMatchContext.Provider>\n\n {currentMatchState().parentRouteId === rootRouteId ? (\n <>\n <OnRendered />\n {router.options.scrollRestoration &&\n (isServer ?? router.isServer) ? (\n <ScrollRestoration />\n ) : null}\n </>\n ) : null}\n </ShellComponent>\n )\n }}\n </Solid.Show>\n )\n}\n\n// On Rendered can't happen above the root layout because it needs to run\n// after the app has committed below the root layout. Keeping it here lets us\n// fire onRendered even after a hydration mismatch above the root layout\n// (like bad head/link tags, which is common).\nfunction OnRendered() {\n const router = useRouter()\n\n const location = Solid.createMemo(\n () => router.stores.resolvedLocation.state?.state.__TSR_key,\n )\n Solid.createEffect(\n Solid.on([location], () => {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(\n router.stores.location.state,\n router.stores.resolvedLocation.state,\n ),\n })\n }),\n )\n return null\n}\n\nexport const MatchInner = (): any => {\n const router = useRouter()\n const match = Solid.useContext(nearestMatchContext).match\n\n const rawMatchState = Solid.createMemo(() => {\n const currentMatch = match()\n if (!currentMatch) {\n return null\n }\n\n const routeId = currentMatch.routeId as string\n\n const remountFn =\n (router.routesById[routeId] as AnyRoute).options.remountDeps ??\n router.options.defaultRemountDeps\n const remountDeps = remountFn?.({\n routeId,\n loaderDeps: currentMatch.loaderDeps,\n params: currentMatch._strictParams,\n search: currentMatch._strictSearch,\n })\n const key = remountDeps ? JSON.stringify(remountDeps) : undefined\n\n return {\n key,\n routeId,\n match: {\n id: currentMatch.id,\n status: currentMatch.status,\n error: currentMatch.error,\n _forcePending: currentMatch._forcePending ?? false,\n _displayPending: currentMatch._displayPending ?? false,\n },\n }\n })\n\n return (\n <Solid.Show when={rawMatchState()}>\n {(currentMatchState) => {\n const route = () => router.routesById[currentMatchState().routeId]!\n\n const currentMatch = () => currentMatchState().match\n\n const componentKey = () =>\n currentMatchState().key ?? currentMatchState().match.id\n\n const out = () => {\n const Comp =\n route().options.component ?? router.options.defaultComponent\n if (Comp) {\n return <Comp />\n }\n return <Outlet />\n }\n\n const keyedOut = () => (\n <Solid.Show when={componentKey()} keyed>\n {(_key) => out()}\n </Solid.Show>\n )\n\n return (\n <Solid.Switch>\n <Solid.Match when={currentMatch()._displayPending}>\n {(_) => {\n const [displayPendingResult] = Solid.createResource(\n () =>\n router.getMatch(currentMatch().id)?._nonReactive\n .displayPendingPromise,\n )\n\n return <>{displayPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch()._forcePending}>\n {(_) => {\n const [minPendingResult] = Solid.createResource(\n () =>\n router.getMatch(currentMatch().id)?._nonReactive\n .minPendingPromise,\n )\n\n return <>{minPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'pending'}>\n {(_) => {\n const pendingMinMs =\n route().options.pendingMinMs ??\n router.options.defaultPendingMinMs\n\n if (pendingMinMs) {\n const routerMatch = router.getMatch(currentMatch().id)\n if (\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 =\n 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\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(currentMatch().id)?._nonReactive\n .loadPromise\n })\n\n const FallbackComponent =\n route().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n return (\n <>\n {FallbackComponent && pendingMinMs > 0 ? (\n <Dynamic component={FallbackComponent} />\n ) : null}\n {loaderResult()}\n </>\n )\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'notFound'}>\n {(_) => {\n if (!isNotFound(currentMatch().error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'Invariant failed: Expected a notFound error',\n )\n }\n\n invariant()\n }\n\n // Use Show with keyed to ensure re-render when routeId changes\n return (\n <Solid.Show when={currentMatchState().routeId} keyed>\n {(_routeId) =>\n renderRouteNotFound(router, route(), currentMatch().error)\n }\n </Solid.Show>\n )\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'redirected'}>\n {(_) => {\n if (!isRedirect(currentMatch().error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'Invariant failed: Expected a redirect error',\n )\n }\n\n invariant()\n }\n\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(currentMatch().id)?._nonReactive\n .loadPromise\n })\n\n return <>{loaderResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'error'}>\n {(_) => {\n if (isServer ?? router.isServer) {\n const RouteErrorComponent =\n (route().options.errorComponent ??\n router.options.defaultErrorComponent) ||\n ErrorComponent\n\n return (\n <RouteErrorComponent\n error={currentMatch().error}\n info={{\n componentStack: '',\n }}\n />\n )\n }\n\n throw currentMatch().error\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'success'}>\n {keyedOut()}\n </Solid.Match>\n </Solid.Switch>\n )\n }}\n </Solid.Show>\n )\n}\n\nexport const Outlet = () => {\n const router = useRouter()\n const nearestParentMatch = Solid.useContext(nearestMatchContext)\n const parentMatch = nearestParentMatch.match\n const routeId = nearestParentMatch.routeId\n const route = Solid.createMemo(() =>\n routeId() ? router.routesById[routeId()!] : undefined,\n )\n\n const parentGlobalNotFound = Solid.createMemo(\n () => parentMatch()?.globalNotFound ?? false,\n )\n\n const childMatchId = Solid.createMemo(() => {\n const currentRouteId = routeId()\n return currentRouteId\n ? router.stores.childMatchIdByRouteId.state[currentRouteId]\n : undefined\n })\n\n const childMatchStatus = Solid.createMemo(() => {\n const id = childMatchId()\n if (!id) return undefined\n return router.stores.activeMatchStoresById.get(id)?.state.status\n })\n\n // Only show not-found if we're not in a redirected state\n const shouldShowNotFound = () =>\n childMatchStatus() !== 'redirected' && parentGlobalNotFound()\n\n return (\n <Solid.Show\n when={!shouldShowNotFound() && childMatchId()}\n fallback={\n <Solid.Show when={shouldShowNotFound() && route()}>\n {(resolvedRoute) =>\n renderRouteNotFound(router, resolvedRoute(), undefined)\n }\n </Solid.Show>\n }\n >\n {(childMatchIdAccessor) => {\n const currentMatchId = Solid.createMemo(() => childMatchIdAccessor())\n\n return (\n <Solid.Show\n when={routeId() === rootRouteId}\n fallback={<Match matchId={currentMatchId()} />}\n >\n <Solid.Suspense\n fallback={\n <Dynamic component={router.options.defaultPendingComponent} />\n }\n >\n <Match matchId={currentMatchId()} />\n </Solid.Suspense>\n </Solid.Show>\n )\n }}\n </Solid.Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAaoB,SAASC,UAA+B;CACnD,MAAME,SAASZ,WAAW;CAE1B,MAAMa,QAAQxB,MAAMyB,iBAAiB;EACnC,MAAMC,KAAKL,MAAMC;AACjB,MAAI,CAACI,GAAI,Q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NotFound","isRedirect","rootRouteId","isServer","Dynamic","CatchBoundary","ErrorComponent","useRouter","CatchNotFound","getNotFound","nearestMatchContext","SafeFragment","renderRouteNotFound","ScrollRestoration","AnyRoute","RootRouteOptions","Match","props","matchId","router","match","createMemo","id","undefined","stores","activeMatchStoresById","get","state","rawMatchState","currentMatch","routeId","parentRouteId","routesById","parentRoute","ssr","_displayPending","hasPendingMatch","currentRouteId","Boolean","pendingRouteIds","nearestMatch","hasPending","_$createComponent","Show","when","children","currentMatchState","route","resolvePendingComponent","options","pendingComponent","defaultPendingComponent","routeErrorComponent","errorComponent","defaultErrorComponent","routeOnCatch","onCatch","defaultOnCatch","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","resolvedNoSsr","ResolvedSuspenseBoundary","Suspense","ResolvedCatchBoundary","ResolvedNotFoundBoundary","ShellComponent","shellComponent","Provider","value","fallback","_$memo","getResetKey","loadedAt","error","Error","notFoundError","process","env","NODE_ENV","console","warn","_$mergeProps","Switch","MatchInner","OnRendered","scrollRestoration","location","resolvedLocation","__TSR_key","createEffect","on","emit","type","useContext","remountFn","remountDeps","defaultRemountDeps","loaderDeps","params","_strictParams","search","_strictSearch","key","JSON","stringify","status","_forcePending","componentKey","out","Comp","defaultComponent","Outlet","getLoadPromise","fallbackMatch","_nonReactive","loadPromise","Promise","getMatch","keyedOut","keyed","_key","_","displayPendingResult","createResource","displayPendingPromise","minPendingResult","minPendingPromise","pendingMinMs","defaultPendingMinMs","routerMatch","setTimeout","resolve","loaderResult","r","FallbackComponent","_routeId","RouteErrorComponent","info","componentStack","nearestParentMatch","parentMatch","parentGlobalNotFound","globalNotFound","childMatchId","childMatchIdByRouteId","childMatchStatus","shouldShowNotFound","resolvedRoute","childMatchIdAccessor","currentMatchId"],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\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 { Dynamic } from 'solid-js/web'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound, getNotFound } from './not-found'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport type { AnyRoute, RootRouteOptions } from '@tanstack/router-core'\n\nexport const Match = (props: { matchId: string }) => {\n const router = useRouter()\n\n const match = Solid.createMemo(() => {\n const id = props.matchId\n if (!id) return undefined\n return router.stores.activeMatchStoresById.get(id)?.state\n })\n\n const rawMatchState = Solid.createMemo(() => {\n const currentMatch = match()\n if (!currentMatch) {\n return null\n }\n\n const routeId = currentMatch.routeId as string\n const parentRouteId = (router.routesById[routeId] as AnyRoute)?.parentRoute\n ?.id\n\n return {\n matchId: currentMatch.id,\n routeId,\n ssr: currentMatch.ssr,\n _displayPending: currentMatch._displayPending,\n parentRouteId: parentRouteId as string | undefined,\n }\n })\n\n const hasPendingMatch = Solid.createMemo(() => {\n const currentRouteId = rawMatchState()?.routeId\n return currentRouteId\n ? Boolean(router.stores.pendingRouteIds.state[currentRouteId])\n : false\n })\n const nearestMatch = {\n matchId: () => rawMatchState()?.matchId,\n routeId: () => rawMatchState()?.routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n return (\n <Solid.Show when={rawMatchState()}>\n {(currentMatchState) => {\n const route: () => AnyRoute = () =>\n router.routesById[currentMatchState().routeId]\n\n const resolvePendingComponent = () =>\n route().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const routeErrorComponent = () =>\n route().options.errorComponent ?? router.options.defaultErrorComponent\n\n const routeOnCatch = () =>\n route().options.onCatch ?? router.options.defaultOnCatch\n\n const routeNotFoundComponent = () =>\n route().isRoot\n ? // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component\n (route().options.notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : route().options.notFoundComponent\n\n const resolvedNoSsr =\n currentMatchState().ssr === false ||\n currentMatchState().ssr === 'data-only'\n\n const ResolvedSuspenseBoundary = () => Solid.Suspense\n\n const ResolvedCatchBoundary = () =>\n routeErrorComponent() ? CatchBoundary : SafeFragment\n\n const ResolvedNotFoundBoundary = () =>\n routeNotFoundComponent() ? CatchNotFound : SafeFragment\n\n const ShellComponent = route().isRoot\n ? ((route().options as RootRouteOptions).shellComponent ??\n SafeFragment)\n : SafeFragment\n\n return (\n <ShellComponent>\n <nearestMatchContext.Provider value={nearestMatch}>\n <Dynamic\n component={ResolvedSuspenseBoundary()}\n fallback={\n // Don't show fallback on server when using no-ssr mode to avoid hydration mismatch\n (isServer ?? router.isServer) && resolvedNoSsr ? undefined : (\n <Dynamic component={resolvePendingComponent()} />\n )\n }\n >\n <Dynamic\n component={ResolvedCatchBoundary()}\n getResetKey={() => router.stores.loadedAt.state}\n errorComponent={routeErrorComponent() || ErrorComponent}\n onCatch={(error: Error) => {\n // Forward not found errors (we don't want to show the error component for these)\n const notFoundError = getNotFound(error)\n if (notFoundError) {\n notFoundError.routeId ??= currentMatchState()\n .routeId as any\n throw notFoundError\n }\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Warning: Error in route match: ${currentMatchState().routeId}`,\n )\n }\n routeOnCatch()?.(error)\n }}\n >\n <Dynamic\n component={ResolvedNotFoundBoundary()}\n fallback={(error: any) => {\n const notFoundError = getNotFound(error) ?? error\n\n notFoundError.routeId ??= currentMatchState()\n .routeId as any\n\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() ||\n (notFoundError.routeId &&\n notFoundError.routeId !==\n currentMatchState().routeId) ||\n (!notFoundError.routeId && !route().isRoot)\n )\n throw notFoundError\n\n return (\n <Dynamic\n component={routeNotFoundComponent()}\n {...notFoundError}\n />\n )\n }}\n >\n <Solid.Switch>\n <Solid.Match when={resolvedNoSsr}>\n <Solid.Show\n when={!(isServer ?? router.isServer)}\n fallback={\n <Dynamic component={resolvePendingComponent()} />\n }\n >\n <MatchInner />\n </Solid.Show>\n </Solid.Match>\n <Solid.Match when={!resolvedNoSsr}>\n <MatchInner />\n </Solid.Match>\n </Solid.Switch>\n </Dynamic>\n </Dynamic>\n </Dynamic>\n </nearestMatchContext.Provider>\n\n {currentMatchState().parentRouteId === rootRouteId ? (\n <>\n <OnRendered />\n {router.options.scrollRestoration &&\n (isServer ?? router.isServer) ? (\n <ScrollRestoration />\n ) : null}\n </>\n ) : null}\n </ShellComponent>\n )\n }}\n </Solid.Show>\n )\n}\n\n// On Rendered can't happen above the root layout because it needs to run\n// after the app has committed below the root layout. Keeping it here lets us\n// fire onRendered even after a hydration mismatch above the root layout\n// (like bad head/link tags, which is common).\nfunction OnRendered() {\n const router = useRouter()\n\n const location = Solid.createMemo(\n () => router.stores.resolvedLocation.state?.state.__TSR_key,\n )\n Solid.createEffect(\n Solid.on([location], () => {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(\n router.stores.location.state,\n router.stores.resolvedLocation.state,\n ),\n })\n }),\n )\n return null\n}\n\nexport const MatchInner = (): any => {\n const router = useRouter()\n const match = Solid.useContext(nearestMatchContext).match\n\n const rawMatchState = Solid.createMemo(() => {\n const currentMatch = match()\n if (!currentMatch) {\n return null\n }\n\n const routeId = currentMatch.routeId as string\n\n const remountFn =\n (router.routesById[routeId] as AnyRoute).options.remountDeps ??\n router.options.defaultRemountDeps\n const remountDeps = remountFn?.({\n routeId,\n loaderDeps: currentMatch.loaderDeps,\n params: currentMatch._strictParams,\n search: currentMatch._strictSearch,\n })\n const key = remountDeps ? JSON.stringify(remountDeps) : undefined\n\n return {\n key,\n routeId,\n match: {\n id: currentMatch.id,\n status: currentMatch.status,\n error: currentMatch.error,\n _forcePending: currentMatch._forcePending ?? false,\n _displayPending: currentMatch._displayPending ?? false,\n },\n }\n })\n\n return (\n <Solid.Show when={rawMatchState()}>\n {(currentMatchState) => {\n const route = () => router.routesById[currentMatchState().routeId]!\n\n const currentMatch = () => currentMatchState().match\n\n const componentKey = () =>\n currentMatchState().key ?? currentMatchState().match.id\n\n const out = () => {\n const Comp =\n route().options.component ?? router.options.defaultComponent\n if (Comp) {\n return <Comp />\n }\n return <Outlet />\n }\n\n const getLoadPromise = (\n matchId: string,\n fallbackMatch:\n | {\n _nonReactive: {\n loadPromise?: Promise<void>\n }\n }\n | undefined,\n ) => {\n return (\n router.getMatch(matchId)?._nonReactive.loadPromise ??\n fallbackMatch?._nonReactive.loadPromise\n )\n }\n\n const keyedOut = () => (\n <Solid.Show when={componentKey()} keyed>\n {(_key) => out()}\n </Solid.Show>\n )\n\n return (\n <Solid.Switch>\n <Solid.Match when={currentMatch()._displayPending}>\n {(_) => {\n const [displayPendingResult] = Solid.createResource(\n () =>\n router.getMatch(currentMatch().id)?._nonReactive\n .displayPendingPromise,\n )\n\n return <>{displayPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch()._forcePending}>\n {(_) => {\n const [minPendingResult] = Solid.createResource(\n () =>\n router.getMatch(currentMatch().id)?._nonReactive\n .minPendingPromise,\n )\n\n return <>{minPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'pending'}>\n {(_) => {\n const pendingMinMs =\n route().options.pendingMinMs ??\n router.options.defaultPendingMinMs\n\n if (pendingMinMs) {\n const routerMatch = router.getMatch(currentMatch().id)\n if (\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 =\n 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\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(currentMatch().id)?._nonReactive\n .loadPromise\n })\n\n const FallbackComponent =\n route().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n return (\n <>\n {FallbackComponent && pendingMinMs > 0 ? (\n <Dynamic component={FallbackComponent} />\n ) : null}\n {loaderResult()}\n </>\n )\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'notFound'}>\n {(_) => {\n if (!isNotFound(currentMatch().error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'Invariant failed: Expected a notFound error',\n )\n }\n\n invariant()\n }\n\n // Use Show with keyed to ensure re-render when routeId changes\n return (\n <Solid.Show when={currentMatchState().routeId} keyed>\n {(_routeId) =>\n renderRouteNotFound(router, route(), currentMatch().error)\n }\n </Solid.Show>\n )\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'redirected'}>\n {(_) => {\n const matchId = currentMatch().id\n const routerMatch = router.getMatch(matchId)\n\n if (!isRedirect(currentMatch().error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'Invariant failed: Expected a redirect error',\n )\n }\n\n invariant()\n }\n\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return getLoadPromise(matchId, routerMatch)\n })\n\n return <>{loaderResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'error'}>\n {(_) => {\n if (isServer ?? router.isServer) {\n const RouteErrorComponent =\n (route().options.errorComponent ??\n router.options.defaultErrorComponent) ||\n ErrorComponent\n\n return (\n <RouteErrorComponent\n error={currentMatch().error}\n info={{\n componentStack: '',\n }}\n />\n )\n }\n\n throw currentMatch().error\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'success'}>\n {keyedOut()}\n </Solid.Match>\n </Solid.Switch>\n )\n }}\n </Solid.Show>\n )\n}\n\nexport const Outlet = () => {\n const router = useRouter()\n const nearestParentMatch = Solid.useContext(nearestMatchContext)\n const parentMatch = nearestParentMatch.match\n const routeId = nearestParentMatch.routeId\n const route = Solid.createMemo(() =>\n routeId() ? router.routesById[routeId()!] : undefined,\n )\n\n const parentGlobalNotFound = Solid.createMemo(\n () => parentMatch()?.globalNotFound ?? false,\n )\n\n const childMatchId = Solid.createMemo(() => {\n const currentRouteId = routeId()\n return currentRouteId\n ? router.stores.childMatchIdByRouteId.state[currentRouteId]\n : undefined\n })\n\n const childMatchStatus = Solid.createMemo(() => {\n const id = childMatchId()\n if (!id) return undefined\n return router.stores.activeMatchStoresById.get(id)?.state.status\n })\n\n // Only show not-found if we're not in a redirected state\n const shouldShowNotFound = () =>\n childMatchStatus() !== 'redirected' && parentGlobalNotFound()\n\n return (\n <Solid.Show\n when={!shouldShowNotFound() && childMatchId()}\n fallback={\n <Solid.Show when={shouldShowNotFound() && route()}>\n {(resolvedRoute) =>\n renderRouteNotFound(router, resolvedRoute(), undefined)\n }\n </Solid.Show>\n }\n >\n {(childMatchIdAccessor) => {\n const currentMatchId = Solid.createMemo(() => childMatchIdAccessor())\n\n return (\n <Solid.Show\n when={routeId() === rootRouteId}\n fallback={<Match matchId={currentMatchId()} />}\n >\n <Solid.Suspense\n fallback={\n <Dynamic component={router.options.defaultPendingComponent} />\n }\n >\n <Match matchId={currentMatchId()} />\n </Solid.Suspense>\n </Solid.Show>\n )\n }}\n </Solid.Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAaoB,SAASC,UAA+B;CACnD,MAAME,SAASZ,WAAW;CAE1B,MAAMa,QAAQxB,MAAMyB,iBAAiB;EACnC,MAAMC,KAAKL,MAAMC;AACjB,MAAI,CAACI,GAAI,QAAOC,KAAAA;AAChB,SAAOJ,OAAOK,OAAOC,sBAAsBC,IAAIJ,GAAG,EAAEK;GACpD;CAEF,MAAMC,gBAAgBhC,MAAMyB,iBAAiB;EAC3C,MAAMQ,eAAeT,OAAO;AAC5B,MAAI,CAACS,aACH,QAAO;EAGT,MAAMC,UAAUD,aAAaC;EAC7B,MAAMC,gBAAiBZ,OAAOa,WAAWF,U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chRouteOptions,
|
|
1
|
+
import { AnyRouter, DeepPartial, Expand, MakeOptionalPathParams, MakeOptionalSearchParams, MakeRouteMatchUnion, MaskOptions, MatchRouteOptions, RegisteredRouter, ResolveRoute, ToSubOptionsProps } from '@tanstack/router-core';
|
|
2
2
|
import * as Solid from 'solid-js';
|
|
3
3
|
declare module '@tanstack/router-core' {
|
|
4
4
|
interface RouteMatchExtensions {
|
|
@@ -13,7 +13,7 @@ export declare function Matches(): Solid.JSX.Element;
|
|
|
13
13
|
export type UseMatchRouteOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = undefined, TMaskFrom extends string = TFrom, TMaskTo extends string = ''> = ToSubOptionsProps<TRouter, TFrom, TTo> & DeepPartial<MakeOptionalSearchParams<TRouter, TFrom, TTo>> & DeepPartial<MakeOptionalPathParams<TRouter, TFrom, TTo>> & MaskOptions<TRouter, TMaskFrom, TMaskTo> & MatchRouteOptions;
|
|
14
14
|
export declare function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>(): <const TFrom extends string = string, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, const TMaskTo extends string = "">(opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>) => Solid.Accessor<false | Expand<ResolveRoute<TRouter, TFrom, TTo>["types"]["allParams"]>>;
|
|
15
15
|
export type MakeMatchRouteOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = undefined, TMaskFrom extends string = TFrom, TMaskTo extends string = ''> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {
|
|
16
|
-
children?: ((params?:
|
|
16
|
+
children?: ((params?: Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>) => Solid.JSX.Element) | Solid.JSX.Element;
|
|
17
17
|
};
|
|
18
18
|
export declare function MatchRoute<TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string = string, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, const TMaskTo extends string = ''>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any;
|
|
19
19
|
export interface UseMatchesBaseOptions<TRouter extends AnyRouter, TSelected> {
|
package/dist/esm/Matches.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Matches.js","names":["Solid","replaceEqualDeep","rootRouteId","isServer","CatchBoundary","ErrorComponent","useRouter","Transitioner","nearestMatchContext","SafeFragment","Match","AnyRoute","AnyRouter","DeepPartial","Expand","MakeOptionalPathParams","MakeOptionalSearchParams","MakeRouteMatchUnion","MaskOptions","MatchRouteOptions","NoInfer","RegisteredRouter","ResolveRelativePath","ResolveRoute","RouteByPath","ToSubOptionsProps","RouteMatchExtensions","meta","Array","JSX","IntrinsicElements","links","scripts","styles","headScripts","Matches","router","ResolvedSuspense","document","ssr","Suspense","rootRoute","routesById","PendingComponent","options","pendingComponent","defaultPendingComponent","OptionalWrapper","InnerWrap","_$createComponent","children","fallback","MatchesInner","matchId","stores","firstMatchId","state","routeId","undefined","match","getMatchStoreByRouteId","hasPendingMatch","Boolean","pendingRouteIds","resetKey","loadedAt","nearestMatch","hasPending","matchComponent","Show","when","Provider","value","_$memo","disableGlobalCatchBoundary","getResetKey","errorComponent","onCatch","process","env","NODE_ENV","error","console","warn","message","toString","UseMatchRouteOptions","TFrom","TRouter","TTo","TMaskFrom","TMaskTo","useMatchRoute","opts","Accessor","createMemo","pending","caseSensitive","fuzzy","includeSearch","rest","matchRouteReactivity","matchRoute","MakeMatchRouteOptions","params","Element","MatchRoute","props","renderedChild","matchedParams","child","UseMatchesBaseOptions","select","matches","TSelected","UseMatchesResult","useMatches","prev","activeMatchesSnapshot","res","useParentMatches","contextMatchId","useContext","slice","findIndex","d","id","useChildMatches"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep, rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { Transitioner } from './Transitioner'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Match } from './Match'\nimport type {\n AnyRoute,\n AnyRouter,\n DeepPartial,\n Expand,\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\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<Solid.JSX.IntrinsicElements['meta'] | undefined>\n links?: Array<Solid.JSX.IntrinsicElements['link'] | undefined>\n scripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n styles?: Array<Solid.JSX.IntrinsicElements['style'] | undefined>\n headScripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n }\n}\n\nexport function Matches() {\n const router = useRouter()\n\n const ResolvedSuspense =\n (isServer ?? router.isServer) ||\n (typeof document !== 'undefined' && router.ssr)\n ? SafeFragment\n : Solid.Suspense\n\n const rootRoute: () => AnyRoute = () => router.routesById[rootRouteId]\n const PendingComponent =\n rootRoute().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const OptionalWrapper = router.options.InnerWrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <ResolvedSuspense\n fallback={PendingComponent ? <PendingComponent /> : null}\n >\n <Transitioner />\n <MatchesInner />\n </ResolvedSuspense>\n </OptionalWrapper>\n )\n}\n\nfunction MatchesInner() {\n const router = useRouter()\n const matchId = () => router.stores.firstMatchId.state\n const routeId = () => (matchId() ? rootRouteId : undefined)\n const match = () =>\n routeId()\n ? router.stores.getMatchStoreByRouteId(rootRouteId).state\n : undefined\n const hasPendingMatch = () =>\n routeId()\n ? Boolean(router.stores.pendingRouteIds.state[rootRouteId])\n : false\n const resetKey = () => router.stores.loadedAt.state\n const nearestMatch = {\n matchId,\n routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n const matchComponent = () => {\n return (\n <Solid.Show when={matchId()}>\n <Match matchId={matchId()!} />\n </Solid.Show>\n )\n }\n\n return (\n <nearestMatchContext.Provider value={nearestMatch}>\n {router.options.disableGlobalCatchBoundary ? (\n matchComponent()\n ) : (\n <CatchBoundary\n getResetKey={() => resetKey()}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (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 }\n >\n {matchComponent()}\n </CatchBoundary>\n )}\n </nearestMatchContext.Provider>\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 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 ): Solid.Accessor<\n false | Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>\n > => {\n return Solid.createMemo(() => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n router.stores.matchRouteReactivity.state\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\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 ) => Solid.JSX.Element)\n | Solid.JSX.Element\n}\n\nexport function MatchRoute<\n TRouter extends AnyRouter = RegisteredRouter,\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>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any)\n\n const renderedChild = Solid.createMemo(() => {\n const matchedParams = params()\n const child = props.children\n\n if (typeof child === 'function') {\n return (child as any)(matchedParams)\n }\n\n return matchedParams ? child : null\n })\n\n return <>{renderedChild()}</>\n}\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): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return Solid.createMemo((prev: TSelected | undefined) => {\n const matches = router.stores.activeMatchesSnapshot.state as Array<\n MakeRouteMatchUnion<TRouter>\n >\n const res = opts?.select ? opts.select(matches) : matches\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res) as any\n }) as Solid.Accessor<UseMatchesResult<TRouter, TSelected>>\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n 0,\n matches.findIndex((d) => d.id === contextMatchId()),\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): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n matches.findIndex((d) => d.id === contextMatchId()) + 1,\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n"],"mappings":";;;;;;;;;;;AAqCA,SAAgBmC,UAAU;CACxB,MAAMC,SAAS9B,WAAW;CAE1B,MAAM+B,oBACHlC,YAAYiC,OAAOjC,aACnB,OAAOmC,aAAa,eAAeF,OAAOG,MACvC9B,eACAT,MAAMwC;CAEZ,MAAMC,kBAAkCL,OAAOM,WAAWxC;CAC1D,MAAMyC,mBACJF,WAAW,CAACG,QAAQC,oBACpBT,OAAOQ,QAAQE;AAIjB,QAAAG,gBAFwBb,OAAOQ,QAAQI,aAAavC,cAGlC,EAAA,IAAAyC,WAAA;AAAA,SAAAD,gBACbZ,kBAAgB;GAAA,IACfc,WAAQ;AAAA,WAAER,mBAAgBM,gBAAIN,kBAAgB,EAAA,CAAA,GAAM;;GAAI,IAAAO,WAAA;AAAA,WAAA,CAAAD,gBAEvD1C,cAAY,EAAA,CAAA,EAAA0C,gBACZG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QAAQU,MAChBV,QAAQW,WAAWC,MAAMA,EAAEC,OAAOL,gBAAgB,CAAC,GAAG,EACvD;AACD,SAAO5B,MAAMmB,SAASnB,KAAKmB,OAAOC,QAAQ,GAAGA;IAEhD,CAAQ"}
|
|
1
|
+
{"version":3,"file":"Matches.js","names":["Solid","replaceEqualDeep","rootRouteId","isServer","CatchBoundary","ErrorComponent","useRouter","Transitioner","nearestMatchContext","SafeFragment","Match","AnyRoute","AnyRouter","DeepPartial","Expand","MakeOptionalPathParams","MakeOptionalSearchParams","MakeRouteMatchUnion","MaskOptions","MatchRouteOptions","RegisteredRouter","ResolveRoute","ToSubOptionsProps","RouteMatchExtensions","meta","Array","JSX","IntrinsicElements","links","scripts","styles","headScripts","Matches","router","ResolvedSuspense","document","ssr","Suspense","rootRoute","routesById","PendingComponent","options","pendingComponent","defaultPendingComponent","OptionalWrapper","InnerWrap","_$createComponent","children","fallback","MatchesInner","matchId","stores","firstMatchId","state","routeId","undefined","match","getMatchStoreByRouteId","hasPendingMatch","Boolean","pendingRouteIds","resetKey","loadedAt","nearestMatch","hasPending","matchComponent","Show","when","Provider","value","_$memo","disableGlobalCatchBoundary","getResetKey","errorComponent","onCatch","process","env","NODE_ENV","error","console","warn","message","toString","UseMatchRouteOptions","TFrom","TRouter","TTo","TMaskFrom","TMaskTo","useMatchRoute","opts","Accessor","createMemo","pending","caseSensitive","fuzzy","includeSearch","rest","matchRouteReactivity","matchRoute","MakeMatchRouteOptions","params","Element","MatchRoute","props","renderedChild","matchedParams","child","UseMatchesBaseOptions","select","matches","TSelected","UseMatchesResult","useMatches","prev","activeMatchesSnapshot","res","useParentMatches","contextMatchId","useContext","slice","findIndex","d","id","useChildMatches"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep, rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { Transitioner } from './Transitioner'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Match } from './Match'\nimport type {\n AnyRoute,\n AnyRouter,\n DeepPartial,\n Expand,\n MakeOptionalPathParams,\n MakeOptionalSearchParams,\n MakeRouteMatchUnion,\n MaskOptions,\n MatchRouteOptions,\n RegisteredRouter,\n ResolveRoute,\n ToSubOptionsProps,\n} from '@tanstack/router-core'\n\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<Solid.JSX.IntrinsicElements['meta'] | undefined>\n links?: Array<Solid.JSX.IntrinsicElements['link'] | undefined>\n scripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n styles?: Array<Solid.JSX.IntrinsicElements['style'] | undefined>\n headScripts?: Array<Solid.JSX.IntrinsicElements['script'] | undefined>\n }\n}\n\nexport function Matches() {\n const router = useRouter()\n\n const ResolvedSuspense =\n (isServer ?? router.isServer) ||\n (typeof document !== 'undefined' && router.ssr)\n ? SafeFragment\n : Solid.Suspense\n\n const rootRoute: () => AnyRoute = () => router.routesById[rootRouteId]\n const PendingComponent =\n rootRoute().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const OptionalWrapper = router.options.InnerWrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <ResolvedSuspense\n fallback={PendingComponent ? <PendingComponent /> : null}\n >\n <Transitioner />\n <MatchesInner />\n </ResolvedSuspense>\n </OptionalWrapper>\n )\n}\n\nfunction MatchesInner() {\n const router = useRouter()\n const matchId = () => router.stores.firstMatchId.state\n const routeId = () => (matchId() ? rootRouteId : undefined)\n const match = () =>\n routeId()\n ? router.stores.getMatchStoreByRouteId(rootRouteId).state\n : undefined\n const hasPendingMatch = () =>\n routeId()\n ? Boolean(router.stores.pendingRouteIds.state[rootRouteId])\n : false\n const resetKey = () => router.stores.loadedAt.state\n const nearestMatch = {\n matchId,\n routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n const matchComponent = () => {\n return (\n <Solid.Show when={matchId()}>\n <Match matchId={matchId()!} />\n </Solid.Show>\n )\n }\n\n return (\n <nearestMatchContext.Provider value={nearestMatch}>\n {router.options.disableGlobalCatchBoundary ? (\n matchComponent()\n ) : (\n <CatchBoundary\n getResetKey={() => resetKey()}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (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 }\n >\n {matchComponent()}\n </CatchBoundary>\n )}\n </nearestMatchContext.Provider>\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 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 ): Solid.Accessor<\n false | Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>\n > => {\n return Solid.createMemo(() => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n router.stores.matchRouteReactivity.state\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\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?: Expand<\n ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']\n >,\n ) => Solid.JSX.Element)\n | Solid.JSX.Element\n}\n\nexport function MatchRoute<\n TRouter extends AnyRouter = RegisteredRouter,\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>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any)\n\n const renderedChild = Solid.createMemo(() => {\n const matchedParams = params()\n const child = props.children\n\n if (typeof child === 'function') {\n return (child as any)(matchedParams)\n }\n\n return matchedParams ? child : null\n })\n\n return <>{renderedChild()}</>\n}\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): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return Solid.createMemo((prev: TSelected | undefined) => {\n const matches = router.stores.activeMatchesSnapshot.state as Array<\n MakeRouteMatchUnion<TRouter>\n >\n const res = opts?.select ? opts.select(matches) : matches\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res) as any\n }) as Solid.Accessor<UseMatchesResult<TRouter, TSelected>>\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n 0,\n matches.findIndex((d) => d.id === contextMatchId()),\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): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n matches.findIndex((d) => d.id === contextMatchId()) + 1,\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n"],"mappings":";;;;;;;;;;;AAkCA,SAAgBgC,UAAU;CACxB,MAAMC,SAAS3B,WAAW;CAE1B,MAAM4B,oBACH/B,YAAY8B,OAAO9B,aACnB,OAAOgC,aAAa,eAAeF,OAAOG,MACvC3B,eACAT,MAAMqC;CAEZ,MAAMC,kBAAkCL,OAAOM,WAAWrC;CAC1D,MAAMsC,mBACJF,WAAW,CAACG,QAAQC,oBACpBT,OAAOQ,QAAQE;AAIjB,QAAAG,gBAFwBb,OAAOQ,QAAQI,aAAapC,cAGlC,EAAA,IAAAsC,WAAA;AAAA,SAAAD,gBACbZ,kBAAgB;GAAA,IACfc,WAAQ;AAAA,WAAER,mBAAgBM,gBAAIN,kBAAgB,EAAA,CAAA,GAAM;;GAAI,IAAAO,WAAA;AAAA,WAAA,CAAAD,gBAEvDvC,cAAY,EAAA,CAAA,EAAAuC,gBACZG,cAAY,EAAA,CAAA,CAAA;;GAAA,CAAA;IAAA,CAAA;;AAMrB,SAASA,eAAe;CACtB,MAAMhB,SAAS3B,WAAW;CAC1B,MAAM4C,gBAAgBjB,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,GAAGA;IAEhD,CAAQ"}
|
package/dist/source/Match.jsx
CHANGED
|
@@ -179,6 +179,10 @@ export const MatchInner = () => {
|
|
|
179
179
|
}
|
|
180
180
|
return <Outlet />;
|
|
181
181
|
};
|
|
182
|
+
const getLoadPromise = (matchId, fallbackMatch) => {
|
|
183
|
+
return (router.getMatch(matchId)?._nonReactive.loadPromise ??
|
|
184
|
+
fallbackMatch?._nonReactive.loadPromise);
|
|
185
|
+
};
|
|
182
186
|
const keyedOut = () => (<Solid.Show when={componentKey()} keyed>
|
|
183
187
|
{(_key) => out()}
|
|
184
188
|
</Solid.Show>);
|
|
@@ -247,6 +251,8 @@ export const MatchInner = () => {
|
|
|
247
251
|
</Solid.Match>
|
|
248
252
|
<Solid.Match when={currentMatch().status === 'redirected'}>
|
|
249
253
|
{(_) => {
|
|
254
|
+
const matchId = currentMatch().id;
|
|
255
|
+
const routerMatch = router.getMatch(matchId);
|
|
250
256
|
if (!isRedirect(currentMatch().error)) {
|
|
251
257
|
if (process.env.NODE_ENV !== 'production') {
|
|
252
258
|
throw new Error('Invariant failed: Expected a redirect error');
|
|
@@ -255,8 +261,7 @@ export const MatchInner = () => {
|
|
|
255
261
|
}
|
|
256
262
|
const [loaderResult] = Solid.createResource(async () => {
|
|
257
263
|
await new Promise((r) => setTimeout(r, 0));
|
|
258
|
-
return
|
|
259
|
-
.loadPromise;
|
|
264
|
+
return getLoadPromise(matchId, routerMatch);
|
|
260
265
|
});
|
|
261
266
|
return <>{loaderResult()}</>;
|
|
262
267
|
}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Match.jsx","sourceRoot":"","sources":["../../src/Match.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AACjC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,GACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,M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AAE,IAAI,KAAK,EAAE,CAAC,CAChD;UAAA,CAAC,CAAC,aAAa,EAAE,EAAE,CACjB,mBAAmB,CAAC,MAAM,EAAE,aAAa,EAAE,EAAE,SAAS,CACxD,CACF;QAAA,EAAE,KAAK,CAAC,IAAI,CACd,CAAC,CAED;MAAA,CAAC,CAAC,oBAAoB,EAAE,EAAE;YACxB,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,oBAAoB,EAAE,CAAC,CAAA;YAErE,OAAO,CACL,CAAC,KAAK,CAAC,IAAI,CACT,IAAI,CAAC,CAAC,OAAO,EAAE,KAAK,WAAW,CAAC,CAChC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,cAAc,EAAE,CAAC,EAAG,CAAC,CAE/C;YAAA,CAAC,KAAK,CAAC,QAAQ,CACb,QAAQ,CAAC,CACP,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,EAC7D,CAAC,CAED;cAAA,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,cAAc,EAAE,CAAC,EACnC;YAAA,EAAE,KAAK,CAAC,QAAQ,CAClB;UAAA,EAAE,KAAK,CAAC,IAAI,CAAC,CACd,CAAA;QACH,CAAC,CACH;IAAA,EAAE,KAAK,CAAC,IAAI,CAAC,CACd,CAAA;AACH,CAAC,CAAA"}
|
package/dist/source/Matches.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Solid from 'solid-js';
|
|
2
|
-
import type { AnyRouter, DeepPartial, Expand, MakeOptionalPathParams, MakeOptionalSearchParams, MakeRouteMatchUnion, MaskOptions, MatchRouteOptions,
|
|
2
|
+
import type { AnyRouter, DeepPartial, Expand, MakeOptionalPathParams, MakeOptionalSearchParams, MakeRouteMatchUnion, MaskOptions, MatchRouteOptions, RegisteredRouter, ResolveRoute, ToSubOptionsProps } from '@tanstack/router-core';
|
|
3
3
|
declare module '@tanstack/router-core' {
|
|
4
4
|
interface RouteMatchExtensions {
|
|
5
5
|
meta?: Array<Solid.JSX.IntrinsicElements['meta'] | undefined>;
|
|
@@ -13,7 +13,7 @@ export declare function Matches(): Solid.JSX.Element;
|
|
|
13
13
|
export type UseMatchRouteOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = undefined, TMaskFrom extends string = TFrom, TMaskTo extends string = ''> = ToSubOptionsProps<TRouter, TFrom, TTo> & DeepPartial<MakeOptionalSearchParams<TRouter, TFrom, TTo>> & DeepPartial<MakeOptionalPathParams<TRouter, TFrom, TTo>> & MaskOptions<TRouter, TMaskFrom, TMaskTo> & MatchRouteOptions;
|
|
14
14
|
export declare function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>(): <const TFrom extends string = string, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, const TMaskTo extends string = "">(opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>) => Solid.Accessor<false | Expand<ResolveRoute<TRouter, TFrom, TTo>["types"]["allParams"]>>;
|
|
15
15
|
export type MakeMatchRouteOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = undefined, TMaskFrom extends string = TFrom, TMaskTo extends string = ''> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {
|
|
16
|
-
children?: ((params?:
|
|
16
|
+
children?: ((params?: Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>) => Solid.JSX.Element) | Solid.JSX.Element;
|
|
17
17
|
};
|
|
18
18
|
export declare function MatchRoute<TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string = string, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, const TMaskTo extends string = ''>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any;
|
|
19
19
|
export interface UseMatchesBaseOptions<TRouter extends AnyRouter, TSelected> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Matches.jsx","sourceRoot":"","sources":["../../src/Matches.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"Matches.jsx","sourceRoot":"","sources":["../../src/Matches.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AA0B/B,MAAM,UAAU,OAAO;IACrB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,MAAM,gBAAgB,GACpB,CAAC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AAC,GAAG,CAAC,CACxD,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/package.json
CHANGED
package/src/Match.tsx
CHANGED
|
@@ -273,6 +273,22 @@ export const MatchInner = (): any => {
|
|
|
273
273
|
return <Outlet />
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
+
const getLoadPromise = (
|
|
277
|
+
matchId: string,
|
|
278
|
+
fallbackMatch:
|
|
279
|
+
| {
|
|
280
|
+
_nonReactive: {
|
|
281
|
+
loadPromise?: Promise<void>
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
| undefined,
|
|
285
|
+
) => {
|
|
286
|
+
return (
|
|
287
|
+
router.getMatch(matchId)?._nonReactive.loadPromise ??
|
|
288
|
+
fallbackMatch?._nonReactive.loadPromise
|
|
289
|
+
)
|
|
290
|
+
}
|
|
291
|
+
|
|
276
292
|
const keyedOut = () => (
|
|
277
293
|
<Solid.Show when={componentKey()} keyed>
|
|
278
294
|
{(_key) => out()}
|
|
@@ -375,6 +391,9 @@ export const MatchInner = (): any => {
|
|
|
375
391
|
</Solid.Match>
|
|
376
392
|
<Solid.Match when={currentMatch().status === 'redirected'}>
|
|
377
393
|
{(_) => {
|
|
394
|
+
const matchId = currentMatch().id
|
|
395
|
+
const routerMatch = router.getMatch(matchId)
|
|
396
|
+
|
|
378
397
|
if (!isRedirect(currentMatch().error)) {
|
|
379
398
|
if (process.env.NODE_ENV !== 'production') {
|
|
380
399
|
throw new Error(
|
|
@@ -387,8 +406,7 @@ export const MatchInner = (): any => {
|
|
|
387
406
|
|
|
388
407
|
const [loaderResult] = Solid.createResource(async () => {
|
|
389
408
|
await new Promise((r) => setTimeout(r, 0))
|
|
390
|
-
return
|
|
391
|
-
.loadPromise
|
|
409
|
+
return getLoadPromise(matchId, routerMatch)
|
|
392
410
|
})
|
|
393
411
|
|
|
394
412
|
return <>{loaderResult()}</>
|
package/src/Matches.tsx
CHANGED
|
@@ -17,11 +17,8 @@ import type {
|
|
|
17
17
|
MakeRouteMatchUnion,
|
|
18
18
|
MaskOptions,
|
|
19
19
|
MatchRouteOptions,
|
|
20
|
-
NoInfer,
|
|
21
20
|
RegisteredRouter,
|
|
22
|
-
ResolveRelativePath,
|
|
23
21
|
ResolveRoute,
|
|
24
|
-
RouteByPath,
|
|
25
22
|
ToSubOptionsProps,
|
|
26
23
|
} from '@tanstack/router-core'
|
|
27
24
|
|
|
@@ -166,10 +163,9 @@ export type MakeMatchRouteOptions<
|
|
|
166
163
|
// 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
|
|
167
164
|
children?:
|
|
168
165
|
| ((
|
|
169
|
-
params?:
|
|
170
|
-
TRouter['
|
|
171
|
-
|
|
172
|
-
>['types']['allParams'],
|
|
166
|
+
params?: Expand<
|
|
167
|
+
ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']
|
|
168
|
+
>,
|
|
173
169
|
) => Solid.JSX.Element)
|
|
174
170
|
| Solid.JSX.Element
|
|
175
171
|
}
|