@trpc/react-query 11.0.0-alpha-tmp-app-router-example.382 → 11.0.0-alpha-tmp-app-router-example.383

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.
@@ -1,7 +1,7 @@
1
1
  {
2
- "bundleSize": 32132,
3
- "bundleOrigSize": 68297,
4
- "bundleReduction": 52.95,
2
+ "bundleSize": 32315,
3
+ "bundleOrigSize": 68524,
4
+ "bundleReduction": 52.84,
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.77,
17
+ "percent": 42.53,
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.77,
32
+ "percent": 11.7,
33
33
  "reduction": 6.34
34
34
  },
35
35
  {
@@ -43,9 +43,21 @@
43
43
  "dependents": [
44
44
  "/src/server/index.ts"
45
45
  ],
46
- "percent": 11.43,
46
+ "percent": 11.37,
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
+ },
49
61
  {
50
62
  "id": "/src/shared/proxy/utilsProxy.ts",
51
63
  "size": 2869,
@@ -59,21 +71,9 @@
59
71
  "dependents": [
60
72
  "/src/shared/index.ts"
61
73
  ],
62
- "percent": 8.93,
74
+ "percent": 8.88,
63
75
  "reduction": 74.38
64
76
  },
65
- {
66
- "id": "/src/rsc.tsx",
67
- "size": 2701,
68
- "origSize": 4857,
69
- "renderedExports": [
70
- "createHydrationHelpers"
71
- ],
72
- "removedExports": [],
73
- "dependents": [],
74
- "percent": 8.41,
75
- "reduction": 44.39
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.22,
94
+ "percent": 6.19,
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.65,
109
+ "percent": 2.63,
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.51,
123
+ "percent": 2.49,
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.77,
138
+ "percent": 1.76,
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.47,
154
+ "percent": 1.46,
155
155
  "reduction": 17.31
156
156
  },
