@tanstack/vue-router-ssr-query 1.140.5 → 1.141.0
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/index.js +16 -21
- package/dist/esm/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.tsx +14 -22
package/dist/esm/index.js
CHANGED
|
@@ -6,28 +6,23 @@ function setupRouterSsrQueryIntegration(opts) {
|
|
|
6
6
|
if (opts.wrapQueryClient === false) {
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
9
|
-
const OGWrap = opts.router.options.Wrap
|
|
10
|
-
opts.router.options.Wrap = (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
const OGWrap = opts.router.options.Wrap;
|
|
10
|
+
opts.router.options.Wrap = Vue.defineComponent({
|
|
11
|
+
name: "QueryClientWrapper",
|
|
12
|
+
setup(_, {
|
|
13
|
+
slots
|
|
14
|
+
}) {
|
|
15
|
+
Vue.provide(VUE_QUERY_CLIENT, opts.queryClient);
|
|
16
|
+
return () => {
|
|
17
|
+
const children = slots.default?.();
|
|
18
|
+
if (OGWrap) {
|
|
19
|
+
return Vue.h(OGWrap, null, () => children);
|
|
20
|
+
}
|
|
21
|
+
return children;
|
|
22
|
+
};
|
|
22
23
|
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
slots
|
|
26
|
-
}) {
|
|
27
|
-
Vue.provide(VUE_QUERY_CLIENT, props.client);
|
|
28
|
-
return () => slots.default?.();
|
|
29
|
-
}
|
|
30
|
-
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
31
26
|
export {
|
|
32
27
|
setupRouterSsrQueryIntegration
|
|
33
28
|
};
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport { setupCoreRouterSsrQueryIntegration } from '@tanstack/router-ssr-query-core'\nimport type { RouterSsrQueryOptions } from '@tanstack/router-ssr-query-core'\nimport type { AnyRouter } from '@tanstack/vue-router'\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import * as Vue from 'vue'\nimport { setupCoreRouterSsrQueryIntegration } from '@tanstack/router-ssr-query-core'\nimport type { RouterSsrQueryOptions } from '@tanstack/router-ssr-query-core'\nimport type { AnyRouter } from '@tanstack/vue-router'\n\n// Vue Query uses this string as the injection key\nconst VUE_QUERY_CLIENT = 'VUE_QUERY_CLIENT'\n\nexport type Options<TRouter extends AnyRouter> =\n RouterSsrQueryOptions<TRouter> & {\n wrapQueryClient?: boolean\n }\n\nexport function setupRouterSsrQueryIntegration<TRouter extends AnyRouter>(\n opts: Options<TRouter>,\n) {\n setupCoreRouterSsrQueryIntegration(opts)\n\n if (opts.wrapQueryClient === false) {\n return\n }\n\n const OGWrap = opts.router.options.Wrap\n\n opts.router.options.Wrap = Vue.defineComponent({\n name: 'QueryClientWrapper',\n setup(_, { slots }) {\n Vue.provide(VUE_QUERY_CLIENT, opts.queryClient)\n return () => {\n const children = slots.default?.()\n if (OGWrap) {\n return Vue.h(OGWrap, null, () => children)\n }\n return children\n }\n },\n }) as any\n}\n"],"names":["VUE_QUERY_CLIENT","setupRouterSsrQueryIntegration","opts","setupCoreRouterSsrQueryIntegration","wrapQueryClient","OGWrap","router","options","Wrap","Vue","defineComponent","name","setup","_","slots","provide","queryClient","children","default","h"],"mappings":";;AAMA,MAAMA,mBAAmB;AAOlB,SAASC,+BACdC,MACA;AACAC,qCAAmCD,IAAI;AAEvC,MAAIA,KAAKE,oBAAoB,OAAO;AAClC;AAAA,EACF;AAEA,QAAMC,SAASH,KAAKI,OAAOC,QAAQC;AAEnCN,OAAKI,OAAOC,QAAQC,OAAOC,IAAIC,gBAAgB;AAAA,IAC7CC,MAAM;AAAA,IACNC,MAAMC,GAAG;AAAA,MAAEC;AAAAA,IAAM,GAAG;AAClBL,UAAIM,QAAQf,kBAAkBE,KAAKc,WAAW;AAC9C,aAAO,MAAM;AACX,cAAMC,WAAWH,MAAMI,UAAO;AAC9B,YAAIb,QAAQ;AACV,iBAAOI,IAAIU,EAAEd,QAAQ,MAAM,MAAMY,QAAQ;AAAA,QAC3C;AACA,eAAOA;AAAAA,MACT;AAAA,IACF;AAAA,EACF,CAAC;AACH;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/vue-router-ssr-query",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.141.0",
|
|
4
4
|
"description": "Modern and scalable routing for Vue applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"node": ">=12"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@tanstack/router-ssr-query-core": "1.
|
|
47
|
+
"@tanstack/router-ssr-query-core": "1.141.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@tanstack/vue-query": "^5.92.0",
|
|
51
51
|
"@vitejs/plugin-vue-jsx": "^4.1.2",
|
|
52
52
|
"vue": "^3.5.25",
|
|
53
|
-
"@tanstack/vue-router": "1.
|
|
53
|
+
"@tanstack/vue-router": "1.141.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@tanstack/query-core": ">=5.90.0",
|
package/src/index.tsx
CHANGED
|
@@ -2,7 +2,6 @@ import * as Vue from 'vue'
|
|
|
2
2
|
import { setupCoreRouterSsrQueryIntegration } from '@tanstack/router-ssr-query-core'
|
|
3
3
|
import type { RouterSsrQueryOptions } from '@tanstack/router-ssr-query-core'
|
|
4
4
|
import type { AnyRouter } from '@tanstack/vue-router'
|
|
5
|
-
import type { QueryClient } from '@tanstack/query-core'
|
|
6
5
|
|
|
7
6
|
// Vue Query uses this string as the injection key
|
|
8
7
|
const VUE_QUERY_CLIENT = 'VUE_QUERY_CLIENT'
|
|
@@ -21,26 +20,19 @@ export function setupRouterSsrQueryIntegration<TRouter extends AnyRouter>(
|
|
|
21
20
|
return
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
const OGWrap =
|
|
25
|
-
opts.router.options.Wrap || ((props: { children: any }) => props.children)
|
|
23
|
+
const OGWrap = opts.router.options.Wrap
|
|
26
24
|
|
|
27
|
-
opts.router.options.Wrap = (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
type: Object as () => QueryClient,
|
|
39
|
-
required: true,
|
|
25
|
+
opts.router.options.Wrap = Vue.defineComponent({
|
|
26
|
+
name: 'QueryClientWrapper',
|
|
27
|
+
setup(_, { slots }) {
|
|
28
|
+
Vue.provide(VUE_QUERY_CLIENT, opts.queryClient)
|
|
29
|
+
return () => {
|
|
30
|
+
const children = slots.default?.()
|
|
31
|
+
if (OGWrap) {
|
|
32
|
+
return Vue.h(OGWrap, null, () => children)
|
|
33
|
+
}
|
|
34
|
+
return children
|
|
35
|
+
}
|
|
40
36
|
},
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
Vue.provide(VUE_QUERY_CLIENT, props.client)
|
|
44
|
-
return () => slots.default?.()
|
|
45
|
-
},
|
|
46
|
-
})
|
|
37
|
+
}) as any
|
|
38
|
+
}
|