@tanstack/solid-router 1.168.22 → 1.168.24
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 +2 -1
- package/dist/cjs/Match.cjs.map +1 -1
- package/dist/cjs/awaited.cjs +17 -6
- package/dist/cjs/awaited.cjs.map +1 -1
- package/dist/cjs/useMatch.cjs +5 -1
- package/dist/cjs/useMatch.cjs.map +1 -1
- package/dist/esm/Match.js +2 -1
- package/dist/esm/Match.js.map +1 -1
- package/dist/esm/awaited.js +17 -6
- package/dist/esm/awaited.js.map +1 -1
- package/dist/esm/useMatch.js +5 -1
- package/dist/esm/useMatch.js.map +1 -1
- package/dist/source/Match.jsx +6 -2
- package/dist/source/Match.jsx.map +1 -1
- package/dist/source/awaited.jsx +15 -8
- package/dist/source/awaited.jsx.map +1 -1
- package/dist/source/useMatch.jsx +9 -1
- package/dist/source/useMatch.jsx.map +1 -1
- package/package.json +1 -1
- package/src/Match.tsx +8 -2
- package/src/awaited.tsx +30 -9
- package/src/useMatch.tsx +15 -1
package/dist/cjs/Match.cjs
CHANGED
|
@@ -52,6 +52,7 @@ var Match = (props) => {
|
|
|
52
52
|
const routeOnCatch = () => route().options.onCatch ?? router.options.defaultOnCatch;
|
|
53
53
|
const routeNotFoundComponent = () => route().isRoot ? route().options.notFoundComponent ?? router.options.notFoundRoute?.options.component : route().options.notFoundComponent;
|
|
54
54
|
const resolvedNoSsr = currentMatchState().ssr === false || currentMatchState().ssr === "data-only";
|
|
55
|
+
const shouldSkipSuspenseFallback = _tanstack_router_core_isServer.isServer ?? router.isServer ? resolvedNoSsr : currentMatchState().ssr === "data-only";
|
|
55
56
|
const ResolvedSuspenseBoundary = () => solid_js.Suspense;
|
|
56
57
|
const ResolvedCatchBoundary = () => routeErrorComponent() ? require_CatchBoundary.CatchBoundary : require_SafeFragment.SafeFragment;
|
|
57
58
|
const ResolvedNotFoundBoundary = () => routeNotFoundComponent() ? require_not_found.CatchNotFound : require_SafeFragment.SafeFragment;
|
|
@@ -64,7 +65,7 @@ var Match = (props) => {
|
|
|
64
65
|
return ResolvedSuspenseBoundary();
|
|
65
66
|
},
|
|
66
67
|
get fallback() {
|
|
67
|
-
return
|
|
68
|
+
return shouldSkipSuspenseFallback ? void 0 : (0, solid_js_web.createComponent)(solid_js_web.Dynamic, { get component() {
|
|
68
69
|
return resolvePendingComponent();
|
|
69
70
|
} });
|
|
70
71
|
},
|
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","matchStores","get","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","state","__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","childRouteKey","cid","resolvedRoute","_routeKey"],"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.matchStores.get(id)?.get()\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.get()[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.get()}\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.get()?.state.__TSR_key,\n )\n Solid.createEffect(\n Solid.on([location], () => {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(\n router.stores.location.get(),\n router.stores.resolvedLocation.get(),\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.get()[currentRouteId]\n : undefined\n })\n\n const childMatchStatus = Solid.createMemo(() => {\n const id = childMatchId()\n if (!id) return undefined\n return router.stores.matchStores.get(id)?.get().status\n })\n\n const shouldShowNotFound = () =>\n childMatchStatus() !== 'redirected' && parentGlobalNotFound()\n\n const childRouteKey = Solid.createMemo(() => {\n if (shouldShowNotFound()) return undefined\n const cid = childMatchId()\n if (!cid) return undefined\n return router.stores.matchStores.get(cid)?.routeId ?? cid\n })\n\n return (\n <Solid.Show\n when={childRouteKey()}\n keyed\n fallback={\n <Solid.Show when={shouldShowNotFound() && route()}>\n {(resolvedRoute) =>\n renderRouteNotFound(router, resolvedRoute(), undefined)\n }\n </Solid.Show>\n }\n >\n {(_routeKey: string) => {\n return (\n <Solid.Show\n when={routeId() === rootRouteId}\n fallback={<Match matchId={childMatchId()!} />}\n >\n <Solid.Suspense\n fallback={\n <Dynamic component={router.options.defaultPendingComponent} />\n }\n >\n <Match matchId={childMatchId()!} />\n </Solid.Suspense>\n </Solid.Show>\n )\n }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["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","matchStores","get","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","shouldSkipSuspenseFallback","ResolvedSuspenseBoundary","Suspense","ResolvedCatchBoundary","ResolvedNotFoundBoundary","ShellComponent","shellComponent","Provider","value","fallback","getResetKey","loadedAt","error","Error","notFoundError","process","env","NODE_ENV","console","warn","_$mergeProps","Switch","MatchInner","_$memo","OnRendered","scrollRestoration","location","resolvedLocation","state","__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","childRouteKey","cid","resolvedRoute","_routeKey"],"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.matchStores.get(id)?.get()\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.get()[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 shouldSkipSuspenseFallback =\n (isServer ?? router.isServer)\n ? resolvedNoSsr\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 // Data-only SSR renders the inner fallback on the server, so\n // avoid adding an extra suspense fallback on the client.\n shouldSkipSuspenseFallback ? undefined : (\n <Dynamic component={resolvePendingComponent()} />\n )\n }\n >\n <Dynamic\n component={ResolvedCatchBoundary()}\n getResetKey={() => router.stores.loadedAt.get()}\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.get()?.state.__TSR_key,\n )\n Solid.createEffect(\n Solid.on([location], () => {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(\n router.stores.location.get(),\n router.stores.resolvedLocation.get(),\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.get()[currentRouteId]\n : undefined\n })\n\n const childMatchStatus = Solid.createMemo(() => {\n const id = childMatchId()\n if (!id) return undefined\n return router.stores.matchStores.get(id)?.get().status\n })\n\n const shouldShowNotFound = () =>\n childMatchStatus() !== 'redirected' && parentGlobalNotFound()\n\n const childRouteKey = Solid.createMemo(() => {\n if (shouldShowNotFound()) return undefined\n const cid = childMatchId()\n if (!cid) return undefined\n return router.stores.matchStores.get(cid)?.routeId ?? cid\n })\n\n return (\n <Solid.Show\n when={childRouteKey()}\n keyed\n fallback={\n <Solid.Show when={shouldShowNotFound() && route()}>\n {(resolvedRoute) =>\n renderRouteNotFound(router, resolvedRoute(), undefined)\n }\n </Solid.Show>\n }\n >\n {(_routeKey: string) => {\n return (\n <Solid.Show\n when={routeId() === rootRouteId}\n fallback={<Match matchId={childMatchId()!} />}\n >\n <Solid.Suspense\n fallback={\n <Dynamic component={router.options.defaultPendingComponent} />\n }\n >\n <Match matchId={childMatchId()!} />\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,YAAYC,IAAIJ,GAAG,EAA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A,aAAA,iBACG5J,SAAM8C,MAAI;EAAA,IACTC,OAAI;AAAA,UAAE4G,eAAe;;EACrB5B,OAAK;EAAA,IACLnD,WAAQ;AAAA,WAAA,GAAA,aAAA,iBACL5E,SAAM8C,MAAI;IAAA,IAACC,OAAI;AAAA,aAAA,GAAA,aAAA,YAAE,CAAA,CAAA2G,oBAAoB,CAAA,EAAA,IAAIxG,OAAO;;IAAAF,WAC7C6G,kBACA7I,4BAAAA,oBAAoBO,QAAQsI,eAAe,EAAElI,KAAAA,EAAS;IAAC,CAAA;;EAAAqB,WAK3D8G,cAAsB;AACtB,WAAA,GAAA,aAAA,iBACG9J,SAAM8C,MAAI;IAAA,IACTC,OAAI;AAAA,YAAEd,SAAS,KAAK3B,sBAAAA;;IAAW,IAC/BsE,WAAQ;AAAA,aAAA,GAAA,aAAA,iBAAGxD,OAAK,EAAA,IAACE,UAAO;AAAA,aAAEiI,cAAc;QAAC,CAAA;;IAAA,IAAAvG,WAAA;AAAA,aAAA,GAAA,aAAA,iBAExChD,SAAMqE,UAAQ;MAAA,IACbO,WAAQ;AAAA,eAAA,GAAA,aAAA,iBACLpE,aAAAA,SAAO,EAAA,IAACyD,YAAS;AAAA,eAAE1C,OAAO6B,QAAQE;UAAuB,CAAA;;MAAA,IAAAN,WAAA;AAAA,eAAA,GAAA,aAAA,iBAG3D5B,OAAK,EAAA,IAACE,UAAO;AAAA,eAAEiI,cAAc;UAAC,CAAA;;MAAA,CAAA;;IAAA,CAAA;;EAItC,CAAA"}
|
package/dist/cjs/awaited.cjs
CHANGED
|
@@ -11,17 +11,28 @@ function useAwaited({ promise: _promise }) {
|
|
|
11
11
|
return [promise[_tanstack_router_core.TSR_DEFERRED_PROMISE].data, promise];
|
|
12
12
|
}
|
|
13
13
|
function Await(props) {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
if (!("fallback" in props)) {
|
|
15
|
+
const [resource] = solid_js.createResource(() => (0, _tanstack_router_core.defer)(props.promise), (p) => p, { deferStream: true });
|
|
16
|
+
return (0, solid_js_web.createComponent)(solid_js.Show, {
|
|
17
|
+
get when() {
|
|
18
|
+
return resource();
|
|
19
|
+
},
|
|
20
|
+
children: (data) => props.children(data())
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return (0, solid_js_web.createComponent)(solid_js.Suspense, {
|
|
16
24
|
get fallback() {
|
|
17
25
|
return props.fallback;
|
|
18
26
|
},
|
|
19
|
-
get
|
|
20
|
-
return
|
|
21
|
-
}
|
|
22
|
-
children: (data) => props.children(data())
|
|
27
|
+
get children() {
|
|
28
|
+
return (0, solid_js_web.createComponent)(AwaitInner, props);
|
|
29
|
+
}
|
|
23
30
|
});
|
|
24
31
|
}
|
|
32
|
+
function AwaitInner(props) {
|
|
33
|
+
const [resource] = solid_js.createResource(() => (0, _tanstack_router_core.defer)(props.promise), (p) => p);
|
|
34
|
+
return props.children(resource());
|
|
35
|
+
}
|
|
25
36
|
//#endregion
|
|
26
37
|
exports.Await = Await;
|
|
27
38
|
exports.useAwaited = useAwaited;
|
package/dist/cjs/awaited.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"awaited.cjs","names":["Solid","TSR_DEFERRED_PROMISE","defer","DeferredPromise","SolidNode","AwaitOptions","promise","Promise","T","useAwaited","_promise","status","error","data","Await","props","fallback","children","result","resource","createResource","p","deferStream","_$createComponent","Show","when"],"sources":["../../src/awaited.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nimport { TSR_DEFERRED_PROMISE, defer } from '@tanstack/router-core'\nimport type { DeferredPromise } from '@tanstack/router-core'\nimport type { SolidNode } from './route'\n\nexport type AwaitOptions<T> = {\n promise: Promise<T>\n}\n\nexport function useAwaited<T>({\n promise: _promise,\n}: AwaitOptions<T>): [T, DeferredPromise<T>] {\n const promise = defer(_promise)\n\n if (promise[TSR_DEFERRED_PROMISE].status === 'pending') {\n throw promise\n }\n\n if (promise[TSR_DEFERRED_PROMISE].status === 'error') {\n throw promise[TSR_DEFERRED_PROMISE].error\n }\n\n return [promise[TSR_DEFERRED_PROMISE].data, promise]\n}\n\nexport function Await<T>(\n props: AwaitOptions<T> & {\n fallback?: SolidNode\n children: (result: T) => SolidNode\n },\n) {\n const [resource] = Solid.createResource(\n
|
|
1
|
+
{"version":3,"file":"awaited.cjs","names":["Solid","TSR_DEFERRED_PROMISE","defer","DeferredPromise","SolidNode","AwaitOptions","promise","Promise","T","useAwaited","_promise","status","error","data","Await","props","fallback","children","result","resource","createResource","p","deferStream","_$createComponent","Show","when","Suspense","AwaitInner"],"sources":["../../src/awaited.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nimport { TSR_DEFERRED_PROMISE, defer } from '@tanstack/router-core'\nimport type { DeferredPromise } from '@tanstack/router-core'\nimport type { SolidNode } from './route'\n\nexport type AwaitOptions<T> = {\n promise: Promise<T>\n}\n\nexport function useAwaited<T>({\n promise: _promise,\n}: AwaitOptions<T>): [T, DeferredPromise<T>] {\n const promise = defer(_promise)\n\n if (promise[TSR_DEFERRED_PROMISE].status === 'pending') {\n throw promise\n }\n\n if (promise[TSR_DEFERRED_PROMISE].status === 'error') {\n throw promise[TSR_DEFERRED_PROMISE].error\n }\n\n return [promise[TSR_DEFERRED_PROMISE].data, promise]\n}\n\nexport function Await<T>(\n props: AwaitOptions<T> & {\n fallback?: SolidNode\n children: (result: T) => SolidNode\n },\n) {\n if (!('fallback' in props)) {\n const [resource] = Solid.createResource(\n () => defer(props.promise),\n (p) => p,\n {\n deferStream: true,\n },\n )\n\n return (\n <Solid.Show when={resource()}>\n {(data) => props.children(data())}\n </Solid.Show>\n )\n }\n\n return (\n <Solid.Suspense fallback={props.fallback}>\n <AwaitInner {...props} />\n </Solid.Suspense>\n )\n}\n\nfunction AwaitInner<T>(\n props: AwaitOptions<T> & {\n fallback?: SolidNode\n children: (result: T) => SolidNode\n },\n) {\n const [resource] = Solid.createResource(\n () => defer(props.promise),\n (p) => p,\n )\n\n return props.children(resource() as T)\n}\n"],"mappings":";;;;;;AAUA,SAAgBS,WAAc,EAC5BH,SAASI,YACkC;CAC3C,MAAMJ,WAAAA,GAAAA,sBAAAA,OAAgBI,SAAS;AAE/B,KAAIJ,QAAQL,sBAAAA,sBAAsBU,WAAW,UAC3C,OAAML;AAGR,KAAIA,QAAQL,sBAAAA,sBAAsBU,WAAW,QAC3C,OAAML,QAAQL,sBAAAA,sBAAsBW;AAGtC,QAAO,CAACN,QAAQL,sBAAAA,sBAAsBY,MAAMP,QAAQ;;AAGtD,SAAgBQ,MACdC,OAIA;AACA,KAAI,EAAE,cAAcA,QAAQ;EAC1B,MAAM,CAACI,YAAYnB,SAAMoB,sBAAAA,GAAAA,sBAAAA,OACXL,MAAMT,QAAQ,GACzBe,MAAMA,GACP,EACEC,aAAa,MAEjB,CAAC;AAED,UAAA,GAAA,aAAA,iBACGtB,SAAMwB,MAAI;GAAA,IAACC,OAAI;AAAA,WAAEN,UAAU;;GAAAF,WACxBJ,SAASE,MAAME,SAASJ,MAAM,CAAA;GAAC,CAAA;;AAKvC,SAAA,GAAA,aAAA,iBACGb,SAAM0B,UAAQ;EAAA,IAACV,WAAQ;AAAA,UAAED,MAAMC;;EAAQ,IAAAC,WAAA;AAAA,WAAA,GAAA,aAAA,iBACrCU,YAAeZ,MAAK;;EAAA,CAAA;;AAK3B,SAASY,WACPZ,OAIA;CACA,MAAM,CAACI,YAAYnB,SAAMoB,sBAAAA,GAAAA,sBAAAA,OACXL,MAAMT,QAAQ,GACzBe,MAAMA,EACR;AAED,QAAON,MAAME,SAASE,UAAU,CAAM"}
|
package/dist/cjs/useMatch.cjs
CHANGED
|
@@ -21,7 +21,11 @@ function useMatch(opts) {
|
|
|
21
21
|
});
|
|
22
22
|
return solid_js.createMemo((prev) => {
|
|
23
23
|
const selectedMatch = match();
|
|
24
|
-
if (selectedMatch === void 0)
|
|
24
|
+
if (selectedMatch === void 0) {
|
|
25
|
+
const hasPendingMatch = opts.from ? Boolean(router.stores.pendingRouteIds.get()[opts.from]) : nearestMatch?.hasPending() ?? false;
|
|
26
|
+
if (prev !== void 0 && (hasPendingMatch || router.stores.isTransitioning.get())) return prev;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
25
29
|
const res = opts.select ? opts.select(selectedMatch) : selectedMatch;
|
|
26
30
|
if (prev === void 0) return res;
|
|
27
31
|
return (0, _tanstack_router_core.replaceEqualDeep)(prev, res);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMatch.cjs","names":["Solid","invariant","replaceEqualDeep","nearestMatchContext","useRouter","AnyRouter","MakeRouteMatch","MakeRouteMatchUnion","RegisteredRouter","StrictOrFrom","ThrowConstraint","ThrowOrOptional","UseMatchBaseOptions","select","match","TRouter","TFrom","TStrict","TSelected","shouldThrow","TThrow","UseMatchRoute","opts","Accessor","UseMatchResult","UseMatchOptions","useMatch","router","nearestMatch","from","undefined","useContext","stores","getRouteMatchStore","get","createEffect","hasPendingMatch","Boolean","pendingRouteIds","hasPending","isTransitioning","process","env","NODE_ENV","Error","createMemo","prev","selectedMatch","res"],"sources":["../../src/useMatch.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { invariant, replaceEqualDeep } from '@tanstack/router-core'\nimport { nearestMatchContext } from './matchContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n MakeRouteMatch,\n MakeRouteMatchUnion,\n RegisteredRouter,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n} from '@tanstack/router-core'\n\nexport interface UseMatchBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (\n match: MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>,\n ) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseMatchRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchBaseOptions<TRouter, TFrom, true, true, TSelected>,\n) => Solid.Accessor<UseMatchResult<TRouter, TFrom, true, TSelected>>\n\nexport type UseMatchOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseMatchBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseMatchResult<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TSelected,\n> = unknown extends TSelected\n ? TStrict extends true\n ? MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>\n : MakeRouteMatchUnion<TRouter>\n : TSelected\n\nexport function useMatch<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseMatchOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Solid.Accessor<\n ThrowOrOptional<UseMatchResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n const router = useRouter<TRouter>()\n const nearestMatch = opts.from\n ? undefined\n : Solid.useContext(nearestMatchContext)\n\n const match = () => {\n if (opts.from) {\n return router.stores.getRouteMatchStore(opts.from).get()\n }\n\n return nearestMatch?.match()\n }\n\n Solid.createEffect(() => {\n if (match() !== undefined) {\n return\n }\n\n const hasPendingMatch = opts.from\n ? Boolean(router.stores.pendingRouteIds.get()[opts.from!])\n : (nearestMatch?.hasPending() ?? false)\n\n if (\n !hasPendingMatch &&\n !router.stores.isTransitioning.get() &&\n (opts.shouldThrow ?? true)\n ) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Invariant failed: Could not find ${opts.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'}`,\n )\n }\n\n invariant()\n }\n })\n\n return Solid.createMemo((prev: TSelected | undefined) => {\n const selectedMatch = match()\n\n if (selectedMatch === undefined) return undefined\n const res = opts.select ? opts.select(selectedMatch as any) : selectedMatch\n if (prev === undefined) return res as TSelected\n return replaceEqualDeep(prev, res) as TSelected\n }) as any\n}\n"],"mappings":";;;;;;;AAsDA,SAAgB0B,SAOdJ,MASA;CACA,MAAMK,SAASvB,kBAAAA,WAAoB;CACnC,MAAMwB,eAAeN,KAAKO,OACtBC,KAAAA,IACA9B,SAAM+B,WAAW5B,qBAAAA,oBAAoB;CAEzC,MAAMW,cAAc;AAClB,MAAIQ,KAAKO,KACP,QAAOF,OAAOK,OAAOC,mBAAmBX,KAAKO,KAAK,CAACK,KAAK;AAG1D,SAAON,cAAcd,OAAO;;AAG9Bd,UAAMmC,mBAAmB;AACvB,MAAIrB,OAAO,KAAKgB,KAAAA,EACd;AAOF,MACE,EALsBR,KAAKO,OACzBQ,QAAQV,OAAOK,OAAOM,gBAAgBJ,KAAK,CAACZ,KAAKO,MAAO,GACvDD,cAAcW,YAAY,IAAI,UAIjC,CAACZ,OAAOK,OAAOQ,gBAAgBN,KAAK,KACnCZ,KAAKH,eAAe,OACrB;AACA,OAAA,QAAA,IAAA,aAA6B,aAC3B,OAAM,IAAIyB,MACR,oCAAoCtB,KAAKO,OAAO,yBAAyBP,KAAKO,KAAI,KAAM,qBACzF;AAGH5B,IAAAA,GAAAA,sBAAAA,YAAW;;GAEb;AAEF,QAAOD,SAAM6C,YAAYC,SAAgC;EACvD,MAAMC,gBAAgBjC,OAAO;AAE7B,MAAIiC,kBAAkBjB,KAAAA,
|
|
1
|
+
{"version":3,"file":"useMatch.cjs","names":["Solid","invariant","replaceEqualDeep","nearestMatchContext","useRouter","AnyRouter","MakeRouteMatch","MakeRouteMatchUnion","RegisteredRouter","StrictOrFrom","ThrowConstraint","ThrowOrOptional","UseMatchBaseOptions","select","match","TRouter","TFrom","TStrict","TSelected","shouldThrow","TThrow","UseMatchRoute","opts","Accessor","UseMatchResult","UseMatchOptions","useMatch","router","nearestMatch","from","undefined","useContext","stores","getRouteMatchStore","get","createEffect","hasPendingMatch","Boolean","pendingRouteIds","hasPending","isTransitioning","process","env","NODE_ENV","Error","createMemo","prev","selectedMatch","res"],"sources":["../../src/useMatch.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { invariant, replaceEqualDeep } from '@tanstack/router-core'\nimport { nearestMatchContext } from './matchContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n MakeRouteMatch,\n MakeRouteMatchUnion,\n RegisteredRouter,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n} from '@tanstack/router-core'\n\nexport interface UseMatchBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (\n match: MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>,\n ) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseMatchRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchBaseOptions<TRouter, TFrom, true, true, TSelected>,\n) => Solid.Accessor<UseMatchResult<TRouter, TFrom, true, TSelected>>\n\nexport type UseMatchOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseMatchBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseMatchResult<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TSelected,\n> = unknown extends TSelected\n ? TStrict extends true\n ? MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>\n : MakeRouteMatchUnion<TRouter>\n : TSelected\n\nexport function useMatch<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseMatchOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Solid.Accessor<\n ThrowOrOptional<UseMatchResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n const router = useRouter<TRouter>()\n const nearestMatch = opts.from\n ? undefined\n : Solid.useContext(nearestMatchContext)\n\n const match = () => {\n if (opts.from) {\n return router.stores.getRouteMatchStore(opts.from).get()\n }\n\n return nearestMatch?.match()\n }\n\n Solid.createEffect(() => {\n if (match() !== undefined) {\n return\n }\n\n const hasPendingMatch = opts.from\n ? Boolean(router.stores.pendingRouteIds.get()[opts.from!])\n : (nearestMatch?.hasPending() ?? false)\n\n if (\n !hasPendingMatch &&\n !router.stores.isTransitioning.get() &&\n (opts.shouldThrow ?? true)\n ) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Invariant failed: Could not find ${opts.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'}`,\n )\n }\n\n invariant()\n }\n })\n\n return Solid.createMemo((prev: TSelected | undefined) => {\n const selectedMatch = match()\n\n if (selectedMatch === undefined) {\n const hasPendingMatch = opts.from\n ? Boolean(router.stores.pendingRouteIds.get()[opts.from!])\n : (nearestMatch?.hasPending() ?? false)\n\n if (\n prev !== undefined &&\n (hasPendingMatch || router.stores.isTransitioning.get())\n ) {\n return prev\n }\n\n return undefined\n }\n\n const res = opts.select ? opts.select(selectedMatch as any) : selectedMatch\n if (prev === undefined) return res as TSelected\n return replaceEqualDeep(prev, res) as TSelected\n }) as any\n}\n"],"mappings":";;;;;;;AAsDA,SAAgB0B,SAOdJ,MASA;CACA,MAAMK,SAASvB,kBAAAA,WAAoB;CACnC,MAAMwB,eAAeN,KAAKO,OACtBC,KAAAA,IACA9B,SAAM+B,WAAW5B,qBAAAA,oBAAoB;CAEzC,MAAMW,cAAc;AAClB,MAAIQ,KAAKO,KACP,QAAOF,OAAOK,OAAOC,mBAAmBX,KAAKO,KAAK,CAACK,KAAK;AAG1D,SAAON,cAAcd,OAAO;;AAG9Bd,UAAMmC,mBAAmB;AACvB,MAAIrB,OAAO,KAAKgB,KAAAA,EACd;AAOF,MACE,EALsBR,KAAKO,OACzBQ,QAAQV,OAAOK,OAAOM,gBAAgBJ,KAAK,CAACZ,KAAKO,MAAO,GACvDD,cAAcW,YAAY,IAAI,UAIjC,CAACZ,OAAOK,OAAOQ,gBAAgBN,KAAK,KACnCZ,KAAKH,eAAe,OACrB;AACA,OAAA,QAAA,IAAA,aAA6B,aAC3B,OAAM,IAAIyB,MACR,oCAAoCtB,KAAKO,OAAO,yBAAyBP,KAAKO,KAAI,KAAM,qBACzF;AAGH5B,IAAAA,GAAAA,sBAAAA,YAAW;;GAEb;AAEF,QAAOD,SAAM6C,YAAYC,SAAgC;EACvD,MAAMC,gBAAgBjC,OAAO;AAE7B,MAAIiC,kBAAkBjB,KAAAA,GAAW;GAC/B,MAAMM,kBAAkBd,KAAKO,OACzBQ,QAAQV,OAAOK,OAAOM,gBAAgBJ,KAAK,CAACZ,KAAKO,MAAO,GACvDD,cAAcW,YAAY,IAAI;AAEnC,OACEO,SAAShB,KAAAA,MACRM,mBAAmBT,OAAOK,OAAOQ,gBAAgBN,KAAK,EAEvD,QAAOY;AAGT;;EAGF,MAAME,MAAM1B,KAAKT,SAASS,KAAKT,OAAOkC,cAAqB,GAAGA;AAC9D,MAAID,SAAShB,KAAAA,EAAW,QAAOkB;AAC/B,UAAA,GAAA,sBAAA,kBAAwBF,MAAME,IAAI;GAClC"}
|
package/dist/esm/Match.js
CHANGED
|
@@ -50,6 +50,7 @@ var Match = (props) => {
|
|
|
50
50
|
const routeOnCatch = () => route().options.onCatch ?? router.options.defaultOnCatch;
|
|
51
51
|
const routeNotFoundComponent = () => route().isRoot ? route().options.notFoundComponent ?? router.options.notFoundRoute?.options.component : route().options.notFoundComponent;
|
|
52
52
|
const resolvedNoSsr = currentMatchState().ssr === false || currentMatchState().ssr === "data-only";
|
|
53
|
+
const shouldSkipSuspenseFallback = isServer ?? router.isServer ? resolvedNoSsr : currentMatchState().ssr === "data-only";
|
|
53
54
|
const ResolvedSuspenseBoundary = () => Solid.Suspense;
|
|
54
55
|
const ResolvedCatchBoundary = () => routeErrorComponent() ? CatchBoundary : SafeFragment;
|
|
55
56
|
const ResolvedNotFoundBoundary = () => routeNotFoundComponent() ? CatchNotFound : SafeFragment;
|
|
@@ -62,7 +63,7 @@ var Match = (props) => {
|
|
|
62
63
|
return ResolvedSuspenseBoundary();
|
|
63
64
|
},
|
|
64
65
|
get fallback() {
|
|
65
|
-
return
|
|
66
|
+
return shouldSkipSuspenseFallback ? void 0 : createComponent(Dynamic, { get component() {
|
|
66
67
|
return resolvePendingComponent();
|
|
67
68
|
} });
|
|
68
69
|
},
|
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","matchStores","get","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","state","__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","childRouteKey","cid","resolvedRoute","_routeKey"],"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.matchStores.get(id)?.get()\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.get()[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.get()}\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.get()?.state.__TSR_key,\n )\n Solid.createEffect(\n Solid.on([location], () => {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(\n router.stores.location.get(),\n router.stores.resolvedLocation.get(),\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.get()[currentRouteId]\n : undefined\n })\n\n const childMatchStatus = Solid.createMemo(() => {\n const id = childMatchId()\n if (!id) return undefined\n return router.stores.matchStores.get(id)?.get().status\n })\n\n const shouldShowNotFound = () =>\n childMatchStatus() !== 'redirected' && parentGlobalNotFound()\n\n const childRouteKey = Solid.createMemo(() => {\n if (shouldShowNotFound()) return undefined\n const cid = childMatchId()\n if (!cid) return undefined\n return router.stores.matchStores.get(cid)?.routeId ?? cid\n })\n\n return (\n <Solid.Show\n when={childRouteKey()}\n keyed\n fallback={\n <Solid.Show when={shouldShowNotFound() && route()}>\n {(resolvedRoute) =>\n renderRouteNotFound(router, resolvedRoute(), undefined)\n }\n </Solid.Show>\n }\n >\n {(_routeKey: string) => {\n return (\n <Solid.Show\n when={routeId() === rootRouteId}\n fallback={<Match matchId={childMatchId()!} />}\n >\n <Solid.Suspense\n fallback={\n <Dynamic component={router.options.defaultPendingComponent} />\n }\n >\n <Match matchId={childMatchId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AAI;IAAA,IACTC,OAAI;AAAA,YAAEd,SAAS,KAAK3B;;IAAW,IAC/BqE,WAAQ;AAAA,YAAA9B,gBAAGzB,OAAK,EAAA,IAACE,UAAO;AAAA,aAAEgI,cAAc;QAAC,CAAA;;IAAA,IAAAtG,WAAA;AAAA,YAAAH,gBAExC7C,MAAMoE,UAAQ;MAAA,IACbO,WAAQ;AAAA,cAAA9B,gBACLrC,SAAO,EAAA,IAACyD,YAAS;AAAA,eAAE1C,OAAO6B,QAAQE;UAAuB,CAAA;;MAAA,IAAAN,WAAA;AAAA,cAAAH,gBAG3DzB,OAAK,EAAA,IAACE,UAAO;AAAA,eAAEgI,cAAc;UAAC,CAAA;;MAAA,CAAA;;IAAA,CAAA;;EAItC,CAAA"}
|
|
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","matchStores","get","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","shouldSkipSuspenseFallback","ResolvedSuspenseBoundary","Suspense","ResolvedCatchBoundary","ResolvedNotFoundBoundary","ShellComponent","shellComponent","Provider","value","fallback","getResetKey","loadedAt","error","Error","notFoundError","process","env","NODE_ENV","console","warn","_$mergeProps","Switch","MatchInner","_$memo","OnRendered","scrollRestoration","location","resolvedLocation","state","__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","childRouteKey","cid","resolvedRoute","_routeKey"],"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.matchStores.get(id)?.get()\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.get()[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 shouldSkipSuspenseFallback =\n (isServer ?? router.isServer)\n ? resolvedNoSsr\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 // Data-only SSR renders the inner fallback on the server, so\n // avoid adding an extra suspense fallback on the client.\n shouldSkipSuspenseFallback ? undefined : (\n <Dynamic component={resolvePendingComponent()} />\n )\n }\n >\n <Dynamic\n component={ResolvedCatchBoundary()}\n getResetKey={() => router.stores.loadedAt.get()}\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.get()?.state.__TSR_key,\n )\n Solid.createEffect(\n Solid.on([location], () => {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(\n router.stores.location.get(),\n router.stores.resolvedLocation.get(),\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.get()[currentRouteId]\n : undefined\n })\n\n const childMatchStatus = Solid.createMemo(() => {\n const id = childMatchId()\n if (!id) return undefined\n return router.stores.matchStores.get(id)?.get().status\n })\n\n const shouldShowNotFound = () =>\n childMatchStatus() !== 'redirected' && parentGlobalNotFound()\n\n const childRouteKey = Solid.createMemo(() => {\n if (shouldShowNotFound()) return undefined\n const cid = childMatchId()\n if (!cid) return undefined\n return router.stores.matchStores.get(cid)?.routeId ?? cid\n })\n\n return (\n <Solid.Show\n when={childRouteKey()}\n keyed\n fallback={\n <Solid.Show when={shouldShowNotFound() && route()}>\n {(resolvedRoute) =>\n renderRouteNotFound(router, resolvedRoute(), undefined)\n }\n </Solid.Show>\n }\n >\n {(_routeKey: string) => {\n return (\n <Solid.Show\n when={routeId() === rootRouteId}\n fallback={<Match matchId={childMatchId()!} />}\n >\n <Solid.Suspense\n fallback={\n <Dynamic component={router.options.defaultPendingComponent} />\n }\n >\n <Match matchId={childMatchId()!} />\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,YAAYC,IAAIJ,GAAG,EAAEI,KAAK;GAC/C;CAEF,MAAMC,gBAAgB/B,MAAMyB,iBAAiB;EAC3C,MAAMO,eAAeR,OAAO;AAC5B,MAAI,CAACQ,aACH,QAAO;EAGT,MAAMC,UAAUD,aAAaC;EAC7B,MAAMC,gBAAiBX,OAAOY,WAAWF,UAAuBG,aAC5DV;AAEJ,SAAO;GACLJ,SAASU,aAAaN;GACtBO;GACAI,KAAKL,aAAaK;GAClBC,iBAAiBN,aAAaM;GACfJ;GAChB;GACD;CAQF,MAAMS,eAAe;EACnBrB,eAAeS,eAAe,EAAET;EAChCW,eAAeF,eAAe,EAAEE;EAChCT;EACAoB,YAVsB5C,MAAMyB,iBAAiB;GAC7C,MAAMe,iBAAiBT,eAAe,EAAEE;AACxC,UAAOO,iBACHC,QAAQlB,OAAOK,OAAOc,gBAAgBZ,KAAK,CAACU,gBAAgB,GAC5D;IACJ;EAMD;AAED,QAAAK,gBACG7C,MAAM8C,MAAI;EAAA,IAACC,OAAI;AAAA,UAAEhB,eAAe;;EAAAiB,WAC7BC,sBAAsB;GACtB,MAAMC,cACJ3B,OAAOY,WAAWc,mBAAmB,CAAChB;GAExC,MAAMkB,gCACJD,OAAO,CAACE,QAAQC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,OAAI;AAAA,YAAE2C,WAAA,CAAA,CAAAgE,oBAAoB,CAAA,EAAA,IAAIxG,OAAO;;IAAAF,WAC7C6G,kBACA7I,oBAAoBO,QAAQsI,eAAe,EAAElI,KAAAA,EAAS;IAAC,CAAA;;EAAAqB,WAK3D8G,cAAsB;AACtB,UAAAjH,gBACG7C,MAAM8C,MAAI;IAAA,IACTC,OAAI;AAAA,YAAEd,SAAS,KAAK3B;;IAAW,IAC/BsE,WAAQ;AAAA,YAAA/B,gBAAGzB,OAAK,EAAA,IAACE,UAAO;AAAA,aAAEiI,cAAc;QAAC,CAAA;;IAAA,IAAAvG,WAAA;AAAA,YAAAH,gBAExC7C,MAAMqE,UAAQ;MAAA,IACbO,WAAQ;AAAA,cAAA/B,gBACLrC,SAAO,EAAA,IAACyD,YAAS;AAAA,eAAE1C,OAAO6B,QAAQE;UAAuB,CAAA;;MAAA,IAAAN,WAAA;AAAA,cAAAH,gBAG3DzB,OAAK,EAAA,IAACE,UAAO;AAAA,eAAEiI,cAAc;UAAC,CAAA;;MAAA,CAAA;;IAAA,CAAA;;EAItC,CAAA"}
|
package/dist/esm/awaited.js
CHANGED
|
@@ -9,17 +9,28 @@ function useAwaited({ promise: _promise }) {
|
|
|
9
9
|
return [promise[TSR_DEFERRED_PROMISE].data, promise];
|
|
10
10
|
}
|
|
11
11
|
function Await(props) {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
if (!("fallback" in props)) {
|
|
13
|
+
const [resource] = Solid.createResource(() => defer(props.promise), (p) => p, { deferStream: true });
|
|
14
|
+
return createComponent(Solid.Show, {
|
|
15
|
+
get when() {
|
|
16
|
+
return resource();
|
|
17
|
+
},
|
|
18
|
+
children: (data) => props.children(data())
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return createComponent(Solid.Suspense, {
|
|
14
22
|
get fallback() {
|
|
15
23
|
return props.fallback;
|
|
16
24
|
},
|
|
17
|
-
get
|
|
18
|
-
return
|
|
19
|
-
}
|
|
20
|
-
children: (data) => props.children(data())
|
|
25
|
+
get children() {
|
|
26
|
+
return createComponent(AwaitInner, props);
|
|
27
|
+
}
|
|
21
28
|
});
|
|
22
29
|
}
|
|
30
|
+
function AwaitInner(props) {
|
|
31
|
+
const [resource] = Solid.createResource(() => defer(props.promise), (p) => p);
|
|
32
|
+
return props.children(resource());
|
|
33
|
+
}
|
|
23
34
|
//#endregion
|
|
24
35
|
export { Await, useAwaited };
|
|
25
36
|
|
package/dist/esm/awaited.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"awaited.js","names":["Solid","TSR_DEFERRED_PROMISE","defer","DeferredPromise","SolidNode","AwaitOptions","promise","Promise","T","useAwaited","_promise","status","error","data","Await","props","fallback","children","result","resource","createResource","p","deferStream","_$createComponent","Show","when"],"sources":["../../src/awaited.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nimport { TSR_DEFERRED_PROMISE, defer } from '@tanstack/router-core'\nimport type { DeferredPromise } from '@tanstack/router-core'\nimport type { SolidNode } from './route'\n\nexport type AwaitOptions<T> = {\n promise: Promise<T>\n}\n\nexport function useAwaited<T>({\n promise: _promise,\n}: AwaitOptions<T>): [T, DeferredPromise<T>] {\n const promise = defer(_promise)\n\n if (promise[TSR_DEFERRED_PROMISE].status === 'pending') {\n throw promise\n }\n\n if (promise[TSR_DEFERRED_PROMISE].status === 'error') {\n throw promise[TSR_DEFERRED_PROMISE].error\n }\n\n return [promise[TSR_DEFERRED_PROMISE].data, promise]\n}\n\nexport function Await<T>(\n props: AwaitOptions<T> & {\n fallback?: SolidNode\n children: (result: T) => SolidNode\n },\n) {\n const [resource] = Solid.createResource(\n
|
|
1
|
+
{"version":3,"file":"awaited.js","names":["Solid","TSR_DEFERRED_PROMISE","defer","DeferredPromise","SolidNode","AwaitOptions","promise","Promise","T","useAwaited","_promise","status","error","data","Await","props","fallback","children","result","resource","createResource","p","deferStream","_$createComponent","Show","when","Suspense","AwaitInner"],"sources":["../../src/awaited.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nimport { TSR_DEFERRED_PROMISE, defer } from '@tanstack/router-core'\nimport type { DeferredPromise } from '@tanstack/router-core'\nimport type { SolidNode } from './route'\n\nexport type AwaitOptions<T> = {\n promise: Promise<T>\n}\n\nexport function useAwaited<T>({\n promise: _promise,\n}: AwaitOptions<T>): [T, DeferredPromise<T>] {\n const promise = defer(_promise)\n\n if (promise[TSR_DEFERRED_PROMISE].status === 'pending') {\n throw promise\n }\n\n if (promise[TSR_DEFERRED_PROMISE].status === 'error') {\n throw promise[TSR_DEFERRED_PROMISE].error\n }\n\n return [promise[TSR_DEFERRED_PROMISE].data, promise]\n}\n\nexport function Await<T>(\n props: AwaitOptions<T> & {\n fallback?: SolidNode\n children: (result: T) => SolidNode\n },\n) {\n if (!('fallback' in props)) {\n const [resource] = Solid.createResource(\n () => defer(props.promise),\n (p) => p,\n {\n deferStream: true,\n },\n )\n\n return (\n <Solid.Show when={resource()}>\n {(data) => props.children(data())}\n </Solid.Show>\n )\n }\n\n return (\n <Solid.Suspense fallback={props.fallback}>\n <AwaitInner {...props} />\n </Solid.Suspense>\n )\n}\n\nfunction AwaitInner<T>(\n props: AwaitOptions<T> & {\n fallback?: SolidNode\n children: (result: T) => SolidNode\n },\n) {\n const [resource] = Solid.createResource(\n () => defer(props.promise),\n (p) => p,\n )\n\n return props.children(resource() as T)\n}\n"],"mappings":";;;;AAUA,SAAgBS,WAAc,EAC5BH,SAASI,YACkC;CAC3C,MAAMJ,UAAUJ,MAAMQ,SAAS;AAE/B,KAAIJ,QAAQL,sBAAsBU,WAAW,UAC3C,OAAML;AAGR,KAAIA,QAAQL,sBAAsBU,WAAW,QAC3C,OAAML,QAAQL,sBAAsBW;AAGtC,QAAO,CAACN,QAAQL,sBAAsBY,MAAMP,QAAQ;;AAGtD,SAAgBQ,MACdC,OAIA;AACA,KAAI,EAAE,cAAcA,QAAQ;EAC1B,MAAM,CAACI,YAAYnB,MAAMoB,qBACjBlB,MAAMa,MAAMT,QAAQ,GACzBe,MAAMA,GACP,EACEC,aAAa,MAEjB,CAAC;AAED,SAAAC,gBACGvB,MAAMwB,MAAI;GAAA,IAACC,OAAI;AAAA,WAAEN,UAAU;;GAAAF,WACxBJ,SAASE,MAAME,SAASJ,MAAM,CAAA;GAAC,CAAA;;AAKvC,QAAAU,gBACGvB,MAAM0B,UAAQ;EAAA,IAACV,WAAQ;AAAA,UAAED,MAAMC;;EAAQ,IAAAC,WAAA;AAAA,UAAAM,gBACrCI,YAAeZ,MAAK;;EAAA,CAAA;;AAK3B,SAASY,WACPZ,OAIA;CACA,MAAM,CAACI,YAAYnB,MAAMoB,qBACjBlB,MAAMa,MAAMT,QAAQ,GACzBe,MAAMA,EACR;AAED,QAAON,MAAME,SAASE,UAAU,CAAM"}
|
package/dist/esm/useMatch.js
CHANGED
|
@@ -19,7 +19,11 @@ function useMatch(opts) {
|
|
|
19
19
|
});
|
|
20
20
|
return Solid.createMemo((prev) => {
|
|
21
21
|
const selectedMatch = match();
|
|
22
|
-
if (selectedMatch === void 0)
|
|
22
|
+
if (selectedMatch === void 0) {
|
|
23
|
+
const hasPendingMatch = opts.from ? Boolean(router.stores.pendingRouteIds.get()[opts.from]) : nearestMatch?.hasPending() ?? false;
|
|
24
|
+
if (prev !== void 0 && (hasPendingMatch || router.stores.isTransitioning.get())) return prev;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
23
27
|
const res = opts.select ? opts.select(selectedMatch) : selectedMatch;
|
|
24
28
|
if (prev === void 0) return res;
|
|
25
29
|
return replaceEqualDeep(prev, res);
|
package/dist/esm/useMatch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMatch.js","names":["Solid","invariant","replaceEqualDeep","nearestMatchContext","useRouter","AnyRouter","MakeRouteMatch","MakeRouteMatchUnion","RegisteredRouter","StrictOrFrom","ThrowConstraint","ThrowOrOptional","UseMatchBaseOptions","select","match","TRouter","TFrom","TStrict","TSelected","shouldThrow","TThrow","UseMatchRoute","opts","Accessor","UseMatchResult","UseMatchOptions","useMatch","router","nearestMatch","from","undefined","useContext","stores","getRouteMatchStore","get","createEffect","hasPendingMatch","Boolean","pendingRouteIds","hasPending","isTransitioning","process","env","NODE_ENV","Error","createMemo","prev","selectedMatch","res"],"sources":["../../src/useMatch.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { invariant, replaceEqualDeep } from '@tanstack/router-core'\nimport { nearestMatchContext } from './matchContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n MakeRouteMatch,\n MakeRouteMatchUnion,\n RegisteredRouter,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n} from '@tanstack/router-core'\n\nexport interface UseMatchBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (\n match: MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>,\n ) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseMatchRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchBaseOptions<TRouter, TFrom, true, true, TSelected>,\n) => Solid.Accessor<UseMatchResult<TRouter, TFrom, true, TSelected>>\n\nexport type UseMatchOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseMatchBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseMatchResult<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TSelected,\n> = unknown extends TSelected\n ? TStrict extends true\n ? MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>\n : MakeRouteMatchUnion<TRouter>\n : TSelected\n\nexport function useMatch<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseMatchOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Solid.Accessor<\n ThrowOrOptional<UseMatchResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n const router = useRouter<TRouter>()\n const nearestMatch = opts.from\n ? undefined\n : Solid.useContext(nearestMatchContext)\n\n const match = () => {\n if (opts.from) {\n return router.stores.getRouteMatchStore(opts.from).get()\n }\n\n return nearestMatch?.match()\n }\n\n Solid.createEffect(() => {\n if (match() !== undefined) {\n return\n }\n\n const hasPendingMatch = opts.from\n ? Boolean(router.stores.pendingRouteIds.get()[opts.from!])\n : (nearestMatch?.hasPending() ?? false)\n\n if (\n !hasPendingMatch &&\n !router.stores.isTransitioning.get() &&\n (opts.shouldThrow ?? true)\n ) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Invariant failed: Could not find ${opts.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'}`,\n )\n }\n\n invariant()\n }\n })\n\n return Solid.createMemo((prev: TSelected | undefined) => {\n const selectedMatch = match()\n\n if (selectedMatch === undefined) return undefined\n const res = opts.select ? opts.select(selectedMatch as any) : selectedMatch\n if (prev === undefined) return res as TSelected\n return replaceEqualDeep(prev, res) as TSelected\n }) as any\n}\n"],"mappings":";;;;;AAsDA,SAAgB0B,SAOdJ,MASA;CACA,MAAMK,SAASvB,WAAoB;CACnC,MAAMwB,eAAeN,KAAKO,OACtBC,KAAAA,IACA9B,MAAM+B,WAAW5B,oBAAoB;CAEzC,MAAMW,cAAc;AAClB,MAAIQ,KAAKO,KACP,QAAOF,OAAOK,OAAOC,mBAAmBX,KAAKO,KAAK,CAACK,KAAK;AAG1D,SAAON,cAAcd,OAAO;;AAG9Bd,OAAMmC,mBAAmB;AACvB,MAAIrB,OAAO,KAAKgB,KAAAA,EACd;AAOF,MACE,EALsBR,KAAKO,OACzBQ,QAAQV,OAAOK,OAAOM,gBAAgBJ,KAAK,CAACZ,KAAKO,MAAO,GACvDD,cAAcW,YAAY,IAAI,UAIjC,CAACZ,OAAOK,OAAOQ,gBAAgBN,KAAK,KACnCZ,KAAKH,eAAe,OACrB;AACA,OAAA,QAAA,IAAA,aAA6B,aAC3B,OAAM,IAAIyB,MACR,oCAAoCtB,KAAKO,OAAO,yBAAyBP,KAAKO,KAAI,KAAM,qBACzF;AAGH5B,cAAW;;GAEb;AAEF,QAAOD,MAAM6C,YAAYC,SAAgC;EACvD,MAAMC,gBAAgBjC,OAAO;AAE7B,MAAIiC,kBAAkBjB,KAAAA,
|
|
1
|
+
{"version":3,"file":"useMatch.js","names":["Solid","invariant","replaceEqualDeep","nearestMatchContext","useRouter","AnyRouter","MakeRouteMatch","MakeRouteMatchUnion","RegisteredRouter","StrictOrFrom","ThrowConstraint","ThrowOrOptional","UseMatchBaseOptions","select","match","TRouter","TFrom","TStrict","TSelected","shouldThrow","TThrow","UseMatchRoute","opts","Accessor","UseMatchResult","UseMatchOptions","useMatch","router","nearestMatch","from","undefined","useContext","stores","getRouteMatchStore","get","createEffect","hasPendingMatch","Boolean","pendingRouteIds","hasPending","isTransitioning","process","env","NODE_ENV","Error","createMemo","prev","selectedMatch","res"],"sources":["../../src/useMatch.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { invariant, replaceEqualDeep } from '@tanstack/router-core'\nimport { nearestMatchContext } from './matchContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n MakeRouteMatch,\n MakeRouteMatchUnion,\n RegisteredRouter,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n} from '@tanstack/router-core'\n\nexport interface UseMatchBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (\n match: MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>,\n ) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseMatchRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchBaseOptions<TRouter, TFrom, true, true, TSelected>,\n) => Solid.Accessor<UseMatchResult<TRouter, TFrom, true, TSelected>>\n\nexport type UseMatchOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseMatchBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseMatchResult<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TSelected,\n> = unknown extends TSelected\n ? TStrict extends true\n ? MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>\n : MakeRouteMatchUnion<TRouter>\n : TSelected\n\nexport function useMatch<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseMatchOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Solid.Accessor<\n ThrowOrOptional<UseMatchResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n const router = useRouter<TRouter>()\n const nearestMatch = opts.from\n ? undefined\n : Solid.useContext(nearestMatchContext)\n\n const match = () => {\n if (opts.from) {\n return router.stores.getRouteMatchStore(opts.from).get()\n }\n\n return nearestMatch?.match()\n }\n\n Solid.createEffect(() => {\n if (match() !== undefined) {\n return\n }\n\n const hasPendingMatch = opts.from\n ? Boolean(router.stores.pendingRouteIds.get()[opts.from!])\n : (nearestMatch?.hasPending() ?? false)\n\n if (\n !hasPendingMatch &&\n !router.stores.isTransitioning.get() &&\n (opts.shouldThrow ?? true)\n ) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Invariant failed: Could not find ${opts.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'}`,\n )\n }\n\n invariant()\n }\n })\n\n return Solid.createMemo((prev: TSelected | undefined) => {\n const selectedMatch = match()\n\n if (selectedMatch === undefined) {\n const hasPendingMatch = opts.from\n ? Boolean(router.stores.pendingRouteIds.get()[opts.from!])\n : (nearestMatch?.hasPending() ?? false)\n\n if (\n prev !== undefined &&\n (hasPendingMatch || router.stores.isTransitioning.get())\n ) {\n return prev\n }\n\n return undefined\n }\n\n const res = opts.select ? opts.select(selectedMatch as any) : selectedMatch\n if (prev === undefined) return res as TSelected\n return replaceEqualDeep(prev, res) as TSelected\n }) as any\n}\n"],"mappings":";;;;;AAsDA,SAAgB0B,SAOdJ,MASA;CACA,MAAMK,SAASvB,WAAoB;CACnC,MAAMwB,eAAeN,KAAKO,OACtBC,KAAAA,IACA9B,MAAM+B,WAAW5B,oBAAoB;CAEzC,MAAMW,cAAc;AAClB,MAAIQ,KAAKO,KACP,QAAOF,OAAOK,OAAOC,mBAAmBX,KAAKO,KAAK,CAACK,KAAK;AAG1D,SAAON,cAAcd,OAAO;;AAG9Bd,OAAMmC,mBAAmB;AACvB,MAAIrB,OAAO,KAAKgB,KAAAA,EACd;AAOF,MACE,EALsBR,KAAKO,OACzBQ,QAAQV,OAAOK,OAAOM,gBAAgBJ,KAAK,CAACZ,KAAKO,MAAO,GACvDD,cAAcW,YAAY,IAAI,UAIjC,CAACZ,OAAOK,OAAOQ,gBAAgBN,KAAK,KACnCZ,KAAKH,eAAe,OACrB;AACA,OAAA,QAAA,IAAA,aAA6B,aAC3B,OAAM,IAAIyB,MACR,oCAAoCtB,KAAKO,OAAO,yBAAyBP,KAAKO,KAAI,KAAM,qBACzF;AAGH5B,cAAW;;GAEb;AAEF,QAAOD,MAAM6C,YAAYC,SAAgC;EACvD,MAAMC,gBAAgBjC,OAAO;AAE7B,MAAIiC,kBAAkBjB,KAAAA,GAAW;GAC/B,MAAMM,kBAAkBd,KAAKO,OACzBQ,QAAQV,OAAOK,OAAOM,gBAAgBJ,KAAK,CAACZ,KAAKO,MAAO,GACvDD,cAAcW,YAAY,IAAI;AAEnC,OACEO,SAAShB,KAAAA,MACRM,mBAAmBT,OAAOK,OAAOQ,gBAAgBN,KAAK,EAEvD,QAAOY;AAGT;;EAGF,MAAME,MAAM1B,KAAKT,SAASS,KAAKT,OAAOkC,cAAqB,GAAGA;AAC9D,MAAID,SAAShB,KAAAA,EAAW,QAAOkB;AAC/B,SAAO9C,iBAAiB4C,MAAME,IAAI;GAClC"}
|
package/dist/source/Match.jsx
CHANGED
|
@@ -59,6 +59,9 @@ export const Match = (props) => {
|
|
|
59
59
|
: route().options.notFoundComponent;
|
|
60
60
|
const resolvedNoSsr = currentMatchState().ssr === false ||
|
|
61
61
|
currentMatchState().ssr === 'data-only';
|
|
62
|
+
const shouldSkipSuspenseFallback = (isServer ?? router.isServer)
|
|
63
|
+
? resolvedNoSsr
|
|
64
|
+
: currentMatchState().ssr === 'data-only';
|
|
62
65
|
const ResolvedSuspenseBoundary = () => Solid.Suspense;
|
|
63
66
|
const ResolvedCatchBoundary = () => routeErrorComponent() ? CatchBoundary : SafeFragment;
|
|
64
67
|
const ResolvedNotFoundBoundary = () => routeNotFoundComponent() ? CatchNotFound : SafeFragment;
|
|
@@ -69,8 +72,9 @@ export const Match = (props) => {
|
|
|
69
72
|
return (<ShellComponent>
|
|
70
73
|
<nearestMatchContext.Provider value={nearestMatch}>
|
|
71
74
|
<Dynamic component={ResolvedSuspenseBoundary()} fallback={
|
|
72
|
-
//
|
|
73
|
-
|
|
75
|
+
// Data-only SSR renders the inner fallback on the server, so
|
|
76
|
+
// avoid adding an extra suspense fallback on the client.
|
|
77
|
+
shouldSkipSuspenseFallback ? undefined : (<Dynamic component={resolvePendingComponent()}/>)}>
|
|
74
78
|
<Dynamic component={ResolvedCatchBoundary()} getResetKey={() => router.stores.loadedAt.get()} errorComponent={routeErrorComponent() || ErrorComponent} onCatch={(error) => {
|
|
75
79
|
// Forward not found errors (we don't want to show the error component for these)
|
|
76
80
|
const notFoundError = getNotFound(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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,CAAC,kBAAkB,EAAE,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,SAAiB,EAAE,EAAE;YACrB,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,YAAY,EAAG,CAAC,EAAG,CAAC,CAE9C;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,YAAY,EAAG,CAAC,EAClC;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/awaited.jsx
CHANGED
|
@@ -11,13 +11,20 @@ export function useAwaited({ promise: _promise, }) {
|
|
|
11
11
|
return [promise[TSR_DEFERRED_PROMISE].data, promise];
|
|
12
12
|
}
|
|
13
13
|
export function Await(props) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
if (!('fallback' in props)) {
|
|
15
|
+
const [resource] = Solid.createResource(() => defer(props.promise), (p) => p, {
|
|
16
|
+
deferStream: true,
|
|
17
|
+
});
|
|
18
|
+
return (<Solid.Show when={resource()}>
|
|
19
|
+
{(data) => props.children(data())}
|
|
20
|
+
</Solid.Show>);
|
|
21
|
+
}
|
|
22
|
+
return (<Solid.Suspense fallback={props.fallback}>
|
|
23
|
+
<AwaitInner {...props}/>
|
|
24
|
+
</Solid.Suspense>);
|
|
25
|
+
}
|
|
26
|
+
function AwaitInner(props) {
|
|
27
|
+
const [resource] = Solid.createResource(() => defer(props.promise), (p) => p);
|
|
28
|
+
return props.children(resource());
|
|
22
29
|
}
|
|
23
30
|
//# sourceMappingURL=awaited.jsx.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"awaited.jsx","sourceRoot":"","sources":["../../src/awaited.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAQnE,MAAM,UAAU,UAAU,CAAI,EAC5B,OAAO,EAAE,QAAQ,GACD;IAChB,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAA;IAE/B,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACvD,MAAM,OAAO,CAAA;IACf,CAAC;IAED,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QACrD,MAAM,OAAO,CAAC,oBAAoB,CAAC,CAAC,KAAK,CAAA;IAC3C,CAAC;IAED,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;AACtD,CAAC;AAED,MAAM,UAAU,KAAK,CACnB,KAGC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,cAAc,CACrC,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"awaited.jsx","sourceRoot":"","sources":["../../src/awaited.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MA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A,EAAE,KAAK,CAAC,QAAQ,CAAC,CAClB,CAAA;AACH,CAAC;AAED,SAAS,UAAU,CACjB,KAGC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,cAAc,CACrC,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAC1B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CACT,CAAA;IAED,OAAO,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAO,CAAC,CAAA;AACxC,CAAC"}
|
package/dist/source/useMatch.jsx
CHANGED
|
@@ -31,8 +31,16 @@ export function useMatch(opts) {
|
|
|
31
31
|
});
|
|
32
32
|
return Solid.createMemo((prev) => {
|
|
33
33
|
const selectedMatch = match();
|
|
34
|
-
if (selectedMatch === undefined)
|
|
34
|
+
if (selectedMatch === undefined) {
|
|
35
|
+
const hasPendingMatch = opts.from
|
|
36
|
+
? Boolean(router.stores.pendingRouteIds.get()[opts.from])
|
|
37
|
+
: (nearestMatch?.hasPending() ?? false);
|
|
38
|
+
if (prev !== undefined &&
|
|
39
|
+
(hasPendingMatch || router.stores.isTransitioning.get())) {
|
|
40
|
+
return prev;
|
|
41
|
+
}
|
|
35
42
|
return undefined;
|
|
43
|
+
}
|
|
36
44
|
const res = opts.select ? opts.select(selectedMatch) : selectedMatch;
|
|
37
45
|
if (prev === undefined)
|
|
38
46
|
return res;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMatch.jsx","sourceRoot":"","sources":["../../src/useMatch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAmDvC,MAAM,UAAU,QAAQ,CAOtB,IAMC;IAID,MAAM,MA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
package/package.json
CHANGED
package/src/Match.tsx
CHANGED
|
@@ -86,6 +86,11 @@ export const Match = (props: { matchId: string }) => {
|
|
|
86
86
|
currentMatchState().ssr === false ||
|
|
87
87
|
currentMatchState().ssr === 'data-only'
|
|
88
88
|
|
|
89
|
+
const shouldSkipSuspenseFallback =
|
|
90
|
+
(isServer ?? router.isServer)
|
|
91
|
+
? resolvedNoSsr
|
|
92
|
+
: currentMatchState().ssr === 'data-only'
|
|
93
|
+
|
|
89
94
|
const ResolvedSuspenseBoundary = () => Solid.Suspense
|
|
90
95
|
|
|
91
96
|
const ResolvedCatchBoundary = () =>
|
|
@@ -105,8 +110,9 @@ export const Match = (props: { matchId: string }) => {
|
|
|
105
110
|
<Dynamic
|
|
106
111
|
component={ResolvedSuspenseBoundary()}
|
|
107
112
|
fallback={
|
|
108
|
-
//
|
|
109
|
-
|
|
113
|
+
// Data-only SSR renders the inner fallback on the server, so
|
|
114
|
+
// avoid adding an extra suspense fallback on the client.
|
|
115
|
+
shouldSkipSuspenseFallback ? undefined : (
|
|
110
116
|
<Dynamic component={resolvePendingComponent()} />
|
|
111
117
|
)
|
|
112
118
|
}
|
package/src/awaited.tsx
CHANGED
|
@@ -29,19 +29,40 @@ export function Await<T>(
|
|
|
29
29
|
fallback?: SolidNode
|
|
30
30
|
children: (result: T) => SolidNode
|
|
31
31
|
},
|
|
32
|
+
) {
|
|
33
|
+
if (!('fallback' in props)) {
|
|
34
|
+
const [resource] = Solid.createResource(
|
|
35
|
+
() => defer(props.promise),
|
|
36
|
+
(p) => p,
|
|
37
|
+
{
|
|
38
|
+
deferStream: true,
|
|
39
|
+
},
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Solid.Show when={resource()}>
|
|
44
|
+
{(data) => props.children(data())}
|
|
45
|
+
</Solid.Show>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Solid.Suspense fallback={props.fallback}>
|
|
51
|
+
<AwaitInner {...props} />
|
|
52
|
+
</Solid.Suspense>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function AwaitInner<T>(
|
|
57
|
+
props: AwaitOptions<T> & {
|
|
58
|
+
fallback?: SolidNode
|
|
59
|
+
children: (result: T) => SolidNode
|
|
60
|
+
},
|
|
32
61
|
) {
|
|
33
62
|
const [resource] = Solid.createResource(
|
|
34
63
|
() => defer(props.promise),
|
|
35
|
-
// Simple passthrough - just return the promise for Solid to await
|
|
36
64
|
(p) => p,
|
|
37
|
-
{
|
|
38
|
-
deferStream: true,
|
|
39
|
-
},
|
|
40
65
|
)
|
|
41
66
|
|
|
42
|
-
return (
|
|
43
|
-
<Solid.Show fallback={props.fallback} when={resource()}>
|
|
44
|
-
{(data) => props.children(data())}
|
|
45
|
-
</Solid.Show>
|
|
46
|
-
)
|
|
67
|
+
return props.children(resource() as T)
|
|
47
68
|
}
|
package/src/useMatch.tsx
CHANGED
|
@@ -109,7 +109,21 @@ export function useMatch<
|
|
|
109
109
|
return Solid.createMemo((prev: TSelected | undefined) => {
|
|
110
110
|
const selectedMatch = match()
|
|
111
111
|
|
|
112
|
-
if (selectedMatch === undefined)
|
|
112
|
+
if (selectedMatch === undefined) {
|
|
113
|
+
const hasPendingMatch = opts.from
|
|
114
|
+
? Boolean(router.stores.pendingRouteIds.get()[opts.from!])
|
|
115
|
+
: (nearestMatch?.hasPending() ?? false)
|
|
116
|
+
|
|
117
|
+
if (
|
|
118
|
+
prev !== undefined &&
|
|
119
|
+
(hasPendingMatch || router.stores.isTransitioning.get())
|
|
120
|
+
) {
|
|
121
|
+
return prev
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return undefined
|
|
125
|
+
}
|
|
126
|
+
|
|
113
127
|
const res = opts.select ? opts.select(selectedMatch as any) : selectedMatch
|
|
114
128
|
if (prev === undefined) return res as TSelected
|
|
115
129
|
return replaceEqualDeep(prev, res) as TSelected
|