@tanstack/react-query 5.0.0-alpha.81 → 5.0.0-alpha.84
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/HydrationBoundary.cjs.map +1 -1
- package/build/lib/HydrationBoundary.d.ts.map +1 -1
- package/build/lib/HydrationBoundary.js.map +1 -1
- package/build/lib/HydrationBoundary.legacy.cjs.map +1 -1
- package/build/lib/HydrationBoundary.legacy.js.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.cjs.map +1 -1
- package/build/lib/errorBoundaryUtils.d.ts.map +1 -1
- package/build/lib/errorBoundaryUtils.js.map +1 -1
- package/build/lib/errorBoundaryUtils.legacy.cjs.map +1 -1
- package/build/lib/errorBoundaryUtils.legacy.js.map +1 -1
- package/build/lib/suspense.cjs.map +1 -1
- package/build/lib/suspense.d.ts +1 -1
- package/build/lib/suspense.d.ts.map +1 -1
- package/build/lib/suspense.js.map +1 -1
- package/build/lib/suspense.legacy.cjs.map +1 -1
- package/build/lib/suspense.legacy.js.map +1 -1
- package/build/lib/types.d.ts +1 -1
- package/build/lib/types.d.ts.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 +1 -1
- 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 +1 -1
- 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/package.json +2 -2
- package/src/HydrationBoundary.tsx +1 -1
- package/src/__tests__/HydrationBoundary.test.tsx +5 -5
- package/src/__tests__/QueryClientProvider.test.tsx +2 -2
- package/src/__tests__/QueryResetErrorBoundary.test.tsx +2 -2
- package/src/__tests__/ssr-hydration.test.tsx +2 -2
- package/src/__tests__/ssr.test.tsx +2 -2
- package/src/__tests__/suspense.test.tsx +2 -2
- package/src/__tests__/useInfiniteQuery.test.tsx +2 -2
- package/src/__tests__/useInfiniteQuery.type.test.tsx +2 -2
- package/src/__tests__/useIsFetching.test.tsx +1 -1
- package/src/__tests__/useMutation.test.tsx +2 -2
- package/src/__tests__/useQueries.test.tsx +8 -8
- package/src/__tests__/useQuery.test.tsx +3 -3
- package/src/__tests__/useQuery.types.test.tsx +1 -1
- package/src/__tests__/utils.tsx +2 -2
- package/src/errorBoundaryUtils.ts +2 -2
- package/src/suspense.ts +1 -1
- package/src/types.ts +5 -5
- package/src/useBaseQuery.ts +3 -3
- package/src/useInfiniteQuery.ts +5 -5
- package/src/useIsFetching.ts +1 -1
- package/src/useMutation.ts +3 -3
- package/src/useMutationState.ts +5 -5
- package/src/useQueries.ts +11 -11
- package/src/useQuery.ts +2 -2
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import { shouldThrowError } from './utils'
|
|
2
4
|
import type {
|
|
3
5
|
DefaultedQueryObserverOptions,
|
|
4
6
|
Query,
|
|
@@ -7,8 +9,6 @@ import type {
|
|
|
7
9
|
ThrowOnError,
|
|
8
10
|
} from '@tanstack/query-core'
|
|
9
11
|
import type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'
|
|
10
|
-
import * as React from 'react'
|
|
11
|
-
import { shouldThrowError } from './utils'
|
|
12
12
|
|
|
13
13
|
export const ensurePreventErrorBoundaryRetry = <
|
|
14
14
|
TQueryFnData,
|
package/src/suspense.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/* istanbul ignore file */
|
|
2
2
|
|
|
3
3
|
import type {
|
|
4
|
+
DefaultError,
|
|
5
|
+
DefinedQueryObserverResult,
|
|
4
6
|
InfiniteQueryObserverOptions,
|
|
5
7
|
InfiniteQueryObserverResult,
|
|
8
|
+
MutateFunction,
|
|
9
|
+
MutationObserverOptions,
|
|
6
10
|
MutationObserverResult,
|
|
11
|
+
QueryKey,
|
|
7
12
|
QueryObserverOptions,
|
|
8
13
|
QueryObserverResult,
|
|
9
|
-
QueryKey,
|
|
10
|
-
MutationObserverOptions,
|
|
11
|
-
MutateFunction,
|
|
12
|
-
DefinedQueryObserverResult,
|
|
13
14
|
WithRequired,
|
|
14
|
-
DefaultError,
|
|
15
15
|
} from '@tanstack/query-core'
|
|
16
16
|
|
|
17
17
|
export interface UseBaseQueryOptions<
|
package/src/useBaseQuery.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
import type { QueryClient, QueryKey, QueryObserver } from '@tanstack/query-core'
|
|
5
4
|
import { notifyManager } from '@tanstack/query-core'
|
|
6
5
|
import { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'
|
|
7
6
|
import { useQueryClient } from './QueryClientProvider'
|
|
8
|
-
import type { UseBaseQueryOptions } from './types'
|
|
9
7
|
import { useIsRestoring } from './isRestoring'
|
|
10
8
|
import {
|
|
11
9
|
ensurePreventErrorBoundaryRetry,
|
|
12
10
|
getHasError,
|
|
13
11
|
useClearResetErrorBoundary,
|
|
14
12
|
} from './errorBoundaryUtils'
|
|
15
|
-
import { ensureStaleTime,
|
|
13
|
+
import { ensureStaleTime, fetchOptimistic, shouldSuspend } from './suspense'
|
|
14
|
+
import type { UseBaseQueryOptions } from './types'
|
|
15
|
+
import type { QueryClient, QueryKey, QueryObserver } from '@tanstack/query-core'
|
|
16
16
|
|
|
17
17
|
export function useBaseQuery<
|
|
18
18
|
TQueryFnData,
|
package/src/useInfiniteQuery.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client'
|
|
2
|
+
import { InfiniteQueryObserver } from '@tanstack/query-core'
|
|
3
|
+
import { useBaseQuery } from './useBaseQuery'
|
|
2
4
|
import type {
|
|
3
|
-
QueryObserver,
|
|
4
|
-
QueryKey,
|
|
5
|
-
QueryClient,
|
|
6
5
|
DefaultError,
|
|
7
6
|
InfiniteData,
|
|
7
|
+
QueryClient,
|
|
8
|
+
QueryKey,
|
|
9
|
+
QueryObserver,
|
|
8
10
|
} from '@tanstack/query-core'
|
|
9
|
-
import { InfiniteQueryObserver } from '@tanstack/query-core'
|
|
10
11
|
import type { UseInfiniteQueryOptions, UseInfiniteQueryResult } from './types'
|
|
11
|
-
import { useBaseQuery } from './useBaseQuery'
|
|
12
12
|
|
|
13
13
|
// HOOK
|
|
14
14
|
export function useInfiniteQuery<
|
package/src/useIsFetching.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import type { QueryClient, QueryFilters } from '@tanstack/query-core'
|
|
4
3
|
import { notifyManager } from '@tanstack/query-core'
|
|
5
4
|
|
|
6
5
|
import { useQueryClient } from './QueryClientProvider'
|
|
6
|
+
import type { QueryClient, QueryFilters } from '@tanstack/query-core'
|
|
7
7
|
|
|
8
8
|
export function useIsFetching(
|
|
9
9
|
filters?: QueryFilters,
|
package/src/useMutation.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import
|
|
4
|
-
import { notifyManager, MutationObserver } from '@tanstack/query-core'
|
|
3
|
+
import { MutationObserver, notifyManager } from '@tanstack/query-core'
|
|
5
4
|
import { useQueryClient } from './QueryClientProvider'
|
|
5
|
+
import { shouldThrowError } from './utils'
|
|
6
6
|
import type {
|
|
7
7
|
UseMutateFunction,
|
|
8
8
|
UseMutationOptions,
|
|
9
9
|
UseMutationResult,
|
|
10
10
|
} from './types'
|
|
11
|
-
import {
|
|
11
|
+
import type { DefaultError, QueryClient } from '@tanstack/query-core'
|
|
12
12
|
|
|
13
13
|
// HOOK
|
|
14
14
|
|
package/src/useMutationState.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
+
import { notifyManager, replaceEqualDeep } from '@tanstack/query-core'
|
|
5
|
+
import { useQueryClient } from './QueryClientProvider'
|
|
4
6
|
import type {
|
|
5
|
-
|
|
6
|
-
QueryClient,
|
|
7
|
+
DefaultError,
|
|
7
8
|
Mutation,
|
|
8
9
|
MutationCache,
|
|
9
|
-
|
|
10
|
+
MutationFilters,
|
|
10
11
|
MutationState,
|
|
12
|
+
QueryClient,
|
|
11
13
|
} from '@tanstack/query-core'
|
|
12
|
-
import { notifyManager, replaceEqualDeep } from '@tanstack/query-core'
|
|
13
|
-
import { useQueryClient } from './QueryClientProvider'
|
|
14
14
|
|
|
15
15
|
export function useIsMutating(
|
|
16
16
|
filters?: MutationFilters,
|
package/src/useQueries.ts
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
QueryKey,
|
|
6
|
-
QueryFunction,
|
|
7
|
-
QueriesPlaceholderDataFunction,
|
|
8
|
-
QueryClient,
|
|
9
|
-
DefaultError,
|
|
10
|
-
QueriesObserverOptions,
|
|
11
|
-
} from '@tanstack/query-core'
|
|
12
|
-
import { notifyManager, QueriesObserver } from '@tanstack/query-core'
|
|
4
|
+
import { QueriesObserver, notifyManager } from '@tanstack/query-core'
|
|
13
5
|
import { useQueryClient } from './QueryClientProvider'
|
|
14
|
-
import type { UseQueryOptions, UseQueryResult } from './types'
|
|
15
6
|
import { useIsRestoring } from './isRestoring'
|
|
16
7
|
import { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'
|
|
17
8
|
import {
|
|
@@ -21,10 +12,19 @@ import {
|
|
|
21
12
|
} from './errorBoundaryUtils'
|
|
22
13
|
import {
|
|
23
14
|
ensureStaleTime,
|
|
24
|
-
shouldSuspend,
|
|
25
15
|
fetchOptimistic,
|
|
16
|
+
shouldSuspend,
|
|
26
17
|
willFetch,
|
|
27
18
|
} from './suspense'
|
|
19
|
+
import type { UseQueryOptions, UseQueryResult } from './types'
|
|
20
|
+
import type {
|
|
21
|
+
DefaultError,
|
|
22
|
+
QueriesObserverOptions,
|
|
23
|
+
QueriesPlaceholderDataFunction,
|
|
24
|
+
QueryClient,
|
|
25
|
+
QueryFunction,
|
|
26
|
+
QueryKey,
|
|
27
|
+
} from '@tanstack/query-core'
|
|
28
28
|
|
|
29
29
|
// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.
|
|
30
30
|
// `placeholderData` function does not have a parameter
|
package/src/useQuery.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import type { QueryClient, QueryKey, DefaultError } from '@tanstack/query-core'
|
|
3
2
|
import { QueryObserver } from '@tanstack/query-core'
|
|
3
|
+
import { useBaseQuery } from './useBaseQuery'
|
|
4
|
+
import type { DefaultError, QueryClient, QueryKey } 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
|
import type {
|
|
11
11
|
DefinedInitialDataOptions,
|
|
12
12
|
UndefinedInitialDataOptions,
|