@trpc/client 11.0.0-alpha-tmp.231 → 11.0.0-alpha-tmp.234
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 +25 -25
- package/dist/index.js +9 -10
- package/dist/index.mjs +11 -12
- package/dist/links/httpFormDataLink.d.ts.map +1 -1
- package/dist/links/internals/httpUtils.d.ts +2 -2
- package/dist/links/internals/httpUtils.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/links/httpFormDataLink.ts +10 -13
- package/src/links/internals/httpUtils.ts +2 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 27.
|
|
2
|
+
"bundleSize": 47808,
|
|
3
|
+
"bundleOrigSize": 65642,
|
|
4
|
+
"bundleReduction": 27.17,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/links/wsLink.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"removedExports": [],
|
|
15
15
|
"dependents": [],
|
|
16
|
-
"percent": 25.
|
|
16
|
+
"percent": 25.03,
|
|
17
17
|
"reduction": 10
|
|
18
18
|
},
|
|
19
19
|
{
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
],
|
|
26
26
|
"removedExports": [],
|
|
27
27
|
"dependents": [],
|
|
28
|
-
"percent": 10.
|
|
28
|
+
"percent": 10.95,
|
|
29
29
|
"reduction": 18.76
|
|
30
30
|
},
|
|
31
31
|
{
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dependents": [
|
|
40
40
|
"/src/links/internals/createHTTPBatchLink.ts"
|
|
41
41
|
],
|
|
42
|
-
"percent": 9.
|
|
42
|
+
"percent": 9.22,
|
|
43
43
|
"reduction": 7.39
|
|
44
44
|
},
|
|
45
45
|
{
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"dependents": [
|
|
55
55
|
"/src/links/httpBatchStreamLink.ts"
|
|
56
56
|
],
|
|
57
|
-
"percent": 8.
|
|
57
|
+
"percent": 8.38,
|
|
58
58
|
"reduction": 18.61
|
|
59
59
|
},
|
|
60
60
|
{
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
{
|
|
76
76
|
"id": "/src/links/internals/httpUtils.ts",
|
|
77
77
|
"size": 3243,
|
|
78
|
-
"origSize":
|
|
78
|
+
"origSize": 5267,
|
|
79
79
|
"renderedExports": [
|
|
80
80
|
"resolveHTTPLinkOptions",
|
|
81
81
|
"getUrl",
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
"/src/links/internals/createHTTPBatchLink.ts",
|
|
93
93
|
"/src/links/httpBatchLink.ts"
|
|
94
94
|
],
|
|
95
|
-
"percent": 6.
|
|
96
|
-
"reduction": 38.
|
|
95
|
+
"percent": 6.78,
|
|
96
|
+
"reduction": 38.43
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"id": "/src/links/internals/createHTTPBatchLink.ts",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"/src/links/httpBatchStreamLink.ts",
|
|
108
108
|
"/src/links/httpBatchLink.ts"
|
|
109
109
|
],
|
|
110
|
-
"percent": 6.
|
|
110
|
+
"percent": 6.09,
|
|
111
111
|
"reduction": 16.42
|
|
112
112
|
},
|
|
113
113
|
{
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"dependents": [
|
|
123
123
|
"/src/links/httpFormDataLink.ts"
|
|
124
124
|
],
|
|
125
|
-
"percent": 4.
|
|
125
|
+
"percent": 4.54,
|
|
126
126
|
"reduction": 13.05
|
|
127
127
|
},
|
|
128
128
|
{
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"/src/links/internals/httpUtils.ts",
|
|
142
142
|
"/src/links/internals/createHTTPBatchLink.ts"
|
|
143
143
|
],
|
|
144
|
-
"percent": 3.
|
|
144
|
+
"percent": 3.78,
|
|
145
145
|
"reduction": 43.92
|
|
146
146
|
},
|
|
147
147
|
{
|
|
@@ -202,6 +202,18 @@
|
|
|
202
202
|
"percent": 2.41,
|
|
203
203
|
"reduction": 73.26
|
|
204
204
|
},
|
|
205
|
+
{
|
|
206
|
+
"id": "/src/links/httpFormDataLink.ts",
|
|
207
|
+
"size": 709,
|
|
208
|
+
"origSize": 727,
|
|
209
|
+
"renderedExports": [
|
|
210
|
+
"experimental_formDataLink"
|
|
211
|
+
],
|
|
212
|
+
"removedExports": [],
|
|
213
|
+
"dependents": [],
|
|
214
|
+
"percent": 1.48,
|
|
215
|
+
"reduction": 2.48
|
|
216
|
+
},
|
|
205
217
|
{
|
|
206
218
|
"id": "/src/links/internals/createChain.ts",
|
|
207
219
|
"size": 690,
|
|
@@ -217,18 +229,6 @@
|
|
|
217
229
|
"percent": 1.44,
|
|
218
230
|
"reduction": 29.38
|
|
219
231
|
},
|
|
220
|
-
{
|
|
221
|
-
"id": "/src/links/httpFormDataLink.ts",
|
|
222
|
-
"size": 663,
|
|
223
|
-
"origSize": 818,
|
|
224
|
-
"renderedExports": [
|
|
225
|
-
"experimental_formDataLink"
|
|
226
|
-
],
|
|
227
|
-
"removedExports": [],
|
|
228
|
-
"dependents": [],
|
|
229
|
-
"percent": 1.39,
|
|
230
|
-
"reduction": 18.95
|
|
231
|
-
},
|
|
232
232
|
{
|
|
233
233
|
"id": "/src/links/splitLink.ts",
|
|
234
234
|
"size": 598,
|
package/dist/index.js
CHANGED
|
@@ -327,15 +327,6 @@ const streamRequester = (requesterOpts)=>{
|
|
|
327
327
|
};
|
|
328
328
|
const unstable_httpBatchStreamLink = links_httpBatchLink.createHTTPBatchLink(streamRequester);
|
|
329
329
|
|
|
330
|
-
const getBody = (opts)=>{
|
|
331
|
-
if (!('input' in opts)) {
|
|
332
|
-
return undefined;
|
|
333
|
-
}
|
|
334
|
-
if (!(opts.input instanceof FormData)) {
|
|
335
|
-
throw new Error('Input is not FormData');
|
|
336
|
-
}
|
|
337
|
-
return opts.input;
|
|
338
|
-
};
|
|
339
330
|
const formDataRequester = (opts)=>{
|
|
340
331
|
if (opts.type !== 'mutation') {
|
|
341
332
|
// TODO(?) handle formdata queries
|
|
@@ -346,7 +337,15 @@ const formDataRequester = (opts)=>{
|
|
|
346
337
|
getUrl () {
|
|
347
338
|
return `${opts.url}/${opts.path}`;
|
|
348
339
|
},
|
|
349
|
-
getBody
|
|
340
|
+
getBody (opts) {
|
|
341
|
+
if (!('input' in opts)) {
|
|
342
|
+
return undefined;
|
|
343
|
+
}
|
|
344
|
+
if (!(opts.input instanceof FormData)) {
|
|
345
|
+
throw new Error('Input is not FormData');
|
|
346
|
+
}
|
|
347
|
+
return opts.input;
|
|
348
|
+
}
|
|
350
349
|
});
|
|
351
350
|
};
|
|
352
351
|
const experimental_formDataLink = links_httpLink.httpLinkFactory({
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ export { s as splitLink } from './splitLink-13989f7f.mjs';
|
|
|
4
4
|
import { T as TRPCClientError } from './TRPCClientError-3414c3d5.mjs';
|
|
5
5
|
export { T as TRPCClientError } from './TRPCClientError-3414c3d5.mjs';
|
|
6
6
|
import { createFlatProxy, createRecursiveProxy } from '@trpc/core';
|
|
7
|
-
import { f as fetchHTTPResponse, g as getUrl, a as getBody
|
|
7
|
+
import { f as fetchHTTPResponse, g as getUrl, a as getBody, h as httpRequest } from './httpUtils-82ae6a64.mjs';
|
|
8
8
|
export { b as getFetch } from './httpUtils-82ae6a64.mjs';
|
|
9
9
|
import { c as createHTTPBatchLink } from './httpBatchLink-a1f60db9.mjs';
|
|
10
10
|
export { h as httpBatchLink } from './httpBatchLink-a1f60db9.mjs';
|
|
@@ -267,7 +267,7 @@ const streamingJsonHttpRequester = (opts, onSingle)=>{
|
|
|
267
267
|
contentTypeHeader: 'application/json',
|
|
268
268
|
batchModeHeader: 'stream',
|
|
269
269
|
getUrl,
|
|
270
|
-
getBody
|
|
270
|
+
getBody
|
|
271
271
|
}, ac);
|
|
272
272
|
const cancel = ()=>ac?.abort();
|
|
273
273
|
const promise = responsePromise.then(async (res)=>{
|
|
@@ -328,15 +328,6 @@ const streamRequester = (requesterOpts)=>{
|
|
|
328
328
|
};
|
|
329
329
|
const unstable_httpBatchStreamLink = createHTTPBatchLink(streamRequester);
|
|
330
330
|
|
|
331
|
-
const getBody = (opts)=>{
|
|
332
|
-
if (!('input' in opts)) {
|
|
333
|
-
return undefined;
|
|
334
|
-
}
|
|
335
|
-
if (!(opts.input instanceof FormData)) {
|
|
336
|
-
throw new Error('Input is not FormData');
|
|
337
|
-
}
|
|
338
|
-
return opts.input;
|
|
339
|
-
};
|
|
340
331
|
const formDataRequester = (opts)=>{
|
|
341
332
|
if (opts.type !== 'mutation') {
|
|
342
333
|
// TODO(?) handle formdata queries
|
|
@@ -347,7 +338,15 @@ const formDataRequester = (opts)=>{
|
|
|
347
338
|
getUrl () {
|
|
348
339
|
return `${opts.url}/${opts.path}`;
|
|
349
340
|
},
|
|
350
|
-
getBody
|
|
341
|
+
getBody (opts) {
|
|
342
|
+
if (!('input' in opts)) {
|
|
343
|
+
return undefined;
|
|
344
|
+
}
|
|
345
|
+
if (!(opts.input instanceof FormData)) {
|
|
346
|
+
throw new Error('Input is not FormData');
|
|
347
|
+
}
|
|
348
|
+
return opts.input;
|
|
349
|
+
}
|
|
351
350
|
});
|
|
352
351
|
};
|
|
353
352
|
const experimental_formDataLink = httpLinkFactory({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpFormDataLink.d.ts","sourceRoot":"","sources":["../../src/links/httpFormDataLink.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"httpFormDataLink.d.ts","sourceRoot":"","sources":["../../src/links/httpFormDataLink.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,yBAAyB,qIAEpC,CAAC"}
|
|
@@ -41,8 +41,8 @@ export type HTTPBaseRequestOptions = GetInputOptions & ResolvedHTTPLinkOptions &
|
|
|
41
41
|
type: ProcedureType;
|
|
42
42
|
path: string;
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
type GetUrl = (opts: HTTPBaseRequestOptions) => string;
|
|
45
|
+
type GetBody = (opts: HTTPBaseRequestOptions) => RequestInitEsque['body'];
|
|
46
46
|
export type ContentOptions = {
|
|
47
47
|
batchModeHeader?: 'stream';
|
|
48
48
|
contentTypeHeader?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpUtils.d.ts","sourceRoot":"","sources":["../../../src/links/internals/httpUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,UAAU,EACV,gBAAgB,EAChB,aAAa,EACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;OAEG;IACH,eAAe,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;CAC/C;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,eAAe,EAAE,oBAAoB,GAAG,IAAI,CAAC;CAC9C;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,mBAAmB,GACxB,uBAAuB,CAMzB;AAiBD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE;QACJ,QAAQ,EAAE,aAAa,CAAC;QAC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B,CAAC;CAChC,CAAC;AAEJ,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,kBAAkB,EACxB,EAAE,CAAC,EAAE,4BAA4B,GAAG,IAAI,0BAgCzC;AAED,wBAAgB,WAAW,CACzB,IAAI,EAAE,kBAAkB,GACvB,gBAAgB,CAAC,UAAU,CAAC,CA8B9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/client",
|
|
3
|
-
"version": "11.0.0-alpha-tmp.
|
|
3
|
+
"version": "11.0.0-alpha-tmp.234+517856c20",
|
|
4
4
|
"description": "The tRPC client library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"!**/*.test.*"
|
|
77
77
|
],
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@trpc/core": "11.0.0-alpha-tmp.
|
|
79
|
+
"@trpc/core": "11.0.0-alpha-tmp.234+517856c20"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@testing-library/dom": "^9.0.0",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"funding": [
|
|
97
97
|
"https://trpc.io/sponsor"
|
|
98
98
|
],
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "517856c209e3647bbb42460b90ec2c54e334dc1c"
|
|
100
100
|
}
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
import { RequestInitEsque } from '../internals/types';
|
|
2
1
|
import { httpLinkFactory } from './httpLink';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const getBody: GetBody = (opts) => {
|
|
6
|
-
if (!('input' in opts)) {
|
|
7
|
-
return undefined;
|
|
8
|
-
}
|
|
9
|
-
if (!(opts.input instanceof FormData)) {
|
|
10
|
-
throw new Error('Input is not FormData');
|
|
11
|
-
}
|
|
12
|
-
return opts.input as RequestInitEsque['body'];
|
|
13
|
-
};
|
|
2
|
+
import { httpRequest, Requester } from './internals/httpUtils';
|
|
14
3
|
|
|
15
4
|
const formDataRequester: Requester = (opts) => {
|
|
16
5
|
if (opts.type !== 'mutation') {
|
|
@@ -22,7 +11,15 @@ const formDataRequester: Requester = (opts) => {
|
|
|
22
11
|
getUrl() {
|
|
23
12
|
return `${opts.url}/${opts.path}`;
|
|
24
13
|
},
|
|
25
|
-
getBody
|
|
14
|
+
getBody(opts) {
|
|
15
|
+
if (!('input' in opts)) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
if (!(opts.input instanceof FormData)) {
|
|
19
|
+
throw new Error('Input is not FormData');
|
|
20
|
+
}
|
|
21
|
+
return opts.input;
|
|
22
|
+
},
|
|
26
23
|
});
|
|
27
24
|
};
|
|
28
25
|
|
|
@@ -85,11 +85,8 @@ export type HTTPBaseRequestOptions = GetInputOptions &
|
|
|
85
85
|
path: string;
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
opts: HTTPBaseRequestOptions,
|
|
91
|
-
) => RequestInitEsque['body'];
|
|
92
|
-
|
|
88
|
+
type GetUrl = (opts: HTTPBaseRequestOptions) => string;
|
|
89
|
+
type GetBody = (opts: HTTPBaseRequestOptions) => RequestInitEsque['body'];
|
|
93
90
|
export type ContentOptions = {
|
|
94
91
|
batchModeHeader?: 'stream';
|
|
95
92
|
contentTypeHeader?: string;
|