@trpc/server 11.0.0-rc.563 → 11.0.0-rc.565

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": 139519,
3
- "bundleOrigSize": 186356,
4
- "bundleReduction": 25.13,
2
+ "bundleSize": 139879,
3
+ "bundleOrigSize": 186645,
4
+ "bundleReduction": 25.06,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
@@ -14,7 +14,7 @@
14
14
  "dependents": [
15
15
  "/src/unstable-core-do-not-import.ts"
16
16
  ],
17
- "percent": 13.22,
17
+ "percent": 13.18,
18
18
  "reduction": 0
19
19
  },
20
20
  {
@@ -31,7 +31,7 @@
31
31
  "/src/unstable-core-do-not-import.ts",
32
32
  "/src/unstable-core-do-not-import/http/resolveResponse.ts"
33
33
  ],
34
- "percent": 12.59,
34
+ "percent": 12.56,
35
35
  "reduction": 4.86
36
36
  },
37
37
  {
@@ -47,13 +47,13 @@
47
47
  "dependents": [
48
48
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
49
49
  ],
50
- "percent": 11.67,
50
+ "percent": 11.64,
51
51
  "reduction": 0
52
52
  },
53
53
  {
54
54
  "id": "/src/unstable-core-do-not-import/stream/sse.ts",
55
- "size": 9020,
56
- "origSize": 10407,
55
+ "size": 9380,
56
+ "origSize": 10696,
57
57
  "renderedExports": [
58
58
  "sseStreamProducer",
59
59
  "sseStreamConsumer",
@@ -64,8 +64,8 @@
64
64
  "/src/unstable-core-do-not-import.ts",
65
65
  "/src/unstable-core-do-not-import/http/resolveResponse.ts"
66
66
  ],
67
- "percent": 6.47,
68
- "reduction": 13.33
67
+ "percent": 6.71,
68
+ "reduction": 12.3
69
69
  },
70
70
  {
71
71
  "id": "/src/unstable-core-do-not-import/http/contentType.ts",
@@ -79,7 +79,7 @@
79
79
  "/src/unstable-core-do-not-import.ts",
80
80
  "/src/unstable-core-do-not-import/http/resolveResponse.ts"
81
81
  ],
82
- "percent": 5.51,
82
+ "percent": 5.5,
83
83
  "reduction": 0
84
84
  },
85
85
  {
@@ -97,7 +97,7 @@
97
97
  "/src/unstable-core-do-not-import.ts",
98
98
  "/src/unstable-core-do-not-import/initTRPC.ts"
99
99
  ],
100
- "percent": 4.6,
100
+ "percent": 4.59,
101
101
  "reduction": 40.09
102
102
  },
103
103
  {
@@ -112,7 +112,7 @@
112
112
  "/src/unstable-core-do-not-import.ts",
113
113
  "/src/unstable-core-do-not-import/initTRPC.ts"
114
114
  ],
115
- "percent": 4.15,
115
+ "percent": 4.14,
116
116
  "reduction": 64.74
117
117
  },
118
118
  {
@@ -126,7 +126,7 @@
126
126
  "dependents": [
127
127
  "/src/adapters/aws-lambda/index.ts"
128
128
  ],
129
- "percent": 3.88,
129
+ "percent": 3.87,
130
130
  "reduction": 11.38
131
131
  },
132
132
  {
@@ -145,7 +145,7 @@
145
145
  "/src/unstable-core-do-not-import/http/resolveResponse.ts",
146
146
  "/src/observable/operators.ts"
147
147
  ],
148
- "percent": 2.96,
148
+ "percent": 2.95,
149
149
  "reduction": 0
150
150
  },
151
151
  {
@@ -159,7 +159,7 @@
159
159
  "dependents": [
160
160
  "/src/adapters/next-app-dir.ts"
161
161
  ],
162
- "percent": 2.31,
162
+ "percent": 2.3,
163
163
  "reduction": 22.57
164
164
  },
165
165
  {
@@ -189,7 +189,7 @@
189
189
  "dependents": [
190
190
  "/src/observable/index.ts"
191
191
  ],
192
- "percent": 1.98,
192
+ "percent": 1.97,
193
193
  "reduction": 0
194
194
  },
