@tanstack/vue-query 5.0.0-alpha.81 → 5.0.0-alpha.85
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/build/lib/__mocks__/useBaseQuery.d.ts +2 -1
- package/build/lib/__mocks__/useBaseQuery.d.ts.map +1 -1
- package/build/lib/__mocks__/useQueryClient.d.ts +2 -1
- package/build/lib/__mocks__/useQueryClient.d.ts.map +1 -1
- package/build/lib/devtools/devtools.cjs.map +1 -1
- package/build/lib/devtools/devtools.d.ts.map +1 -1
- package/build/lib/devtools/devtools.js.map +1 -1
- package/build/lib/devtools/devtools.legacy.cjs.map +1 -1
- package/build/lib/devtools/devtools.legacy.js.map +1 -1
- package/build/lib/mutationCache.cjs.map +1 -1
- package/build/lib/mutationCache.d.ts +1 -1
- package/build/lib/mutationCache.d.ts.map +1 -1
- package/build/lib/mutationCache.js.map +1 -1
- package/build/lib/mutationCache.legacy.cjs.map +1 -1
- package/build/lib/mutationCache.legacy.js.map +1 -1
- package/build/lib/queryCache.cjs.map +1 -1
- package/build/lib/queryCache.d.ts +1 -1
- package/build/lib/queryCache.d.ts.map +1 -1
- package/build/lib/queryCache.js.map +1 -1
- package/build/lib/queryCache.legacy.cjs.map +1 -1
- package/build/lib/queryCache.legacy.js.map +1 -1
- package/build/lib/queryClient.cjs.map +1 -1
- package/build/lib/queryClient.d.ts +1 -1
- package/build/lib/queryClient.d.ts.map +1 -1
- package/build/lib/queryClient.js.map +1 -1
- package/build/lib/queryClient.legacy.cjs.map +1 -1
- package/build/lib/queryClient.legacy.js.map +1 -1
- package/build/lib/useBaseQuery.cjs.map +1 -1
- package/build/lib/useBaseQuery.d.ts +1 -1
- package/build/lib/useBaseQuery.d.ts.map +1 -1
- package/build/lib/useBaseQuery.js.map +1 -1
- package/build/lib/useBaseQuery.legacy.cjs.map +1 -1
- package/build/lib/useBaseQuery.legacy.js.map +1 -1
- package/build/lib/useInfiniteQuery.cjs.map +1 -1
- package/build/lib/useInfiniteQuery.d.ts +1 -1
- package/build/lib/useInfiniteQuery.d.ts.map +1 -1
- package/build/lib/useInfiniteQuery.js.map +1 -1
- package/build/lib/useInfiniteQuery.legacy.cjs.map +1 -1
- package/build/lib/useInfiniteQuery.legacy.js.map +1 -1
- package/build/lib/useIsFetching.cjs.map +1 -1
- package/build/lib/useIsFetching.d.ts.map +1 -1
- package/build/lib/useIsFetching.js.map +1 -1
- package/build/lib/useIsFetching.legacy.cjs.map +1 -1
- package/build/lib/useIsFetching.legacy.js.map +1 -1
- package/build/lib/useMutation.cjs.map +1 -1
- package/build/lib/useMutation.d.ts +2 -2
- package/build/lib/useMutation.d.ts.map +1 -1
- package/build/lib/useMutation.js.map +1 -1
- package/build/lib/useMutation.legacy.cjs.map +1 -1
- package/build/lib/useMutation.legacy.js.map +1 -1
- package/build/lib/useMutationState.cjs.map +1 -1
- package/build/lib/useMutationState.d.ts +2 -2
- package/build/lib/useMutationState.d.ts.map +1 -1
- package/build/lib/useMutationState.js.map +1 -1
- package/build/lib/useMutationState.legacy.cjs.map +1 -1
- package/build/lib/useMutationState.legacy.js.map +1 -1
- package/build/lib/useQueries.cjs.map +1 -1
- package/build/lib/useQueries.d.ts +1 -1
- package/build/lib/useQueries.d.ts.map +1 -1
- package/build/lib/useQueries.js.map +1 -1
- package/build/lib/useQueries.legacy.cjs.map +1 -1
- package/build/lib/useQueries.legacy.js.map +1 -1
- package/build/lib/useQuery.cjs.map +1 -1
- package/build/lib/useQuery.d.ts +1 -1
- package/build/lib/useQuery.d.ts.map +1 -1
- package/build/lib/useQuery.js.map +1 -1
- package/build/lib/useQuery.legacy.cjs.map +1 -1
- package/build/lib/useQuery.legacy.js.map +1 -1
- package/build/lib/useQueryClient.cjs.map +1 -1
- package/build/lib/useQueryClient.d.ts.map +1 -1
- package/build/lib/useQueryClient.js.map +1 -1
- package/build/lib/useQueryClient.legacy.cjs.map +1 -1
- package/build/lib/useQueryClient.legacy.js.map +1 -1
- package/build/lib/vueQueryPlugin.cjs.map +1 -1
- package/build/lib/vueQueryPlugin.d.ts +1 -1
- package/build/lib/vueQueryPlugin.d.ts.map +1 -1
- package/build/lib/vueQueryPlugin.js.map +1 -1
- package/build/lib/vueQueryPlugin.legacy.cjs.map +1 -1
- package/build/lib/vueQueryPlugin.legacy.js.map +1 -1
- package/package.json +2 -2
- package/src/__mocks__/useBaseQuery.ts +2 -1
- package/src/__mocks__/useQueryClient.ts +3 -2
- package/src/__tests__/mutationCache.test.ts +1 -1
- package/src/__tests__/queryCache.test.ts +1 -1
- package/src/__tests__/queryClient.test.ts +1 -1
- package/src/__tests__/useInfiniteQuery.test.ts +2 -2
- package/src/__tests__/useInfiniteQuery.types.test.tsx +2 -2
- package/src/__tests__/useIsFetching.test.ts +2 -2
- package/src/__tests__/useIsMutating.test.ts +3 -3
- package/src/__tests__/useMutation.test.ts +2 -2
- package/src/__tests__/useQueries.test.ts +5 -5
- package/src/__tests__/useQuery.test.ts +6 -6
- package/src/__tests__/useQueryClient.test.ts +1 -1
- package/src/__tests__/utils.test.ts +1 -1
- package/src/__tests__/vueQueryPlugin.test.ts +3 -3
- package/src/devtools/devtools.ts +3 -3
- package/src/mutationCache.ts +2 -2
- package/src/queryCache.ts +2 -2
- package/src/queryClient.ts +17 -17
- package/src/useBaseQuery.ts +7 -7
- package/src/useInfiniteQuery.ts +5 -5
- package/src/useIsFetching.ts +2 -2
- package/src/useMutation.ts +8 -8
- package/src/useMutationState.ts +5 -5
- package/src/useQueries.ts +7 -7
- package/src/useQuery.ts +5 -5
- package/src/useQueryClient.ts +1 -1
- package/src/vueQueryPlugin.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQueryClient.cjs","sources":["../../src/useQueryClient.ts"],"sourcesContent":["import { getCurrentInstance, inject } from 'vue-demi'\n\nimport
|
|
1
|
+
{"version":3,"file":"useQueryClient.cjs","sources":["../../src/useQueryClient.ts"],"sourcesContent":["import { getCurrentInstance, inject } from 'vue-demi'\n\nimport { getClientKey } from './utils'\nimport type { QueryClient } from './queryClient'\n\nexport function useQueryClient(id = ''): QueryClient {\n const vm = getCurrentInstance()?.proxy\n\n if (!vm) {\n throw new Error('vue-query hooks can only be used inside setup() function.')\n }\n\n const key = getClientKey(id)\n const queryClient = inject<QueryClient>(key)\n\n if (!queryClient) {\n throw new Error(\n \"No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.\",\n )\n }\n\n return queryClient\n}\n"],"names":["useQueryClient","id","vm","getCurrentInstance","proxy","Error","key","getClientKey","queryClient","inject"],"mappings":";;;;;AAKO,SAASA,cAAcA,CAACC,EAAE,GAAG,EAAE,EAAe;AACnD,EAAA,MAAMC,EAAE,GAAGC,0BAAkB,EAAE,EAAEC,KAAK,CAAA;EAEtC,IAAI,CAACF,EAAE,EAAE;AACP,IAAA,MAAM,IAAIG,KAAK,CAAC,2DAA2D,CAAC,CAAA;AAC9E,GAAA;AAEA,EAAA,MAAMC,GAAG,GAAGC,kBAAY,CAACN,EAAE,CAAC,CAAA;AAC5B,EAAA,MAAMO,WAAW,GAAGC,cAAM,CAAcH,GAAG,CAAC,CAAA;EAE5C,IAAI,CAACE,WAAW,EAAE;AAChB,IAAA,MAAM,IAAIH,KAAK,CACb,iGACF,CAAC,CAAA;AACH,GAAA;AAEA,EAAA,OAAOG,WAAW,CAAA;AACpB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQueryClient.d.ts","sourceRoot":"","sources":["../../src/useQueryClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useQueryClient.d.ts","sourceRoot":"","sources":["../../src/useQueryClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,wBAAgB,cAAc,CAAC,EAAE,SAAK,GAAG,WAAW,CAiBnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQueryClient.js","sources":["../../src/useQueryClient.ts"],"sourcesContent":["import { getCurrentInstance, inject } from 'vue-demi'\n\nimport
|
|
1
|
+
{"version":3,"file":"useQueryClient.js","sources":["../../src/useQueryClient.ts"],"sourcesContent":["import { getCurrentInstance, inject } from 'vue-demi'\n\nimport { getClientKey } from './utils'\nimport type { QueryClient } from './queryClient'\n\nexport function useQueryClient(id = ''): QueryClient {\n const vm = getCurrentInstance()?.proxy\n\n if (!vm) {\n throw new Error('vue-query hooks can only be used inside setup() function.')\n }\n\n const key = getClientKey(id)\n const queryClient = inject<QueryClient>(key)\n\n if (!queryClient) {\n throw new Error(\n \"No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.\",\n )\n }\n\n return queryClient\n}\n"],"names":["useQueryClient","id","vm","getCurrentInstance","proxy","Error","key","getClientKey","queryClient","inject"],"mappings":";;;AAKO,SAASA,cAAcA,CAACC,EAAE,GAAG,EAAE,EAAe;AACnD,EAAA,MAAMC,EAAE,GAAGC,kBAAkB,EAAE,EAAEC,KAAK,CAAA;EAEtC,IAAI,CAACF,EAAE,EAAE;AACP,IAAA,MAAM,IAAIG,KAAK,CAAC,2DAA2D,CAAC,CAAA;AAC9E,GAAA;AAEA,EAAA,MAAMC,GAAG,GAAGC,YAAY,CAACN,EAAE,CAAC,CAAA;AAC5B,EAAA,MAAMO,WAAW,GAAGC,MAAM,CAAcH,GAAG,CAAC,CAAA;EAE5C,IAAI,CAACE,WAAW,EAAE;AAChB,IAAA,MAAM,IAAIH,KAAK,CACb,iGACF,CAAC,CAAA;AACH,GAAA;AAEA,EAAA,OAAOG,WAAW,CAAA;AACpB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQueryClient.legacy.cjs","sources":["../../src/useQueryClient.ts"],"sourcesContent":["import { getCurrentInstance, inject } from 'vue-demi'\n\nimport
|
|
1
|
+
{"version":3,"file":"useQueryClient.legacy.cjs","sources":["../../src/useQueryClient.ts"],"sourcesContent":["import { getCurrentInstance, inject } from 'vue-demi'\n\nimport { getClientKey } from './utils'\nimport type { QueryClient } from './queryClient'\n\nexport function useQueryClient(id = ''): QueryClient {\n const vm = getCurrentInstance()?.proxy\n\n if (!vm) {\n throw new Error('vue-query hooks can only be used inside setup() function.')\n }\n\n const key = getClientKey(id)\n const queryClient = inject<QueryClient>(key)\n\n if (!queryClient) {\n throw new Error(\n \"No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.\",\n )\n }\n\n return queryClient\n}\n"],"names":["useQueryClient","id","_getCurrentInstance","vm","getCurrentInstance","proxy","Error","key","getClientKey","queryClient","inject"],"mappings":";;;;;AAKO,SAASA,cAAcA,CAACC,EAAE,GAAG,EAAE,EAAe;AAAA,EAAA,IAAAC,mBAAA,CAAA;EACnD,MAAMC,EAAE,GAAAD,CAAAA,mBAAA,GAAGE,0BAAkB,EAAE,KAAA,IAAA,GAAA,KAAA,CAAA,GAApBF,mBAAA,CAAsBG,KAAK,CAAA;EAEtC,IAAI,CAACF,EAAE,EAAE;AACP,IAAA,MAAM,IAAIG,KAAK,CAAC,2DAA2D,CAAC,CAAA;AAC9E,GAAA;AAEA,EAAA,MAAMC,GAAG,GAAGC,kBAAY,CAACP,EAAE,CAAC,CAAA;AAC5B,EAAA,MAAMQ,WAAW,GAAGC,cAAM,CAAcH,GAAG,CAAC,CAAA;EAE5C,IAAI,CAACE,WAAW,EAAE;AAChB,IAAA,MAAM,IAAIH,KAAK,CACb,iGACF,CAAC,CAAA;AACH,GAAA;AAEA,EAAA,OAAOG,WAAW,CAAA;AACpB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQueryClient.legacy.js","sources":["../../src/useQueryClient.ts"],"sourcesContent":["import { getCurrentInstance, inject } from 'vue-demi'\n\nimport
|
|
1
|
+
{"version":3,"file":"useQueryClient.legacy.js","sources":["../../src/useQueryClient.ts"],"sourcesContent":["import { getCurrentInstance, inject } from 'vue-demi'\n\nimport { getClientKey } from './utils'\nimport type { QueryClient } from './queryClient'\n\nexport function useQueryClient(id = ''): QueryClient {\n const vm = getCurrentInstance()?.proxy\n\n if (!vm) {\n throw new Error('vue-query hooks can only be used inside setup() function.')\n }\n\n const key = getClientKey(id)\n const queryClient = inject<QueryClient>(key)\n\n if (!queryClient) {\n throw new Error(\n \"No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.\",\n )\n }\n\n return queryClient\n}\n"],"names":["useQueryClient","id","_getCurrentInstance","vm","getCurrentInstance","proxy","Error","key","getClientKey","queryClient","inject"],"mappings":";;;AAKO,SAASA,cAAcA,CAACC,EAAE,GAAG,EAAE,EAAe;AAAA,EAAA,IAAAC,mBAAA,CAAA;EACnD,MAAMC,EAAE,GAAAD,CAAAA,mBAAA,GAAGE,kBAAkB,EAAE,KAAA,IAAA,GAAA,KAAA,CAAA,GAApBF,mBAAA,CAAsBG,KAAK,CAAA;EAEtC,IAAI,CAACF,EAAE,EAAE;AACP,IAAA,MAAM,IAAIG,KAAK,CAAC,2DAA2D,CAAC,CAAA;AAC9E,GAAA;AAEA,EAAA,MAAMC,GAAG,GAAGC,YAAY,CAACP,EAAE,CAAC,CAAA;AAC5B,EAAA,MAAMQ,WAAW,GAAGC,MAAM,CAAcH,GAAG,CAAC,CAAA;EAE5C,IAAI,CAACE,WAAW,EAAE;AAChB,IAAA,MAAM,IAAIH,KAAK,CACb,iGACF,CAAC,CAAA;AACH,GAAA;AAEA,EAAA,OAAOG,WAAW,CAAA;AACpB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vueQueryPlugin.cjs","sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { isServer } from '@tanstack/query-core'\nimport
|
|
1
|
+
{"version":3,"file":"vueQueryPlugin.cjs","sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { isServer } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from '@tanstack/query-core'\nimport type { MaybeRefDeep } from './types'\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n queryClientKey?: string\n clientPersister?: ClientPersister\n}\n\ninterface ConfigOptions extends CommonOptions {\n queryClientConfig?: MaybeRefDeep<QueryClientConfig>\n}\n\ninterface ClientOptions extends CommonOptions {\n queryClient?: QueryClient\n}\n\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n\n if (!isServer) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n client.isRestoring.value = true\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(() => {\n client.isRestoring.value = false\n })\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n setupDevtools(app, client)\n }\n }\n },\n}\n"],"names":["VueQueryPlugin","install","app","options","clientKey","getClientKey","queryClientKey","client","queryClient","clientConfig","queryClientConfig","undefined","QueryClient","isServer","mount","persisterUnmount","clientPersister","isRestoring","value","unmount","promise","then","cleanup","onUnmount","originalUnmount","vueQueryUnmount","isVue2","mixin","beforeCreate","_provided","provideCache","Object","defineProperty","get","set","v","assign","process","env","NODE_ENV","$root","setupDevtools","provide"],"mappings":";;;;;;;;AA0BO,MAAMA,cAAc,GAAG;EAC5BC,OAAO,EAAEA,CAACC,GAAQ,EAAEC,OAA8B,GAAG,EAAE,KAAK;AAC1D,IAAA,MAAMC,SAAS,GAAGC,kBAAY,CAACF,OAAO,CAACG,cAAc,CAAC,CAAA;AACtD,IAAA,IAAIC,MAAmB,CAAA;AAEvB,IAAA,IAAI,aAAa,IAAIJ,OAAO,IAAIA,OAAO,CAACK,WAAW,EAAE;MACnDD,MAAM,GAAGJ,OAAO,CAACK,WAAW,CAAA;AAC9B,KAAC,MAAM;MACL,MAAMC,YAAY,GAChB,mBAAmB,IAAIN,OAAO,GAAGA,OAAO,CAACO,iBAAiB,GAAGC,SAAS,CAAA;AACxEJ,MAAAA,MAAM,GAAG,IAAIK,uBAAW,CAACH,YAAY,CAAC,CAAA;AACxC,KAAA;IAEA,IAAI,CAACI,kBAAQ,EAAE;MACbN,MAAM,CAACO,KAAK,EAAE,CAAA;AAChB,KAAA;IAEA,IAAIC,gBAAgB,GAAGA,MAAM;AAC3B;KACD,CAAA;IAED,IAAIZ,OAAO,CAACa,eAAe,EAAE;AAC3BT,MAAAA,MAAM,CAACU,WAAW,CAACC,KAAK,GAAG,IAAI,CAAA;MAC/B,MAAM,CAACC,OAAO,EAAEC,OAAO,CAAC,GAAGjB,OAAO,CAACa,eAAe,CAACT,MAAM,CAAC,CAAA;AAC1DQ,MAAAA,gBAAgB,GAAGI,OAAO,CAAA;MAC1BC,OAAO,CAACC,IAAI,CAAC,MAAM;AACjBd,QAAAA,MAAM,CAACU,WAAW,CAACC,KAAK,GAAG,KAAK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AAO,CAACtC,SAAS,EAAEG,MAAM,CAAC,CAAA;AAE9B,MAAA,IAAI8B,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,aAAa,EAAE;AAC1CE,QAAAA,sBAAa,CAACvC,GAAG,EAAEK,MAAM,CAAC,CAAA;AAC5B,OAAA;AACF,KAAA;AACF,GAAA;AACF;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { QueryClientConfig } from '@tanstack/query-core';
|
|
2
1
|
import { QueryClient } from './queryClient';
|
|
2
|
+
import type { QueryClientConfig } from '@tanstack/query-core';
|
|
3
3
|
import type { MaybeRefDeep } from './types';
|
|
4
4
|
type ClientPersister = (client: QueryClient) => [() => void, Promise<void>];
|
|
5
5
|
interface CommonOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vueQueryPlugin.d.ts","sourceRoot":"","sources":["../../src/vueQueryPlugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vueQueryPlugin.d.ts","sourceRoot":"","sources":["../../src/vueQueryPlugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAG3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C,KAAK,eAAe,GAAG,CAAC,MAAM,EAAE,WAAW,KAAK,CAAC,MAAM,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;AAE3E,UAAU,aAAa;IACrB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,eAAe,CAAA;CAClC;AAED,UAAU,aAAc,SAAQ,aAAa;IAC3C,iBAAiB,CAAC,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAA;CACpD;AAED,UAAU,aAAc,SAAQ,aAAa;IAC3C,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAED,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG,aAAa,CAAA;AAEjE,eAAO,MAAM,cAAc;mBACV,GAAG,YAAW,qBAAqB;CAyEnD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vueQueryPlugin.js","sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { isServer } from '@tanstack/query-core'\nimport
|
|
1
|
+
{"version":3,"file":"vueQueryPlugin.js","sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { isServer } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from '@tanstack/query-core'\nimport type { MaybeRefDeep } from './types'\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n queryClientKey?: string\n clientPersister?: ClientPersister\n}\n\ninterface ConfigOptions extends CommonOptions {\n queryClientConfig?: MaybeRefDeep<QueryClientConfig>\n}\n\ninterface ClientOptions extends CommonOptions {\n queryClient?: QueryClient\n}\n\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n\n if (!isServer) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n client.isRestoring.value = true\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(() => {\n client.isRestoring.value = false\n })\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n setupDevtools(app, client)\n }\n }\n },\n}\n"],"names":["VueQueryPlugin","install","app","options","clientKey","getClientKey","queryClientKey","client","queryClient","clientConfig","queryClientConfig","undefined","QueryClient","isServer","mount","persisterUnmount","clientPersister","isRestoring","value","unmount","promise","then","cleanup","onUnmount","originalUnmount","vueQueryUnmount","isVue2","mixin","beforeCreate","_provided","provideCache","Object","defineProperty","get","set","v","assign","process","env","NODE_ENV","$root","setupDevtools","provide"],"mappings":";;;;;;AA0BO,MAAMA,cAAc,GAAG;EAC5BC,OAAO,EAAEA,CAACC,GAAQ,EAAEC,OAA8B,GAAG,EAAE,KAAK;AAC1D,IAAA,MAAMC,SAAS,GAAGC,YAAY,CAACF,OAAO,CAACG,cAAc,CAAC,CAAA;AACtD,IAAA,IAAIC,MAAmB,CAAA;AAEvB,IAAA,IAAI,aAAa,IAAIJ,OAAO,IAAIA,OAAO,CAACK,WAAW,EAAE;MACnDD,MAAM,GAAGJ,OAAO,CAACK,WAAW,CAAA;AAC9B,KAAC,MAAM;MACL,MAAMC,YAAY,GAChB,mBAAmB,IAAIN,OAAO,GAAGA,OAAO,CAACO,iBAAiB,GAAGC,SAAS,CAAA;AACxEJ,MAAAA,MAAM,GAAG,IAAIK,WAAW,CAACH,YAAY,CAAC,CAAA;AACxC,KAAA;IAEA,IAAI,CAACI,QAAQ,EAAE;MACbN,MAAM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CAACN,YAAY,EAAEK,CAAC,CAAA;AAC3C,aAAC,CAAC,CAAA;AACJ,WAAA;AAEA,UAAA,IAAI,CAACN,SAAS,CAACzB,SAAS,CAAC,GAAGG,MAAM,CAAA;AAElC,UAAA,IAAI8B,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,aAAa,EAAE;AAC1C,YAAA,IAAI,IAAI,KAAK,IAAI,CAACC,KAAK,EAAE;AACvBC,cAAAA,aAAa,CAAC,IAAI,EAAElC,MAAM,CAAC,CAAA;AAC7B,aAAA;AACF,WAAA;AACF,SAAA;AACF,OAAC,CAAC,CAAA;AACJ,KAAC,MAAM;AACLL,MAAAA,GAAG,CAACwC,OAAO,CAACtC,SAAS,EAAEG,MAAM,CAAC,CAAA;AAE9B,MAAA,IAAI8B,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,aAAa,EAAE;AAC1CE,QAAAA,aAAa,CAACvC,GAAG,EAAEK,MAAM,CAAC,CAAA;AAC5B,OAAA;AACF,KAAA;AACF,GAAA;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vueQueryPlugin.legacy.cjs","sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { isServer } from '@tanstack/query-core'\nimport
|
|
1
|
+
{"version":3,"file":"vueQueryPlugin.legacy.cjs","sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { isServer } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from '@tanstack/query-core'\nimport type { MaybeRefDeep } from './types'\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n queryClientKey?: string\n clientPersister?: ClientPersister\n}\n\ninterface ConfigOptions extends CommonOptions {\n queryClientConfig?: MaybeRefDeep<QueryClientConfig>\n}\n\ninterface ClientOptions extends CommonOptions {\n queryClient?: QueryClient\n}\n\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n\n if (!isServer) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n client.isRestoring.value = true\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(() => {\n client.isRestoring.value = false\n })\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n setupDevtools(app, client)\n }\n }\n },\n}\n"],"names":["VueQueryPlugin","install","app","options","clientKey","getClientKey","queryClientKey","client","queryClient","clientConfig","queryClientConfig","undefined","QueryClient","isServer","mount","persisterUnmount","clientPersister","isRestoring","value","unmount","promise","then","cleanup","onUnmount","originalUnmount","vueQueryUnmount","isVue2","mixin","beforeCreate","_provided","provideCache","Object","defineProperty","get","set","v","assign","process","env","NODE_ENV","$root","setupDevtools","provide"],"mappings":";;;;;;;;AA0BO,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3,"file":"vueQueryPlugin.legacy.js","sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { isServer } from '@tanstack/query-core'\nimport
|
|
1
|
+
{"version":3,"file":"vueQueryPlugin.legacy.js","sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { isServer } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from '@tanstack/query-core'\nimport type { MaybeRefDeep } from './types'\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n queryClientKey?: string\n clientPersister?: ClientPersister\n}\n\ninterface ConfigOptions extends CommonOptions {\n queryClientConfig?: MaybeRefDeep<QueryClientConfig>\n}\n\ninterface ClientOptions extends CommonOptions {\n queryClient?: QueryClient\n}\n\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n\n if (!isServer) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n client.isRestoring.value = true\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(() => {\n client.isRestoring.value = false\n })\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n setupDevtools(app, client)\n }\n }\n },\n}\n"],"names":["VueQueryPlugin","install","app","options","clientKey","getClientKey","queryClientKey","client","queryClient","clientConfig","queryClientConfig","undefined","QueryClient","isServer","mount","persisterUnmount","clientPersister","isRestoring","value","unmount","promise","then","cleanup","onUnmount","originalUnmount","vueQueryUnmount","isVue2","mixin","beforeCreate","_provided","provideCache","Object","defineProperty","get","set","v","assign","process","env","NODE_ENV","$root","setupDevtools","provide"],"mappings":";;;;;;AA0BO,MAAMA,cAAc,GAAG;EAC5BC,OAAO,EAAEA,CAACC,GAAQ,EAAEC,OAA8B,GAAG,EAAE,KAAK;AAC1D,IAAA,MAAMC,SAAS,GAAGC,YAAY,CAACF,OAAO,CAACG,cAAc,CAAC,CAAA;AACtD,IAAA,IAAIC,MAAmB,CAAA;AAEvB,IAAA,IAAI,aAAa,IAAIJ,OAAO,IAAIA,OAAO,CAACK,WAAW,EAAE;MACnDD,MAAM,GAAGJ,OAAO,CAACK,WAAW,CAAA;AAC9B,KAAC,MAAM;MACL,MAAMC,YAAY,GAChB,mBAAmB,IAAIN,OAAO,GAAGA,OAAO,CAACO,iBAAiB,GAAGC,SAAS,CAAA;AACxEJ,MAAAA,MAAM,GAAG,IAAIK,WAAW,CAACH,YAAY,CAAC,CAAA;AACxC,KAAA;IAEA,IAAI,CAACI,QAAQ,EAAE;MACbN,MAAM,CAACO,KAAK,EAAE,CAAA;AAChB,KAAA;IAEA,IAAIC,gBAAgB,GAAGA,MAAM;AAC3B;KACD,CAAA;IAED,IAAIZ,OAAO,CAACa,eAAe,EAAE;AAC3BT,MAAAA,MAAM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,IAAI8B,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,aAAa,EAAE;AAC1C,YAAA,IAAI,IAAI,KAAK,IAAI,CAACC,KAAK,EAAE;AACvBC,cAAAA,aAAa,CAAC,IAAI,EAAElC,MAAM,CAAC,CAAA;AAC7B,aAAA;AACF,WAAA;AACF,SAAA;AACF,OAAC,CAAC,CAAA;AACJ,KAAC,MAAM;AACLL,MAAAA,GAAG,CAACwC,OAAO,CAACtC,SAAS,EAAEG,MAAM,CAAC,CAAA;AAE9B,MAAA,IAAI8B,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,aAAa,EAAE;AAC1CE,QAAAA,aAAa,CAACvC,GAAG,EAAEK,MAAM,CAAC,CAAA;AAC5B,OAAA;AACF,KAAA;AACF,GAAA;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/vue-query",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.85",
|
|
4
4
|
"description": "Hooks for managing, caching and syncing asynchronous and remote data in Vue",
|
|
5
5
|
"author": "Damian Osipiuk",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@tanstack/match-sorter-utils": "^8.8.4",
|
|
46
46
|
"@vue/devtools-api": "^6.5.0",
|
|
47
47
|
"vue-demi": "^0.13.11",
|
|
48
|
-
"@tanstack/query-core": "5.0.0-alpha.
|
|
48
|
+
"@tanstack/query-core": "5.0.0-alpha.85"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@vue/composition-api": "1.7.1",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { vi } from 'vitest'
|
|
2
|
+
import type { Mock } from 'vitest'
|
|
2
3
|
|
|
3
4
|
const { useBaseQuery: originImpl, unrefQueryArgs: originalParse } =
|
|
4
5
|
// @ts-expect-error - vitest uses esmodules; tsconfig is not set to use them
|
|
5
6
|
(await vi.importActual('../useBaseQuery')) as any
|
|
6
7
|
|
|
7
|
-
export const useBaseQuery = vi.fn(originImpl)
|
|
8
|
+
export const useBaseQuery: Mock<any[], any> = vi.fn(originImpl)
|
|
8
9
|
export const unrefQueryArgs = originalParse
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { QueryClient } from '../queryClient'
|
|
2
1
|
import { vi } from 'vitest'
|
|
2
|
+
import { QueryClient } from '../queryClient'
|
|
3
|
+
import type { Mock } from 'vitest'
|
|
3
4
|
|
|
4
5
|
const queryClient = new QueryClient({
|
|
5
6
|
defaultOptions: {
|
|
@@ -7,4 +8,4 @@ const queryClient = new QueryClient({
|
|
|
7
8
|
},
|
|
8
9
|
})
|
|
9
10
|
|
|
10
|
-
export const useQueryClient = vi.fn(() => queryClient)
|
|
11
|
+
export const useQueryClient: Mock<[], QueryClient> = vi.fn(() => queryClient)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ref } from 'vue-demi'
|
|
2
2
|
import { MutationCache as MutationCacheOrigin } from '@tanstack/query-core'
|
|
3
3
|
|
|
4
|
-
import { MutationCache } from '../mutationCache'
|
|
5
4
|
import { vi } from 'vitest'
|
|
5
|
+
import { MutationCache } from '../mutationCache'
|
|
6
6
|
|
|
7
7
|
describe('MutationCache', () => {
|
|
8
8
|
beforeAll(() => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ref } from 'vue-demi'
|
|
2
2
|
import { QueryCache as QueryCacheOrigin } from '@tanstack/query-core'
|
|
3
3
|
|
|
4
|
-
import { QueryCache } from '../queryCache'
|
|
5
4
|
import { vi } from 'vitest'
|
|
5
|
+
import { QueryCache } from '../queryCache'
|
|
6
6
|
|
|
7
7
|
describe('QueryCache', () => {
|
|
8
8
|
beforeAll(() => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ref } from 'vue-demi'
|
|
2
2
|
import { QueryClient as QueryClientOrigin } from '@tanstack/query-core'
|
|
3
3
|
|
|
4
|
-
import { QueryClient } from '../queryClient'
|
|
5
4
|
import { vi } from 'vitest'
|
|
5
|
+
import { QueryClient } from '../queryClient'
|
|
6
6
|
|
|
7
7
|
vi.mock('@tanstack/query-core')
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { infiniteFetcher, flushPromises } from './test-utils'
|
|
2
|
-
import { useInfiniteQuery } from '../useInfiniteQuery'
|
|
3
1
|
import { vi } from 'vitest'
|
|
2
|
+
import { useInfiniteQuery } from '../useInfiniteQuery'
|
|
3
|
+
import { flushPromises, infiniteFetcher } from './test-utils'
|
|
4
4
|
|
|
5
5
|
vi.mock('../useQueryClient')
|
|
6
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { InfiniteData } from '@tanstack/query-core'
|
|
2
1
|
import { reactive } from 'vue'
|
|
3
2
|
import { useInfiniteQuery } from '../useInfiniteQuery'
|
|
4
|
-
import type { Equal, Expect } from './test-utils'
|
|
5
3
|
import { doNotExecute, simpleFetcher } from './test-utils'
|
|
4
|
+
import type { Equal, Expect } from './test-utils'
|
|
5
|
+
import type { InfiniteData } from '@tanstack/query-core'
|
|
6
6
|
|
|
7
7
|
describe('Discriminated union return type', () => {
|
|
8
8
|
it('data should be possibly undefined by default', () => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { onScopeDispose, reactive } from 'vue-demi'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { vi } from 'vitest'
|
|
4
4
|
import { useQuery } from '../useQuery'
|
|
5
5
|
import { useIsFetching } from '../useIsFetching'
|
|
6
|
-
import {
|
|
6
|
+
import { flushPromises, simpleFetcher } from './test-utils'
|
|
7
7
|
import type { MockedFunction } from 'vitest'
|
|
8
8
|
|
|
9
9
|
vi.mock('../useQueryClient')
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { onScopeDispose, reactive } from 'vue-demi'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { vi } from 'vitest'
|
|
4
4
|
import { useMutation } from '../useMutation'
|
|
5
5
|
import { useIsMutating, useMutationState } from '../useMutationState'
|
|
6
|
-
import { vi } from 'vitest'
|
|
7
|
-
import type { MockedFunction } from 'vitest'
|
|
8
6
|
import { useQueryClient } from '../useQueryClient'
|
|
7
|
+
import { flushPromises, successMutator } from './test-utils'
|
|
8
|
+
import type { MockedFunction } from 'vitest'
|
|
9
9
|
|
|
10
10
|
vi.mock('../useQueryClient')
|
|
11
11
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { reactive, ref } from 'vue-demi'
|
|
2
|
-
import {
|
|
2
|
+
import { vi } from 'vitest'
|
|
3
3
|
import { useMutation } from '../useMutation'
|
|
4
4
|
import { useQueryClient } from '../useQueryClient'
|
|
5
|
-
import {
|
|
5
|
+
import { errorMutator, flushPromises, successMutator } from './test-utils'
|
|
6
6
|
|
|
7
7
|
vi.mock('../useQueryClient')
|
|
8
8
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { onScopeDispose, ref } from 'vue-demi'
|
|
2
2
|
|
|
3
|
+
import { vi } from 'vitest'
|
|
4
|
+
import { useQueries } from '../useQueries'
|
|
5
|
+
import { useQueryClient } from '../useQueryClient'
|
|
6
|
+
import { QueryClient } from '../queryClient'
|
|
3
7
|
import {
|
|
4
8
|
flushPromises,
|
|
9
|
+
getSimpleFetcherWithReturnData,
|
|
5
10
|
rejectFetcher,
|
|
6
11
|
simpleFetcher,
|
|
7
|
-
getSimpleFetcherWithReturnData,
|
|
8
12
|
} from './test-utils'
|
|
9
|
-
import { useQueries } from '../useQueries'
|
|
10
|
-
import { useQueryClient } from '../useQueryClient'
|
|
11
|
-
import { QueryClient } from '../queryClient'
|
|
12
|
-
import { vi } from 'vitest'
|
|
13
13
|
import type { MockedFunction } from 'vitest'
|
|
14
14
|
|
|
15
15
|
vi.mock('../useQueryClient')
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
computed,
|
|
3
|
+
getCurrentInstance,
|
|
4
|
+
onScopeDispose,
|
|
3
5
|
reactive,
|
|
4
6
|
ref,
|
|
5
|
-
onScopeDispose,
|
|
6
|
-
getCurrentInstance,
|
|
7
7
|
} from 'vue-demi'
|
|
8
8
|
import { QueryObserver } from '@tanstack/query-core'
|
|
9
9
|
|
|
10
|
+
import { vi } from 'vitest'
|
|
11
|
+
import { useQuery } from '../useQuery'
|
|
12
|
+
import { useBaseQuery } from '../useBaseQuery'
|
|
10
13
|
import {
|
|
11
14
|
flushPromises,
|
|
15
|
+
getSimpleFetcherWithReturnData,
|
|
12
16
|
rejectFetcher,
|
|
13
17
|
simpleFetcher,
|
|
14
|
-
getSimpleFetcherWithReturnData,
|
|
15
18
|
} from './test-utils'
|
|
16
|
-
import { useQuery } from '../useQuery'
|
|
17
|
-
import { useBaseQuery } from '../useBaseQuery'
|
|
18
|
-
import { vi } from 'vitest'
|
|
19
19
|
import type { Mock, MockedFunction } from 'vitest'
|
|
20
20
|
|
|
21
21
|
vi.mock('../useQueryClient')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getCurrentInstance, inject } from 'vue-demi'
|
|
2
|
+
import { vi } from 'vitest'
|
|
2
3
|
import { useQueryClient } from '../useQueryClient'
|
|
3
4
|
import { VUE_QUERY_CLIENT } from '../utils'
|
|
4
|
-
import { vi } from 'vitest'
|
|
5
5
|
import type { Mock } from 'vitest'
|
|
6
6
|
|
|
7
7
|
describe('useQueryClient', () => {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { App, ComponentOptions } from 'vue'
|
|
2
1
|
import { isVue2, isVue3, ref } from 'vue-demi'
|
|
3
2
|
|
|
3
|
+
import { vi } from 'vitest'
|
|
4
4
|
import { QueryClient } from '../queryClient'
|
|
5
5
|
import { VueQueryPlugin } from '../vueQueryPlugin'
|
|
6
6
|
import { VUE_QUERY_CLIENT } from '../utils'
|
|
7
7
|
import { setupDevtools } from '../devtools/devtools'
|
|
8
|
-
import { flushPromises } from './test-utils'
|
|
9
8
|
import { useQuery } from '../useQuery'
|
|
10
9
|
import { useQueries } from '../useQueries'
|
|
11
|
-
import {
|
|
10
|
+
import { flushPromises } from './test-utils'
|
|
11
|
+
import type { App, ComponentOptions } from 'vue'
|
|
12
12
|
import type { Mock } from 'vitest'
|
|
13
13
|
|
|
14
14
|
vi.mock('../devtools/devtools')
|
package/src/devtools/devtools.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { setupDevtoolsPlugin } from '@vue/devtools-api'
|
|
2
|
-
import type { CustomInspectorNode } from '@vue/devtools-api'
|
|
3
2
|
import { rankItem } from '@tanstack/match-sorter-utils'
|
|
4
3
|
import { onlineManager } from '@tanstack/query-core'
|
|
5
|
-
import type { Query, QueryCacheNotifyEvent } from '@tanstack/query-core'
|
|
6
|
-
import type { QueryClient } from '../queryClient'
|
|
7
4
|
import {
|
|
8
5
|
getQueryStateLabel,
|
|
9
6
|
getQueryStatusBg,
|
|
10
7
|
getQueryStatusFg,
|
|
11
8
|
sortFns,
|
|
12
9
|
} from './utils'
|
|
10
|
+
import type { CustomInspectorNode } from '@vue/devtools-api'
|
|
11
|
+
import type { Query, QueryCacheNotifyEvent } from '@tanstack/query-core'
|
|
12
|
+
import type { QueryClient } from '../queryClient'
|
|
13
13
|
|
|
14
14
|
const pluginId = 'vue-query'
|
|
15
15
|
const pluginName = 'Vue Query'
|
package/src/mutationCache.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { MutationCache as MC } from '@tanstack/query-core'
|
|
2
|
+
import { cloneDeepUnref } from './utils'
|
|
2
3
|
import type {
|
|
4
|
+
DefaultError,
|
|
3
5
|
Mutation,
|
|
4
6
|
MutationFilters,
|
|
5
|
-
DefaultError,
|
|
6
7
|
} from '@tanstack/query-core'
|
|
7
8
|
import type { MaybeRefDeep } from './types'
|
|
8
|
-
import { cloneDeepUnref } from './utils'
|
|
9
9
|
|
|
10
10
|
export class MutationCache extends MC {
|
|
11
11
|
find<
|
package/src/queryCache.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { QueryCache as QC } from '@tanstack/query-core'
|
|
2
|
+
import { cloneDeepUnref } from './utils'
|
|
2
3
|
import type {
|
|
4
|
+
DefaultError,
|
|
3
5
|
Query,
|
|
4
6
|
QueryFilters,
|
|
5
7
|
WithRequired,
|
|
6
|
-
DefaultError,
|
|
7
8
|
} from '@tanstack/query-core'
|
|
8
9
|
import type { MaybeRefDeep } from './types'
|
|
9
|
-
import { cloneDeepUnref } from './utils'
|
|
10
10
|
|
|
11
11
|
export class QueryCache extends QC {
|
|
12
12
|
find<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData>(
|
package/src/queryClient.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { ref } from 'vue-demi'
|
|
2
2
|
import { QueryClient as QC } from '@tanstack/query-core'
|
|
3
|
+
import { cloneDeepUnref } from './utils'
|
|
4
|
+
import { QueryCache } from './queryCache'
|
|
5
|
+
import { MutationCache } from './mutationCache'
|
|
6
|
+
import type { MaybeRefDeep } from './types'
|
|
3
7
|
import type {
|
|
4
|
-
QueryKey,
|
|
5
|
-
QueryClientConfig,
|
|
6
|
-
SetDataOptions,
|
|
7
|
-
ResetOptions,
|
|
8
8
|
CancelOptions,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
RefetchQueryFilters,
|
|
12
|
-
RefetchOptions,
|
|
13
|
-
FetchQueryOptions,
|
|
9
|
+
DefaultError,
|
|
10
|
+
DefaultOptions,
|
|
14
11
|
FetchInfiniteQueryOptions,
|
|
12
|
+
FetchQueryOptions,
|
|
15
13
|
InfiniteData,
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
InvalidateOptions,
|
|
15
|
+
InvalidateQueryFilters,
|
|
16
|
+
MutationFilters,
|
|
18
17
|
MutationKey,
|
|
19
18
|
MutationObserverOptions,
|
|
19
|
+
QueryClientConfig,
|
|
20
20
|
QueryFilters,
|
|
21
|
-
|
|
21
|
+
QueryKey,
|
|
22
|
+
QueryObserverOptions,
|
|
22
23
|
QueryState,
|
|
24
|
+
RefetchOptions,
|
|
25
|
+
RefetchQueryFilters,
|
|
26
|
+
ResetOptions,
|
|
27
|
+
SetDataOptions,
|
|
23
28
|
Updater,
|
|
24
|
-
DefaultError,
|
|
25
29
|
} from '@tanstack/query-core'
|
|
26
|
-
import type { MaybeRefDeep } from './types'
|
|
27
|
-
import { cloneDeepUnref } from './utils'
|
|
28
|
-
import { QueryCache } from './queryCache'
|
|
29
|
-
import { MutationCache } from './mutationCache'
|
|
30
30
|
|
|
31
31
|
export class QueryClient extends QC {
|
|
32
32
|
constructor(config: MaybeRefDeep<QueryClientConfig> = {}) {
|
package/src/useBaseQuery.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
|
+
computed,
|
|
2
3
|
onScopeDispose,
|
|
3
|
-
toRefs,
|
|
4
|
-
readonly,
|
|
5
4
|
reactive,
|
|
5
|
+
readonly,
|
|
6
|
+
toRefs,
|
|
6
7
|
watch,
|
|
7
|
-
computed,
|
|
8
8
|
} from 'vue-demi'
|
|
9
|
+
import { useQueryClient } from './useQueryClient'
|
|
10
|
+
import { cloneDeepUnref, updateState } from './utils'
|
|
9
11
|
import type { ToRefs } from 'vue-demi'
|
|
10
12
|
import type {
|
|
11
|
-
|
|
13
|
+
DefaultedQueryObserverOptions,
|
|
12
14
|
QueryKey,
|
|
15
|
+
QueryObserver,
|
|
13
16
|
QueryObserverResult,
|
|
14
|
-
DefaultedQueryObserverOptions,
|
|
15
17
|
} from '@tanstack/query-core'
|
|
16
|
-
import { useQueryClient } from './useQueryClient'
|
|
17
|
-
import { updateState, cloneDeepUnref } from './utils'
|
|
18
18
|
import type { QueryClient } from './queryClient'
|
|
19
19
|
import type { UseQueryOptions } from './useQuery'
|
|
20
20
|
import type { UseInfiniteQueryOptions } from './useInfiniteQuery'
|
package/src/useInfiniteQuery.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { InfiniteQueryObserver } from '@tanstack/query-core'
|
|
2
|
+
import { useBaseQuery } from './useBaseQuery'
|
|
2
3
|
import type {
|
|
4
|
+
DefaultError,
|
|
3
5
|
InfiniteData,
|
|
6
|
+
InfiniteQueryObserverOptions,
|
|
7
|
+
InfiniteQueryObserverResult,
|
|
8
|
+
QueryKey,
|
|
4
9
|
QueryObserver,
|
|
5
10
|
WithRequired,
|
|
6
|
-
QueryKey,
|
|
7
|
-
InfiniteQueryObserverResult,
|
|
8
|
-
InfiniteQueryObserverOptions,
|
|
9
|
-
DefaultError,
|
|
10
11
|
} from '@tanstack/query-core'
|
|
11
12
|
|
|
12
|
-
import { useBaseQuery } from './useBaseQuery'
|
|
13
13
|
import type { UseBaseQueryReturnType } from './useBaseQuery'
|
|
14
14
|
|
|
15
15
|
import type { DistributiveOmit, MaybeRefDeep } from './types'
|
package/src/useIsFetching.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { computed, onScopeDispose, ref, watch } from 'vue-demi'
|
|
2
|
-
import type { Ref } from 'vue-demi'
|
|
3
|
-
import type { QueryFilters as QF } from '@tanstack/query-core'
|
|
4
2
|
import { useQueryClient } from './useQueryClient'
|
|
5
3
|
import { cloneDeepUnref } from './utils'
|
|
4
|
+
import type { Ref } from 'vue-demi'
|
|
5
|
+
import type { QueryFilters as QF } from '@tanstack/query-core'
|
|
6
6
|
import type { MaybeRefDeep } from './types'
|
|
7
7
|
import type { QueryClient } from './queryClient'
|
|
8
8
|
|
package/src/useMutation.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
|
+
computed,
|
|
2
3
|
onScopeDispose,
|
|
3
4
|
reactive,
|
|
4
5
|
readonly,
|
|
5
6
|
toRefs,
|
|
6
7
|
watch,
|
|
7
|
-
computed,
|
|
8
8
|
} from 'vue-demi'
|
|
9
|
+
import { MutationObserver } from '@tanstack/query-core'
|
|
10
|
+
import { cloneDeepUnref, updateState } from './utils'
|
|
11
|
+
import { useQueryClient } from './useQueryClient'
|
|
9
12
|
import type { ToRefs } from 'vue-demi'
|
|
10
13
|
import type {
|
|
11
|
-
|
|
14
|
+
DefaultError,
|
|
12
15
|
MutateFunction,
|
|
13
|
-
|
|
16
|
+
MutateOptions,
|
|
14
17
|
MutationObserverOptions,
|
|
15
|
-
|
|
18
|
+
MutationObserverResult,
|
|
16
19
|
} from '@tanstack/query-core'
|
|
17
|
-
import type {
|
|
18
|
-
import { MutationObserver } from '@tanstack/query-core'
|
|
19
|
-
import { cloneDeepUnref, updateState } from './utils'
|
|
20
|
-
import { useQueryClient } from './useQueryClient'
|
|
20
|
+
import type { DistributiveOmit, MaybeRefDeep } from './types'
|
|
21
21
|
import type { QueryClient } from './queryClient'
|
|
22
22
|
|
|
23
23
|
type MutationResult<TData, TError, TVariables, TContext> = DistributiveOmit<
|