@trpc/server 11.0.0-rc.619 → 11.0.0-rc.621

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 +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,uBAAwB,SAAQ,IAAI,CAAC,eAAe;IACnE;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAiED,wBAAgB,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,GAAG,GAAG,CAkBxD;AAwBD;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,IAAI,EAAE;IACJ;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GACA,OAAO,CA6BT"}
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,uBAAwB,SAAQ,IAAI,CAAC,eAAe;IACnE;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAiED,wBAAgB,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,GAAG,GAAG,CAkBxD;AAwBD;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,IAAI,EAAE;IACJ;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,GACA,OAAO,CAkCT"}
@@ -84,9 +84,13 @@ function createHeaders(incoming) {
84
84
  * Convert an [`IncomingMessage`](https://nodejs.org/api/http.html#class-httpincomingmessage) to a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request)
85
85
  */ function incomingMessageToRequest(req, opts) {
86
86
  const ac = new AbortController();
87
- req.once('aborted', ()=>{
87
+ const onAbort = ()=>{
88
88
  ac.abort();
89
- });
89
+ req.off('aborted', onAbort);
90
+ req.off('close', onAbort);
91
+ };
92
+ req.once('aborted', onAbort);
93
+ req.socket?.once('close', onAbort);
90
94
  // Get host from either regular header or HTTP/2 pseudo-header
91
95
  const url = createURL(req);
92
96
  const init = {
@@ -82,9 +82,13 @@ function createHeaders(incoming) {
82
82
  * Convert an [`IncomingMessage`](https://nodejs.org/api/http.html#class-httpincomingmessage) to a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request)
83
83
  */ function incomingMessageToRequest(req, opts) {
84
84
  const ac = new AbortController();
85
- req.once('aborted', ()=>{
85
+ const onAbort = ()=>{
86
86
  ac.abort();
87
- });
87
+ req.off('aborted', onAbort);
88
+ req.off('close', onAbort);
89
+ };
90
+ req.once('aborted', onAbort);
91
+ req.socket?.once('close', onAbort);
88
92
  // Get host from either regular header or HTTP/2 pseudo-header
89
93
  const url = createURL(req);
90
94
  const init = {
@@ -1,7 +1,7 @@
1
1
  {
2
- "bundleSize": 164337,
3
- "bundleOrigSize": 214888,
4
- "bundleReduction": 23.52,
2
+ "bundleSize": 164478,
3
+ "bundleOrigSize": 215018,
4
+ "bundleReduction": 23.51,
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": 13.17,
17
+ "percent": 13.16,
18
18
  "reduction": 0
19
19
  },
20
20
  {
@@ -47,7 +47,7 @@
47
47
  "dependents": [
48
48
  "/src/adapters/fastify/fastifyTRPCPlugin.ts"
49
49
  ],
50
- "percent": 10.22,
50
+ "percent": 10.21,
51
51
  "reduction": 0
52
52
  },
53
53
  {
@@ -60,7 +60,7 @@
60
60
  ],
61
61
  "removedExports": [],
62
62
  "dependents": [],
63
- "percent": 7.08,
63
+ "percent": 7.07,
64
64
  "reduction": 15.45
65
65
  },
66
66
  {
@@ -75,7 +75,7 @@
75
75
  "/src/unstable-core-do-not-import.ts",
76
76
  "/src/unstable-core-do-not-import/http/resolveResponse.ts"
77
77
  ],
78
- "percent": 4.68,
78
+ "percent": 4.67,
79
79
  "reduction": 0
80
80
  },
81
81
  {
@@ -110,7 +110,7 @@
110
110
  "/src/unstable-core-do-not-import.ts",
111
111
  "/src/unstable-core-do-not-import/initTRPC.ts"
112
112
  ],
113
- "percent": 3.91,
113
+ "percent": 3.9,
114
114
  "reduction": 39.85
115
115
  },
116
116
  {
@@ -125,7 +125,7 @@
125
125
  "/src/unstable-core-do-not-import.ts",
126
126
  "/src/unstable-core-do-not-import/initTRPC.ts"
127
127
  ],
128
- "percent": 3.53,
128
+ "percent": 3.52,
129
129
  "reduction": 64.96
130
130
  },
131
131
  {
@@ -139,7 +139,7 @@
139
139
  "dependents": [
140
140
  "/src/adapters/aws-lambda/index.ts"
141
141
  ],
142
- "percent": 3.3,
142
+ "percent": 3.29,
143
143
  "reduction": 11.44
144
144
  },
145
145
  {
@@ -174,7 +174,7 @@
174
174
  "dependents": [
175
175
  "/src/adapters/node-http/index.ts"
176
176
  ],
177
- "percent": 2.72,
177
+ "percent": 2.71,
178
178
  "reduction": 2.49
179
179
  },
180
180
  {
@@ -197,8 +197,8 @@
197
197
  },
198
198
  {
199
199
  "id": "/src/adapters/node-http/incomingMessageToRequest.ts",
200
- "size": 3665,
201
- "origSize": 4172,
200
+ "size": 3806,
201
+ "origSize": 4302,
202
202
  "renderedExports": [
203
203
  "createURL",
204
204
  "incomingMessageToRequest"
@@ -208,8 +208,8 @@
208
208
  "/src/adapters/node-http/index.ts",
209
209
  "/src/adapters/node-http/nodeHTTPRequestHandler.ts"
210
210
  ],
211
- "percent": 2.23,
212
- "reduction": 12.15
211
+ "percent": 2.31,
212
+ "reduction": 11.53
213
213
  },
214
214
  {
215
215
  "id": "/src/adapters/next-app-dir/nextAppDirCaller.ts",
@@ -529,7 +529,7 @@
529
529
  "dependents": [
530
530
  "/src/unstable-core-do-not-import.ts"
531
531
  ],
532
- "percent": 0.65,
532
+ "percent": 0.64,
533
533
  "reduction": 0
534
534
  },
535
535
  {
@@ -807,9 +807,9 @@
807
807
  "reduction": 100
808
808
  },
809
809
  {
810
- "id": "/src/shared.ts",
810
+ "id": "/src/rpc.ts",
811
811
  "size": 0,
812
- "origSize": 653,
812
+ "origSize": 36,
813
813
  "renderedExports": [],
814
814
  "removedExports": [],
815
815
  "dependents": [],
@@ -817,9 +817,9 @@
817
817
  "reduction": 100
818
818
  },
819
819
  {
820
- "id": "/src/rpc.ts",
820
+ "id": "/src/shared.ts",
821
821
  "size": 0,
822
- "origSize": 36,
822
+ "origSize": 653,
823
823
  "renderedExports": [],
824
824
  "removedExports": [],
825
825
  "dependents": [],
@@ -834,11 +834,11 @@
834
834
  "removedExports": [],
835
835
  "dependents": [
836
836
  "/src/adapters/express.ts",
837
+ "/src/adapters/ws.ts",
837
838
  "/src/adapters/next.ts",
838
839
  "/src/adapters/standalone.ts",
839
- "/src/adapters/ws.ts",
840
- "/src/adapters/next-app-dir/nextAppDirCaller.ts",
841
- "/src/adapters/node-http/nodeHTTPRequestHandler.ts"
840
+ "/src/adapters/node-http/nodeHTTPRequestHandler.ts",
841
+ "/src/adapters/next-app-dir/nextAppDirCaller.ts"
842
842
  ],
843
843
  "percent": 0,
844
844
  "reduction": 100
@@ -893,9 +893,9 @@
893
893
  "removedExports": [],
894
894
  "dependents": [
895
895
  "/src/adapters/express.ts",
896
+ "/src/adapters/ws.ts",
896
897
  "/src/adapters/next.ts",
897
898
  "/src/adapters/standalone.ts",
898
- "/src/adapters/ws.ts",
899
899
  "/src/adapters/fastify/fastifyRequestHandler.ts"
900
900
  ],
901
901
  "percent": 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/server",
3
- "version": "11.0.0-rc.619+0f06947e0",
3
+ "version": "11.0.0-rc.621+87fde6297",
4
4
  "description": "The tRPC server library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -149,5 +149,5 @@
149
149
  "funding": [
150
150
  "https://trpc.io/sponsor"
151
151
  ],
152
- "gitHead": "0f06947e0801db7f9cb236d4018dc4dfe34dcedd"
152
+ "gitHead": "87fde62978441b1cedd1d5cf7290f6ade9a92607"
153
153
  }
@@ -126,9 +126,14 @@ export function incomingMessageToRequest(
126
126
  },
127
127
  ): Request {
128
128
  const ac = new AbortController();
129
- req.once('aborted', () => {
129
+
130
+ const onAbort = () => {
130
131
  ac.abort();
131
- });
132
+ req.off('aborted', onAbort);
133
+ req.off('close', onAbort);
134
+ };
135
+ req.once('aborted', onAbort);
136
+ req.socket?.once('close', onAbort);
132
137
 
133
138
  // Get host from either regular header or HTTP/2 pseudo-header
134
139
  const url = createURL(req);