@trpc/next 11.0.0-alpha.131 → 11.0.0-next-alpha.133

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,12 +1,12 @@
1
1
  {
2
- "bundleSize": 21857,
3
- "bundleOrigSize": 31694,
4
- "bundleReduction": 31.04,
2
+ "bundleSize": 22075,
3
+ "bundleOrigSize": 31928,
4
+ "bundleReduction": 30.86,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/withTRPC.tsx",
8
- "size": 7791,
9
- "origSize": 9068,
8
+ "size": 8009,
9
+ "origSize": 9302,
10
10
  "renderedExports": [
11
11
  "withTRPC"
12
12
  ],
@@ -15,8 +15,8 @@
15
15
  "/src/createTRPCNext.tsx",
16
16
  "/src/index.ts"
17
17
  ],
18
- "percent": 35.65,
19
- "reduction": 14.08
18
+ "percent": 36.28,
19
+ "reduction": 13.9
20
20
  },
21
21
  {
22
22
  "id": "/src/app-dir/server.ts",
@@ -29,7 +29,7 @@
29
29
  ],
30
30
  "removedExports": [],
31
31
  "dependents": [],
32
- "percent": 16.97,
32
+ "percent": 16.8,
33
33
  "reduction": 24.2
34
34
  },
35
35
  {
@@ -44,7 +44,7 @@
44
44
  "dependents": [
45
45
  "/src/app-dir/client.ts"
46
46
  ],
47
- "percent": 15.14,
47
+ "percent": 14.99,
48
48
  "reduction": 41.89
49
49
  },
50
50
  {
@@ -56,7 +56,7 @@
56
56
  ],
57
57
  "removedExports": [],
58
58
  "dependents": [],
59
- "percent": 11.38,
59
+ "percent": 11.27,
60
60
  "reduction": 7.89
61
61
  },
62
62
  {
@@ -68,7 +68,7 @@
68
68
  ],
69
69
  "removedExports": [],
70
70
  "dependents": [],
71
- "percent": 5.78,
71
+ "percent": 5.73,
72
72
  "reduction": 29.82
73
73
  },
74
74
  {
@@ -80,7 +80,7 @@
80
80
  ],
81
81
  "removedExports": [],
82
82
  "dependents": [],
83
- "percent": 5.45,
83
+ "percent": 5.4,
84
84
  "reduction": 30.5
85
85
  },
86
86
  {
@@ -94,7 +94,7 @@
94
94
  "dependents": [
95
95
  "/src/index.ts"
96
96
  ],
97
- "percent": 4.35,
97
+ "percent": 4.3,
98
98
  "reduction": 60.86
99
99
  },
100
100
  {
@@ -108,7 +108,7 @@
108
108
  "dependents": [
109
109
  "/src/app-dir/server.ts"
110
110
  ],
111
- "percent": 3.74,
111
+ "percent": 3.71,
112
112
  "reduction": 0.97
113
113
  },
114
114
  {
@@ -128,7 +128,7 @@
128
128
  "/src/app-dir/links/nextCache.ts",
129
129
  "/src/app-dir/links/nextHttp.ts"
130
130
  ],
131
- "percent": 1.53,
131
+ "percent": 1.52,
132
132
  "reduction": 86.63
133
133
  },
134
134
  {
package/dist/index.js CHANGED
@@ -157,9 +157,10 @@ function withTRPC(opts) {
157
157
  });
158
158
  }
159
159
  const dehydratedCache = reactQuery.dehydrate(queryClient, {
160
- shouldDehydrateQuery () {
161
- // makes sure errors are also dehydrated
162
- return true;
160
+ shouldDehydrateQuery (query) {
161
+ // filter out queries that are marked as trpc: { ssr: false } or are not enabled, but make sure errors are dehydrated
162
+ const isExcludedFromSSr = query.state.fetchStatus === 'idle' && query.state.status === 'pending';
163
+ return !isExcludedFromSSr;
163
164
  }
164
165
  });
165
166
  // since error instances can't be serialized, let's make them into `TRPCClientErrorLike`-objects
package/dist/index.mjs CHANGED
@@ -131,9 +131,10 @@ function withTRPC(opts) {
131
131
  });
132
132
  }
