@trpc/server 11.0.0-rc.744 → 11.0.0-rc.746
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/bundle-analysis.json +43 -43
- package/dist/unstable-core-do-not-import/stream/jsonl.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/stream/jsonl.js +10 -8
- package/dist/unstable-core-do-not-import/stream/jsonl.mjs +10 -8
- package/package.json +2 -2
- package/src/unstable-core-do-not-import/stream/jsonl.ts +10 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 13.
|
|
2
|
+
"bundleSize": 195415,
|
|
3
|
+
"bundleOrigSize": 226915,
|
|
4
|
+
"bundleReduction": 13.88,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
"dependents": [
|
|
15
15
|
"/src/unstable-core-do-not-import.ts"
|
|
16
16
|
],
|
|
17
|
-
"percent": 10.
|
|
17
|
+
"percent": 10.78,
|
|
18
18
|
"reduction": 0
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"id": "/src/unstable-core-do-not-import/stream/jsonl.ts",
|
|
22
|
-
"size":
|
|
23
|
-
"origSize":
|
|
22
|
+
"size": 20511,
|
|
23
|
+
"origSize": 17610,
|
|
24
24
|
"renderedExports": [
|
|
25
25
|
"isPromise",
|
|
26
26
|
"jsonlStreamProducer",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"/src/unstable-core-do-not-import.ts",
|
|
32
32
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
33
33
|
],
|
|
34
|
-
"percent": 10.
|
|
34
|
+
"percent": 10.5,
|
|
35
35
|
"reduction": 0
|
|
36
36
|
},
|
|
37
37
|
{
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dependents": [
|
|
48
48
|
"/src/adapters/fastify/fastifyTRPCPlugin.ts"
|
|
49
49
|
],
|
|
50
|
-
"percent": 10.
|
|
50
|
+
"percent": 10.32,
|
|
51
51
|
"reduction": 0
|
|
52
52
|
},
|
|
53
53
|
{
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"/src/unstable-core-do-not-import.ts",
|
|
107
107
|
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
108
108
|
],
|
|
109
|
-
"percent": 3.
|
|
109
|
+
"percent": 3.97,
|
|
110
110
|
"reduction": 0
|
|
111
111
|
},
|
|
112
112
|
{
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"/src/unstable-core-do-not-import.ts",
|
|
160
160
|
"/src/unstable-core-do-not-import/initTRPC.ts"
|
|
161
161
|
],
|
|
162
|
-
"percent": 2.
|
|
162
|
+
"percent": 2.96,
|
|
163
163
|
"reduction": 65.01
|
|
164
164
|
},
|
|
165
165
|
{
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
"/src/observable/operators.ts",
|
|
194
194
|
"/src/observable/behaviorSubject.ts"
|
|
195
195
|
],
|
|
196
|
-
"percent": 2.
|
|
196
|
+
"percent": 2.47,
|
|
197
197
|
"reduction": 0
|
|
198
198
|
},
|
|
199
199
|
{
|
|
@@ -288,9 +288,9 @@
|
|
|
288
288
|
"removedExports": [],
|
|
289
289
|
"dependents": [
|
|
290
290
|
"/src/unstable-core-do-not-import.ts",
|
|
291
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
292
291
|
"/src/unstable-core-do-not-import/initTRPC.ts",
|
|
293
|
-
"/src/unstable-core-do-not-import/router.ts"
|
|
292
|
+
"/src/unstable-core-do-not-import/router.ts",
|
|
293
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
294
294
|
],
|
|
295
295
|
"percent": 1.4,
|
|
296
296
|
"reduction": 45.98
|
|
@@ -350,13 +350,13 @@
|
|
|
350
350
|
"removedExports": [],
|
|
351
351
|
"dependents": [
|
|
352
352
|
"/src/unstable-core-do-not-import.ts",
|
|
353
|
-
"/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
|
|
354
|
-
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
355
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
356
353
|
"/src/unstable-core-do-not-import/error/TRPCError.ts",
|
|
357
354
|
"/src/unstable-core-do-not-import/transformer.ts",
|
|
358
355
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
359
356
|
"/src/unstable-core-do-not-import/router.ts",
|
|
357
|
+
"/src/unstable-core-do-not-import/http/getHTTPStatusCode.ts",
|
|
358
|
+
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
359
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
360
360
|
"/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
361
361
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
362
362
|
"/src/unstable-core-do-not-import/http/isAbortError.ts",
|
|
@@ -379,10 +379,10 @@
|
|
|
379
379
|
"removedExports": [],
|
|
380
380
|
"dependents": [
|
|
381
381
|
"/src/unstable-core-do-not-import.ts",
|
|
382
|
-
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
383
|
-
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
384
382
|
"/src/unstable-core-do-not-import/middleware.ts",
|
|
385
383
|
"/src/unstable-core-do-not-import/router.ts",
|
|
384
|
+
"/src/unstable-core-do-not-import/http/parseConnectionParams.ts",
|
|
385
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
386
386
|
"/src/unstable-core-do-not-import/http/contentType.ts",
|
|
387
387
|
"/src/unstable-core-do-not-import/procedureBuilder.ts",
|
|
388
388
|
"/src/unstable-core-do-not-import/stream/sse.ts"
|
|
@@ -431,7 +431,7 @@
|
|
|
431
431
|
"dependents": [
|
|
432
432
|
"/src/adapters/next-app-dir/nextAppDirCaller.ts"
|
|
433
433
|
],
|
|
434
|
-
"percent": 1.
|
|
434
|
+
"percent": 1.08,
|
|
435
435
|
"reduction": 5.4
|
|
436
436
|
},
|
|
437
437
|
{
|
|
@@ -449,8 +449,8 @@
|
|
|
449
449
|
"removedExports": [],
|
|
450
450
|
"dependents": [
|
|
451
451
|
"/src/unstable-core-do-not-import.ts",
|
|
452
|
-
"/src/unstable-core-do-not-import/
|
|
453
|
-
"/src/unstable-core-do-not-import/
|
|
452
|
+
"/src/unstable-core-do-not-import/error/getErrorShape.ts",
|
|
453
|
+
"/src/unstable-core-do-not-import/http/resolveResponse.ts"
|
|
454
454
|
],
|
|
455
455
|
"percent": 1.07,
|
|
456
456
|
"reduction": 18.54
|
|
@@ -601,7 +601,7 @@
|
|
|
601
601
|
"/src/unstable-core-do-not-import.ts",
|
|
602
602
|
"/src/unstable-core-do-not-import/http/contentType.ts"
|
|
603
603
|
],
|
|
604
|
-
"percent": 0.
|
|
604
|
+
"percent": 0.56,
|
|
605
605
|
"reduction": 15.08
|
|
606
606
|
},
|
|
607
607
|
{
|
|
@@ -629,7 +629,7 @@
|
|
|
629
629
|
"dependents": [
|
|
630
630
|
"/src/observable/index.ts"
|
|
631
631
|
],
|
|
632
|
-
"percent": 0.
|
|
632
|
+
"percent": 0.49,
|
|
633
633
|
"reduction": 32.89
|
|
634
634
|
},
|
|
635
635
|
{
|
|
@@ -855,24 +855,24 @@
|
|
|
855
855
|
"reduction": 93.9
|
|
856
856
|
},
|
|
857
857
|
{
|
|
858
|
-
"id": "/src/
|
|
858
|
+
"id": "/src/index.ts",
|
|
859
859
|
"size": 0,
|
|
860
|
-
"origSize":
|
|
860
|
+
"origSize": 32,
|
|
861
861
|
"renderedExports": [],
|
|
862
862
|
"removedExports": [],
|
|
863
|
-
"dependents": [
|
|
864
|
-
"/src/adapters/ws.ts"
|
|
865
|
-
],
|
|
863
|
+
"dependents": [],
|
|
866
864
|
"percent": 0,
|
|
867
865
|
"reduction": 100
|
|
868
866
|
},
|
|
869
867
|
{
|
|
870
|
-
"id": "/src/
|
|
868
|
+
"id": "/src/http.ts",
|
|
871
869
|
"size": 0,
|
|
872
|
-
"origSize":
|
|
870
|
+
"origSize": 37,
|
|
873
871
|
"renderedExports": [],
|
|
874
872
|
"removedExports": [],
|
|
875
|
-
"dependents": [
|
|
873
|
+
"dependents": [
|
|
874
|
+
"/src/adapters/ws.ts"
|
|
875
|
+
],
|
|
876
876
|
"percent": 0,
|
|
877
877
|
"reduction": 100
|
|
878
878
|
},
|
|
@@ -904,8 +904,8 @@
|
|
|
904
904
|
"removedExports": [],
|
|
905
905
|
"dependents": [
|
|
906
906
|
"/src/adapters/express.ts",
|
|
907
|
-
"/src/adapters/standalone.ts",
|
|
908
907
|
"/src/adapters/next.ts",
|
|
908
|
+
"/src/adapters/standalone.ts",
|
|
909
909
|
"/src/adapters/ws.ts",
|
|
910
910
|
"/src/adapters/node-http/nodeHTTPRequestHandler.ts",
|
|
911
911
|
"/src/adapters/next-app-dir/nextAppDirCaller.ts",
|
|
@@ -946,16 +946,6 @@
|
|
|
946
946
|
"percent": 0,
|
|
947
947
|
"reduction": 100
|
|
948
948
|
},
|
|
949
|
-
{
|
|
950
|
-
"id": "/src/adapters/fetch/index.ts",
|
|
951
|
-
"size": 0,
|
|
952
|
-
"origSize": 64,
|
|
953
|
-
"renderedExports": [],
|
|
954
|
-
"removedExports": [],
|
|
955
|
-
"dependents": [],
|
|
956
|
-
"percent": 0,
|
|
957
|
-
"reduction": 100
|
|
958
|
-
},
|
|
959
949
|
{
|
|
960
950
|
"id": "/src/adapters/node-http/index.ts",
|
|
961
951
|
"size": 0,
|
|
@@ -964,13 +954,23 @@
|
|
|
964
954
|
"removedExports": [],
|
|
965
955
|
"dependents": [
|
|
966
956
|
"/src/adapters/express.ts",
|
|
967
|
-
"/src/adapters/standalone.ts",
|
|
968
957
|
"/src/adapters/next.ts",
|
|
958
|
+
"/src/adapters/standalone.ts",
|
|
969
959
|
"/src/adapters/ws.ts",
|
|
970
960
|
"/src/adapters/fastify/fastifyRequestHandler.ts"
|
|
971
961
|
],
|
|
972
962
|
"percent": 0,
|
|
973
963
|
"reduction": 100
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
"id": "/src/adapters/fetch/index.ts",
|
|
967
|
+
"size": 0,
|
|
968
|
+
"origSize": 64,
|
|
969
|
+
"renderedExports": [],
|
|
970
|
+
"removedExports": [],
|
|
971
|
+
"dependents": [],
|
|
972
|
+
"percent": 0,
|
|
973
|
+
"reduction": 100
|
|
974
974
|
}
|
|
975
975
|
],
|
|
976
976
|
"moduleCount": 63
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonl.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/stream/jsonl.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,MAAM,2BAA2B,CAAC,UAAU,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,EAAE,CACA,SAAS,EAAE,MAAM,GAAG,MAAM,EAC1B,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GACjC,yBAAyB,CAAC;CAC9B,CAAC;
|
|
1
|
+
{"version":3,"file":"jsonl.d.ts","sourceRoot":"","sources":["../../../src/unstable-core-do-not-import/stream/jsonl.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,MAAM,2BAA2B,CAAC,UAAU,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,EAAE,CACA,SAAS,EAAE,MAAM,GAAG,MAAM,EAC1B,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GACjC,yBA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uB,SAAQ,KAAK;gBAC5B,KAAK,CAAC,EAAE,OAAO;CAK5B;AAMD,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,KAAK,IAAI,CAAC;AAkFjE;;GAEG;AACH,KAAK,eAAe,GAAG,SAAS,GAAG,sBAAsB,CAAC;AA8F1D;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE;IACrD,IAAI,EAAE,yBAAyB,GAAG,sBAAsB,CAAC;IACzD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,KAAK,KAAK,CAAC;IAClD;;OAEG;IACH,eAAe,EAAE,eAAe,CAAC;CAClC;2BAxC+B,UAAU;qBArCvB,eAAe;;;;;;wBAiDL,OAAO;IA0JnC"}
|
|
@@ -86,7 +86,9 @@ function _ts_dispose_resources(env) {
|
|
|
86
86
|
return next();
|
|
87
87
|
})(env);
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
function isPlainObject(value) {
|
|
90
|
+
return Object.prototype.toString.call(value) === '[object Object]';
|
|
91
|
+
}
|
|
90
92
|
// ---------- types
|
|
91
93
|
const CHUNK_VALUE_TYPE_PROMISE = 0;
|
|
92
94
|
const CHUNK_VALUE_TYPE_ASYNC_ITERABLE = 1;
|
|
@@ -235,13 +237,6 @@ async function* createBatchStreamProducer(opts) {
|
|
|
235
237
|
[]
|
|
236
238
|
];
|
|
237
239
|
}
|
|
238
|
-
if (!utils.isObject(value)) {
|
|
239
|
-
return [
|
|
240
|
-
[
|
|
241
|
-
value
|
|
242
|
-
]
|
|
243
|
-
];
|
|
244
|
-
}
|
|
245
240
|
const reg = encodeAsync(value, path);
|
|
246
241
|
if (reg) {
|
|
247
242
|
return [
|
|
@@ -254,6 +249,13 @@ async function* createBatchStreamProducer(opts) {
|
|
|
254
249
|
]
|
|
255
250
|
];
|
|
256
251
|
}
|
|
252
|
+
if (!isPlainObject(value)) {
|
|
253
|
+
return [
|
|
254
|
+
[
|
|
255
|
+
value
|
|
256
|
+
]
|
|
257
|
+
];
|
|
258
|
+
}
|
|
257
259
|
const newObj = {};
|
|
258
260
|
const asyncValues = [];
|
|
259
261
|
for (const [key, item] of Object.entries(value)){
|
|
@@ -84,7 +84,9 @@ function _ts_dispose_resources(env) {
|
|
|
84
84
|
return next();
|
|
85
85
|
})(env);
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
function isPlainObject(value) {
|
|
88
|
+
return Object.prototype.toString.call(value) === '[object Object]';
|
|
89
|
+
}
|
|
88
90
|
// ---------- types
|
|
89
91
|
const CHUNK_VALUE_TYPE_PROMISE = 0;
|
|
90
92
|
const CHUNK_VALUE_TYPE_ASYNC_ITERABLE = 1;
|
|
@@ -233,13 +235,6 @@ async function* createBatchStreamProducer(opts) {
|
|
|
233
235
|
[]
|
|
234
236
|
];
|
|
235
237
|
}
|
|
236
|
-
if (!isObject(value)) {
|
|
237
|
-
return [
|
|
238
|
-
[
|
|
239
|
-
value
|
|
240
|
-
]
|
|
241
|
-
];
|
|
242
|
-
}
|
|
243
238
|
const reg = encodeAsync(value, path);
|
|
244
239
|
if (reg) {
|
|
245
240
|
return [
|
|
@@ -252,6 +247,13 @@ async function* createBatchStreamProducer(opts) {
|
|
|
252
247
|
]
|
|
253
248
|
];
|
|
254
249
|
}
|
|
250
|
+
if (!isPlainObject(value)) {
|
|
251
|
+
return [
|
|
252
|
+
[
|
|
253
|
+
value
|
|
254
|
+
]
|
|
255
|
+
];
|
|
256
|
+
}
|
|
255
257
|
const newObj = {};
|
|
256
258
|
const asyncValues = [];
|
|
257
259
|
for (const [key, item] of Object.entries(value)){
|
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.746+6c15b0575",
|
|
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": "6c15b0575d18179ddf964d89d8295aabad39f2cc"
|
|
156
156
|
}
|
|
@@ -22,7 +22,9 @@ export type NodeJSReadableStreamEsque = {
|
|
|
22
22
|
): NodeJSReadableStreamEsque;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
function isPlainObject(value: unknown): value is Record<string, unknown> {
|
|
26
|
+
return Object.prototype.toString.call(value) === '[object Object]';
|
|
27
|
+
}
|
|
26
28
|
|
|
27
29
|
// ---------- types
|
|
28
30
|
const CHUNK_VALUE_TYPE_PROMISE = 0;
|
|
@@ -230,14 +232,16 @@ async function* createBatchStreamProducer(
|
|
|
230
232
|
if (value === undefined) {
|
|
231
233
|
return [[]];
|
|
232
234
|
}
|
|
233
|
-
if (!isObject(value)) {
|
|
234
|
-
return [[value]];
|
|
235
|
-
}
|
|
236
235
|
const reg = encodeAsync(value, path);
|
|
237
236
|
if (reg) {
|
|
238
237
|
return [[placeholder], [null, ...reg]];
|
|
239
238
|
}
|
|
240
|
-
|
|
239
|
+
|
|
240
|
+
if (!isPlainObject(value)) {
|
|
241
|
+
return [[value]];
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const newObj: Record<string, unknown> = {};
|
|
241
245
|
const asyncValues: ChunkDefinition[] = [];
|
|
242
246
|
for (const [key, item] of Object.entries(value)) {
|
|
243
247
|
const transformed = encodeAsync(item, [...path, key]);
|
|
@@ -258,7 +262,7 @@ async function* createBatchStreamProducer(
|
|
|
258
262
|
|
|
259
263
|
yield newHead;
|
|
260
264
|
|
|
261
|
-
let iterable: AsyncIterable<
|
|
265
|
+
let iterable: AsyncIterable<ChunkData | typeof PING_SYM, void> =
|
|
262
266
|
mergedIterables;
|
|
263
267
|
if (opts.pingMs) {
|
|
264
268
|
iterable = withPing(mergedIterables, opts.pingMs);
|