195
195
  {
@@ -209,7 +209,7 @@
209
209
  "/src/unstable-core-do-not-import/initTRPC.ts",
210
210
  "/src/unstable-core-do-not-import/router.ts"
211
211
  ],
212
- "percent": 1.97,
212
+ "percent": 1.96,
213
213
  "reduction": 45.94
214
214
  },
215
215
  {
@@ -273,7 +273,7 @@
273
273
  "dependents": [
274
274
  "/src/adapters/fetch/index.ts"
275
275
  ],
276
- "percent": 1.62,
276
+ "percent": 1.61,
277
277
  "reduction": 2.17
278
278
  },
279
279
  {
@@ -316,7 +316,7 @@
316
316
  "dependents": [
317
317
  "/src/adapters/fastify/index.ts"
318
318
  ],
319
- "percent": 1.28,
319
+ "percent": 1.27,
320
320
  "reduction": 29.88
321
321
  },
322
322
  {
@@ -352,7 +352,7 @@
352
352
  ],
353
353
  "removedExports": [],
354
354
  "dependents": [],
355
- "percent": 1.22,
355
+ "percent": 1.21,
356
356
  "reduction": 19.29
357
357
  },
358
358
  {
@@ -377,7 +377,7 @@
377
377
  ],
378
378
  "removedExports": [],
379
379
  "dependents": [],
380
- "percent": 1.11,
380
+ "percent": 1.1,
381
381
  "reduction": 26.94
382
382
  },
383
383
  {
@@ -566,7 +566,7 @@
566
566
  "/src/unstable-core-do-not-import/stream/jsonl.ts",
567
567
  "/src/unstable-core-do-not-import/stream/sse.ts"
568
568
  ],
569
- "percent": 0.51,
569
+ "percent": 0.5,
570
570
  "reduction": 21.32
571
571
  },
572
572
  {
@@ -744,25 +744,25 @@
744
744
  "reduction": 100
745
745
  },
746
746
  {
747
- "id": "/src/shared.ts",
747
+ "id": "/src/unstable-core-do-not-import.ts",
748
748
  "size": 0,
749
- "origSize": 653,
749
+ "origSize": 2306,
750
750
  "renderedExports": [],
751
751
  "removedExports": [],
752
- "dependents": [],
752
+ "dependents": [
753
+ "/src/adapters/ws.ts",
754
+ "/src/adapters/next-app-dir/nextAppDirCaller.ts"
755
+ ],
753
756
  "percent": 0,
754
757
  "reduction": 100
755
758
  },
756
759
  {
757
- "id": "/src/unstable-core-do-not-import.ts",
760
+ "id": "/src/shared.ts",
758
761
  "size": 0,
759
- "origSize": 2306,
762
+ "origSize": 653,
760
763
  "renderedExports": [],
761
764
  "removedExports": [],
762
- "dependents": [
763
- "/src/adapters/ws.ts",
764
- "/src/adapters/next-app-dir/nextAppDirCaller.ts"
765
- ],
765
+ "dependents": [],
766
766
  "percent": 0,
767
767
  "reduction": 100
768
768
  },
@@ -789,9 +789,9 @@
789
789
  "reduction": 100
790
790
  },
791
791
  {
792
- "id": "/src/adapters/fastify/index.ts",
792
+ "id": "/src/adapters/fetch/index.ts",
793
793
  "size": 0,
794
- "origSize": 78,
794
+ "origSize": 64,
795
795
  "renderedExports": [],
796
796
  "removedExports": [],
797
797
  "dependents": [],
@@ -799,9 +799,9 @@
799
799
  "reduction": 100
800
800
  },