133
133
  const dehydratedCache = dehydrate(queryClient, {
134
- shouldDehydrateQuery () {
135
- // makes sure errors are also dehydrated
136
- return true;
134
+ shouldDehydrateQuery (query) {
135
+ // filter out queries that are marked as trpc: { ssr: false } or are not enabled, but make sure errors are dehydrated
136
+ const isExcludedFromSSr = query.state.fetchStatus === 'idle' && query.state.status === 'pending';
137
+ return !isExcludedFromSSr;
137
138
  }
138
139
  });
139
140
  // since error instances can't be serialized, let's make them into `TRPCClientErrorLike`-objects
@@ -1 +1 @@
1
- {"version":3,"file":"withTR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AA;KAAE,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAC7E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE;QACpB,GAAG,EAAE,eAAe,CAAC;QACrB,YAAY,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;KAC1C,KAAK,YAAY,CAAC;CACpB;AACD,MAAM,WAAW,oBAAoB,CAAC,OAAO,SAAS,SAAS,CAC7D,SAAQ,eAAe,CAAC,OAAO,CAAC;IAChC,GAAG,CAAC,EAAE,KAAK,CAAC;CACb;AAED,wBAAgB,QAAQ,CACtB,OAAO,SAAS,SAAS,EACzB,WAAW,SAAS,eAAe,GAAG,eAAe,EACrD,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC,eAU9C,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,KAAG,iBAAiB,CAqMxE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/next",
3
- "version": "11.0.0-alpha.131+d50deb794",
3
+ "version": "11.0.0-next-alpha.133+b786d25b0",
4
4
  "description": "The tRPC Next.js library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -67,18 +67,18 @@
67
67
  ],
68
68
  "peerDependencies": {
69
69
  "@tanstack/react-query": "^5.0.0",
70
- "@trpc/client": "11.0.0-alpha.131+d50deb794",
71
- "@trpc/react-query": "11.0.0-alpha.131+d50deb794",
72
- "@trpc/server": "11.0.0-alpha.131+d50deb794",
70
+ "@trpc/client": "11.0.0-next-alpha.133+b786d25b0",
71
+ "@trpc/react-query": "11.0.0-next-alpha.133+b786d25b0",
72
+ "@trpc/server": "11.0.0-next-alpha.133+b786d25b0",
73
73
  "next": "*",
74
- "react": ">=18.2.0",
75
- "react-dom": ">=18.2.0"
74
+ "react": ">=16.8.0",
75
+ "react-dom": ">=16.8.0"
76
76
  },
77
77
  "devDependencies": {
78
78
  "@tanstack/react-query": "^5.0.0",
79
- "@trpc/client": "11.0.0-alpha.131+d50deb794",
80
- "@trpc/react-query": "11.0.0-alpha.131+d50deb794",
81
- "@trpc/server": "11.0.0-alpha.131+d50deb794",
79
+ "@trpc/client": "11.0.0-next-alpha.133+b786d25b0",
80
+ "@trpc/react-query": "11.0.0-next-alpha.133+b786d25b0",
81
+ "@trpc/server": "11.0.0-next-alpha.133+b786d25b0",
82
82
  "@types/express": "^4.17.17",
83
83
  "@types/node": "^20.10.0",
84
84
  "@types/react": "^18.2.33",
@@ -98,5 +98,5 @@
98
98
  "funding": [
99
99
  "https://trpc.io/sponsor"
100
100
  ],
101
- "gitHead": "d50deb7943b1334b7de0adc71aaf31bc0ca1dcf8"
101
+ "gitHead": "b786d25b0f8ec63df12ec831e41663ebb665a2da"
102
102
  }
package/src/withTRPC.tsx CHANGED
@@ -227,9 +227,12 @@ export function withTRPC<
227
227
  });
228
228
  }
229
229
  const dehydratedCache = dehydrate(queryClient, {
230
- shouldDehydrateQuery() {
231
- // makes sure errors are also dehydrated
232
- return true;
230
+ shouldDehydrateQuery(query) {
231
+ // filter out queries that are marked as trpc: { ssr: false } or are not enabled, but make sure errors are dehydrated
232
+ const isExcludedFromSSr =
233
+ query.state.fetchStatus === 'idle' &&
234
+ query.state.status === 'pending';
235
+ return !isExcludedFromSSr;
233
236
  },
234
237
  });
235
238
  // since error instances can't be serialized, let's make them into `TRPCClientErrorLike`-objects