@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 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 || ((props) => props.children);
10
- opts.router.options.Wrap = (props) => {
11
- return Vue.h(QueryClientProvider, {
12
- client: opts.queryClient
13
- }, () => Vue.h(OGWrap, null, () => props.children));
14
- };
15
- }
16
- const QueryClientProvider = Vue.defineComponent({
17
- name: "QueryClientProvider",
18
- props: {
19
- client: {
20
- type: Object,
21
- required: true
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
- setup(props, {
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
  };
@@ -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'\nimport type { QueryClient } from '@tanstack/query-core'\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 =\n opts.router.options.Wrap || ((props: { children: any }) => props.children)\n\n opts.router.options.Wrap = (props) => {\n return Vue.h(QueryClientProvider, { client: opts.queryClient }, () =>\n Vue.h(OGWrap, null, () => props.children),\n )\n }\n}\n\nconst QueryClientProvider = Vue.defineComponent({\n name: 'QueryClientProvider',\n props: {\n client: {\n type: Object as () => QueryClient,\n required: true,\n },\n },\n setup(props, { slots }) {\n Vue.provide(VUE_QUERY_CLIENT, props.client)\n return () => slots.default?.()\n },\n})\n"],"names":["VUE_QUERY_CLIENT","setupRouterSsrQueryIntegration","opts","setupCoreRouterSsrQueryIntegration","wrapQueryClient","OGWrap","router","options","Wrap","props","children","Vue","h","QueryClientProvider","client","queryClient","defineComponent","name","type","Object","required","setup","slots","provide","default"],"mappings":";;AAOA,MAAMA,mBAAmB;AAOlB,SAASC,+BACdC,MACA;AACAC,qCAAmCD,IAAI;AAEvC,MAAIA,KAAKE,oBAAoB,OAAO;AAClC;AAAA,EACF;AAEA,QAAMC,SACJH,KAAKI,OAAOC,QAAQC,SAAUC,WAA6BA,MAAMC;AAEnER,OAAKI,OAAOC,QAAQC,OAAQC,WAAU;AACpC,WAAOE,IAAIC,EAAEC,qBAAqB;AAAA,MAAEC,QAAQZ,KAAKa;AAAAA,IAAY,GAAG,MAC9DJ,IAAIC,EAAEP,QAAQ,MAAM,MAAMI,MAAMC,QAAQ,CAC1C;AAAA,EACF;AACF;AAEA,MAAMG,sBAAsBF,IAAIK,gBAAgB;AAAA,EAC9CC,MAAM;AAAA,EACNR,OAAO;AAAA,IACLK,QAAQ;AAAA,MACNI,MAAMC;AAAAA,MACNC,UAAU;AAAA,IACZ;AAAA;EAEFC,MAAMZ,OAAO;AAAA,IAAEa;AAAAA,EAAM,GAAG;AACtBX,QAAIY,QAAQvB,kBAAkBS,MAAMK,MAAM;AAC1C,WAAO,MAAMQ,MAAME,UAAO;AAAA,EAC5B;AACF,CAAC;"}
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.140.5",
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.140.5"
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.140.5"
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 = (props) => {
28
- return Vue.h(QueryClientProvider, { client: opts.queryClient }, () =>
29
- Vue.h(OGWrap, null, () => props.children),
30
- )
31
- }
32
- }
33
-
34
- const QueryClientProvider = Vue.defineComponent({
35
- name: 'QueryClientProvider',
36
- props: {
37
- client: {
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
- setup(props, { slots }) {
43
- Vue.provide(VUE_QUERY_CLIENT, props.client)
44
- return () => slots.default?.()
45
- },
46
- })
37
+ }) as any
38
+ }