@trpc/server 11.0.0-rc.844 → 11.0.1-canary.14

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/README.md CHANGED
@@ -24,16 +24,16 @@ Full documentation for `@trpc/server` can be found [here](https://trpc.io/docs/r
24
24
 
25
25
  ```bash
26
26
  # npm
27
- npm install @trpc/server@next
27
+ npm install @trpc/server
28
28
 
29
29
  # Yarn
30
- yarn add @trpc/server@next
30
+ yarn add @trpc/server
31
31
 
32
32
  # pnpm
33
- pnpm add @trpc/server@next
33
+ pnpm add @trpc/server
34
34
 
35
35
  # Bun
36
- bun add @trpc/server@next
36
+ bun add @trpc/server
37
37
  ```
38
38
 
39
39
  We also recommend installing `zod` to validate procedure inputs.
@@ -1,7 +1,7 @@
1
1
  {
2
- "bundleSize": 201924,
3
- "bundleOrigSize": 234627,
4
- "bundleReduction": 13.94,
2
+ "bundleSize": 202129,
3
+ "bundleOrigSize": 234830,
4
+ "bundleReduction": 13.93,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
@@ -14,7 +14,7 @@
14
14
  "dependents": [
15
15
  "/src/unstable-core-do-not-import.ts"
16
16
  ],
17
- "percent": 10.44,
17
+ "percent": 10.43,
18
18
  "reduction": 0
19
19
  },
20
20
  {
@@ -30,7 +30,7 @@
30
30
  "dependents": [
31
31
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
32
32
  ],
33
- "percent": 9.98,
33
+ "percent": 9.97,
34
34
  "reduction": 0
35
35
  },
36
36
  {
@@ -47,7 +47,7 @@
47
47
  "/src/unstable-core-do-not-import.ts",
48
48
  "/src/unstable-core-do-not-import/http/resolveResponse.ts"
49
49
  ],
50
- "percent": 9.88,
50
+ "percent": 9.87,
51
51
  "reduction": 0
52
52
  },
53
53
  {
@@ -77,7 +77,7 @@
77
77
  ],
78
78
  "removedExports": [],
79
79
  "dependents": [],
80
- "percent": 6.02,
80
+ "percent": 6.01,
81
81
  "reduction": 11.62
82
82
  },
83
83
  {
@@ -98,7 +98,7 @@
98
98
  "/src/unstable-core-do-not-import/initTRPC.ts",
99
99
  "/src/unstable-core-do-not-import/http/contentType.ts"
100
100
  ],
101
- "percent": 5.03,
101
+ "percent": 5.02,
102
102
  "reduction": 29.54
103
103
  },
104
104
  {
@@ -228,7 +228,7 @@
228
228
  "/src/adapters/node-http/index.ts",
229
229
  "/src/adapters/node-http/nodeHTTPRequestHandler.ts"
230
230
  ],
231
- "percent": 2.01,
231
+ "percent": 2,
232
232
  "reduction": 6.81
233
233
  },
234
234
  {
@@ -246,7 +246,7 @@
246
246
  "dependents": [
247
247
  "/src/observable/index.ts"
248
248
  ],
249
- "percent": 1.94,
249
+ "percent": 1.93,
250
250
  "reduction": 1.66
251
251
  },
252
252
  {
@@ -260,7 +260,7 @@
260
260
  "dependents": [
261
261
  "/src/adapters/next-app-dir.ts"
262
262
  ],
263
- "percent": 1.61,
263
+ "percent": 1.6,
264
264
  "reduction": 22.52
265
265
  },
266
266
  {
@@ -274,7 +274,7 @@
274
274
  "dependents": [
275
275
  "/src/adapters/aws-lambda/getPlanner.ts"
276
276
  ],
277
- "percent": 1.39,
277
+ "percent": 1.38,
278
278
  "reduction": 0
279
279
  },
280
280
  {
@@ -343,7 +343,7 @@
343
343
  "/src/unstable-core-do-not-import/initTRPC.ts",
344
344
  "/src/unstable-core-do-not-import/procedureBuilder.ts"
345
345
  ],
346
- "percent": 1.3,
346
+ "percent": 1.29,
347
347
  "reduction": 55.88
348
348
  },
349
349
  {
@@ -488,6 +488,21 @@
488
488
  "percent": 1,
489
489
  "reduction": 3.8
490
490
  },
