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

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
  {
@@ -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
  {
@@ -882,9 +882,9 @@
882
882
  "reduction": 100
883
883
  },
884
884
  {
885
- "id": "/src/shared.ts",
885
+ "id": "/src/rpc.ts",
886
886
  "size": 0,
887
- "origSize": 653,
887
+ "origSize": 36,
888
888
  "renderedExports": [],
889
889
  "removedExports": [],
890
890
  "dependents": [],
@@ -892,9 +892,9 @@
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": [],
@@ -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": [],
@@ -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.797+8374c3b18",
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": "8374c3b1869538c8a32c2ea266c9762c98a8b91c"
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;