801
801
  {
802
- "id": "/src/adapters/fetch/index.ts",
802
+ "id": "/src/adapters/fastify/index.ts",
803
803
  "size": 0,
804
- "origSize": 64,
804
+ "origSize": 78,
805
805
  "renderedExports": [],
806
806
  "removedExports": [],
807
807
  "dependents": [],
@@ -1 +1 @@
1
- {"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/stream/sse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAKpD,KAAK,SAAS,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;AACrC,KAAK,WAAW,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE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AAwB;IAClE,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,UAAU,0BAA2B,SAAQ,wBAAwB;IACnE,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,UAAU,8BAA+B,SAAQ,wBAAwB;IACvE,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,KAAK,oBAAoB,CAAC,KAAK,IAC3B,wBAAwB,CAAC,KAAK,CAAC,GAC/B,yBAAyB,GACzB,0BAA0B,GAC1B,8BAA8B,CAAC;AAEnC,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,YAAY,CAAC,eAAe,CAAC,GAAG,SAAS,CAAC;IACtD,MAAM,EAAE,WAAW,CAAC;IACpB,qBAAqB,CAAC,EAAE,CACtB,IAAI,EACA;QACE,IAAI,EAAE,OAAO,CAAC;QACd,KAAK,EAAE,KAAK,CAAC;KACd,GACD;QACE,IAAI,EAAE,kBAAkB,CAAC;QACzB,KAAK,EAAE,OAAO,CAAC;KAChB,KACF,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AACD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EACrC,IAAI,EAAE,wBAAwB,GAC7B,aAAa,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAkL5C;AAED,eAAO,MAAM,UAAU;;;;;CAKb,CAAC"}
@@ -28,12 +28,21 @@ const SERIALIZED_ERROR_EVENT = 'serialized-error';
28
28
  while(true){
29
29
  const pingPromise = createDeferred.createTimeoutPromise(ping.enabled ? ping.intervalMs : Infinity, 'ping');
30
30
  const next = await Promise.race([
31
- nextPromise.catch(TRPCError.getTRPCErrorFromUnknown),
31
+ nextPromise.catch((err)=>{
32
+ if (err instanceof Error && err.name === 'AbortError') {
33
+ // Ensures that aborting the request doesn't throw an error
34
+ return 'aborted';
35
+ }
36
+ return TRPCError.getTRPCErrorFromUnknown(err);
37
+ }),
32
38
  pingPromise.promise,
33
39
  closedPromise,
34
40
  maxDurationPromise.promise
35
41
  ]);
36
42
  pingPromise.clear();
43
+ if (next === 'aborted') {
44
+ break;
45
+ }
37
46
  if (next === 'closed') {
38
47
  break;
39
48
  }
@@ -26,12 +26,21 @@ const SERIALIZED_ERROR_EVENT = 'serialized-error';
26
26
  while(true){
27
27
  const pingPromise = createTimeoutPromise(ping.enabled ? ping.intervalMs : Infinity, 'ping');
28
28
  const next = await Promise.race([
29
- nextPromise.catch(getTRPCErrorFromUnknown),
29
+ nextPromise.catch((err)=>{
30
+ if (err instanceof Error && err.name === 'AbortError') {
31
+ // Ensures that aborting the request doesn't throw an error
32
+ return 'aborted';
33
+ }
34
+ return getTRPCErrorFromUnknown(err);
35
+ }),
30
36
  pingPromise.promise,
31
37
  closedPromise,
32
38
  maxDurationPromise.promise
33
39
  ]);
34
40
  pingPromise.clear();
41
+ if (next === 'aborted') {
42
+ break;
43
+ }
35
44
  if (next === 'closed') {
36
45
  break;
37
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/server",
3
- "version": "11.0.0-rc.563+e5ae464b2",
3
+ "version": "11.0.0-rc.565+25f21aad2",
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": "e5ae464b2428b591d816ee4e01725c86b232d620"
152
+ "gitHead": "25f21aad23b0a49439048604eb7cddb92cdc84d8"
153
153
  }
@@ -87,13 +87,22 @@ export function sseStreamProducer(opts: SSEStreamProducerOptions) {
87
87
  'ping' as const,
88
88
  );
89
89
  const next = await Promise.race([
90
- nextPromise.catch(getTRPCErrorFromUnknown),
90
+ nextPromise.catch((err) => {
91
+ if (err instanceof Error && err.name === 'AbortError') {
92
+ // Ensures that aborting the request doesn't throw an error
93
+ return 'aborted' as const;
94
+ }
95
+ return getTRPCErrorFromUnknown(err);
96
+ }),
91
97
  pingPromise.promise,
92
98
  closedPromise,
93
99
  maxDurationPromise.promise,
94
100
  ]);
95
101
 
96
102
  pingPromise.clear();
103
+ if (next === 'aborted') {
104
+ break;
105
+ }
97
106
  if (next === 'closed') {
98
107
  break;
99
108
  }