@trpc/react-query 11.0.0-next-alpha.153 → 11.0.0-next-alpha.155
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/bundle-analysis.json +38 -38
- package/dist/{createHooksInternal-40609d46.js → createHooksInternal-7ec4d77f.js} +2 -2
- package/dist/{createHooksInternal-13dc16e4.mjs → createHooksInternal-99f56cf8.mjs} +2 -2
- package/dist/{createHooksInternal-4571281b.js → createHooksInternal-e15b2117.js} +4 -4
- package/dist/createTRPCQueryUtils.d.ts +2 -2
- package/dist/createTRPCQueryUtils.d.ts.map +1 -1
- package/dist/createTRPCReact.d.ts +7 -9
- package/dist/createTRPCReact.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/internals/context.d.ts +5 -6
- package/dist/internals/context.d.ts.map +1 -1
- package/dist/internals/getClientArgs.d.ts +1 -1
- package/dist/internals/getClientArgs.d.ts.map +1 -1
- package/dist/internals/getQueryKey.d.ts +2 -3
- package/dist/internals/getQueryKey.d.ts.map +1 -1
- package/dist/internals/useQueries.d.ts +3 -4
- package/dist/internals/useQueries.d.ts.map +1 -1
- package/dist/server/index.js +5 -6
- package/dist/server/index.mjs +2 -3
- package/dist/server/ssgProxy.d.ts +5 -6
- package/dist/server/ssgProxy.d.ts.map +1 -1
- package/dist/shared/hooks/createHooksInternal.d.ts +6 -6
- package/dist/shared/hooks/createHooksInternal.d.ts.map +1 -1
- package/dist/shared/hooks/types.d.ts +7 -8
- package/dist/shared/hooks/types.d.ts.map +1 -1
- package/dist/shared/index.js +3 -3
- package/dist/shared/index.mjs +3 -3
- package/dist/shared/polymorphism/mutationLike.d.ts +2 -3
- package/dist/shared/polymorphism/mutationLike.d.ts.map +1 -1
- package/dist/shared/polymorphism/queryLike.d.ts +2 -3
- package/dist/shared/polymorphism/queryLike.d.ts.map +1 -1
- package/dist/shared/polymorphism/routerLike.d.ts +3 -3
- package/dist/shared/polymorphism/routerLike.d.ts.map +1 -1
- package/dist/shared/polymorphism/utilsLike.d.ts +2 -2
- package/dist/shared/polymorphism/utilsLike.d.ts.map +1 -1
- package/dist/shared/proxy/decorationProxy.d.ts +2 -2
- package/dist/shared/proxy/decorationProxy.d.ts.map +1 -1
- package/dist/shared/proxy/useQueriesProxy.d.ts +3 -5
- package/dist/shared/proxy/useQueriesProxy.d.ts.map +1 -1
- package/dist/shared/proxy/utilsProxy.d.ts +6 -8
- package/dist/shared/proxy/utilsProxy.d.ts.map +1 -1
- package/dist/shared/queryClient.d.ts +2 -1
- package/dist/shared/queryClient.d.ts.map +1 -1
- package/dist/shared/types.d.ts +2 -3
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/utils/createUtilityFunctions.d.ts +5 -4
- package/dist/utils/createUtilityFunctions.d.ts.map +1 -1
- package/dist/utils/inferReactQueryProcedure.d.ts +3 -4
- package/dist/utils/inferReactQueryProcedure.d.ts.map +1 -1
- package/dist/{utilsProxy-a640c81e.js → utilsProxy-003891dc.js} +1 -1
- package/dist/{utilsProxy-790567b0.js → utilsProxy-aa151f2c.js} +4 -4
- package/dist/{utilsProxy-21e16b5c.mjs → utilsProxy-e4c93b46.mjs} +1 -1
- package/package.json +7 -6
- package/src/createTRPCQueryUtils.tsx +3 -5
- package/src/createTRPCReact.tsx +16 -20
- package/src/internals/context.tsx +5 -6
- package/src/internals/getClientArgs.ts +1 -1
- package/src/internals/getQueryKey.ts +4 -4
- package/src/internals/useQueries.ts +3 -4
- package/src/server/ssgProxy.ts +14 -21
- package/src/shared/hooks/createHooksInternal.tsx +11 -12
- package/src/shared/hooks/types.ts +7 -8
- package/src/shared/polymorphism/mutationLike.ts +7 -3
- package/src/shared/polymorphism/queryLike.ts +7 -3
- package/src/shared/polymorphism/routerLike.ts +4 -4
- package/src/shared/polymorphism/utilsLike.ts +2 -2
- package/src/shared/proxy/decorationProxy.ts +3 -3
- package/src/shared/proxy/useQueriesProxy.ts +8 -10
- package/src/shared/proxy/utilsProxy.ts +13 -20
- package/src/shared/queryClient.ts +2 -1
- package/src/shared/types.ts +2 -3
- package/src/utils/createUtilityFunctions.ts +5 -8
- package/src/utils/inferReactQueryProcedure.ts +5 -5
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DehydratedState } from '@tanstack/react-query';
|
|
1
2
|
import {
|
|
2
3
|
useInfiniteQuery as __useInfiniteQuery,
|
|
3
4
|
useMutation as __useMutation,
|
|
@@ -6,29 +7,27 @@ import {
|
|
|
6
7
|
useSuspenseInfiniteQuery as __useSuspenseInfiniteQuery,
|
|
7
8
|
useSuspenseQueries as __useSuspenseQueries,
|
|
8
9
|
useSuspenseQuery as __useSuspenseQuery,
|
|
9
|
-
DehydratedState,
|
|
10
10
|
hashKey,
|
|
11
11
|
useQueryClient,
|
|
12
12
|
} from '@tanstack/react-query';
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
13
|
+
import type { TRPCClientErrorLike } from '@trpc/client';
|
|
14
|
+
import { createTRPCUntypedClient } from '@trpc/client';
|
|
15
|
+
import type { AnyRouter } from '@trpc/core';
|
|
15
16
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
TRPCContext,
|
|
19
|
-
TRPCContextState,
|
|
20
|
-
} from '../../internals/context';
|
|
17
|
+
import type { SSRState, TRPCContextState } from '../../internals/context';
|
|
18
|
+
import { TRPCContext } from '../../internals/context';
|
|
21
19
|
import { getClientArgs } from '../../internals/getClientArgs';
|
|
22
|
-
import {
|
|
20
|
+
import type { TRPCQueryKey } from '../../internals/getQueryKey';
|
|
21
|
+
import { getQueryKeyInternal } from '../../internals/getQueryKey';
|
|
23
22
|
import { useHookResult } from '../../internals/useHookResult';
|
|
24
|
-
import {
|
|
23
|
+
import type {
|
|
25
24
|
TRPCUseQueries,
|
|
26
25
|
TRPCUseSuspenseQueries,
|
|
27
26
|
} from '../../internals/useQueries';
|
|
28
27
|
import { createUtilityFunctions } from '../../utils/createUtilityFunctions';
|
|
29
28
|
import { createUseQueries } from '../proxy/useQueriesProxy';
|
|
30
|
-
import { CreateTRPCReactOptions, UseMutationOverride } from '../types';
|
|
31
|
-
import {
|
|
29
|
+
import type { CreateTRPCReactOptions, UseMutationOverride } from '../types';
|
|
30
|
+
import type {
|
|
32
31
|
CreateClient,
|
|
33
32
|
TRPCProvider,
|
|
34
33
|
TRPCQueryOptions,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
DefinedUseQueryResult,
|
|
3
3
|
DehydratedState,
|
|
4
4
|
InfiniteData,
|
|
@@ -17,17 +17,16 @@ import {
|
|
|
17
17
|
UseSuspenseQueryOptions,
|
|
18
18
|
UseSuspenseQueryResult,
|
|
19
19
|
} from '@tanstack/react-query';
|
|
20
|
-
import {
|
|
20
|
+
import type {
|
|
21
21
|
CreateTRPCClientOptions,
|
|
22
22
|
TRPCRequestOptions,
|
|
23
23
|
TRPCUntypedClient,
|
|
24
24
|
} from '@trpc/client';
|
|
25
|
-
import { AnyRouter } from '@trpc/
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import { TRPCHookResult } from '../../internals/useHookResult';
|
|
25
|
+
import type { AnyRouter, DistributiveOmit } from '@trpc/core';
|
|
26
|
+
import type { ReactNode } from 'react';
|
|
27
|
+
import type { TRPCContextProps } from '../../internals/context';
|
|
28
|
+
import type { TRPCQueryKey } from '../../internals/getQueryKey';
|
|
29
|
+
import type { TRPCHookResult } from '../../internals/useHookResult';
|
|
31
30
|
|
|
32
31
|
export type OutputWithCursor<TData, TCursor = any> = {
|
|
33
32
|
cursor: TCursor | null;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type {
|
|
2
|
+
AnyProcedure,
|
|
3
|
+
AnyRootConfig,
|
|
4
|
+
inferProcedureInput,
|
|
5
|
+
inferTransformedProcedureOutput,
|
|
6
|
+
} from '@trpc/core';
|
|
7
|
+
import type {
|
|
4
8
|
InferMutationOptions,
|
|
5
9
|
InferMutationResult,
|
|
6
10
|
} from '../../utils/inferReactQueryProcedure';
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type {
|
|
2
|
+
AnyProcedure,
|
|
3
|
+
AnyRootConfig,
|
|
4
|
+
inferProcedureInput,
|
|
5
|
+
inferTransformedProcedureOutput,
|
|
6
|
+
} from '@trpc/core';
|
|
7
|
+
import type {
|
|
4
8
|
InferQueryOptions,
|
|
5
9
|
InferQueryResult,
|
|
6
10
|
} from '../../utils/inferReactQueryProcedure';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
AnyMutationProcedure,
|
|
3
3
|
AnyProcedure,
|
|
4
4
|
AnyQueryProcedure,
|
|
5
5
|
AnyRootConfig,
|
|
6
6
|
AnyRouter,
|
|
7
|
-
} from '@trpc/
|
|
8
|
-
import { MutationLike } from './mutationLike';
|
|
9
|
-
import { QueryLike } from './queryLike';
|
|
7
|
+
} from '@trpc/core';
|
|
8
|
+
import type { MutationLike } from './mutationLike';
|
|
9
|
+
import type { QueryLike } from './queryLike';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Use to describe a route path which matches a given route's interface
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyRouter } from '@trpc/
|
|
2
|
-
import { DecoratedProcedureUtilsRecord } from '../proxy/utilsProxy';
|
|
1
|
+
import type { AnyRouter } from '@trpc/core';
|
|
2
|
+
import type { DecoratedProcedureUtilsRecord } from '../proxy/utilsProxy';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Use to describe a Utils/Context path which matches the given route's interface
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AnyRouter } from '@trpc/
|
|
2
|
-
import { createRecursiveProxy } from '@trpc/
|
|
3
|
-
import { CreateReactQueryHooks } from '../hooks/createHooksInternal';
|
|
1
|
+
import type { AnyRouter } from '@trpc/core';
|
|
2
|
+
import { createRecursiveProxy } from '@trpc/core';
|
|
3
|
+
import type { CreateReactQueryHooks } from '../hooks/createHooksInternal';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Create proxy for decorating procedures
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import { QueryOptions } from '@tanstack/react-query';
|
|
2
|
-
import { TRPCClientError, TRPCUntypedClient } from '@trpc/client';
|
|
3
|
-
import {
|
|
1
|
+
import type { QueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { TRPCClientError, TRPCUntypedClient } from '@trpc/client';
|
|
3
|
+
import type {
|
|
4
4
|
AnyProcedure,
|
|
5
5
|
AnyQueryProcedure,
|
|
6
6
|
AnyRootConfig,
|
|
7
7
|
AnyRouter,
|
|
8
|
+
Filter,
|
|
8
9
|
inferProcedureInput,
|
|
9
|
-
} from '@trpc/server';
|
|
10
|
-
import {
|
|
11
|
-
createRecursiveProxy,
|
|
12
10
|
inferTransformedProcedureOutput,
|
|
13
|
-
} from '@trpc/
|
|
14
|
-
import {
|
|
11
|
+
} from '@trpc/core';
|
|
12
|
+
import { createRecursiveProxy } from '@trpc/core';
|
|
15
13
|
import { getQueryKeyInternal } from '../../internals/getQueryKey';
|
|
16
|
-
import {
|
|
14
|
+
import type {
|
|
17
15
|
TrpcQueryOptionsForUseQueries,
|
|
18
16
|
TrpcQueryOptionsForUseSuspenseQueries,
|
|
19
17
|
} from '../../internals/useQueries';
|
|
20
|
-
import { TRPCUseQueryBaseOptions } from '../hooks/types';
|
|
18
|
+
import type { TRPCUseQueryBaseOptions } from '../hooks/types';
|
|
21
19
|
|
|
22
20
|
type GetQueryOptions<
|
|
23
21
|
TConfig extends AnyRootConfig,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
CancelOptions,
|
|
3
3
|
InfiniteData,
|
|
4
4
|
InvalidateOptions,
|
|
@@ -10,37 +10,30 @@ import {
|
|
|
10
10
|
SetDataOptions,
|
|
11
11
|
Updater,
|
|
12
12
|
} from '@tanstack/react-query';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import type { TRPCClientError } from '@trpc/client';
|
|
14
|
+
import { createTRPCClientProxy } from '@trpc/client';
|
|
15
|
+
import type {
|
|
15
16
|
AnyQueryProcedure,
|
|
16
17
|
AnyRootConfig,
|
|
17
18
|
AnyRouter,
|
|
18
|
-
inferProcedureInput,
|
|
19
|
-
} from '@trpc/server';
|
|
20
|
-
import {
|
|
21
|
-
createFlatProxy,
|
|
22
|
-
createRecursiveProxy,
|
|
23
|
-
inferTransformedProcedureOutput,
|
|
24
|
-
} from '@trpc/server/shared';
|
|
25
|
-
import {
|
|
26
19
|
DeepPartial,
|
|
27
20
|
Filter,
|
|
21
|
+
inferProcedureInput,
|
|
22
|
+
inferTransformedProcedureOutput,
|
|
28
23
|
ProtectedIntersection,
|
|
29
|
-
} from '@trpc/
|
|
30
|
-
import {
|
|
31
|
-
|
|
24
|
+
} from '@trpc/core';
|
|
25
|
+
import { createFlatProxy, createRecursiveProxy } from '@trpc/core';
|
|
26
|
+
import type {
|
|
32
27
|
DecoratedTRPCContextProps,
|
|
33
28
|
TRPCContextState,
|
|
34
29
|
TRPCFetchInfiniteQueryOptions,
|
|
35
30
|
TRPCFetchQueryOptions,
|
|
36
31
|
TRPCQueryUtils,
|
|
37
32
|
} from '../../internals/context';
|
|
38
|
-
import {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} from '../../internals/getQueryKey';
|
|
43
|
-
import { ExtractCursorType } from '../hooks/types';
|
|
33
|
+
import { contextProps } from '../../internals/context';
|
|
34
|
+
import type { QueryKeyKnown, QueryType } from '../../internals/getQueryKey';
|
|
35
|
+
import { getQueryKeyInternal } from '../../internals/getQueryKey';
|
|
36
|
+
import type { ExtractCursorType } from '../hooks/types';
|
|
44
37
|
|
|
45
38
|
type DecorateProcedure<
|
|
46
39
|
TConfig extends AnyRootConfig,
|
package/src/shared/types.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
-
import { AnyRouter } from '@trpc/
|
|
3
|
-
import { MaybePromise } from '@trpc/server/unstableInternalsExport';
|
|
1
|
+
import type { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import type { AnyRouter, MaybePromise } from '@trpc/core';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* @internal
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { QueryClient } from '@tanstack/react-query';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
TRPCUntypedClient,
|
|
6
|
-
} from '@trpc/client';
|
|
7
|
-
import { AnyRouter } from '@trpc/server';
|
|
1
|
+
import type { QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import type { CreateTRPCClient } from '@trpc/client';
|
|
3
|
+
import { getUntypedClient, TRPCUntypedClient } from '@trpc/client';
|
|
4
|
+
import type { AnyRouter } from '@trpc/core';
|
|
8
5
|
import { getClientArgs } from '../internals/getClientArgs';
|
|
9
|
-
import { TRPCQueryUtils } from '../shared';
|
|
6
|
+
import type { TRPCQueryUtils } from '../shared';
|
|
10
7
|
|
|
11
8
|
export interface CreateQueryUtilsOptions<TRouter extends AnyRouter> {
|
|
12
9
|
/**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { TRPCClientErrorLike } from '@trpc/client';
|
|
2
|
-
import {
|
|
1
|
+
import type { TRPCClientErrorLike } from '@trpc/client';
|
|
2
|
+
import type {
|
|
3
3
|
AnyMutationProcedure,
|
|
4
4
|
AnyProcedure,
|
|
5
5
|
AnyQueryProcedure,
|
|
6
6
|
AnyRootConfig,
|
|
7
7
|
AnyRouter,
|
|
8
8
|
inferProcedureInput,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import {
|
|
9
|
+
inferTransformedProcedureOutput,
|
|
10
|
+
} from '@trpc/core';
|
|
11
|
+
import type {
|
|
12
12
|
UseTRPCMutationOptions,
|
|
13
13
|
UseTRPCMutationResult,
|
|
14
14
|
UseTRPCQueryOptions,
|