@trpc/server 11.0.0-rc.791 → 11.0.0-rc.795

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": 199018,
3
- "bundleOrigSize": 230679,
4
- "bundleReduction": 13.73,
2
+ "bundleSize": 198990,
3
+ "bundleOrigSize": 230642,
4
+ "bundleReduction": 13.72,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
@@ -30,7 +30,7 @@
30
30
  "dependents": [
31
31
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
32
32
  ],
33
- "percent": 10.12,
33
+ "percent": 10.13,
34
34
  "reduction": 0
35
35
  },
36
36
  {
@@ -291,9 +291,9 @@
291
291
  "removedExports": [],
292
292
  "dependents": [
293
293
  "/src/unstable-core-do-not-import.ts",
294
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
295
294
  "/src/unstable-core-do-not-import/router.ts",
296
- "/src/unstable-core-do-not-import/initTRPC.ts"
295
+ "/src/unstable-core-do-not-import/initTRPC.ts",
296
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts"
297
297
  ],
298
298
  "percent": 1.38,
299
299
  "reduction": 45.98
@@ -353,14 +353,14 @@
353
353
  "removedExports": [],
354
354
  "dependents": [
355
355
  "/src/unstable-core-do-not-import.ts",
356
- "/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
357
- "/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
358
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
359
356
  "/src/unstable-core-do-not-import/error/TRPCError.ts",
360
357
  "/src/unstable-core-do-not-import/router.ts",
361
358
  "/src/unstable-core-do-not-import/transformer.ts",
362
359
  "/src/unstable-core-do-not-import/middleware.ts",
363
360
  "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
361
+ "/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
362
+ "/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
363
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts",
364
364
  "/src/unstable-core-do-not-import/http/contentType.ts",
365
365
  "/src/unstable-core-do-not-import/http/abortError.ts",
366
366
  "/src/unstable-core-do-not-import/procedureBuilder.ts",
@@ -382,10 +382,10 @@
382
382
  "removedExports": [],
383
383
  "dependents": [
384
384
  "/src/unstable-core-do-not-import.ts",
385
- "/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
386
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
387
385
  "/src/unstable-core-do-not-import/router.ts",
388
386
  "/src/unstable-core-do-not-import/middleware.ts",
387
+ "/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
388
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts",
389
389
  "/src/unstable-core-do-not-import/http/contentType.ts",
390
390
  "/src/unstable-core-do-not-import/procedureBuilder.ts",
391
391
  "/src/unstable-core-do-not-import/stream/sse.ts"
@@ -395,8 +395,8 @@
395
395
  },
396
396
  {
397
397
  "id": "/src/unstable-core-do-not-import/createProxy.ts",
398
- "size": 2333,
399
- "origSize": 2262,
398
+ "size": 2305,
399
+ "origSize": 2225,
400
400
  "renderedExports": [
401
401
  "createRecursiveProxy",
402
402
  "createFlatProxy"
@@ -406,7 +406,7 @@
406
406
  "/src/unstable-core-do-not-import.ts",
407
407
  "/src/unstable-core-do-not-import/router.ts"
408
408
  ],
409
- "percent": 1.17,
409
+ "percent": 1.16,
410
410
  "reduction": 0
411
411
  },
412
412
  {
@@ -452,8 +452,8 @@
452
452
  "removedExports": [],
453
453
  "dependents": [
454
454
  "/src/unstable-core-do-not-import.ts",
455
- "/src/unstable-core-do-not-import/http/resolveResponse.ts",
456
- "/src/unstable-core-do-not-import/error/getErrorShape.ts"
455
+ "/src/unstable-core-do-not-import/error/getErrorShape.ts",
456
+ "/src/unstable-core-do-not-import/http/resolveResponse.ts"
457
457
  ],
458
458
  "percent": 1.05,
459
459
  "reduction": 18.54
@@ -860,21 +860,19 @@
860
860
  "reduction": 93.9
861
861
  },
862
862
  {
863
- "id": "/src/http.ts",
863
+ "id": "/src/index.ts",
864
864
  "size": 0,
865
- "origSize": 37,
865
+ "origSize": 32,
866
866
  "renderedExports": [],
867
867
  "removedExports": [],
868
- "dependents": [
869
- "/src/adapters/ws.ts"
870
- ],
868
+ "dependents": [],
871
869
  "percent": 0,
872
870
  "reduction": 100
873
871
  },
874
872
  {
875
- "id": "/src/index.ts",
873
+ "id": "/src/rpc.ts",
876
874
  "size": 0,
877
- "origSize": 32,
875
+ "origSize": 36,
878
876
  "renderedExports": [],
879
877
  "removedExports": [],
880
878
  "dependents": [],
@@ -882,19 +880,21 @@
882
880
  "reduction": 100
883
881
  },
884
882
  {
885
- "id": "/src/shared.ts",
883
+ "id": "/src/http.ts",
886
884
  "size": 0,
887
- "origSize": 653,
885
+ "origSize": 37,
888
886
  "renderedExports": [],
889
887
  "removedExports": [],
890
- "dependents": [],
888
+ "dependents": [
889
+ "/src/adapters/ws.ts"
890
+ ],
891
891
  "percent": 0,
892
892
  "reduction": 100
893
893
  },
894
894
  {
895
- "id": "/src/rpc.ts",
895
+ "id": "/src/shared.ts",
896
896
  "size": 0,
897
- "origSize": 36,
897
+ "origSize": 653,
898
898
  "renderedExports": [],
899
899
  "removedExports": [],
900
900
  "dependents": [],
@@ -910,8 +910,8 @@
910
910
  "dependents": [
911
911
  "/src/adapters/express.ts",
912
912
  "/src/adapters/next.ts",
913
- "/src/adapters/ws.ts",
914
913
  "/src/adapters/standalone.ts",
914
+ "/src/adapters/ws.ts",
915
915
  "/src/adapters/node-http/nodeHTTPRequestHandler.ts",
916
916
  "/src/adapters/next-app-dir/nextAppDirCaller.ts",
917
917
  "/src/adapters/node-http/writeResponse.ts"
@@ -942,9 +942,9 @@
942
942
  "reduction": 100
943
943
  },
944
944
  {
945
- "id": "/src/adapters/fetch/index.ts",
945
+ "id": "/src/adapters/fastify/index.ts",
946
946
  "size": 0,
947
- "origSize": 64,
947
+ "origSize": 78,
948
948
  "renderedExports": [],
949
949
  "removedExports": [],
950
950
  "dependents": [],
@@ -952,9 +952,9 @@
952
952
  "reduction": 100
953
953
  },
954
954
  {
955
- "id": "/src/adapters/fastify/index.ts",
955
+ "id": "/src/adapters/fetch/index.ts",
956
956
  "size": 0,
957
- "origSize": 78,
957
+ "origSize": 64,
958
958
  "renderedExports": [],
959
959
  "removedExports": [],
960
960
  "dependents": [],
@@ -970,8 +970,8 @@
970
970
  "dependents": [
971
971
  "/src/adapters/express.ts",
972
972
  "/src/adapters/next.ts",
973
- "/src/adapters/ws.ts",
974
973
  "/src/adapters/standalone.ts",
974
+ "/src/adapters/ws.ts",
975
975
  "/src/adapters/fastify/fastifyRequestHandler.ts"
976
976
  ],
977
977
  "percent": 0,
@@ -24,9 +24,13 @@ type RootConfigLike = {
24
24
  * Anything that can be inferred to the root config types needed for a TRPC client
25
25
  */
26
26
  export type InferrableClientTypes = RouterLike | InitLike | RootConfigLike | AnyClientTypes;
27
+ type PickTypes<T extends AnyClientTypes> = {
28
+ transformer: T['transformer'];
29
+ errorShape: T['errorShape'];
30
+ };
27
31
  /**
28
32
  * Infer the root types from a InferrableClientTypes
29
33
  */
30
- export type inferClientTypes<TInferrable extends InferrableClientTypes> = TInferrable extends AnyClientTypes ? TInferrable : TInferrable extends RootConfigLike ? TInferrable['$types'] : TInferrable extends InitLike ? TInferrable['_config']['$types'] : TInferrable extends RouterLike ? TInferrable['_def']['_config']['$types'] : never;
34
+ export type inferClientTypes<TInferrable extends InferrableClientTypes> = TInferrable extends AnyClientTypes ? PickTypes<TInferrable> : TInferrable extends RootConfigLike ? PickTypes<TInferrable['$types']> : TInferrable extends InitLike ? PickTypes<TInferrable['_config']['$types']> : TInferrable extends RouterLike ? PickTypes<TInferrable['_def']['_config']['$types']> : never;
31
35
  export {};
32
36
  //# sourceMappingURL=inferrable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inferrable.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/clientish/inferrable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,YAAY,EAAE,YAAY,GAAG,aAAa,CAAC,CAAC;AAE9E;;GAEG;AACH,KAAK,QAAQ,GAAG;IACd,OAAO,EAAE;QACP,MAAM,EAAE,cAAc,CAAC;KACxB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC7B,UAAU,GACV,QAAQ,GACR,cAAc,GACd,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,WAAW,SAAS,qBAAqB,IACpE,WAAW,SAAS,cAAc,GAC9B,WAAW,GACX,WAAW,SAAS,cAAc,GAChC,WAAW,CAAC,QAAQ,CAAC,GACrB,WAAW,SAAS,QAAQ,GAC1B,WAAW,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,GAChC,WAAW,SAAS,UAAU,GAC5B,WAAW,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,GACxC,KAAK,CAAC"}
1
+ {"version":3,"file":"inferrable.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/clientish/inferrable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,YAAY,EAAE,YAAY,GAAG,aAAa,CAAC,CAAC;AAE9E;;GAEG;AACH,KAAK,QAAQ,GAAG;IACd,OAAO,EAAE;QACP,MAAM,EAAE,cAAc,CAAC;KACxB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC7B,UAAU,GACV,QAAQ,GACR,cAAc,GACd,cAAc,CAAC;AAEnB,KAAK,SAAS,CAAC,CAAC,SAAS,cAAc,IAAI;IACzC,WAAW,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC;IAC9B,UAAU,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC;CAC7B,CAAC;AACF;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,WAAW,SAAS,qBAAqB,IACpE,WAAW,SAAS,cAAc,GAC9B,SAAS,CAAC,WAAW,CAAC,GACtB,WAAW,SAAS,cAAc,GAChC,SAAS,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,GAChC,WAAW,SAAS,QAAQ,GAC1B,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,GAC3C,WAAW,SAAS,UAAU,GAC5B,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,GACnD,KAAK,CAAC"}
@@ -14,6 +14,6 @@ export declare const createRecursiveProxy: <TFaux = unknown>(callback: ProxyCall
14
14
  *
15
15
  * @internal
16
16
  */
17
- export declare const createFlatProxy: <TFaux>(callback: (path: string & keyof TFaux) => any) => TFaux;
17
+ export declare const createFlatProxy: <TFaux>(callback: (path: keyof TFaux) => any) => TFaux;
18
18
  export {};
19
19
  //# sourceMappingURL=createProxy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createProxy.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/createProxy.ts"],"names":[],"mappings":"AAAA,UAAU,oBAAoB;IAC5B,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;CAC1B;AACD,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,oBAAoB,KAAK,OAAO,CAAC;AAqD7D;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,sBAC9B,aAAa,KACtB,KAAqE,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,YACzB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,KAAK,KAAK,GAAG,KAC5C,KAWF,CAAC"}
1
+ {"version":3,"file":"createProxy.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/createProxy.ts"],"names":[],"mappings":"AAAA,UAAU,oBAAoB;IAC5B,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;CAC1B;AACD,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,oBAAoB,KAAK,OAAO,CAAC;AAqD7D;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,sBAC9B,aAAa,KACtB,KAAqE,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,YACzB,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,GAAG,KACnC,KAWF,CAAC"}
@@ -62,7 +62,7 @@ function createInnerProxy(callback, path, memo) {
62
62
  */ const createFlatProxy = (callback)=>{
63
63
  return new Proxy(noop, {
64
64
  get (_obj, name) {
65
- if (typeof name !== 'string' || name === 'then') {
65
+ if (name === 'then') {
66
66
  // special case for if the proxy is accidentally treated
67
67
  // like a PromiseLike (like in `Promise.resolve(proxy)`)
68
68
  return undefined;
@@ -60,7 +60,7 @@ function createInnerProxy(callback, path, memo) {
60
60
  */ const createFlatProxy = (callback)=>{
61
61
  return new Proxy(noop, {
62
62
  get (_obj, name) {
63
- if (typeof name !== 'string' || name === 'then') {
63
+ if (name === 'then') {
64
64
  // special case for if the proxy is accidentally treated
65
65
  // like a PromiseLike (like in `Promise.resolve(proxy)`)
66
66
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/server",
3
- "version": "11.0.0-rc.791+4eda4d50f",
3
+ "version": "11.0.0-rc.795+394b0f5cc",
4
4
  "description": "The tRPC server library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -152,5 +152,5 @@
152
152
  "peerDependencies": {
153
153
  "typescript": ">=5.7.2"
154
154
  },
155
- "gitHead": "4eda4d50fb6eb3907dce587cd71c7c131ffb02fe"
155
+ "gitHead": "394b0f5cc328937156cc75a772b3280231d4a2e2"
156
156
  }
@@ -34,16 +34,20 @@ export type InferrableClientTypes =
34
34
  | RootConfigLike
35
35
  | AnyClientTypes;
36
36
 
37
+ type PickTypes<T extends AnyClientTypes> = {
38
+ transformer: T['transformer'];
39
+ errorShape: T['errorShape'];
40
+ };
37
41
  /**
38
42
  * Infer the root types from a InferrableClientTypes
39
43
  */
40
44
  export type inferClientTypes<TInferrable extends InferrableClientTypes> =
41
45
  TInferrable extends AnyClientTypes
42
- ? TInferrable
46
+ ? PickTypes<TInferrable>
43
47
  : TInferrable extends RootConfigLike
44
- ? TInferrable['$types']
48
+ ? PickTypes<TInferrable['$types']>
45
49
  : TInferrable extends InitLike
46
- ? TInferrable['_config']['$types']
50
+ ? PickTypes<TInferrable['_config']['$types']>
47
51
  : TInferrable extends RouterLike
48
- ? TInferrable['_def']['_config']['$types']
52
+ ? PickTypes<TInferrable['_def']['_config']['$types']>
49
53
  : never;
@@ -70,11 +70,11 @@ export const createRecursiveProxy = <TFaux = unknown>(
70
70
  * @internal
71
71
  */
72
72
  export const createFlatProxy = <TFaux>(
73
- callback: (path: string & keyof TFaux) => any,
73
+ callback: (path: keyof TFaux) => any,
74
74
  ): TFaux => {
75
75
  return new Proxy(noop, {
76
76
  get(_obj, name) {
77
- if (typeof name !== 'string' || name === 'then') {
77
+ if (name === 'then') {
78
78
  // special case for if the proxy is accidentally treated
79
79
  // like a PromiseLike (like in `Promise.resolve(proxy)`)
80
80
  return undefined;