@trpc/server 11.0.0-rc.708 → 11.0.0-rc.711
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.
- package/dist/bundle-analysis.json +24 -24
- package/dist/unstable-core-do-not-import/clientish/inference.d.ts +2 -2
- package/dist/unstable-core-do-not-import/clientish/inference.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/router.d.ts +2 -1
- package/dist/unstable-core-do-not-import/router.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/unstable-core-do-not-import/clientish/inference.ts +7 -7
- package/src/unstable-core-do-not-import/router.ts +6 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bundleSize": 193473,
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 13.
|
|
3
|
+
"bundleOrigSize": 224144,
|
|
4
|
+
"bundleReduction": 13.68,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
{
|
|
113
113
|
"id": "/src/unstable-core-do-not-import/router.ts",
|
|
114
114
|
"size": 6417,
|
|
115
|
-
"origSize":
|
|
115
|
+
"origSize": 10809,
|
|
116
116
|
"renderedExports": [
|
|
117
117
|
"createRouterFactory",
|
|
118
118
|
"callProcedure",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
126
126
|
],
|
|
127
127
|
"percent": 3.32,
|
|
128
|
-
"reduction":
|
|
128
|
+
"reduction": 40.63
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
"id": "/src/unstable-core-do-not-import/stream/utils/asyncIterable.ts",
|
|
@@ -351,11 +351,11 @@
|
|
|
351
351
|
"/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
|
|
352
352
|
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
353
353
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
354
|
+
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
354
355
|
"/src/unstable-core-do-not-import/error/TRPCError.ts",
|
|
355
356
|
"/src/unstable-core-do-not-import/transformer.ts",
|
|
356
357
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
357
358
|
"/src/unstable-core-do-not-import/router.ts",
|
|
358
|
-
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
359
359
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
360
360
|
"/src/unstable-core-do-not-import/http/isAbortError.ts",
|
|
361
361
|
"/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
@@ -849,9 +849,9 @@
|
|
|
849
849
|
"reduction": 100
|
|
850
850
|
},
|
|
851
851
|
{
|
|
852
|
-
"id": "/src/
|
|
852
|
+
"id": "/src/rpc.ts",
|
|
853
853
|
"size": 0,
|
|
854
|
-
"origSize":
|
|
854
|
+
"origSize": 36,
|
|
855
855
|
"renderedExports": [],
|
|
856
856
|
"removedExports": [],
|
|
857
857
|
"dependents": [],
|
|
@@ -859,9 +859,9 @@
|
|
|
859
859
|
"reduction": 100
|
|
860
860
|
},
|
|
861
861
|
{
|
|
862
|
-
"id": "/src/
|
|
862
|
+
"id": "/src/index.ts",
|
|
863
863
|
"size": 0,
|
|
864
|
-
"origSize":
|
|
864
|
+
"origSize": 32,
|
|
865
865
|
"renderedExports": [],
|
|
866
866
|
"removedExports": [],
|
|
867
867
|
"dependents": [],
|
|
@@ -869,9 +869,9 @@
|
|
|
869
869
|
"reduction": 100
|
|
870
870
|
},
|
|
871
871
|
{
|
|
872
|
-
"id": "/src/
|
|
872
|
+
"id": "/src/shared.ts",
|
|
873
873
|
"size": 0,
|
|
874
|
-
"origSize":
|
|
874
|
+
"origSize": 653,
|
|
875
875
|
"renderedExports": [],
|
|
876
876
|
"removedExports": [],
|
|
877
877
|
"dependents": [],
|
|
@@ -886,8 +886,8 @@
|
|
|
886
886
|
"removedExports": [],
|
|
887
887
|
"dependents": [
|
|
888
888
|
"/src/adapters/express.ts",
|
|
889
|
-
"/src/adapters/standalone.ts",
|
|
890
889
|
"/src/adapters/next.ts",
|
|
890
|
+
"/src/adapters/standalone.ts",
|
|
891
891
|
"/src/adapters/ws.ts",
|
|
892
892
|
"/src/adapters/node-http/nodeHTTPRequestHandler.ts",
|
|
893
893
|
"/src/adapters/next-app-dir/nextAppDirCaller.ts",
|
|
@@ -919,12 +919,18 @@
|
|
|
919
919
|
"reduction": 100
|
|
920
920
|
},
|
|
921
921
|
{
|
|
922
|
-
"id": "/src/adapters/
|
|
922
|
+
"id": "/src/adapters/node-http/index.ts",
|
|
923
923
|
"size": 0,
|
|
924
|
-
"origSize":
|
|
924
|
+
"origSize": 111,
|
|
925
925
|
"renderedExports": [],
|
|
926
926
|
"removedExports": [],
|
|
927
|
-
"dependents": [
|
|
927
|
+
"dependents": [
|
|
928
|
+
"/src/adapters/express.ts",
|
|
929
|
+
"/src/adapters/next.ts",
|
|
930
|
+
"/src/adapters/standalone.ts",
|
|
931
|
+
"/src/adapters/ws.ts",
|
|
932
|
+
"/src/adapters/fastify/fastifyRequestHandler.ts"
|
|
933
|
+
],
|
|
928
934
|
"percent": 0,
|
|
929
935
|
"reduction": 100
|
|
930
936
|
},
|
|
@@ -939,18 +945,12 @@
|
|
|
939
945
|
"reduction": 100
|
|
940
946
|
},
|
|
941
947
|
{
|
|
942
|
-
"id": "/src/adapters/
|
|
948
|
+
"id": "/src/adapters/fastify/index.ts",
|
|
943
949
|
"size": 0,
|
|
944
|
-
"origSize":
|
|
950
|
+
"origSize": 78,
|
|
945
951
|
"renderedExports": [],
|
|
946
952
|
"removedExports": [],
|
|
947
|
-
"dependents": [
|
|
948
|
-
"/src/adapters/express.ts",
|
|
949
|
-
"/src/adapters/standalone.ts",
|
|
950
|
-
"/src/adapters/next.ts",
|
|
951
|
-
"/src/adapters/ws.ts",
|
|
952
|
-
"/src/adapters/fastify/fastifyRequestHandler.ts"
|
|
953
|
-
],
|
|
953
|
+
"dependents": [],
|
|
954
954
|
"percent": 0,
|
|
955
955
|
"reduction": 100
|
|
956
956
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { inferObservableValue } from '../../observable';
|
|
2
2
|
import type { AnyProcedure, inferProcedureInput, inferProcedureOutput } from '../procedure';
|
|
3
|
-
import type { AnyRouter, RouterRecord } from '../router';
|
|
3
|
+
import type { AnyRouter, coerceToRouterRecord, RouterRecord } from '../router';
|
|
4
4
|
import type { AnyClientTypes, inferClientTypes, InferrableClientTypes } from './inferrable';
|
|
5
5
|
import type { Serialize } from './serialize';
|
|
6
6
|
/**
|
|
@@ -10,7 +10,7 @@ export type inferTransformedProcedureOutput<TInferrable extends InferrableClient
|
|
|
10
10
|
/** @internal */
|
|
11
11
|
export type inferTransformedSubscriptionOutput<TInferrable extends InferrableClientTypes, TProcedure extends AnyProcedure> = inferClientTypes<TInferrable>['transformer'] extends false ? Serialize<inferObservableValue<inferProcedureOutput<TProcedure>>> : inferObservableValue<inferProcedureOutput<TProcedure>>;
|
|
12
12
|
export type GetInferenceHelpers<TType extends 'input' | 'output', TRoot extends AnyClientTypes, TRecord extends RouterRecord> = {
|
|
13
|
-
[TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends
|
|
13
|
+
[TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyProcedure ? TType extends 'input' ? inferProcedureInput<$Value> : inferTransformedProcedureOutput<TRoot, $Value> : $Value extends RouterRecord | AnyRouter ? GetInferenceHelpers<TType, TRoot, coerceToRouterRecord<$Value>> : never : never;
|
|
14
14
|
};
|
|
15
15
|
export type inferRouterInputs<TRouter extends AnyRouter> = GetInferenceHelpers<'input', TRouter['_def']['_config']['$types'], TRouter['_def']['record']>;
|
|
16
16
|
export type inferRouterOutputs<TRouter extends AnyRouter> = GetInferenceHelpers<'output', TRouter['_def']['_config']['$types'], TRouter['_def']['record']>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/clientish/inference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/clientish/inference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC/E,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AAEH,MAAM,MAAM,+BAA+B,CACzC,WAAW,SAAS,qBAAqB,EACzC,UAAU,SAAS,YAAY,IAC7B,gBAAgB,CAAC,WAAW,CAAC,CAAC,aAAa,CAAC,SAAS,KAAK,GAC1D,SAAS,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,GAC3C,oBAAoB,CAAC,UAAU,CAAC,CAAC;AACrC,gBAAgB;AAEhB,MAAM,MAAM,kCAAkC,CAC5C,WAAW,SAAS,qBAAqB,EACzC,UAAU,SAAS,YAAY,IAC7B,gBAAgB,CAAC,WAAW,CAAC,CAAC,aAAa,CAAC,SAAS,KAAK,GAC1D,SAAS,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC,GACjE,oBAAoB,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC;AAE3D,MAAM,MAAM,mBAAmB,CAC7B,KAAK,SAAS,OAAO,GAAG,QAAQ,EAChC,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,YAAY,IAC1B;KACD,IAAI,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,MAAM,MAAM,GACvD,MAAM,SAAS,YAAY,GACzB,KAAK,SAAS,OAAO,GACnB,mBAAmB,CAAC,MAAM,CAAC,GAC3B,+BAA+B,CAAC,KAAK,EAAE,MAAM,CAAC,GAChD,MAAM,SAAS,YAAY,GAAG,SAAS,GACrC,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC,GAC/D,KAAK,GACT,KAAK;CACV,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,OAAO,SAAS,SAAS,IAAI,mBAAmB,CAC5E,OAAO,EACP,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EACpC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAC1B,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,OAAO,SAAS,SAAS,IAAI,mBAAmB,CAC7E,QAAQ,EACR,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EACpC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAC1B,CAAC"}
|
|
@@ -12,7 +12,7 @@ type DecorateProcedure<TProcedure extends AnyProcedure> = (input: inferProcedure
|
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
14
|
export type DecorateRouterRecord<TRecord extends RouterRecord> = {
|
|
15
|
-
[TKey in keyof TRecord]: TRecord[TKey] extends AnyProcedure ? DecorateProcedure<TRecord[TKey]> : TRecord[TKey] extends RouterRecord ? DecorateRouterRecord<TRecord[TKey]
|
|
15
|
+
[TKey in keyof TRecord]: TRecord[TKey] extends AnyProcedure ? DecorateProcedure<TRecord[TKey]> : coerceToRouterRecord<TRecord[TKey]> extends RouterRecord ? DecorateRouterRecord<coerceToRouterRecord<TRecord[TKey]>> : never;
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
18
|
* @internal
|
|
@@ -78,5 +78,6 @@ type MergeRouters<TRouters extends AnyRouter[], TRoot extends AnyRootTypes = TRo
|
|
|
78
78
|
...infer Tail extends AnyRouter[]
|
|
79
79
|
] ? MergeRouters<Tail, TRoot, Head['_def']['record'] & TRecord> : BuiltRouter<TRoot, TRecord>;
|
|
80
80
|
export declare function mergeRouters<TRouters extends AnyRouter[]>(...routerList: [...TRouters]): MergeRouters<TRouters>;
|
|
81
|
+
export type coerceToRouterRecord<T> = T extends AnyRouter ? T['_def']['record'] : T;
|
|
81
82
|
export {};
|
|
82
83
|
//# sourceMappingURL=router.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,EAA2B,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qCAAqC,EACtC,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAW,MAAM,SAAS,CAAC;AAGrD,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,YAAY,CAAC;CAC5C;AA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W,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAEhC,wBAAgB,YAAY,CAAC,QAAQ,SAAS,SAAS,EAAE,EACvD,GAAG,UAAU,EAAE,CAAC,GAAG,QAAQ,CAAC,GAC3B,YAAY,CAAC,QAAQ,CAAC,CAoDxB;AAED,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GACrD,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,GACnB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "11.0.0-rc.
|
|
3
|
+
"version": "11.0.0-rc.711+e82d26126",
|
|
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": "
|
|
155
|
+
"gitHead": "e82d261262fcb9d54747e0b223ee1e069ec2a9fd"
|
|
156
156
|
}
|
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
inferProcedureInput,
|
|
5
5
|
inferProcedureOutput,
|
|
6
6
|
} from '../procedure';
|
|
7
|
-
import type { AnyRouter, RouterRecord } from '../router';
|
|
7
|
+
import type { AnyRouter, coerceToRouterRecord, RouterRecord } from '../router';
|
|
8
8
|
import type {
|
|
9
9
|
AnyClientTypes,
|
|
10
10
|
inferClientTypes,
|
|
@@ -37,12 +37,12 @@ export type GetInferenceHelpers<
|
|
|
37
37
|
TRecord extends RouterRecord,
|
|
38
38
|
> = {
|
|
39
39
|
[TKey in keyof TRecord]: TRecord[TKey] extends infer $Value
|
|
40
|
-
? $Value extends
|
|
41
|
-
?
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
? $Value extends AnyProcedure
|
|
41
|
+
? TType extends 'input'
|
|
42
|
+
? inferProcedureInput<$Value>
|
|
43
|
+
: inferTransformedProcedureOutput<TRoot, $Value>
|
|
44
|
+
: $Value extends RouterRecord | AnyRouter
|
|
45
|
+
? GetInferenceHelpers<TType, TRoot, coerceToRouterRecord<$Value>>
|
|
46
46
|
: never
|
|
47
47
|
: never;
|
|
48
48
|
};
|
|
@@ -35,8 +35,8 @@ type DecorateProcedure<TProcedure extends AnyProcedure> = (
|
|
|
35
35
|
export type DecorateRouterRecord<TRecord extends RouterRecord> = {
|
|
36
36
|
[TKey in keyof TRecord]: TRecord[TKey] extends AnyProcedure
|
|
37
37
|
? DecorateProcedure<TRecord[TKey]>
|
|
38
|
-
: TRecord[TKey] extends RouterRecord
|
|
39
|
-
? DecorateRouterRecord<TRecord[TKey]
|
|
38
|
+
: coerceToRouterRecord<TRecord[TKey]> extends RouterRecord
|
|
39
|
+
? DecorateRouterRecord<coerceToRouterRecord<TRecord[TKey]>>
|
|
40
40
|
: never;
|
|
41
41
|
};
|
|
42
42
|
|
|
@@ -381,3 +381,7 @@ export function mergeRouters<TRouters extends AnyRouter[]>(
|
|
|
381
381
|
|
|
382
382
|
return router as MergeRouters<TRouters>;
|
|
383
383
|
}
|
|
384
|
+
|
|
385
|
+
export type coerceToRouterRecord<T> = T extends AnyRouter
|
|
386
|
+
? T['_def']['record']
|
|
387
|
+
: T;
|