@trpc/server 11.0.0-rc.589 → 11.0.0-rc.590

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.
Files changed (26) hide show
  1. package/dist/bundle-analysis.json +114 -111
  2. package/dist/unstable-core-do-not-import/http/resolveResponse.d.ts.map +1 -1
  3. package/dist/unstable-core-do-not-import/http/resolveResponse.js +30 -16
  4. package/dist/unstable-core-do-not-import/http/resolveResponse.mjs +31 -17
  5. package/dist/unstable-core-do-not-import/stream/sse.d.ts +1 -0
  6. package/dist/unstable-core-do-not-import/stream/sse.d.ts.map +1 -1
  7. package/dist/unstable-core-do-not-import/stream/sse.js +3 -2
  8. package/dist/unstable-core-do-not-import/stream/sse.mjs +3 -2
  9. package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.d.ts +2 -1
  10. package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.d.ts.map +1 -1
  11. package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.js +2 -2
  12. package/dist/unstable-core-do-not-import/stream/utils/asyncIterable.mjs +2 -2
  13. package/dist/unstable-core-do-not-import/stream/utils/promiseTimer.js +1 -1
  14. package/dist/unstable-core-do-not-import/stream/utils/promiseTimer.mjs +1 -1
  15. package/dist/unstable-core-do-not-import/utils.d.ts +13 -0
  16. package/dist/unstable-core-do-not-import/utils.d.ts.map +1 -1
  17. package/dist/unstable-core-do-not-import/utils.js +41 -0
  18. package/dist/unstable-core-do-not-import/utils.mjs +39 -1
  19. package/dist/unstable-core-do-not-import.js +3 -0
  20. package/dist/unstable-core-do-not-import.mjs +1 -1
  21. package/package.json +2 -2
  22. package/src/unstable-core-do-not-import/http/resolveResponse.ts +39 -21
  23. package/src/unstable-core-do-not-import/stream/sse.ts +14 -4
  24. package/src/unstable-core-do-not-import/stream/utils/asyncIterable.ts +3 -2
  25. package/src/unstable-core-do-not-import/stream/utils/promiseTimer.ts +1 -1
  26. package/src/unstable-core-do-not-import/utils.ts +48 -0
@@ -1,12 +1,12 @@
1
1
  {
2
- "bundleSize": 144960,
3
- "bundleOrigSize": 191903,
4
- "bundleReduction": 24.46,
2
+ "bundleSize": 147003,
3
+ "bundleOrigSize": 194022,
4
+ "bundleReduction": 24.23,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
8
- "size": 18439,
9
- "origSize": 17070,
8
+ "size": 19166,
9
+ "origSize": 17764,
10
10
  "renderedExports": [
11
11
  "resolveResponse"
12
12
  ],
@@ -14,7 +14,7 @@
14
14
  "dependents": [
15
15
  "/src/unstable-core-do-not-import.ts"
16
16
  ],
17
- "percent": 12.72,
17
+ "percent": 13.04,
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.12,
34
+ "percent": 11.95,
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.23,
50
+ "percent": 11.08,
51
51
  "reduction": 0
52
52
  },
53
53
  {
54
54
  "id": "/src/unstable-core-do-not-import/stream/sse.ts",
55
- "size": 9006,
56
- "origSize": 10511,
55
+ "size": 9093,
56
+ "origSize": 10673,
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.21,
68
- "reduction": 14.32
67
+ "percent": 6.19,
68
+ "reduction": 14.8
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.3,
82
+ "percent": 5.23,
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.43,
100
+ "percent": 4.37,
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,
115
+ "percent": 3.94,
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.74,
129
+ "percent": 3.69,
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": 3.09,
148
+ "percent": 3.05,
149
149
  "reduction": 0
150
150
  },
151
151
  {
@@ -160,7 +160,7 @@
160
160
  "dependents": [
161
161
  "/src/adapters/node-http/index.ts"
162
162
  ],
163
- "percent": 3.08,
163
+ "percent": 3.04,
164
164
  "reduction": 2.49
165
165
  },
166
166
  {
@@ -174,7 +174,7 @@
174
174
  "dependents": [
175
175
  "/src/adapters/next-app-dir.ts"
176
176
  ],
177
- "percent": 2.22,
177
+ "percent": 2.19,
178
178
  "reduction": 22.57
179
179
  },
180
180
  {
@@ -190,7 +190,7 @@
190
190
  "dependents": [
191
191
  "/src/observable/index.ts"
192
192
  ],
193
- "percent": 1.9,
193
+ "percent": 1.87,
194
194
  "reduction": 0
195
195
  },
