@trpc/react-query 11.0.0-alpha-tmp-app-router-example.383 → 11.0.0-alpha-tmp-app-router-example.384
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 +24 -24
- package/dist/rsc.js +7 -6
- package/dist/rsc.mjs +7 -6
- package/package.json +6 -6
- package/src/rsc.tsx +8 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 52.
|
|
2
|
+
"bundleSize": 32207,
|
|
3
|
+
"bundleOrigSize": 68385,
|
|
4
|
+
"bundleReduction": 52.9,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/shared/hooks/createHooksInternal.tsx",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dependents": [
|
|
15
15
|
"/src/createTRPCReact.tsx"
|
|
16
16
|
],
|
|
17
|
-
"percent": 42.
|
|
17
|
+
"percent": 42.67,
|
|
18
18
|
"reduction": 12.84
|
|
19
19
|
},
|
|
20
20
|
{
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"/src/createTRPCQueryUtils.tsx",
|
|
30
30
|
"/src/shared/hooks/createHooksInternal.tsx"
|
|
31
31
|
],
|
|
32
|
-
"percent": 11.
|
|
32
|
+
"percent": 11.74,
|
|
33
33
|
"reduction": 6.34
|
|
34
34
|
},
|
|
35
35
|
{
|
|
@@ -43,21 +43,9 @@
|
|
|
43
43
|
"dependents": [
|
|
44
44
|
"/src/server/index.ts"
|
|
45
45
|
],
|
|
46
|
-
"percent": 11.
|
|
46
|
+
"percent": 11.4,
|
|
47
47
|
"reduction": 50.38
|
|
48
48
|
},
|
|
49
|
-
{
|
|
50
|
-
"id": "/src/rsc.tsx",
|
|
51
|
-
"size": 2884,
|
|
52
|
-
"origSize": 5084,
|
|
53
|
-
"renderedExports": [
|
|
54
|
-
"createHydrationHelpers"
|
|
55
|
-
],
|
|
56
|
-
"removedExports": [],
|
|
57
|
-
"dependents": [],
|
|
58
|
-
"percent": 8.92,
|
|
59
|
-
"reduction": 43.27
|
|
60
|
-
},
|
|
61
49
|
{
|
|
62
50
|
"id": "/src/shared/proxy/utilsProxy.ts",
|
|
63
51
|
"size": 2869,
|
|
@@ -71,9 +59,21 @@
|
|
|
71
59
|
"dependents": [
|
|
72
60
|
"/src/shared/index.ts"
|
|
73
61
|
],
|
|
74
|
-
"percent": 8.
|
|
62
|
+
"percent": 8.91,
|
|
75
63
|
"reduction": 74.38
|
|
76
64
|
},
|
|
65
|
+
{
|
|
66
|
+
"id": "/src/rsc.tsx",
|
|
67
|
+
"size": 2776,
|
|
68
|
+
"origSize": 4945,
|
|
69
|
+
"renderedExports": [
|
|
70
|
+
"createHydrationHelpers"
|
|
71
|
+
],
|
|
72
|
+
"removedExports": [],
|
|
73
|
+
"dependents": [],
|
|
74
|
+
"percent": 8.62,
|
|
75
|
+
"reduction": 43.86
|
|
76
|
+
},
|
|
77
77
|
{
|
|
78
78
|
"id": "/src/internals/getQueryKey.ts",
|
|
79
79
|
"size": 1999,
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"/src/shared/proxy/useQueriesProxy.ts",
|
|
92
92
|
"/src/shared/hooks/createHooksInternal.tsx"
|
|
93
93
|
],
|
|
94
|
-
"percent": 6.
|
|
94
|
+
"percent": 6.21,
|
|
95
95
|
"reduction": 42.49
|
|
96
96
|
},
|
|
97
97
|
{
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"dependents": [
|
|
107
107
|
"/src/index.ts"
|
|
108
108
|
],
|
|
109
|
-
"percent": 2.
|
|
109
|
+
"percent": 2.64,
|
|
110
110
|
"reduction": 89.28
|
|
111
111
|
},
|
|
112
112
|
{
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"dependents": [
|
|
121
121
|
"/src/shared/index.ts"
|
|
122
122
|
],
|
|
123
|
-
"percent": 2.
|
|
123
|
+
"percent": 2.5,
|
|
124
124
|
"reduction": 23.16
|
|
125
125
|
},
|
|
126
126
|
{
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"/src/shared/index.ts",
|
|
136
136
|
"/src/shared/hooks/createHooksInternal.tsx"
|
|
137
137
|
],
|
|
138
|
-
"percent": 1.
|
|
138
|
+
"percent": 1.77,
|
|
139
139
|
"reduction": 82.03
|
|
140
140
|
},
|
|
141
141
|
{
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
"/src/shared/hooks/createHooksInternal.tsx",
|
|
152
152
|
"/src/utils/createUtilityFunctions.ts"
|
|
153
153
|
],
|
|
154
|
-
"percent": 1.
|
|
154
|
+
"percent": 1.47,
|
|
155
155
|
"reduction": 17.31
|
|
156
156
|
},
|
|
157
157
|
{
|
package/dist/rsc.js
CHANGED
|
@@ -35,25 +35,26 @@ function createHydrationHelpers(caller, getQueryClient) {
|
|
|
35
35
|
HELPERS.includes(key) ? acc : acc[key], caller);
|
|
36
36
|
const input = args[0];
|
|
37
37
|
const promise = proc(input);
|
|
38
|
+
const queryFn = async ()=>{
|
|
39
|
+
const def = await caller._def();
|
|
40
|
+
const transformer = def._config.transformer;
|
|
41
|
+
return promise.then((value)=>transformer.output.serialize(value));
|
|
42
|
+
};
|
|
38
43
|
const helper = path.pop();
|
|
39
44
|
if (helper === 'prefetch') {
|
|
40
45
|
const args1 = args[1];
|
|
41
|
-
const def = await caller._def();
|
|
42
|
-
const transformer = def._config.transformer.output;
|
|
43
46
|
return getQueryClient().prefetchQuery({
|
|
44
47
|
...args1,
|
|
45
48
|
queryKey: getQueryKey.getQueryKeyInternal(path, input, 'query'),
|
|
46
|
-
queryFn
|
|
49
|
+
queryFn
|
|
47
50
|
});
|
|
48
51
|
}
|
|
49
52
|
if (helper === 'prefetchInfinite') {
|
|
50
53
|
const args11 = args[1];
|
|
51
|
-
const def1 = await caller._def();
|
|
52
|
-
const transformer1 = def1._config.transformer.output;
|
|
53
54
|
return getQueryClient().prefetchInfiniteQuery({
|
|
54
55
|
...args11,
|
|
55
56
|
queryKey: getQueryKey.getQueryKeyInternal(path, input, 'infinite'),
|
|
56
|
-
queryFn
|
|
57
|
+
queryFn,
|
|
57
58
|
initialPageParam: args11?.initialCursor ?? null
|
|
58
59
|
});
|
|
59
60
|
}
|
package/dist/rsc.mjs
CHANGED
|
@@ -14,25 +14,26 @@ function createHydrationHelpers(caller, getQueryClient) {
|
|
|
14
14
|
HELPERS.includes(key) ? acc : acc[key], caller);
|
|
15
15
|
const input = args[0];
|
|
16
16
|
const promise = proc(input);
|
|
17
|
+
const queryFn = async ()=>{
|
|
18
|
+
const def = await caller._def();
|
|
19
|
+
const transformer = def._config.transformer;
|
|
20
|
+
return promise.then((value)=>transformer.output.serialize(value));
|
|
21
|
+
};
|
|
17
22
|
const helper = path.pop();
|
|
18
23
|
if (helper === 'prefetch') {
|
|
19
24
|
const args1 = args[1];
|
|
20
|
-
const def = await caller._def();
|
|
21
|
-
const transformer = def._config.transformer.output;
|
|
22
25
|
return getQueryClient().prefetchQuery({
|
|
23
26
|
...args1,
|
|
24
27
|
queryKey: getQueryKeyInternal(path, input, 'query'),
|
|
25
|
-
queryFn
|
|
28
|
+
queryFn
|
|
26
29
|
});
|
|
27
30
|
}
|
|
28
31
|
if (helper === 'prefetchInfinite') {
|
|
29
32
|
const args11 = args[1];
|
|
30
|
-
const def1 = await caller._def();
|
|
31
|
-
const transformer1 = def1._config.transformer.output;
|
|
32
33
|
return getQueryClient().prefetchInfiniteQuery({
|
|
33
34
|
...args11,
|
|
34
35
|
queryKey: getQueryKeyInternal(path, input, 'infinite'),
|
|
35
|
-
queryFn
|
|
36
|
+
queryFn,
|
|
36
37
|
initialPageParam: args11?.initialCursor ?? null
|
|
37
38
|
});
|
|
38
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/react-query",
|
|
3
|
-
"version": "11.0.0-alpha-tmp-app-router-example.
|
|
3
|
+
"version": "11.0.0-alpha-tmp-app-router-example.384+28243c34d",
|
|
4
4
|
"description": "The tRPC React library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -64,15 +64,15 @@
|
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@tanstack/react-query": "^5.25.0",
|
|
67
|
-
"@trpc/client": "11.0.0-alpha-tmp-app-router-example.
|
|
68
|
-
"@trpc/server": "11.0.0-alpha-tmp-app-router-example.
|
|
67
|
+
"@trpc/client": "11.0.0-alpha-tmp-app-router-example.384+28243c34d",
|
|
68
|
+
"@trpc/server": "11.0.0-alpha-tmp-app-router-example.384+28243c34d",
|
|
69
69
|
"react": ">=18.2.0",
|
|
70
70
|
"react-dom": ">=18.2.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@tanstack/react-query": "^5.40.0",
|
|
74
|
-
"@trpc/client": "11.0.0-alpha-tmp-app-router-example.
|
|
75
|
-
"@trpc/server": "11.0.0-alpha-tmp-app-router-example.
|
|
74
|
+
"@trpc/client": "11.0.0-alpha-tmp-app-router-example.384+28243c34d",
|
|
75
|
+
"@trpc/server": "11.0.0-alpha-tmp-app-router-example.384+28243c34d",
|
|
76
76
|
"@types/express": "^4.17.17",
|
|
77
77
|
"@types/node": "^20.10.0",
|
|
78
78
|
"@types/react": "^18.3.1",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"funding": [
|
|
93
93
|
"https://trpc.io/sponsor"
|
|
94
94
|
],
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "28243c34dd1f4145ef6e9d350bf2cab8e5139ac8"
|
|
96
96
|
}
|
package/src/rsc.tsx
CHANGED
|
@@ -87,19 +87,22 @@ export function createHydrationHelpers<TRouter extends AnyRouter>(
|
|
|
87
87
|
const input = args[0];
|
|
88
88
|
const promise = proc(input);
|
|
89
89
|
|
|
90
|
+
const queryFn = async () => {
|
|
91
|
+
const def: AnyRouter['_def'] = await (caller as any)._def();
|
|
92
|
+
const transformer = def._config.transformer;
|
|
93
|
+
return promise.then((value) => transformer.output.serialize(value));
|
|
94
|
+
};
|
|
95
|
+
|
|
90
96
|
const helper = path.pop();
|
|
91
97
|
if (helper === 'prefetch') {
|
|
92
98
|
const args1 = args[1] as Maybe<
|
|
93
99
|
TRPCFetchInfiniteQueryOptions<any, any, any>
|
|
94
100
|
>;
|
|
95
101
|
|
|
96
|
-
const def: AnyRouter['_def'] = await (caller as any)._def();
|
|
97
|
-
const transformer = def._config.transformer.output;
|
|
98
|
-
|
|
99
102
|
return getQueryClient().prefetchQuery({
|
|
100
103
|
...args1,
|
|
101
104
|
queryKey: getQueryKeyInternal(path, input, 'query'),
|
|
102
|
-
queryFn
|
|
105
|
+
queryFn,
|
|
103
106
|
});
|
|
104
107
|
}
|
|
105
108
|
if (helper === 'prefetchInfinite') {
|
|
@@ -107,13 +110,10 @@ export function createHydrationHelpers<TRouter extends AnyRouter>(
|
|
|
107
110
|
TRPCFetchInfiniteQueryOptions<any, any, any>
|
|
108
111
|
>;
|
|
109
112
|
|
|
110
|
-
const def: AnyRouter['_def'] = await (caller as any)._def();
|
|
111
|
-
const transformer = def._config.transformer.output;
|
|
112
|
-
|
|
113
113
|
return getQueryClient().prefetchInfiniteQuery({
|
|
114
114
|
...args1,
|
|
115
115
|
queryKey: getQueryKeyInternal(path, input, 'infinite'),
|
|
116
|
-
queryFn
|
|
116
|
+
queryFn,
|
|
117
117
|
initialPageParam: args1?.initialCursor ?? null,
|
|
118
118
|
});
|
|
119
119
|
}
|