@tanstack/react-query 4.29.23 → 4.30.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/build/lib/Hydrate.d.ts.map +1 -1
- package/build/lib/Hydrate.esm.js.map +1 -1
- package/build/lib/Hydrate.js.map +1 -1
- package/build/lib/Hydrate.mjs.map +1 -1
- package/build/lib/__tests__/utils.d.ts +1 -1
- package/build/lib/__tests__/utils.d.ts.map +1 -1
- package/build/lib/errorBoundaryUtils.d.ts.map +1 -1
- package/build/lib/errorBoundaryUtils.esm.js.map +1 -1
- package/build/lib/errorBoundaryUtils.js.map +1 -1
- package/build/lib/errorBoundaryUtils.mjs.map +1 -1
- package/build/lib/reactBatchedUpdates.d.ts.map +1 -1
- package/build/lib/reactBatchedUpdates.esm.js.map +1 -1
- package/build/lib/reactBatchedUpdates.js.map +1 -1
- package/build/lib/reactBatchedUpdates.mjs.map +1 -1
- package/build/lib/reactBatchedUpdates.native.d.ts.map +1 -1
- package/build/lib/types.d.ts +1 -1
- package/build/lib/types.d.ts.map +1 -1
- package/build/lib/useBaseQuery.d.ts.map +1 -1
- package/build/lib/useBaseQuery.esm.js +1 -1
- package/build/lib/useBaseQuery.esm.js.map +1 -1
- package/build/lib/useBaseQuery.js +1 -1
- package/build/lib/useBaseQuery.js.map +1 -1
- package/build/lib/useBaseQuery.mjs +1 -1
- package/build/lib/useBaseQuery.mjs.map +1 -1
- package/build/lib/useInfiniteQuery.d.ts.map +1 -1
- package/build/lib/useInfiniteQuery.esm.js.map +1 -1
- package/build/lib/useInfiniteQuery.js.map +1 -1
- package/build/lib/useInfiniteQuery.mjs.map +1 -1
- package/build/lib/useIsFetching.d.ts +1 -1
- package/build/lib/useIsFetching.d.ts.map +1 -1
- package/build/lib/useIsFetching.esm.js.map +1 -1
- package/build/lib/useIsFetching.js.map +1 -1
- package/build/lib/useIsFetching.mjs.map +1 -1
- package/build/lib/useIsMutating.d.ts +1 -1
- package/build/lib/useIsMutating.d.ts.map +1 -1
- package/build/lib/useIsMutating.esm.js +1 -1
- package/build/lib/useIsMutating.esm.js.map +1 -1
- package/build/lib/useIsMutating.js +1 -1
- package/build/lib/useIsMutating.js.map +1 -1
- package/build/lib/useIsMutating.mjs +1 -1
- package/build/lib/useIsMutating.mjs.map +1 -1
- package/build/lib/useMutation.d.ts.map +1 -1
- package/build/lib/useMutation.esm.js +1 -1
- package/build/lib/useMutation.esm.js.map +1 -1
- package/build/lib/useMutation.js +1 -1
- package/build/lib/useMutation.js.map +1 -1
- package/build/lib/useMutation.mjs +1 -1
- package/build/lib/useMutation.mjs.map +1 -1
- package/build/lib/useQueries.d.ts +1 -1
- package/build/lib/useQueries.d.ts.map +1 -1
- package/build/lib/useQueries.esm.js +1 -3
- package/build/lib/useQueries.esm.js.map +1 -1
- package/build/lib/useQueries.js +1 -3
- package/build/lib/useQueries.js.map +1 -1
- package/build/lib/useQueries.mjs +1 -3
- package/build/lib/useQueries.mjs.map +1 -1
- package/build/lib/useQuery.d.ts.map +1 -1
- package/build/lib/useQuery.esm.js.map +1 -1
- package/build/lib/useQuery.js.map +1 -1
- package/build/lib/useQuery.mjs.map +1 -1
- package/build/umd/index.development.js +3 -4
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/Hydrate.tsx +1 -1
- package/src/__tests__/Hydrate.test.tsx +4 -4
- package/src/__tests__/QueryClientProvider.test.tsx +2 -2
- package/src/__tests__/QueryResetErrorBoundary.test.tsx +1 -1
- package/src/__tests__/ssr-hydration.test.tsx +2 -2
- package/src/__tests__/ssr.test.tsx +2 -2
- package/src/__tests__/suspense.test.tsx +1 -1
- package/src/__tests__/useInfiniteQuery.test.tsx +1 -1
- package/src/__tests__/useIsFetching.test.tsx +1 -1
- package/src/__tests__/useIsMutating.test.tsx +3 -3
- package/src/__tests__/useMutation.test.tsx +2 -2
- package/src/__tests__/useQueries.test.tsx +1 -1
- package/src/__tests__/useQuery.test.tsx +252 -85
- package/src/__tests__/utils.tsx +2 -2
- package/src/errorBoundaryUtils.ts +2 -2
- package/src/reactBatchedUpdates.native.ts +1 -0
- package/src/reactBatchedUpdates.ts +1 -0
- package/src/types.ts +4 -4
- package/src/useBaseQuery.ts +4 -4
- package/src/useInfiniteQuery.ts +3 -3
- package/src/useIsFetching.ts +2 -2
- package/src/useIsMutating.ts +3 -3
- package/src/useMutation.ts +5 -5
- package/src/useQueries.ts +5 -5
- package/src/useQuery.ts +2 -2
package/src/useInfiniteQuery.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client'
|
|
2
|
+
import { InfiniteQueryObserver, parseQueryArgs } from '@tanstack/query-core'
|
|
3
|
+
import { useBaseQuery } from './useBaseQuery'
|
|
2
4
|
import type {
|
|
3
|
-
QueryObserver,
|
|
4
5
|
QueryFunction,
|
|
5
6
|
QueryKey,
|
|
7
|
+
QueryObserver,
|
|
6
8
|
} from '@tanstack/query-core'
|
|
7
|
-
import { InfiniteQueryObserver, parseQueryArgs } from '@tanstack/query-core'
|
|
8
9
|
import type { UseInfiniteQueryOptions, UseInfiniteQueryResult } from './types'
|
|
9
|
-
import { useBaseQuery } from './useBaseQuery'
|
|
10
10
|
|
|
11
11
|
// HOOK
|
|
12
12
|
|
package/src/useIsFetching.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import type { QueryKey, QueryFilters } from '@tanstack/query-core'
|
|
4
3
|
import { notifyManager, parseFilterArgs } from '@tanstack/query-core'
|
|
5
4
|
|
|
6
5
|
import { useSyncExternalStore } from './useSyncExternalStore'
|
|
7
|
-
import type { ContextOptions } from './types'
|
|
8
6
|
import { useQueryClient } from './QueryClientProvider'
|
|
7
|
+
import type { ContextOptions } from './types'
|
|
8
|
+
import type { QueryFilters, QueryKey } from '@tanstack/query-core'
|
|
9
9
|
|
|
10
10
|
interface Options extends ContextOptions {}
|
|
11
11
|
|
package/src/useIsMutating.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
+
import { notifyManager, parseMutationFilterArgs } from '@tanstack/query-core'
|
|
3
4
|
import { useSyncExternalStore } from './useSyncExternalStore'
|
|
4
5
|
|
|
5
|
-
import type { MutationKey, MutationFilters } from '@tanstack/query-core'
|
|
6
|
-
import { notifyManager, parseMutationFilterArgs } from '@tanstack/query-core'
|
|
7
|
-
import type { ContextOptions } from './types'
|
|
8
6
|
import { useQueryClient } from './QueryClientProvider'
|
|
7
|
+
import type { MutationFilters, MutationKey } from '@tanstack/query-core'
|
|
8
|
+
import type { ContextOptions } from './types'
|
|
9
9
|
|
|
10
10
|
interface Options extends ContextOptions {}
|
|
11
11
|
|
package/src/useMutation.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import { useSyncExternalStore } from './useSyncExternalStore'
|
|
4
|
-
|
|
5
|
-
import type { MutationFunction, MutationKey } from '@tanstack/query-core'
|
|
6
3
|
import {
|
|
4
|
+
MutationObserver,
|
|
7
5
|
notifyManager,
|
|
8
6
|
parseMutationArgs,
|
|
9
|
-
MutationObserver,
|
|
10
7
|
} from '@tanstack/query-core'
|
|
8
|
+
import { useSyncExternalStore } from './useSyncExternalStore'
|
|
9
|
+
|
|
11
10
|
import { useQueryClient } from './QueryClientProvider'
|
|
11
|
+
import { shouldThrowError } from './utils'
|
|
12
|
+
import type { MutationFunction, MutationKey } from '@tanstack/query-core'
|
|
12
13
|
import type {
|
|
13
14
|
UseMutateFunction,
|
|
14
15
|
UseMutationOptions,
|
|
15
16
|
UseMutationResult,
|
|
16
17
|
} from './types'
|
|
17
|
-
import { shouldThrowError } from './utils'
|
|
18
18
|
|
|
19
19
|
// HOOK
|
|
20
20
|
|
package/src/useQueries.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import { useSyncExternalStore } from './useSyncExternalStore'
|
|
4
3
|
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
4
|
+
import { QueriesObserver, notifyManager } from '@tanstack/query-core'
|
|
5
|
+
import { useSyncExternalStore } from './useSyncExternalStore'
|
|
7
6
|
import { useQueryClient } from './QueryClientProvider'
|
|
8
|
-
import type { UseQueryOptions, UseQueryResult } from './types'
|
|
9
7
|
import { useIsRestoring } from './isRestoring'
|
|
10
8
|
import { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'
|
|
11
9
|
import {
|
|
@@ -15,10 +13,12 @@ import {
|
|
|
15
13
|
} from './errorBoundaryUtils'
|
|
16
14
|
import {
|
|
17
15
|
ensureStaleTime,
|
|
18
|
-
shouldSuspend,
|
|
19
16
|
fetchOptimistic,
|
|
17
|
+
shouldSuspend,
|
|
20
18
|
willFetch,
|
|
21
19
|
} from './suspense'
|
|
20
|
+
import type { QueryFunction, QueryKey } from '@tanstack/query-core'
|
|
21
|
+
import type { UseQueryOptions, UseQueryResult } from './types'
|
|
22
22
|
|
|
23
23
|
// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.
|
|
24
24
|
// - `context` is omitted as it is passed as a root-level option to `useQueries` instead.
|
package/src/useQuery.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client'
|
|
2
|
+
import { QueryObserver, parseQueryArgs } from '@tanstack/query-core'
|
|
3
|
+
import { useBaseQuery } from './useBaseQuery'
|
|
2
4
|
import type { QueryFunction, QueryKey } from '@tanstack/query-core'
|
|
3
|
-
import { parseQueryArgs, QueryObserver } from '@tanstack/query-core'
|
|
4
5
|
import type {
|
|
5
6
|
DefinedUseQueryResult,
|
|
6
7
|
UseQueryOptions,
|
|
7
8
|
UseQueryResult,
|
|
8
9
|
} from './types'
|
|
9
|
-
import { useBaseQuery } from './useBaseQuery'
|
|
10
10
|
|
|
11
11
|
// HOOK
|
|
12
12
|
|