196
196
  {
@@ -210,7 +210,7 @@
210
210
  "/src/unstable-core-do-not-import/router.ts",
211
211
  "/src/unstable-core-do-not-import/http/resolveResponse.ts"
212
212
  ],
213
- "percent": 1.89,
213
+ "percent": 1.87,
214
214
  "reduction": 45.94
215
215
  },
216
216
  {
@@ -224,7 +224,7 @@
224
224
  "dependents": [
225
225
  "/src/unstable-core-do-not-import.ts"
226
226
  ],
227
- "percent": 1.86,
227
+ "percent": 1.83,
228
228
  "reduction": 40.98
229
229
  },
230
230
  {
@@ -244,9 +244,47 @@
244
244
  "/src/unstable-core-do-not-import/initTRPC.ts",
245
245
  "/src/unstable-core-do-not-import/procedureBuilder.ts"
246
246
  ],
247
- "percent": 1.81,
247
+ "percent": 1.79,
248
248
  "reduction": 55.78
249
249
  },
250
+ {
251
+ "id": "/src/unstable-core-do-not-import/utils.ts",
252
+ "size": 2494,
253
+ "origSize": 3008,
254
+ "renderedExports": [
255
+ "unsetMarker",
256
+ "mergeWithoutOverrides",
257
+ "isObject",
258
+ "isFunction",
259
+ "omitPrototype",
260
+ "isAsyncIterable",
261
+ "run",
262
+ "noop",
263
+ "identity",
264
+ "assert",
265
+ "sleep",
266
+ "abortSignalsAnyPonyfill"
267
+ ],
268
+ "removedExports": [],
269
+ "dependents": [
270
+ "/src/unstable-core-do-not-import.ts",
271
+ "/src/unstable-core-do-not-import/error/TRPCError.ts",
272
+ "/src/unstable-core-do-not-import/transformer.ts",
273
+ "/src/unstable-core-do-not-import/middleware.ts",
274
+ "/src/unstable-core-do-not-import/router.ts",
275
+ "/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
276
+ "/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
277
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts",
278
+ "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
279
+ "/src/unstable-core-do-not-import/http/contentType.ts",
280
+ "/src/unstable-core-do-not-import/procedureBuilder.ts",
281
+ "/src/unstable-core-do-not-import/stream/jsonl.ts",
282
+ "/src/unstable-core-do-not-import/stream/sse.ts",
283
+ "/src/unstable-core-do-not-import/stream/utils/asyncIterable.ts"
284
+ ],
285
+ "percent": 1.7,
286
+ "reduction": 17.09
287
+ },
250
288
  {
251
289
  "id": "/src/unstable-core-do-not-import/createProxy.ts",
252
290
  "size": 2329,
@@ -260,7 +298,7 @@
260
298
  "/src/unstable-core-do-not-import.ts",
261
299
  "/src/unstable-core-do-not-import/router.ts"
262
300
  ],
263
- "percent": 1.61,
301
+ "percent": 1.58,
264
302
  "reduction": 0
265
303
  },
266
304
  {
@@ -274,7 +312,7 @@
274
312
  "dependents": [
275
313
  "/src/adapters/fetch/index.ts"
276
314
  ],
277
- "percent": 1.56,
315
+ "percent": 1.53,
278
316
  "reduction": 2.17
279
317
  },
280
318
  {
@@ -289,7 +327,7 @@
289
327
  "/src/adapters/node-http/index.ts",
290
328
  "/src/adapters/node-http/nodeHTTPRequestHandler.ts"
291
329
  ],
292
- "percent": 1.52,
330
+ "percent": 1.5,
293
331
  "reduction": 14.72
294
332
  },
295
333
  {
@@ -303,7 +341,7 @@
303
341
  "dependents": [
304
342
  "/src/adapters/next-app-dir/nextAppDirCaller.ts"
305
343
  ],
306
- "percent": 1.41,
344
+ "percent": 1.39,
307
345
  "reduction": 5.79
308
346
  },
309
347
  {
@@ -317,7 +355,7 @@
317
355
  "dependents": [
318
356
  "/src/adapters/fastify/index.ts"
319
357
  ],
320
- "percent": 1.23,
358
+ "percent": 1.21,
321
359
  "reduction": 29.88
322
360
  },
323
361
  {
@@ -342,7 +380,7 @@
342
380
  "/src/unstable-core-do-not-import/stream/jsonl.ts",
343
381
  "/src/unstable-core-do-not-import/stream/sse.ts"
344
382
  ],
