@octanejs/tanstack-router 0.1.56 → 0.1.57
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 +2 -2
- package/src/headContentUtils.ts +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/tanstack-router",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.57",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"react": "19.2.7",
|
|
68
68
|
"react-dom": "19.2.7",
|
|
69
69
|
"vitest": "^4.1.10",
|
|
70
|
-
"octane": "0.4.
|
|
70
|
+
"octane": "0.4.3"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"test": "vitest run"
|
package/src/headContentUtils.ts
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
deepEqual,
|
|
4
4
|
escapeHtml,
|
|
5
5
|
getAssetCrossOrigin,
|
|
6
|
+
getScriptPreloadAttrs,
|
|
6
7
|
resolveManifestCssLink,
|
|
7
8
|
} from '@tanstack/router-core';
|
|
8
9
|
import { isServer } from '@tanstack/router-core/isServer';
|
|
@@ -79,6 +80,7 @@ function buildTagsFromMatches(
|
|
|
79
80
|
.map((link) => ({ tag: 'link', attrs: { ...link, nonce } }) satisfies RouterManagedTag);
|
|
80
81
|
|
|
81
82
|
const manifestTags: Array<RouterManagedTag> = [];
|
|
83
|
+
const preloadTags: Array<RouterManagedTag> = [];
|
|
82
84
|
const manifest = router.ssr?.manifest;
|
|
83
85
|
if (manifest) {
|
|
84
86
|
for (const match of matches) {
|
|
@@ -95,6 +97,15 @@ function buildTagsFromMatches(
|
|
|
95
97
|
},
|
|
96
98
|
});
|
|
97
99
|
}
|
|
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
|
+
}
|
|
98
109
|
}
|
|
99
110
|
|
|
100
111
|
if (manifest.inlineStyle) {
|
|
@@ -133,6 +144,7 @@ function buildTagsFromMatches(
|
|
|
133
144
|
|
|
134
145
|
const tags: Array<RouterManagedTag> = [];
|
|
135
146
|
appendUniqueUserTags(tags, resultMeta);
|
|
147
|
+
tags.push(...preloadTags);
|
|
136
148
|
appendUniqueUserTags(tags, links);
|
|
137
149
|
tags.push(...manifestTags);
|
|
138
150
|
appendUniqueUserTags(tags, styles);
|