491
+ {
492
+ "id": "/src/unstable-core-do-not-import/parser.ts",
493
+ "size": 1815,
494
+ "origSize": 3704,
495
+ "renderedExports": [
496
+ "getParseFn"
497
+ ],
498
+ "removedExports": [],
499
+ "dependents": [
500
+ "/src/unstable-core-do-not-import.ts",
501
+ "/src/unstable-core-do-not-import/procedureBuilder.ts"
502
+ ],
503
+ "percent": 0.9,
504
+ "reduction": 51
505
+ },
491
506
  {
492
507
  "id": "/src/adapters/fastify/fastifyTRPCPlugin.ts",
493
508
  "size": 1777,
@@ -547,21 +562,6 @@
547
562
  "percent": 0.8,
548
563
  "reduction": 17.81
549
564
  },
550
- {
551
- "id": "/src/unstable-core-do-not-import/parser.ts",
552
- "size": 1610,
553
- "origSize": 3501,
554
- "renderedExports": [
555
- "getParseFn"
556
- ],
557
- "removedExports": [],
558
- "dependents": [
559
- "/src/unstable-core-do-not-import.ts",
560
- "/src/unstable-core-do-not-import/procedureBuilder.ts"
561
- ],
562
- "percent": 0.8,
563
- "reduction": 54.01
564
- },
565
565
  {
566
566
  "id": "/src/adapters/next.ts",
567
567
  "size": 1326,
@@ -924,9 +924,9 @@
924
924
  "removedExports": [],
925
925
  "dependents": [
926
926
  "/src/adapters/express.ts",
927
+ "/src/adapters/next.ts",
927
928
  "/src/adapters/standalone.ts",
928
929
  "/src/adapters/ws.ts",
929
- "/src/adapters/next.ts",
930
930
  "/src/adapters/node-http/nodeHTTPRequestHandler.ts",
931
931
  "/src/adapters/next-app-dir/nextAppDirCaller.ts",
932
932
  "/src/adapters/node-http/writeResponse.ts"
@@ -957,9 +957,9 @@
957
957
  "reduction": 100
958
958
  },
959
959
  {
960
- "id": "/src/adapters/fastify/index.ts",
960
+ "id": "/src/adapters/fetch/index.ts",
961
961
  "size": 0,
962
- "origSize": 78,
962
+ "origSize": 64,
963
963
  "renderedExports": [],
964
964
  "removedExports": [],
965
965
  "dependents": [],
@@ -967,9 +967,9 @@
967
967
  "reduction": 100
968
968
  },
969
969
  {
970
- "id": "/src/adapters/fetch/index.ts",
970
+ "id": "/src/adapters/fastify/index.ts",
971
971
  "size": 0,
972
- "origSize": 64,
972
+ "origSize": 78,
973
973
  "renderedExports": [],
974
974
  "removedExports": [],
975
975
  "dependents": [],
@@ -984,9 +984,9 @@
984
984
  "removedExports": [],
985
985
  "dependents": [
986
986
  "/src/adapters/express.ts",
987
+ "/src/adapters/next.ts",
987
988
  "/src/adapters/standalone.ts",
988
989
  "/src/adapters/ws.ts",
989
- "/src/adapters/next.ts",
990
990
  "/src/adapters/fastify/fastifyRequestHandler.ts"
991
991
  ],
992
992
  "percent": 0,
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/unstable-core-do-not-import/parser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,MAAM,MAAM,cAAc,CAAC,MAAM,EAAE,YAAY,IAAI;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,MAAM,EAAE,YAAY,IAAI;IACrD,MAAM,EAAE;QACN,MAAM,CAAC,EAAE;YACP,KAAK,EAAE,MAAM,CAAC;YACd,MAAM,EAAE,YAAY,CAAC;SACtB,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,MAAM,EAAE,YAAY,IAAI;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,YAAY,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,yBAAyB,CAAC,MAAM,EAAE,YAAY,IAAI,gBAAgB,CAC5E,MAAM,EACN,YAAY,CACb,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,MAAM,IAAI;IACrC,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,sBAAsB,CAAC,MAAM,IAAI;IAC3C,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,0BAA0B,CAAC,MAAM,IAAI,CAC/C,KAAK,EAAE,OAAO,KACX,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAE9B,MAAM,M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@@ -4,13 +4,14 @@ var error = require('../vendor/standard-schema-v1/error.js');
4
4
 
5
5
  function getParseFn(procedureParser) {
6
6
  const parser = procedureParser;
7
+ const isStandardSchema = '~standard' in parser;
7
8
  if (typeof parser === 'function' && typeof parser.assert === 'function') {
8
9
  // ParserArkTypeEsque - arktype schemas shouldn't be called as a function because they return a union type instead of throwing
9
10
  return parser.assert.bind(parser);
10
11
  }
11
- if (typeof parser === 'function') {
12
+ if (typeof parser === 'function' && !isStandardSchema) {
12
13
  // ParserValibotEsque (>= v0.31.0)
13
- // ParserCustomValidatorEsque
14
+ // ParserCustomValidatorEsque - note the check for standard-schema conformance - some libraries like `effect` use function schemas which are *not* a "parse" function.
14
15
  return parser;
15
16
  }
16
17
  if (typeof parser.parseAsync === 'function') {
@@ -37,7 +38,7 @@ function getParseFn(procedureParser) {
37
38
  return value;
38
39
  };
39
40
  }
40
- if ('~standard' in parser) {
41
+ if (isStandardSchema) {
41
42
  // StandardSchemaEsque
42
43
  return async (value)=>{
43
44
  const result = await parser['~standard'].validate(value);
@@ -2,13 +2,14 @@ import { StandardSchemaV1Error } from '../vendor/standard-schema-v1/error.mjs';
2
2
 
3
3
  function getParseFn(procedureParser) {
4
4
  const parser = procedureParser;
5
+ const isStandardSchema = '~standard' in parser;
5
6
  if (typeof parser === 'function' && typeof parser.assert === 'function') {
6
7
  // ParserArkTypeEsque - arktype schemas shouldn't be called as a function because they return a union type instead of throwing
7
8
  return parser.assert.bind(parser);
8
9
  }
9
- if (typeof parser === 'function') {
10
+ if (typeof parser === 'function' && !isStandardSchema) {
10
11
  // ParserValibotEsque (>= v0.31.0)
11
- // ParserCustomValidatorEsque
12
+ // ParserCustomValidatorEsque - note the check for standard-schema conformance - some libraries like `effect` use function schemas which are *not* a "parse" function.
12
13
  return parser;
13
14
  }
14
15
  if (typeof parser.parseAsync === 'function') {
@@ -35,7 +36,7 @@ function getParseFn(procedureParser) {
35
36
  return value;
36
37
  };
37
38
  }
38
- if ('~standard' in parser) {
39
+ if (isStandardSchema) {
39
40
  // StandardSchemaEsque
40
41
  return async (value)=>{
41
42
  const result = await parser['~standard'].validate(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/server",
3
- "version": "11.0.0-rc.844+0244dee81",
3
+ "version": "11.0.1-canary.14+249b40d25",
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": "0244dee8108e808281041838d6c326dacb030bf2"
155
+ "gitHead": "249b40d256a7d551cc9f43871599629f713080ef"
156
156
  }
@@ -78,15 +78,16 @@ export type ParseFn<TType> = (value: unknown) => Promise<TType> | TType;
78
78
 
79
79
  export function getParseFn<TType>(procedureParser: Parser): ParseFn<TType> {
80
80
  const parser = procedureParser as any;
81
+ const isStandardSchema = '~standard' in parser;
81
82
 
82
83
  if (typeof parser === 'function' && typeof parser.assert === 'function') {
83
84
  // ParserArkTypeEsque - arktype schemas shouldn't be called as a function because they return a union type instead of throwing
84
85
  return parser.assert.bind(parser);
85
86
  }
86
87
 
87
- if (typeof parser === 'function') {
88
+ if (typeof parser === 'function' && !isStandardSchema) {
88
89
  // ParserValibotEsque (>= v0.31.0)
89
- // ParserCustomValidatorEsque
90
+ // ParserCustomValidatorEsque - note the check for standard-schema conformance - some libraries like `effect` use function schemas which are *not* a "parse" function.
90
91
  return parser;
91
92
  }
92
93
 
@@ -119,7 +120,7 @@ export function getParseFn<TType>(procedureParser: Parser): ParseFn<TType> {
119
120
  };
120
121
  }
121
122
 
122
- if ('~standard' in parser) {
123
+ if (isStandardSchema) {
123
124
  // StandardSchemaEsque
124
125
  return async (value) => {
125
126
  const result = await parser['~standard'].validate(value);