@octanejs/tanstack-router 0.1.53 → 0.1.55
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/package.json +6 -6
- package/src/Match.tsrx +3 -3
- package/src/Matches.tsrx +3 -3
- package/src/RouterProvider.tsrx +2 -2
- package/src/headContentUtils.ts +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/tanstack-router",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.55",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -58,16 +58,16 @@
|
|
|
58
58
|
"isbot": "^5.1.22"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"octane": "^0.1.51 || ^0.2.0"
|
|
61
|
+
"octane": "^0.1.51 || ^0.2.0 || ^0.3.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@tanstack/react-router": "1.170.18",
|
|
65
|
-
"@tsrx/react": "^0.
|
|
65
|
+
"@tsrx/react": "^0.3.0",
|
|
66
66
|
"esbuild": "^0.28.1",
|
|
67
|
-
"react": "
|
|
68
|
-
"react-dom": "
|
|
67
|
+
"react": "19.2.7",
|
|
68
|
+
"react-dom": "19.2.7",
|
|
69
69
|
"vitest": "^4.1.10",
|
|
70
|
-
"octane": "0.
|
|
70
|
+
"octane": "0.3.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"test": "vitest run"
|
package/src/Match.tsrx
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
import type { NotFoundError, ParsedLocation, RootRouteOptions } from '@tanstack/router-core';
|
|
28
28
|
import type { ErrorInfo, ErrorRouteComponent } from './route.ts';
|
|
29
29
|
import { useStore } from './useStore.ts';
|
|
30
|
-
import { useRouter, matchContext } from './context.ts';
|
|
30
|
+
import { useRouter, matchContext as MatchContext } from './context.ts';
|
|
31
31
|
import { Outlet } from './Outlet.tsrx';
|
|
32
32
|
import { RouteNotFound } from './RouteNotFound.tsrx';
|
|
33
33
|
import { CatchBoundary, ErrorComponent } from './CatchBoundary.tsrx';
|
|
@@ -83,7 +83,7 @@ export function Match(props: { matchId: string }) @{
|
|
|
83
83
|
const parentRouteId = route.parentRoute?.id;
|
|
84
84
|
|
|
85
85
|
<ShellComponent>
|
|
86
|
-
<
|
|
86
|
+
<MatchContext value={props.matchId}>
|
|
87
87
|
<SuspenseWrap fallback={pendingElement}>
|
|
88
88
|
<CatchWrap
|
|
89
89
|
getResetKey={() => resetKey}
|
|
@@ -119,7 +119,7 @@ export function Match(props: { matchId: string }) @{
|
|
|
119
119
|
</NotFoundWrap>
|
|
120
120
|
</CatchWrap>
|
|
121
121
|
</SuspenseWrap>
|
|
122
|
-
</
|
|
122
|
+
</MatchContext>
|
|
123
123
|
@if (parentRouteId === rootRouteId) {
|
|
124
124
|
<>
|
|
125
125
|
<OnRendered />
|
package/src/Matches.tsrx
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { useLayoutEffect, createElement, Suspense } from 'octane';
|
|
14
14
|
import { setupScrollRestoration, rootRouteId } from '@tanstack/router-core';
|
|
15
15
|
import { useStore } from './useStore.ts';
|
|
16
|
-
import { useRouter, matchContext } from './context.ts';
|
|
16
|
+
import { useRouter, matchContext as MatchContext } from './context.ts';
|
|
17
17
|
import { useTransitioner } from './Transitioner.tsrx';
|
|
18
18
|
import { Match } from './Match.tsrx';
|
|
19
19
|
import { CatchBoundary, ErrorComponent } from './CatchBoundary.tsrx';
|
|
@@ -48,11 +48,11 @@ function MatchesInner() @{
|
|
|
48
48
|
const resetKey = useStore(router.stores.loadedAt, (l: any) => l as number | string);
|
|
49
49
|
const CatchWrap = router.options.disableGlobalCatchBoundary ? SafeFragment : CatchBoundary;
|
|
50
50
|
|
|
51
|
-
<
|
|
51
|
+
<MatchContext value={matchId}>
|
|
52
52
|
<CatchWrap getResetKey={() => resetKey} errorComponent={ErrorComponent}>
|
|
53
53
|
@if (matchId) {
|
|
54
54
|
<Match matchId={matchId} />
|
|
55
55
|
}
|
|
56
56
|
</CatchWrap>
|
|
57
|
-
</
|
|
57
|
+
</MatchContext>
|
|
58
58
|
}
|
package/src/RouterProvider.tsrx
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { hasKeys } from '@tanstack/router-core';
|
|
8
8
|
import type { AnyRouter } from '@tanstack/router-core';
|
|
9
9
|
import type { OctaneNode } from 'octane';
|
|
10
|
-
import { routerContext } from './context.ts';
|
|
10
|
+
import { routerContext as RouterContext } from './context.ts';
|
|
11
11
|
import { Matches } from './Matches.tsrx';
|
|
12
12
|
import { SafeFragment } from './SafeFragment.tsrx';
|
|
13
13
|
|
|
@@ -35,7 +35,7 @@ export function RouterContextProvider(props: RouterProps & { children?: OctaneNo
|
|
|
35
35
|
const Wrap = router.options.Wrap ?? SafeFragment;
|
|
36
36
|
|
|
37
37
|
<Wrap>
|
|
38
|
-
<
|
|
38
|
+
<RouterContext value={router}>{children}</RouterContext>
|
|
39
39
|
</Wrap>
|
|
40
40
|
}
|
|
41
41
|
|
package/src/headContentUtils.ts
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
deepEqual,
|
|
4
4
|
escapeHtml,
|
|
5
5
|
getAssetCrossOrigin,
|
|
6
|
-
getScriptPreloadAttrs,
|
|
7
6
|
resolveManifestCssLink,
|
|
8
7
|
} from '@tanstack/router-core';
|
|
9
8
|
import { isServer } from '@tanstack/router-core/isServer';
|
|
@@ -80,7 +79,6 @@ function buildTagsFromMatches(
|
|
|
80
79
|
.map((link) => ({ tag: 'link', attrs: { ...link, nonce } }) satisfies RouterManagedTag);
|
|
81
80
|
|
|
82
81
|
const manifestTags: Array<RouterManagedTag> = [];
|
|
83
|
-
const preloadTags: Array<RouterManagedTag> = [];
|
|
84
82
|
const manifest = router.ssr?.manifest;
|
|
85
83
|
if (manifest) {
|
|
86
84
|
for (const match of matches) {
|
|
@@ -97,15 +95,6 @@ function buildTagsFromMatches(
|
|
|
97
95
|
},
|
|
98
96
|
});
|
|
99
97
|
}
|
|
100
|
-
for (const preload of manifest.routes[match.routeId]?.preloads ?? []) {
|
|
101
|
-
preloadTags.push({
|
|
102
|
-
tag: 'link',
|
|
103
|
-
attrs: {
|
|
104
|
-
...getScriptPreloadAttrs(manifest, preload, assetCrossOrigin),
|
|
105
|
-
nonce,
|
|
106
|
-
},
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
98
|
}
|
|
110
99
|
|
|
111
100
|
if (manifest.inlineStyle) {
|
|
@@ -144,7 +133,6 @@ function buildTagsFromMatches(
|
|
|
144
133
|
|
|
145
134
|
const tags: Array<RouterManagedTag> = [];
|
|
146
135
|
appendUniqueUserTags(tags, resultMeta);
|
|
147
|
-
tags.push(...preloadTags);
|
|
148
136
|
appendUniqueUserTags(tags, links);
|
|
149
137
|
tags.push(...manifestTags);
|
|
150
138
|
appendUniqueUserTags(tags, styles);
|