345
- "percent": 1.2,
383
+ "percent": 1.18,
346
384
  "reduction": 19.47
347
385
  },
348
386
  {
@@ -354,9 +392,24 @@
354
392
  ],
355
393
  "removedExports": [],
356
394
  "dependents": [],
357
- "percent": 1.17,
395
+ "percent": 1.16,
358
396
  "reduction": 19.29
359
397
  },
398
+ {
399
+ "id": "/src/unstable-core-do-not-import/stream/utils/asyncIterable.ts",
400
+ "size": 1655,
401
+ "origSize": 1735,
402
+ "renderedExports": [
403
+ "withCancel",
404
+ "takeWithGrace"
405
+ ],
406
+ "removedExports": [],
407
+ "dependents": [
408
+ "/src/unstable-core-do-not-import/stream/sse.ts"
409
+ ],
410
+ "percent": 1.13,
411
+ "reduction": 4.61
412
+ },
360
413
  {
361
414
  "id": "/src/unstable-core-do-not-import/rpc/codes.ts",
362
415
  "size": 1611,
@@ -367,24 +420,9 @@
367
420
  ],
368
421
  "removedExports": [],
369
422
  "dependents": [],
370
- "percent": 1.11,
423
+ "percent": 1.1,
371
424
  "reduction": 27.47
372
425
  },
373
- {
374
- "id": "/src/unstable-core-do-not-import/stream/utils/asyncIterable.ts",
375
- "size": 1609,
376
- "origSize": 1671,
377
- "renderedExports": [
378
- "withCancel",
379
- "takeWithGrace"
380
- ],
381
- "removedExports": [],
382
- "dependents": [
383
- "/src/unstable-core-do-not-import/stream/sse.ts"
384
- ],
385
- "percent": 1.11,
386
- "reduction": 3.71
387
- },
388
426
  {
389
427
  "id": "/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
390
428
  "size": 1438,
@@ -399,7 +437,7 @@
399
437
  "/src/unstable-core-do-not-import/error/getErrorShape.ts",
400
438
  "/src/unstable-core-do-not-import/http/resolveResponse.ts"
401
439
  ],
402
- "percent": 0.99,
440
+ "percent": 0.98,
403
441
  "reduction": 16.73
404
442
  },
405
443
  {
@@ -411,43 +449,8 @@
411
449
  ],
412
450
  "removedExports": [],
413
451
  "dependents": [],
414
- "percent": 0.91,
415
- "reduction": 35.1
416
- },
417
- {
418
- "id": "/src/unstable-core-do-not-import/utils.ts",
419
- "size": 1311,
420
- "origSize": 1809,
421
- "renderedExports": [
422
- "unsetMarker",
423
- "mergeWithoutOverrides",
424
- "isObject",
425
- "isFunction",
426
- "omitPrototype",
427
- "isAsyncIterable",
428
- "run",
429
- "noop",
430
- "identity"
431
- ],
432
- "removedExports": [],
433
- "dependents": [
434
- "/src/unstable-core-do-not-import.ts",
435
- "/src/unstable-core-do-not-import/error/TRPCError.ts",
436
- "/src/unstable-core-do-not-import/transformer.ts",
437
- "/src/unstable-core-do-not-import/middleware.ts",
438
- "/src/unstable-core-do-not-import/router.ts",
439
- "/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
440
- "/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
441
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
442
- "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
443
- "/src/unstable-core-do-not-import/http/contentType.ts",
444
- "/src/unstable-core-do-not-import/procedureBuilder.ts",
445
- "/src/unstable-core-do-not-import/stream/jsonl.ts",
446
- "/src/unstable-core-do-not-import/stream/sse.ts",
447
- "/src/unstable-core-do-not-import/stream/utils/asyncIterable.ts"
448
- ],
449
452
  "percent": 0.9,
450
- "reduction": 27.53
453
+ "reduction": 35.1
451
454
  },
452
455
  {
453
456
  "id": "/src/unstable-core-do-not-import/parser.ts",
@@ -461,7 +464,7 @@
461
464
  "/src/unstable-core-do-not-import.ts",
462
465
  "/src/unstable-core-do-not-import/procedureBuilder.ts"
463
466
  ],
464
- "percent": 0.89,
467
+ "percent": 0.88,
465
468
  "reduction": 55.21
466
469
  },
467
470
  {
@@ -476,7 +479,7 @@
476
479
  "/src/adapters/fastify/index.ts",
477
480
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
478
481
  ],
