@trpc/server 11.0.0-rc.474 → 11.0.0-rc.477
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/@trpc/server/index.d.ts +5 -1
- package/dist/@trpc/server/index.d.ts.map +1 -1
- package/dist/adapters/ws.d.ts.map +1 -1
- package/dist/adapters/ws.js +36 -6
- package/dist/adapters/ws.mjs +37 -7
- package/dist/bundle-analysis.json +121 -106
- package/dist/index.js +3 -2
- package/dist/index.mjs +1 -1
- package/dist/unstable-core-do-not-import/http/resolveResponse.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/http/resolveResponse.js +13 -2
- package/dist/unstable-core-do-not-import/http/resolveResponse.mjs +13 -2
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts +2 -2
- package/dist/unstable-core-do-not-import/procedureBuilder.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/rootConfig.d.ts +1 -1
- package/dist/unstable-core-do-not-import/rootConfig.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts +8 -0
- package/dist/unstable-core-do-not-import/rpc/envelopes.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.js +6 -2
- package/dist/unstable-core-do-not-import/rpc/parseTRPCMessage.mjs +6 -2
- package/dist/unstable-core-do-not-import/stream/sse.d.ts +12 -30
- package/dist/unstable-core-do-not-import/stream/sse.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/stream/sse.js +29 -23
- package/dist/unstable-core-do-not-import/stream/sse.mjs +30 -22
- package/dist/unstable-core-do-not-import/stream/tracked.d.ts +31 -0
- package/dist/unstable-core-do-not-import/stream/tracked.d.ts.map +1 -0
- package/dist/unstable-core-do-not-import/stream/tracked.js +29 -0
- package/dist/unstable-core-do-not-import/stream/tracked.mjs +25 -0
- package/dist/unstable-core-do-not-import/transformer.d.ts +1 -0
- package/dist/unstable-core-do-not-import/transformer.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 +4 -2
- package/dist/unstable-core-do-not-import.mjs +2 -1
- package/package.json +2 -2
- package/src/@trpc/server/index.ts +4 -0
- package/src/adapters/ws.ts +42 -6
- package/src/unstable-core-do-not-import/http/resolveResponse.ts +13 -1
- package/src/unstable-core-do-not-import/procedureBuilder.ts +2 -2
- package/src/unstable-core-do-not-import/rootConfig.ts +4 -1
- package/src/unstable-core-do-not-import/rpc/envelopes.ts +18 -2
- package/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts +5 -1
- package/src/unstable-core-do-not-import/stream/sse.ts +59 -68
- package/src/unstable-core-do-not-import/stream/tracked.ts +55 -0
- package/src/unstable-core-do-not-import.ts +1 -0
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction":
|
|
2
|
+
"bundleSize": 134783,
|
|
3
|
+
"bundleOrigSize": 183711,
|
|
4
|
+
"bundleReduction": 26.63,
|
|
5
5
|
"modules": [
|
|
6
|
+
{
|
|
7
|
+
"id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
8
|
+
"size": 17762,
|
|
9
|
+
"origSize": 16670,
|
|
10
|
+
"renderedExports": [
|
|
11
|
+
"resolveResponse"
|
|
12
|
+
],
|
|
13
|
+
"removedExports": [],
|
|
14
|
+
"dependents": [
|
|
15
|
+
"/src/unstable-core-do-not-import.ts"
|
|
16
|
+
],
|
|
17
|
+
"percent": 13.18,
|
|
18
|
+
"reduction": 0
|
|
19
|
+
},
|
|
6
20
|
{
|
|
7
21
|
"id": "/src/unstable-core-do-not-import/stream/jsonl.ts",
|
|
8
22
|
"size": 17400,
|
|
@@ -17,27 +31,13 @@
|
|
|
17
31
|
"/src/unstable-core-do-not-import.ts",
|
|
18
32
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
19
33
|
],
|
|
20
|
-
"percent":
|
|
34
|
+
"percent": 12.91,
|
|
21
35
|
"reduction": 4.62
|
|
22
36
|
},
|
|
23
|
-
{
|
|
24
|
-
"id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
25
|
-
"size": 17157,
|
|
26
|
-
"origSize": 16294,
|
|
27
|
-
"renderedExports": [
|
|
28
|
-
"resolveResponse"
|
|
29
|
-
],
|
|
30
|
-
"removedExports": [],
|
|
31
|
-
"dependents": [
|
|
32
|
-
"/src/unstable-core-do-not-import.ts"
|
|
33
|
-
],
|
|
34
|
-
"percent": 13.02,
|
|
35
|
-
"reduction": 0
|
|
36
|
-
},
|
|
37
37
|
{
|
|
38
38
|
"id": "/src/adapters/ws.ts",
|
|
39
|
-
"size":
|
|
40
|
-
"origSize":
|
|
39
|
+
"size": 15730,
|
|
40
|
+
"origSize": 14665,
|
|
41
41
|
"renderedExports": [
|
|
42
42
|
"getWSConnectionHandler",
|
|
43
43
|
"applyWSSHandler"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"dependents": [
|
|
47
47
|
"/src/adapters/fastify/fastifyTRPCPlugin.ts"
|
|
48
48
|
],
|
|
49
|
-
"percent":
|
|
49
|
+
"percent": 11.67,
|
|
50
50
|
"reduction": 0
|
|
51
51
|
},
|
|
52
52
|
{
|
|
@@ -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.7,
|
|
65
65
|
"reduction": 0
|
|
66
66
|
},
|
|
67
67
|
{
|
|
@@ -79,13 +79,13 @@
|
|
|
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.73,
|
|
83
83
|
"reduction": 39.77
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
"id": "/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
87
87
|
"size": 6326,
|
|
88
|
-
"origSize":
|
|
88
|
+
"origSize": 15849,
|
|
89
89
|
"renderedExports": [
|
|
90
90
|
"createBuilder"
|
|
91
91
|
],
|
|
@@ -94,16 +94,14 @@
|
|
|
94
94
|
"/src/unstable-core-do-not-import.ts",
|
|
95
95
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
96
96
|
],
|
|
97
|
-
"percent": 4.
|
|
98
|
-
"reduction": 60.
|
|
97
|
+
"percent": 4.69,
|
|
98
|
+
"reduction": 60.09
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
"id": "/src/unstable-core-do-not-import/stream/sse.ts",
|
|
102
|
-
"size":
|
|
103
|
-
"origSize":
|
|
102
|
+
"size": 5910,
|
|
103
|
+
"origSize": 6971,
|
|
104
104
|
"renderedExports": [
|
|
105
|
-
"sse",
|
|
106
|
-
"isSSEMessageEnvelope",
|
|
107
105
|
"sseStreamProducer",
|
|
108
106
|
"sseStreamConsumer",
|
|
109
107
|
"sseHeaders"
|
|
@@ -113,8 +111,8 @@
|
|
|
113
111
|
"/src/unstable-core-do-not-import.ts",
|
|
114
112
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
115
113
|
],
|
|
116
|
-
"percent": 4.
|
|
117
|
-
"reduction":
|
|
114
|
+
"percent": 4.38,
|
|
115
|
+
"reduction": 15.22
|
|
118
116
|
},
|
|
119
117
|
{
|
|
120
118
|
"id": "/src/adapters/aws-lambda/getPlanner.ts",
|
|
@@ -127,7 +125,7 @@
|
|
|
127
125
|
"dependents": [
|
|
128
126
|
"/src/adapters/aws-lambda/index.ts"
|
|
129
127
|
],
|
|
130
|
-
"percent": 4.
|
|
128
|
+
"percent": 4.02,
|
|
131
129
|
"reduction": 11.38
|
|
132
130
|
},
|
|
133
131
|
{
|
|
@@ -147,7 +145,7 @@
|
|
|
147
145
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
148
146
|
"/src/observable/operators.ts"
|
|
149
147
|
],
|
|
150
|
-
"percent": 3.
|
|
148
|
+
"percent": 3.05,
|
|
151
149
|
"reduction": 0
|
|
152
150
|
},
|
|
153
151
|
{
|
|
@@ -161,7 +159,7 @@
|
|
|
161
159
|
"dependents": [
|
|
162
160
|
"/src/adapters/next-app-dir.ts"
|
|
163
161
|
],
|
|
164
|
-
"percent": 2.
|
|
162
|
+
"percent": 2.33,
|
|
165
163
|
"reduction": 23.5
|
|
166
164
|
},
|
|
167
165
|
{
|
|
@@ -177,7 +175,7 @@
|
|
|
177
175
|
"dependents": [
|
|
178
176
|
"/src/observable/index.ts"
|
|
179
177
|
],
|
|
180
|
-
"percent": 2.
|
|
178
|
+
"percent": 2.04,
|
|
181
179
|
"reduction": 0
|
|
182
180
|
},
|
|
183
181
|
{
|
|
@@ -193,11 +191,11 @@
|
|
|
193
191
|
"removedExports": [],
|
|
194
192
|
"dependents": [
|
|
195
193
|
"/src/unstable-core-do-not-import.ts",
|
|
196
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
197
194
|
"/src/unstable-core-do-not-import/initTRPC.ts",
|
|
198
|
-
"/src/unstable-core-do-not-import/router.ts"
|
|
195
|
+
"/src/unstable-core-do-not-import/router.ts",
|
|
196
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
199
197
|
],
|
|
200
|
-
"percent": 2.
|
|
198
|
+
"percent": 2.04,
|
|
201
199
|
"reduction": 45.94
|
|
202
200
|
},
|
|
203
201
|
{
|
|
@@ -211,7 +209,7 @@
|
|
|
211
209
|
"dependents": [
|
|
212
210
|
"/src/adapters/node-http/index.ts"
|
|
213
211
|
],
|
|
214
|
-
"percent": 2.
|
|
212
|
+
"percent": 2.03,
|
|
215
213
|
"reduction": 6.79
|
|
216
214
|
},
|
|
217
215
|
{
|
|
@@ -225,7 +223,7 @@
|
|
|
225
223
|
"dependents": [
|
|
226
224
|
"/src/unstable-core-do-not-import.ts"
|
|
227
225
|
],
|
|
228
|
-
"percent": 2.
|
|
226
|
+
"percent": 2.01,
|
|
229
227
|
"reduction": 40.91
|
|
230
228
|
},
|
|
231
229
|
{
|
|
@@ -245,7 +243,7 @@
|
|
|
245
243
|
"/src/unstable-core-do-not-import/initTRPC.ts",
|
|
246
244
|
"/src/unstable-core-do-not-import/procedureBuilder.ts"
|
|
247
245
|
],
|
|
248
|
-
"percent": 1.
|
|
246
|
+
"percent": 1.95,
|
|
249
247
|
"reduction": 55.5
|
|
250
248
|
},
|
|
251
249
|
{
|
|
@@ -261,7 +259,7 @@
|
|
|
261
259
|
"/src/unstable-core-do-not-import.ts",
|
|
262
260
|
"/src/unstable-core-do-not-import/router.ts"
|
|
263
261
|
],
|
|
264
|
-
"percent": 1.
|
|
262
|
+
"percent": 1.73,
|
|
265
263
|
"reduction": 0
|
|
266
264
|
},
|
|
267
265
|
{
|
|
@@ -275,7 +273,7 @@
|
|
|
275
273
|
"dependents": [
|
|
276
274
|
"/src/adapters/fetch/index.ts"
|
|
277
275
|
],
|
|
278
|
-
"percent": 1.
|
|
276
|
+
"percent": 1.67,
|
|
279
277
|
"reduction": 2.17
|
|
280
278
|
},
|
|
281
279
|
{
|
|
@@ -290,7 +288,7 @@
|
|
|
290
288
|
"/src/adapters/node-http/index.ts",
|
|
291
289
|
"/src/adapters/node-http/nodeHTTPRequestHandler.ts"
|
|
292
290
|
],
|
|
293
|
-
"percent": 1.
|
|
291
|
+
"percent": 1.63,
|
|
294
292
|
"reduction": 13.79
|
|
295
293
|
},
|
|
296
294
|
{
|
|
@@ -304,7 +302,7 @@
|
|
|
304
302
|
"dependents": [
|
|
305
303
|
"/src/adapters/next-app-dir/nextAppDirCaller.ts"
|
|
306
304
|
],
|
|
307
|
-
"percent": 1.
|
|
305
|
+
"percent": 1.52,
|
|
308
306
|
"reduction": 5.79
|
|
309
307
|
},
|
|
310
308
|
{
|
|
@@ -319,42 +317,42 @@
|
|
|
319
317
|
"removedExports": [],
|
|
320
318
|
"dependents": [
|
|
321
319
|
"/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",
|
|
324
|
-
"/src/unstable-core-do-not-import/stream/sse.ts",
|
|
325
320
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
326
321
|
"/src/unstable-core-do-not-import/router.ts",
|
|
322
|
+
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
323
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
327
324
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
328
325
|
"/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
329
|
-
"/src/unstable-core-do-not-import/stream/jsonl.ts"
|
|
326
|
+
"/src/unstable-core-do-not-import/stream/jsonl.ts",
|
|
327
|
+
"/src/unstable-core-do-not-import/stream/sse.ts"
|
|
330
328
|
],
|
|
331
|
-
"percent": 1.
|
|
329
|
+
"percent": 1.29,
|
|
332
330
|
"reduction": 19.47
|
|
333
331
|
},
|
|
334
332
|
{
|
|
335
|
-
"id": "/src/unstable-core-do-not-import/rpc/
|
|
336
|
-
"size":
|
|
337
|
-
"origSize":
|
|
333
|
+
"id": "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
334
|
+
"size": 1699,
|
|
335
|
+
"origSize": 2105,
|
|
338
336
|
"renderedExports": [
|
|
339
|
-
"
|
|
340
|
-
"TRPC_ERROR_CODES_BY_NUMBER"
|
|
337
|
+
"parseTRPCMessage"
|
|
341
338
|
],
|
|
342
339
|
"removedExports": [],
|
|
343
340
|
"dependents": [],
|
|
344
|
-
"percent": 1.
|
|
345
|
-
"reduction":
|
|
341
|
+
"percent": 1.26,
|
|
342
|
+
"reduction": 19.29
|
|
346
343
|
},
|
|
347
344
|
{
|
|
348
|
-
"id": "/src/unstable-core-do-not-import/rpc/
|
|
349
|
-
"size":
|
|
350
|
-
"origSize":
|
|
345
|
+
"id": "/src/unstable-core-do-not-import/rpc/codes.ts",
|
|
346
|
+
"size": 1611,
|
|
347
|
+
"origSize": 2221,
|
|
351
348
|
"renderedExports": [
|
|
352
|
-
"
|
|
349
|
+
"TRPC_ERROR_CODES_BY_KEY",
|
|
350
|
+
"TRPC_ERROR_CODES_BY_NUMBER"
|
|
353
351
|
],
|
|
354
352
|
"removedExports": [],
|
|
355
353
|
"dependents": [],
|
|
356
354
|
"percent": 1.2,
|
|
357
|
-
"reduction":
|
|
355
|
+
"reduction": 27.47
|
|
358
356
|
},
|
|
359
357
|
{
|
|
360
358
|
"id": "/src/adapters/next.ts",
|
|
@@ -365,7 +363,7 @@
|
|
|
365
363
|
],
|
|
366
364
|
"removedExports": [],
|
|
367
365
|
"dependents": [],
|
|
368
|
-
"percent": 1.
|
|
366
|
+
"percent": 1.14,
|
|
369
367
|
"reduction": 26.94
|
|
370
368
|
},
|
|
371
369
|
{
|
|
@@ -379,7 +377,7 @@
|
|
|
379
377
|
"dependents": [
|
|
380
378
|
"/src/adapters/fastify/index.ts"
|
|
381
379
|
],
|
|
382
|
-
"percent": 1.
|
|
380
|
+
"percent": 1.11,
|
|
383
381
|
"reduction": 34.7
|
|
384
382
|
},
|
|
385
383
|
{
|
|
@@ -393,10 +391,10 @@
|
|
|
393
391
|
"removedExports": [],
|
|
394
392
|
"dependents": [
|
|
395
393
|
"/src/unstable-core-do-not-import.ts",
|
|
396
|
-
"/src/unstable-core-do-not-import/
|
|
397
|
-
"/src/unstable-core-do-not-import/
|
|
394
|
+
"/src/unstable-core-do-not-import/error/getErrorShape.ts",
|
|
395
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
398
396
|
],
|
|
399
|
-
"percent": 1.
|
|
397
|
+
"percent": 1.01,
|
|
400
398
|
"reduction": 17.52
|
|
401
399
|
},
|
|
402
400
|
{
|
|
@@ -415,20 +413,20 @@
|
|
|
415
413
|
"removedExports": [],
|
|
416
414
|
"dependents": [
|
|
417
415
|
"/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",
|
|
422
416
|
"/src/unstable-core-do-not-import/error/TRPCError.ts",
|
|
423
|
-
"/src/unstable-core-do-not-import/stream/sse.ts",
|
|
424
417
|
"/src/unstable-core-do-not-import/transformer.ts",
|
|
425
418
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
426
419
|
"/src/unstable-core-do-not-import/router.ts",
|
|
420
|
+
"/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
|
|
421
|
+
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
422
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
423
|
+
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
427
424
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
428
425
|
"/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
429
|
-
"/src/unstable-core-do-not-import/stream/jsonl.ts"
|
|
426
|
+
"/src/unstable-core-do-not-import/stream/jsonl.ts",
|
|
427
|
+
"/src/unstable-core-do-not-import/stream/sse.ts"
|
|
430
428
|
],
|
|
431
|
-
"percent": 0.
|
|
429
|
+
"percent": 0.89,
|
|
432
430
|
"reduction": 28.12
|
|
433
431
|
},
|
|
434
432
|
{
|
|
@@ -443,7 +441,7 @@
|
|
|
443
441
|
"/src/adapters/fastify/index.ts",
|
|
444
442
|
"/src/adapters/fastify/fastifyTRPCPlugin.ts"
|
|
445
443
|
],
|
|
446
|
-
"percent": 0.
|
|
444
|
+
"percent": 0.84,
|
|
447
445
|
"reduction": 47.59
|
|
448
446
|
},
|
|
449
447
|
{
|
|
@@ -459,7 +457,7 @@
|
|
|
459
457
|
"/src/unstable-core-do-not-import.ts",
|
|
460
458
|
"/src/unstable-core-do-not-import/http/contentType.ts"
|
|
461
459
|
],
|
|
462
|
-
"percent": 0.
|
|
460
|
+
"percent": 0.82,
|
|
463
461
|
"reduction": 15.08
|
|
464
462
|
},
|
|
465
463
|
{
|
|
@@ -473,7 +471,7 @@
|
|
|
473
471
|
"dependents": [
|
|
474
472
|
"/src/unstable-core-do-not-import.ts"
|
|
475
473
|
],
|
|
476
|
-
"percent": 0.
|
|
474
|
+
"percent": 0.79,
|
|
477
475
|
"reduction": 0
|
|
478
476
|
},
|
|
479
477
|
{
|
|
@@ -488,7 +486,7 @@
|
|
|
488
486
|
"/src/unstable-core-do-not-import.ts",
|
|
489
487
|
"/src/unstable-core-do-not-import/procedureBuilder.ts"
|
|
490
488
|
],
|
|
491
|
-
"percent": 0.
|
|
489
|
+
"percent": 0.77,
|
|
492
490
|
"reduction": 58.57
|
|
493
491
|
},
|
|
494
492
|
{
|
|
@@ -505,7 +503,7 @@
|
|
|
505
503
|
"/src/adapters/next-app-dir/nextAppDirCaller.ts",
|
|
506
504
|
"/src/adapters/next-app-dir/rethrowNextErrors.ts"
|
|
507
505
|
],
|
|
508
|
-
"percent": 0.
|
|
506
|
+
"percent": 0.73,
|
|
509
507
|
"reduction": 13.65
|
|
510
508
|
},
|
|
511
509
|
{
|
|
@@ -519,13 +517,30 @@
|
|
|
519
517
|
"removedExports": [],
|
|
520
518
|
"dependents": [
|
|
521
519
|
"/src/unstable-core-do-not-import.ts",
|
|
522
|
-
"/src/unstable-core-do-not-import/stream/sse.ts",
|
|
523
520
|
"/src/unstable-core-do-not-import/stream/jsonl.ts",
|
|
521
|
+
"/src/unstable-core-do-not-import/stream/sse.ts",
|
|
524
522
|
"/src/unstable-core-do-not-import/stream/utils/createReadableStream.ts"
|
|
525
523
|
],
|
|
526
|
-
"percent": 0.
|
|
524
|
+
"percent": 0.73,
|
|
527
525
|
"reduction": 15.69
|
|
528
526
|
},
|
|
527
|
+
{
|
|
528
|
+
"id": "/src/unstable-core-do-not-import/stream/tracked.ts",
|
|
529
|
+
"size": 797,
|
|
530
|
+
"origSize": 1440,
|
|
531
|
+
"renderedExports": [
|
|
532
|
+
"sse",
|
|
533
|
+
"isTrackedEnvelope",
|
|
534
|
+
"tracked"
|
|
535
|
+
],
|
|
536
|
+
"removedExports": [],
|
|
537
|
+
"dependents": [
|
|
538
|
+
"/src/unstable-core-do-not-import.ts",
|
|
539
|
+
"/src/unstable-core-do-not-import/stream/sse.ts"
|
|
540
|
+
],
|
|
541
|
+
"percent": 0.59,
|
|
542
|
+
"reduction": 44.65
|
|
543
|
+
},
|
|
529
544
|
{
|
|
530
545
|
"id": "/src/adapters/aws-lambda/index.ts",
|
|
531
546
|
"size": 759,
|
|
@@ -535,7 +550,7 @@
|
|
|
535
550
|
],
|
|
536
551
|
"removedExports": [],
|
|
537
552
|
"dependents": [],
|
|
538
|
-
"percent": 0.
|
|
553
|
+
"percent": 0.56,
|
|
539
554
|
"reduction": 66.9
|
|
540
555
|
},
|
|
541
556
|
{
|
|
@@ -549,7 +564,7 @@
|
|
|
549
564
|
"dependents": [
|
|
550
565
|
"/src/unstable-core-do-not-import.ts"
|
|
551
566
|
],
|
|
552
|
-
"percent": 0.
|
|
567
|
+
"percent": 0.49,
|
|
553
568
|
"reduction": 0.6
|
|
554
569
|
},
|
|
555
570
|
{
|
|
@@ -564,7 +579,7 @@
|
|
|
564
579
|
"/src/unstable-core-do-not-import.ts",
|
|
565
580
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
566
581
|
],
|
|
567
|
-
"percent": 0.
|
|
582
|
+
"percent": 0.46,
|
|
568
583
|
"reduction": 43.49
|
|
569
584
|
},
|
|
570
585
|
{
|
|
@@ -576,10 +591,10 @@
|
|
|
576
591
|
],
|
|
577
592
|
"removedExports": [],
|
|
578
593
|
"dependents": [
|
|
579
|
-
"/src/unstable-core-do-not-import/stream/
|
|
580
|
-
"/src/unstable-core-do-not-import/stream/
|
|
594
|
+
"/src/unstable-core-do-not-import/stream/jsonl.ts",
|
|
595
|
+
"/src/unstable-core-do-not-import/stream/sse.ts"
|
|
581
596
|
],
|
|
582
|
-
"percent": 0.
|
|
597
|
+
"percent": 0.43,
|
|
583
598
|
"reduction": 17.15
|
|
584
599
|
},
|
|
585
600
|
{
|
|
@@ -598,7 +613,7 @@
|
|
|
598
613
|
{
|
|
599
614
|
"id": "/src/unstable-core-do-not-import/rootConfig.ts",
|
|
600
615
|
"size": 343,
|
|
601
|
-
"origSize":
|
|
616
|
+
"origSize": 3270,
|
|
602
617
|
"renderedExports": [
|
|
603
618
|
"isServerDefault"
|
|
604
619
|
],
|
|
@@ -607,8 +622,8 @@
|
|
|
607
622
|
"/src/unstable-core-do-not-import.ts",
|
|
608
623
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
609
624
|
],
|
|
610
|
-
"percent": 0.
|
|
611
|
-
"reduction": 89.
|
|
625
|
+
"percent": 0.25,
|
|
626
|
+
"reduction": 89.51
|
|
612
627
|
},
|
|
613
628
|
{
|
|
614
629
|
"id": "/src/adapters/express.ts",
|
|
@@ -647,7 +662,7 @@
|
|
|
647
662
|
"dependents": [
|
|
648
663
|
"/src/unstable-core-do-not-import.ts"
|
|
649
664
|
],
|
|
650
|
-
"percent": 0.
|
|
665
|
+
"percent": 0.16,
|
|
651
666
|
"reduction": 94.55
|
|
652
667
|
},
|
|
653
668
|
{
|
|
@@ -661,7 +676,7 @@
|
|
|
661
676
|
"dependents": [
|
|
662
677
|
"/src/adapters/next-app-dir.ts"
|
|
663
678
|
],
|
|
664
|
-
"percent": 0.
|
|
679
|
+
"percent": 0.16,
|
|
665
680
|
"reduction": 36.26
|
|
666
681
|
},
|
|
667
682
|
{
|
|
@@ -710,31 +725,31 @@
|
|
|
710
725
|
"reduction": 93.8
|
|
711
726
|
},
|
|
712
727
|
{
|
|
713
|
-
"id": "/src/
|
|
728
|
+
"id": "/src/index.ts",
|
|
714
729
|
"size": 0,
|
|
715
|
-
"origSize":
|
|
730
|
+
"origSize": 32,
|
|
716
731
|
"renderedExports": [],
|
|
717
732
|
"removedExports": [],
|
|
718
|
-
"dependents": [
|
|
719
|
-
"/src/adapters/ws.ts"
|
|
720
|
-
],
|
|
733
|
+
"dependents": [],
|
|
721
734
|
"percent": 0,
|
|
722
735
|
"reduction": 100
|
|
723
736
|
},
|
|
724
737
|
{
|
|
725
|
-
"id": "/src/
|
|
738
|
+
"id": "/src/http.ts",
|
|
726
739
|
"size": 0,
|
|
727
|
-
"origSize":
|
|
740
|
+
"origSize": 37,
|
|
728
741
|
"renderedExports": [],
|
|
729
742
|
"removedExports": [],
|
|
730
|
-
"dependents": [
|
|
743
|
+
"dependents": [
|
|
744
|
+
"/src/adapters/ws.ts"
|
|
745
|
+
],
|
|
731
746
|
"percent": 0,
|
|
732
747
|
"reduction": 100
|
|
733
748
|
},
|
|
734
749
|
{
|
|
735
|
-
"id": "/src/
|
|
750
|
+
"id": "/src/rpc.ts",
|
|
736
751
|
"size": 0,
|
|
737
|
-
"origSize":
|
|
752
|
+
"origSize": 36,
|
|
738
753
|
"renderedExports": [],
|
|
739
754
|
"removedExports": [],
|
|
740
755
|
"dependents": [],
|
|
@@ -754,7 +769,7 @@
|
|
|
754
769
|
{
|
|
755
770
|
"id": "/src/unstable-core-do-not-import.ts",
|
|
756
771
|
"size": 0,
|
|
757
|
-
"origSize":
|
|
772
|
+
"origSize": 2306,
|
|
758
773
|
"renderedExports": [],
|
|
759
774
|
"removedExports": [],
|
|
760
775
|
"dependents": [
|
|
@@ -814,13 +829,13 @@
|
|
|
814
829
|
"removedExports": [],
|
|
815
830
|
"dependents": [
|
|
816
831
|
"/src/adapters/express.ts",
|
|
817
|
-
"/src/adapters/standalone.ts",
|
|
818
832
|
"/src/adapters/next.ts",
|
|
833
|
+
"/src/adapters/standalone.ts",
|
|
819
834
|
"/src/adapters/fastify/fastifyRequestHandler.ts"
|
|
820
835
|
],
|
|
821
836
|
"percent": 0,
|
|
822
837
|
"reduction": 100
|
|
823
838
|
}
|
|
824
839
|
],
|
|
825
|
-
"moduleCount":
|
|
840
|
+
"moduleCount": 56
|
|
826
841
|
}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var createProxy = require('./unstable-core-do-not-import/createProxy.js');
|
|
4
4
|
var getErrorShape = require('./unstable-core-do-not-import/error/getErrorShape.js');
|
|
5
5
|
var TRPCError = require('./unstable-core-do-not-import/error/TRPCError.js');
|
|
6
|
-
var
|
|
6
|
+
var tracked = require('./unstable-core-do-not-import/stream/tracked.js');
|
|
7
7
|
var transformer = require('./unstable-core-do-not-import/transformer.js');
|
|
8
8
|
var initTRPC = require('./unstable-core-do-not-import/initTRPC.js');
|
|
9
9
|
var middleware = require('./unstable-core-do-not-import/middleware.js');
|
|
@@ -16,7 +16,8 @@ exports.createTRPCFlatProxy = createProxy.createFlatProxy;
|
|
|
16
16
|
exports.getErrorShape = getErrorShape.getErrorShape;
|
|
17
17
|
exports.TRPCError = TRPCError.TRPCError;
|
|
18
18
|
exports.getTRPCErrorFromUnknown = TRPCError.getTRPCErrorFromUnknown;
|
|
19
|
-
exports.sse =
|
|
19
|
+
exports.sse = tracked.sse;
|
|
20
|
+
exports.tracked = tracked.tracked;
|
|
20
21
|
exports.transformTRPCResponse = transformer.transformTRPCResponse;
|
|
21
22
|
exports.initTRPC = initTRPC.initTRPC;
|
|
22
23
|
exports.experimental_standaloneMiddleware = middleware.experimental_standaloneMiddleware;
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createFlatProxy as createTRPCFlatProxy } from './unstable-core-do-not-import/createProxy.mjs';
|
|
2
2
|
export { getErrorShape } from './unstable-core-do-not-import/error/getErrorShape.mjs';
|
|
3
3
|
export { TRPCError, getTRPCErrorFromUnknown } from './unstable-core-do-not-import/error/TRPCError.mjs';
|
|
4
|
-
export { sse } from './unstable-core-do-not-import/stream/
|
|
4
|
+
export { sse, tracked } from './unstable-core-do-not-import/stream/tracked.mjs';
|
|
5
5
|
export { transformTRPCResponse } from './unstable-core-do-not-import/transformer.mjs';
|
|
6
6
|
export { initTRPC } from './unstable-core-do-not-import/initTRPC.mjs';
|
|
7
7
|
export { experimental_standaloneMiddleware, experimental_standaloneMiddleware as experimental_trpcMiddleware } from './unstable-core-do-not-import/middleware.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveResponse.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/resolveResponse.ts"],"names":[],"mappings":"AAMA,OAAO,EAA2B,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAExE,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,WAAW,CAAC;AAQnB,OAAO,KAAK,EACV,sBAAsB,EACtB,kCAAkC,EAEnC,MAAM,SAAS,CAAC;AA0BjB,UAAU,yBAAyB,CAAC,OAAO,SAAS,SAAS,CAC3D,SAAQ,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC;IAChD,aAAa,EAAE,kCAAkC,CAAC,OAAO,CAAC,CAAC;IAC3D,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;CACzB;AAyID,wBAAsB,eAAe,CAAC,OAAO,SAAS,SAAS,EAC7D,IAAI,EAAE,yBAAyB,CAAC,OAAO,CAAC,GACvC,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"resolveResponse.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/http/resolveResponse.ts"],"names":[],"mappings":"AAMA,OAAO,EAA2B,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAExE,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,WAAW,CAAC;AAQnB,OAAO,KAAK,EACV,sBAAsB,EACtB,kCAAkC,EAEnC,MAAM,SAAS,CAAC;AA0BjB,UAAU,yBAAyB,CAAC,OAAO,SAAS,SAAS,CAC3D,SAAQ,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC;IAChD,aAAa,EAAE,kCAAkC,CAAC,OAAO,CAAC,CAAC;IAC3D,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;CACzB;AAyID,wBAAsB,eAAe,CAAC,OAAO,SAAS,SAAS,EAC7D,IAAI,EAAE,yBAAyB,CAAC,OAAO,CAAC,GACvC,OAAO,CAAC,QAAQ,CAAC,CA6ZnB"}
|
|
@@ -284,9 +284,20 @@ async function resolveResponse(opts) {
|
|
|
284
284
|
}
|
|
285
285
|
const dataAsIterable = observable.isObservable(data) ? observable.observableToAsyncIterable(data) : data;
|
|
286
286
|
const stream = sse.sseStreamProducer({
|
|
287
|
-
...
|
|
287
|
+
...config.experimental?.sseSubscriptions,
|
|
288
288
|
data: dataAsIterable,
|
|
289
|
-
serialize: (v)=>config.transformer.output.serialize(v)
|
|
289
|
+
serialize: (v)=>config.transformer.output.serialize(v),
|
|
290
|
+
formatError (errorOpts) {
|
|
291
|
+
const shape = getErrorShape.getErrorShape({
|
|
292
|
+
config,
|
|
293
|
+
ctx,
|
|
294
|
+
error: TRPCError.getTRPCErrorFromUnknown(errorOpts.error),
|
|
295
|
+
input: call?.result(),
|
|
296
|
+
path: call?.path,
|
|
297
|
+
type: call?.procedure?._def.type ?? 'unknown'
|
|
298
|
+
});
|
|
299
|
+
return shape;
|
|
300
|
+
}
|
|
290
301
|
});
|
|
291
302
|
for (const [key, value] of Object.entries(sse.sseHeaders)){
|
|
292
303
|
headers.set(key, value);
|
|
@@ -282,9 +282,20 @@ async function resolveResponse(opts) {
|
|
|
282
282
|
}
|
|
283
283
|
const dataAsIterable = isObservable(data) ? observableToAsyncIterable(data) : data;
|
|
284
284
|
const stream = sseStreamProducer({
|
|
285
|
-
...
|
|
285
|
+
...config.experimental?.sseSubscriptions,
|
|
286
286
|
data: dataAsIterable,
|
|
287
|
-
serialize: (v)=>config.transformer.output.serialize(v)
|
|
287
|
+
serialize: (v)=>config.transformer.output.serialize(v),
|
|
288
|
+
formatError (errorOpts) {
|
|
289
|
+
const shape = getErrorShape({
|
|
290
|
+
config,
|
|
291
|
+
ctx,
|
|
292
|
+
error: getTRPCErrorFromUnknown(errorOpts.error),
|
|
293
|
+
input: call?.result(),
|
|
294
|
+
path: call?.path,
|
|
295
|
+
type: call?.procedure?._def.type ?? 'unknown'
|
|
296
|
+
});
|
|
297
|
+
return shape;
|
|
298
|
+
}
|
|
288
299
|
});
|
|
289
300
|
for (const [key, value] of Object.entries(sseHeaders)){
|
|
290
301
|
headers.set(key, value);
|
|
@@ -2,12 +2,12 @@ import type { inferObservableValue } from '../observable';
|
|
|
2
2
|
import type { AnyMiddlewareFunction, MiddlewareBuilder, MiddlewareFunction } from './middleware';
|
|
3
3
|
import type { inferParser, Parser } from './parser';
|
|
4
4
|
import type { AnyProcedure, MutationProcedure, ProcedureType, QueryProcedure, SubscriptionProcedure } from './procedure';
|
|
5
|
-
import type {
|
|
5
|
+
import type { inferTrackedOutput } from './stream/tracked';
|
|
6
6
|
import type { GetRawInputFn, MaybePromise, Overwrite, Simplify, TypeError } from './types';
|
|
7
7
|
import type { UnsetMarker } from './utils';
|
|
8
8
|
type IntersectIfDefined<TType, TWith> = TType extends UnsetMarker ? TWith : TWith extends UnsetMarker ? TType : Simplify<TType & TWith>;
|
|
9
9
|
type DefaultValue<TValue, TFallback> = TValue extends UnsetMarker ? TFallback : TValue;
|
|
10
|
-
type inferSubscriptionOutput<TOutput> = TOutput extends AsyncIterable<infer $Output> ?
|
|
10
|
+
type inferSubscriptionOutput<TOutput> = TOutput extends AsyncIterable<infer $Output> ? inferTrackedOutput<$Output> : inferObservableValue<TOutput>;
|
|
11
11
|
export type CallerOverride<TContext> = (opts: {
|
|
12
12
|
args: unknown[];
|
|
13
13
|
invoke: (opts: ProcedureCallOptions<TContext>) => Promise<unknown>;
|