@trpc/server 11.0.0-next-beta.284 → 11.0.0-next-beta.286

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": 92285,
3
- "bundleOrigSize": 146562,
4
- "bundleReduction": 37.03,
2
+ "bundleSize": 92133,
3
+ "bundleOrigSize": 146326,
4
+ "bundleReduction": 37.04,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/adapters/ws.ts",
@@ -14,7 +14,7 @@
14
14
  "dependents": [
15
15
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
16
16
  ],
17
- "percent": 10.8,
17
+ "percent": 10.82,
18
18
  "reduction": 0
19
19
  },
20
20
  {
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "removedExports": [],
28
28
  "dependents": [],
29
- "percent": 10.03,
29
+ "percent": 10.05,
30
30
  "reduction": 21.53
31
31
  },
32
32
  {
@@ -45,7 +45,7 @@
45
45
  "/src/unstable-core-do-not-import/http/resolveHTTPResponse.ts",
46
46
  "/src/unstable-core-do-not-import/initTRPC.ts"
47
47
  ],
48
- "percent": 6.54,
48
+ "percent": 6.56,
49
49
  "reduction": 38.32
50
50
  },
51
51
  {
@@ -61,7 +61,7 @@
61
61
  "/src/unstable-core-do-not-import.ts",
62
62
  "/src/unstable-core-do-not-import/initTRPC.ts"
63
63
  ],
64
- "percent": 6.07,
64
+ "percent": 6.08,
65
65
  "reduction": 56.15
66
66
  },
67
67
  {
@@ -77,7 +77,7 @@
77
77
  "dependents": [
78
78
  "/src/adapters/node-http/content-type/form-data/index.ts"
79
79
  ],
80
- "percent": 5.39,
80
+ "percent": 5.4,
81
81
  "reduction": 36.77
82
82
  },
83
83
  {
@@ -91,7 +91,7 @@
91
91
  ],
92
92
  "removedExports": [],
93
93
  "dependents": [],
94
- "percent": 4.79,
94
+ "percent": 4.8,
95
95
  "reduction": 32.71
96
96
  },
97
97
  {
@@ -119,7 +119,7 @@
119
119
  "dependents": [
120
120
  "/src/adapters/fetch/index.ts"
121
121
  ],
122
- "percent": 3.85,
122
+ "percent": 3.86,
123
123
  "reduction": 9.5
124
124
  },
125
125
  {
@@ -154,7 +154,7 @@
154
154
  "dependents": [
155
155
  "/src/adapters/aws-lambda/index.ts"
156
156
  ],
157
- "percent": 3.58,
157
+ "percent": 3.59,
158
158
  "reduction": 36.48
159
159
  },
160
160
  {
@@ -173,20 +173,6 @@
173
173
  "percent": 3.23,
174
174
  "reduction": 0
175
175
  },
176
- {
177
- "id": "/src/unstable-core-do-not-import/initTRPC.ts",
178
- "size": 2879,
179
- "origSize": 4716,
180
- "renderedExports": [
181
- "initTRPC"
182
- ],
183
- "removedExports": [],
184
- "dependents": [
185
- "/src/unstable-core-do-not-import.ts"
186
- ],
187
- "percent": 3.12,
188
- "reduction": 38.95
189
- },
190
176
  {
191
177
  "id": "/src/unstable-core-do-not-import/transformer.ts",
192
178
  "size": 2744,
@@ -204,9 +190,23 @@
204
190
  "/src/unstable-core-do-not-import/router.ts",
205
191
  "/src/unstable-core-do-not-import/initTRPC.ts"
206
192
  ],
207
- "percent": 2.97,
193
+ "percent": 2.98,
208
194
  "reduction": 45.94
209
195
  },
196
+ {
197
+ "id": "/src/unstable-core-do-not-import/initTRPC.ts",
198
+ "size": 2727,
199
+ "origSize": 4480,
200
+ "renderedExports": [
201
+ "initTRPC"
202
+ ],
203
+ "removedExports": [],
204
+ "dependents": [
205
+ "/src/unstable-core-do-not-import.ts"
206
+ ],
207
+ "percent": 2.96,
208
+ "reduction": 39.13
209
+ },
210
210
  {
211
211
  "id": "/src/adapters/fastify/fastifyRequestHandler.ts",
212
212
  "size": 2590,
@@ -239,7 +239,7 @@
239
239
  "/src/unstable-core-do-not-import/initTRPC.ts",
240
240
  "/src/unstable-core-do-not-import/procedureBuilder.ts"
241
241
  ],
242
- "percent": 2.79,
242
+ "percent": 2.8,
243
243
  "reduction": 55.95
244
244
  },
245
245
  {
@@ -251,7 +251,7 @@
251
251
  ],
252
252
  "removedExports": [],
253
253
  "dependents": [],
