@tanstack/start-server-core 1.133.25 → 1.133.27
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RouterManagedTag } from '@tanstack/router-core';
|
|
1
2
|
/**
|
|
2
3
|
* @description Returns the router manifest that should be sent to the client.
|
|
3
4
|
* This includes only the assets and preloads for the current route and any
|
|
@@ -7,8 +8,8 @@
|
|
|
7
8
|
export declare function getStartManifest(): Promise<{
|
|
8
9
|
routes: {
|
|
9
10
|
[k: string]: {
|
|
10
|
-
preloads
|
|
11
|
-
assets
|
|
11
|
+
preloads?: Array<string>;
|
|
12
|
+
assets?: Array<RouterManagedTag>;
|
|
12
13
|
};
|
|
13
14
|
};
|
|
14
15
|
clientEntry: string;
|
|
@@ -31,13 +31,14 @@ async function getStartManifest() {
|
|
|
31
31
|
routes: Object.fromEntries(
|
|
32
32
|
Object.entries(startManifest.routes).map(([k, v]) => {
|
|
33
33
|
const { preloads, assets } = v;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
const result = {};
|
|
35
|
+
if (preloads) {
|
|
36
|
+
result["preloads"] = preloads;
|
|
37
|
+
}
|
|
38
|
+
if (assets) {
|
|
39
|
+
result["assets"] = assets;
|
|
40
|
+
}
|
|
41
|
+
return [k, result];
|
|
41
42
|
})
|
|
42
43
|
)
|
|
43
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-manifest.js","sources":["../../src/router-manifest.ts"],"sourcesContent":["import { rootRouteId } from '@tanstack/router-core'\nimport { VIRTUAL_MODULES } from './virtual-modules'\nimport { loadVirtualModule } from './loadVirtualModule'\n\n/**\n * @description Returns the router manifest that should be sent to the client.\n * This includes only the assets and preloads for the current route and any\n * special assets that are needed for the client. It does not include relationships\n * between routes or any other data that is not needed for the client.\n */\nexport async function getStartManifest() {\n const { tsrStartManifest } = await loadVirtualModule(\n VIRTUAL_MODULES.startManifest,\n )\n const startManifest = tsrStartManifest()\n\n const rootRoute = (startManifest.routes[rootRouteId] =\n startManifest.routes[rootRouteId] || {})\n\n rootRoute.assets = rootRoute.assets || []\n\n let script = `import('${startManifest.clientEntry}')`\n if (process.env.TSS_DEV_SERVER === 'true') {\n const { injectedHeadScripts } = await loadVirtualModule(\n VIRTUAL_MODULES.injectedHeadScripts,\n )\n if (injectedHeadScripts) {\n script = `${injectedHeadScripts + ';'}${script}`\n }\n }\n rootRoute.assets.push({\n tag: 'script',\n attrs: {\n type: 'module',\n suppressHydrationWarning: true,\n async: true,\n },\n children: script,\n })\n\n const manifest = {\n ...startManifest,\n routes: Object.fromEntries(\n Object.entries(startManifest.routes).map(([k, v]) => {\n const { preloads, assets } = v\n
|
|
1
|
+
{"version":3,"file":"router-manifest.js","sources":["../../src/router-manifest.ts"],"sourcesContent":["import { rootRouteId } from '@tanstack/router-core'\nimport { VIRTUAL_MODULES } from './virtual-modules'\nimport { loadVirtualModule } from './loadVirtualModule'\nimport type { RouterManagedTag } from '@tanstack/router-core'\n\n/**\n * @description Returns the router manifest that should be sent to the client.\n * This includes only the assets and preloads for the current route and any\n * special assets that are needed for the client. It does not include relationships\n * between routes or any other data that is not needed for the client.\n */\nexport async function getStartManifest() {\n const { tsrStartManifest } = await loadVirtualModule(\n VIRTUAL_MODULES.startManifest,\n )\n const startManifest = tsrStartManifest()\n\n const rootRoute = (startManifest.routes[rootRouteId] =\n startManifest.routes[rootRouteId] || {})\n\n rootRoute.assets = rootRoute.assets || []\n\n let script = `import('${startManifest.clientEntry}')`\n if (process.env.TSS_DEV_SERVER === 'true') {\n const { injectedHeadScripts } = await loadVirtualModule(\n VIRTUAL_MODULES.injectedHeadScripts,\n )\n if (injectedHeadScripts) {\n script = `${injectedHeadScripts + ';'}${script}`\n }\n }\n rootRoute.assets.push({\n tag: 'script',\n attrs: {\n type: 'module',\n suppressHydrationWarning: true,\n async: true,\n },\n children: script,\n })\n\n const manifest = {\n ...startManifest,\n routes: Object.fromEntries(\n Object.entries(startManifest.routes).map(([k, v]) => {\n const { preloads, assets } = v\n const result = {} as {\n preloads?: Array<string>\n assets?: Array<RouterManagedTag>\n }\n if (preloads) {\n result['preloads'] = preloads\n }\n if (assets) {\n result['assets'] = assets\n }\n return [k, result]\n }),\n ),\n }\n\n // Strip out anything that isn't needed for the client\n return manifest\n}\n"],"names":[],"mappings":";;;AAWA,eAAsB,mBAAmB;AACvC,QAAM,EAAE,iBAAA,IAAqB,MAAM;AAAA,IACjC,gBAAgB;AAAA,EAAA;AAElB,QAAM,gBAAgB,iBAAA;AAEtB,QAAM,YAAa,cAAc,OAAO,WAAW,IACjD,cAAc,OAAO,WAAW,KAAK,CAAA;AAEvC,YAAU,SAAS,UAAU,UAAU,CAAA;AAEvC,MAAI,SAAS,WAAW,cAAc,WAAW;AACjD,MAAI,QAAQ,IAAI,mBAAmB,QAAQ;AACzC,UAAM,EAAE,oBAAA,IAAwB,MAAM;AAAA,MACpC,gBAAgB;AAAA,IAAA;AAElB,QAAI,qBAAqB;AACvB,eAAS,GAAG,sBAAsB,GAAG,GAAG,MAAM;AAAA,IAChD;AAAA,EACF;AACA,YAAU,OAAO,KAAK;AAAA,IACpB,KAAK;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,0BAA0B;AAAA,MAC1B,OAAO;AAAA,IAAA;AAAA,IAET,UAAU;AAAA,EAAA,CACX;AAED,QAAM,WAAW;AAAA,IACf,GAAG;AAAA,IACH,QAAQ,OAAO;AAAA,MACb,OAAO,QAAQ,cAAc,MAAM,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM;AACnD,cAAM,EAAE,UAAU,OAAA,IAAW;AAC7B,cAAM,SAAS,CAAA;AAIf,YAAI,UAAU;AACZ,iBAAO,UAAU,IAAI;AAAA,QACvB;AACA,YAAI,QAAQ;AACV,iBAAO,QAAQ,IAAI;AAAA,QACrB;AACA,eAAO,CAAC,GAAG,MAAM;AAAA,MACnB,CAAC;AAAA,IAAA;AAAA,EACH;AAIF,SAAO;AACT;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/start-server-core",
|
|
3
|
-
"version": "1.133.
|
|
3
|
+
"version": "1.133.27",
|
|
4
4
|
"description": "Modern and scalable routing for React applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"h3-v2": "npm:h3@2.0.0-beta.4",
|
|
58
58
|
"seroval": "^1.3.2",
|
|
59
59
|
"tiny-invariant": "^1.3.3",
|
|
60
|
-
"@tanstack/
|
|
61
|
-
"@tanstack/
|
|
62
|
-
"@tanstack/start-storage-context": "1.133.
|
|
63
|
-
"@tanstack/
|
|
60
|
+
"@tanstack/history": "1.133.19",
|
|
61
|
+
"@tanstack/router-core": "1.133.27",
|
|
62
|
+
"@tanstack/start-storage-context": "1.133.27",
|
|
63
|
+
"@tanstack/start-client-core": "1.133.27"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@standard-schema/spec": "^1.0.0",
|
package/src/router-manifest.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { rootRouteId } from '@tanstack/router-core'
|
|
2
2
|
import { VIRTUAL_MODULES } from './virtual-modules'
|
|
3
3
|
import { loadVirtualModule } from './loadVirtualModule'
|
|
4
|
+
import type { RouterManagedTag } from '@tanstack/router-core'
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* @description Returns the router manifest that should be sent to the client.
|
|
@@ -43,13 +44,17 @@ export async function getStartManifest() {
|
|
|
43
44
|
routes: Object.fromEntries(
|
|
44
45
|
Object.entries(startManifest.routes).map(([k, v]) => {
|
|
45
46
|
const { preloads, assets } = v
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
const result = {} as {
|
|
48
|
+
preloads?: Array<string>
|
|
49
|
+
assets?: Array<RouterManagedTag>
|
|
50
|
+
}
|
|
51
|
+
if (preloads) {
|
|
52
|
+
result['preloads'] = preloads
|
|
53
|
+
}
|
|
54
|
+
if (assets) {
|
|
55
|
+
result['assets'] = assets
|
|
56
|
+
}
|
|
57
|
+
return [k, result]
|
|
53
58
|
}),
|
|
54
59
|
),
|
|
55
60
|
}
|