479
- "percent": 0.78,
482
+ "percent": 0.77,
480
483
  "reduction": 47.59
481
484
  },
482
485
  {
@@ -492,7 +495,7 @@
492
495
  "/src/unstable-core-do-not-import.ts",
493
496
  "/src/unstable-core-do-not-import/http/contentType.ts"
494
497
  ],
495
- "percent": 0.76,
498
+ "percent": 0.75,
496
499
  "reduction": 15.08
497
500
  },
498
501
  {
@@ -506,7 +509,7 @@
506
509
  "dependents": [
507
510
  "/src/unstable-core-do-not-import.ts"
508
511
  ],
509
- "percent": 0.73,
512
+ "percent": 0.72,
510
513
  "reduction": 0
511
514
  },
512
515
  {
@@ -523,7 +526,7 @@
523
526
  "/src/adapters/next-app-dir/nextAppDirCaller.ts",
524
527
  "/src/adapters/next-app-dir/rethrowNextErrors.ts"
525
528
  ],
526
- "percent": 0.68,
529
+ "percent": 0.67,
527
530
  "reduction": 13.65
528
531
  },
529
532
  {
@@ -538,7 +541,7 @@
538
541
  "dependents": [
539
542
  "/src/unstable-core-do-not-import/stream/sse.ts"
540
543
  ],
541
- "percent": 0.63,
544
+ "percent": 0.62,
542
545
  "reduction": 10.89
543
546
  },
544
547
  {
@@ -550,7 +553,7 @@
550
553
  ],
551
554
  "removedExports": [],
552
555
  "dependents": [],
553
- "percent": 0.59,
556
+ "percent": 0.58,
554
557
  "reduction": 34.73
555
558
  },
556
559
  {
@@ -567,7 +570,7 @@
567
570
  "/src/unstable-core-do-not-import.ts",
568
571
  "/src/unstable-core-do-not-import/stream/sse.ts"
569
572
  ],
570
- "percent": 0.54,
573
+ "percent": 0.53,
571
574
  "reduction": 44.37
572
575
  },
573
576
  {
@@ -595,7 +598,7 @@
595
598
  "/src/unstable-core-do-not-import/stream/utils/asyncIterable.ts",
596
599
  "/src/unstable-core-do-not-import/stream/utils/withPing.ts"
597
600
  ],
598
- "percent": 0.52,
601
+ "percent": 0.51,
599
602
  "reduction": 10.56
600
603
  },
601
604
  {
@@ -624,7 +627,7 @@
624
627
  "/src/unstable-core-do-not-import/stream/jsonl.ts",
625
628
  "/src/unstable-core-do-not-import/stream/sse.ts"
626
629
  ],
627
- "percent": 0.49,
630
+ "percent": 0.48,
628
631
  "reduction": 21.32
629
632
  },
630
633
  {
@@ -638,7 +641,7 @@
638
641
  "dependents": [
639
642
  "/src/unstable-core-do-not-import.ts"
640
643
  ],
641
- "percent": 0.46,
644
+ "percent": 0.45,
642
645
  "reduction": 0.6
643
646
  },
644
647
  {
@@ -668,7 +671,7 @@
668
671
  "/src/unstable-core-do-not-import.ts",
669
672
  "/src/unstable-core-do-not-import/initTRPC.ts"
670
673
  ],
671
- "percent": 0.24,
674
+ "percent": 0.23,
672
675
  "reduction": 89.5
673
676
  },
674
677
  {
@@ -682,7 +685,7 @@
682
685
  "dependents": [
683
686
  "/src/unstable-core-do-not-import.ts"
684
687
  ],
685
- "percent": 0.24,
688
+ "percent": 0.23,
686
689
  "reduction": 9.02
687
690
  },
688
691
  {
@@ -813,11 +816,11 @@
813
816
  "removedExports": [],
814
817
  "dependents": [
815
818
  "/src/adapters/express.ts",
816
- "/src/adapters/ws.ts",
817
- "/src/adapters/standalone.ts",
818
819
  "/src/adapters/next.ts",
819
- "/src/adapters/node-http/nodeHTTPRequestHandler.ts",
820
- "/src/adapters/next-app-dir/nextAppDirCaller.ts"
820
+ "/src/adapters/standalone.ts",
821
+ "/src/adapters/ws.ts",
822
+ "/src/adapters/next-app-dir/nextAppDirCaller.ts",
823
+ "/src/adapters/node-http/nodeHTTPRequestHandler.ts"
821
824
  ],
822
825
  "percent": 0,
823
826
  "reduction": 100
@@ -855,27 +858,27 @@
855
858
  "reduction": 100
856
859
  },