254
- "percent": 2.75,
254
+ "percent": 2.76,
255
255
  "reduction": 31.37
256
256
  },
257
257
  {
@@ -341,7 +341,7 @@
341
341
  "/src/unstable-core-do-not-import/router.ts",
342
342
  "/src/unstable-core-do-not-import/initTRPC.ts"
343
343
  ],
344
- "percent": 1.63,
344
+ "percent": 1.64,
345
345
  "reduction": 5.58
346
346
  },
347
347
  {
@@ -39,8 +39,8 @@ declare class TRPCBuilder<TContext extends object, TMeta extends object> {
39
39
  _config: RootConfig<{
40
40
  ctx: TContext;
41
41
  meta: TMeta;
42
- errorShape: undefined extends TOptions["errorFormatter"] ? DefaultErrorShape : inferErrorFormatterShape<TOptions["errorFormatter"]>;
43
- transformer: undefined extends TOptions["transformer"] ? false : true;
42
+ errorShape: undefined extends TOptions['errorFormatter'] ? DefaultErrorShape : inferErrorFormatterShape<TOptions['errorFormatter']>;
43
+ transformer: undefined extends TOptions['transformer'] ? false : true;
44
44
  }>;
45
45
  /**
46
46
  * Builder object for creating procedures
@@ -60,14 +60,14 @@ declare class TRPCBuilder<TContext extends object, TMeta extends object> {
60
60
  <TInput extends import("./router").RouterRecord>(input: TInput): import("./router").BuiltRouter<{
61
61
  ctx: TContext;
62
62
  meta: TMeta;
63
- errorShape: undefined extends TOptions["errorFormatter"] ? DefaultErrorShape : inferErrorFormatterShape<TOptions["errorFormatter"]>;
64
- transformer: undefined extends TOptions["transformer"] ? false : true;
63
+ errorShape: undefined extends TOptions['errorFormatter'] ? DefaultErrorShape : inferErrorFormatterShape<TOptions['errorFormatter']>;
64
+ transformer: undefined extends TOptions['transformer'] ? false : true;
65
65
  }, TInput>;
66
66
  <TInput_1 extends import("./router").CreateRouterOptions>(input: TInput_1): import("./router").BuiltRouter<{
67
67
  ctx: TContext;
68
68
  meta: TMeta;
69
- errorShape: undefined extends TOptions["errorFormatter"] ? DefaultErrorShape : inferErrorFormatterShape<TOptions["errorFormatter"]>;
70
- transformer: undefined extends TOptions["transformer"] ? false : true;
69
+ errorShape: undefined extends TOptions['errorFormatter'] ? DefaultErrorShape : inferErrorFormatterShape<TOptions['errorFormatter']>;
70
+ transformer: undefined extends TOptions['transformer'] ? false : true;
71
71
  }, import("./router").DecorateCreateRouterOptions<TInput_1>>;
72
72
  };
73
73
  /**
@@ -82,13 +82,13 @@ declare class TRPCBuilder<TContext extends object, TMeta extends object> {
82
82
  createCallerFactory: <TRecord extends import("./router").RouterRecord>(router: import("./router").Router<{
83
83
  ctx: TContext;
84
84
  meta: TMeta;
85
- errorShape: undefined extends TOptions["errorFormatter"] ? DefaultErrorShape : inferErrorFormatterShape<TOptions["errorFormatter"]>;
86
- transformer: undefined extends TOptions["transformer"] ? false : true;
85
+ errorShape: undefined extends TOptions['errorFormatter'] ? DefaultErrorShape : inferErrorFormatterShape<TOptions['errorFormatter']>;
86
+ transformer: undefined extends TOptions['transformer'] ? false : true;
87
87
  }, TRecord>) => import("./router").RouterCaller<{
88
88
  ctx: TContext;
89
89
  meta: TMeta;
90
- errorShape: undefined extends TOptions["errorFormatter"] ? DefaultErrorShape : inferErrorFormatterShape<TOptions["errorFormatter"]>;
91
- transformer: undefined extends TOptions["transformer"] ? false : true;
90
+ errorShape: undefined extends TOptions['errorFormatter'] ? DefaultErrorShape : inferErrorFormatterShape<TOptions['errorFormatter']>;
91
+ transformer: undefined extends TOptions['transformer'] ? false : true;
92
92
  }, TRecord>;
93
93
  };
94
94
  }
@@ -1 +1 @@
1
- {"version":3,"file":"initTRPC.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/initTRPC.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAGL,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,sBAAsB,EAAE,M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AAG,IAAI;;;CAiE1E;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,6BAAoB,CAAC"}
@@ -25,14 +25,11 @@ class TRPCBuilder {
25
25
  * Create the root object
26
26
  * @link https://trpc.io/docs/v11/server/routers#initialize-trpc
27
27
  */ create(opts) {
28
- const errorFormatter = opts?.errorFormatter ?? formatter.defaultFormatter;
29
- const transformer$1 = transformer.getDataTransformer(opts?.transformer ?? transformer.defaultTransformer);
30
28
  const config = {
31
- transformer: transformer$1,
32
- isDev: opts?.isDev ?? // eslint-disable-next-line @typescript-eslint/dot-notation
33
- globalThis.process?.env?.['NODE_ENV'] !== 'production',
29
+ transformer: transformer.getDataTransformer(opts?.transformer ?? transformer.defaultTransformer),
30
+ isDev: opts?.isDev ?? globalThis.process?.env?.NODE_ENV !== 'production',
34
31
  allowOutsideOfServer: opts?.allowOutsideOfServer ?? false,
35
- errorFormatter,
32
+ errorFormatter: opts?.errorFormatter ?? formatter.defaultFormatter,
36
33
  isServer: opts?.isServer ?? rootConfig.isServerDefault,
37
34
  /**
38
35
  * These are just types, they can't be used at runtime
@@ -23,14 +23,11 @@ class TRPCBuilder {
23
23
  * Create the root object
24
24
  * @link https://trpc.io/docs/v11/server/routers#initialize-trpc
25
25
  */ create(opts) {
26
- const errorFormatter = opts?.errorFormatter ?? defaultFormatter;
27
- const transformer = getDataTransformer(opts?.transformer ?? defaultTransformer);
28
26
  const config = {
29
- transformer,
30
- isDev: opts?.isDev ?? // eslint-disable-next-line @typescript-eslint/dot-notation
31
- globalThis.process?.env?.['NODE_ENV'] !== 'production',
27
+ transformer: getDataTransformer(opts?.transformer ?? defaultTransformer),
28
+ isDev: opts?.isDev ?? globalThis.process?.env?.NODE_ENV !== 'production',
32
29
  allowOutsideOfServer: opts?.allowOutsideOfServer ?? false,
33
- errorFormatter,
30
+ errorFormatter: opts?.errorFormatter ?? defaultFormatter,
34
31
  isServer: opts?.isServer ?? isServerDefault,
35
32
  /**
36
33
  * These are just types, they can't be used at runtime
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/server",
3
- "version": "11.0.0-next-beta.284+1960156a1",
3
+ "version": "11.0.0-next-beta.286+361675f0a",
4
4
  "description": "The tRPC server library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -157,5 +157,5 @@
157
157
  "funding": [
158
158
  "https://trpc.io/sponsor"
159
159
  ],
160
- "gitHead": "1960156a1b30fe76a3828cbf8096e78f85593f11"
160
+ "gitHead": "361675f0a5b3e7eaf8d6982a32dbfd0f0b40a5a5"
161
161
  }
@@ -68,33 +68,20 @@ class TRPCBuilder<TContext extends object, TMeta extends object> {
68
68
  | ValidateShape<TOptions, RuntimeConfigOptions<TContext, TMeta>>
69
69
  | undefined,
70
70
  ) {
71
- type $Transformer = undefined extends TOptions['transformer']
72
- ? false
73
- : true;
74
- type $ErrorShape = undefined extends TOptions['errorFormatter']
75
- ? DefaultErrorShape
76
- : inferErrorFormatterShape<TOptions['errorFormatter']>;
77
-
78
71
  type $Root = CreateRootTypes<{
79
72
  ctx: TContext;
80
73
  meta: TMeta;
81
- errorShape: $ErrorShape;
82
- transformer: $Transformer;
74
+ errorShape: undefined extends TOptions['errorFormatter']
75
+ ? DefaultErrorShape
76
+ : inferErrorFormatterShape<TOptions['errorFormatter']>;
77
+ transformer: undefined extends TOptions['transformer'] ? false : true;
83
78
  }>;
84
79
 
85
- const errorFormatter = opts?.errorFormatter ?? defaultFormatter;
86
- const transformer = getDataTransformer(
87
- opts?.transformer ?? defaultTransformer,
88
- );
89
-
90
80
  const config: RootConfig<$Root> = {
91
- transformer,
92
- isDev:
93
- opts?.isDev ??
94
- // eslint-disable-next-line @typescript-eslint/dot-notation
95
- globalThis.process?.env?.['NODE_ENV'] !== 'production',
81
+ transformer: getDataTransformer(opts?.transformer ?? defaultTransformer),
82
+ isDev: opts?.isDev ?? globalThis.process?.env?.NODE_ENV !== 'production',
96
83
  allowOutsideOfServer: opts?.allowOutsideOfServer ?? false,
97
- errorFormatter,
84
+ errorFormatter: opts?.errorFormatter ?? defaultFormatter,
98
85
  isServer: opts?.isServer ?? isServerDefault,
99
86
  /**
100
87
  * These are just types, they can't be used at runtime