@trpc/server 11.0.0-rc.487 → 11.0.0-rc.489

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": 135515,
3
- "bundleOrigSize": 184418,
4
- "bundleReduction": 26.52,
2
+ "bundleSize": 135619,
3
+ "bundleOrigSize": 184479,
4
+ "bundleReduction": 26.49,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
8
- "size": 17762,
9
- "origSize": 16670,
8
+ "size": 17866,
9
+ "origSize": 16731,
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": 13.11,
17
+ "percent": 13.17,
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.96,
34
+ "percent": 12.95,
35
35
  "reduction": 4.31
36
36
  },
37
37
  {
@@ -47,7 +47,7 @@
47
47
  "dependents": [
48
48
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
49
49
  ],
50
- "percent": 11.61,
50
+ "percent": 11.6,
51
51
  "reduction": 0
52
52
  },
53
53
  {
@@ -95,7 +95,7 @@
95
95
  "/src/unstable-core-do-not-import.ts",
96
96
  "/src/unstable-core-do-not-import/initTRPC.ts"
97
97
  ],
98
- "percent": 4.67,
98
+ "percent": 4.66,
99
99
  "reduction": 60.09
100
100
  },
101
101
  {
@@ -146,7 +146,7 @@
146
146
  "/src/unstable-core-do-not-import/http/resolveResponse.ts",
147
147
  "/src/observable/operators.ts"
148
148
  ],
149
- "percent": 3.04,
149
+ "percent": 3.03,
150
150
  "reduction": 0
151
151
  },
152
152
  {
@@ -206,9 +206,9 @@
206
206
  "removedExports": [],
207
207
  "dependents": [
208
208
  "/src/unstable-core-do-not-import.ts",
209
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
210
209
  "/src/unstable-core-do-not-import/initTRPC.ts",
211
- "/src/unstable-core-do-not-import/router.ts"
210
+ "/src/unstable-core-do-not-import/router.ts",
211
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts"
212
212
  ],
213
213
  "percent": 2.02,
214
214
  "reduction": 45.94
@@ -224,7 +224,7 @@
224
224
  "dependents": [
225
225
  "/src/unstable-core-do-not-import.ts"
226
226
  ],
227
- "percent": 2,
227
+ "percent": 1.99,
228
228
  "reduction": 40.91
229
229
  },
230
230
  {
@@ -332,10 +332,10 @@
332
332
  "removedExports": [],
333
333
  "dependents": [
334
334
  "/src/unstable-core-do-not-import.ts",
335
- "/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
336
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
337
335
  "/src/unstable-core-do-not-import/middleware.ts",
338
336
  "/src/unstable-core-do-not-import/router.ts",
337
+ "/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
338
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts",
339
339
  "/src/unstable-core-do-not-import/http/contentType.ts",
340
340
  "/src/unstable-core-do-not-import/procedureBuilder.ts",
341
341
  "/src/unstable-core-do-not-import/stream/jsonl.ts",
@@ -392,8 +392,8 @@
392
392
  "removedExports": [],
393
393
  "dependents": [
394
394
  "/src/unstable-core-do-not-import.ts",
395
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
396
- "/src/unstable-core-do-not-import/error/getErrorShape.ts"
395
+ "/src/unstable-core-do-not-import/error/getErrorShape.ts",
396
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts"
397
397
  ],
398
398
  "percent": 1.01,
399
399
  "reduction": 17.52
@@ -414,13 +414,13 @@
414
414
  "removedExports": [],
415
415
  "dependents": [
416
416
  "/src/unstable-core-do-not-import.ts",
417
- "/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
418
- "/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
419
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
420
417
  "/src/unstable-core-do-not-import/error/TRPCError.ts",
421
418
  "/src/unstable-core-do-not-import/transformer.ts",
422
419
  "/src/unstable-core-do-not-import/middleware.ts",
423
420
  "/src/unstable-core-do-not-import/router.ts",
421
+ "/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
422
+ "/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
423
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts",
424
424
  "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
425
425
  "/src/unstable-core-do-not-import/http/contentType.ts",
426
426
  "/src/unstable-core-do-not-import/procedureBuilder.ts",
@@ -442,7 +442,7 @@
442
442
  "/src/adapters/fastify/index.ts",
443
443
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
444
444
  ],
445
- "percent": 0.84,
445
+ "percent": 0.83,
446
446
  "reduction": 47.59
447
447
  },
448
448
  {
@@ -522,7 +522,7 @@
522
522
  "/src/unstable-core-do-not-import/stream/sse.ts",
523
523
  "/src/unstable-core-do-not-import/stream/utils/createReadableStream.ts"
524
524
  ],
525
- "percent": 0.73,
525
+ "percent": 0.72,
526
526
  "reduction": 15.69
527
527
  },