857
860
  {
858
- "id": "/src/adapters/node-http/index.ts",
861
+ "id": "/src/adapters/fetch/index.ts",
859
862
  "size": 0,
860
- "origSize": 111,
863
+ "origSize": 64,
861
864
  "renderedExports": [],
862
865
  "removedExports": [],
863
- "dependents": [
864
- "/src/adapters/express.ts",
865
- "/src/adapters/standalone.ts",
866
- "/src/adapters/next.ts",
867
- "/src/adapters/fastify/fastifyRequestHandler.ts"
868
- ],
866
+ "dependents": [],
869
867
  "percent": 0,
870
868
  "reduction": 100
871
869
  },
872
870
  {
873
- "id": "/src/adapters/fetch/index.ts",
871
+ "id": "/src/adapters/node-http/index.ts",
874
872
  "size": 0,
875
- "origSize": 64,
873
+ "origSize": 111,
876
874
  "renderedExports": [],
877
875
  "removedExports": [],
878
- "dependents": [],
876
+ "dependents": [
877
+ "/src/adapters/express.ts",
878
+ "/src/adapters/next.ts",
879
+ "/src/adapters/standalone.ts",
880
+ "/src/adapters/fastify/fastifyRequestHandler.ts"
881
+ ],
879
882
  "percent": 0,
880
883
  "reduction": 100
881
884
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resolveResponse.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/resolveResponse.ts"],"names":[],"mappings":"AAMA,OAAO,EAA2B,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAExE,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,WAAW,CAAC;AAQnB,OAAO,KAAK,EACV,sBAAsB,EACtB,kCAAkC,EAEnC,MAAM,SAAS,CAAC;AA0BjB,UAAU,yBAAyB,CAAC,OAAO,SAAS,SAAS,CAC3D,SAAQ,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC;IAChD,aAAa,EAAE,kCAAkC,CAAC,OAAO,CAAC,CAAC;IAC3D,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;CACzB;AAyID,wBAAsB,eAAe,CAAC,OAAO,SAAS,SAAS,EAC7D,IAAI,EAAE,yBAAyB,CAAC,OAAO,CAAC,GACvC,OAAO,CAAC,QAAQ,CAAC,CAibnB"}
1
+ {"version":3,"file":"resolveResponse.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/resolveResponse.ts"],"names":[],"mappings":"AAMA,OAAO,EAA2B,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAExE,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,WAAW,CAAC;AAQnB,OAAO,KAAK,EACV,sBAAsB,EACtB,kCAAkC,EAEnC,MAAM,SAAS,CAAC;AA0BjB,UAAU,yBAAyB,CAAC,OAAO,SAAS,SAAS,CAC3D,SAAQ,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC;IAChD,aAAa,EAAE,kCAAkC,CAAC,OAAO,CAAC,CAAC;IAC3D,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;CACzB;AAyID,wBAAsB,eAAe,CAAC,OAAO,SAAS,SAAS,EAC7D,IAAI,EAAE,yBAAyB,CAAC,OAAO,CAAC,GACvC,OAAO,CAAC,QAAQ,CAAC,CAmcnB"}
@@ -187,21 +187,31 @@ async function resolveResponse(opts) {
187
187
  message: `Unsupported ${req.method}-request to ${proc._def.type} procedure at path "${call.path}"`
188
188
  });
189
189
  }
