@trpc/server 11.0.0-rc.688 → 11.0.0-rc.692
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/adapters/node-http/incomingMessageToRequest.d.ts +3 -1
- package/dist/adapters/node-http/incomingMessageToRequest.d.ts.map +1 -1
- package/dist/adapters/node-http/incomingMessageToRequest.js +2 -2
- package/dist/adapters/node-http/incomingMessageToRequest.mjs +2 -2
- package/dist/bundle-analysis.json +33 -33
- package/package.json +2 -2
- package/src/adapters/node-http/incomingMessageToRequest.ts +5 -3
|
@@ -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
|
|
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":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 14.
|
|
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":
|
|
202
|
-
"origSize":
|
|
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":
|
|
213
|
+
"reduction": 17.53
|
|
214
214
|
},
|
|
215
215
|
{
|
|
216
216
|
"id": "/src/observable/operators.ts",
|
|
@@ -272,9 +272,9 @@
|
|
|
272
272
|
"removedExports": [],
|
|
273
273
|
"dependents": [
|
|
274
274
|
"/src/unstable-core-do-not-import.ts",
|
|
275
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
276
275
|
"/src/unstable-core-do-not-import/initTRPC.ts",
|
|
277
|
-
"/src/unstable-core-do-not-import/router.ts"
|
|
276
|
+
"/src/unstable-core-do-not-import/router.ts",
|
|
277
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
278
278
|
],
|
|
279
279
|
"percent": 1.46,
|
|
280
280
|
"reduction": 45.98
|
|
@@ -334,13 +334,13 @@
|
|
|
334
334
|
"removedExports": [],
|
|
335
335
|
"dependents": [
|
|
336
336
|
"/src/unstable-core-do-not-import.ts",
|
|
337
|
-
"/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
|
|
338
|
-
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
339
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
340
337
|
"/src/unstable-core-do-not-import/error/TRPCError.ts",
|
|
341
338
|
"/src/unstable-core-do-not-import/transformer.ts",
|
|
342
339
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
343
340
|
"/src/unstable-core-do-not-import/router.ts",
|
|
341
|
+
"/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
|
|
342
|
+
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
343
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
344
344
|
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
345
345
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
346
346
|
"/src/unstable-core-do-not-import/http/isAbortError.ts",
|
|
@@ -363,10 +363,10 @@
|
|
|
363
363
|
"removedExports": [],
|
|
364
364
|
"dependents": [
|
|
365
365
|
"/src/unstable-core-do-not-import.ts",
|
|
366
|
-
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
367
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
368
366
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
369
367
|
"/src/unstable-core-do-not-import/router.ts",
|
|
368
|
+
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
369
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
370
370
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
371
371
|
"/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
372
372
|
"/src/unstable-core-do-not-import/stream/sse.ts"
|
|
@@ -433,8 +433,8 @@
|
|
|
433
433
|
"removedExports": [],
|
|
434
434
|
"dependents": [
|
|
435
435
|
"/src/unstable-core-do-not-import.ts",
|
|
436
|
-
"/src/unstable-core-do-not-import/
|
|
437
|
-
"/src/unstable-core-do-not-import/
|
|
436
|
+
"/src/unstable-core-do-not-import/error/getErrorShape.ts",
|
|
437
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
438
438
|
],
|
|
439
439
|
"percent": 1.11,
|
|
440
440
|
"reduction": 18.54
|
|
@@ -821,24 +821,24 @@
|
|
|
821
821
|
"reduction": 93.9
|
|
822
822
|
},
|
|
823
823
|
{
|
|
824
|
-
"id": "/src/
|
|
824
|
+
"id": "/src/index.ts",
|
|
825
825
|
"size": 0,
|
|
826
|
-
"origSize":
|
|
826
|
+
"origSize": 32,
|
|
827
827
|
"renderedExports": [],
|
|
828
828
|
"removedExports": [],
|
|
829
|
-
"dependents": [
|
|
830
|
-
"/src/adapters/ws.ts"
|
|
831
|
-
],
|
|
829
|
+
"dependents": [],
|
|
832
830
|
"percent": 0,
|
|
833
831
|
"reduction": 100
|
|
834
832
|
},
|
|
835
833
|
{
|
|
836
|
-
"id": "/src/
|
|
834
|
+
"id": "/src/http.ts",
|
|
837
835
|
"size": 0,
|
|
838
|
-
"origSize":
|
|
836
|
+
"origSize": 37,
|
|
839
837
|
"renderedExports": [],
|
|
840
838
|
"removedExports": [],
|
|
841
|
-
"dependents": [
|
|
839
|
+
"dependents": [
|
|
840
|
+
"/src/adapters/ws.ts"
|
|
841
|
+
],
|
|
842
842
|
"percent": 0,
|
|
843
843
|
"reduction": 100
|
|
844
844
|
},
|
|
@@ -912,16 +912,6 @@
|
|
|
912
912
|
"percent": 0,
|
|
913
913
|
"reduction": 100
|
|
914
914
|
},
|
|
915
|
-
{
|
|
916
|
-
"id": "/src/adapters/fetch/index.ts",
|
|
917
|
-
"size": 0,
|
|
918
|
-
"origSize": 64,
|
|
919
|
-
"renderedExports": [],
|
|
920
|
-
"removedExports": [],
|
|
921
|
-
"dependents": [],
|
|
922
|
-
"percent": 0,
|
|
923
|
-
"reduction": 100
|
|
924
|
-
},
|
|
925
915
|
{
|
|
926
916
|
"id": "/src/adapters/node-http/index.ts",
|
|
927
917
|
"size": 0,
|
|
@@ -937,6 +927,16 @@
|
|
|
937
927
|
],
|
|
938
928
|
"percent": 0,
|
|
939
929
|
"reduction": 100
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
"id": "/src/adapters/fetch/index.ts",
|
|
933
|
+
"size": 0,
|
|
934
|
+
"origSize": 64,
|
|
935
|
+
"renderedExports": [],
|
|
936
|
+
"removedExports": [],
|
|
937
|
+
"dependents": [],
|
|
938
|
+
"percent": 0,
|
|
939
|
+
"reduction": 100
|
|
940
940
|
}
|
|
941
941
|
],
|
|
942
942
|
"moduleCount": 61
|
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.692+fd2342add",
|
|
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": "fd2342add3de8f6956459182154d49686c523b06"
|
|
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);
|