157
157
  {
package/dist/rsc.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"rsc.d.ts","sourceRoot":"","sources":["../src/rsc.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,YAAY,EAClB,MAAM,0C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DyB;QAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;KAAE;EAmD5D"}
package/dist/rsc.js CHANGED
@@ -38,18 +38,22 @@ function createHydrationHelpers(caller, getQueryClient) {
38
38
  const helper = path.pop();
39
39
  if (helper === 'prefetch') {
40
40
  const args1 = args[1];
41
+ const def = await caller._def();
42
+ const transformer = def._config.transformer.output;
41
43
  return getQueryClient().prefetchQuery({
42
44
  ...args1,
43
45
  queryKey: getQueryKey.getQueryKeyInternal(path, input, 'query'),
44
- queryFn: ()=>promise
46
+ queryFn: ()=>promise.then((value)=>transformer.serialize(value))
45
47
  });
46
48
  }
47
49
  if (helper === 'prefetchInfinite') {
48
50
  const args11 = args[1];
51
+ const def1 = await caller._def();
52
+ const transformer1 = def1._config.transformer.output;
49
53
  return getQueryClient().prefetchInfiniteQuery({
50
54
  ...args11,
51
55
  queryKey: getQueryKey.getQueryKeyInternal(path, input, 'infinite'),
52
- queryFn: ()=>promise,
56
+ queryFn: ()=>promise.then((value)=>transformer1.serialize(value)),
53
57
  initialPageParam: args11?.initialCursor ?? null
54
58
  });
55
59
  }
@@ -57,8 +61,6 @@ function createHydrationHelpers(caller, getQueryClient) {
57
61
  });
58
62
  function HydrateClient(props) {
59
63
  const dehydratedState = reactQuery.dehydrate(getQueryClient());
60
- // TODO: transform?? We can't transform promises i don't think...
61
- // since that is handled by React internally
62
64
  return /*#__PURE__*/ React__namespace.createElement(reactQuery.HydrationBoundary, {
63
65
  state: dehydratedState
64
66
  }, props.children);
package/dist/rsc.mjs CHANGED
@@ -17,18 +17,22 @@ function createHydrationHelpers(caller, getQueryClient) {
17
17
  const helper = path.pop();
18
18
  if (helper === 'prefetch') {
19
19
  const args1 = args[1];
20
+ const def = await caller._def();
21
+ const transformer = def._config.transformer.output;
20
22
  return getQueryClient().prefetchQuery({
21
23
  ...args1,
22
24
  queryKey: getQueryKeyInternal(path, input, 'query'),
23
- queryFn: ()=>promise
25
+ queryFn: ()=>promise.then((value)=>transformer.serialize(value))
24
26
  });
25
27
  }
26
28
  if (helper === 'prefetchInfinite') {
27
29
  const args11 = args[1];
30
+ const def1 = await caller._def();
31
+ const transformer1 = def1._config.transformer.output;
28
32
  return getQueryClient().prefetchInfiniteQuery({
29
33
  ...args11,
30
34
  queryKey: getQueryKeyInternal(path, input, 'infinite'),
31
- queryFn: ()=>promise,
35
+ queryFn: ()=>promise.then((value)=>transformer1.serialize(value)),
32
36
  initialPageParam: args11?.initialCursor ?? null
33
37
  });
34
38
  }
@@ -36,8 +40,6 @@ function createHydrationHelpers(caller, getQueryClient) {
36
40
  });
37
41
  function HydrateClient(props) {
38
42
  const dehydratedState = dehydrate(getQueryClient());
39
- // TODO: transform?? We can't transform promises i don't think...
40
- // since that is handled by React internally
41
43
  return /*#__PURE__*/ React.createElement(HydrationBoundary, {
42
44
  state: dehydratedState
43
45
  }, props.children);
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.382+c359a47e9",
3
+ "version": "11.0.0-alpha-tmp-app-router-example.383+882a6dd80",
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.382+c359a47e9",
68
- "@trpc/server": "11.0.0-alpha-tmp-app-router-example.382+c359a47e9",
67
+ "@trpc/client": "11.0.0-alpha-tmp-app-router-example.383+882a6dd80",
68
+ "@trpc/server": "11.0.0-alpha-tmp-app-router-example.383+882a6dd80",
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.382+c359a47e9",
75
- "@trpc/server": "11.0.0-alpha-tmp-app-router-example.382+c359a47e9",
74
+ "@trpc/client": "11.0.0-alpha-tmp-app-router-example.383+882a6dd80",
75
+ "@trpc/server": "11.0.0-alpha-tmp-app-router-example.383+882a6dd80",
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": "c359a47e9da8bc4c8d177189e3738fe440d87ddd"
95
+ "gitHead": "882a6dd800c3b75d864c5a5cfddaa2229d95c708"
96
96
  }
package/src/rsc.tsx CHANGED
@@ -92,20 +92,28 @@ export function createHydrationHelpers<TRouter extends AnyRouter>(
92
92
  const args1 = args[1] as Maybe<
93
93
  TRPCFetchInfiniteQueryOptions<any, any, any>
94
94
  >;
95
+
96
+ const def: AnyRouter['_def'] = await (caller as any)._def();
97
+ const transformer = def._config.transformer.output;
98
+
95
99
  return getQueryClient().prefetchQuery({
96
100
  ...args1,
97
101
  queryKey: getQueryKeyInternal(path, input, 'query'),
98
- queryFn: () => promise,
102
+ queryFn: () => promise.then((value) => transformer.serialize(value)),
99
103
  });
100
104
  }
101
105
  if (helper === 'prefetchInfinite') {
102
106
  const args1 = args[1] as Maybe<
103
107
  TRPCFetchInfiniteQueryOptions<any, any, any>
104
108
  >;
109
+
110
+ const def: AnyRouter['_def'] = await (caller as any)._def();
111
+ const transformer = def._config.transformer.output;
112
+
105
113
  return getQueryClient().prefetchInfiniteQuery({
106
114
  ...args1,
107
115
  queryKey: getQueryKeyInternal(path, input, 'infinite'),
108
- queryFn: () => promise,
116
+ queryFn: () => promise.then((value) => transformer.serialize(value)),
109
117
  initialPageParam: args1?.initialCursor ?? null,
110
118
  });
111
119
  }
@@ -115,8 +123,6 @@ export function createHydrationHelpers<TRouter extends AnyRouter>(
115
123
 
116
124
  function HydrateClient(props: { children: React.ReactNode }) {
117
125
  const dehydratedState = dehydrate(getQueryClient());
118
- // TODO: transform?? We can't transform promises i don't think...
119
- // since that is handled by React internally
120
126
 
121
127
  return (
122
128
  <HydrationBoundary state={dehydratedState}>