528
528
  {
@@ -723,9 +723,19 @@
723
723
  "/src/unstable-core-do-not-import/initTRPC.ts",
724
724
  "/src/unstable-core-do-not-import/router.ts"
725
725
  ],
726
- "percent": 0.05,
726
+ "percent": 0.04,
727
727
  "reduction": 93.8
728
728
  },
729
+ {
730
+ "id": "/src/index.ts",
731
+ "size": 0,
732
+ "origSize": 32,
733
+ "renderedExports": [],
734
+ "removedExports": [],
735
+ "dependents": [],
736
+ "percent": 0,
737
+ "reduction": 100
738
+ },
729
739
  {
730
740
  "id": "/src/http.ts",
731
741
  "size": 0,
@@ -739,9 +749,9 @@
739
749
  "reduction": 100
740
750
  },
741
751
  {
742
- "id": "/src/index.ts",
752
+ "id": "/src/rpc.ts",
743
753
  "size": 0,
744
- "origSize": 32,
754
+ "origSize": 36,
745
755
  "renderedExports": [],
746
756
  "removedExports": [],
747
757
  "dependents": [],
@@ -749,9 +759,9 @@
749
759
  "reduction": 100
750
760
  },
751
761
  {
752
- "id": "/src/rpc.ts",
762
+ "id": "/src/shared.ts",
753
763
  "size": 0,
754
- "origSize": 36,
764
+ "origSize": 653,
755
765
  "renderedExports": [],
756
766
  "removedExports": [],
757
767
  "dependents": [],
@@ -771,16 +781,6 @@
771
781
  "percent": 0,
772
782
  "reduction": 100
773
783
  },
774
- {
775
- "id": "/src/shared.ts",
776
- "size": 0,
777
- "origSize": 653,
778
- "renderedExports": [],
779
- "removedExports": [],
780
- "dependents": [],
781
- "percent": 0,
782
- "reduction": 100
783
- },
784
784
  {
785
785
  "id": "/src/adapters/next-app-dir.ts",
786
786
  "size": 0,
@@ -831,8 +831,8 @@
831
831
  "removedExports": [],
832
832
  "dependents": [
833
833
  "/src/adapters/express.ts",
834
- "/src/adapters/standalone.ts",
835
834
  "/src/adapters/next.ts",
835
+ "/src/adapters/standalone.ts",
836
836
  "/src/adapters/fastify/fastifyRequestHandler.ts"
837
837
  ],
838
838
  "percent": 0,
@@ -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,CA6ZnB"}
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,CAianB"}
@@ -276,6 +276,9 @@ async function resolveResponse(opts) {
276
276
  message: 'Missing experimental flag "sseSubscriptions"'
277
277
  });
278
278
  }
279
+ if (error) {
280
+ throw error;
281
+ }
279
282
  if (!observable.isObservable(data) && !utils.isAsyncIterable(data)) {
280
283
  throw new TRPCError.TRPCError({
281
284
  message: `Subscription ${call.path} did not return an observable or a AsyncGenerator`,
@@ -274,6 +274,9 @@ async function resolveResponse(opts) {
274
274
  message: 'Missing experimental flag "sseSubscriptions"'
275
275
  });
276
276
  }
277
+ if (error) {
278
+ throw error;
279
+ }
277
280
  if (!isObservable(data) && !isAsyncIterable(data)) {
278
281
  throw new TRPCError({
279
282
  message: `Subscription ${call.path} did not return an observable or a AsyncGenerator`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/server",
3
- "version": "11.0.0-rc.487+3cf8f49f5",
3
+ "version": "11.0.0-rc.489+6b483e375",
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": "3cf8f49f5b2ca262d7a13ad780f3e76956922cbb"
152
+ "gitHead": "6b483e3752e666c3fb200f0234c1c8d10c89620e"
153
153
  }
@@ -368,6 +368,10 @@ export async function resolveResponse<TRouter extends AnyRouter>(
368
368
  });
369
369
  }
370
370
 
371
+ if (error) {
372
+ throw error;
373
+ }
374
+
371
375
  if (!isObservable(data) && !isAsyncIterable(data)) {
372
376
  throw new TRPCError({
373
377
  message: `Subscription ${