@trpc/client 11.0.0-rc.383 → 11.0.0-rc.394
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 26.
|
|
2
|
+
"bundleSize": 46976,
|
|
3
|
+
"bundleOrigSize": 63519,
|
|
4
|
+
"bundleReduction": 26.04,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/links/wsLink.ts",
|
|
@@ -13,20 +13,20 @@
|
|
|
13
13
|
],
|
|
14
14
|
"removedExports": [],
|
|
15
15
|
"dependents": [],
|
|
16
|
-
"percent": 25.
|
|
16
|
+
"percent": 25.67,
|
|
17
17
|
"reduction": 11.68
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"id": "/src/links/httpBatchStreamLink.ts",
|
|
21
|
-
"size":
|
|
22
|
-
"origSize":
|
|
21
|
+
"size": 6153,
|
|
22
|
+
"origSize": 6253,
|
|
23
23
|
"renderedExports": [
|
|
24
24
|
"unstable_httpBatchStreamLink"
|
|
25
25
|
],
|
|
26
26
|
"removedExports": [],
|
|
27
27
|
"dependents": [],
|
|
28
|
-
"percent":
|
|
29
|
-
"reduction":
|
|
28
|
+
"percent": 13.1,
|
|
29
|
+
"reduction": 1.6
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"id": "/src/links/loggerLink.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
],
|
|
38
38
|
"removedExports": [],
|
|
39
39
|
"dependents": [],
|
|
40
|
-
"percent": 11.
|
|
40
|
+
"percent": 11.62,
|
|
41
41
|
"reduction": 18.48
|
|
42
42
|
},
|
|
43
43
|
{
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"/src/links/httpBatchLink.ts",
|
|
53
53
|
"/src/links/httpBatchStreamLink.ts"
|
|
54
54
|
],
|
|
55
|
-
"percent": 9.
|
|
55
|
+
"percent": 9.59,
|
|
56
56
|
"reduction": 6.34
|
|
57
57
|
},
|
|
58
58
|
{
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
],
|
|
65
65
|
"removedExports": [],
|
|
66
66
|
"dependents": [],
|
|
67
|
-
"percent": 8.
|
|
67
|
+
"percent": 8.31,
|
|
68
68
|
"reduction": 4.12
|
|
69
69
|
},
|
|
70
70
|
{
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"/src/links/httpLink.ts",
|
|
87
87
|
"/src/links/httpBatchStreamLink.ts"
|
|
88
88
|
],
|
|
89
|
-
"percent": 7.
|
|
89
|
+
"percent": 7.38,
|
|
90
90
|
"reduction": 41.47
|
|
91
91
|
},
|
|
92
92
|
{
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
],
|
|
99
99
|
"removedExports": [],
|
|
100
100
|
"dependents": [],
|
|
101
|
-
"percent": 6.
|
|
101
|
+
"percent": 6.26,
|
|
102
102
|
"reduction": 15.03
|
|
103
103
|
},
|
|
104
104
|
{
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"/src/createTRPCUntypedClient.ts",
|
|
114
114
|
"/src/createTRPCClient.ts"
|
|
115
115
|
],
|
|
116
|
-
"percent": 4.
|
|
116
|
+
"percent": 4.89,
|
|
117
117
|
"reduction": 45.35
|
|
118
118
|
},
|
|
119
119
|
{
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"/src/internals/TRPCUntypedClient.ts",
|
|
134
134
|
"/src/links/internals/httpUtils.ts"
|
|
135
135
|
],
|
|
136
|
-
"percent":
|
|
136
|
+
"percent": 3.97,
|
|
137
137
|
"reduction": 45.71
|
|
138
138
|
},
|
|
139
139
|
{
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"dependents": [
|
|
151
151
|
"/src/index.ts"
|
|
152
152
|
],
|
|
153
|
-
"percent": 2.
|
|
153
|
+
"percent": 2.57,
|
|
154
154
|
"reduction": 72.4
|
|
155
155
|
},
|
|
156
156
|
{
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
"/src/links/splitLink.ts",
|
|
166
166
|
"/src/internals/TRPCUntypedClient.ts"
|
|
167
167
|
],
|
|
168
|
-
"percent": 1.
|
|
168
|
+
"percent": 1.47,
|
|
169
169
|
"reduction": 32.75
|
|
170
170
|
},
|
|
171
171
|
{
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
],
|
|
178
178
|
"removedExports": [],
|
|
179
179
|
"dependents": [],
|
|
180
|
-
"percent": 1.
|
|
180
|
+
"percent": 1.3,
|
|
181
181
|
"reduction": 44.95
|
|
182
182
|
},
|
|
183
183
|
{
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
"dependents": [
|
|
192
192
|
"/src/unstable-internals.ts"
|
|
193
193
|
],
|
|
194
|
-
"percent": 1.
|
|
194
|
+
"percent": 1.2,
|
|
195
195
|
"reduction": 66.75
|
|
196
196
|
},
|
|
197
197
|
{
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
"/src/index.ts",
|
|
207
207
|
"/src/links/internals/httpUtils.ts"
|
|
208
208
|
],
|
|
209
|
-
"percent": 0.
|
|
209
|
+
"percent": 0.91,
|
|
210
210
|
"reduction": 33.54
|
|
211
211
|
},
|
|
212
212
|
{
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
"dependents": [
|
|
221
221
|
"/src/links/internals/httpUtils.ts"
|
|
222
222
|
],
|
|
223
|
-
"percent": 0.
|
|
223
|
+
"percent": 0.84,
|
|
224
224
|
"reduction": 30.4
|
|
225
225
|
},
|
|
226
226
|
{
|
|
@@ -234,7 +234,7 @@
|
|
|
234
234
|
],
|
|
235
235
|
"removedExports": [],
|
|
236
236
|
"dependents": [],
|
|
237
|
-
"percent": 0.
|
|
237
|
+
"percent": 0.7,
|
|
238
238
|
"reduction": 15.17
|
|
239
239
|
},
|
|
240
240
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpBatchStreamLink.d.ts","sourceRoot":"","sources":["../../src/links/httpBatchStreamLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,cAAc,CAAC;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAM7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAQnE,OAAO,KAAK,EAAa,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,MAAM,0BAA0B,CAAC,KAAK,SAAS,YAAY,IAC/D,oBAAoB,CAAC,KAAK,CAAC,GAAG;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEJ;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,SAAS,SAAS,EACpE,IAAI,EAAE,0BAA0B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,GACrE,QAAQ,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"httpBatchStreamLink.d.ts","sourceRoot":"","sources":["../../src/links/httpBatchStreamLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,cAAc,CAAC;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAM7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAQnE,OAAO,KAAK,EAAa,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,MAAM,0BAA0B,CAAC,KAAK,SAAS,YAAY,IAC/D,oBAAoB,CAAC,KAAK,CAAC,GAAG;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEJ;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,SAAS,SAAS,EACpE,IAAI,EAAE,0BAA0B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,GACrE,QAAQ,CAAC,OAAO,CAAC,CAkKnB"}
|
|
@@ -65,7 +65,14 @@ var httpUtils = require('./internals/httpUtils.js');
|
|
|
65
65
|
}
|
|
66
66
|
const [head] = await unstableCoreDoNotImport.jsonlStreamConsumer({
|
|
67
67
|
from: res.body,
|
|
68
|
-
deserialize: resolvedOpts.transformer.output.deserialize
|
|
68
|
+
deserialize: resolvedOpts.transformer.output.deserialize,
|
|
69
|
+
// onError: console.error,
|
|
70
|
+
formatError (opts) {
|
|
71
|
+
const error = opts.error;
|
|
72
|
+
return TRPCClientError.TRPCClientError.from({
|
|
73
|
+
error
|
|
74
|
+
});
|
|
75
|
+
}
|
|
69
76
|
});
|
|
70
77
|
const promises = Object.keys(batchOps).map(async (key)=>{
|
|
71
78
|
let json = await head[key];
|
|
@@ -63,7 +63,14 @@ import { resolveHTTPLinkOptions, getUrl, fetchHTTPResponse, getBody } from './in
|
|
|
63
63
|
}
|
|
64
64
|
const [head] = await jsonlStreamConsumer({
|
|
65
65
|
from: res.body,
|
|
66
|
-
deserialize: resolvedOpts.transformer.output.deserialize
|
|
66
|
+
deserialize: resolvedOpts.transformer.output.deserialize,
|
|
67
|
+
// onError: console.error,
|
|
68
|
+
formatError (opts) {
|
|
69
|
+
const error = opts.error;
|
|
70
|
+
return TRPCClientError.from({
|
|
71
|
+
error
|
|
72
|
+
});
|
|
73
|
+
}
|
|
67
74
|
});
|
|
68
75
|
const promises = Object.keys(batchOps).map(async (key)=>{
|
|
69
76
|
let json = await head[key];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/client",
|
|
3
|
-
"version": "11.0.0-rc.
|
|
3
|
+
"version": "11.0.0-rc.394+eab054f77",
|
|
4
4
|
"description": "The tRPC client library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
"!**/*.test.*"
|
|
77
77
|
],
|
|
78
78
|
"peerDependencies": {
|
|
79
|
-
"@trpc/server": "11.0.0-rc.
|
|
79
|
+
"@trpc/server": "11.0.0-rc.394+eab054f77"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@trpc/server": "11.0.0-rc.
|
|
82
|
+
"@trpc/server": "11.0.0-rc.394+eab054f77",
|
|
83
83
|
"@types/isomorphic-fetch": "^0.0.39",
|
|
84
84
|
"@types/node": "^20.10.0",
|
|
85
85
|
"eslint": "^8.56.0",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"funding": [
|
|
97
97
|
"https://trpc.io/sponsor"
|
|
98
98
|
],
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "eab054f77f6c86bee3a3959b8312fdefd739378a"
|
|
100
100
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AnyRouter, ProcedureType } from '@trpc/server';
|
|
2
2
|
import { observable } from '@trpc/server/observable';
|
|
3
|
-
import type { TRPCResponse } from '@trpc/server/rpc';
|
|
3
|
+
import type { TRPCErrorShape, TRPCResponse } from '@trpc/server/rpc';
|
|
4
4
|
import type { AnyRootTypes } from '@trpc/server/unstable-core-do-not-import';
|
|
5
5
|
import { jsonlStreamConsumer } from '@trpc/server/unstable-core-do-not-import';
|
|
6
6
|
import type { BatchLoader } from '../internals/dataLoader';
|
|
@@ -104,6 +104,12 @@ export function unstable_httpBatchStreamLink<TRouter extends AnyRouter>(
|
|
|
104
104
|
from: res.body,
|
|
105
105
|
deserialize: resolvedOpts.transformer.output.deserialize,
|
|
106
106
|
// onError: console.error,
|
|
107
|
+
formatError(opts) {
|
|
108
|
+
const error = opts.error as TRPCErrorShape;
|
|
109
|
+
return TRPCClientError.from({
|
|
110
|
+
error,
|
|
111
|
+
});
|
|
112
|
+
},
|
|
107
113
|
});
|
|
108
114
|
|
|
109
115
|
const promises = Object.keys(batchOps).map(
|