@trpc/react-query 11.0.0-next-beta.249 → 11.0.0-next-beta.253
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 +19 -19
- package/dist/internals/getClientArgs.d.ts.map +1 -1
- package/dist/internals/getClientArgs.js +7 -2
- package/dist/internals/getClientArgs.mjs +7 -2
- package/dist/shared/hooks/createHooksInternal.d.ts +1 -24
- package/dist/shared/hooks/createHooksInternal.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/internals/getClientArgs.ts +7 -2
- package/src/shared/hooks/createHooksInternal.tsx +1 -21
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 56.
|
|
2
|
+
"bundleSize": 27295,
|
|
3
|
+
"bundleOrigSize": 62048,
|
|
4
|
+
"bundleReduction": 56.01,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/shared/hooks/createHooksInternal.tsx",
|
|
8
8
|
"size": 12452,
|
|
9
|
-
"origSize":
|
|
9
|
+
"origSize": 14484,
|
|
10
10
|
"renderedExports": [
|
|
11
11
|
"createRootHooks"
|
|
12
12
|
],
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"dependents": [
|
|
15
15
|
"/src/createTRPCReact.tsx"
|
|
16
16
|
],
|
|
17
|
-
"percent": 45.
|
|
18
|
-
"reduction":
|
|
17
|
+
"percent": 45.62,
|
|
18
|
+
"reduction": 14.03
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"id": "/src/server/ssgProxy.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dependents": [
|
|
29
29
|
"/src/server/index.ts"
|
|
30
30
|
],
|
|
31
|
-
"percent": 13.
|
|
31
|
+
"percent": 13.46,
|
|
32
32
|
"reduction": 50.36
|
|
33
33
|
},
|
|
34
34
|
{
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"/src/createTRPCQueryUtils.tsx",
|
|
44
44
|
"/src/shared/hooks/createHooksInternal.tsx"
|
|
45
45
|
],
|
|
46
|
-
"percent": 12.
|
|
46
|
+
"percent": 12.21,
|
|
47
47
|
"reduction": 10.5
|
|
48
48
|
},
|
|
49
49
|
{
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"dependents": [
|
|
60
60
|
"/src/shared/index.ts"
|
|
61
61
|
],
|
|
62
|
-
"percent": 10.
|
|
62
|
+
"percent": 10.06,
|
|
63
63
|
"reduction": 73.94
|
|
64
64
|
},
|
|
65
65
|
{
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"/src/shared/proxy/useQueriesProxy.ts",
|
|
79
79
|
"/src/shared/hooks/createHooksInternal.tsx"
|
|
80
80
|
],
|
|
81
|
-
"percent": 6.
|
|
81
|
+
"percent": 6.94,
|
|
82
82
|
"reduction": 54.97
|
|
83
83
|
},
|
|
84
84
|
{
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"dependents": [
|
|
94
94
|
"/src/index.ts"
|
|
95
95
|
],
|
|
96
|
-
"percent": 3.
|
|
96
|
+
"percent": 3.11,
|
|
97
97
|
"reduction": 90.09
|
|
98
98
|
},
|
|
99
99
|
{
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"dependents": [
|
|
108
108
|
"/src/shared/index.ts"
|
|
109
109
|
],
|
|
110
|
-
"percent": 2.
|
|
110
|
+
"percent": 2.95,
|
|
111
111
|
"reduction": 23.16
|
|
112
112
|
},
|
|
113
113
|
{
|
|
@@ -122,13 +122,13 @@
|
|
|
122
122
|
"/src/shared/index.ts",
|
|
123
123
|
"/src/shared/hooks/createHooksInternal.tsx"
|
|
124
124
|
],
|
|
125
|
-
"percent": 2.
|
|
125
|
+
"percent": 2.08,
|
|
126
126
|
"reduction": 82.03
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
129
|
"id": "/src/internals/getClientArgs.ts",
|
|
130
|
-
"size":
|
|
131
|
-
"origSize":
|
|
130
|
+
"size": 332,
|
|
131
|
+
"origSize": 402,
|
|
132
132
|
"renderedExports": [
|
|
133
133
|
"getClientArgs"
|
|
134
134
|
],
|
|
@@ -138,8 +138,8 @@
|
|
|
138
138
|
"/src/shared/hooks/createHooksInternal.tsx",
|
|
139
139
|
"/src/utils/createUtilityFunctions.ts"
|
|
140
140
|
],
|
|
141
|
-
"percent":
|
|
142
|
-
"reduction":
|
|
141
|
+
"percent": 1.22,
|
|
142
|
+
"reduction": 17.41
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
145
|
"id": "/src/internals/useHookResult.ts",
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"dependents": [
|
|
153
153
|
"/src/shared/hooks/createHooksInternal.tsx"
|
|
154
154
|
],
|
|
155
|
-
"percent": 0.
|
|
155
|
+
"percent": 0.71,
|
|
156
156
|
"reduction": 42.98
|
|
157
157
|
},
|
|
158
158
|
{
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
"/src/shared/proxy/utilsProxy.ts",
|
|
185
185
|
"/src/shared/hooks/createHooksInternal.tsx"
|
|
186
186
|
],
|
|
187
|
-
"percent": 0.
|
|
187
|
+
"percent": 0.56,
|
|
188
188
|
"reduction": 97.47
|
|
189
189
|
},
|
|
190
190
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getClientArgs.d.ts","sourceRoot":"","sources":["../../src/internals/getClientArgs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EACpC,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,QAAQ,EACd,SAAS,CAAC,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"getClientArgs.d.ts","sourceRoot":"","sources":["../../src/internals/getClientArgs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EACpC,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,QAAQ,EACd,SAAS,CAAC,EAAE,GAAG,mCAWhB"}
|
|
@@ -4,8 +4,13 @@
|
|
|
4
4
|
* @internal
|
|
5
5
|
*/ function getClientArgs(queryKey, opts, pageParam) {
|
|
6
6
|
const path = queryKey[0];
|
|
7
|
-
|
|
8
|
-
if (pageParam)
|
|
7
|
+
let input = queryKey[1]?.input;
|
|
8
|
+
if (pageParam) {
|
|
9
|
+
input = {
|
|
10
|
+
...input ?? {},
|
|
11
|
+
cursor: pageParam
|
|
12
|
+
};
|
|
13
|
+
}
|
|
9
14
|
return [
|
|
10
15
|
path.join('.'),
|
|
11
16
|
input,
|
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
* @internal
|
|
3
3
|
*/ function getClientArgs(queryKey, opts, pageParam) {
|
|
4
4
|
const path = queryKey[0];
|
|
5
|
-
|
|
6
|
-
if (pageParam)
|
|
5
|
+
let input = queryKey[1]?.input;
|
|
6
|
+
if (pageParam) {
|
|
7
|
+
input = {
|
|
8
|
+
...input ?? {},
|
|
9
|
+
cursor: pageParam
|
|
10
|
+
};
|
|
11
|
+
}
|
|
7
12
|
return [
|
|
8
13
|
path.join('.'),
|
|
9
14
|
input,
|
|
@@ -21,32 +21,9 @@ export declare function createRootHooks<TRouter extends AnyRouter, TSSRContext =
|
|
|
21
21
|
useInfiniteQuery: (path: string[], input: unknown, opts: UseTRPCInfiniteQueryOptions<unknown, unknown, TRPCClientErrorLike<TRouter>>) => UseTRPCInfiniteQueryResult<unknown, TRPCClientErrorLike<TRouter>, unknown>;
|
|
22
22
|
useSuspenseInfiniteQuery: (path: string[], input: unknown, opts: UseTRPCSuspenseInfiniteQueryOptions<unknown, unknown, TRPCClientErrorLike<TRouter>>) => UseTRPCSuspenseInfiniteQueryResult<unknown, TRPCClientErrorLike<TRouter>, unknown>;
|
|
23
23
|
};
|
|
24
|
-
/**
|
|
25
|
-
* Hack to infer the type of `createReactQueryHooks`
|
|
26
|
-
* @link https://stackoverflow.com/a/59072991
|
|
27
|
-
*/
|
|
28
|
-
declare class GnClass<TRouter extends AnyRouter, TSSRContext = unknown> {
|
|
29
|
-
fn(): {
|
|
30
|
-
Provider: TRPCProvider<TRouter, TSSRContext>;
|
|
31
|
-
createClient: CreateClient<TRouter>;
|
|
32
|
-
useContext: () => TRPCContextState<TRouter, TSSRContext>;
|
|
33
|
-
useUtils: () => TRPCContextState<TRouter, TSSRContext>;
|
|
34
|
-
useQuery: (path: string[], input: unknown, opts?: UseTRPCQueryOptions<unknown, unknown, TRPCClientErrorLike<TRouter>, unknown> | undefined) => UseTRPCQueryResult<unknown, TRPCClientErrorLike<TRouter>>;
|
|
35
|
-
useSuspenseQuery: (path: string[], input: unknown, opts?: UseTRPCSuspenseQueryOptions<unknown, unknown, TRPCClientErrorLike<TRouter>> | undefined) => UseTRPCSuspenseQueryResult<unknown, TRPCClientErrorLike<TRouter>>;
|
|
36
|
-
useQueries: TRPCUseQueries<TRouter>;
|
|
37
|
-
useSuspenseQueries: TRPCUseSuspenseQueries<TRouter>;
|
|
38
|
-
useMutation: (path: string[], opts?: UseTRPCMutationOptions<unknown, TRPCClientErrorLike<TRouter>, unknown, unknown> | undefined) => UseTRPCMutationResult<unknown, TRPCClientErrorLike<TRouter>, unknown, unknown>;
|
|
39
|
-
useSubscription: (path: string[], input: unknown, opts: UseTRPCSubscriptionOptions<unknown, TRPCClientErrorLike<TRouter>>) => void;
|
|
40
|
-
useInfiniteQuery: (path: string[], input: unknown, opts: UseTRPCInfiniteQueryOptions<unknown, unknown, TRPCClientErrorLike<TRouter>>) => UseTRPCInfiniteQueryResult<unknown, TRPCClientErrorLike<TRouter>, unknown>;
|
|
41
|
-
useSuspenseInfiniteQuery: (path: string[], input: unknown, opts: UseTRPCSuspenseInfiniteQueryOptions<unknown, unknown, TRPCClientErrorLike<TRouter>>) => UseTRPCSuspenseInfiniteQueryResult<unknown, TRPCClientErrorLike<TRouter>, unknown>;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
type returnTypeInferer<TType> = TType extends (a: Record<string, string>) => infer U ? U : never;
|
|
45
|
-
type fooType<TRouter extends AnyRouter, TSSRContext = unknown> = GnClass<TRouter, TSSRContext>['fn'];
|
|
46
24
|
/**
|
|
47
25
|
* Infer the type of a `createReactQueryHooks` function
|
|
48
26
|
* @internal
|
|
49
27
|
*/
|
|
50
|
-
export type CreateReactQueryHooks<TRouter extends AnyRouter, TSSRContext = unknown> =
|
|
51
|
-
export {};
|
|
28
|
+
export type CreateReactQueryHooks<TRouter extends AnyRouter, TSSRContext = unknown> = ReturnType<typeof createRootHooks<TRouter, TSSRContext>>;
|
|
52
29
|
//# sourceMappingURL=createHooksInternal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createHooksInternal.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/createHooksInternal.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAE1E,OAAO,KAAK,EAAY,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAM1E,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACvB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EAAE,sBAAsB,EAAuB,MAAM,UAAU,CAAC;AAC5E,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EAEZ,2BAA2B,EAC3B,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,mCAAmC,EACnC,kCAAkC,EAClC,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,SAAS,SAAS,EACzB,WAAW,GAAG,OAAO,EACrB,MAAM,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC;;;;;qBAmFhC,MAAM,EAAE,SACP,OAAO;6BAwDR,MAAM,EAAE,SACP,OAAO;;;wBAsCR,MAAM,EAAE;4BAuCR,MAAM,EAAE,SACP,OAAO;6BA6CR,MAAM,EAAE,SACP,OAAO;qCAoER,MAAM,EAAE,SACP,OAAO;EAuHjB;AAED;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"createHooksInternal.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/createHooksInternal.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAE1E,OAAO,KAAK,EAAY,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAM1E,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACvB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EAAE,sBAAsB,EAAuB,MAAM,UAAU,CAAC;AAC5E,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EAEZ,2BAA2B,EAC3B,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,mCAAmC,EACnC,kCAAkC,EAClC,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,SAAS,SAAS,EACzB,WAAW,GAAG,OAAO,EACrB,MAAM,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC;;;;;qBAmFhC,MAAM,EAAE,SACP,OAAO;6BAwDR,MAAM,EAAE,SACP,OAAO;;;wBAsCR,MAAM,EAAE;4BAuCR,MAAM,EAAE,SACP,OAAO;6BA6CR,MAAM,EAAE,SACP,OAAO;qCAoER,MAAM,EAAE,SACP,OAAO;EAuHjB;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB,CAC/B,OAAO,SAAS,SAAS,EACzB,WAAW,GAAG,OAAO,IACnB,UAAU,CAAC,OAAO,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/react-query",
|
|
3
|
-
"version": "11.0.0-next-beta.
|
|
3
|
+
"version": "11.0.0-next-beta.253+9bcf00a0f",
|
|
4
4
|
"description": "The tRPC React library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@tanstack/react-query": "^5.0.0",
|
|
61
|
-
"@trpc/client": "11.0.0-next-beta.
|
|
62
|
-
"@trpc/server": "11.0.0-next-beta.
|
|
61
|
+
"@trpc/client": "11.0.0-next-beta.253+9bcf00a0f",
|
|
62
|
+
"@trpc/server": "11.0.0-next-beta.253+9bcf00a0f",
|
|
63
63
|
"react": ">=18.2.0",
|
|
64
64
|
"react-dom": ">=18.2.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@tanstack/react-query": "^5.0.0",
|
|
68
|
-
"@trpc/client": "11.0.0-next-beta.
|
|
69
|
-
"@trpc/server": "11.0.0-next-beta.
|
|
68
|
+
"@trpc/client": "11.0.0-next-beta.253+9bcf00a0f",
|
|
69
|
+
"@trpc/server": "11.0.0-next-beta.253+9bcf00a0f",
|
|
70
70
|
"@types/express": "^4.17.17",
|
|
71
71
|
"@types/node": "^20.10.0",
|
|
72
72
|
"@types/react": "^18.2.33",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"funding": [
|
|
86
86
|
"https://trpc.io/sponsor"
|
|
87
87
|
],
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "9bcf00a0f8367a70c4a9e72a1f194abc0bf702f6"
|
|
89
89
|
}
|
|
@@ -9,7 +9,12 @@ export function getClientArgs<TOptions>(
|
|
|
9
9
|
pageParam?: any,
|
|
10
10
|
) {
|
|
11
11
|
const path = queryKey[0];
|
|
12
|
-
|
|
13
|
-
if (pageParam)
|
|
12
|
+
let input = queryKey[1]?.input;
|
|
13
|
+
if (pageParam) {
|
|
14
|
+
input = {
|
|
15
|
+
...(input ?? {}),
|
|
16
|
+
cursor: pageParam,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
14
19
|
return [path.join('.'), input, (opts as any)?.trpc] as const;
|
|
15
20
|
}
|
|
@@ -503,26 +503,6 @@ export function createRootHooks<
|
|
|
503
503
|
useSuspenseInfiniteQuery,
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
|
-
/* istanbul ignore next */
|
|
507
|
-
/**
|
|
508
|
-
* Hack to infer the type of `createReactQueryHooks`
|
|
509
|
-
* @link https://stackoverflow.com/a/59072991
|
|
510
|
-
*/
|
|
511
|
-
class GnClass<TRouter extends AnyRouter, TSSRContext = unknown> {
|
|
512
|
-
fn() {
|
|
513
|
-
return createRootHooks<TRouter, TSSRContext>();
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
type returnTypeInferer<TType> = TType extends (
|
|
518
|
-
a: Record<string, string>,
|
|
519
|
-
) => infer U
|
|
520
|
-
? U
|
|
521
|
-
: never;
|
|
522
|
-
type fooType<TRouter extends AnyRouter, TSSRContext = unknown> = GnClass<
|
|
523
|
-
TRouter,
|
|
524
|
-
TSSRContext
|
|
525
|
-
>['fn'];
|
|
526
506
|
|
|
527
507
|
/**
|
|
528
508
|
* Infer the type of a `createReactQueryHooks` function
|
|
@@ -531,4 +511,4 @@ type fooType<TRouter extends AnyRouter, TSSRContext = unknown> = GnClass<
|
|
|
531
511
|
export type CreateReactQueryHooks<
|
|
532
512
|
TRouter extends AnyRouter,
|
|
533
513
|
TSSRContext = unknown,
|
|
534
|
-
> =
|
|
514
|
+
> = ReturnType<typeof createRootHooks<TRouter, TSSRContext>>;
|