@trpc/server 11.0.0-rc.688 → 11.0.0-rc.693

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.
@@ -7,8 +7,10 @@ export interface UniversalIncomingMessage extends Omit<http.IncomingMessage, 'so
7
7
  /**
8
8
  * Socket is not always available in all deployments, so we need to make it optional
9
9
  * @see https://github.com/trpc/trpc/issues/6341
10
+ * The socket object provided in the request does not fully implement the expected Node.js Socket interface.
11
+ * @see https://github.com/trpc/trpc/pull/6358
10
12
  */
11
- socket?: http.IncomingMessage['socket'];
13
+ socket?: Partial<http.IncomingMessage['socket']>;
12
14
  }
13
15
  export declare function createURL(req: UniversalIncomingMessage): URL;
14
16
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"incomingMessageToRequest.d.ts","sourceRoot":"","sources":["../../../src/adapters/node-http/incomingMessageToRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,MAAM,CAAC;AAGlC,MAAM,WAAW,wBACf,SAAQ,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC;IAC5C;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;CACzC;AAiED,wBAAgB,SAAS,CAAC,GAAG,EAAE,wBAAwB,GAAG,GAAG,CAkB5D;AAwBD;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,wBAAwB,EAC7B,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,IAAI,EAAE;IACJ;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GACA,OAAO,CAqCT"}
1
+ {"version":3,"file":"incomingMessageToRequest.d.ts","sourceRoot":"","sources":["../../../src/adapters/node-http/incomingMessageToRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,MAAM,CAAC;AAGlC,MAAM,WAAW,wBACf,SAAQ,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC;IAC5C;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;CAClD;AAiED,wBAAgB,SAAS,CAAC,GAAG,EAAE,wBAAwB,GAAG,GAAG,CAkB5D;AAwBD;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,wBAAwB,EAC7B,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,IAAI,EAAE;IACJ;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GACA,OAAO,CAqCT"}
@@ -90,12 +90,12 @@ function createHeaders(incoming) {
90
90
  const ac = new AbortController();
91
91
  const onAbort = ()=>{
92
92
  res.off('close', onAbort);
93
- req.socket?.off('end', onAbort);
93
+ req.socket?.off?.('end', onAbort);
94
94
  // abort the request
95
95
  ac.abort();
96
96
  };
97
97
  res.once('close', onAbort);
98
- req.socket?.once('end', onAbort);
98
+ req.socket?.once?.('end', onAbort);
99
99
  // Get host from either regular header or HTTP/2 pseudo-header
100
100
  const url = createURL(req);
101
101
  const init = {
@@ -88,12 +88,12 @@ function createHeaders(incoming) {
88
88
  const ac = new AbortController();
89
89
  const onAbort = ()=>{
90
90
  res.off('close', onAbort);
91
- req.socket?.off('end', onAbort);
91
+ req.socket?.off?.('end', onAbort);
92
92
  // abort the request
93
93
  ac.abort();
94
94
  };
95
95
  res.once('close', onAbort);
96
- req.socket?.once('end', onAbort);
96
+ req.socket?.once?.('end', onAbort);
97
97
  // Get host from either regular header or HTTP/2 pseudo-header
98
98
  const url = createURL(req);
99
99
  const init = {
@@ -1,7 +1,7 @@
1
1
  {
2
- "bundleSize": 187247,
3
- "bundleOrigSize": 219578,
4
- "bundleReduction": 14.72,
2
+ "bundleSize": 187251,
3
+ "bundleOrigSize": 219751,
4
+ "bundleReduction": 14.79,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/unstable-core-do-not-import/stream/jsonl.ts",
@@ -198,8 +198,8 @@
198
198
  },
199
199
  {
200
200
  "id": "/src/adapters/node-http/incomingMessageToRequest.ts",
201
- "size": 3914,
202
- "origSize": 4578,
201
+ "size": 3918,
202
+ "origSize": 4751,
203
203
  "renderedExports": [
204
204
  "createURL",
205
205
  "incomingMessageToRequest"
@@ -210,7 +210,7 @@
210
210
  "/src/adapters/node-http/nodeHTTPRequestHandler.ts"
211
211
  ],
212
212
  "percent": 2.09,
213
- "reduction": 14.5
213
+ "reduction": 17.53
214
214
  },
215
215
  {
216
216
  "id": "/src/observable/operators.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/server",
3
- "version": "11.0.0-rc.688+87ea49ed1",
3
+ "version": "11.0.0-rc.693+c3a9b2102",
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": "87ea49ed1da187e72669ce6f638500369b16b749"
155
+ "gitHead": "c3a9b2102cc53d963944d201abc59892242af709"
156
156
  }
@@ -10,8 +10,10 @@ export interface UniversalIncomingMessage
10
10
  /**
11
11
  * Socket is not always available in all deployments, so we need to make it optional
12
12
  * @see https://github.com/trpc/trpc/issues/6341
13
+ * The socket object provided in the request does not fully implement the expected Node.js Socket interface.
14
+ * @see https://github.com/trpc/trpc/pull/6358
13
15
  */
14
- socket?: http.IncomingMessage['socket'];
16
+ socket?: Partial<http.IncomingMessage['socket']>;
15
17
  }
16
18
 
17
19
  function createBody(
@@ -136,14 +138,14 @@ export function incomingMessageToRequest(
136
138
 
137
139
  const onAbort = () => {
138
140
  res.off('close', onAbort);
139
- req.socket?.off('end', onAbort);
141
+ req.socket?.off?.('end', onAbort);
140
142
 
141
143
  // abort the request
142
144
  ac.abort();
143
145
  };
144
146
 
145
147
  res.once('close', onAbort);
146
- req.socket?.once('end', onAbort);
148
+ req.socket?.once?.('end', onAbort);
147
149
 
148
150
  // Get host from either regular header or HTTP/2 pseudo-header
149
151
  const url = createURL(req);