@tanstack/vue-start-client 1.166.9 → 1.166.11
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/StartClient.js +19 -22
- package/dist/esm/StartClient.js.map +1 -1
- package/dist/esm/hydrateStart.js +56 -39
- package/dist/esm/hydrateStart.js.map +1 -1
- package/dist/esm/index.js +1 -6
- package/package.json +4 -4
- package/dist/esm/index.js.map +0 -1
package/dist/esm/StartClient.js
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
import * as Vue from "vue";
|
|
2
2
|
import { createVNode } from "vue";
|
|
3
3
|
import { RouterProvider } from "@tanstack/vue-router";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"router": props.router
|
|
20
|
-
}, null);
|
|
21
|
-
}
|
|
4
|
+
//#region src/StartClient.tsx
|
|
5
|
+
var StartClient = Vue.defineComponent({
|
|
6
|
+
name: "StartClient",
|
|
7
|
+
props: { router: {
|
|
8
|
+
type: Object,
|
|
9
|
+
required: true
|
|
10
|
+
} },
|
|
11
|
+
setup(props) {
|
|
12
|
+
Vue.onMounted(() => {
|
|
13
|
+
Vue.nextTick(() => {
|
|
14
|
+
window.$_TSR?.h();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
return () => createVNode(RouterProvider, { "router": props.router }, null);
|
|
18
|
+
}
|
|
22
19
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
//# sourceMappingURL=StartClient.js.map
|
|
20
|
+
//#endregion
|
|
21
|
+
export { StartClient };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=StartClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StartClient.js","sources":["../../src/StartClient.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport { RouterProvider } from '@tanstack/vue-router'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nexport const StartClient = Vue.defineComponent({\n name: 'StartClient',\n props: {\n router: {\n type: Object as () => AnyRouter,\n required: true,\n },\n },\n setup(props) {\n // After Vue hydration is complete, signal that router hydration is complete so cleanup can happen if stream has ended\n // Use nextTick to ensure all child component onMounted hooks have completed\n // This prevents the cleanup to happen before components have finished transitioning\n Vue.onMounted(() => {\n Vue.nextTick(() => {\n window.$_TSR?.h()\n })\n })\n\n return () => <RouterProvider router={props.router} />\n },\n})\n"],"
|
|
1
|
+
{"version":3,"file":"StartClient.js","names":["Vue","RouterProvider","StartClient","defineComponent","name","props","router","type","Object","required","setup","onMounted","nextTick","window","$_TSR","h","_createVNode"],"sources":["../../src/StartClient.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport { RouterProvider } from '@tanstack/vue-router'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nexport const StartClient = Vue.defineComponent({\n name: 'StartClient',\n props: {\n router: {\n type: Object as () => AnyRouter,\n required: true,\n },\n },\n setup(props) {\n // After Vue hydration is complete, signal that router hydration is complete so cleanup can happen if stream has ended\n // Use nextTick to ensure all child component onMounted hooks have completed\n // This prevents the cleanup to happen before components have finished transitioning\n Vue.onMounted(() => {\n Vue.nextTick(() => {\n window.$_TSR?.h()\n })\n })\n\n return () => <RouterProvider router={props.router} />\n },\n})\n"],"mappings":";;;;AAIA,IAAaE,cAAcF,IAAIG,gBAAgB;CAC7CC,MAAM;CACNC,OAAO,EACLC,QAAQ;EACNC,MAAMC;EACNC,UAAU;EACZ,EACD;CACDC,MAAML,OAAO;AAIXL,MAAIW,gBAAgB;AAClBX,OAAIY,eAAe;AACjBC,WAAOC,OAAOC,GAAG;KACjB;IACF;AAEF,eAAOC,YAAAf,gBAAA,EAAA,UAA8BI,MAAMC,QAAM,EAAA,KAAI;;CAExD,CAAC"}
|
package/dist/esm/hydrateStart.js
CHANGED
|
@@ -1,44 +1,61 @@
|
|
|
1
|
-
import { hydrateStart
|
|
1
|
+
import { hydrateStart } from "@tanstack/start-client-core/client";
|
|
2
|
+
//#region src/hydrateStart.ts
|
|
3
|
+
/**
|
|
4
|
+
* Suppress expected hydration mismatch warnings for routes with ssr: 'data-only' or ssr: false
|
|
5
|
+
* These routes intentionally render different content on server vs client.
|
|
6
|
+
*
|
|
7
|
+
* Note: We always suppress hydration warnings in Vue Start apps because:
|
|
8
|
+
* 1. Routes with ssr: 'data-only' or ssr: false cause expected mismatches
|
|
9
|
+
* 2. The ssr option is not reliably accessible from route.options for file-based routes
|
|
10
|
+
* 3. DevTools components also cause expected mismatches in development
|
|
11
|
+
* 4. In production builds, Vue strips these warnings anyway
|
|
12
|
+
*/
|
|
2
13
|
function suppressSsrHydrationMismatches(_router) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
console.error = (...args) => {
|
|
21
|
-
if (isHydrationMismatchMessage(args)) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
originalError.apply(console, args);
|
|
25
|
-
};
|
|
14
|
+
const originalWarn = console.warn;
|
|
15
|
+
const originalError = console.error;
|
|
16
|
+
const isHydrationMismatchMessage = (args) => {
|
|
17
|
+
for (const arg of args) {
|
|
18
|
+
if (typeof arg !== "string") continue;
|
|
19
|
+
if (arg.includes("Hydration completed but contains mismatches") || arg.includes("Hydration node mismatch") || arg.includes("Hydration text mismatch") || arg.includes("Hydration children mismatch") || arg.includes("Hydration class mismatch") || arg.includes("Hydration style mismatch") || arg.includes("Hydration attribute mismatch")) return true;
|
|
20
|
+
}
|
|
21
|
+
return false;
|
|
22
|
+
};
|
|
23
|
+
console.warn = (...args) => {
|
|
24
|
+
if (isHydrationMismatchMessage(args)) return;
|
|
25
|
+
originalWarn.apply(console, args);
|
|
26
|
+
};
|
|
27
|
+
console.error = (...args) => {
|
|
28
|
+
if (isHydrationMismatchMessage(args)) return;
|
|
29
|
+
originalError.apply(console, args);
|
|
30
|
+
};
|
|
26
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Configure a Vue app to suppress expected hydration mismatch warnings
|
|
34
|
+
* for routes with ssr: false or ssr: 'data-only'
|
|
35
|
+
* Call this after createSSRApp and before app.mount()
|
|
36
|
+
*
|
|
37
|
+
* Note: We always suppress hydration warnings in Vue Start apps because:
|
|
38
|
+
* 1. Routes with ssr: 'data-only' or ssr: false cause expected mismatches
|
|
39
|
+
* 2. The ssr option is not reliably accessible from route.options for file-based routes
|
|
40
|
+
* 3. DevTools components also cause expected mismatches in development
|
|
41
|
+
* 4. In production builds, Vue strips these warnings anyway
|
|
42
|
+
*/
|
|
27
43
|
function configureHydrationSuppressions(app, _router) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
console.warn(`[Vue warn]: ${msg}`);
|
|
33
|
-
};
|
|
44
|
+
app.config.warnHandler = (msg, _instance, _trace) => {
|
|
45
|
+
if (msg.includes("Hydration node mismatch") || msg.includes("Hydration text mismatch") || msg.includes("Hydration children mismatch") || msg.includes("Hydration class mismatch") || msg.includes("Hydration style mismatch") || msg.includes("Hydration attribute mismatch")) return;
|
|
46
|
+
console.warn(`[Vue warn]: ${msg}`);
|
|
47
|
+
};
|
|
34
48
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Vue-specific wrapper for hydrateStart that installs hydration mismatch
|
|
51
|
+
* suppression for routes with ssr: false or ssr: 'data-only' before returning
|
|
52
|
+
*/
|
|
53
|
+
async function hydrateStart$1() {
|
|
54
|
+
const router = await hydrateStart();
|
|
55
|
+
suppressSsrHydrationMismatches(router);
|
|
56
|
+
return router;
|
|
39
57
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
//# sourceMappingURL=hydrateStart.js.map
|
|
58
|
+
//#endregion
|
|
59
|
+
export { configureHydrationSuppressions, hydrateStart$1 as hydrateStart };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=hydrateStart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydrateStart.js","sources":["../../src/hydrateStart.ts"],"sourcesContent":["import { hydrateStart as coreHydrateStart } from '@tanstack/start-client-core/client'\nimport type { AnyRouter } from '@tanstack/router-core'\nimport type { App } from 'vue'\n\n/**\n * Suppress expected hydration mismatch warnings for routes with ssr: 'data-only' or ssr: false\n * These routes intentionally render different content on server vs client.\n *\n * Note: We always suppress hydration warnings in Vue Start apps because:\n * 1. Routes with ssr: 'data-only' or ssr: false cause expected mismatches\n * 2. The ssr option is not reliably accessible from route.options for file-based routes\n * 3. DevTools components also cause expected mismatches in development\n * 4. In production builds, Vue strips these warnings anyway\n */\nfunction suppressSsrHydrationMismatches(_router: AnyRouter): void {\n const originalWarn = console.warn\n const originalError = console.error\n\n const isHydrationMismatchMessage = (args: Array<unknown>): boolean => {\n // Check all args since Vue may pass message in different positions\n for (const arg of args) {\n if (typeof arg !== 'string') continue\n if (\n arg.includes('Hydration completed but contains mismatches') ||\n arg.includes('Hydration node mismatch') ||\n arg.includes('Hydration text mismatch') ||\n arg.includes('Hydration children mismatch') ||\n arg.includes('Hydration class mismatch') ||\n arg.includes('Hydration style mismatch') ||\n arg.includes('Hydration attribute mismatch')\n ) {\n return true\n }\n }\n return false\n }\n\n console.warn = (...args) => {\n if (isHydrationMismatchMessage(args)) {\n return // Suppress hydration warnings\n }\n originalWarn.apply(console, args)\n }\n\n console.error = (...args) => {\n if (isHydrationMismatchMessage(args)) {\n return // Suppress hydration warnings\n }\n originalError.apply(console, args)\n }\n}\n\n/**\n * Configure a Vue app to suppress expected hydration mismatch warnings\n * for routes with ssr: false or ssr: 'data-only'\n * Call this after createSSRApp and before app.mount()\n *\n * Note: We always suppress hydration warnings in Vue Start apps because:\n * 1. Routes with ssr: 'data-only' or ssr: false cause expected mismatches\n * 2. The ssr option is not reliably accessible from route.options for file-based routes\n * 3. DevTools components also cause expected mismatches in development\n * 4. In production builds, Vue strips these warnings anyway\n */\nexport function configureHydrationSuppressions(\n app: App,\n _router: AnyRouter,\n): void {\n // Always install the warnHandler to suppress hydration warnings\n // Vue's app.config.warnHandler intercepts dev warnings BEFORE console.warn\n app.config.warnHandler = (msg, _instance, _trace) => {\n // Suppress hydration mismatch warnings\n if (\n msg.includes('Hydration node mismatch') ||\n msg.includes('Hydration text mismatch') ||\n msg.includes('Hydration children mismatch') ||\n msg.includes('Hydration class mismatch') ||\n msg.includes('Hydration style mismatch') ||\n msg.includes('Hydration attribute mismatch')\n ) {\n return // Suppress the warning\n }\n // Let other warnings through to console\n console.warn(`[Vue warn]: ${msg}`)\n }\n}\n\n/**\n * Vue-specific wrapper for hydrateStart that installs hydration mismatch\n * suppression for routes with ssr: false or ssr: 'data-only' before returning\n */\nexport async function hydrateStart(): Promise<AnyRouter> {\n const router = await coreHydrateStart()\n // Install console suppression before app.mount() is called\n // This catches the \"Hydration completed but contains mismatches\" error\n suppressSsrHydrationMismatches(router)\n return router\n}\n"],"
|
|
1
|
+
{"version":3,"file":"hydrateStart.js","names":[],"sources":["../../src/hydrateStart.ts"],"sourcesContent":["import { hydrateStart as coreHydrateStart } from '@tanstack/start-client-core/client'\nimport type { AnyRouter } from '@tanstack/router-core'\nimport type { App } from 'vue'\n\n/**\n * Suppress expected hydration mismatch warnings for routes with ssr: 'data-only' or ssr: false\n * These routes intentionally render different content on server vs client.\n *\n * Note: We always suppress hydration warnings in Vue Start apps because:\n * 1. Routes with ssr: 'data-only' or ssr: false cause expected mismatches\n * 2. The ssr option is not reliably accessible from route.options for file-based routes\n * 3. DevTools components also cause expected mismatches in development\n * 4. In production builds, Vue strips these warnings anyway\n */\nfunction suppressSsrHydrationMismatches(_router: AnyRouter): void {\n const originalWarn = console.warn\n const originalError = console.error\n\n const isHydrationMismatchMessage = (args: Array<unknown>): boolean => {\n // Check all args since Vue may pass message in different positions\n for (const arg of args) {\n if (typeof arg !== 'string') continue\n if (\n arg.includes('Hydration completed but contains mismatches') ||\n arg.includes('Hydration node mismatch') ||\n arg.includes('Hydration text mismatch') ||\n arg.includes('Hydration children mismatch') ||\n arg.includes('Hydration class mismatch') ||\n arg.includes('Hydration style mismatch') ||\n arg.includes('Hydration attribute mismatch')\n ) {\n return true\n }\n }\n return false\n }\n\n console.warn = (...args) => {\n if (isHydrationMismatchMessage(args)) {\n return // Suppress hydration warnings\n }\n originalWarn.apply(console, args)\n }\n\n console.error = (...args) => {\n if (isHydrationMismatchMessage(args)) {\n return // Suppress hydration warnings\n }\n originalError.apply(console, args)\n }\n}\n\n/**\n * Configure a Vue app to suppress expected hydration mismatch warnings\n * for routes with ssr: false or ssr: 'data-only'\n * Call this after createSSRApp and before app.mount()\n *\n * Note: We always suppress hydration warnings in Vue Start apps because:\n * 1. Routes with ssr: 'data-only' or ssr: false cause expected mismatches\n * 2. The ssr option is not reliably accessible from route.options for file-based routes\n * 3. DevTools components also cause expected mismatches in development\n * 4. In production builds, Vue strips these warnings anyway\n */\nexport function configureHydrationSuppressions(\n app: App,\n _router: AnyRouter,\n): void {\n // Always install the warnHandler to suppress hydration warnings\n // Vue's app.config.warnHandler intercepts dev warnings BEFORE console.warn\n app.config.warnHandler = (msg, _instance, _trace) => {\n // Suppress hydration mismatch warnings\n if (\n msg.includes('Hydration node mismatch') ||\n msg.includes('Hydration text mismatch') ||\n msg.includes('Hydration children mismatch') ||\n msg.includes('Hydration class mismatch') ||\n msg.includes('Hydration style mismatch') ||\n msg.includes('Hydration attribute mismatch')\n ) {\n return // Suppress the warning\n }\n // Let other warnings through to console\n console.warn(`[Vue warn]: ${msg}`)\n }\n}\n\n/**\n * Vue-specific wrapper for hydrateStart that installs hydration mismatch\n * suppression for routes with ssr: false or ssr: 'data-only' before returning\n */\nexport async function hydrateStart(): Promise<AnyRouter> {\n const router = await coreHydrateStart()\n // Install console suppression before app.mount() is called\n // This catches the \"Hydration completed but contains mismatches\" error\n suppressSsrHydrationMismatches(router)\n return router\n}\n"],"mappings":";;;;;;;;;;;;AAcA,SAAS,+BAA+B,SAA0B;CAChE,MAAM,eAAe,QAAQ;CAC7B,MAAM,gBAAgB,QAAQ;CAE9B,MAAM,8BAA8B,SAAkC;AAEpE,OAAK,MAAM,OAAO,MAAM;AACtB,OAAI,OAAO,QAAQ,SAAU;AAC7B,OACE,IAAI,SAAS,8CAA8C,IAC3D,IAAI,SAAS,0BAA0B,IACvC,IAAI,SAAS,0BAA0B,IACvC,IAAI,SAAS,8BAA8B,IAC3C,IAAI,SAAS,2BAA2B,IACxC,IAAI,SAAS,2BAA2B,IACxC,IAAI,SAAS,+BAA+B,CAE5C,QAAO;;AAGX,SAAO;;AAGT,SAAQ,QAAQ,GAAG,SAAS;AAC1B,MAAI,2BAA2B,KAAK,CAClC;AAEF,eAAa,MAAM,SAAS,KAAK;;AAGnC,SAAQ,SAAS,GAAG,SAAS;AAC3B,MAAI,2BAA2B,KAAK,CAClC;AAEF,gBAAc,MAAM,SAAS,KAAK;;;;;;;;;;;;;;AAetC,SAAgB,+BACd,KACA,SACM;AAGN,KAAI,OAAO,eAAe,KAAK,WAAW,WAAW;AAEnD,MACE,IAAI,SAAS,0BAA0B,IACvC,IAAI,SAAS,0BAA0B,IACvC,IAAI,SAAS,8BAA8B,IAC3C,IAAI,SAAS,2BAA2B,IACxC,IAAI,SAAS,2BAA2B,IACxC,IAAI,SAAS,+BAA+B,CAE5C;AAGF,UAAQ,KAAK,eAAe,MAAM;;;;;;;AAQtC,eAAsB,iBAAmC;CACvD,MAAM,SAAS,MAAM,cAAkB;AAGvC,gCAA+B,OAAO;AACtC,QAAO"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import { StartClient } from "./StartClient.js";
|
|
2
2
|
import { configureHydrationSuppressions, hydrateStart } from "./hydrateStart.js";
|
|
3
|
-
export {
|
|
4
|
-
StartClient,
|
|
5
|
-
configureHydrationSuppressions,
|
|
6
|
-
hydrateStart
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
3
|
+
export { StartClient, configureHydrationSuppressions, hydrateStart };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/vue-start-client",
|
|
3
|
-
"version": "1.166.
|
|
3
|
+
"version": "1.166.11",
|
|
4
4
|
"description": "Modern and scalable routing for Vue applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"tiny-invariant": "^1.3.3",
|
|
47
47
|
"tiny-warning": "^1.0.3",
|
|
48
|
-
"@tanstack/router-core": "1.167.
|
|
49
|
-
"@tanstack/vue-router": "1.167.
|
|
50
|
-
"@tanstack/start-client-core": "1.166.
|
|
48
|
+
"@tanstack/router-core": "1.167.3",
|
|
49
|
+
"@tanstack/vue-router": "1.167.3",
|
|
50
|
+
"@tanstack/start-client-core": "1.166.11"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@testing-library/vue": "^8.1.0",
|
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|