190
- /* istanbul ignore if -- @preserve */ if (proc._def.type === 'subscription' && info.isBatchCall) {
191
- throw new TRPCError.TRPCError({
192
- code: 'BAD_REQUEST',
193
- message: `Cannot batch subscription calls`
194
- });
190
+ let abortCtrl;
191
+ if (proc._def.type === 'subscription') {
192
+ /* istanbul ignore if -- @preserve */ if (info.isBatchCall) {
193
+ throw new TRPCError.TRPCError({
194
+ code: 'BAD_REQUEST',
195
+ message: `Cannot batch subscription calls`
196
+ });
197
+ }
198
+ abortCtrl = new AbortController();
195
199
  }
196
200
  const data = await proc({
197
201
  path: call.path,
198
202
  getRawInput: call.getRawInput,
199
203
  ctx,
200
204
  type: proc._def.type,
201
- signal: opts.req.signal
205
+ signal: abortCtrl ? utils.abortSignalsAnyPonyfill([
206
+ opts.req.signal,
207
+ abortCtrl.signal
208
+ ]) : opts.req.signal
202
209
  });
203
210
  return [
204
- data
211
+ {
212
+ data,
213
+ abortCtrl
214
+ }
205
215
  ];
206
216
  } catch (cause) {
207
217
  const error = TRPCError.getTRPCErrorFromUnknown(cause);
@@ -223,7 +233,7 @@ async function resolveResponse(opts) {
223
233
  // ----------- response handlers -----------
224
234
  if (!info.isBatchCall) {
225
235
  const [call] = info.calls;
226
- const [data, error] = await rpcCalls[0];
236
+ const [result, error] = await rpcCalls[0];
227
237
  switch(info.type){
228
238
  case 'unknown':
229
239
  case 'mutation':
@@ -231,7 +241,7 @@ async function resolveResponse(opts) {
231
241
  {
232
242
  // httpLink
233
243
  headers.set('content-type', 'application/json');
234
- if (isDataStream(data)) {
244
+ if (isDataStream(result?.data)) {
235
245
  throw new TRPCError.TRPCError({
236
246
  code: 'UNSUPPORTED_MEDIA_TYPE',
237
247
  message: 'Cannot use stream-like response in non-streaming request - use httpBatchStreamLink'
@@ -248,7 +258,7 @@ async function resolveResponse(opts) {
248
258
  })
249
259
  } : {
250
260
  result: {
251
- data
261
+ data: result.data
252
262
  }
253
263
  };
254
264
  const headResponse = initResponse({
@@ -280,6 +290,8 @@ async function resolveResponse(opts) {
280
290
  if (error) {
281
291
  throw error;
282
292
  }
293
+ const { data , abortCtrl } = result;
294
+ utils.assert(abortCtrl !== undefined, 'subscription type must have an AbortController');
283
295
  if (!observable.isObservable(data) && !utils.isAsyncIterable(data)) {
284
296
  throw new TRPCError.TRPCError({
285
297
  message: `Subscription ${call.path} did not return an observable or a AsyncGenerator`,
@@ -290,6 +302,7 @@ async function resolveResponse(opts) {
290
302
  const stream = sse.sseStreamProducer({
291
303
  ...config.experimental?.sseSubscriptions,
292
304
  data: dataAsIterable,
305
+ abortCtrl,
293
306
  serialize: (v)=>config.transformer.output.serialize(v),
294
307
  formatError (errorOpts) {
295
308
  const error = TRPCError.getTRPCErrorFromUnknown(errorOpts.error);
@@ -375,13 +388,14 @@ async function resolveResponse(opts) {
375
388
  })
376
389
  };
377
390
  }
391
+ const { data } = result;
378
392
  /**
379
393
  * Not very pretty, but we need to wrap nested data in promises
380
394
  * Our stream producer will only resolve top-level async values or async values that are directly nested in another async value
381
- */ const data = observable.isObservable(result) ? observable.observableToAsyncIterable(result) : Promise.resolve(result);
395
+ */ const dataAsPromiseOrIterable = observable.isObservable(data) ? observable.observableToAsyncIterable(data) : Promise.resolve(data);
382
396
  return {
383
397
  result: Promise.resolve({
384
- data
398
+ data: dataAsPromiseOrIterable
385
399
  })
386
400
  };
387
401
  }),
@@ -422,11 +436,11 @@ async function resolveResponse(opts) {
422
436
  * - return a complete HTTPResponse
423
437
  */ headers.set('content-type', 'application/json');
424
438
  const results = (await Promise.all(rpcCalls)).map((res)=>{
425
- const [data, error] = res;
439
+ const [result, error] = res;
426
440
  if (error) {
427
441
  return res;
428
442
  }
429
- if (isDataStream(data)) {
443
+ if (isDataStream(result.data)) {
430
444
  return [
431
445
  null,
432
446
  new TRPCError.TRPCError({
@@ -437,7 +451,7 @@ async function resolveResponse(opts) {
437
451
  }
438
452
  return res;
439
453
  });
440
- const resultAsRPCResponse = results.map(([data, error], index)=>{
454
+ const resultAsRPCResponse = results.map(([result, error], index)=>{
441
455
  const call = info.calls[index];
442
456
  if (error) {
443
457
  return {
@@ -453,7 +467,7 @@ async function resolveResponse(opts) {
453
467
  }
454
468
  return {
455
469
  result: {
456
- data
470
+ data: result.data
457
471
  }
458
472
  };
459
473
  });