@trpc/react-query 11.0.0-alpha-tmp-nosideeffects.257 → 11.0.0-alpha-tmp-02-08-tmp.274
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 +240 -0
- package/dist/createTRPCReact.d.ts +38 -24
- package/dist/createTRPCReact.d.ts.map +1 -1
- package/dist/internals/getQueryKey.d.ts +6 -11
- package/dist/internals/getQueryKey.d.ts.map +1 -1
- package/dist/internals/getQueryKey.js +2 -2
- package/dist/internals/getQueryKey.mjs +2 -2
- package/dist/internals/useHookResult.d.ts +4 -6
- package/dist/internals/useHookResult.d.ts.map +1 -1
- package/dist/internals/useHookResult.js +6 -3
- package/dist/internals/useHookResult.mjs +6 -3
- package/dist/server/ssgProxy.d.ts +2 -2
- package/dist/server/ssgProxy.d.ts.map +1 -1
- package/dist/shared/hooks/createHooksInternal.js +5 -5
- package/dist/shared/hooks/createHooksInternal.mjs +5 -5
- package/dist/shared/hooks/types.d.ts +5 -1
- package/dist/shared/hooks/types.d.ts.map +1 -1
- package/dist/shared/polymorphism/queryLike.d.ts +3 -2
- package/dist/shared/polymorphism/queryLike.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/createTRPCReact.tsx +102 -121
- package/src/internals/getQueryKey.ts +18 -57
- package/src/internals/useHookResult.ts +11 -12
- package/src/server/ssgProxy.ts +2 -2
- package/src/shared/hooks/createHooksInternal.tsx +5 -5
- package/src/shared/hooks/types.ts +6 -1
- package/src/shared/polymorphism/queryLike.ts +15 -8
- package/src/shared/polymorphism/routerLike.ts +12 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bundleSize": 27242,
|
|
3
|
+
"bundleOrigSize": 60201,
|
|
4
|
+
"bundleReduction": 54.75,
|
|
5
|
+
"modules": [
|
|
6
|
+
{
|
|
7
|
+
"id": "/src/shared/hooks/createHooksInternal.tsx",
|
|
8
|
+
"size": 12372,
|
|
9
|
+
"origSize": 14404,
|
|
10
|
+
"renderedExports": [
|
|
11
|
+
"createRootHooks"
|
|
12
|
+
],
|
|
13
|
+
"removedExports": [],
|
|
14
|
+
"dependents": [
|
|
15
|
+
"/src/createTRPCReact.tsx"
|
|
16
|
+
],
|
|
17
|
+
"percent": 45.42,
|
|
18
|
+
"reduction": 14.11
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "/src/server/ssgProxy.ts",
|
|
22
|
+
"size": 3673,
|
|
23
|
+
"origSize": 7403,
|
|
24
|
+
"renderedExports": [
|
|
25
|
+
"createServerSideHelpers"
|
|
26
|
+
],
|
|
27
|
+
"removedExports": [],
|
|
28
|
+
"dependents": [
|
|
29
|
+
"/src/server/index.ts"
|
|
30
|
+
],
|
|
31
|
+
"percent": 13.48,
|
|
32
|
+
"reduction": 50.38
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "/src/utils/createUtilityFunctions.ts",
|
|
36
|
+
"size": 3334,
|
|
37
|
+
"origSize": 3725,
|
|
38
|
+
"renderedExports": [
|
|
39
|
+
"createUtilityFunctions"
|
|
40
|
+
],
|
|
41
|
+
"removedExports": [],
|
|
42
|
+
"dependents": [
|
|
43
|
+
"/src/createTRPCQueryUtils.tsx",
|
|
44
|
+
"/src/shared/hooks/createHooksInternal.tsx"
|
|
45
|
+
],
|
|
46
|
+
"percent": 12.24,
|
|
47
|
+
"reduction": 10.5
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "/src/shared/proxy/utilsProxy.ts",
|
|
51
|
+
"size": 2745,
|
|
52
|
+
"origSize": 10534,
|
|
53
|
+
"renderedExports": [
|
|
54
|
+
"getQueryType",
|
|
55
|
+
"createReactQueryUtils",
|
|
56
|
+
"createQueryUtilsProxy"
|
|
57
|
+
],
|
|
58
|
+
"removedExports": [],
|
|
59
|
+
"dependents": [
|
|
60
|
+
"/src/shared/index.ts"
|
|
61
|
+
],
|
|
62
|
+
"percent": 10.08,
|
|
63
|
+
"reduction": 73.94
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "/src/internals/getQueryKey.ts",
|
|
67
|
+
"size": 1894,
|
|
68
|
+
"origSize": 3254,
|
|
69
|
+
"renderedExports": [
|
|
70
|
+
"getQueryKeyInternal",
|
|
71
|
+
"getQueryKey"
|
|
72
|
+
],
|
|
73
|
+
"removedExports": [],
|
|
74
|
+
"dependents": [
|
|
75
|
+
"/src/index.ts",
|
|
76
|
+
"/src/server/ssgProxy.ts",
|
|
77
|
+
"/src/shared/proxy/utilsProxy.ts",
|
|
78
|
+
"/src/shared/proxy/useQueriesProxy.ts",
|
|
79
|
+
"/src/shared/hooks/createHooksInternal.tsx"
|
|
80
|
+
],
|
|
81
|
+
"percent": 6.95,
|
|
82
|
+
"reduction": 41.79
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"id": "/src/createTRPCReact.tsx",
|
|
86
|
+
"size": 850,
|
|
87
|
+
"origSize": 7749,
|
|
88
|
+
"renderedExports": [
|
|
89
|
+
"createHooksInternal",
|
|
90
|
+
"createTRPCReact"
|
|
91
|
+
],
|
|
92
|
+
"removedExports": [],
|
|
93
|
+
"dependents": [
|
|
94
|
+
"/src/index.ts"
|
|
95
|
+
],
|
|
96
|
+
"percent": 3.12,
|
|
97
|
+
"reduction": 89.03
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "/src/shared/proxy/decorationProxy.ts",
|
|
101
|
+
"size": 806,
|
|
102
|
+
"origSize": 1049,
|
|
103
|
+
"renderedExports": [
|
|
104
|
+
"createReactDecoration"
|
|
105
|
+
],
|
|
106
|
+
"removedExports": [],
|
|
107
|
+
"dependents": [
|
|
108
|
+
"/src/shared/index.ts"
|
|
109
|
+
],
|
|
110
|
+
"percent": 2.96,
|
|
111
|
+
"reduction": 23.16
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": "/src/shared/proxy/useQueriesProxy.ts",
|
|
115
|
+
"size": 569,
|
|
116
|
+
"origSize": 3167,
|
|
117
|
+
"renderedExports": [
|
|
118
|
+
"createUseQueries"
|
|
119
|
+
],
|
|
120
|
+
"removedExports": [],
|
|
121
|
+
"dependents": [
|
|
122
|
+
"/src/shared/index.ts",
|
|
123
|
+
"/src/shared/hooks/createHooksInternal.tsx"
|
|
124
|
+
],
|
|
125
|
+
"percent": 2.09,
|
|
126
|
+
"reduction": 82.03
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"id": "/src/internals/getClientArgs.ts",
|
|
130
|
+
"size": 332,
|
|
131
|
+
"origSize": 402,
|
|
132
|
+
"renderedExports": [
|
|
133
|
+
"getClientArgs"
|
|
134
|
+
],
|
|
135
|
+
"removedExports": [],
|
|
136
|
+
"dependents": [
|
|
137
|
+
"/src/shared/index.ts",
|
|
138
|
+
"/src/shared/hooks/createHooksInternal.tsx",
|
|
139
|
+
"/src/utils/createUtilityFunctions.ts"
|
|
140
|
+
],
|
|
141
|
+
"percent": 1.22,
|
|
142
|
+
"reduction": 17.41
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"id": "/src/internals/useHookResult.ts",
|
|
146
|
+
"size": 222,
|
|
147
|
+
"origSize": 348,
|
|
148
|
+
"renderedExports": [
|
|
149
|
+
"useHookResult"
|
|
150
|
+
],
|
|
151
|
+
"removedExports": [],
|
|
152
|
+
"dependents": [
|
|
153
|
+
"/src/shared/hooks/createHooksInternal.tsx"
|
|
154
|
+
],
|
|
155
|
+
"percent": 0.81,
|
|
156
|
+
"reduction": 36.21
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"id": "/src/createTRPCQueryUtils.tsx",
|
|
160
|
+
"size": 162,
|
|
161
|
+
"origSize": 485,
|
|
162
|
+
"renderedExports": [
|
|
163
|
+
"createTRPCQueryUtils"
|
|
164
|
+
],
|
|
165
|
+
"removedExports": [],
|
|
166
|
+
"dependents": [
|
|
167
|
+
"/src/index.ts"
|
|
168
|
+
],
|
|
169
|
+
"percent": 0.59,
|
|
170
|
+
"reduction": 66.6
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"id": "/src/internals/context.tsx",
|
|
174
|
+
"size": 154,
|
|
175
|
+
"origSize": 6094,
|
|
176
|
+
"renderedExports": [
|
|
177
|
+
"contextProps",
|
|
178
|
+
"TRPCContext"
|
|
179
|
+
],
|
|
180
|
+
"removedExports": [],
|
|
181
|
+
"dependents": [
|
|
182
|
+
"/src/shared/index.ts",
|
|
183
|
+
"/src/shared/index.ts",
|
|
184
|
+
"/src/shared/proxy/utilsProxy.ts",
|
|
185
|
+
"/src/shared/hooks/createHooksInternal.tsx"
|
|
186
|
+
],
|
|
187
|
+
"percent": 0.57,
|
|
188
|
+
"reduction": 97.47
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"id": "/src/shared/queryClient.ts",
|
|
192
|
+
"size": 129,
|
|
193
|
+
"origSize": 514,
|
|
194
|
+
"renderedExports": [
|
|
195
|
+
"getQueryClient"
|
|
196
|
+
],
|
|
197
|
+
"removedExports": [],
|
|
198
|
+
"dependents": [
|
|
199
|
+
"/src/shared/index.ts"
|
|
200
|
+
],
|
|
201
|
+
"percent": 0.47,
|
|
202
|
+
"reduction": 74.9
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"id": "/src/index.ts",
|
|
206
|
+
"size": 0,
|
|
207
|
+
"origSize": 313,
|
|
208
|
+
"renderedExports": [],
|
|
209
|
+
"removedExports": [],
|
|
210
|
+
"dependents": [],
|
|
211
|
+
"percent": 0,
|
|
212
|
+
"reduction": 100
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"id": "/src/server/index.ts",
|
|
216
|
+
"size": 0,
|
|
217
|
+
"origSize": 54,
|
|
218
|
+
"renderedExports": [],
|
|
219
|
+
"removedExports": [],
|
|
220
|
+
"dependents": [],
|
|
221
|
+
"percent": 0,
|
|
222
|
+
"reduction": 100
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"id": "/src/shared/index.ts",
|
|
226
|
+
"size": 0,
|
|
227
|
+
"origSize": 706,
|
|
228
|
+
"renderedExports": [],
|
|
229
|
+
"removedExports": [],
|
|
230
|
+
"dependents": [
|
|
231
|
+
"/src/createTRPCReact.tsx",
|
|
232
|
+
"/src/createTRPCQueryUtils.tsx",
|
|
233
|
+
"/src/server/ssgProxy.ts"
|
|
234
|
+
],
|
|
235
|
+
"percent": 0,
|
|
236
|
+
"reduction": 100
|
|
237
|
+
}
|
|
238
|
+
],
|
|
239
|
+
"moduleCount": 16
|
|
240
|
+
}
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
import type { TRPCClientErrorLike } from '@trpc/client';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AnyProcedure, AnyRootTypes, AnyRouter, inferProcedureInput, inferTransformedProcedureOutput, ProcedureType, ProtectedIntersection, RouterRecord } from '@trpc/server/unstable-core-do-not-import';
|
|
3
3
|
import type { TRPCUseQueries, TRPCUseSuspenseQueries } from './internals/useQueries';
|
|
4
4
|
import type { CreateReactUtils } from './shared';
|
|
5
5
|
import type { CreateReactQueryHooks } from './shared/hooks/createHooksInternal';
|
|
6
6
|
import type { CreateClient, DefinedUseTRPCQueryOptions, DefinedUseTRPCQueryResult, TRPCProvider, UseTRPCInfiniteQueryOptions, UseTRPCInfiniteQueryResult, UseTRPCMutationOptions, UseTRPCMutationResult, UseTRPCQueryOptions, UseTRPCQueryResult, UseTRPCSubscriptionOptions, UseTRPCSuspenseInfiniteQueryOptions, UseTRPCSuspenseInfiniteQueryResult, UseTRPCSuspenseQueryOptions, UseTRPCSuspenseQueryResult } from './shared/hooks/types';
|
|
7
7
|
import type { CreateTRPCReactOptions } from './shared/types';
|
|
8
|
+
type ResolverDef = {
|
|
9
|
+
input: any;
|
|
10
|
+
output: any;
|
|
11
|
+
transformer: boolean;
|
|
12
|
+
errorShape: any;
|
|
13
|
+
};
|
|
8
14
|
/**
|
|
9
15
|
* @internal
|
|
10
16
|
*/
|
|
11
|
-
export interface ProcedureUseQuery<
|
|
12
|
-
<TQueryFnData extends
|
|
13
|
-
|
|
17
|
+
export interface ProcedureUseQuery<TDef extends ResolverDef> {
|
|
18
|
+
<TQueryFnData extends TDef['output'] = TDef['output'], TData = TQueryFnData>(input: TDef['input'], opts: DefinedUseTRPCQueryOptions<TQueryFnData, TData, TRPCClientErrorLike<{
|
|
19
|
+
errorShape: TDef['errorShape'];
|
|
20
|
+
transformer: TDef['transformer'];
|
|
21
|
+
}>, TDef['output']>): DefinedUseTRPCQueryResult<TData, TRPCClientErrorLike<{
|
|
22
|
+
errorShape: TDef['errorShape'];
|
|
23
|
+
transformer: TDef['transformer'];
|
|
24
|
+
}>>;
|
|
25
|
+
<TQueryFnData extends TDef['output'] = TDef['output'], TData = TQueryFnData>(input: TDef['input'], opts?: UseTRPCQueryOptions<TQueryFnData, TData, TRPCClientErrorLike<TDef>, TDef['output']>): UseTRPCQueryResult<TData, TRPCClientErrorLike<TDef>>;
|
|
14
26
|
}
|
|
15
27
|
/**
|
|
16
28
|
* @remark `void` is here due to https://github.com/trpc/trpc/pull/4374
|
|
@@ -21,56 +33,58 @@ type CursorInput = {
|
|
|
21
33
|
/**
|
|
22
34
|
* @internal
|
|
23
35
|
*/
|
|
24
|
-
export type MaybeDecoratedInfiniteQuery<
|
|
36
|
+
export type MaybeDecoratedInfiniteQuery<TDef extends ResolverDef> = TDef['input'] extends CursorInput ? {
|
|
25
37
|
/**
|
|
26
38
|
* @link https://trpc.io/docs/v11/client/react/suspense#useinfinitesuspensequery
|
|
27
39
|
*/
|
|
28
|
-
useInfiniteQuery: (input: Omit<
|
|
40
|
+
useInfiniteQuery: (input: Omit<TDef['input'], 'cursor'>, opts: UseTRPCInfiniteQueryOptions<TDef['input'], TDef['output'], TRPCClientErrorLike<TDef>>) => UseTRPCInfiniteQueryResult<TDef['output'], TRPCClientErrorLike<TDef>, TDef['input']>;
|
|
29
41
|
/**
|
|
30
42
|
* @link https://trpc.io/docs/v11/client/react/suspense
|
|
31
43
|
*/
|
|
32
|
-
useSuspenseInfiniteQuery: (input: Omit<
|
|
44
|
+
useSuspenseInfiniteQuery: (input: Omit<TDef['input'], 'cursor'>, opts: UseTRPCSuspenseInfiniteQueryOptions<TDef['input'], TDef['output'], TRPCClientErrorLike<TDef>>) => UseTRPCSuspenseInfiniteQueryResult<TDef['output'], TRPCClientErrorLike<TDef>, TDef['input']>;
|
|
33
45
|
} : object;
|
|
34
46
|
/**
|
|
35
47
|
* @internal
|
|
36
48
|
*/
|
|
37
|
-
export type DecoratedQueryMethods<
|
|
49
|
+
export type DecoratedQueryMethods<TDef extends ResolverDef> = {
|
|
38
50
|
/**
|
|
39
51
|
* @link https://trpc.io/docs/v11/client/react/useQuery
|
|
40
52
|
*/
|
|
41
|
-
useQuery: ProcedureUseQuery<
|
|
53
|
+
useQuery: ProcedureUseQuery<TDef>;
|
|
42
54
|
/**
|
|
43
55
|
* @link https://trpc.io/docs/v11/client/react/suspense#usesuspensequery
|
|
44
56
|
*/
|
|
45
|
-
useSuspenseQuery: <TQueryFnData extends
|
|
57
|
+
useSuspenseQuery: <TQueryFnData extends TDef['output'] = TDef['output'], TData = TQueryFnData>(input: TDef['input'], opts?: UseTRPCSuspenseQueryOptions<TQueryFnData, TData, TRPCClientErrorLike<TDef>>) => UseTRPCSuspenseQueryResult<TData, TRPCClientErrorLike<TDef>>;
|
|
46
58
|
};
|
|
47
59
|
/**
|
|
48
60
|
* @internal
|
|
49
61
|
*/
|
|
50
|
-
export type DecoratedQuery<
|
|
51
|
-
|
|
52
|
-
* @internal
|
|
53
|
-
*/
|
|
54
|
-
export interface DecoratedMutation<TRoot extends AnyRootTypes, TProcedure extends AnyProcedure> {
|
|
62
|
+
export type DecoratedQuery<TDef extends ResolverDef> = MaybeDecoratedInfiniteQuery<TDef> & DecoratedQueryMethods<TDef>;
|
|
63
|
+
export type DecoratedMutation<TDef extends ResolverDef> = {
|
|
55
64
|
/**
|
|
56
65
|
* @link https://trpc.io/docs/v11/client/react/useMutation
|
|
57
66
|
*/
|
|
58
|
-
useMutation: <TContext = unknown>(opts?: UseTRPCMutationOptions<
|
|
59
|
-
}
|
|
67
|
+
useMutation: <TContext = unknown>(opts?: UseTRPCMutationOptions<TDef['input'], TRPCClientErrorLike<TDef>, TDef['output'], TContext>) => UseTRPCMutationResult<TDef['output'], TRPCClientErrorLike<TDef>, TDef['input'], TContext>;
|
|
68
|
+
};
|
|
60
69
|
/**
|
|
61
70
|
* @internal
|
|
62
71
|
*/
|
|
63
|
-
export type DecorateProcedure<
|
|
72
|
+
export type DecorateProcedure<TType extends ProcedureType, TDef extends ResolverDef> = TType extends 'query' ? DecoratedQuery<TDef> : TType extends 'mutation' ? DecoratedMutation<TDef> : TType extends 'subscription' ? {
|
|
64
73
|
/**
|
|
65
74
|
* @link https://trpc.io/docs/v11/subscriptions
|
|
66
75
|
*/
|
|
67
|
-
useSubscription: (input:
|
|
76
|
+
useSubscription: (input: TDef['input'], opts?: UseTRPCSubscriptionOptions<TDef['output'], TRPCClientErrorLike<TDef>>) => void;
|
|
68
77
|
} : never;
|
|
69
78
|
/**
|
|
70
79
|
* @internal
|
|
71
80
|
*/
|
|
72
|
-
export type DecorateRouterRecord<TRoot extends AnyRootTypes, TRecord extends RouterRecord
|
|
73
|
-
[TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends RouterRecord ? DecorateRouterRecord<TRoot, $Value
|
|
81
|
+
export type DecorateRouterRecord<TRoot extends AnyRootTypes, TRecord extends RouterRecord> = {
|
|
82
|
+
[TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends RouterRecord ? DecorateRouterRecord<TRoot, $Value> : $Value extends AnyProcedure ? DecorateProcedure<$Value['_def']['type'], {
|
|
83
|
+
input: inferProcedureInput<$Value>;
|
|
84
|
+
output: inferTransformedProcedureOutput<TRoot, $Value>;
|
|
85
|
+
transformer: TRoot['transformer'];
|
|
86
|
+
errorShape: TRoot['errorShape'];
|
|
87
|
+
}> : never : never;
|
|
74
88
|
};
|
|
75
89
|
/**
|
|
76
90
|
* @internal
|
|
@@ -91,11 +105,11 @@ export type CreateTRPCReactBase<TRouter extends AnyRouter, TSSRContext> = {
|
|
|
91
105
|
useQueries: TRPCUseQueries<TRouter>;
|
|
92
106
|
useSuspenseQueries: TRPCUseSuspenseQueries<TRouter>;
|
|
93
107
|
};
|
|
94
|
-
export type CreateTRPCReact<TRouter extends AnyRouter, TSSRContext
|
|
108
|
+
export type CreateTRPCReact<TRouter extends AnyRouter, TSSRContext> = ProtectedIntersection<CreateTRPCReactBase<TRouter, TSSRContext>, DecorateRouterRecord<TRouter['_def']['_config']['$types'], TRouter['_def']['record']>>;
|
|
95
109
|
/**
|
|
96
110
|
* @internal
|
|
97
111
|
*/
|
|
98
|
-
export declare function createHooksInternal<TRouter extends AnyRouter, TSSRContext = unknown
|
|
99
|
-
export declare function createTRPCReact<TRouter extends AnyRouter, TSSRContext = unknown
|
|
112
|
+
export declare function createHooksInternal<TRouter extends AnyRouter, TSSRContext = unknown>(trpc: CreateReactQueryHooks<TRouter, TSSRContext>): ProtectedIntersection<CreateTRPCReactBase<TRouter, TSSRContext>, DecorateRouterRecord<TRouter["_def"]["_config"]["$types"], TRouter["_def"]["record"]>>;
|
|
113
|
+
export declare function createTRPCReact<TRouter extends AnyRouter, TSSRContext = unknown>(opts?: CreateTRPCReactOptions<TRouter>): CreateTRPCReact<TRouter, TSSRContext>;
|
|
100
114
|
export {};
|
|
101
115
|
//# sourceMappingURL=createTRPCReact.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTRPCReact.d.ts","sourceRoot":"","sources":["../src/createTRPCReact.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"createTRPCReact.d.ts","sourceRoot":"","sources":["../src/createTRPCReact.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,E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,IAAI,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACnD,QAAQ,EAAE,YAAY,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC7C,YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,UAAU,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IACpC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,eAAe,CACzB,OAAO,SAAS,SAAS,EACzB,WAAW,IACT,qBAAqB,CACvB,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAC,EACzC,oBAAoB,CAClB,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EACpC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAC1B,CACF,CAAC;AAEF;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,SAAS,SAAS,EACzB,WAAW,GAAG,OAAO,EACrB,IAAI,EAAE,qBAAqB,CAAC,OAAO,EAAE,WAAW,CAAC,2JAoBlD;AAED,wBAAgB,eAAe,CAC7B,OAAO,SAAS,SAAS,EACzB,WAAW,GAAG,OAAO,EAErB,IAAI,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC,GACrC,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC,CAKvC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { DeepPartial } from '@trpc/server/unstable-core-do-not-import';
|
|
2
|
+
import type { DecoratedMutation, DecoratedQuery } from '../createTRPCReact';
|
|
3
|
+
import type { DecorateRouterRecord } from '../shared';
|
|
3
4
|
export type QueryType = 'any' | 'infinite' | 'query';
|
|
4
5
|
export type TRPCQueryKey = [
|
|
5
6
|
string[],
|
|
@@ -8,6 +9,7 @@ export type TRPCQueryKey = [
|
|
|
8
9
|
type?: Exclude<QueryType, 'any'>;
|
|
9
10
|
}?
|
|
10
11
|
];
|
|
12
|
+
type ProcedureOrRouter = DecoratedMutation<any> | DecoratedQuery<any> | DecorateRouterRecord<any, any>;
|
|
11
13
|
/**
|
|
12
14
|
* To allow easy interactions with groups of related queries, such as
|
|
13
15
|
* invalidating all queries of a router, we use an array as the path when
|
|
@@ -19,14 +21,7 @@ type GetInfiniteQueryInput<TProcedureInput, TInputWithoutCursor = Omit<TProcedur
|
|
|
19
21
|
export type GetQueryProcedureInput<TProcedureInput> = TProcedureInput extends {
|
|
20
22
|
cursor?: any;
|
|
21
23
|
} ? GetInfiniteQueryInput<TProcedureInput> : DeepPartial<TProcedureInput> | undefined;
|
|
22
|
-
type
|
|
23
|
-
type GetParams<TRoot extends AnyRootTypes, TProcedureOrRouter extends AnyMutationProcedure | AnyQueryProcedure | AnyRouter, TFlags> = TProcedureOrRouter extends AnyQueryProcedure ? [
|
|
24
|
-
procedureOrRouter: DecorateProcedure<TRoot, TProcedureOrRouter, TFlags>,
|
|
25
|
-
..._params: GetQueryParams<TProcedureOrRouter>
|
|
26
|
-
] : TProcedureOrRouter extends AnyMutationProcedure ? [procedureOrRouter: DecorateProcedure<TRoot, TProcedureOrRouter, TFlags>] : TProcedureOrRouter extends AnyRouter ? [
|
|
27
|
-
procedureOrRouter: DecorateRouterRecord<TRoot, TProcedureOrRouter['_def']['record'], TFlags>
|
|
28
|
-
] : never;
|
|
29
|
-
type GetQueryKeyParams<TRoot extends AnyRootTypes, TProcedureOrRouter extends AnyMutationProcedure | AnyQueryProcedure | AnyRouter, TFlags> = GetParams<TRoot, TProcedureOrRouter, TFlags>;
|
|
24
|
+
type GetParams<TProcedureOrRouter extends ProcedureOrRouter> = TProcedureOrRouter extends DecoratedQuery<infer $Def> ? [input?: GetQueryProcedureInput<$Def['input']>, type?: QueryType] : [];
|
|
30
25
|
/**
|
|
31
26
|
* Method to extract the query key for a procedure
|
|
32
27
|
* @param procedureOrRouter - procedure or AnyRouter
|
|
@@ -34,7 +29,7 @@ type GetQueryKeyParams<TRoot extends AnyRootTypes, TProcedureOrRouter extends An
|
|
|
34
29
|
* @param type - defaults to `any`
|
|
35
30
|
* @link https://trpc.io/docs/v11/getQueryKey
|
|
36
31
|
*/
|
|
37
|
-
export declare function getQueryKey<
|
|
32
|
+
export declare function getQueryKey<TProcedureOrRouter extends ProcedureOrRouter>(procedureOrRouter: TProcedureOrRouter, ..._params: GetParams<TProcedureOrRouter>): TRPCQueryKey;
|
|
38
33
|
export type QueryKeyKnown<TInput, TType extends Exclude<QueryType, 'any'>> = [
|
|
39
34
|
string[],
|
|
40
35
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getQueryKey.d.ts","sourceRoot":"","sources":["../../src/internals/getQueryKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"getQueryKey.d.ts","sourceRoot":"","sources":["../../src/internals/getQueryKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEtD,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,CAAC;AAErD,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE;IACR;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;KAAE,CAAC;CACvD,CAAC;AAEF,KAAK,iBAAiB,GAClB,iBAAiB,CAAC,GAAG,CAAC,GACtB,cAAc,CAAC,GAAG,CAAC,GACnB,oBAAoB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAEnC;;;;IAII;AACJ,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,SAAS,GACd,YAAY,CAqCd;AAED,KAAK,qBAAqB,CACxB,eAAe,EACf,mBAAmB,GAAG,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,IACnD,MAAM,mBAAmB,SAAS,KAAK,GACvC,SAAS,GACT,WAAW,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAAC;AAEjD,gBAAgB;AAChB,MAAM,MAAM,sBAAsB,CAAC,eAAe,IAAI,eAAe,SAAS;IAC5E,MAAM,CAAC,EAAE,GAAG,CAAC;CACd,GACG,qBAAqB,CAAC,eAAe,CAAC,GACtC,WAAW,CAAC,eAAe,CAAC,GAAG,SAAS,CAAC;AAE7C,KAAK,SAAS,CAAC,kBAAkB,SAAS,iBAAiB,IACzD,kBAAkB,SAAS,cAAc,CAAC,MAAM,IAAI,CAAC,GACjD,CAAC,KAAK,CAAC,EAAE,sBAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS,CAAC,GACjE,EAAE,CAAC;AAET;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,kBAAkB,SAAS,iBAAiB,EACtE,iBAAiB,EAAE,kBAAkB,EACrC,GAAG,OAAO,EAAE,SAAS,CAAC,kBAAkB,CAAC,gBAQ1C;AAGD,MAAM,MAAM,aAAa,CAAC,MAAM,EAAE,KAAK,SAAS,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI;IAC3E,MAAM,EAAE;IACR;QAAE,KAAK,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;QAAC,IAAI,EAAE,KAAK,CAAA;KAAE,CAAC;CACzD,CAAC"}
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
* @param input - input to procedureOrRouter
|
|
46
46
|
* @param type - defaults to `any`
|
|
47
47
|
* @link https://trpc.io/docs/v11/getQueryKey
|
|
48
|
-
*/ function getQueryKey(..._params) {
|
|
49
|
-
const [
|
|
48
|
+
*/ function getQueryKey(procedureOrRouter, ..._params) {
|
|
49
|
+
const [input, type] = _params;
|
|
50
50
|
// @ts-expect-error - we don't expose _def on the type layer
|
|
51
51
|
const path = procedureOrRouter._def().path;
|
|
52
52
|
const queryKey = getQueryKeyInternal(path, input, type ?? 'any');
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
* @param input - input to procedureOrRouter
|
|
44
44
|
* @param type - defaults to `any`
|
|
45
45
|
* @link https://trpc.io/docs/v11/getQueryKey
|
|
46
|
-
*/ function getQueryKey(..._params) {
|
|
47
|
-
const [
|
|
46
|
+
*/ function getQueryKey(procedureOrRouter, ..._params) {
|
|
47
|
+
const [input, type] = _params;
|
|
48
48
|
// @ts-expect-error - we don't expose _def on the type layer
|
|
49
49
|
const path = procedureOrRouter._def().path;
|
|
50
50
|
const queryKey = getQueryKeyInternal(path, input, type ?? 'any');
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
trpc: {
|
|
3
|
-
path: string;
|
|
4
|
-
};
|
|
5
|
-
}
|
|
1
|
+
import type { TRPCHookResult } from '../shared/hooks/types';
|
|
6
2
|
/**
|
|
7
3
|
* Makes a stable reference of the `trpc` prop
|
|
8
4
|
*/
|
|
9
|
-
export declare function useHookResult(value:
|
|
5
|
+
export declare function useHookResult(value: {
|
|
6
|
+
path: string[];
|
|
7
|
+
}): TRPCHookResult['trpc'];
|
|
10
8
|
//# sourceMappingURL=useHookResult.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHookResult.d.ts","sourceRoot":"","sources":["../../src/internals/useHookResult.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useHookResult.d.ts","sourceRoot":"","sources":["../../src/internals/useHookResult.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,GAAG,cAAc,CAAC,MAAM,CAAC,CAQzB"}
|
|
@@ -24,9 +24,12 @@ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
|
24
24
|
/**
|
|
25
25
|
* Makes a stable reference of the `trpc` prop
|
|
26
26
|
*/ function useHookResult(value) {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
const path = value.path.join('.');
|
|
28
|
+
return React__namespace.useMemo(()=>({
|
|
29
|
+
path
|
|
30
|
+
}), [
|
|
31
|
+
path
|
|
32
|
+
]);
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
exports.useHookResult = useHookResult;
|
|
@@ -3,9 +3,12 @@ import * as React from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* Makes a stable reference of the `trpc` prop
|
|
5
5
|
*/ function useHookResult(value) {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const path = value.path.join('.');
|
|
7
|
+
return React.useMemo(()=>({
|
|
8
|
+
path
|
|
9
|
+
}), [
|
|
10
|
+
path
|
|
11
|
+
]);
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
export { useHookResult };
|
|
@@ -2,12 +2,12 @@ import type { DehydratedState, DehydrateOptions, InfiniteData, QueryClient } fro
|
|
|
2
2
|
import type { inferRouterClient, TRPCClientError } from '@trpc/client';
|
|
3
3
|
import { TRPCUntypedClient } from '@trpc/client';
|
|
4
4
|
import { type TransformerOptions } from '@trpc/client/unstable-internals';
|
|
5
|
-
import type { AnyProcedure, AnyQueryProcedure, AnyRootTypes, AnyRouter,
|
|
5
|
+
import type { AnyProcedure, AnyQueryProcedure, AnyRootTypes, AnyRouter, inferClientTypes, inferProcedureInput, inferRouterContext, inferTransformedProcedureOutput, ProtectedIntersection, RouterRecord } from '@trpc/server/unstable-core-do-not-import';
|
|
6
6
|
import type { CreateTRPCReactQueryClientConfig, ExtractCursorType, TRPCFetchInfiniteQueryOptions, TRPCFetchQueryOptions } from '../shared';
|
|
7
7
|
type CreateSSGHelpersInternal<TRouter extends AnyRouter> = {
|
|
8
8
|
router: TRouter;
|
|
9
9
|
ctx: inferRouterContext<TRouter>;
|
|
10
|
-
} & TransformerOptions<
|
|
10
|
+
} & TransformerOptions<inferClientTypes<TRouter>>;
|
|
11
11
|
interface CreateSSGHelpersExternal<TRouter extends AnyRouter> {
|
|
12
12
|
client: inferRouterClient<TRouter> | TRPCUntypedClient<TRouter>;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssgProxy.d.ts","sourceRoot":"","sources":["../../src/server/ssgProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAoB,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEnE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"ssgProxy.d.ts","sourceRoot":"","sources":["../../src/server/ssgProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAoB,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEnE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,mB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124
|
hook.trpc = useHookResult.useHookResult({
|
|
125
|
-
path
|
|
125
|
+
path
|
|
126
126
|
});
|
|
127
127
|
return hook;
|
|
128
128
|
}
|
|
@@ -145,7 +145,7 @@ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
|
145
145
|
}
|
|
146
146
|
}, context.queryClient);
|
|
147
147
|
hook.trpc = useHookResult.useHookResult({
|
|
148
|
-
path
|
|
148
|
+
path
|
|
149
149
|
});
|
|
150
150
|
return [
|
|
151
151
|
hook.data,
|
|
@@ -180,7 +180,7 @@ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
|
180
180
|
}
|
|
181
181
|
}, queryClient);
|
|
182
182
|
hook.trpc = useHookResult.useHookResult({
|
|
183
|
-
path
|
|
183
|
+
path
|
|
184
184
|
});
|
|
185
185
|
return hook;
|
|
186
186
|
}
|
|
@@ -259,7 +259,7 @@ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
|
259
259
|
}
|
|
260
260
|
}, queryClient);
|
|
261
261
|
hook.trpc = useHookResult.useHookResult({
|
|
262
|
-
path
|
|
262
|
+
path
|
|
263
263
|
});
|
|
264
264
|
return hook;
|
|
265
265
|
}
|
|
@@ -291,7 +291,7 @@ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
|
291
291
|
}
|
|
292
292
|
}, context.queryClient);
|
|
293
293
|
hook.trpc = useHookResult.useHookResult({
|
|
294
|
-
path
|
|
294
|
+
path
|
|
295
295
|
});
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
297
297
|
return [
|