@trpc/server 11.0.0-rc.452 → 11.0.0-rc.456
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/nodeHTTPRequestHandler.d.ts.map +1 -1
- package/dist/adapters/node-http/nodeHTTPRequestHandler.js +3 -1
- package/dist/adapters/node-http/nodeHTTPRequestHandler.mjs +3 -1
- package/dist/adapters/ws.d.ts.map +1 -1
- package/dist/adapters/ws.js +4 -1
- package/dist/adapters/ws.mjs +4 -1
- package/dist/bundle-analysis.json +107 -106
- package/dist/observable/observable.d.ts +1 -4
- package/dist/observable/observable.d.ts.map +1 -1
- package/dist/observable/observable.js +6 -18
- package/dist/observable/observable.mjs +6 -18
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts +1 -1
- package/dist/unstable-core-do-not-import/error/TRPCError.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/http/contentType.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/http/contentType.js +6 -3
- package/dist/unstable-core-do-not-import/http/contentType.mjs +6 -3
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.js +5 -2
- package/dist/unstable-core-do-not-import/http/getHTTPStatusCode.mjs +5 -2
- package/dist/unstable-core-do-not-import/http/types.d.ts +5 -0
- package/dist/unstable-core-do-not-import/http/types.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts +4 -1
- package/dist/unstable-core-do-not-import/rpc/codes.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/rpc/codes.js +4 -1
- package/dist/unstable-core-do-not-import/rpc/codes.mjs +4 -1
- package/dist/unstable-core-do-not-import/stream/jsonl.d.ts +8 -3
- package/dist/unstable-core-do-not-import/stream/jsonl.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/stream/jsonl.js +66 -32
- package/dist/unstable-core-do-not-import/stream/jsonl.mjs +66 -32
- package/dist/unstable-core-do-not-import/stream/utils/createServer.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import.d.ts +1 -0
- package/dist/unstable-core-do-not-import.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import.js +3 -0
- package/dist/unstable-core-do-not-import.mjs +1 -0
- package/package.json +2 -2
- package/src/adapters/node-http/nodeHTTPRequestHandler.ts +3 -1
- package/src/adapters/ws.ts +3 -0
- package/src/observable/observable.ts +6 -19
- package/src/unstable-core-do-not-import/http/contentType.ts +3 -0
- package/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts +4 -1
- package/src/unstable-core-do-not-import/http/types.ts +5 -0
- package/src/unstable-core-do-not-import/rpc/codes.ts +6 -3
- package/src/unstable-core-do-not-import/stream/jsonl.ts +88 -43
- package/src/unstable-core-do-not-import/stream/utils/createServer.ts +1 -3
- package/src/unstable-core-do-not-import.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeHTTPRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/node-http/nodeHTTPRequestHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI7E,OAAO,KAAK,EACV,eAAe,EACf,6BAA6B,EAC7B,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB,wBAAsB,sBAAsB,CAC1C,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,eAAe,EAChC,SAAS,SAAS,gBAAgB,EAClC,IAAI,EAAE,6BAA6B,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"nodeHTTPRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/adapters/node-http/nodeHTTPRequestHandler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI7E,OAAO,KAAK,EACV,eAAe,EACf,6BAA6B,EAC7B,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB,wBAAsB,sBAAsB,CAC1C,OAAO,SAAS,SAAS,EACzB,QAAQ,SAAS,eAAe,EAChC,SAAS,SAAS,gBAAgB,EAClC,IAAI,EAAE,6BAA6B,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,iBAwElE"}
|
|
@@ -55,7 +55,9 @@ async function nodeHTTPRequestHandler(opts) {
|
|
|
55
55
|
// console.error('reader.cancel() error', err);
|
|
56
56
|
});
|
|
57
57
|
};
|
|
58
|
-
req.signal.addEventListener('abort', onAbort
|
|
58
|
+
req.signal.addEventListener('abort', onAbort, {
|
|
59
|
+
once: true
|
|
60
|
+
});
|
|
59
61
|
while(true){
|
|
60
62
|
const { done , value: value1 } = await reader.read();
|
|
61
63
|
if (done) {
|
|
@@ -53,7 +53,9 @@ async function nodeHTTPRequestHandler(opts) {
|
|
|
53
53
|
// console.error('reader.cancel() error', err);
|
|
54
54
|
});
|
|
55
55
|
};
|
|
56
|
-
req.signal.addEventListener('abort', onAbort
|
|
56
|
+
req.signal.addEventListener('abort', onAbort, {
|
|
57
|
+
once: true
|
|
58
|
+
});
|
|
57
59
|
while(true){
|
|
58
60
|
const { done , value: value1 } = await reader.read();
|
|
59
61
|
if (done) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws.d.ts","sourceRoot":"","sources":["../../src/adapters/ws.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EACV,SAAS,EACT,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AASzB,OAAO,EAAS,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAatE,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,gCAAgC,CAAC;AACxC,OAAO,K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C;;EA+BjC"}
|
package/dist/adapters/ws.js
CHANGED
|
@@ -21,6 +21,7 @@ function getWSConnectionHandler(opts) {
|
|
|
21
21
|
const { transformer: transformer$1 } = router$1._def._config;
|
|
22
22
|
return async (client, req)=>{
|
|
23
23
|
const clientSubscriptions = new Map();
|
|
24
|
+
const abortController = new AbortController();
|
|
24
25
|
function respond(untransformedJSON) {
|
|
25
26
|
client.send(JSON.stringify(transformer.transformTRPCResponse(router$1._def._config, untransformedJSON)));
|
|
26
27
|
}
|
|
@@ -34,7 +35,8 @@ function getWSConnectionHandler(opts) {
|
|
|
34
35
|
calls: [],
|
|
35
36
|
isBatchCall: false,
|
|
36
37
|
accept: null,
|
|
37
|
-
type: 'unknown'
|
|
38
|
+
type: 'unknown',
|
|
39
|
+
signal: abortController.signal
|
|
38
40
|
}
|
|
39
41
|
});
|
|
40
42
|
return ctx;
|
|
@@ -310,6 +312,7 @@ function getWSConnectionHandler(opts) {
|
|
|
310
312
|
sub.abort();
|
|
311
313
|
}
|
|
312
314
|
clientSubscriptions.clear();
|
|
315
|
+
abortController.abort();
|
|
313
316
|
});
|
|
314
317
|
if (ctxPromise !== unsetContextSymbol) {
|
|
315
318
|
// prevent unhandled promise rejection errors
|
package/dist/adapters/ws.mjs
CHANGED
|
@@ -19,6 +19,7 @@ function getWSConnectionHandler(opts) {
|
|
|
19
19
|
const { transformer } = router._def._config;
|
|
20
20
|
return async (client, req)=>{
|
|
21
21
|
const clientSubscriptions = new Map();
|
|
22
|
+
const abortController = new AbortController();
|
|
22
23
|
function respond(untransformedJSON) {
|
|
23
24
|
client.send(JSON.stringify(transformTRPCResponse(router._def._config, untransformedJSON)));
|
|
24
25
|
}
|
|
@@ -32,7 +33,8 @@ function getWSConnectionHandler(opts) {
|
|
|
32
33
|
calls: [],
|
|
33
34
|
isBatchCall: false,
|
|
34
35
|
accept: null,
|
|
35
|
-
type: 'unknown'
|
|
36
|
+
type: 'unknown',
|
|
37
|
+
signal: abortController.signal
|
|
36
38
|
}
|
|
37
39
|
});
|
|
38
40
|
return ctx;
|
|
@@ -308,6 +310,7 @@ function getWSConnectionHandler(opts) {
|
|
|
308
310
|
sub.abort();
|
|
309
311
|
}
|
|
310
312
|
clientSubscriptions.clear();
|
|
313
|
+
abortController.abort();
|
|
311
314
|
});
|
|
312
315
|
if (ctxPromise !== unsetContextSymbol) {
|
|
313
316
|
// prevent unhandled promise rejection errors
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 27.
|
|
2
|
+
"bundleSize": 131618,
|
|
3
|
+
"bundleOrigSize": 181007,
|
|
4
|
+
"bundleReduction": 27.29,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
|
-
"id": "/src/unstable-core-do-not-import/
|
|
8
|
-
"size":
|
|
9
|
-
"origSize":
|
|
7
|
+
"id": "/src/unstable-core-do-not-import/stream/jsonl.ts",
|
|
8
|
+
"size": 17337,
|
|
9
|
+
"origSize": 18100,
|
|
10
10
|
"renderedExports": [
|
|
11
|
-
"
|
|
11
|
+
"isPromise",
|
|
12
|
+
"jsonlStreamProducer",
|
|
13
|
+
"jsonlStreamConsumer"
|
|
12
14
|
],
|
|
13
15
|
"removedExports": [],
|
|
14
16
|
"dependents": [
|
|
15
|
-
"/src/unstable-core-do-not-import.ts"
|
|
17
|
+
"/src/unstable-core-do-not-import.ts",
|
|
18
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
16
19
|
],
|
|
17
|
-
"percent": 13.
|
|
18
|
-
"reduction":
|
|
20
|
+
"percent": 13.17,
|
|
21
|
+
"reduction": 4.22
|
|
19
22
|
},
|
|
20
23
|
{
|
|
21
|
-
"id": "/src/unstable-core-do-not-import/
|
|
22
|
-
"size":
|
|
23
|
-
"origSize":
|
|
24
|
+
"id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
25
|
+
"size": 17157,
|
|
26
|
+
"origSize": 16294,
|
|
24
27
|
"renderedExports": [
|
|
25
|
-
"
|
|
26
|
-
"jsonlStreamProducer",
|
|
27
|
-
"jsonlStreamConsumer"
|
|
28
|
+
"resolveResponse"
|
|
28
29
|
],
|
|
29
30
|
"removedExports": [],
|
|
30
31
|
"dependents": [
|
|
31
|
-
"/src/unstable-core-do-not-import.ts"
|
|
32
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
32
|
+
"/src/unstable-core-do-not-import.ts"
|
|
33
33
|
],
|
|
34
|
-
"percent":
|
|
35
|
-
"reduction":
|
|
34
|
+
"percent": 13.04,
|
|
35
|
+
"reduction": 0
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"id": "/src/adapters/ws.ts",
|
|
39
|
-
"size":
|
|
40
|
-
"origSize":
|
|
39
|
+
"size": 14422,
|
|
40
|
+
"origSize": 13640,
|
|
41
41
|
"renderedExports": [
|
|
42
42
|
"getWSConnectionHandler",
|
|
43
43
|
"applyWSSHandler"
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"dependents": [
|
|
47
47
|
"/src/adapters/fastify/fastifyTRPCPlugin.ts"
|
|
48
48
|
],
|
|
49
|
-
"percent": 10.
|
|
49
|
+
"percent": 10.96,
|
|
50
50
|
"reduction": 0
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
"id": "/src/unstable-core-do-not-import/http/contentType.ts",
|
|
54
|
-
"size":
|
|
55
|
-
"origSize":
|
|
54
|
+
"size": 7688,
|
|
55
|
+
"origSize": 7608,
|
|
56
56
|
"renderedExports": [
|
|
57
57
|
"getRequestInfo"
|
|
58
58
|
],
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"/src/unstable-core-do-not-import.ts",
|
|
62
62
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
63
63
|
],
|
|
64
|
-
"percent": 5.
|
|
64
|
+
"percent": 5.84,
|
|
65
65
|
"reduction": 0
|
|
66
66
|
},
|
|
67
67
|
{
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"/src/unstable-core-do-not-import.ts",
|
|
80
80
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
81
81
|
],
|
|
82
|
-
"percent": 4.
|
|
82
|
+
"percent": 4.85,
|
|
83
83
|
"reduction": 39.77
|
|
84
84
|
},
|
|
85
85
|
{
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"/src/unstable-core-do-not-import.ts",
|
|
95
95
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
96
96
|
],
|
|
97
|
-
"percent": 4.
|
|
97
|
+
"percent": 4.81,
|
|
98
98
|
"reduction": 60.06
|
|
99
99
|
},
|
|
100
100
|
{
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"/src/unstable-core-do-not-import.ts",
|
|
114
114
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
115
115
|
],
|
|
116
|
-
"percent": 4.
|
|
116
|
+
"percent": 4.28,
|
|
117
117
|
"reduction": 24.48
|
|
118
118
|
},
|
|
119
119
|
{
|
|
@@ -127,13 +127,13 @@
|
|
|
127
127
|
"dependents": [
|
|
128
128
|
"/src/adapters/aws-lambda/index.ts"
|
|
129
129
|
],
|
|
130
|
-
"percent": 4.
|
|
130
|
+
"percent": 4.12,
|
|
131
131
|
"reduction": 11.38
|
|
132
132
|
},
|
|
133
133
|
{
|
|
134
134
|
"id": "/src/observable/observable.ts",
|
|
135
|
-
"size":
|
|
136
|
-
"origSize":
|
|
135
|
+
"size": 4116,
|
|
136
|
+
"origSize": 4093,
|
|
137
137
|
"renderedExports": [
|
|
138
138
|
"isObservable",
|
|
139
139
|
"observable",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
148
148
|
"/src/observable/operators.ts"
|
|
149
149
|
],
|
|
150
|
-
"percent": 3.
|
|
150
|
+
"percent": 3.13,
|
|
151
151
|
"reduction": 0
|
|
152
152
|
},
|
|
153
153
|
{
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
"dependents": [
|
|
162
162
|
"/src/adapters/next-app-dir.ts"
|
|
163
163
|
],
|
|
164
|
-
"percent": 2.
|
|
164
|
+
"percent": 2.38,
|
|
165
165
|
"reduction": 23.5
|
|
166
166
|
},
|
|
167
167
|
{
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
"dependents": [
|
|
178
178
|
"/src/observable/index.ts"
|
|
179
179
|
],
|
|
180
|
-
"percent": 2.
|
|
180
|
+
"percent": 2.09,
|
|
181
181
|
"reduction": 0
|
|
182
182
|
},
|
|
183
183
|
{
|
|
@@ -193,40 +193,40 @@
|
|
|
193
193
|
"removedExports": [],
|
|
194
194
|
"dependents": [
|
|
195
195
|
"/src/unstable-core-do-not-import.ts",
|
|
196
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
196
197
|
"/src/unstable-core-do-not-import/initTRPC.ts",
|
|
197
|
-
"/src/unstable-core-do-not-import/router.ts"
|
|
198
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
198
|
+
"/src/unstable-core-do-not-import/router.ts"
|
|
199
199
|
],
|
|
200
|
-
"percent": 2.
|
|
200
|
+
"percent": 2.08,
|
|
201
201
|
"reduction": 45.94
|
|
202
202
|
},
|
|
203
203
|
{
|
|
204
|
-
"id": "/src/
|
|
205
|
-
"size":
|
|
206
|
-
"origSize":
|
|
204
|
+
"id": "/src/adapters/node-http/nodeHTTPRequestHandler.ts",
|
|
205
|
+
"size": 2732,
|
|
206
|
+
"origSize": 2931,
|
|
207
207
|
"renderedExports": [
|
|
208
|
-
"
|
|
208
|
+
"nodeHTTPRequestHandler"
|
|
209
209
|
],
|
|
210
210
|
"removedExports": [],
|
|
211
211
|
"dependents": [
|
|
212
|
-
"/src/
|
|
212
|
+
"/src/adapters/node-http/index.ts"
|
|
213
213
|
],
|
|
214
214
|
"percent": 2.08,
|
|
215
|
-
"reduction":
|
|
215
|
+
"reduction": 6.79
|
|
216
216
|
},
|
|
217
217
|
{
|
|
218
|
-
"id": "/src/
|
|
219
|
-
"size":
|
|
220
|
-
"origSize":
|
|
218
|
+
"id": "/src/unstable-core-do-not-import/initTRPC.ts",
|
|
219
|
+
"size": 2704,
|
|
220
|
+
"origSize": 4576,
|
|
221
221
|
"renderedExports": [
|
|
222
|
-
"
|
|
222
|
+
"initTRPC"
|
|
223
223
|
],
|
|
224
224
|
"removedExports": [],
|
|
225
225
|
"dependents": [
|
|
226
|
-
"/src/
|
|
226
|
+
"/src/unstable-core-do-not-import.ts"
|
|
227
227
|
],
|
|
228
|
-
"percent": 2.
|
|
229
|
-
"reduction":
|
|
228
|
+
"percent": 2.05,
|
|
229
|
+
"reduction": 40.91
|
|
230
230
|
},
|
|
231
231
|
{
|
|
232
232
|
"id": "/src/unstable-core-do-not-import/middleware.ts",
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
"/src/unstable-core-do-not-import/initTRPC.ts",
|
|
246
246
|
"/src/unstable-core-do-not-import/procedureBuilder.ts"
|
|
247
247
|
],
|
|
248
|
-
"percent": 2
|
|
248
|
+
"percent": 2,
|
|
249
249
|
"reduction": 55.5
|
|
250
250
|
},
|
|
251
251
|
{
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
"/src/unstable-core-do-not-import.ts",
|
|
262
262
|
"/src/unstable-core-do-not-import/router.ts"
|
|
263
263
|
],
|
|
264
|
-
"percent": 1.
|
|
264
|
+
"percent": 1.77,
|
|
265
265
|
"reduction": 0
|
|
266
266
|
},
|
|
267
267
|
{
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
"dependents": [
|
|
276
276
|
"/src/adapters/fetch/index.ts"
|
|
277
277
|
],
|
|
278
|
-
"percent": 1.
|
|
278
|
+
"percent": 1.71,
|
|
279
279
|
"reduction": 2.17
|
|
280
280
|
},
|
|
281
281
|
{
|
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"/src/adapters/node-http/index.ts",
|
|
291
291
|
"/src/adapters/node-http/nodeHTTPRequestHandler.ts"
|
|
292
292
|
],
|
|
293
|
-
"percent": 1.
|
|
293
|
+
"percent": 1.67,
|
|
294
294
|
"reduction": 13.79
|
|
295
295
|
},
|
|
296
296
|
{
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
"dependents": [
|
|
305
305
|
"/src/adapters/next-app-dir/nextAppDirCaller.ts"
|
|
306
306
|
],
|
|
307
|
-
"percent": 1.
|
|
307
|
+
"percent": 1.56,
|
|
308
308
|
"reduction": 5.79
|
|
309
309
|
},
|
|
310
310
|
{
|
|
@@ -319,18 +319,31 @@
|
|
|
319
319
|
"removedExports": [],
|
|
320
320
|
"dependents": [
|
|
321
321
|
"/src/unstable-core-do-not-import.ts",
|
|
322
|
+
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
323
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
322
324
|
"/src/unstable-core-do-not-import/stream/sse.ts",
|
|
323
325
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
324
326
|
"/src/unstable-core-do-not-import/router.ts",
|
|
325
|
-
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
326
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
327
327
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
328
328
|
"/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
329
329
|
"/src/unstable-core-do-not-import/stream/jsonl.ts"
|
|
330
330
|
],
|
|
331
|
-
"percent": 1.
|
|
331
|
+
"percent": 1.32,
|
|
332
332
|
"reduction": 19.47
|
|
333
333
|
},
|
|
334
|
+
{
|
|
335
|
+
"id": "/src/unstable-core-do-not-import/rpc/codes.ts",
|
|
336
|
+
"size": 1611,
|
|
337
|
+
"origSize": 2221,
|
|
338
|
+
"renderedExports": [
|
|
339
|
+
"TRPC_ERROR_CODES_BY_KEY",
|
|
340
|
+
"TRPC_ERROR_CODES_BY_NUMBER"
|
|
341
|
+
],
|
|
342
|
+
"removedExports": [],
|
|
343
|
+
"dependents": [],
|
|
344
|
+
"percent": 1.22,
|
|
345
|
+
"reduction": 27.47
|
|
346
|
+
},
|
|
334
347
|
{
|
|
335
348
|
"id": "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
336
349
|
"size": 1580,
|
|
@@ -340,7 +353,7 @@
|
|
|
340
353
|
],
|
|
341
354
|
"removedExports": [],
|
|
342
355
|
"dependents": [],
|
|
343
|
-
"percent": 1.
|
|
356
|
+
"percent": 1.2,
|
|
344
357
|
"reduction": 21.04
|
|
345
358
|
},
|
|
346
359
|
{
|
|
@@ -352,21 +365,8 @@
|
|
|
352
365
|
],
|
|
353
366
|
"removedExports": [],
|
|
354
367
|
"dependents": [],
|
|
355
|
-
"percent": 1.19,
|
|
356
|
-
"reduction": 26.94
|
|
357
|
-
},
|
|
358
|
-
{
|
|
359
|
-
"id": "/src/unstable-core-do-not-import/rpc/codes.ts",
|
|
360
|
-
"size": 1524,
|
|
361
|
-
"origSize": 2105,
|
|
362
|
-
"renderedExports": [
|
|
363
|
-
"TRPC_ERROR_CODES_BY_KEY",
|
|
364
|
-
"TRPC_ERROR_CODES_BY_NUMBER"
|
|
365
|
-
],
|
|
366
|
-
"removedExports": [],
|
|
367
|
-
"dependents": [],
|
|
368
368
|
"percent": 1.17,
|
|
369
|
-
"reduction":
|
|
369
|
+
"reduction": 26.94
|
|
370
370
|
},
|
|
371
371
|
{
|
|
372
372
|
"id": "/src/adapters/fastify/fastifyTRPCPlugin.ts",
|
|
@@ -379,13 +379,13 @@
|
|
|
379
379
|
"dependents": [
|
|
380
380
|
"/src/adapters/fastify/index.ts"
|
|
381
381
|
],
|
|
382
|
-
"percent": 1.
|
|
382
|
+
"percent": 1.14,
|
|
383
383
|
"reduction": 34.7
|
|
384
384
|
},
|
|
385
385
|
{
|
|
386
386
|
"id": "/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
|
|
387
|
-
"size":
|
|
388
|
-
"origSize":
|
|
387
|
+
"size": 1365,
|
|
388
|
+
"origSize": 1655,
|
|
389
389
|
"renderedExports": [
|
|
390
390
|
"getHTTPStatusCode",
|
|
391
391
|
"getHTTPStatusCodeFromError"
|
|
@@ -393,11 +393,11 @@
|
|
|
393
393
|
"removedExports": [],
|
|
394
394
|
"dependents": [
|
|
395
395
|
"/src/unstable-core-do-not-import.ts",
|
|
396
|
-
"/src/unstable-core-do-not-import/
|
|
397
|
-
"/src/unstable-core-do-not-import/
|
|
396
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
397
|
+
"/src/unstable-core-do-not-import/error/getErrorShape.ts"
|
|
398
398
|
],
|
|
399
|
-
"percent":
|
|
400
|
-
"reduction":
|
|
399
|
+
"percent": 1.04,
|
|
400
|
+
"reduction": 17.52
|
|
401
401
|
},
|
|
402
402
|
{
|
|
403
403
|
"id": "/src/unstable-core-do-not-import/utils.ts",
|
|
@@ -415,20 +415,20 @@
|
|
|
415
415
|
"removedExports": [],
|
|
416
416
|
"dependents": [
|
|
417
417
|
"/src/unstable-core-do-not-import.ts",
|
|
418
|
+
"/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
|
|
419
|
+
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
420
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
421
|
+
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
418
422
|
"/src/unstable-core-do-not-import/error/TRPCError.ts",
|
|
419
423
|
"/src/unstable-core-do-not-import/stream/sse.ts",
|
|
420
424
|
"/src/unstable-core-do-not-import/transformer.ts",
|
|
421
425
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
422
426
|
"/src/unstable-core-do-not-import/router.ts",
|
|
423
|
-
"/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
|
|
424
|
-
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
425
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
426
|
-
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
427
427
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
428
428
|
"/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
429
429
|
"/src/unstable-core-do-not-import/stream/jsonl.ts"
|
|
430
430
|
],
|
|
431
|
-
"percent": 0.
|
|
431
|
+
"percent": 0.91,
|
|
432
432
|
"reduction": 28.12
|
|
433
433
|
},
|
|
434
434
|
{
|
|
@@ -443,7 +443,7 @@
|
|
|
443
443
|
"/src/adapters/fastify/index.ts",
|
|
444
444
|
"/src/adapters/fastify/fastifyTRPCPlugin.ts"
|
|
445
445
|
],
|
|
446
|
-
"percent": 0.
|
|
446
|
+
"percent": 0.86,
|
|
447
447
|
"reduction": 47.59
|
|
448
448
|
},
|
|
449
449
|
{
|
|
@@ -459,7 +459,7 @@
|
|
|
459
459
|
"/src/unstable-core-do-not-import.ts",
|
|
460
460
|
"/src/unstable-core-do-not-import/http/contentType.ts"
|
|
461
461
|
],
|
|
462
|
-
"percent": 0.
|
|
462
|
+
"percent": 0.84,
|
|
463
463
|
"reduction": 15.08
|
|
464
464
|
},
|
|
465
465
|
{
|
|
@@ -473,7 +473,7 @@
|
|
|
473
473
|
"dependents": [
|
|
474
474
|
"/src/unstable-core-do-not-import.ts"
|
|
475
475
|
],
|
|
476
|
-
"percent": 0.
|
|
476
|
+
"percent": 0.81,
|
|
477
477
|
"reduction": 0
|
|
478
478
|
},
|
|
479
479
|
{
|
|
@@ -488,7 +488,7 @@
|
|
|
488
488
|
"/src/unstable-core-do-not-import.ts",
|
|
489
489
|
"/src/unstable-core-do-not-import/procedureBuilder.ts"
|
|
490
490
|
],
|
|
491
|
-
"percent": 0.
|
|
491
|
+
"percent": 0.79,
|
|
492
492
|
"reduction": 58.57
|
|
493
493
|
},
|
|
494
494
|
{
|
|
@@ -505,7 +505,7 @@
|
|
|
505
505
|
"/src/adapters/next-app-dir/nextAppDirCaller.ts",
|
|
506
506
|
"/src/adapters/next-app-dir/rethrowNextErrors.ts"
|
|
507
507
|
],
|
|
508
|
-
"percent": 0.
|
|
508
|
+
"percent": 0.75,
|
|
509
509
|
"reduction": 13.65
|
|
510
510
|
},
|
|
511
511
|
{
|
|
@@ -518,11 +518,12 @@
|
|
|
518
518
|
],
|
|
519
519
|
"removedExports": [],
|
|
520
520
|
"dependents": [
|
|
521
|
+
"/src/unstable-core-do-not-import.ts",
|
|
521
522
|
"/src/unstable-core-do-not-import/stream/sse.ts",
|
|
522
523
|
"/src/unstable-core-do-not-import/stream/jsonl.ts",
|
|
523
524
|
"/src/unstable-core-do-not-import/stream/utils/createReadableStream.ts"
|
|
524
525
|
],
|
|
525
|
-
"percent": 0.
|
|
526
|
+
"percent": 0.75,
|
|
526
527
|
"reduction": 15.69
|
|
527
528
|
},
|
|
528
529
|
{
|
|
@@ -563,7 +564,7 @@
|
|
|
563
564
|
"/src/unstable-core-do-not-import.ts",
|
|
564
565
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
565
566
|
],
|
|
566
|
-
"percent": 0.
|
|
567
|
+
"percent": 0.47,
|
|
567
568
|
"reduction": 43.49
|
|
568
569
|
},
|
|
569
570
|
{
|
|
@@ -618,7 +619,7 @@
|
|
|
618
619
|
],
|
|
619
620
|
"removedExports": [],
|
|
620
621
|
"dependents": [],
|
|
621
|
-
"percent": 0.
|
|
622
|
+
"percent": 0.21,
|
|
622
623
|
"reduction": 72.92
|
|
623
624
|
},
|
|
624
625
|
{
|
|
@@ -708,16 +709,6 @@
|
|
|
708
709
|
"percent": 0.05,
|
|
709
710
|
"reduction": 93.8
|
|
710
711
|
},
|
|
711
|
-
{
|
|
712
|
-
"id": "/src/index.ts",
|
|
713
|
-
"size": 0,
|
|
714
|
-
"origSize": 32,
|
|
715
|
-
"renderedExports": [],
|
|
716
|
-
"removedExports": [],
|
|
717
|
-
"dependents": [],
|
|
718
|
-
"percent": 0,
|
|
719
|
-
"reduction": 100
|
|
720
|
-
},
|
|
721
712
|
{
|
|
722
713
|
"id": "/src/http.ts",
|
|
723
714
|
"size": 0,
|
|
@@ -750,10 +741,20 @@
|
|
|
750
741
|
"percent": 0,
|
|
751
742
|
"reduction": 100
|
|
752
743
|
},
|
|
744
|
+
{
|
|
745
|
+
"id": "/src/index.ts",
|
|
746
|
+
"size": 0,
|
|
747
|
+
"origSize": 32,
|
|
748
|
+
"renderedExports": [],
|
|
749
|
+
"removedExports": [],
|
|
750
|
+
"dependents": [],
|
|
751
|
+
"percent": 0,
|
|
752
|
+
"reduction": 100
|
|
753
|
+
},
|
|
753
754
|
{
|
|
754
755
|
"id": "/src/unstable-core-do-not-import.ts",
|
|
755
756
|
"size": 0,
|
|
756
|
-
"origSize":
|
|
757
|
+
"origSize": 2244,
|
|
757
758
|
"renderedExports": [],
|
|
758
759
|
"removedExports": [],
|
|
759
760
|
"dependents": [
|
|
@@ -813,8 +814,8 @@
|
|
|
813
814
|
"removedExports": [],
|
|
814
815
|
"dependents": [
|
|
815
816
|
"/src/adapters/express.ts",
|
|
816
|
-
"/src/adapters/next.ts",
|
|
817
817
|
"/src/adapters/standalone.ts",
|
|
818
|
+
"/src/adapters/next.ts",
|
|
818
819
|
"/src/adapters/fastify/fastifyRequestHandler.ts"
|
|
819
820
|
],
|
|
820
821
|
"percent": 0,
|
|
@@ -6,9 +6,6 @@ export declare function isObservable(x: unknown): x is Observable<unknown, unkno
|
|
|
6
6
|
/** @public */
|
|
7
7
|
export declare function observable<TValue, TError = unknown>(subscribe: (observer: Observer<TValue, TError>) => TeardownLogic): Observable<TValue, TError>;
|
|
8
8
|
/** @internal */
|
|
9
|
-
export declare function observableToPromise<TValue>(observable: Observable<TValue, unknown>):
|
|
10
|
-
promise: Promise<TValue>;
|
|
11
|
-
abort: () => void;
|
|
12
|
-
};
|
|
9
|
+
export declare function observableToPromise<TValue>(observable: Observable<TValue, unknown>): Promise<TValue>;
|
|
13
10
|
export declare function observableToAsyncIterable<TValue>(observable: Observable<TValue, unknown>): AsyncIterable<TValue>;
|
|
14
11
|
//# sourceMappingURL=observable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observable.d.ts","sourceRoot":"","sources":["../../src/observable/observable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EAER,aAAa,EAGd,MAAM,SAAS,CAAC;AAEjB,cAAc;AACd,MAAM,MAAM,oBAAoB,CAAC,WAAW,IAAI,WAAW,SAAS,UAAU,CAC5E,MAAM,MAAM,EACZ,OAAO,CACR,GACG,MAAM,GACN,KAAK,CAAC;AAEV,cAAc;AACd,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAE1E;AAED,cAAc;AACd,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,EACjD,SAAS,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,aAAa,GAC/D,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CA6D5B;
|
|
1
|
+
{"version":3,"file":"observable.d.ts","sourceRoot":"","sources":["../../src/observable/observable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EAER,aAAa,EAGd,MAAM,SAAS,CAAC;AAEjB,cAAc;AACd,MAAM,MAAM,oBAAoB,CAAC,WAAW,IAAI,WAAW,SAAS,UAAU,CAC5E,MAAM,MAAM,EACZ,OAAO,CACR,GACG,MAAM,GACN,KAAK,CAAC;AAEV,cAAc;AACd,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAE1E;AAED,cAAc;AACd,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,EACjD,SAAS,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,aAAa,GAC/D,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CA6D5B;AAMD,gBAAgB;AAChB,wBAAgB,mBAAmB,CAAC,MAAM,EACxC,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,mBA+BxC;AA6BD,wBAAgB,yBAAyB,CAAC,MAAM,EAC9C,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,GACtC,aAAa,CAAC,MAAM,CAAC,CA+BvB"}
|
|
@@ -65,15 +65,8 @@
|
|
|
65
65
|
function pipeReducer(prev, fn) {
|
|
66
66
|
return fn(prev);
|
|
67
67
|
}
|
|
68
|
-
class ObservableAbortError extends Error {
|
|
69
|
-
constructor(message){
|
|
70
|
-
super(message);
|
|
71
|
-
this.name = 'ObservableAbortError';
|
|
72
|
-
Object.setPrototypeOf(this, ObservableAbortError.prototype);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
68
|
/** @internal */ function observableToPromise(observable) {
|
|
76
|
-
|
|
69
|
+
const ac = new AbortController();
|
|
77
70
|
const promise = new Promise((resolve, reject)=>{
|
|
78
71
|
let isDone = false;
|
|
79
72
|
function onDone() {
|
|
@@ -81,9 +74,11 @@ class ObservableAbortError extends Error {
|
|
|
81
74
|
return;
|
|
82
75
|
}
|
|
83
76
|
isDone = true;
|
|
84
|
-
reject(new ObservableAbortError('This operation was aborted.'));
|
|
85
77
|
obs$.unsubscribe();
|
|
86
78
|
}
|
|
79
|
+
ac.signal.addEventListener('abort', ()=>{
|
|
80
|
+
reject(ac.signal.reason);
|
|
81
|
+
});
|
|
87
82
|
const obs$ = observable.subscribe({
|
|
88
83
|
next (data) {
|
|
89
84
|
isDone = true;
|
|
@@ -91,22 +86,15 @@ class ObservableAbortError extends Error {
|
|
|
91
86
|
onDone();
|
|
92
87
|
},
|
|
93
88
|
error (data) {
|
|
94
|
-
isDone = true;
|
|
95
89
|
reject(data);
|
|
96
|
-
onDone();
|
|
97
90
|
},
|
|
98
91
|
complete () {
|
|
99
|
-
|
|
92
|
+
ac.abort();
|
|
100
93
|
onDone();
|
|
101
94
|
}
|
|
102
95
|
});
|
|
103
|
-
abort = onDone;
|
|
104
96
|
});
|
|
105
|
-
return
|
|
106
|
-
promise,
|
|
107
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
108
|
-
abort: abort
|
|
109
|
-
};
|
|
97
|
+
return promise;
|
|
110
98
|
}
|
|
111
99
|
/**
|
|
112
100
|
* @internal
|