@trpc/server 11.0.0-alpha-tmp-rethrow-next-errors.384 → 11.0.0-alpha-tmp-rethrow-next-errors.386

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 +1 @@
1
- {"version":3,"file":"rethrowNextErrors.d.ts","sourceRoot":"","sources":["../../../src/adapters/next-app-dir/rethrowNextErrors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAmCpD;;GAEG;AACH,eAAO,MAAM,iBAAiB,UAAW,SAAS,SAqBjD,CAAC"}
1
+ {"version":3,"file":"rethrowNextErrors.d.ts","sourceRoot":"","sources":["../../../src/adapters/next-app-dir/rethrowNextErrors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAyCpD;;GAEG;AACH,eAAO,MAAM,iBAAiB,UAAW,SAAS,SAqBjD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var nextNavigation = require('next/navigation');
3
+ var nextNavigation = require('next/navigation.js');
4
4
  var redirect = require('./redirect.js');
5
5
 
6
6
  function _interopNamespaceDefault(e) {
@@ -25,6 +25,7 @@ var nextNavigation__namespace = /*#__PURE__*/_interopNamespaceDefault(nextNaviga
25
25
  /**
26
26
  * @remarks The helpers from `next/dist/client/components/*` has been removed in Next.js 15.
27
27
  * Inlining them here instead...
28
+ * @see https://github.com/vercel/next.js/blob/5ae286ffd664e5c76841ed64f6e2da85a0835922/packages/next/src/client/components/redirect.ts#L97-L123
28
29
  */ const REDIRECT_ERROR_CODE = 'NEXT_REDIRECT';
29
30
  function isRedirectError(error) {
30
31
  if (typeof error !== 'object' || error === null || !('digest' in error) || typeof error.digest !== 'string') {
@@ -34,7 +35,11 @@ function isRedirectError(error) {
34
35
  const statusCode = Number(status);
35
36
  return errorCode === REDIRECT_ERROR_CODE && (type === 'replace' || type === 'push') && typeof destination === 'string' && !isNaN(statusCode);
36
37
  }
37
- const NOT_FOUND_ERROR_CODE = 'NEXT_NOT_FOUND';
38
+ /**
39
+ * @remarks The helpers from `next/dist/client/components/*` has been removed in Next.js 15.
40
+ * Inlining them here instead...
41
+ * @see https://github.com/vercel/next.js/blob/5ae286ffd664e5c76841ed64f6e2da85a0835922/packages/next/src/client/components/not-found.ts#L33-L39
42
+ */ const NOT_FOUND_ERROR_CODE = 'NEXT_NOT_FOUND';
38
43
  function isNotFoundError(error) {
39
44
  if (typeof error !== 'object' || error === null || !('digest' in error)) {
40
45
  return false;
@@ -1,9 +1,10 @@
1
- import * as nextNavigation from 'next/navigation';
1
+ import * as nextNavigation from 'next/navigation.js';
2
2
  import { TRPCRedirectError } from './redirect.mjs';
3
3
 
4
4
  /**
5
5
  * @remarks The helpers from `next/dist/client/components/*` has been removed in Next.js 15.
6
6
  * Inlining them here instead...
7
+ * @see https://github.com/vercel/next.js/blob/5ae286ffd664e5c76841ed64f6e2da85a0835922/packages/next/src/client/components/redirect.ts#L97-L123
7
8
  */ const REDIRECT_ERROR_CODE = 'NEXT_REDIRECT';
8
9
  function isRedirectError(error) {
9
10
  if (typeof error !== 'object' || error === null || !('digest' in error) || typeof error.digest !== 'string') {
@@ -13,7 +14,11 @@ function isRedirectError(error) {
13
14
  const statusCode = Number(status);
14
15
  return errorCode === REDIRECT_ERROR_CODE && (type === 'replace' || type === 'push') && typeof destination === 'string' && !isNaN(statusCode);
15
16
  }
16
- const NOT_FOUND_ERROR_CODE = 'NEXT_NOT_FOUND';
17
+ /**
18
+ * @remarks The helpers from `next/dist/client/components/*` has been removed in Next.js 15.
19
+ * Inlining them here instead...
20
+ * @see https://github.com/vercel/next.js/blob/5ae286ffd664e5c76841ed64f6e2da85a0835922/packages/next/src/client/components/not-found.ts#L33-L39
21
+ */ const NOT_FOUND_ERROR_CODE = 'NEXT_NOT_FOUND';
17
22
  function isNotFoundError(error) {
18
23
  if (typeof error !== 'object' || error === null || !('digest' in error)) {
19
24
  return false;
@@ -1,7 +1,7 @@
1
1
  {
2
- "bundleSize": 104173,
3
- "bundleOrigSize": 152920,
4
- "bundleReduction": 31.88,
2
+ "bundleSize": 104597,
3
+ "bundleOrigSize": 153347,
4
+ "bundleReduction": 31.79,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/unstable-core-do-not-import/stream/stream.ts",
@@ -17,7 +17,7 @@
17
17
  "/src/unstable-core-do-not-import.ts",
18
18
  "/src/unstable-core-do-not-import/http/resolveResponse.ts"
19
19
  ],
20
- "percent": 13.88,
20
+ "percent": 13.82,
21
21
  "reduction": 9.37
22
22
  },
23
23
  {
@@ -32,7 +32,7 @@
32
32
  "dependents": [
33
33
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
34
34
  ],
35
- "percent": 10.79,
35
+ "percent": 10.75,
36
36
  "reduction": 0
37
37
  },
38
38
  {
@@ -46,7 +46,7 @@
46
46
  "dependents": [
47
47
  "/src/unstable-core-do-not-import.ts"
48
48
  ],
49
- "percent": 10.04,
49
+ "percent": 10,
50
50
  "reduction": 4.19
51
51
  },
52
52
  {
@@ -61,7 +61,7 @@
61
61
  "/src/unstable-core-do-not-import.ts",
62
62
  "/src/unstable-core-do-not-import/initTRPC.ts"
63
63
  ],
64
- "percent": 6.07,
64
+ "percent": 6.05,
65
65
  "reduction": 59.52
66
66
  },
67
67
  {
@@ -77,10 +77,10 @@
77
77
  "removedExports": [],
78
78
  "dependents": [
79
79
  "/src/unstable-core-do-not-import.ts",
80
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
81
- "/src/unstable-core-do-not-import/initTRPC.ts"
80
+ "/src/unstable-core-do-not-import/initTRPC.ts",
81
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts"
82
82
  ],
83
- "percent": 5.75,
83
+ "percent": 5.72,
84
84
  "reduction": 41.05
85
85
  },
86
86
  {
@@ -95,7 +95,7 @@
95
95
  "/src/unstable-core-do-not-import.ts",
96
96
  "/src/unstable-core-do-not-import/http/resolveResponse.ts"
97
97
  ],
98
- "percent": 5.32,
98
+ "percent": 5.3,
99
99
  "reduction": 0
100
100
  },
101
101
  {
@@ -109,7 +109,7 @@
109
109
  "dependents": [
110
110
  "/src/adapters/aws-lambda/index.ts"
111
111
  ],
112
- "percent": 4.66,
112
+ "percent": 4.64,
113
113
  "reduction": 13.62
114
114
  },
115
115
  {
@@ -123,7 +123,7 @@
123
123
  "dependents": [
124
124
  "/src/adapters/next-app-dir.ts"
125
125
  ],
126
- "percent": 3.01,
126
+ "percent": 3,
127
127
  "reduction": 22.27
128
128
  },
129
129
  {
@@ -140,7 +140,7 @@
140
140
  "/src/observable/index.ts",
141
141
  "/src/observable/operators.ts"
142
142
  ],
143
- "percent": 3,
143
+ "percent": 2.99,
144
144
  "reduction": 0.67
145
145
  },
146
146
  {
@@ -156,7 +156,7 @@
156
156
  "dependents": [
157
157
  "/src/observable/index.ts"
158
158
  ],
159
- "percent": 2.65,
159
+ "percent": 2.63,
160
160
  "reduction": 0
161
161
  },
162
162
  {
@@ -172,11 +172,11 @@
172
172
  "removedExports": [],
173
173
  "dependents": [
174
174
  "/src/unstable-core-do-not-import.ts",
175
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
176
175
  "/src/unstable-core-do-not-import/router.ts",
177
- "/src/unstable-core-do-not-import/initTRPC.ts"
176
+ "/src/unstable-core-do-not-import/initTRPC.ts",
177
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts"
178
178
  ],
179
- "percent": 2.63,
179
+ "percent": 2.62,
180
180
  "reduction": 45.94
181
181
  },
182
182
  {
@@ -190,7 +190,7 @@
190
190
  "dependents": [
191
191
  "/src/unstable-core-do-not-import.ts"
192
192
  ],
193
- "percent": 2.6,
193
+ "percent": 2.59,
194
194
  "reduction": 40.91
195
195
  },
196
196
  {
@@ -210,7 +210,7 @@
210
210
  "/src/unstable-core-do-not-import/initTRPC.ts",
211
211
  "/src/unstable-core-do-not-import/procedureBuilder.ts"
212
212
  ],
213
- "percent": 2.52,
213
+ "percent": 2.51,
214
214
  "reduction": 55.5
215
215
  },
216
216
  {
@@ -239,9 +239,23 @@
239
239
  "/src/adapters/node-http/index.ts",
240
240
  "/src/adapters/node-http/nodeHTTPRequestHandler.ts"
241
241
  ],
242
- "percent": 2.09,
242
+ "percent": 2.08,
243
243
  "reduction": 14.12
244
244
  },
245
+ {
246
+ "id": "/src/adapters/next-app-dir/rethrowNextErrors.ts",
247
+ "size": 2050,
248
+ "origSize": 2176,
249
+ "renderedExports": [
250
+ "rethrowNextErrors"
251
+ ],
252
+ "removedExports": [],
253
+ "dependents": [
254
+ "/src/adapters/next-app-dir/nextAppDirCaller.ts"
255
+ ],
256
+ "percent": 1.96,
257
+ "reduction": 5.79
258
+ },
245
259
  {
246
260
  "id": "/src/unstable-core-do-not-import/createProxy.ts",
247
261
  "size": 2000,
@@ -255,7 +269,7 @@
255
269
  "/src/unstable-core-do-not-import.ts",
256
270
  "/src/unstable-core-do-not-import/router.ts"
257
271
  ],
258
- "percent": 1.92,
272
+ "percent": 1.91,
259
273
  "reduction": 0
260
274
  },
261
275
  {
@@ -270,9 +284,9 @@
270
284
  "removedExports": [],
271
285
  "dependents": [
272
286
  "/src/unstable-core-do-not-import.ts",
273
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
274
287
  "/src/unstable-core-do-not-import/router.ts",
275
288
  "/src/unstable-core-do-not-import/middleware.ts",
289
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts",
276
290
  "/src/unstable-core-do-not-import/http/contentType.ts",
277
291
  "/src/unstable-core-do-not-import/procedureBuilder.ts"
278
292
  ],
@@ -293,20 +307,6 @@
293
307
  "percent": 1.65,
294
308
  "reduction": 20.03
295
309
  },
296
- {
297
- "id": "/src/adapters/next-app-dir/rethrowNextErrors.ts",
298
- "size": 1626,
299
- "origSize": 1749,
300
- "renderedExports": [
301
- "rethrowNextErrors"
302
- ],
303
- "removedExports": [],
304
- "dependents": [
305
- "/src/adapters/next-app-dir/nextAppDirCaller.ts"
306
- ],
307
- "percent": 1.56,
308
- "reduction": 7.03
309
- },
310
310
  {
311
311
  "id": "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
312
312
  "size": 1580,
@@ -316,7 +316,7 @@
316
316
  ],
317
317
  "removedExports": [],
318
318
  "dependents": [],
319
- "percent": 1.52,
319
+ "percent": 1.51,
320
320
  "reduction": 21.04
321
321
  },
322
322
  {
@@ -355,7 +355,7 @@
355
355
  "dependents": [
356
356
  "/src/adapters/fastify/index.ts"
357
357
  ],
358
- "percent": 1.44,
358
+ "percent": 1.43,
359
359
  "reduction": 34.7
360
360
  },
361
361
  {
@@ -369,10 +369,10 @@
369
369
  "removedExports": [],
370
370
  "dependents": [
371
371
  "/src/unstable-core-do-not-import.ts",
372
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
373
- "/src/unstable-core-do-not-import/error/getErrorShape.ts"
372
+ "/src/unstable-core-do-not-import/error/getErrorShape.ts",
373
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts"
374
374
  ],
375
- "percent": 1.22,
375
+ "percent": 1.21,
376
376
  "reduction": 23.5
377
377
  },
378
378
  {
@@ -390,17 +390,17 @@
390
390
  "removedExports": [],
391
391
  "dependents": [
392
392
  "/src/unstable-core-do-not-import.ts",
393
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
394
393
  "/src/unstable-core-do-not-import/error/TRPCError.ts",
395
394
  "/src/unstable-core-do-not-import/router.ts",
396
395
  "/src/unstable-core-do-not-import/transformer.ts",
397
396
  "/src/unstable-core-do-not-import/middleware.ts",
397
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts",
398
398
  "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
399
399
  "/src/unstable-core-do-not-import/http/contentType.ts",
400
400
  "/src/unstable-core-do-not-import/procedureBuilder.ts",
401
401
  "/src/unstable-core-do-not-import/stream/stream.ts"
402
402
  ],
403
- "percent": 1.11,
403
+ "percent": 1.1,
404
404
  "reduction": 27.13
405
405
  },
406
406
  {
@@ -415,7 +415,7 @@
415
415
  "/src/adapters/fastify/index.ts",
416
416
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
417
417
  ],
418
- "percent": 1.09,
418
+ "percent": 1.08,
419
419
  "reduction": 47.59
420
420
  },
421
421
  {
@@ -447,7 +447,7 @@
447
447
  "/src/adapters/next-app-dir/nextAppDirCaller.ts",
448
448
  "/src/adapters/next-app-dir/rethrowNextErrors.ts"
449
449
  ],
450
- "percent": 0.95,
450
+ "percent": 0.94,
451
451
  "reduction": 13.65
452
452
  },
453
453
  {
@@ -461,7 +461,7 @@
461
461
  "dependents": [
462
462
  "/src/adapters/next-app-dir/nextAppDirCaller.ts"
463
463
  ],
464
- "percent": 0.79,
464
+ "percent": 0.78,
465
465
  "reduction": 0.97
466
466
  },
467
467
  {
@@ -556,7 +556,7 @@
556
556
  "dependents": [
557
557
  "/src/unstable-core-do-not-import.ts"
558
558
  ],
559
- "percent": 0.27,
559
+ "percent": 0.26,
560
560
  "reduction": 68.45
561
561
  },
562
562
  {
@@ -633,9 +633,9 @@
633
633
  "reduction": 93.8
634
634
  },
635
635
  {
636
- "id": "/src/http.ts",
636
+ "id": "/src/index.ts",
637
637
  "size": 0,
638
- "origSize": 37,
638
+ "origSize": 32,
639
639
  "renderedExports": [],
640
640
  "removedExports": [],
641
641
  "dependents": [],
@@ -643,9 +643,9 @@
643
643
  "reduction": 100
644
644
  },
645
645
  {
646
- "id": "/src/index.ts",
646
+ "id": "/src/http.ts",
647
647
  "size": 0,
648
- "origSize": 32,
648
+ "origSize": 37,
649
649
  "renderedExports": [],
650
650
  "removedExports": [],
651
651
  "dependents": [],
@@ -653,9 +653,9 @@
653
653
  "reduction": 100
654
654
  },
655
655
  {
656
- "id": "/src/rpc.ts",
656
+ "id": "/src/shared.ts",
657
657
  "size": 0,
658
- "origSize": 36,
658
+ "origSize": 653,
659
659
  "renderedExports": [],
660
660
  "removedExports": [],
661
661
  "dependents": [],
@@ -663,9 +663,9 @@
663
663
  "reduction": 100
664
664
  },
665
665
  {
666
- "id": "/src/unstable-core-do-not-import.ts",
666
+ "id": "/src/rpc.ts",
667
667
  "size": 0,
668
- "origSize": 1969,
668
+ "origSize": 36,
669
669
  "renderedExports": [],
670
670
  "removedExports": [],
671
671
  "dependents": [],
@@ -673,9 +673,9 @@
673
673
  "reduction": 100
674
674
  },
675
675
  {
676
- "id": "/src/shared.ts",
676
+ "id": "/src/unstable-core-do-not-import.ts",
677
677
  "size": 0,
678
- "origSize": 653,
678
+ "origSize": 1969,
679
679
  "renderedExports": [],
680
680
  "removedExports": [],
681
681
  "dependents": [],
@@ -732,8 +732,8 @@
732
732
  "removedExports": [],
733
733
  "dependents": [
734
734
  "/src/adapters/express.ts",
735
- "/src/adapters/next.ts",
736
735
  "/src/adapters/standalone.ts",
736
+ "/src/adapters/next.ts",
737
737
  "/src/adapters/fastify/fastifyRequestHandler.ts"
738
738
  ],
739
739
  "percent": 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/server",
3
- "version": "11.0.0-alpha-tmp-rethrow-next-errors.384+c8f03d0d8",
3
+ "version": "11.0.0-alpha-tmp-rethrow-next-errors.386+a4f5d8541",
4
4
  "description": "The tRPC server library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -149,5 +149,5 @@
149
149
  "funding": [
150
150
  "https://trpc.io/sponsor"
151
151
  ],
152
- "gitHead": "c8f03d0d8fd891eccde7cf6d04dba5fa9db43329"
152
+ "gitHead": "a4f5d854168964a872610d94d4aa359789db760b"
153
153
  }
@@ -1,10 +1,11 @@
1
- import * as nextNavigation from 'next/navigation';
1
+ import * as nextNavigation from 'next/navigation.js';
2
2
  import type { TRPCError } from '../../@trpc/server';
3
3
  import { TRPCRedirectError } from './redirect';
4
4
 
5
5
  /**
6
6
  * @remarks The helpers from `next/dist/client/components/*` has been removed in Next.js 15.
7
7
  * Inlining them here instead...
8
+ * @see https://github.com/vercel/next.js/blob/5ae286ffd664e5c76841ed64f6e2da85a0835922/packages/next/src/client/components/redirect.ts#L97-L123
8
9
  */
9
10
  const REDIRECT_ERROR_CODE = 'NEXT_REDIRECT';
10
11
  function isRedirectError(error: unknown) {
@@ -26,6 +27,11 @@ function isRedirectError(error: unknown) {
26
27
  );
27
28
  }
28
29
 
30
+ /**
31
+ * @remarks The helpers from `next/dist/client/components/*` has been removed in Next.js 15.
32
+ * Inlining them here instead...
33
+ * @see https://github.com/vercel/next.js/blob/5ae286ffd664e5c76841ed64f6e2da85a0835922/packages/next/src/client/components/not-found.ts#L33-L39
34
+ */
29
35
  const NOT_FOUND_ERROR_CODE = 'NEXT_NOT_FOUND';
30
36
  function isNotFoundError(error: unknown) {
31
37
  if (typeof error !== 'object' || error === null || !('digest' in error)) {