@bleedingdev/modern-js-renderer-solid 0.0.0-stage → 3.9.3-ultramodern.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/actions.js +282 -0
- package/dist/esm/application-router.js +30 -0
- package/dist/esm/client.js +49 -0
- package/dist/esm/entry-application.js +60 -0
- package/dist/esm/entry-client.js +24 -0
- package/dist/esm/federation-context.js +25 -0
- package/dist/esm/federation-ssr.js +92 -0
- package/dist/esm/federation.js +87 -0
- package/dist/esm/i18n/I18nProvider.js +33 -0
- package/dist/esm/i18n/LocalizedLink.js +52 -0
- package/dist/esm/i18n/context.js +3 -0
- package/dist/esm/i18n/index.js +8 -0
- package/dist/esm/i18n/languageSync.js +50 -0
- package/dist/esm/i18n/types.js +0 -0
- package/dist/esm/i18n/useI18n.js +74 -0
- package/dist/esm/index.js +58 -0
- package/dist/esm/manifest.js +150 -0
- package/dist/esm/route-completion.js +151 -0
- package/dist/esm/route-data-error.js +108 -0
- package/dist/esm/router-binding/Asset.js +202 -0
- package/dist/esm/router-binding/CatchBoundary.js +94 -0
- package/dist/esm/router-binding/ClientOnly.js +26 -0
- package/dist/esm/router-binding/HeadContent.js +8 -0
- package/dist/esm/router-binding/LICENSE +21 -0
- package/dist/esm/router-binding/Match.js +319 -0
- package/dist/esm/router-binding/Matches.js +124 -0
- package/dist/esm/router-binding/PROVENANCE.json +94 -0
- package/dist/esm/router-binding/RouterProvider.js +52 -0
- package/dist/esm/router-binding/SafeFragment.js +5 -0
- package/dist/esm/router-binding/ScriptOnce.js +15 -0
- package/dist/esm/router-binding/Scripts.js +30 -0
- package/dist/esm/router-binding/ScrollRestoration.js +16 -0
- package/dist/esm/router-binding/Transitioner.js +109 -0
- package/dist/esm/router-binding/awaited.js +48 -0
- package/dist/esm/router-binding/fileRoute.js +83 -0
- package/dist/esm/router-binding/flightData.js +23 -0
- package/dist/esm/router-binding/headContentUtils.js +168 -0
- package/dist/esm/router-binding/history.js +0 -0
- package/dist/esm/router-binding/index.js +35 -0
- package/dist/esm/router-binding/lazyRouteComponent.js +30 -0
- package/dist/esm/router-binding/link.js +387 -0
- package/dist/esm/router-binding/matchContext.js +7 -0
- package/dist/esm/router-binding/nonRouteComponentContext.js +13 -0
- package/dist/esm/router-binding/not-found.js +35 -0
- package/dist/esm/router-binding/publicMatchData.js +447 -0
- package/dist/esm/router-binding/registryTransfer.js +223 -0
- package/dist/esm/router-binding/renderRouteNotFound.js +23 -0
- package/dist/esm/router-binding/route.js +143 -0
- package/dist/esm/router-binding/router.js +14 -0
- package/dist/esm/router-binding/routerContext.js +3 -0
- package/dist/esm/router-binding/routerOptions.js +0 -0
- package/dist/esm/router-binding/routerStores.js +50 -0
- package/dist/esm/router-binding/scroll-restoration.js +13 -0
- package/dist/esm/router-binding/typePrimitives.js +0 -0
- package/dist/esm/router-binding/useBlocker.js +152 -0
- package/dist/esm/router-binding/useCanGoBack.js +7 -0
- package/dist/esm/router-binding/useLoaderData.js +8 -0
- package/dist/esm/router-binding/useLoaderDeps.js +8 -0
- package/dist/esm/router-binding/useLocation.js +14 -0
- package/dist/esm/router-binding/useMatch.js +28 -0
- package/dist/esm/router-binding/useNavigate.js +25 -0
- package/dist/esm/router-binding/useParams.js +11 -0
- package/dist/esm/router-binding/useRouteContext.js +8 -0
- package/dist/esm/router-binding/useRouter.js +10 -0
- package/dist/esm/router-binding/useRouterState.js +19 -0
- package/dist/esm/router-binding/useSearch.js +11 -0
- package/dist/esm/router-binding/utils.js +23 -0
- package/dist/esm/router.js +187 -0
- package/dist/esm-node/actions.js +263 -0
- package/dist/esm-node/application-router.js +30 -0
- package/dist/esm-node/client.js +49 -0
- package/dist/esm-node/entry-application.js +110 -0
- package/dist/esm-node/entry-client.js +24 -0
- package/dist/esm-node/entry-server.js +47 -0
- package/dist/esm-node/federation-context.js +25 -0
- package/dist/esm-node/federation-ssr.js +92 -0
- package/dist/esm-node/federation.js +87 -0
- package/dist/esm-node/i18n/I18nProvider.js +42 -0
- package/dist/esm-node/i18n/LocalizedLink.js +88 -0
- package/dist/esm-node/i18n/context.js +3 -0
- package/dist/esm-node/i18n/index.js +8 -0
- package/dist/esm-node/i18n/languageSync.js +50 -0
- package/dist/esm-node/i18n/types.js +1 -0
- package/dist/esm-node/i18n/useI18n.js +74 -0
- package/dist/esm-node/index.js +58 -0
- package/dist/esm-node/manifest.js +150 -0
- package/dist/esm-node/native-promise-serialization.js +113 -0
- package/dist/esm-node/plugin/compiler.js +209 -0
- package/dist/esm-node/plugin/create.js +236 -0
- package/dist/esm-node/plugin/index.js +70 -0
- package/dist/esm-node/plugin/profile.js +51 -0
- package/dist/esm-node/route-completion.js +161 -0
- package/dist/esm-node/route-data-error.js +108 -0
- package/dist/esm-node/router-binding/Asset.js +172 -0
- package/dist/esm-node/router-binding/CatchBoundary.js +136 -0
- package/dist/esm-node/router-binding/ClientOnly.js +46 -0
- package/dist/esm-node/router-binding/HeadContent.js +8 -0
- package/dist/esm-node/router-binding/LICENSE +21 -0
- package/dist/esm-node/router-binding/Match.js +660 -0
- package/dist/esm-node/router-binding/Matches.js +161 -0
- package/dist/esm-node/router-binding/PROVENANCE.json +94 -0
- package/dist/esm-node/router-binding/RouterProvider.js +88 -0
- package/dist/esm-node/router-binding/SafeFragment.js +5 -0
- package/dist/esm-node/router-binding/ScriptOnce.js +16 -0
- package/dist/esm-node/router-binding/Scripts.js +49 -0
- package/dist/esm-node/router-binding/ScrollRestoration.js +16 -0
- package/dist/esm-node/router-binding/Transitioner.js +109 -0
- package/dist/esm-node/router-binding/awaited.js +75 -0
- package/dist/esm-node/router-binding/fileRoute.js +83 -0
- package/dist/esm-node/router-binding/flightData.js +23 -0
- package/dist/esm-node/router-binding/headContentUtils.js +168 -0
- package/dist/esm-node/router-binding/history.js +1 -0
- package/dist/esm-node/router-binding/index.js +35 -0
- package/dist/esm-node/router-binding/lazyRouteComponent.js +30 -0
- package/dist/esm-node/router-binding/link.js +399 -0
- package/dist/esm-node/router-binding/matchContext.js +7 -0
- package/dist/esm-node/router-binding/nonRouteComponentContext.js +22 -0
- package/dist/esm-node/router-binding/not-found.js +49 -0
- package/dist/esm-node/router-binding/publicMatchData.js +447 -0
- package/dist/esm-node/router-binding/registryTransfer.js +223 -0
- package/dist/esm-node/router-binding/renderRouteNotFound.js +22 -0
- package/dist/esm-node/router-binding/route.js +162 -0
- package/dist/esm-node/router-binding/router.js +14 -0
- package/dist/esm-node/router-binding/routerContext.js +3 -0
- package/dist/esm-node/router-binding/routerOptions.js +1 -0
- package/dist/esm-node/router-binding/routerStores.js +50 -0
- package/dist/esm-node/router-binding/scroll-restoration.js +12 -0
- package/dist/esm-node/router-binding/typePrimitives.js +1 -0
- package/dist/esm-node/router-binding/useBlocker.js +152 -0
- package/dist/esm-node/router-binding/useCanGoBack.js +7 -0
- package/dist/esm-node/router-binding/useLoaderData.js +8 -0
- package/dist/esm-node/router-binding/useLoaderDeps.js +8 -0
- package/dist/esm-node/router-binding/useLocation.js +14 -0
- package/dist/esm-node/router-binding/useMatch.js +28 -0
- package/dist/esm-node/router-binding/useNavigate.js +25 -0
- package/dist/esm-node/router-binding/useParams.js +11 -0
- package/dist/esm-node/router-binding/useRouteContext.js +8 -0
- package/dist/esm-node/router-binding/useRouter.js +10 -0
- package/dist/esm-node/router-binding/useRouterState.js +19 -0
- package/dist/esm-node/router-binding/useSearch.js +11 -0
- package/dist/esm-node/router-binding/utils.js +23 -0
- package/dist/esm-node/router.js +187 -0
- package/dist/esm-node/server.js +396 -0
- package/dist/types/actions.d.ts +45 -0
- package/dist/types/application-router.d.ts +5 -0
- package/dist/types/client.d.ts +23 -0
- package/dist/types/entry-application.d.ts +10 -0
- package/dist/types/entry-client.d.ts +5 -0
- package/dist/types/entry-server.d.ts +5 -0
- package/dist/types/federation-context.d.ts +16 -0
- package/dist/types/federation-ssr.d.ts +19 -0
- package/dist/types/federation.d.ts +30 -0
- package/dist/types/i18n/I18nProvider.d.ts +21 -0
- package/dist/types/i18n/LocalizedLink.d.ts +15 -0
- package/dist/types/i18n/context.d.ts +11 -0
- package/dist/types/i18n/index.d.ts +9 -0
- package/dist/types/i18n/languageSync.d.ts +31 -0
- package/dist/types/i18n/types.d.ts +33 -0
- package/dist/types/i18n/useI18n.d.ts +24 -0
- package/dist/types/index.d.ts +41 -0
- package/dist/types/manifest.d.ts +55 -0
- package/dist/types/native-promise-serialization.d.ts +9 -0
- package/dist/types/plugin/compiler.d.ts +6 -0
- package/dist/types/plugin/create.d.ts +21 -0
- package/dist/types/plugin/index.d.ts +3 -0
- package/dist/types/plugin/lazy-modules.d.cts +15 -0
- package/dist/types/plugin/preserve-import-loader.d.cts +3 -0
- package/dist/types/plugin/profile.d.ts +2 -0
- package/dist/types/plugin/solid-loader.d.cts +2 -0
- package/dist/types/plugin/svg-component-template.d.cts +6 -0
- package/dist/types/route-completion.d.ts +21 -0
- package/dist/types/route-data-error.d.ts +17 -0
- package/dist/types/router-binding/Asset.d.ts +3 -0
- package/dist/types/router-binding/CatchBoundary.d.ts +13 -0
- package/dist/types/router-binding/ClientOnly.d.ts +31 -0
- package/dist/types/router-binding/HeadContent.d.ts +13 -0
- package/dist/types/router-binding/Match.d.ts +6 -0
- package/dist/types/router-binding/Matches.d.ts +26 -0
- package/dist/types/router-binding/RouterProvider.d.ts +11 -0
- package/dist/types/router-binding/SafeFragment.d.ts +2 -0
- package/dist/types/router-binding/ScriptOnce.d.ts +6 -0
- package/dist/types/router-binding/Scripts.d.ts +2 -0
- package/dist/types/router-binding/ScrollRestoration.d.ts +14 -0
- package/dist/types/router-binding/Transitioner.d.ts +2 -0
- package/dist/types/router-binding/awaited.d.ts +11 -0
- package/dist/types/router-binding/fileRoute.d.ts +54 -0
- package/dist/types/router-binding/flightData.d.ts +38 -0
- package/dist/types/router-binding/headContentUtils.d.ts +15 -0
- package/dist/types/router-binding/history.d.ts +8 -0
- package/dist/types/router-binding/index.d.ts +46 -0
- package/dist/types/router-binding/lazyRouteComponent.d.ts +2 -0
- package/dist/types/router-binding/link.d.ts +43 -0
- package/dist/types/router-binding/matchContext.d.ts +7 -0
- package/dist/types/router-binding/nonRouteComponentContext.d.ts +5 -0
- package/dist/types/router-binding/not-found.d.ts +11 -0
- package/dist/types/router-binding/publicMatchData.d.ts +19 -0
- package/dist/types/router-binding/registryTransfer.d.ts +49 -0
- package/dist/types/router-binding/renderRouteNotFound.d.ts +11 -0
- package/dist/types/router-binding/route.d.ts +105 -0
- package/dist/types/router-binding/router.d.ts +70 -0
- package/dist/types/router-binding/routerContext.d.ts +3 -0
- package/dist/types/router-binding/routerOptions.d.ts +6 -0
- package/dist/types/router-binding/routerStores.d.ts +2 -0
- package/dist/types/router-binding/scroll-restoration.d.ts +2 -0
- package/dist/types/router-binding/typePrimitives.d.ts +10 -0
- package/dist/types/router-binding/useBlocker.d.ts +70 -0
- package/dist/types/router-binding/useCanGoBack.d.ts +2 -0
- package/dist/types/router-binding/useLoaderData.d.ts +8 -0
- package/dist/types/router-binding/useLoaderDeps.d.ts +8 -0
- package/dist/types/router-binding/useLocation.d.ts +7 -0
- package/dist/types/router-binding/useMatch.d.ts +10 -0
- package/dist/types/router-binding/useNavigate.d.ts +5 -0
- package/dist/types/router-binding/useParams.d.ts +9 -0
- package/dist/types/router-binding/useRouteContext.d.ts +4 -0
- package/dist/types/router-binding/useRouter.d.ts +4 -0
- package/dist/types/router-binding/useRouterState.d.ts +8 -0
- package/dist/types/router-binding/useSearch.d.ts +9 -0
- package/dist/types/router-binding/utils.d.ts +25 -0
- package/dist/types/router.d.ts +31 -0
- package/dist/types/server.d.ts +47 -0
- package/package.json +130 -4
- package/src/actions.tsx +441 -0
- package/src/application-router.tsx +47 -0
- package/src/client.ts +106 -0
- package/src/entry-application.tsx +73 -0
- package/src/entry-client.tsx +49 -0
- package/src/entry-server.tsx +85 -0
- package/src/federation-context.ts +47 -0
- package/src/federation-ssr.ts +136 -0
- package/src/federation.tsx +197 -0
- package/src/i18n/I18nProvider.tsx +54 -0
- package/src/i18n/LocalizedLink.tsx +83 -0
- package/src/i18n/context.ts +13 -0
- package/src/i18n/index.ts +31 -0
- package/src/i18n/languageSync.ts +113 -0
- package/src/i18n/types.ts +35 -0
- package/src/i18n/useI18n.ts +121 -0
- package/src/index.ts +41 -0
- package/src/manifest.ts +337 -0
- package/src/native-promise-serialization.ts +167 -0
- package/src/plugin/compiler.ts +320 -0
- package/src/plugin/create.ts +271 -0
- package/src/plugin/index.ts +69 -0
- package/src/plugin/lazy-modules.cjs +146 -0
- package/src/plugin/preserve-import-loader.cjs +46 -0
- package/src/plugin/profile.ts +42 -0
- package/src/plugin/solid-loader.cjs +83 -0
- package/src/plugin/svg-component-template.cjs +19 -0
- package/src/route-completion.tsx +226 -0
- package/src/route-data-error.ts +175 -0
- package/src/router-binding/Asset.tsx +284 -0
- package/src/router-binding/CatchBoundary.tsx +130 -0
- package/src/router-binding/ClientOnly.tsx +76 -0
- package/src/router-binding/HeadContent.tsx +23 -0
- package/src/router-binding/LICENSE +21 -0
- package/src/router-binding/Match.tsx +397 -0
- package/src/router-binding/Matches.tsx +242 -0
- package/src/router-binding/PROVENANCE.json +94 -0
- package/src/router-binding/RouterProvider.tsx +128 -0
- package/src/router-binding/SafeFragment.tsx +5 -0
- package/src/router-binding/ScriptOnce.tsx +23 -0
- package/src/router-binding/Scripts.tsx +44 -0
- package/src/router-binding/ScrollRestoration.tsx +49 -0
- package/src/router-binding/Transitioner.tsx +177 -0
- package/src/router-binding/awaited.tsx +71 -0
- package/src/router-binding/fileRoute.ts +268 -0
- package/src/router-binding/flightData.ts +90 -0
- package/src/router-binding/headContentUtils.tsx +292 -0
- package/src/router-binding/history.ts +9 -0
- package/src/router-binding/index.tsx +315 -0
- package/src/router-binding/lazyRouteComponent.tsx +70 -0
- package/src/router-binding/link.tsx +865 -0
- package/src/router-binding/matchContext.tsx +15 -0
- package/src/router-binding/nonRouteComponentContext.tsx +23 -0
- package/src/router-binding/not-found.tsx +65 -0
- package/src/router-binding/publicMatchData.ts +674 -0
- package/src/router-binding/registryTransfer.ts +400 -0
- package/src/router-binding/renderRouteNotFound.tsx +53 -0
- package/src/router-binding/route.tsx +665 -0
- package/src/router-binding/router.ts +123 -0
- package/src/router-binding/routerContext.tsx +6 -0
- package/src/router-binding/routerOptions.ts +26 -0
- package/src/router-binding/routerStores.ts +85 -0
- package/src/router-binding/scroll-restoration.tsx +15 -0
- package/src/router-binding/typePrimitives.ts +74 -0
- package/src/router-binding/useBlocker.tsx +359 -0
- package/src/router-binding/useCanGoBack.ts +9 -0
- package/src/router-binding/useLoaderData.tsx +51 -0
- package/src/router-binding/useLoaderDeps.tsx +46 -0
- package/src/router-binding/useLocation.tsx +43 -0
- package/src/router-binding/useMatch.tsx +111 -0
- package/src/router-binding/useNavigate.tsx +45 -0
- package/src/router-binding/useParams.tsx +70 -0
- package/src/router-binding/useRouteContext.ts +30 -0
- package/src/router-binding/useRouter.tsx +17 -0
- package/src/router-binding/useRouterState.tsx +50 -0
- package/src/router-binding/useSearch.tsx +70 -0
- package/src/router-binding/utils.ts +59 -0
- package/src/router.ts +376 -0
- package/src/server.ts +645 -0
- package/README.md +0 -3
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { Dynamic, createComponent, memo, mergeProps } from "@solidjs/web";
|
|
2
|
+
import { rootRouteId } from "@tanstack/router-core";
|
|
3
|
+
import { isServer } from "@tanstack/router-core/isServer";
|
|
4
|
+
import { CatchBoundary, ErrorComponent } from "./CatchBoundary.js";
|
|
5
|
+
import { ClientOnly } from "./ClientOnly.js";
|
|
6
|
+
import { nearestMatchContext } from "./matchContext.js";
|
|
7
|
+
import { nonRouteComponentContext, renderInNonRouteComponentContext } from "./nonRouteComponentContext.js";
|
|
8
|
+
import { CatchNotFound, getNotFound } from "./not-found.js";
|
|
9
|
+
import { renderRouteNotFound } from "./renderRouteNotFound.js";
|
|
10
|
+
import { SafeFragment } from "./SafeFragment.js";
|
|
11
|
+
import { ScrollRestoration } from "./scroll-restoration.js";
|
|
12
|
+
import { useRouter } from "./useRouter.js";
|
|
13
|
+
import * as __rspack_external_solid_js_0ac0db99 from "solid-js";
|
|
14
|
+
const NearestMatchContext = nearestMatchContext;
|
|
15
|
+
const renderScrollRestoration = false === isServer ? void 0 : (router, route)=>(isServer ?? router.isServer) && route.parentRoute?.id === rootRouteId && router.options.scrollRestoration ? createComponent(ScrollRestoration, {}) : null;
|
|
16
|
+
const Match = (props)=>{
|
|
17
|
+
const router = useRouter();
|
|
18
|
+
const currentMatch = __rspack_external_solid_js_0ac0db99.createMemo(()=>router.stores.getMatchStore(props.routeId).get());
|
|
19
|
+
const matchState = __rspack_external_solid_js_0ac0db99.createMemo(()=>{
|
|
20
|
+
const match = currentMatch();
|
|
21
|
+
if (!match) return null;
|
|
22
|
+
return {
|
|
23
|
+
routeId: match.routeId,
|
|
24
|
+
ssr: match.ssr,
|
|
25
|
+
status: match.status
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
const nearestMatch = [
|
|
29
|
+
()=>props.routeId,
|
|
30
|
+
currentMatch
|
|
31
|
+
];
|
|
32
|
+
return createComponent(__rspack_external_solid_js_0ac0db99.Show, {
|
|
33
|
+
get when () {
|
|
34
|
+
return matchState();
|
|
35
|
+
},
|
|
36
|
+
children: (currentMatchState)=>{
|
|
37
|
+
const route = router.routesById[props.routeId];
|
|
38
|
+
const routeOptions = ()=>{
|
|
39
|
+
currentMatchState();
|
|
40
|
+
return route.options;
|
|
41
|
+
};
|
|
42
|
+
const resolvePendingComponent = __rspack_external_solid_js_0ac0db99.createMemo(()=>routeOptions().pendingComponent ?? router.options.defaultPendingComponent);
|
|
43
|
+
const routeErrorComponent = __rspack_external_solid_js_0ac0db99.createMemo(()=>routeOptions().errorComponent ?? router.options.defaultErrorComponent);
|
|
44
|
+
const routeNotFoundComponent = __rspack_external_solid_js_0ac0db99.createMemo(()=>route.isRoot ? routeOptions().notFoundComponent ?? router.options.notFoundRoute?.options.component ?? router.options.defaultNotFoundComponent : routeOptions().notFoundComponent ?? router.options.defaultNotFoundComponent);
|
|
45
|
+
const resolvedNoSsr = __rspack_external_solid_js_0ac0db99.createMemo(()=>false === currentMatchState().ssr || "data-only" === currentMatchState().ssr);
|
|
46
|
+
const ResolvedNotFoundBoundary = __rspack_external_solid_js_0ac0db99.createMemo(()=>routeNotFoundComponent() ? CatchNotFound : SafeFragment);
|
|
47
|
+
const ShellComponent = __rspack_external_solid_js_0ac0db99.createMemo(()=>route.isRoot ? route.options.shellComponent ?? SafeFragment : SafeFragment);
|
|
48
|
+
const MatchContent = ()=>createComponent(__rspack_external_solid_js_0ac0db99.Show, {
|
|
49
|
+
get when () {
|
|
50
|
+
return "pending" !== currentMatchState().status;
|
|
51
|
+
},
|
|
52
|
+
get fallback () {
|
|
53
|
+
if ("production" !== process.env.NODE_ENV) return renderInNonRouteComponentContext(()=>createComponent(Dynamic, {
|
|
54
|
+
get component () {
|
|
55
|
+
return resolvePendingComponent();
|
|
56
|
+
}
|
|
57
|
+
}), "pendingComponent");
|
|
58
|
+
return createComponent(Dynamic, {
|
|
59
|
+
get component () {
|
|
60
|
+
return resolvePendingComponent();
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
get children () {
|
|
65
|
+
return createComponent(MatchInner, {});
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
const RouteContent = ()=>createComponent(Dynamic, {
|
|
69
|
+
get component () {
|
|
70
|
+
return ResolvedNotFoundBoundary();
|
|
71
|
+
},
|
|
72
|
+
fallback: (error)=>{
|
|
73
|
+
const notFoundError = getNotFound(error) ?? error;
|
|
74
|
+
notFoundError.routeId ??= currentMatchState().routeId;
|
|
75
|
+
if (notFoundError.routeId !== currentMatchState().routeId) throw notFoundError;
|
|
76
|
+
return "production" !== process.env.NODE_ENV ? renderInNonRouteComponentContext(()=>createComponent(Dynamic, mergeProps({
|
|
77
|
+
get component () {
|
|
78
|
+
return routeNotFoundComponent();
|
|
79
|
+
}
|
|
80
|
+
}, notFoundError)), "notFoundComponent") : createComponent(Dynamic, mergeProps({
|
|
81
|
+
get component () {
|
|
82
|
+
return routeNotFoundComponent();
|
|
83
|
+
}
|
|
84
|
+
}, notFoundError));
|
|
85
|
+
},
|
|
86
|
+
get children () {
|
|
87
|
+
return createComponent(__rspack_external_solid_js_0ac0db99.Switch, {
|
|
88
|
+
get children () {
|
|
89
|
+
return [
|
|
90
|
+
createComponent(__rspack_external_solid_js_0ac0db99.Match, {
|
|
91
|
+
get when () {
|
|
92
|
+
return resolvedNoSsr();
|
|
93
|
+
},
|
|
94
|
+
get children () {
|
|
95
|
+
return createComponent(ClientOnly, {
|
|
96
|
+
get fallback () {
|
|
97
|
+
if ("production" !== process.env.NODE_ENV) return renderInNonRouteComponentContext(()=>createComponent(Dynamic, {
|
|
98
|
+
get component () {
|
|
99
|
+
return resolvePendingComponent();
|
|
100
|
+
}
|
|
101
|
+
}), "pendingComponent");
|
|
102
|
+
return createComponent(Dynamic, {
|
|
103
|
+
get component () {
|
|
104
|
+
return resolvePendingComponent();
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
},
|
|
108
|
+
get children () {
|
|
109
|
+
return createComponent(MatchContent, {});
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}),
|
|
114
|
+
createComponent(__rspack_external_solid_js_0ac0db99.Match, {
|
|
115
|
+
get when () {
|
|
116
|
+
return !resolvedNoSsr();
|
|
117
|
+
},
|
|
118
|
+
get children () {
|
|
119
|
+
return createComponent(MatchContent, {});
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
return createComponent(Dynamic, {
|
|
128
|
+
get component () {
|
|
129
|
+
return ShellComponent();
|
|
130
|
+
},
|
|
131
|
+
get children () {
|
|
132
|
+
return [
|
|
133
|
+
createComponent(NearestMatchContext, {
|
|
134
|
+
value: nearestMatch,
|
|
135
|
+
get children () {
|
|
136
|
+
return createComponent(__rspack_external_solid_js_0ac0db99.Show, {
|
|
137
|
+
get when () {
|
|
138
|
+
return routeErrorComponent();
|
|
139
|
+
},
|
|
140
|
+
get fallback () {
|
|
141
|
+
return createComponent(RouteContent, {});
|
|
142
|
+
},
|
|
143
|
+
children: (errorComponent)=>createComponent(CatchBoundary, {
|
|
144
|
+
getResetKey: ()=>{
|
|
145
|
+
const matches = router.stores.matches.get();
|
|
146
|
+
const index = matches.findIndex((match)=>match.routeId === props.routeId);
|
|
147
|
+
if (-1 === index) return "";
|
|
148
|
+
let key = "";
|
|
149
|
+
for(let i = index; i < matches.length; i++){
|
|
150
|
+
const match = matches[i];
|
|
151
|
+
key += `${match.status}|${match.updatedAt},`;
|
|
152
|
+
}
|
|
153
|
+
return key;
|
|
154
|
+
},
|
|
155
|
+
get errorComponent () {
|
|
156
|
+
return errorComponent();
|
|
157
|
+
},
|
|
158
|
+
onCatch: (error)=>{
|
|
159
|
+
const notFoundError = getNotFound(error);
|
|
160
|
+
if (notFoundError) {
|
|
161
|
+
notFoundError.routeId ??= currentMatchState().routeId;
|
|
162
|
+
throw notFoundError;
|
|
163
|
+
}
|
|
164
|
+
if ("production" !== process.env.NODE_ENV) console.warn(`Warning: Error in route match: ${currentMatchState().routeId}`);
|
|
165
|
+
(routeOptions().onCatch ?? router.options.defaultOnCatch)?.(error);
|
|
166
|
+
},
|
|
167
|
+
render: RouteContent
|
|
168
|
+
})
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}),
|
|
172
|
+
memo(()=>renderScrollRestoration?.(router, route))
|
|
173
|
+
];
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
const MatchInner = ()=>{
|
|
180
|
+
const router = useRouter();
|
|
181
|
+
const nearestMatch = __rspack_external_solid_js_0ac0db99.useContext(nearestMatchContext);
|
|
182
|
+
const match = nearestMatch[1];
|
|
183
|
+
const routeId = nearestMatch[0];
|
|
184
|
+
const matchState = __rspack_external_solid_js_0ac0db99.createMemo(()=>{
|
|
185
|
+
const currentMatch = match();
|
|
186
|
+
const currentRouteId = routeId();
|
|
187
|
+
if (!currentMatch || !currentRouteId) return null;
|
|
188
|
+
const route = router.routesById[currentRouteId];
|
|
189
|
+
const remount = route.options.remountDeps ?? router.options.defaultRemountDeps;
|
|
190
|
+
let componentKey;
|
|
191
|
+
if (remount) {
|
|
192
|
+
const deps = remount({
|
|
193
|
+
routeId: currentRouteId,
|
|
194
|
+
loaderDeps: currentMatch.loaderDeps,
|
|
195
|
+
params: currentMatch._strictParams,
|
|
196
|
+
search: currentMatch._strictSearch
|
|
197
|
+
});
|
|
198
|
+
componentKey = JSON.stringify(deps) ?? currentRouteId;
|
|
199
|
+
} else componentKey = currentRouteId;
|
|
200
|
+
return {
|
|
201
|
+
route,
|
|
202
|
+
routeId: currentRouteId,
|
|
203
|
+
match: {
|
|
204
|
+
id: currentMatch.id,
|
|
205
|
+
status: currentMatch.status,
|
|
206
|
+
error: currentMatch.error
|
|
207
|
+
},
|
|
208
|
+
componentKey
|
|
209
|
+
};
|
|
210
|
+
});
|
|
211
|
+
return createComponent(__rspack_external_solid_js_0ac0db99.Show, {
|
|
212
|
+
get when () {
|
|
213
|
+
return matchState();
|
|
214
|
+
},
|
|
215
|
+
children: (currentMatchState)=>{
|
|
216
|
+
const route = __rspack_external_solid_js_0ac0db99.createMemo(()=>currentMatchState().route);
|
|
217
|
+
const currentMatch = __rspack_external_solid_js_0ac0db99.createMemo(()=>currentMatchState().match);
|
|
218
|
+
const componentKey = __rspack_external_solid_js_0ac0db99.createMemo(()=>currentMatchState().componentKey);
|
|
219
|
+
const OutComponent = __rspack_external_solid_js_0ac0db99.createMemo(()=>route().options.component ?? router.options.defaultComponent ?? Outlet);
|
|
220
|
+
const keyedOut = ()=>createComponent(__rspack_external_solid_js_0ac0db99.Show, {
|
|
221
|
+
get when () {
|
|
222
|
+
return componentKey();
|
|
223
|
+
},
|
|
224
|
+
keyed: true,
|
|
225
|
+
children: (_key)=>createComponent(Dynamic, {
|
|
226
|
+
get component () {
|
|
227
|
+
return OutComponent();
|
|
228
|
+
}
|
|
229
|
+
})
|
|
230
|
+
});
|
|
231
|
+
return createComponent(__rspack_external_solid_js_0ac0db99.Switch, {
|
|
232
|
+
get children () {
|
|
233
|
+
return [
|
|
234
|
+
createComponent(__rspack_external_solid_js_0ac0db99.Match, {
|
|
235
|
+
get when () {
|
|
236
|
+
return "notFound" === currentMatch().status;
|
|
237
|
+
},
|
|
238
|
+
children: (_)=>__rspack_external_solid_js_0ac0db99.untrack(()=>renderRouteNotFound(router, route(), currentMatch().error))
|
|
239
|
+
}),
|
|
240
|
+
createComponent(__rspack_external_solid_js_0ac0db99.Match, {
|
|
241
|
+
get when () {
|
|
242
|
+
return "error" === currentMatch().status;
|
|
243
|
+
},
|
|
244
|
+
children: (_)=>{
|
|
245
|
+
const matchError = __rspack_external_solid_js_0ac0db99.untrack(()=>currentMatch().error);
|
|
246
|
+
if (isServer ?? router.isServer) {
|
|
247
|
+
const RouteErrorComponent = (route().options.errorComponent ?? router.options.defaultErrorComponent) || ErrorComponent;
|
|
248
|
+
return "production" !== process.env.NODE_ENV ? renderInNonRouteComponentContext(()=>createComponent(RouteErrorComponent, {
|
|
249
|
+
error: matchError,
|
|
250
|
+
reset: void 0,
|
|
251
|
+
info: {
|
|
252
|
+
componentStack: ""
|
|
253
|
+
}
|
|
254
|
+
}), "errorComponent") : createComponent(RouteErrorComponent, {
|
|
255
|
+
error: matchError,
|
|
256
|
+
reset: void 0,
|
|
257
|
+
info: {
|
|
258
|
+
componentStack: ""
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
throw matchError;
|
|
263
|
+
}
|
|
264
|
+
}),
|
|
265
|
+
createComponent(__rspack_external_solid_js_0ac0db99.Match, {
|
|
266
|
+
get when () {
|
|
267
|
+
return "success" === currentMatch().status;
|
|
268
|
+
},
|
|
269
|
+
get children () {
|
|
270
|
+
return keyedOut();
|
|
271
|
+
}
|
|
272
|
+
})
|
|
273
|
+
];
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
};
|
|
279
|
+
const Outlet = ()=>{
|
|
280
|
+
if ("production" !== process.env.NODE_ENV) {
|
|
281
|
+
const nonRouteComponent = __rspack_external_solid_js_0ac0db99.useContext(nonRouteComponentContext);
|
|
282
|
+
if (nonRouteComponent) console.warn(`Warning: An <Outlet /> was rendered inside a ${nonRouteComponent}. <Outlet /> should only be rendered inside a route component.`);
|
|
283
|
+
}
|
|
284
|
+
const router = useRouter();
|
|
285
|
+
const nearestParentMatch = __rspack_external_solid_js_0ac0db99.useContext(nearestMatchContext);
|
|
286
|
+
const parentMatch = nearestParentMatch[1];
|
|
287
|
+
const routeId = nearestParentMatch[0];
|
|
288
|
+
const route = __rspack_external_solid_js_0ac0db99.createMemo(()=>{
|
|
289
|
+
const currentRouteId = routeId();
|
|
290
|
+
return currentRouteId ? router.routesById[currentRouteId] : void 0;
|
|
291
|
+
});
|
|
292
|
+
const parentNotFound = __rspack_external_solid_js_0ac0db99.createMemo(()=>parentMatch()?._notFound);
|
|
293
|
+
const parentNotFoundError = __rspack_external_solid_js_0ac0db99.createMemo(()=>parentMatch()?.error);
|
|
294
|
+
const childRouteId = __rspack_external_solid_js_0ac0db99.createMemo(()=>{
|
|
295
|
+
if (parentNotFound()) return;
|
|
296
|
+
const currentRouteId = routeId();
|
|
297
|
+
if (!currentRouteId) return;
|
|
298
|
+
const ids = router.stores.ids.get();
|
|
299
|
+
return ids[ids.indexOf(currentRouteId) + 1];
|
|
300
|
+
});
|
|
301
|
+
return createComponent(__rspack_external_solid_js_0ac0db99.Show, {
|
|
302
|
+
get when () {
|
|
303
|
+
return childRouteId();
|
|
304
|
+
},
|
|
305
|
+
keyed: true,
|
|
306
|
+
get fallback () {
|
|
307
|
+
return createComponent(__rspack_external_solid_js_0ac0db99.Show, {
|
|
308
|
+
get when () {
|
|
309
|
+
return memo(()=>!!parentNotFound())() ? route() : parentNotFound();
|
|
310
|
+
},
|
|
311
|
+
children: (resolvedRoute)=>__rspack_external_solid_js_0ac0db99.untrack(()=>renderRouteNotFound(router, resolvedRoute(), parentNotFoundError()))
|
|
312
|
+
});
|
|
313
|
+
},
|
|
314
|
+
children: (currentChildRouteId)=>createComponent(Match, {
|
|
315
|
+
routeId: currentChildRouteId
|
|
316
|
+
})
|
|
317
|
+
});
|
|
318
|
+
};
|
|
319
|
+
export { Match, MatchInner, Outlet };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { createComponent, memo, mergeProps } from "@solidjs/web";
|
|
2
|
+
import { replaceEqualDeep } from "@tanstack/router-core";
|
|
3
|
+
import { CatchBoundary, ErrorComponent } from "./CatchBoundary.js";
|
|
4
|
+
import { Match } from "./Match.js";
|
|
5
|
+
import { nearestMatchContext } from "./matchContext.js";
|
|
6
|
+
import { SafeFragment } from "./SafeFragment.js";
|
|
7
|
+
import { Rendered, Transitioner } from "./Transitioner.js";
|
|
8
|
+
import { useRouter } from "./useRouter.js";
|
|
9
|
+
import * as __rspack_external_solid_js_0ac0db99 from "solid-js";
|
|
10
|
+
const NearestMatchContext = nearestMatchContext;
|
|
11
|
+
function Matches() {
|
|
12
|
+
const router = useRouter();
|
|
13
|
+
const OptionalWrapper = router.options.InnerWrap || SafeFragment;
|
|
14
|
+
return createComponent(OptionalWrapper, {
|
|
15
|
+
get children () {
|
|
16
|
+
return [
|
|
17
|
+
createComponent(Transitioner, {}),
|
|
18
|
+
createComponent(MatchesInner, {}),
|
|
19
|
+
createComponent(Rendered, {})
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function MatchesInner() {
|
|
25
|
+
const router = useRouter();
|
|
26
|
+
const routeId = ()=>router.stores.ids.get()[0];
|
|
27
|
+
const match = ()=>routeId() ? router.stores.byRoute.get(routeId())?.get() : void 0;
|
|
28
|
+
const nearestMatch = [
|
|
29
|
+
routeId,
|
|
30
|
+
match
|
|
31
|
+
];
|
|
32
|
+
const matchContent = ()=>createComponent(__rspack_external_solid_js_0ac0db99.Show, {
|
|
33
|
+
get when () {
|
|
34
|
+
return routeId();
|
|
35
|
+
},
|
|
36
|
+
keyed: true,
|
|
37
|
+
children: (currentRouteId)=>createComponent(Match, {
|
|
38
|
+
routeId: currentRouteId
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
if (router.options.disableGlobalCatchBoundary) return createComponent(NearestMatchContext, {
|
|
42
|
+
value: nearestMatch,
|
|
43
|
+
get children () {
|
|
44
|
+
return matchContent();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return createComponent(NearestMatchContext, {
|
|
48
|
+
value: nearestMatch,
|
|
49
|
+
get children () {
|
|
50
|
+
return createComponent(CatchBoundary, mergeProps({
|
|
51
|
+
getResetKey: ()=>router.stores.matches.get(),
|
|
52
|
+
render: matchContent,
|
|
53
|
+
errorComponent: ErrorComponent
|
|
54
|
+
}, ()=>"production" !== process.env.NODE_ENV ? {
|
|
55
|
+
onCatch: (error)=>{
|
|
56
|
+
console.warn("Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!");
|
|
57
|
+
console.warn(`Warning: ${error.message || error.toString()}`);
|
|
58
|
+
}
|
|
59
|
+
} : {}));
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function useMatchRoute() {
|
|
64
|
+
const router = useRouter();
|
|
65
|
+
return (opts)=>__rspack_external_solid_js_0ac0db99.createMemo(()=>{
|
|
66
|
+
const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts;
|
|
67
|
+
router.stores.location.get();
|
|
68
|
+
router.stores.resolvedLocation.get();
|
|
69
|
+
router.stores.status.get();
|
|
70
|
+
return router.matchRoute(rest, {
|
|
71
|
+
...void 0 !== pending ? {
|
|
72
|
+
pending
|
|
73
|
+
} : {},
|
|
74
|
+
...void 0 !== caseSensitive ? {
|
|
75
|
+
caseSensitive
|
|
76
|
+
} : {},
|
|
77
|
+
...void 0 !== fuzzy ? {
|
|
78
|
+
fuzzy
|
|
79
|
+
} : {},
|
|
80
|
+
...void 0 !== includeSearch ? {
|
|
81
|
+
includeSearch
|
|
82
|
+
} : {}
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function MatchRoute(props) {
|
|
87
|
+
const matchRoute = useMatchRoute();
|
|
88
|
+
const params = matchRoute(props);
|
|
89
|
+
const renderedChild = __rspack_external_solid_js_0ac0db99.createMemo(()=>{
|
|
90
|
+
const matchedParams = params();
|
|
91
|
+
const child = props.children;
|
|
92
|
+
if ("function" == typeof child) return child(matchedParams);
|
|
93
|
+
return matchedParams ? child : null;
|
|
94
|
+
});
|
|
95
|
+
return memo(renderedChild);
|
|
96
|
+
}
|
|
97
|
+
function useMatches(opts) {
|
|
98
|
+
const router = useRouter();
|
|
99
|
+
return __rspack_external_solid_js_0ac0db99.createMemo((prev)=>{
|
|
100
|
+
const matches = router.stores.matches.get();
|
|
101
|
+
const res = opts?.select ? opts.select(matches) : matches;
|
|
102
|
+
if (void 0 === prev) return res;
|
|
103
|
+
return replaceEqualDeep(prev, res);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
function useParentMatches(opts) {
|
|
107
|
+
const contextRouteId = __rspack_external_solid_js_0ac0db99.useContext(nearestMatchContext)[0];
|
|
108
|
+
return useMatches({
|
|
109
|
+
select: (matches)=>{
|
|
110
|
+
matches = matches.slice(0, matches.findIndex((d)=>d.routeId === contextRouteId()));
|
|
111
|
+
return opts?.select ? opts.select(matches) : matches;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function useChildMatches(opts) {
|
|
116
|
+
const contextRouteId = __rspack_external_solid_js_0ac0db99.useContext(nearestMatchContext)[0];
|
|
117
|
+
return useMatches({
|
|
118
|
+
select: (matches)=>{
|
|
119
|
+
matches = matches.slice(matches.findIndex((d)=>d.routeId === contextRouteId()) + 1);
|
|
120
|
+
return opts?.select ? opts.select(matches) : matches;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
export { MatchRoute, Matches, useChildMatches, useMatchRoute, useMatches, useParentMatches };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"repository": "https://github.com/TanStack/router",
|
|
3
|
+
"commit": "4fbd65c5c3b40be87a6248867c22021c1c19bba8",
|
|
4
|
+
"sourcePath": "packages/solid-router/src",
|
|
5
|
+
"upstreamPackage": "@tanstack/solid-router",
|
|
6
|
+
"upstreamVersion": "2.0.0-rc.8",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"licenseSourcePath": "LICENSE",
|
|
9
|
+
"ownedBy": "@modern-js/renderer-solid",
|
|
10
|
+
"upstreamPorts": [
|
|
11
|
+
{
|
|
12
|
+
"repository": "https://github.com/TanStack/router",
|
|
13
|
+
"commit": "84bde660a12d82e8c74859b3240157af7566f843",
|
|
14
|
+
"sourcePath": "packages/solid-router/src",
|
|
15
|
+
"upstreamPackage": "@tanstack/solid-router",
|
|
16
|
+
"upstreamVersion": "1.170.36",
|
|
17
|
+
"routerCoreVersion": "1.171.37",
|
|
18
|
+
"files": ["Scripts.tsx", "link.tsx"],
|
|
19
|
+
"adaptation": "Native body-script composition and positional search equality are ported from the matching router-core release. The owned binding retains Solid 2 RC.13 JSX, NoHydration, keyed public match transfer and its module-keyed client-assets resolver."
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"upstreamFileSha256": {
|
|
23
|
+
"Asset.tsx": "78dbaa6e5ab3fabc49dc28cba20e923d7b9f7b9dcaf3729dd5479e2e5d88da56",
|
|
24
|
+
"CatchBoundary.tsx": "c79c2944e7735c76058c196693ca2ddb4bddb142fcd7a586b0672f81772486eb",
|
|
25
|
+
"ClientOnly.tsx": "e6c1ca9b4f2657696bd29d0221bd5e5f60c130f64cc694e426a7b65aaa66df74",
|
|
26
|
+
"HeadContent.tsx": "86537f4ed1ab45282444d7badfb618ba74ad19bbe547c35f3d6e8d12397c8e73",
|
|
27
|
+
"LICENSE": "a405ee70c632bb938acb7ac5f210e814409b3760ea9d2329d8ed8ffcfd11a0e7",
|
|
28
|
+
"Match.tsx": "9f83c3ab36d9eb3480b2f3b8ec10b7b77a2ff5e4ea75d79104fe628c40056af0",
|
|
29
|
+
"Matches.tsx": "5ec59438b48b7dc9bc3add8703080ee46d6dfd7b76ccaff61fe65f5ddcf02579",
|
|
30
|
+
"RouterProvider.tsx": "e5d2459328927a470e5821c7f1f68eeca51915ef885bfc45aedb2e5ee8fa4928",
|
|
31
|
+
"SafeFragment.tsx": "31a1e3445f0893abdccb3f431e97ad4e81562f09db8e0731fca37d3383641bd3",
|
|
32
|
+
"ScriptOnce.tsx": "d499a0a5cc9aa5069f9dcb38adc5de62d50db11e844f5b2bc3789589c859df51",
|
|
33
|
+
"Scripts.tsx": "c47516d07012106ebd069957970336f794ea01644c154828e7c231ac428679e1",
|
|
34
|
+
"ScrollRestoration.tsx": "947f793e1a7b1f889389fbeb24067166e65dddf19185cdc57f725d9064ca7a28",
|
|
35
|
+
"Transitioner.tsx": "ee166b4668d839fc70ccde13cb3236bfe1ec2fd6c84beab6444f312200d28046",
|
|
36
|
+
"awaited.tsx": "68185231c442451c9f97ff47b7de39803272d33e96805778231dac95fc7d1741",
|
|
37
|
+
"fileRoute.ts": "3ed7a45ea9f18566ac71bb63b0c8881b411d28bc2abe486703fe305c9fdbd01e",
|
|
38
|
+
"flightData.ts": "e19f75891f80fd220227fcc03ee17c83c7c7fb804fa0c53785daa24ebe062a4e",
|
|
39
|
+
"headContentUtils.tsx": "9dcbd62e325e7d249a79b6afff77f51388c985ac91b0f329f9ec5140bc16205c",
|
|
40
|
+
"history.ts": "1bd12c2f8ca1b44e860a17f92582596b0125c92bb577db6f07e8c3994b7a582c",
|
|
41
|
+
"index.tsx": "34248dc9c06f4e16a3a42b1256782ffe8d87bcbdbdafb1c2bffb9aef8abdbe47",
|
|
42
|
+
"lazyRouteComponent.tsx": "7bd78423c8ebac18157bacdac1c38b2fe91b98af734a2cd16b67b109e5a9fca6",
|
|
43
|
+
"link.tsx": "66ef79dcde50418e8e4b9cf5fbc15a97179283fc64b3f39a6632ebc38c11ef82",
|
|
44
|
+
"matchContext.tsx": "12bc0fabd0e9ffbab124c7270528bae8efeaf8473fd81f1e88163038d8f12e71",
|
|
45
|
+
"nonRouteComponentContext.tsx": "0c83d583a7852f76f779f7733f4e48c27148295b1f8e831cd27b26ce3ac4e5e2",
|
|
46
|
+
"not-found.tsx": "c408fce8f430c3692332dfae451b713fd17dc484809c39e6b4c9e300fedd25c8",
|
|
47
|
+
"registryTransfer.ts": "c0c989413589a384c0ad714f52d2fa622715bb15a487af1f1158ef96943c2192",
|
|
48
|
+
"renderRouteNotFound.tsx": "b504eb5b9fa6fe9998a90a0d5769ad9d5655d42b3d421e2c0dceebb8bc1831a5",
|
|
49
|
+
"route.tsx": "248922d87014821272e236cd5775c96c32d87060994db5b5f25478ffb20d86e6",
|
|
50
|
+
"router.ts": "0d8dd86241f611561d6588af0e31d194301269efe75525259eead54f95617f68",
|
|
51
|
+
"routerContext.tsx": "42f4c1179d5983224df798d2ca395b6246765cb6ec77eda2b627c8c464b5aa78",
|
|
52
|
+
"routerStores.ts": "46fb1e5d24e3d06ad798ad63b7e1ed9ec5e1f1f42e5ac1f60a9502db72da5f2f",
|
|
53
|
+
"scroll-restoration.tsx": "f029fc78c834c7271827da586b21a719d4ceebecf77f11eda75454c79608e879",
|
|
54
|
+
"typePrimitives.ts": "78d4527fe249ac871bd1696fd71f856a79cf93ccb85cedd57cf44630622d69fb",
|
|
55
|
+
"useBlocker.tsx": "ad5f4865501d628b430d15ea48dc5fabda0235b13075c688a364254183af5c95",
|
|
56
|
+
"useCanGoBack.ts": "d70495b51c4915f33158929b79352044f647d126fc5f44de08f04e219899b95b",
|
|
57
|
+
"useLoaderData.tsx": "2ffacb8e6c4bc2713f7da4db01dad0f34c9c4c9b75af66716e48ec38accf3397",
|
|
58
|
+
"useLoaderDeps.tsx": "066c52b466a0815e5f3e912e5909c8193ac039c3410ca5bb382b8d18ab1008bb",
|
|
59
|
+
"useLocation.tsx": "f65197d00b1bccd2cd7e9834a7273889706a86cf65db7636bafa41cdebb39de8",
|
|
60
|
+
"useMatch.tsx": "26c4a4c2e3d6b8b8a10b028409fca7711441b118c868a73be56209d7c38c2051",
|
|
61
|
+
"useNavigate.tsx": "83a6ec04e886b661bb38d95b12772778f79d573abd2f0c294b95d7080ef97968",
|
|
62
|
+
"useParams.tsx": "0a2a45dee679cf9df90fb1fb88e53a0d7afcfd6005c2d6cc848c350f3d33aefd",
|
|
63
|
+
"useRouteContext.ts": "2f248aeaa2fd4550dbc25b4fd78688c0aaf0d488f440546e5aeee2f055944294",
|
|
64
|
+
"useRouter.tsx": "0fe4a6a60ade5da19db72253898256486e08466a9fafd59aea3263ee5203e21d",
|
|
65
|
+
"useRouterState.tsx": "be1f97cfb4ee845cc8e7175aff5ede190e8a75c7f892faa7c914ac89c4af25f1",
|
|
66
|
+
"useSearch.tsx": "585add65de5a8633d09fa36be38666e601bfd01076e01fccef25f832792c1e1d",
|
|
67
|
+
"utils.ts": "a398c76ac378efe6f8b9aa859a5335d4f07cc692a31754fa93c8bf3e5df0b6ff"
|
|
68
|
+
},
|
|
69
|
+
"localChanges": [
|
|
70
|
+
"The public router surface omits InjectedHtmlEntry, isPlainArray and isPlainObject, which router-core 1.171.37 no longer exports. Managed SSR uses immutable public route data and native Solid 2 promise serialization. Custom serializationAdapters are unsupported and rejected before router construction or document commitment; the local public option types do not admit them.",
|
|
71
|
+
"Authored JSX types import @solidjs/web and have explicit return annotations for Solid 2 declaration generation.",
|
|
72
|
+
"Hydration state and keyed match transfer use Solid 2 RC.13 public isHydrating, isHydratable, getHydrationWriter and takeHydrationValue APIs.",
|
|
73
|
+
"Explicit public beforeLoad results transfer after canonical validation; private request context stays in owner closures. Initial hydration inherits checked server beforeLoad contributions, invokes the native client route-context callback and preserves client options context without rerunning initial beforeLoad callbacks or loaders.",
|
|
74
|
+
"Public native route/view data is projected into deeply frozen canonical plain or null-prototype records, arrays and scalars. Date, RegExp, Map and Set are unsupported at this immutable native UI boundary; the shared HTTP data codec retains its rich-data contract. Authored originals remain untouched.",
|
|
75
|
+
"Owner-scoped alias caches preserve shared critical objects and checked flat deferred transports. Promise fulfillments and rejections are freshly validated, cloned and frozen; unsupported values fail their owning scope. Request preflight captures stable public match snapshots before response commit, excluding known private request identities.",
|
|
76
|
+
"Fresh checked Promise handles are sealed with controlled nonenumerable s/v accessors matching the audited Solid RC.13 state protocol. Status accepts undefined, 0, 1 or 2; assigned values receive the same descriptor-safe immutable public/error projection and private-reference checks. Unsupported AsyncIterable state and unsafe annotations fail the owning scope. Authored Promise handles remain unchanged.",
|
|
77
|
+
"Only the native keyed hydration receiver admits decoded Promise metadata: exact native prototypes, own s/v data descriptors and documented states 0, 1 or 2. Settled states require a checked public value; symbols, accessors, extra fields and AsyncIterable metadata reject before atomic publication. A detached controlled transport adopts valid settled metadata synchronously before native views consume it. General authored Promise validation remains metadata-free and decoded originals remain untouched.",
|
|
78
|
+
"Managed route-tree owners apply the same public projection before native client hydration commits. The owning native store publisher validates the complete offered chain, rewrites composed-context fields to checked public references and freezes the same native context root before publication. Registry claiming consumes the complete matched chain and owns pending rejections before choosing atomic fallback.",
|
|
79
|
+
"Inside UltraModern request-owned SSR, the native provider and match serializer reject unregistered custom native routers before rendering or transfer; managed filesystem/application factories own the immutable public boundary and route-tree owner registration remains internal. Bare native rendering without an UltraModern request remains an ABI probe and does not claim framework privacy qualification.",
|
|
80
|
+
"Match errors use a descriptor-safe public diagnostic projection; exact DataProtocolError diagnostics remain actionable, and the exact fork-owned RouteDataError class has a fixed checked snapshot and native registry restoration.",
|
|
81
|
+
"The upstream ssr/ server-entry adapters are omitted; @modern-js/renderer-solid/server owns document rendering and the router transfer.",
|
|
82
|
+
"Source formatting follows the owning repository's Biome configuration."
|
|
83
|
+
],
|
|
84
|
+
"nativeProtocolLimitations": [
|
|
85
|
+
{
|
|
86
|
+
"runtime": "@solidjs/web@2.0.0-rc.15 with Seroval 1.6.8",
|
|
87
|
+
"trigger": "Direct native writer injection of a rejected whole-match Promise before the client binding loads",
|
|
88
|
+
"observed": "Native inline resolver scripts reject registry Promises without a rejection handler; browser page errors occur before router construction. Binding claims cannot retroactively handle those errors.",
|
|
89
|
+
"supportedProducer": "The maintained match producer writes only settled synchronous records and excludes pending matches. Critical public-data failures are rejected before headers; unsupported deferred values fail the owning session and abort native serialization.",
|
|
90
|
+
"diagnostic": "ULTRAMODERN_SOLID_RAW_PROTOCOL_DIAGNOSTIC=1 node tests/ultramodern-renderers/solid-admission/run.mjs",
|
|
91
|
+
"qualification": "The raw injection is an opt-in unsupported native-protocol diagnostic, excluded from the maintained producer qualification; its failure remains visible and unsuppressed."
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createComponent, mergeProps } from "@solidjs/web";
|
|
2
|
+
import { isServer } from "@tanstack/router-core/isServer";
|
|
3
|
+
import { setupFlightDataConsumer } from "./flightData.js";
|
|
4
|
+
import { Matches } from "./Matches.js";
|
|
5
|
+
import { assertNativeSerializationOptions, requireManagedPublicRouter, serializeMatchTransfer } from "./registryTransfer.js";
|
|
6
|
+
import { routerContext } from "./routerContext.js";
|
|
7
|
+
import { SafeFragment } from "./SafeFragment.js";
|
|
8
|
+
import * as __rspack_external_solid_js_0ac0db99 from "solid-js";
|
|
9
|
+
const RouterContext = routerContext;
|
|
10
|
+
function RouterContextProvider({ router, children, ...rest }) {
|
|
11
|
+
assertNativeSerializationOptions(rest);
|
|
12
|
+
requireManagedPublicRouter(router);
|
|
13
|
+
if (Object.keys(rest).length > 0) __rspack_external_solid_js_0ac0db99.runWithOwner(null, ()=>{
|
|
14
|
+
router.update({
|
|
15
|
+
...router.options,
|
|
16
|
+
...rest,
|
|
17
|
+
context: {
|
|
18
|
+
...router.options.context,
|
|
19
|
+
...rest.context
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
const ready = __rspack_external_solid_js_0ac0db99.createMemo(()=>(isServer ?? router.isServer) && !router._serverResult ? router.load().then(()=>true) : true);
|
|
24
|
+
if (!(isServer ?? router.isServer)) __rspack_external_solid_js_0ac0db99.onCleanup(setupFlightDataConsumer(router));
|
|
25
|
+
const OptionalWrapper = router.options.Wrap || SafeFragment;
|
|
26
|
+
return createComponent(OptionalWrapper, {
|
|
27
|
+
get children () {
|
|
28
|
+
return createComponent(RouterContext, {
|
|
29
|
+
value: router,
|
|
30
|
+
get children () {
|
|
31
|
+
return createComponent(__rspack_external_solid_js_0ac0db99.Show, {
|
|
32
|
+
get when () {
|
|
33
|
+
return ready();
|
|
34
|
+
},
|
|
35
|
+
children: (_)=>{
|
|
36
|
+
if (isServer ?? router.isServer) serializeMatchTransfer(router);
|
|
37
|
+
return children();
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function RouterProvider({ router, ...rest }) {
|
|
46
|
+
return createComponent(RouterContextProvider, mergeProps({
|
|
47
|
+
router
|
|
48
|
+
}, rest, {
|
|
49
|
+
children: ()=>createComponent(Matches, {})
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
export { RouterContextProvider, RouterProvider };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { effect, getNextElement, setAttribute, setProperty, template } from "@solidjs/web";
|
|
2
|
+
import { isServer } from "@tanstack/router-core/isServer";
|
|
3
|
+
import { useRouter } from "./useRouter.js";
|
|
4
|
+
var _tmpl$ = /* @__PURE__ */ template("<script class=$tsr>");
|
|
5
|
+
function ScriptOnce({ children }) {
|
|
6
|
+
const router = useRouter();
|
|
7
|
+
if (!(isServer ?? router.isServer)) return null;
|
|
8
|
+
var _el$ = getNextElement(_tmpl$);
|
|
9
|
+
setProperty(_el$, "innerHTML", children + ";document.currentScript.remove()");
|
|
10
|
+
effect(()=>router.options.ssr?.nonce, (_v$)=>{
|
|
11
|
+
setAttribute(_el$, "nonce", _v$);
|
|
12
|
+
});
|
|
13
|
+
return _el$;
|
|
14
|
+
}
|
|
15
|
+
export { ScriptOnce };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { NoHydration, createComponent } from "@solidjs/web";
|
|
2
|
+
import { composeSsrBodyScripts, getSsrBodyScriptParts, replaceEqualDeep } from "@tanstack/router-core";
|
|
3
|
+
import { isServer } from "@tanstack/router-core/isServer";
|
|
4
|
+
import { Asset } from "./Asset.js";
|
|
5
|
+
import { useRouter } from "./useRouter.js";
|
|
6
|
+
import * as __rspack_external_solid_js_0ac0db99 from "solid-js";
|
|
7
|
+
const Scripts = ()=>{
|
|
8
|
+
const router = useRouter();
|
|
9
|
+
const nonce = router.options.ssr?.nonce;
|
|
10
|
+
const scripts = __rspack_external_solid_js_0ac0db99.createMemo((previous)=>{
|
|
11
|
+
const next = composeSsrBodyScripts(getSsrBodyScriptParts(router.stores.matches.get(), router.ssr?.manifest, nonce));
|
|
12
|
+
return previous ? replaceEqualDeep(previous, next) : next;
|
|
13
|
+
});
|
|
14
|
+
const initialHydrationScripts = (isServer ?? router.isServer) && router.serverSsr ? router.serverSsr.takeInitialHydrationScriptTags() : void 0;
|
|
15
|
+
const tags = ()=>initialHydrationScripts ? composeSsrBodyScripts([
|
|
16
|
+
scripts(),
|
|
17
|
+
[]
|
|
18
|
+
], initialHydrationScripts) : scripts();
|
|
19
|
+
return createComponent(NoHydration, {
|
|
20
|
+
get children () {
|
|
21
|
+
return createComponent(__rspack_external_solid_js_0ac0db99.For, {
|
|
22
|
+
get each () {
|
|
23
|
+
return tags();
|
|
24
|
+
},
|
|
25
|
+
children: (asset)=>createComponent(Asset, asset)
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
export { Scripts };
|