@trpc/react-query 10.45.1-canary.9 → 10.45.2-canary.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/README.md +4 -4
- package/dist/bundle-analysis.json +35 -35
- package/dist/{createHooksInternal-bdff7171.mjs → createHooksInternal-063195fc.mjs} +7 -4
- package/dist/{createHooksInternal-37b068e0.js → createHooksInternal-75aa31d9.js} +3 -6
- package/dist/{createHooksInternal-2e69c447.js → createHooksInternal-d1a331c0.js} +6 -3
- package/dist/createTRPCReact.d.ts +10 -10
- package/dist/createTRPCReact.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +2 -2
- package/dist/internals/context.d.ts +4 -5
- package/dist/internals/context.d.ts.map +1 -1
- package/dist/internals/getArrayQueryKey.d.ts +1 -1
- package/dist/internals/getArrayQueryKey.d.ts.map +1 -1
- package/dist/internals/getQueryKey.d.ts +3 -3
- package/dist/internals/getQueryKey.d.ts.map +1 -1
- package/dist/internals/useHookResult.d.ts.map +1 -1
- package/dist/internals/useQueries.d.ts +3 -3
- package/dist/internals/useQueries.d.ts.map +1 -1
- package/dist/interop.d.ts +4 -4
- package/dist/interop.d.ts.map +1 -1
- package/dist/server/ssgProxy.d.ts +4 -4
- package/dist/server/ssgProxy.d.ts.map +1 -1
- package/dist/server/types.d.ts +3 -3
- package/dist/server/types.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/deprecated/createHooksInternal.d.ts +7 -7
- package/dist/shared/hooks/deprecated/createHooksInternal.d.ts.map +1 -1
- package/dist/shared/hooks/types.d.ts +6 -6
- package/dist/shared/hooks/types.d.ts.map +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/index.mjs +1 -1
- package/dist/shared/polymorphism/mutationLike.d.ts +3 -3
- package/dist/shared/polymorphism/mutationLike.d.ts.map +1 -1
- package/dist/shared/polymorphism/queryLike.d.ts +3 -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 +4 -4
- package/dist/shared/proxy/useQueriesProxy.d.ts.map +1 -1
- package/dist/shared/proxy/utilsProxy.d.ts +6 -6
- 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 -2
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/ssg/ssg.d.ts +3 -3
- package/dist/ssg/ssg.d.ts.map +1 -1
- package/dist/utils/inferReactQueryProcedure.d.ts +4 -4
- package/dist/utils/inferReactQueryProcedure.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/createTRPCReact.tsx +12 -14
- package/src/internals/context.tsx +8 -5
- package/src/internals/getArrayQueryKey.ts +1 -1
- package/src/internals/getQueryKey.ts +4 -3
- package/src/internals/useHookResult.ts +3 -4
- package/src/internals/useQueries.ts +3 -3
- package/src/interop.ts +6 -7
- package/src/server/ssgProxy.ts +5 -8
- package/src/server/types.ts +3 -3
- package/src/shared/hooks/createHooksInternal.tsx +11 -12
- package/src/shared/hooks/deprecated/createHooksInternal.tsx +12 -16
- package/src/shared/hooks/types.ts +6 -6
- package/src/shared/polymorphism/mutationLike.ts +3 -3
- package/src/shared/polymorphism/queryLike.ts +3 -3
- package/src/shared/polymorphism/routerLike.ts +3 -3
- package/src/shared/polymorphism/utilsLike.ts +2 -2
- package/src/shared/proxy/decorationProxy.ts +2 -2
- package/src/shared/proxy/useQueriesProxy.ts +7 -9
- package/src/shared/proxy/utilsProxy.ts +9 -11
- package/src/shared/queryClient.ts +2 -1
- package/src/shared/types.ts +2 -2
- package/src/ssg/ssg.ts +5 -5
- package/src/utils/inferReactQueryProcedure.ts +4 -4
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
2
|
+
import type { DehydratedState } from '@tanstack/react-query';
|
|
2
3
|
import {
|
|
3
4
|
useInfiniteQuery as __useInfiniteQuery,
|
|
4
5
|
useMutation as __useMutation,
|
|
5
6
|
useQueries as __useQueries,
|
|
6
7
|
useQuery as __useQuery,
|
|
7
|
-
DehydratedState,
|
|
8
8
|
hashQueryKey,
|
|
9
9
|
useQueryClient,
|
|
10
10
|
} from '@tanstack/react-query';
|
|
11
|
-
import {
|
|
11
|
+
import type { TRPCClientErrorLike } from '@trpc/client';
|
|
12
|
+
import { createTRPCClient } from '@trpc/client';
|
|
12
13
|
import type {
|
|
13
14
|
AnyRouter,
|
|
14
15
|
inferHandlerInput,
|
|
@@ -18,25 +19,20 @@ import type {
|
|
|
18
19
|
inferSubscriptionOutput,
|
|
19
20
|
ProcedureRecord,
|
|
20
21
|
} from '@trpc/server';
|
|
21
|
-
import { inferObservableValue } from '@trpc/server/observable';
|
|
22
|
-
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
22
|
+
import type { inferObservableValue } from '@trpc/server/observable';
|
|
23
|
+
import type { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
23
24
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} from '../../../internals/context';
|
|
29
|
-
import {
|
|
30
|
-
getArrayQueryKey,
|
|
31
|
-
QueryType,
|
|
32
|
-
} from '../../../internals/getArrayQueryKey';
|
|
25
|
+
import type { SSRState, TRPCContextState } from '../../../internals/context';
|
|
26
|
+
import { TRPCContext } from '../../../internals/context';
|
|
27
|
+
import type { QueryType } from '../../../internals/getArrayQueryKey';
|
|
28
|
+
import { getArrayQueryKey } from '../../../internals/getArrayQueryKey';
|
|
33
29
|
import { getClientArgs } from '../../../internals/getClientArgs';
|
|
34
30
|
import { useHookResult } from '../../../internals/useHookResult';
|
|
35
|
-
import { TRPCUseQueries } from '../../../internals/useQueries';
|
|
31
|
+
import type { TRPCUseQueries } from '../../../internals/useQueries';
|
|
36
32
|
import { createUseQueriesProxy } from '../../proxy/useQueriesProxy';
|
|
37
|
-
import { CreateTRPCReactOptions, UseMutationOverride } from '../../types';
|
|
33
|
+
import type { CreateTRPCReactOptions, UseMutationOverride } from '../../types';
|
|
38
34
|
import { createRootHooks } from '../createHooksInternal';
|
|
39
|
-
import {
|
|
35
|
+
import type {
|
|
40
36
|
CreateClient,
|
|
41
37
|
TRPCProvider,
|
|
42
38
|
TRPCQueryOptions,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
DefinedUseQueryResult,
|
|
3
3
|
DehydratedState,
|
|
4
4
|
InfiniteQueryObserverSuccessResult,
|
|
@@ -12,15 +12,15 @@ import {
|
|
|
12
12
|
UseMutationResult,
|
|
13
13
|
UseQueryResult,
|
|
14
14
|
} from '@tanstack/react-query';
|
|
15
|
-
import {
|
|
15
|
+
import type {
|
|
16
16
|
CreateTRPCClientOptions,
|
|
17
17
|
TRPCClient,
|
|
18
18
|
TRPCRequestOptions,
|
|
19
19
|
} from '@trpc/client';
|
|
20
|
-
import { AnyRouter } from '@trpc/server';
|
|
21
|
-
import { ReactNode } from 'react';
|
|
22
|
-
import { TRPCContextProps } from '../../internals/context';
|
|
23
|
-
import { TRPCHookResult } from '../../internals/useHookResult';
|
|
20
|
+
import type { AnyRouter } from '@trpc/server';
|
|
21
|
+
import type { ReactNode } from 'react';
|
|
22
|
+
import type { TRPCContextProps } from '../../internals/context';
|
|
23
|
+
import type { TRPCHookResult } from '../../internals/useHookResult';
|
|
24
24
|
|
|
25
25
|
export type OutputWithCursor<TData, TCursor = any> = {
|
|
26
26
|
cursor: TCursor | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AnyProcedure, inferProcedureInput } from '@trpc/server';
|
|
2
|
-
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
3
|
-
import {
|
|
1
|
+
import type { AnyProcedure, inferProcedureInput } from '@trpc/server';
|
|
2
|
+
import type { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
3
|
+
import type {
|
|
4
4
|
InferMutationOptions,
|
|
5
5
|
InferMutationResult,
|
|
6
6
|
} from '../../utils/inferReactQueryProcedure';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AnyProcedure, inferProcedureInput } from '@trpc/server';
|
|
2
|
-
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
3
|
-
import {
|
|
1
|
+
import type { AnyProcedure, inferProcedureInput } from '@trpc/server';
|
|
2
|
+
import type { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
3
|
+
import type {
|
|
4
4
|
InferQueryOptions,
|
|
5
5
|
InferQueryResult,
|
|
6
6
|
} from '../../utils/inferReactQueryProcedure';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
AnyMutationProcedure,
|
|
3
3
|
AnyQueryProcedure,
|
|
4
4
|
AnyRouter,
|
|
5
5
|
} from '@trpc/server';
|
|
6
|
-
import { MutationLike } from './mutationLike';
|
|
7
|
-
import { QueryLike } from './queryLike';
|
|
6
|
+
import type { MutationLike } from './mutationLike';
|
|
7
|
+
import type { QueryLike } from './queryLike';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Use to describe a route path which matches a given route's interface
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyRouter } from '@trpc/server';
|
|
2
|
-
import { DecoratedProcedureUtilsRecord } from '../proxy/utilsProxy';
|
|
1
|
+
import type { AnyRouter } from '@trpc/server';
|
|
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,8 +1,8 @@
|
|
|
1
|
-
import { AnyRouter } from '@trpc/server';
|
|
1
|
+
import type { AnyRouter } from '@trpc/server';
|
|
2
2
|
import { createRecursiveProxy } from '@trpc/server/shared';
|
|
3
3
|
import { getArrayQueryKey } from '../../internals/getArrayQueryKey';
|
|
4
4
|
import { getQueryKeyInternal } from '../../internals/getQueryKey';
|
|
5
|
-
import { CreateReactQueryHooks } from '../hooks/createRootHooks';
|
|
5
|
+
import type { CreateReactQueryHooks } from '../hooks/createRootHooks';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Create proxy for decorating procedures
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { QueryOptions } from '@tanstack/react-query';
|
|
2
|
-
import { TRPCClient, TRPCClientError } from '@trpc/client';
|
|
3
|
-
import {
|
|
1
|
+
import type { QueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { TRPCClient, TRPCClientError } from '@trpc/client';
|
|
3
|
+
import type {
|
|
4
4
|
AnyProcedure,
|
|
5
5
|
AnyQueryProcedure,
|
|
6
6
|
AnyRouter,
|
|
7
7
|
Filter,
|
|
8
8
|
inferProcedureInput,
|
|
9
9
|
} from '@trpc/server';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
inferTransformedProcedureOutput,
|
|
13
|
-
} from '@trpc/server/shared';
|
|
10
|
+
import type { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
11
|
+
import { createRecursiveProxy } from '@trpc/server/shared';
|
|
14
12
|
import { getQueryKeyInternal } from '../../internals/getQueryKey';
|
|
15
|
-
import { TrpcQueryOptionsForUseQueries } from '../../internals/useQueries';
|
|
16
|
-
import { TRPCReactRequestOptions } from '../hooks/types';
|
|
13
|
+
import type { TrpcQueryOptionsForUseQueries } from '../../internals/useQueries';
|
|
14
|
+
import type { TRPCReactRequestOptions } from '../hooks/types';
|
|
17
15
|
|
|
18
16
|
type GetQueryOptions<TProcedure extends AnyProcedure, TPath extends string> = <
|
|
19
17
|
TData = inferTransformedProcedureOutput<TProcedure>,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
CancelOptions,
|
|
3
3
|
InfiniteData,
|
|
4
4
|
InvalidateOptions,
|
|
@@ -10,8 +10,9 @@ 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
|
AnyRouter,
|
|
17
18
|
DeepPartial,
|
|
@@ -19,19 +20,16 @@ import {
|
|
|
19
20
|
inferProcedureInput,
|
|
20
21
|
ProtectedIntersection,
|
|
21
22
|
} from '@trpc/server';
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
inferTransformedProcedureOutput,
|
|
26
|
-
} from '@trpc/server/shared';
|
|
27
|
-
import {
|
|
28
|
-
contextProps,
|
|
23
|
+
import type { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
24
|
+
import { createFlatProxy, createRecursiveProxy } from '@trpc/server/shared';
|
|
25
|
+
import type {
|
|
29
26
|
DecoratedProxyTRPCContextProps,
|
|
30
27
|
TRPCContextState,
|
|
31
28
|
TRPCFetchInfiniteQueryOptions,
|
|
32
29
|
TRPCFetchQueryOptions,
|
|
33
30
|
} from '../../internals/context';
|
|
34
|
-
import {
|
|
31
|
+
import { contextProps } from '../../internals/context';
|
|
32
|
+
import type { QueryKeyKnown } from '../../internals/getArrayQueryKey';
|
|
35
33
|
import { getQueryKeyInternal } from '../../internals/getQueryKey';
|
|
36
34
|
|
|
37
35
|
type DecorateProcedure<TProcedure extends AnyQueryProcedure> = {
|
package/src/shared/types.ts
CHANGED
package/src/ssg/ssg.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
dehydrate,
|
|
1
|
+
import type {
|
|
3
2
|
DehydratedState,
|
|
4
3
|
DehydrateOptions,
|
|
5
4
|
InfiniteData,
|
|
6
5
|
} from '@tanstack/react-query';
|
|
6
|
+
import { dehydrate } from '@tanstack/react-query';
|
|
7
7
|
import { getUntypedClient, TRPCUntypedClient } from '@trpc/client';
|
|
8
|
-
import {
|
|
8
|
+
import type {
|
|
9
9
|
AnyRouter,
|
|
10
|
-
callProcedure,
|
|
11
10
|
inferHandlerInput,
|
|
12
11
|
inferProcedureOutput,
|
|
13
12
|
} from '@trpc/server';
|
|
13
|
+
import { callProcedure } from '@trpc/server';
|
|
14
14
|
import { getArrayQueryKey } from '../internals/getArrayQueryKey';
|
|
15
|
-
import { CreateServerSideHelpersOptions } from '../server/types';
|
|
15
|
+
import type { CreateServerSideHelpersOptions } from '../server/types';
|
|
16
16
|
import { getQueryClient } from '../shared';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
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
|
AnyRouter,
|
|
7
7
|
inferProcedureInput,
|
|
8
8
|
} from '@trpc/server';
|
|
9
|
-
import { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
10
|
-
import {
|
|
9
|
+
import type { inferTransformedProcedureOutput } from '@trpc/server/shared';
|
|
10
|
+
import type {
|
|
11
11
|
UseTRPCMutationOptions,
|
|
12
12
|
UseTRPCMutationResult,
|
|
13
13
|
UseTRPCQueryOptions,
|