@trpc/tanstack-react-query 11.28.0 → 11.28.1
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/tanstack-react-query",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "11.28.
|
|
4
|
+
"version": "11.28.1",
|
|
5
5
|
"description": "TanStack React Query Integration for tRPC",
|
|
6
6
|
"author": "juliusmarminge",
|
|
7
7
|
"license": "MIT",
|
|
@@ -59,16 +59,16 @@
|
|
|
59
59
|
],
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@tanstack/react-query": "^5.106.0",
|
|
62
|
-
"@trpc/client": "11.28.
|
|
63
|
-
"@trpc/server": "11.28.
|
|
62
|
+
"@trpc/client": "11.28.1",
|
|
63
|
+
"@trpc/server": "11.28.1",
|
|
64
64
|
"react": ">=18.2.0",
|
|
65
65
|
"typescript": ">=5.7.2"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@tanstack/intent": "0.5.6",
|
|
69
69
|
"@tanstack/react-query": "^5.107.1",
|
|
70
|
-
"@trpc/client": "11.28.
|
|
71
|
-
"@trpc/server": "11.28.
|
|
70
|
+
"@trpc/client": "11.28.1",
|
|
71
|
+
"@trpc/server": "11.28.1",
|
|
72
72
|
"@types/node": "^24.19.2",
|
|
73
73
|
"@types/react": "^19.3.0",
|
|
74
74
|
"event-source-polyfill": "^1.0.31",
|
package/skills/react-query-setup/references/client-tanstack-react-query-server-components.md
CHANGED
|
@@ -140,6 +140,12 @@ export function makeQueryClient() {
|
|
|
140
140
|
shouldDehydrateQuery: (query) =>
|
|
141
141
|
defaultShouldDehydrateQuery(query) ||
|
|
142
142
|
query.state.status === 'pending',
|
|
143
|
+
shouldRedactErrors: (error) => {
|
|
144
|
+
// Next.js detects dynamic pages by catching the errors we throw, so
|
|
145
|
+
// we must not redact them here. Next.js redacts with a better digest
|
|
146
|
+
// of its own.
|
|
147
|
+
return false;
|
|
148
|
+
},
|
|
143
149
|
},
|
|
144
150
|
hydrate: {
|
|
145
151
|
// deserializeData: superjson.deserialize,
|
|
@@ -155,6 +161,10 @@ We're setting a few default options here:
|
|
|
155
161
|
- `shouldDehydrateQuery`: This is a function that determines whether a query should be dehydrated or not. Since the RSC transport protocol
|
|
156
162
|
supports hydrating promises over the network, we extend the `defaultShouldDehydrateQuery` function to also include queries that are
|
|
157
163
|
still pending. This will allow us to start prefetching in a server component high up the tree, then consuming that promise in a client component further down.
|
|
164
|
+
- `shouldRedactErrors`: Next.js detects dynamic rendering by looking for the `digest` on an error thrown during the render. Because
|
|
165
|
+
`shouldDehydrateQuery` also dehydrates queries that are still pending, a query that is pending during the build can reject afterwards,
|
|
166
|
+
and its error gets dehydrated and redacted before Next.js sees the `digest`. The build then fails. Returning `false` here keeps the
|
|
167
|
+
`digest` intact so Next.js can still recognise the error.
|
|
158
168
|
- `serializeData` and `deserializeData` (optional): If you set up a [data transformer](https://trpc.io/docs/server/data-transformers) in the previous step, set this option
|
|
159
169
|
to make sure the data is serialized correctly when hydrating the query client over the server-client boundary.
|
|
160
170
|
|