@trpc/client 11.0.0-alpha-tmp-issues-6374.696 → 11.0.0-alpha-tmp-issues-6374.698
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 +22 -22
- package/dist/createTRPCClient.d.ts +6 -5
- package/dist/createTRPCClient.d.ts.map +1 -1
- package/dist/createTRPCClient.js +4 -4
- package/dist/createTRPCClient.mjs +5 -5
- package/dist/internals/TRPCUntypedClient.d.ts +5 -1
- package/dist/internals/TRPCUntypedClient.d.ts.map +1 -1
- package/dist/internals/TRPCUntypedClient.js +5 -2
- package/dist/internals/TRPCUntypedClient.mjs +5 -2
- package/package.json +4 -4
- package/src/createTRPCClient.ts +11 -9
- package/src/internals/TRPCUntypedClient.ts +5 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 20.
|
|
2
|
+
"bundleSize": 66400,
|
|
3
|
+
"bundleOrigSize": 83904,
|
|
4
|
+
"bundleReduction": 20.86,
|
|
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": 27.
|
|
16
|
+
"percent": 27.13,
|
|
17
17
|
"reduction": 10.3
|
|
18
18
|
},
|
|
19
19
|
{
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
],
|
|
26
26
|
"removedExports": [],
|
|
27
27
|
"dependents": [],
|
|
28
|
-
"percent": 11.
|
|
28
|
+
"percent": 11.73,
|
|
29
29
|
"reduction": 0
|
|
30
30
|
},
|
|
31
31
|
{
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
],
|
|
38
38
|
"removedExports": [],
|
|
39
39
|
"dependents": [],
|
|
40
|
-
"percent": 9.
|
|
40
|
+
"percent": 9.05,
|
|
41
41
|
"reduction": 4.42
|
|
42
42
|
},
|
|
43
43
|
{
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
],
|
|
50
50
|
"removedExports": [],
|
|
51
51
|
"dependents": [],
|
|
52
|
-
"percent": 8.
|
|
52
|
+
"percent": 8.43,
|
|
53
53
|
"reduction": 19.44
|
|
54
54
|
},
|
|
55
55
|
{
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"/src/links/httpBatchLink.ts",
|
|
65
65
|
"/src/links/httpBatchStreamLink.ts"
|
|
66
66
|
],
|
|
67
|
-
"percent": 6.
|
|
67
|
+
"percent": 6.15,
|
|
68
68
|
"reduction": 5.64
|
|
69
69
|
},
|
|
70
70
|
{
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
],
|
|
77
77
|
"removedExports": [],
|
|
78
78
|
"dependents": [],
|
|
79
|
-
"percent": 5.
|
|
79
|
+
"percent": 5.93,
|
|
80
80
|
"reduction": 5.59
|
|
81
81
|
},
|
|
82
82
|
{
|
|
@@ -99,24 +99,24 @@
|
|
|
99
99
|
"/src/links/httpBatchStreamLink.ts",
|
|
100
100
|
"/src/links/httpSubscriptionLink.ts"
|
|
101
101
|
],
|
|
102
|
-
"percent": 5.
|
|
102
|
+
"percent": 5.56,
|
|
103
103
|
"reduction": 37.14
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
106
|
"id": "/src/internals/TRPCUntypedClient.ts",
|
|
107
|
-
"size":
|
|
108
|
-
"origSize":
|
|
107
|
+
"size": 3402,
|
|
108
|
+
"origSize": 4855,
|
|
109
109
|
"renderedExports": [
|
|
110
110
|
"TRPCUntypedClient",
|
|
111
|
-
"
|
|
111
|
+
"untypedClientMarker"
|
|
112
112
|
],
|
|
113
113
|
"removedExports": [],
|
|
114
114
|
"dependents": [
|
|
115
115
|
"/src/createTRPCUntypedClient.ts",
|
|
116
116
|
"/src/createTRPCClient.ts"
|
|
117
117
|
],
|
|
118
|
-
"percent":
|
|
119
|
-
"reduction":
|
|
118
|
+
"percent": 5.12,
|
|
119
|
+
"reduction": 29.93
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
"id": "/src/links/httpLink.ts",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
],
|
|
128
128
|
"removedExports": [],
|
|
129
129
|
"dependents": [],
|
|
130
|
-
"percent": 4.
|
|
130
|
+
"percent": 4.79,
|
|
131
131
|
"reduction": 14.24
|
|
132
132
|
},
|
|
133
133
|
{
|
|
@@ -159,13 +159,13 @@
|
|
|
159
159
|
],
|
|
160
160
|
"removedExports": [],
|
|
161
161
|
"dependents": [],
|
|
162
|
-
"percent": 3.
|
|
162
|
+
"percent": 3.3,
|
|
163
163
|
"reduction": 18.8
|
|
164
164
|
},
|
|
165
165
|
{
|
|
166
166
|
"id": "/src/createTRPCClient.ts",
|
|
167
|
-
"size":
|
|
168
|
-
"origSize":
|
|
167
|
+
"size": 1314,
|
|
168
|
+
"origSize": 5146,
|
|
169
169
|
"renderedExports": [
|
|
170
170
|
"clientCallTypeToProcedureType",
|
|
171
171
|
"createTRPCClientProxy",
|
|
@@ -176,8 +176,8 @@
|
|
|
176
176
|
"dependents": [
|
|
177
177
|
"/src/index.ts"
|
|
178
178
|
],
|
|
179
|
-
"percent": 1.
|
|
180
|
-
"reduction": 74.
|
|
179
|
+
"percent": 1.98,
|
|
180
|
+
"reduction": 74.47
|
|
181
181
|
},
|
|
182
182
|
{
|
|
183
183
|
"id": "/src/internals/signals.ts",
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
"/src/index.ts",
|
|
250
250
|
"/src/links/internals/httpUtils.ts"
|
|
251
251
|
],
|
|
252
|
-
"percent": 0.
|
|
252
|
+
"percent": 0.64,
|
|
253
253
|
"reduction": 33.54
|
|
254
254
|
},
|
|
255
255
|
{
|
|
@@ -2,16 +2,17 @@ import type { Unsubscribable } from '@trpc/server/observable';
|
|
|
2
2
|
import type { AnyProcedure, AnyRouter, inferClientTypes, inferProcedureInput, inferTransformedProcedureOutput, IntersectionError, ProcedureOptions, ProcedureType, RouterRecord } from '@trpc/server/unstable-core-do-not-import';
|
|
3
3
|
import type { CreateTRPCClientOptions } from './createTRPCUntypedClient';
|
|
4
4
|
import type { TRPCSubscriptionObserver, UntypedClientProperties } from './internals/TRPCUntypedClient';
|
|
5
|
-
import { TRPCUntypedClient
|
|
5
|
+
import { TRPCUntypedClient } from './internals/TRPCUntypedClient';
|
|
6
6
|
import type { TRPCClientError } from './TRPCClientError';
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
declare const trpcClientSymbol: unique symbol;
|
|
7
11
|
/**
|
|
8
12
|
* @public
|
|
9
13
|
*/
|
|
10
14
|
export type TRPCClient<TRouter extends AnyRouter> = DecoratedProcedureRecord<TRouter, TRouter['_def']['record']> & {
|
|
11
|
-
[
|
|
12
|
-
errorShape: TRouter['_def']['_config']['$types']['errorShape'];
|
|
13
|
-
transformer: TRouter['_def']['_config']['$types']['transformer'];
|
|
14
|
-
}>;
|
|
15
|
+
[trpcClientSymbol]: true;
|
|
15
16
|
};
|
|
16
17
|
/**
|
|
17
18
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTRPCClient.d.ts","sourceRoot":"","sources":["../src/createTRPCClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACnB,+BAA+B,EAC/B,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,YAAY,EACb,MAAM,0CAA0C,CAAC;AAKlD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,iBAAiB,
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ED
|
@@ -26,7 +26,7 @@ const clientCallTypeMap = {
|
|
|
26
26
|
if (client.hasOwnProperty(key)) {
|
|
27
27
|
return client[key];
|
|
28
28
|
}
|
|
29
|
-
if (key === TRPCUntypedClient.
|
|
29
|
+
if (key === TRPCUntypedClient.untypedClientMarker) {
|
|
30
30
|
return client;
|
|
31
31
|
}
|
|
32
32
|
return proxy[key];
|
|
@@ -41,10 +41,10 @@ function createTRPCClient(opts) {
|
|
|
41
41
|
* Get an untyped client from a proxy client
|
|
42
42
|
* @internal
|
|
43
43
|
*/ function getUntypedClient(client) {
|
|
44
|
-
if (client
|
|
45
|
-
return client;
|
|
44
|
+
if (client[TRPCUntypedClient.untypedClientMarker]) {
|
|
45
|
+
return client[TRPCUntypedClient.untypedClientMarker];
|
|
46
46
|
}
|
|
47
|
-
return client
|
|
47
|
+
return client;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
exports.clientCallTypeToProcedureType = clientCallTypeToProcedureType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRecursiveProxy, createFlatProxy } from '@trpc/server/unstable-core-do-not-import';
|
|
2
|
-
import {
|
|
2
|
+
import { untypedClientMarker, TRPCUntypedClient } from './internals/TRPCUntypedClient.mjs';
|
|
3
3
|
|
|
4
4
|
const clientCallTypeMap = {
|
|
5
5
|
query: 'query',
|
|
@@ -24,7 +24,7 @@ const clientCallTypeMap = {
|
|
|
24
24
|
if (client.hasOwnProperty(key)) {
|
|
25
25
|
return client[key];
|
|
26
26
|
}
|
|
27
|
-
if (key ===
|
|
27
|
+
if (key === untypedClientMarker) {
|
|
28
28
|
return client;
|
|
29
29
|
}
|
|
30
30
|
return proxy[key];
|
|
@@ -39,10 +39,10 @@ function createTRPCClient(opts) {
|
|
|
39
39
|
* Get an untyped client from a proxy client
|
|
40
40
|
* @internal
|
|
41
41
|
*/ function getUntypedClient(client) {
|
|
42
|
-
if (client
|
|
43
|
-
return client;
|
|
42
|
+
if (client[untypedClientMarker]) {
|
|
43
|
+
return client[untypedClientMarker];
|
|
44
44
|
}
|
|
45
|
-
return client
|
|
45
|
+
return client;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export { clientCallTypeToProcedureType, createTRPCClient, createTRPCClientProxy, getUntypedClient };
|
|
@@ -38,5 +38,9 @@ export declare class TRPCUntypedClient<TInferrable extends InferrableClientTypes
|
|
|
38
38
|
mutation(path: string, input?: unknown, opts?: TRPCRequestOptions): Promise<unknown>;
|
|
39
39
|
subscription(path: string, input: unknown, opts: Partial<TRPCSubscriptionObserver<unknown, TRPCClientError<AnyRouter>>> & TRPCRequestOptions): Unsubscribable;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
* This would ideally be a Symbol but that won't work when @trpc/client isn't hoisted
|
|
44
|
+
*/
|
|
45
|
+
export declare const untypedClientMarker = "__internal_untypedClient";
|
|
42
46
|
//# sourceMappingURL=TRPCUntypedClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TRPCUntypedClient.d.ts","sourceRoot":"","sources":["../../src/internals/TRPCUntypedClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EACV,SAAS,EACT,uBAAuB,EACvB,qBAAqB,EAErB,SAAS,EACV,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,KAAK,EACV,gBAAgB,EAEhB,iBAAiB,EACjB,QAAQ,EACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,wBAAwB,CAAC,MA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AChB,MAAM,MAAM,uBAAuB,CAAC,OAAO,SAAS,qBAAqB,IAAI;IAC3E,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE,SAAS,CAAC,qEAAqE,CAAC,CAAC;CAChG,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,uBAAuB,GAC/B,UAAU,GACV,OAAO,GACP,UAAU,GACV,OAAO,GACP,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,cAAc,CAAC;AAEnB,qBAAa,iBAAiB,CAAC,WAAW,SAAS,qBAAqB;IACtE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA+B;IACrD,SAAgB,OAAO,EAAE,iBAAiB,CAAC;IAC3C,OAAO,CAAC,SAAS,CAAS;gBAEd,IAAI,EAAE,uBAAuB,CAAC,WAAW,CAAC;IAStD,OAAO,CAAC,QAAQ;YAkBF,gBAAgB;IAmBvB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,kBAAkB;IAS9D,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,kBAAkB;IASjE,YAAY,CACjB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,OAAO,CACX,wBAAwB,CAAC,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC,CAC9D,GACC,kBAAkB,GACnB,cAAc;CAwClB;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,6BAA6B,CAAC"}
|
|
@@ -112,7 +112,10 @@ class TRPCUntypedClient {
|
|
|
112
112
|
this.links = opts.links.map((link)=>link(this.runtime));
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
|
|
115
|
+
/**
|
|
116
|
+
* @internal
|
|
117
|
+
* This would ideally be a Symbol but that won't work when @trpc/client isn't hoisted
|
|
118
|
+
*/ const untypedClientMarker = '__internal_untypedClient';
|
|
116
119
|
|
|
117
120
|
exports.TRPCUntypedClient = TRPCUntypedClient;
|
|
118
|
-
exports.
|
|
121
|
+
exports.untypedClientMarker = untypedClientMarker;
|
|
@@ -110,6 +110,9 @@ class TRPCUntypedClient {
|
|
|
110
110
|
this.links = opts.links.map((link)=>link(this.runtime));
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
/**
|
|
114
|
+
* @internal
|
|
115
|
+
* This would ideally be a Symbol but that won't work when @trpc/client isn't hoisted
|
|
116
|
+
*/ const untypedClientMarker = '__internal_untypedClient';
|
|
114
117
|
|
|
115
|
-
export { TRPCUntypedClient,
|
|
118
|
+
export { TRPCUntypedClient, untypedClientMarker };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/client",
|
|
3
|
-
"version": "11.0.0-alpha-tmp-issues-6374.
|
|
3
|
+
"version": "11.0.0-alpha-tmp-issues-6374.698+f5be6c9a3",
|
|
4
4
|
"description": "The tRPC client library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"!**/__tests__"
|
|
78
78
|
],
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"@trpc/server": "11.0.0-alpha-tmp-issues-6374.
|
|
80
|
+
"@trpc/server": "11.0.0-alpha-tmp-issues-6374.698+f5be6c9a3",
|
|
81
81
|
"typescript": ">=5.7.2"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@trpc/server": "11.0.0-alpha-tmp-issues-6374.
|
|
84
|
+
"@trpc/server": "11.0.0-alpha-tmp-issues-6374.698+f5be6c9a3",
|
|
85
85
|
"@types/isomorphic-fetch": "^0.0.39",
|
|
86
86
|
"@types/node": "^22.9.0",
|
|
87
87
|
"eslint": "^9.13.0",
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"funding": [
|
|
100
100
|
"https://trpc.io/sponsor"
|
|
101
101
|
],
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "f5be6c9a3f4f829bc82c9bf4ac7875b7ade2b9ef"
|
|
103
103
|
}
|
package/src/createTRPCClient.ts
CHANGED
|
@@ -22,10 +22,15 @@ import type {
|
|
|
22
22
|
} from './internals/TRPCUntypedClient';
|
|
23
23
|
import {
|
|
24
24
|
TRPCUntypedClient,
|
|
25
|
-
|
|
25
|
+
untypedClientMarker,
|
|
26
26
|
} from './internals/TRPCUntypedClient';
|
|
27
27
|
import type { TRPCClientError } from './TRPCClientError';
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
const trpcClientSymbol = Symbol();
|
|
33
|
+
|
|
29
34
|
/**
|
|
30
35
|
* @public
|
|
31
36
|
*/
|
|
@@ -33,10 +38,7 @@ export type TRPCClient<TRouter extends AnyRouter> = DecoratedProcedureRecord<
|
|
|
33
38
|
TRouter,
|
|
34
39
|
TRouter['_def']['record']
|
|
35
40
|
> & {
|
|
36
|
-
[
|
|
37
|
-
errorShape: TRouter['_def']['_config']['$types']['errorShape'];
|
|
38
|
-
transformer: TRouter['_def']['_config']['$types']['transformer'];
|
|
39
|
-
}>;
|
|
41
|
+
[trpcClientSymbol]: true;
|
|
40
42
|
};
|
|
41
43
|
|
|
42
44
|
/**
|
|
@@ -161,7 +163,7 @@ export function createTRPCClientProxy<TRouter extends AnyRouter>(
|
|
|
161
163
|
if (client.hasOwnProperty(key)) {
|
|
162
164
|
return (client as any)[key as any];
|
|
163
165
|
}
|
|
164
|
-
if (key ===
|
|
166
|
+
if (key === untypedClientMarker) {
|
|
165
167
|
return client;
|
|
166
168
|
}
|
|
167
169
|
return proxy[key];
|
|
@@ -186,8 +188,8 @@ export function getUntypedClient<TRouter extends AnyRouter>(
|
|
|
186
188
|
errorShape: TRouter['_def']['_config']['$types']['errorShape'];
|
|
187
189
|
transformer: TRouter['_def']['_config']['$types']['transformer'];
|
|
188
190
|
}> {
|
|
189
|
-
if (client
|
|
190
|
-
return client;
|
|
191
|
+
if ((client as any)[untypedClientMarker]) {
|
|
192
|
+
return (client as any)[untypedClientMarker];
|
|
191
193
|
}
|
|
192
|
-
return client
|
|
194
|
+
return client as any;
|
|
193
195
|
}
|
|
@@ -173,4 +173,8 @@ export class TRPCUntypedClient<TInferrable extends InferrableClientTypes> {
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
|
|
176
|
+
/**
|
|
177
|
+
* @internal
|
|
178
|
+
* This would ideally be a Symbol but that won't work when @trpc/client isn't hoisted
|
|
179
|
+
*/
|
|
180
|
+
export const untypedClientMarker = '__internal_untypedClient';
|