@trpc/server 11.0.0-rc.682 → 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 +44 -44
- package/dist/unstable-core-do-not-import/stream/sse.d.ts +1 -1
- package/dist/unstable-core-do-not-import/stream/sse.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/stream/sse.js +1 -1
- package/dist/unstable-core-do-not-import/stream/sse.mjs +1 -1
- package/package.json +2 -2
- package/src/adapters/node-http/incomingMessageToRequest.ts +5 -3
- package/src/unstable-core-do-not-import/stream/sse.ts +22 -19
|
@@ -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",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependents": [
|
|
32
32
|
"/src/unstable-core-do-not-import.ts"
|
|
33
33
|
],
|
|
34
|
-
"percent": 11.
|
|
34
|
+
"percent": 11.28,
|
|
35
35
|
"reduction": 0
|
|
36
36
|
},
|
|
37
37
|
{
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
"id": "/src/unstable-core-do-not-import/stream/sse.ts",
|
|
55
|
-
"size":
|
|
56
|
-
"origSize":
|
|
55
|
+
"size": 12627,
|
|
56
|
+
"origSize": 12452,
|
|
57
57
|
"renderedExports": [
|
|
58
58
|
"sseStreamProducer",
|
|
59
59
|
"sseStreamConsumer",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"/src/unstable-core-do-not-import.ts",
|
|
65
65
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
66
66
|
],
|
|
67
|
-
"percent": 6.
|
|
67
|
+
"percent": 6.74,
|
|
68
68
|
"reduction": 0
|
|
69
69
|
},
|
|
70
70
|
{
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"/src/unstable-core-do-not-import.ts",
|
|
93
93
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
94
94
|
],
|
|
95
|
-
"percent": 4.
|
|
95
|
+
"percent": 4.1,
|
|
96
96
|
"reduction": 0
|
|
97
97
|
},
|
|
98
98
|
{
|
|
@@ -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,31 +821,31 @@
|
|
|
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
|
},
|
|
845
845
|
{
|
|
846
|
-
"id": "/src/
|
|
846
|
+
"id": "/src/rpc.ts",
|
|
847
847
|
"size": 0,
|
|
848
|
-
"origSize":
|
|
848
|
+
"origSize": 36,
|
|
849
849
|
"renderedExports": [],
|
|
850
850
|
"removedExports": [],
|
|
851
851
|
"dependents": [],
|
|
@@ -853,9 +853,9 @@
|
|
|
853
853
|
"reduction": 100
|
|
854
854
|
},
|
|
855
855
|
{
|
|
856
|
-
"id": "/src/
|
|
856
|
+
"id": "/src/shared.ts",
|
|
857
857
|
"size": 0,
|
|
858
|
-
"origSize":
|
|
858
|
+
"origSize": 653,
|
|
859
859
|
"renderedExports": [],
|
|
860
860
|
"removedExports": [],
|
|
861
861
|
"dependents": [],
|
|
@@ -870,8 +870,8 @@
|
|
|
870
870
|
"removedExports": [],
|
|
871
871
|
"dependents": [
|
|
872
872
|
"/src/adapters/express.ts",
|
|
873
|
-
"/src/adapters/standalone.ts",
|
|
874
873
|
"/src/adapters/next.ts",
|
|
874
|
+
"/src/adapters/standalone.ts",
|
|
875
875
|
"/src/adapters/ws.ts",
|
|
876
876
|
"/src/adapters/node-http/nodeHTTPRequestHandler.ts",
|
|
877
877
|
"/src/adapters/next-app-dir/nextAppDirCaller.ts",
|
|
@@ -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,
|
|
@@ -930,13 +920,23 @@
|
|
|
930
920
|
"removedExports": [],
|
|
931
921
|
"dependents": [
|
|
932
922
|
"/src/adapters/express.ts",
|
|
933
|
-
"/src/adapters/standalone.ts",
|
|
934
923
|
"/src/adapters/next.ts",
|
|
924
|
+
"/src/adapters/standalone.ts",
|
|
935
925
|
"/src/adapters/ws.ts",
|
|
936
926
|
"/src/adapters/fastify/fastifyRequestHandler.ts"
|
|
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
|
|
@@ -54,7 +54,7 @@ export interface SSEStreamProducerOptions<TValue = unknown> {
|
|
|
54
54
|
*
|
|
55
55
|
* @see https://html.spec.whatwg.org/multipage/server-sent-events.html
|
|
56
56
|
*/
|
|
57
|
-
export declare function sseStreamProducer<TValue = unknown>(opts: SSEStreamProducerOptions<TValue>): ReadableStream<
|
|
57
|
+
export declare function sseStreamProducer<TValue = unknown>(opts: SSEStreamProducerOptions<TValue>): ReadableStream<Uint8Array<ArrayBufferLike>>;
|
|
58
58
|
interface ConsumerStreamResultBase<TConfig extends ConsumerConfig> {
|
|
59
59
|
eventSource: InstanceType<TConfig['EventSource']> | null;
|
|
60
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/stream/sse.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAWpD,KAAK,SAAS,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;AACrC,KAAK,WAAW,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,MAAM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aAAa,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAiK9C;AAED,eAAO,MAAM,UAAU;;;;;CAKb,CAAC"}
|
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);
|
|
@@ -176,27 +176,30 @@ export function sseStreamProducer<TValue = unknown>(
|
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
+
|
|
179
180
|
const stream = readableStreamFrom(generatorWithErrorHandling());
|
|
180
181
|
|
|
181
|
-
return stream
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
182
|
+
return stream
|
|
183
|
+
.pipeThrough(
|
|
184
|
+
new TransformStream({
|
|
185
|
+
transform(chunk, controller: TransformStreamDefaultController<string>) {
|
|
186
|
+
if ('event' in chunk) {
|
|
187
|
+
controller.enqueue(`event: ${chunk.event}\n`);
|
|
188
|
+
}
|
|
189
|
+
if ('data' in chunk) {
|
|
190
|
+
controller.enqueue(`data: ${chunk.data}\n`);
|
|
191
|
+
}
|
|
192
|
+
if ('id' in chunk) {
|
|
193
|
+
controller.enqueue(`id: ${chunk.id}\n`);
|
|
194
|
+
}
|
|
195
|
+
if ('comment' in chunk) {
|
|
196
|
+
controller.enqueue(`: ${chunk.comment}\n`);
|
|
197
|
+
}
|
|
198
|
+
controller.enqueue('\n\n');
|
|
199
|
+
},
|
|
200
|
+
}),
|
|
201
|
+
)
|
|
202
|
+
.pipeThrough(new TextEncoderStream());
|
|
200
203
|
}
|
|
201
204
|
|
|
202
205
|
interface ConsumerStreamResultBase<TConfig extends ConsumerConfig> {
|