@tanstack/solid-router 2.0.0-alpha.5 → 2.0.0-alpha.7
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/Asset.cjs +2 -2
- package/dist/cjs/Asset.cjs.map +1 -1
- package/dist/cjs/HeadContent.cjs +11 -1
- package/dist/cjs/HeadContent.cjs.map +1 -1
- package/dist/cjs/HeadContent.dev.cjs +11 -1
- package/dist/cjs/HeadContent.dev.cjs.map +1 -1
- package/dist/cjs/Match.cjs +265 -248
- package/dist/cjs/Match.cjs.map +1 -1
- package/dist/cjs/Match.d.cts +1 -3
- package/dist/cjs/Matches.cjs +35 -34
- package/dist/cjs/Matches.cjs.map +1 -1
- package/dist/cjs/RouterProvider.cjs +12 -8
- package/dist/cjs/RouterProvider.cjs.map +1 -1
- package/dist/cjs/RouterProvider.d.cts +1 -1
- package/dist/cjs/Scripts.cjs +23 -12
- package/dist/cjs/Scripts.cjs.map +1 -1
- package/dist/cjs/Scripts.d.cts +2 -1
- package/dist/cjs/Transitioner.cjs +57 -36
- package/dist/cjs/Transitioner.cjs.map +1 -1
- package/dist/cjs/headContentUtils.cjs +26 -23
- package/dist/cjs/headContentUtils.cjs.map +1 -1
- package/dist/cjs/headContentUtils.d.cts +2 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.dev.cjs +1 -1
- package/dist/cjs/link.cjs +143 -101
- package/dist/cjs/link.cjs.map +1 -1
- package/dist/cjs/matchContext.cjs +7 -5
- package/dist/cjs/matchContext.cjs.map +1 -1
- package/dist/cjs/matchContext.d.cts +8 -2
- package/dist/cjs/not-found.cjs +8 -4
- package/dist/cjs/not-found.cjs.map +1 -1
- package/dist/cjs/not-found.d.cts +1 -1
- package/dist/cjs/router.cjs +2 -1
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/routerStores.cjs +75 -0
- package/dist/cjs/routerStores.cjs.map +1 -0
- package/dist/cjs/routerStores.d.cts +10 -0
- package/dist/cjs/ssr/RouterClient.cjs +1 -1
- package/dist/cjs/ssr/RouterClient.cjs.map +1 -1
- package/dist/cjs/ssr/renderRouterToStream.cjs +1 -1
- package/dist/cjs/ssr/renderRouterToStream.cjs.map +1 -1
- package/dist/cjs/ssr/renderRouterToString.cjs +1 -1
- package/dist/cjs/ssr/renderRouterToString.cjs.map +1 -1
- package/dist/cjs/useBlocker.cjs +12 -3
- package/dist/cjs/useBlocker.cjs.map +1 -1
- package/dist/cjs/useCanGoBack.cjs +6 -2
- package/dist/cjs/useCanGoBack.cjs.map +1 -1
- package/dist/cjs/useCanGoBack.d.cts +2 -1
- package/dist/cjs/useLoaderDeps.cjs +2 -3
- package/dist/cjs/useLoaderDeps.cjs.map +1 -1
- package/dist/cjs/useLocation.cjs +13 -2
- package/dist/cjs/useLocation.cjs.map +1 -1
- package/dist/cjs/useMatch.cjs +27 -15
- package/dist/cjs/useMatch.cjs.map +1 -1
- package/dist/cjs/useParams.cjs +1 -1
- package/dist/cjs/useParams.cjs.map +1 -1
- package/dist/cjs/useRouterState.cjs +12 -30
- package/dist/cjs/useRouterState.cjs.map +1 -1
- package/dist/cjs/useSearch.cjs +2 -1
- package/dist/cjs/useSearch.cjs.map +1 -1
- package/dist/cjs/utils.cjs +3 -17
- package/dist/cjs/utils.cjs.map +1 -1
- package/dist/cjs/utils.d.cts +0 -5
- package/dist/esm/Asset.js +6 -6
- package/dist/esm/Asset.js.map +1 -1
- package/dist/esm/HeadContent.dev.js +12 -2
- package/dist/esm/HeadContent.dev.js.map +1 -1
- package/dist/esm/HeadContent.js +12 -2
- package/dist/esm/HeadContent.js.map +1 -1
- package/dist/esm/Match.d.ts +1 -3
- package/dist/esm/Match.js +267 -250
- package/dist/esm/Match.js.map +1 -1
- package/dist/esm/Matches.js +40 -39
- package/dist/esm/Matches.js.map +1 -1
- package/dist/esm/RouterProvider.d.ts +1 -1
- package/dist/esm/RouterProvider.js +10 -7
- package/dist/esm/RouterProvider.js.map +1 -1
- package/dist/esm/ScriptOnce.js +2 -2
- package/dist/esm/ScriptOnce.js.map +1 -1
- package/dist/esm/Scripts.d.ts +2 -1
- package/dist/esm/Scripts.js +21 -11
- package/dist/esm/Scripts.js.map +1 -1
- package/dist/esm/Transitioner.js +58 -37
- package/dist/esm/Transitioner.js.map +1 -1
- package/dist/esm/headContentUtils.d.ts +2 -1
- package/dist/esm/headContentUtils.js +26 -23
- package/dist/esm/headContentUtils.js.map +1 -1
- package/dist/esm/index.dev.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/link.js +146 -104
- package/dist/esm/link.js.map +1 -1
- package/dist/esm/matchContext.d.ts +8 -2
- package/dist/esm/matchContext.js +7 -4
- package/dist/esm/matchContext.js.map +1 -1
- package/dist/esm/not-found.d.ts +1 -1
- package/dist/esm/not-found.js +6 -3
- package/dist/esm/not-found.js.map +1 -1
- package/dist/esm/router.js +2 -1
- package/dist/esm/router.js.map +1 -1
- package/dist/esm/routerStores.d.ts +10 -0
- package/dist/esm/routerStores.js +73 -0
- package/dist/esm/routerStores.js.map +1 -0
- package/dist/esm/scroll-restoration.js +2 -2
- package/dist/esm/scroll-restoration.js.map +1 -1
- package/dist/esm/ssr/RouterClient.js +1 -1
- package/dist/esm/ssr/RouterClient.js.map +1 -1
- package/dist/esm/ssr/renderRouterToStream.js +1 -1
- package/dist/esm/ssr/renderRouterToStream.js.map +1 -1
- package/dist/esm/ssr/renderRouterToString.js +1 -1
- package/dist/esm/ssr/renderRouterToString.js.map +1 -1
- package/dist/esm/useBlocker.js +12 -3
- package/dist/esm/useBlocker.js.map +1 -1
- package/dist/esm/useCanGoBack.d.ts +2 -1
- package/dist/esm/useCanGoBack.js +4 -2
- package/dist/esm/useCanGoBack.js.map +1 -1
- package/dist/esm/useLoaderDeps.js +2 -3
- package/dist/esm/useLoaderDeps.js.map +1 -1
- package/dist/esm/useLocation.js +11 -2
- package/dist/esm/useLocation.js.map +1 -1
- package/dist/esm/useMatch.js +28 -16
- package/dist/esm/useMatch.js.map +1 -1
- package/dist/esm/useParams.js +1 -1
- package/dist/esm/useParams.js.map +1 -1
- package/dist/esm/useRouterState.js +11 -30
- package/dist/esm/useRouterState.js.map +1 -1
- package/dist/esm/useSearch.js +2 -1
- package/dist/esm/useSearch.js.map +1 -1
- package/dist/esm/utils.d.ts +0 -5
- package/dist/esm/utils.js +4 -17
- package/dist/esm/utils.js.map +1 -1
- package/dist/source/Asset.jsx +3 -3
- package/dist/source/Asset.jsx.map +1 -1
- package/dist/source/HeadContent.dev.jsx +5 -1
- package/dist/source/HeadContent.dev.jsx.map +1 -1
- package/dist/source/HeadContent.jsx +5 -1
- package/dist/source/HeadContent.jsx.map +1 -1
- package/dist/source/Match.d.ts +1 -3
- package/dist/source/Match.jsx +260 -264
- package/dist/source/Match.jsx.map +1 -1
- package/dist/source/Matches.jsx +46 -46
- package/dist/source/Matches.jsx.map +1 -1
- package/dist/source/RouterProvider.d.ts +1 -1
- package/dist/source/RouterProvider.jsx +13 -9
- package/dist/source/RouterProvider.jsx.map +1 -1
- package/dist/source/Scripts.d.ts +2 -1
- package/dist/source/Scripts.jsx +46 -47
- package/dist/source/Scripts.jsx.map +1 -1
- package/dist/source/Transitioner.jsx +80 -44
- package/dist/source/Transitioner.jsx.map +1 -1
- package/dist/source/headContentUtils.d.ts +2 -1
- package/dist/source/headContentUtils.jsx +79 -80
- package/dist/source/headContentUtils.jsx.map +1 -1
- package/dist/source/link.jsx +145 -112
- package/dist/source/link.jsx.map +1 -1
- package/dist/source/matchContext.d.ts +8 -2
- package/dist/source/matchContext.jsx +7 -3
- package/dist/source/matchContext.jsx.map +1 -1
- package/dist/source/not-found.d.ts +1 -1
- package/dist/source/not-found.jsx +6 -5
- package/dist/source/not-found.jsx.map +1 -1
- package/dist/source/router.js +2 -1
- package/dist/source/router.js.map +1 -1
- package/dist/source/routerStores.d.ts +10 -0
- package/dist/source/routerStores.js +82 -0
- package/dist/source/routerStores.js.map +1 -0
- package/dist/source/ssr/RouterClient.jsx +1 -1
- package/dist/source/ssr/RouterClient.jsx.map +1 -1
- package/dist/source/ssr/renderRouterToStream.jsx +1 -1
- package/dist/source/ssr/renderRouterToStream.jsx.map +1 -1
- package/dist/source/ssr/renderRouterToString.jsx +1 -1
- package/dist/source/ssr/renderRouterToString.jsx.map +1 -1
- package/dist/source/useBlocker.jsx +19 -8
- package/dist/source/useBlocker.jsx.map +1 -1
- package/dist/source/useCanGoBack.d.ts +2 -1
- package/dist/source/useCanGoBack.js +4 -2
- package/dist/source/useCanGoBack.js.map +1 -1
- package/dist/source/useLoaderDeps.jsx +2 -3
- package/dist/source/useLoaderDeps.jsx.map +1 -1
- package/dist/source/useLocation.jsx +13 -3
- package/dist/source/useLocation.jsx.map +1 -1
- package/dist/source/useMatch.jsx +33 -23
- package/dist/source/useMatch.jsx.map +1 -1
- package/dist/source/useParams.jsx +1 -1
- package/dist/source/useParams.jsx.map +1 -1
- package/dist/source/useRouterState.jsx +14 -55
- package/dist/source/useRouterState.jsx.map +1 -1
- package/dist/source/useSearch.jsx +2 -1
- package/dist/source/useSearch.jsx.map +1 -1
- package/dist/source/utils.d.ts +0 -5
- package/dist/source/utils.js +2 -15
- package/dist/source/utils.js.map +1 -1
- package/package.json +7 -7
- package/skills/solid-router/SKILL.md +2 -0
- package/src/Asset.tsx +3 -3
- package/src/HeadContent.dev.tsx +10 -1
- package/src/HeadContent.tsx +10 -1
- package/src/Match.tsx +395 -349
- package/src/Matches.tsx +55 -54
- package/src/RouterProvider.tsx +13 -10
- package/src/Scripts.tsx +55 -54
- package/src/Transitioner.tsx +103 -60
- package/src/headContentUtils.tsx +104 -96
- package/src/link.tsx +188 -146
- package/src/matchContext.tsx +16 -7
- package/src/not-found.tsx +6 -6
- package/src/router.ts +2 -1
- package/src/routerStores.ts +119 -0
- package/src/ssr/RouterClient.tsx +1 -1
- package/src/ssr/renderRouterToStream.tsx +1 -1
- package/src/ssr/renderRouterToString.tsx +1 -1
- package/src/useBlocker.tsx +80 -63
- package/src/useCanGoBack.ts +6 -2
- package/src/useLoaderDeps.tsx +2 -3
- package/src/useLocation.tsx +18 -5
- package/src/useMatch.tsx +37 -38
- package/src/useParams.tsx +2 -3
- package/src/useRouterState.tsx +21 -67
- package/src/useSearch.tsx +2 -1
- package/src/utils.ts +2 -24
package/dist/esm/Transitioner.js
CHANGED
|
@@ -1,28 +1,42 @@
|
|
|
1
1
|
import { useRouter } from "./useRouter.js";
|
|
2
|
-
import {
|
|
3
|
-
import { usePrevious } from "./utils.js";
|
|
4
|
-
import { getLocationChangeInfo, handleHashScroll, trimPathRight } from "@tanstack/router-core";
|
|
2
|
+
import { getLocationChangeInfo, trimPathRight } from "@tanstack/router-core";
|
|
5
3
|
import * as Solid from "solid-js";
|
|
6
4
|
//#region src/Transitioner.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Inline version of handleHashScroll that accepts a pre-captured location
|
|
7
|
+
* to avoid reading router.stores.location.state inside an effect callback
|
|
8
|
+
* (which would trigger a Solid v2 reactive warning).
|
|
9
|
+
*/
|
|
10
|
+
function handleHashScrollWithLocation(_router, location) {
|
|
11
|
+
if (typeof document !== "undefined" && document.querySelector) {
|
|
12
|
+
const hashScrollIntoViewOptions = location.state.__hashScrollIntoViewOptions ?? true;
|
|
13
|
+
if (hashScrollIntoViewOptions && location.hash !== "") {
|
|
14
|
+
const el = document.getElementById(location.hash);
|
|
15
|
+
if (el) el.scrollIntoView(hashScrollIntoViewOptions);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
7
19
|
function Transitioner() {
|
|
8
20
|
const router = useRouter();
|
|
9
21
|
let mountLoadForRouter = {
|
|
10
22
|
router,
|
|
11
23
|
mounted: false
|
|
12
24
|
};
|
|
13
|
-
const isLoading =
|
|
25
|
+
const isLoading = Solid.createMemo(() => router.stores.isLoading.state);
|
|
14
26
|
const [isSolidTransitioning] = [() => false];
|
|
15
|
-
const hasPendingMatches =
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const previousIsAnyPending = usePrevious(isAnyPending);
|
|
19
|
-
const isPagePending = () => isLoading() || hasPendingMatches();
|
|
20
|
-
const previousIsPagePending = usePrevious(isPagePending);
|
|
27
|
+
const hasPendingMatches = Solid.createMemo(() => router.stores.hasPendingMatches.state);
|
|
28
|
+
const isAnyPending = Solid.createMemo(() => isLoading() || isSolidTransitioning() || hasPendingMatches());
|
|
29
|
+
const isPagePending = Solid.createMemo(() => isLoading() || hasPendingMatches());
|
|
21
30
|
router.startTransition = (fn) => {
|
|
22
31
|
Solid.runWithOwner(null, fn);
|
|
32
|
+
try {
|
|
33
|
+
Solid.flush();
|
|
34
|
+
} catch {}
|
|
23
35
|
};
|
|
24
36
|
Solid.onSettled(() => {
|
|
25
|
-
const unsub = router.history.subscribe(
|
|
37
|
+
const unsub = router.history.subscribe(() => {
|
|
38
|
+
queueMicrotask(() => router.load());
|
|
39
|
+
});
|
|
26
40
|
router.updateLatestLocation();
|
|
27
41
|
const nextLocation = router.buildLocation({
|
|
28
42
|
to: router.latestLocation.pathname,
|
|
@@ -36,17 +50,17 @@ function Transitioner() {
|
|
|
36
50
|
...nextLocation,
|
|
37
51
|
replace: true
|
|
38
52
|
});
|
|
39
|
-
|
|
53
|
+
return () => {
|
|
40
54
|
unsub();
|
|
41
|
-
}
|
|
55
|
+
};
|
|
42
56
|
});
|
|
43
|
-
Solid.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
Solid.onSettled(() => {
|
|
58
|
+
if (typeof window !== "undefined" && router.ssr || mountLoadForRouter.router === router && mountLoadForRouter.mounted) return;
|
|
59
|
+
mountLoadForRouter = {
|
|
60
|
+
router,
|
|
61
|
+
mounted: true
|
|
62
|
+
};
|
|
63
|
+
queueMicrotask(() => {
|
|
50
64
|
const tryLoad = async () => {
|
|
51
65
|
try {
|
|
52
66
|
await router.load();
|
|
@@ -57,31 +71,38 @@ function Transitioner() {
|
|
|
57
71
|
tryLoad();
|
|
58
72
|
});
|
|
59
73
|
});
|
|
60
|
-
Solid.
|
|
61
|
-
|
|
74
|
+
Solid.createRenderEffect(() => [
|
|
75
|
+
isLoading(),
|
|
76
|
+
isPagePending(),
|
|
77
|
+
isAnyPending(),
|
|
78
|
+
router.stores.location.state,
|
|
79
|
+
router.stores.resolvedLocation.state
|
|
80
|
+
], ([currentIsLoading, currentIsPagePending, currentIsAnyPending, loc, resolvedLoc], prev) => {
|
|
81
|
+
if (!loc) return;
|
|
82
|
+
const previousIsLoading = prev?.[0];
|
|
83
|
+
const previousIsPagePending = prev?.[1];
|
|
84
|
+
const previousIsAnyPending = prev?.[2];
|
|
85
|
+
if (previousIsLoading && !currentIsLoading) router.emit({
|
|
62
86
|
type: "onLoad",
|
|
63
|
-
...getLocationChangeInfo(
|
|
87
|
+
...getLocationChangeInfo(loc, resolvedLoc)
|
|
64
88
|
});
|
|
65
|
-
|
|
66
|
-
Solid.createEffect(() => [isPagePending(), previousIsPagePending()], ([isPagePending, previousIsPagePending]) => {
|
|
67
|
-
if (previousIsPagePending.previous && !isPagePending) router.emit({
|
|
89
|
+
if (previousIsPagePending && !currentIsPagePending) router.emit({
|
|
68
90
|
type: "onBeforeRouteMount",
|
|
69
|
-
...getLocationChangeInfo(
|
|
91
|
+
...getLocationChangeInfo(loc, resolvedLoc)
|
|
70
92
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (previousIsAnyPending.previous && !isAnyPending) {
|
|
74
|
-
const changeInfo = getLocationChangeInfo(router.state);
|
|
93
|
+
if (previousIsAnyPending && !currentIsAnyPending) {
|
|
94
|
+
const changeInfo = getLocationChangeInfo(loc, resolvedLoc);
|
|
75
95
|
router.emit({
|
|
76
96
|
type: "onResolved",
|
|
77
97
|
...changeInfo
|
|
78
98
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
99
|
+
Solid.runWithOwner(null, () => {
|
|
100
|
+
router.batch(() => {
|
|
101
|
+
router.stores.status.setState(() => "idle");
|
|
102
|
+
router.stores.resolvedLocation.setState(() => loc);
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
if (changeInfo.hrefChanged) handleHashScrollWithLocation(router, loc);
|
|
85
106
|
}
|
|
86
107
|
});
|
|
87
108
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transitioner.js","names":["Solid","getLocationChangeInfo","
|
|
1
|
+
{"version":3,"file":"Transitioner.js","names":["Solid","getLocationChangeInfo","trimPathRight","useRouter","ParsedLocation","handleHashScrollWithLocation","_router","location","document","querySelector","hashScrollIntoViewOptions","state","__hashScrollIntoViewOptions","hash","el","getElementById","scrollIntoView","Transitioner","router","mountLoadForRouter","mounted","isLoading","createMemo","stores","isSolidTransitioning","hasPendingMatches","isAnyPending","isPagePending","startTransition","fn","Promise","runWithOwner","flush","onSettled","unsub","history","subscribe","queueMicrotask","load","updateLatestLocation","nextLocation","buildLocation","to","latestLocation","pathname","search","params","_includeValidateSearch","publicHref","commitLocation","replace","window","ssr","tryLoad","err","console","error","createRenderEffect","resolvedLocation","const","currentIsLoading","currentIsPagePending","currentIsAnyPending","loc","resolvedLoc","prev","previousIsLoading","previousIsPagePending","previousIsAnyPending","emit","type","changeInfo","batch","status","setState","hrefChanged"],"sources":["../../src/Transitioner.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { getLocationChangeInfo, trimPathRight } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type { ParsedLocation } from '@tanstack/router-core'\n\n/**\n * Inline version of handleHashScroll that accepts a pre-captured location\n * to avoid reading router.stores.location.state inside an effect callback\n * (which would trigger a Solid v2 reactive warning).\n */\nfunction handleHashScrollWithLocation(_router: any, location: ParsedLocation) {\n if (typeof document !== 'undefined' && (document as any).querySelector) {\n const hashScrollIntoViewOptions =\n location.state.__hashScrollIntoViewOptions ?? true\n\n if (hashScrollIntoViewOptions && location.hash !== '') {\n const el = document.getElementById(location.hash)\n if (el) {\n el.scrollIntoView(hashScrollIntoViewOptions)\n }\n }\n }\n}\n\nexport function Transitioner() {\n const router = useRouter()\n let mountLoadForRouter = { router, mounted: false }\n const isLoading = Solid.createMemo(() => router.stores.isLoading.state)\n\n const [isSolidTransitioning] = [() => false]\n\n // Track pending state changes\n const hasPendingMatches = Solid.createMemo(\n () => router.stores.hasPendingMatches.state,\n )\n\n const isAnyPending = Solid.createMemo(\n () => isLoading() || isSolidTransitioning() || hasPendingMatches(),\n )\n\n const isPagePending = Solid.createMemo(\n () => isLoading() || hasPendingMatches(),\n )\n\n router.startTransition = (fn: () => void | Promise<void>) => {\n Solid.runWithOwner(null, fn)\n try {\n Solid.flush()\n } catch {\n // flush() throws inside reactive contexts — Solid auto-flushes there\n }\n }\n\n // Subscribe to location changes\n // and try to load the new location\n Solid.onSettled(() => {\n const unsub = router.history.subscribe(() => {\n queueMicrotask(() => router.load())\n })\n\n // Refresh latestLocation from the current browser URL before comparing.\n // The URL may have been changed synchronously (e.g. via replaceState) after\n // render() but before this effect ran, so we must not use the stale\n // render-time location here.\n router.updateLatestLocation()\n\n const nextLocation = router.buildLocation({\n to: router.latestLocation.pathname,\n search: true,\n params: true,\n hash: true,\n state: true,\n _includeValidateSearch: true,\n })\n\n // Check if the current URL matches the canonical form.\n // Compare publicHref (browser-facing URL) for consistency with\n // the server-side redirect check in router.beforeLoad.\n if (\n trimPathRight(router.latestLocation.publicHref) !==\n trimPathRight(nextLocation.publicHref)\n ) {\n router.commitLocation({ ...nextLocation, replace: true })\n }\n\n return () => {\n unsub()\n }\n })\n\n // Try to load the initial location\n // In Solid v2, signal updates inside onSettled cannot be flushed\n // synchronously (flush() throws). router.load() sets signals via batch(),\n // and the code that runs immediately after needs those values committed.\n // By deferring to queueMicrotask, the load runs outside the reactive\n // scheduling frame so flush() works correctly.\n Solid.onSettled(() => {\n if (\n // if we are hydrating from SSR, loading is triggered in ssr-client\n (typeof window !== 'undefined' && router.ssr) ||\n (mountLoadForRouter.router === router && mountLoadForRouter.mounted)\n ) {\n return\n }\n mountLoadForRouter = { router, mounted: true }\n queueMicrotask(() => {\n const tryLoad = async () => {\n try {\n await router.load()\n } catch (err) {\n console.error(err)\n }\n }\n tryLoad()\n })\n })\n Solid.createRenderEffect(\n () =>\n [\n isLoading(),\n isPagePending(),\n isAnyPending(),\n router.stores.location.state,\n router.stores.resolvedLocation.state,\n ] as const,\n (\n [\n currentIsLoading,\n currentIsPagePending,\n currentIsAnyPending,\n loc,\n resolvedLoc,\n ],\n prev,\n ) => {\n // Guard: if location state isn't available yet, skip all event emissions\n if (!loc) return\n\n const previousIsLoading = prev?.[0]\n const previousIsPagePending = prev?.[1]\n const previousIsAnyPending = prev?.[2]\n\n // onLoad: when the router finishes loading\n if (previousIsLoading && !currentIsLoading) {\n router.emit({\n type: 'onLoad',\n ...getLocationChangeInfo(loc, resolvedLoc),\n })\n }\n\n // onBeforeRouteMount: must fire before onResolved\n if (previousIsPagePending && !currentIsPagePending) {\n router.emit({\n type: 'onBeforeRouteMount',\n ...getLocationChangeInfo(loc, resolvedLoc),\n })\n }\n\n // onResolved: fires after onBeforeRouteMount\n if (previousIsAnyPending && !currentIsAnyPending) {\n const changeInfo = getLocationChangeInfo(loc, resolvedLoc)\n router.emit({\n type: 'onResolved',\n ...changeInfo,\n })\n\n Solid.runWithOwner(null, () => {\n router.batch(() => {\n router.stores.status.setState(() => 'idle')\n // Use `loc` from the source tuple to avoid reading\n // router.stores.location.state inside the effect callback\n router.stores.resolvedLocation.setState(() => loc)\n })\n })\n\n if (changeInfo.hrefChanged) {\n // Pass the already-captured location to avoid a reactive read\n // inside the effect callback (handleHashScroll would otherwise\n // read router.stores.location.state which triggers a warning)\n handleHashScrollWithLocation(router, loc)\n }\n }\n },\n )\n\n return null\n}\n"],"mappings":";;;;;;;;;AAUA,SAASK,6BAA6BC,SAAcC,UAA0B;AAC5E,KAAI,OAAOC,aAAa,eAAgBA,SAAiBC,eAAe;EACtE,MAAM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|
2
3
|
/**
|
|
3
4
|
* Build the list of head/link/meta/script tags to render for active matches.
|
|
4
5
|
* Used internally by `HeadContent`.
|
|
5
6
|
*/
|
|
6
|
-
export declare const useTags: () =>
|
|
7
|
+
export declare const useTags: () => Solid.Accessor<RouterManagedTag[]>;
|
|
7
8
|
export declare function uniqBy<T>(arr: Array<T>, fn: (item: T) => string): T[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useRouter } from "./useRouter.js";
|
|
2
|
-
import { useRouterState } from "./useRouterState.js";
|
|
3
2
|
import { escapeHtml } from "@tanstack/router-core";
|
|
4
3
|
import * as Solid from "solid-js";
|
|
5
4
|
//#region src/headContentUtils.tsx
|
|
@@ -10,9 +9,9 @@ import * as Solid from "solid-js";
|
|
|
10
9
|
var useTags = () => {
|
|
11
10
|
const router = useRouter();
|
|
12
11
|
const nonce = router.options.ssr?.nonce;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const getTagKey = (tag) => JSON.stringify(tag);
|
|
13
|
+
const activeMatches = Solid.createMemo(() => router.stores.activeMatchesSnapshot.state);
|
|
14
|
+
const routeMeta = Solid.createMemo(() => activeMatches().map((match) => match.meta).filter(Boolean));
|
|
16
15
|
const meta = Solid.createMemo(() => {
|
|
17
16
|
const resultMeta = [];
|
|
18
17
|
const metaByAttribute = {};
|
|
@@ -61,8 +60,9 @@ var useTags = () => {
|
|
|
61
60
|
resultMeta.reverse();
|
|
62
61
|
return resultMeta;
|
|
63
62
|
});
|
|
64
|
-
const links =
|
|
65
|
-
const
|
|
63
|
+
const links = Solid.createMemo(() => {
|
|
64
|
+
const matches = activeMatches();
|
|
65
|
+
const constructed = matches.map((match) => match.links).filter(Boolean).flat(1).map((link) => ({
|
|
66
66
|
tag: "link",
|
|
67
67
|
attrs: {
|
|
68
68
|
...link,
|
|
@@ -70,7 +70,7 @@ var useTags = () => {
|
|
|
70
70
|
}
|
|
71
71
|
}));
|
|
72
72
|
const manifest = router.ssr?.manifest;
|
|
73
|
-
const assets =
|
|
73
|
+
const assets = matches.map((match) => manifest?.routes[match.routeId]?.assets ?? []).filter(Boolean).flat(1).filter((asset) => asset.tag === "link").map((asset) => ({
|
|
74
74
|
tag: "link",
|
|
75
75
|
attrs: {
|
|
76
76
|
...asset.attrs,
|
|
@@ -78,10 +78,11 @@ var useTags = () => {
|
|
|
78
78
|
}
|
|
79
79
|
}));
|
|
80
80
|
return [...constructed, ...assets];
|
|
81
|
-
}
|
|
82
|
-
const preloadLinks =
|
|
81
|
+
});
|
|
82
|
+
const preloadLinks = Solid.createMemo(() => {
|
|
83
|
+
const matches = activeMatches();
|
|
83
84
|
const preloadLinks = [];
|
|
84
|
-
|
|
85
|
+
matches.map((match) => router.looseRoutesById[match.routeId]).forEach((route) => router.ssr?.manifest?.routes[route.id]?.preloads?.filter(Boolean).forEach((preload) => {
|
|
85
86
|
preloadLinks.push({
|
|
86
87
|
tag: "link",
|
|
87
88
|
attrs: {
|
|
@@ -92,31 +93,33 @@ var useTags = () => {
|
|
|
92
93
|
});
|
|
93
94
|
}));
|
|
94
95
|
return preloadLinks;
|
|
95
|
-
}
|
|
96
|
-
const styles =
|
|
96
|
+
});
|
|
97
|
+
const styles = Solid.createMemo(() => activeMatches().map((match) => match.styles).flat(1).filter(Boolean).map(({ children, ...style }) => ({
|
|
97
98
|
tag: "style",
|
|
98
99
|
attrs: {
|
|
99
100
|
...style,
|
|
100
101
|
nonce
|
|
101
102
|
},
|
|
102
103
|
children
|
|
103
|
-
}))
|
|
104
|
-
const headScripts =
|
|
104
|
+
})));
|
|
105
|
+
const headScripts = Solid.createMemo(() => activeMatches().map((match) => match.headScripts).flat(1).filter(Boolean).map(({ children, ...script }) => ({
|
|
105
106
|
tag: "script",
|
|
106
107
|
attrs: {
|
|
107
108
|
...script,
|
|
108
109
|
nonce
|
|
109
110
|
},
|
|
110
111
|
children
|
|
111
|
-
}))
|
|
112
|
-
return () =>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
})));
|
|
113
|
+
return Solid.createMemo((prev) => {
|
|
114
|
+
const next = uniqBy([
|
|
115
|
+
...meta(),
|
|
116
|
+
...preloadLinks(),
|
|
117
|
+
...links(),
|
|
118
|
+
...styles(),
|
|
119
|
+
...headScripts()
|
|
120
|
+
], getTagKey);
|
|
121
|
+
if (prev && prev.length === next.length && prev.every((tag, index) => getTagKey(tag) === getTagKey(next[index]))) return prev;
|
|
122
|
+
return next;
|
|
120
123
|
});
|
|
121
124
|
};
|
|
122
125
|
function uniqBy(arr, fn) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headContentUtils.js","names":["Solid","escapeHtml","useRouter","
|
|
1
|
+
{"version":3,"file":"headContentUtils.js","names":["Solid","escapeHtml","useRouter","RouterManagedTag","useTags","router","nonce","options","ssr","getTagKey","tag","JSON","stringify","activeMatches","createMemo","stores","activeMatchesSnapshot","state","routeMeta","map","match","meta","filter","Boolean","Accessor","Array","resultMeta","metaByAttribute","Record","title","routeMetasArray","i","length","metas","j","m","children","json","push","attrs","type","attribute","name","property","content","reverse","links","matches","constructed","flat","link","manifest","assets","routes","routeId","asset","preloadLinks","looseRoutesById","forEach","route","id","preloads","preload","rel","href","styles","style","headScripts","script","prev","next","uniqBy","every","index","arr","T","fn","item","seen","Set","key","has","add"],"sources":["../../src/headContentUtils.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { escapeHtml } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type { RouterManagedTag } from '@tanstack/router-core'\n\n/**\n * Build the list of head/link/meta/script tags to render for active matches.\n * Used internally by `HeadContent`.\n */\nexport const useTags = () => {\n const router = useRouter()\n const nonce = router.options.ssr?.nonce\n const getTagKey = (tag: RouterManagedTag) => JSON.stringify(tag)\n const activeMatches = Solid.createMemo(\n () => router.stores.activeMatchesSnapshot.state,\n )\n const routeMeta = Solid.createMemo(() =>\n activeMatches()\n .map((match) => match.meta!)\n .filter(Boolean),\n )\n\n const meta: Solid.Accessor<Array<RouterManagedTag>> = Solid.createMemo(() => {\n const resultMeta: Array<RouterManagedTag> = []\n const metaByAttribute: Record<string, true> = {}\n let title: RouterManagedTag | undefined\n const routeMetasArray = routeMeta()\n for (let i = routeMetasArray.length - 1; i >= 0; i--) {\n const metas = routeMetasArray[i]!\n for (let j = metas.length - 1; j >= 0; j--) {\n const m = metas[j]\n if (!m) continue\n\n if (m.title) {\n if (!title) {\n title = {\n tag: 'title',\n children: m.title,\n }\n }\n } else if ('script:ld+json' in m) {\n // Handle JSON-LD structured data\n // Content is HTML-escaped to prevent XSS when injected via innerHTML\n try {\n const json = JSON.stringify(m['script:ld+json'])\n resultMeta.push({\n tag: 'script',\n attrs: {\n type: 'application/ld+json',\n },\n children: escapeHtml(json),\n })\n } catch {\n // Skip invalid JSON-LD objects\n }\n } else {\n const attribute = m.name ?? m.property\n if (attribute) {\n if (metaByAttribute[attribute]) {\n continue\n } else {\n metaByAttribute[attribute] = true\n }\n }\n\n resultMeta.push({\n tag: 'meta',\n attrs: {\n ...m,\n nonce,\n },\n })\n }\n }\n }\n\n if (title) {\n resultMeta.push(title)\n }\n\n if (router.options.ssr?.nonce) {\n resultMeta.push({\n tag: 'meta',\n attrs: {\n property: 'csp-nonce',\n content: router.options.ssr.nonce,\n },\n })\n }\n resultMeta.reverse()\n\n return resultMeta\n })\n\n const links = Solid.createMemo(() => {\n const matches = activeMatches()\n const constructed = matches\n .map((match) => match.links!)\n .filter(Boolean)\n .flat(1)\n .map((link) => ({\n tag: 'link',\n attrs: {\n ...link,\n nonce,\n },\n })) satisfies Array<RouterManagedTag>\n\n const manifest = router.ssr?.manifest\n\n const assets = matches\n .map((match) => manifest?.routes[match.routeId]?.assets ?? [])\n .filter(Boolean)\n .flat(1)\n .filter((asset) => asset.tag === 'link')\n .map(\n (asset) =>\n ({\n tag: 'link',\n attrs: { ...asset.attrs, nonce },\n }) satisfies RouterManagedTag,\n )\n\n return [...constructed, ...assets]\n })\n\n const preloadLinks = Solid.createMemo(() => {\n const matches = activeMatches()\n const preloadLinks: Array<RouterManagedTag> = []\n\n matches\n .map((match) => router.looseRoutesById[match.routeId]!)\n .forEach((route) =>\n router.ssr?.manifest?.routes[route.id]?.preloads\n ?.filter(Boolean)\n .forEach((preload) => {\n preloadLinks.push({\n tag: 'link',\n attrs: {\n rel: 'modulepreload',\n href: preload,\n nonce,\n },\n })\n }),\n )\n\n return preloadLinks\n })\n\n const styles = Solid.createMemo(() =>\n (\n activeMatches()\n .map((match) => match.styles!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(({ children, ...style }) => ({\n tag: 'style',\n attrs: {\n ...style,\n nonce,\n },\n children,\n })),\n )\n\n const headScripts = Solid.createMemo(() =>\n (\n activeMatches()\n .map((match) => match.headScripts!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(({ children, ...script }) => ({\n tag: 'script',\n attrs: {\n ...script,\n nonce,\n },\n children,\n })),\n )\n\n return Solid.createMemo((prev: Array<RouterManagedTag> | undefined) => {\n const next = uniqBy(\n [\n ...meta(),\n ...preloadLinks(),\n ...links(),\n ...styles(),\n ...headScripts(),\n ] as Array<RouterManagedTag>,\n getTagKey,\n )\n\n if (\n prev &&\n prev.length === next.length &&\n prev.every((tag, index) => getTagKey(tag) === getTagKey(next[index]!))\n ) {\n return prev\n }\n\n return next\n })\n}\n\nexport function uniqBy<T>(arr: Array<T>, fn: (item: T) => string) {\n const seen = new Set<string>()\n return arr.filter((item) => {\n const key = fn(item)\n if (seen.has(key)) {\n return false\n }\n seen.add(key)\n return true\n })\n}\n"],"mappings":";;;;;;;;AASA,IAAaI,gBAAgB;CAC3B,MAAMC,SAASH,WAAW;CAC1B,MAAMI,QAAQD,OAAOE,QAAQC,KAAKF;CAClC,MAAMG,aAAaC,QAA0BC,KAAKC,UAAUF,IAAI;CAChE,MAAMG,gBAAgBb,MAAMc,iBACpB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,MAAM+B,cAAcnE,MAAMc,iBAEtBD,eAAe,CACZM,KAAKC,UAAUA,MAAM+C,YAAa,CAClClB,KAAK,EAAE,CACP3B,OAAOC,QAAQ,CAClBJ,KAAK,EAAEiB,UAAU,GAAGgC,cAAc;EAClC1D,KAAK;EACL6B,OAAO;GACL,GAAG6B;GACH9D;GACD;EACD8B;EACD,EACH,CAAC;AAED,QAAOpC,MAAMc,YAAYuD,SAA8C;EACrE,MAAMC,OAAOC,OACX;GACE,GAAGlD,MAAM;GACT,GAAGmC,cAAc;GACjB,GAAGV,OAAO;GACV,GAAGmB,QAAQ;GACX,GAAGE,aAAa;GACjB,EACD1D,UACD;AAED,MACE4D,QACAA,KAAKrC,WAAWsC,KAAKtC,UACrBqC,KAAKG,OAAO9D,KAAK+D,UAAUhE,UAAUC,IAAI,KAAKD,UAAU6D,KAAKG,OAAQ,CAAC,CAEtE,QAAOJ;AAGT,SAAOC;GACP;;AAGJ,SAAgBC,OAAUG,KAAeE,IAAyB;CAChE,MAAME,uBAAO,IAAIC,KAAa;AAC9B,QAAOL,IAAIpD,QAAQuD,SAAS;EAC1B,MAAMG,MAAMJ,GAAGC,KAAK;AACpB,MAAIC,KAAKG,IAAID,IAAI,CACf,QAAO;AAETF,OAAKI,IAAIF,IAAI;AACb,SAAO;GACP"}
|
package/dist/esm/index.dev.js
CHANGED
|
@@ -2,7 +2,6 @@ import { Await, useAwaited } from "./awaited.js";
|
|
|
2
2
|
import { CatchBoundary, ErrorComponent } from "./CatchBoundary.js";
|
|
3
3
|
import { ClientOnly, useHydrated } from "./ClientOnly.js";
|
|
4
4
|
import { useRouter } from "./useRouter.js";
|
|
5
|
-
import { useRouterState } from "./useRouterState.js";
|
|
6
5
|
import { Link, createLink, linkOptions, useLinkProps } from "./link.js";
|
|
7
6
|
import { useMatch } from "./useMatch.js";
|
|
8
7
|
import { useLoaderData } from "./useLoaderData.js";
|
|
@@ -22,6 +21,7 @@ import { Router, createRouter } from "./router.js";
|
|
|
22
21
|
import { RouterContextProvider, RouterProvider } from "./RouterProvider.js";
|
|
23
22
|
import { ScrollRestoration, useElementScrollRestoration } from "./ScrollRestoration.js";
|
|
24
23
|
import { Block, useBlocker } from "./useBlocker.js";
|
|
24
|
+
import { useRouterState } from "./useRouterState.js";
|
|
25
25
|
import { useLocation } from "./useLocation.js";
|
|
26
26
|
import { useCanGoBack } from "./useCanGoBack.js";
|
|
27
27
|
import { Asset } from "./Asset.js";
|
package/dist/esm/index.js
CHANGED
|
@@ -2,7 +2,6 @@ import { Await, useAwaited } from "./awaited.js";
|
|
|
2
2
|
import { CatchBoundary, ErrorComponent } from "./CatchBoundary.js";
|
|
3
3
|
import { ClientOnly, useHydrated } from "./ClientOnly.js";
|
|
4
4
|
import { useRouter } from "./useRouter.js";
|
|
5
|
-
import { useRouterState } from "./useRouterState.js";
|
|
6
5
|
import { Link, createLink, linkOptions, useLinkProps } from "./link.js";
|
|
7
6
|
import { useMatch } from "./useMatch.js";
|
|
8
7
|
import { useLoaderData } from "./useLoaderData.js";
|
|
@@ -22,6 +21,7 @@ import { Router, createRouter } from "./router.js";
|
|
|
22
21
|
import { RouterContextProvider, RouterProvider } from "./RouterProvider.js";
|
|
23
22
|
import { ScrollRestoration, useElementScrollRestoration } from "./ScrollRestoration.js";
|
|
24
23
|
import { Block, useBlocker } from "./useBlocker.js";
|
|
24
|
+
import { useRouterState } from "./useRouterState.js";
|
|
25
25
|
import { useLocation } from "./useLocation.js";
|
|
26
26
|
import { useCanGoBack } from "./useCanGoBack.js";
|
|
27
27
|
import { Asset } from "./Asset.js";
|