@trpc/client 11.0.0-rc.637 → 11.0.0-rc.642
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 +15 -15
- package/dist/links/httpSubscriptionLink.d.ts +0 -4
- package/dist/links/httpSubscriptionLink.d.ts.map +1 -1
- package/dist/links/httpSubscriptionLink.js +3 -4
- package/dist/links/httpSubscriptionLink.mjs +3 -4
- package/package.json +8 -5
- package/src/links/httpSubscriptionLink.ts +2 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 21.
|
|
2
|
+
"bundleSize": 65670,
|
|
3
|
+
"bundleOrigSize": 83372,
|
|
4
|
+
"bundleReduction": 21.23,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/links/wsLink.ts",
|
|
@@ -13,19 +13,19 @@
|
|
|
13
13
|
],
|
|
14
14
|
"removedExports": [],
|
|
15
15
|
"dependents": [],
|
|
16
|
-
"percent": 27.
|
|
16
|
+
"percent": 27.43,
|
|
17
17
|
"reduction": 10.3
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"id": "/src/links/httpSubscriptionLink.ts",
|
|
21
|
-
"size":
|
|
22
|
-
"origSize":
|
|
21
|
+
"size": 7788,
|
|
22
|
+
"origSize": 7568,
|
|
23
23
|
"renderedExports": [
|
|
24
24
|
"unstable_httpSubscriptionLink"
|
|
25
25
|
],
|
|
26
26
|
"removedExports": [],
|
|
27
27
|
"dependents": [],
|
|
28
|
-
"percent": 11.
|
|
28
|
+
"percent": 11.86,
|
|
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.15,
|
|
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.52,
|
|
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.22,
|
|
68
68
|
"reduction": 5.64
|
|
69
69
|
},
|
|
70
70
|
{
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
],
|
|
77
77
|
"removedExports": [],
|
|
78
78
|
"dependents": [],
|
|
79
|
-
"percent":
|
|
79
|
+
"percent": 6,
|
|
80
80
|
"reduction": 5.59
|
|
81
81
|
},
|
|
82
82
|
{
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"/src/links/httpBatchStreamLink.ts",
|
|
100
100
|
"/src/links/httpSubscriptionLink.ts"
|
|
101
101
|
],
|
|
102
|
-
"percent": 5.
|
|
102
|
+
"percent": 5.62,
|
|
103
103
|
"reduction": 37.14
|
|
104
104
|
},
|
|
105
105
|
{
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
],
|
|
112
112
|
"removedExports": [],
|
|
113
113
|
"dependents": [],
|
|
114
|
-
"percent": 4.
|
|
114
|
+
"percent": 4.84,
|
|
115
115
|
"reduction": 14.24
|
|
116
116
|
},
|
|
117
117
|
{
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"/src/links/httpSubscriptionLink.ts",
|
|
147
147
|
"/src/internals/TRPCUntypedClient.ts"
|
|
148
148
|
],
|
|
149
|
-
"percent": 3.
|
|
149
|
+
"percent": 3.8,
|
|
150
150
|
"reduction": 29.97
|
|
151
151
|
},
|
|
152
152
|
{
|
|
@@ -292,7 +292,7 @@
|
|
|
292
292
|
"/src/links/wsLink.ts",
|
|
293
293
|
"/src/links/httpSubscriptionLink.ts"
|
|
294
294
|
],
|
|
295
|
-
"percent": 0.
|
|
295
|
+
"percent": 0.37,
|
|
296
296
|
"reduction": 76.38
|
|
297
297
|
},
|
|
298
298
|
{
|
|
@@ -13,10 +13,6 @@ type HTTPSubscriptionLinkOptions<TRoot extends AnyClientTypes, TEventSource exte
|
|
|
13
13
|
eventSourceOptions?: EventSourceLike.InitDictOf<TEventSource> | ((opts: {
|
|
14
14
|
op: Operation;
|
|
15
15
|
}) => EventSourceLike.InitDictOf<TEventSource> | Promise<EventSourceLike.InitDictOf<TEventSource>>);
|
|
16
|
-
/**
|
|
17
|
-
* Timeout after inactivity in milliseconds
|
|
18
|
-
*/
|
|
19
|
-
reconnectAfterInactivityMs?: number;
|
|
20
16
|
} & TransformerOptions<TRoot> & UrlOptionsWithConnectionParams;
|
|
21
17
|
/**
|
|
22
18
|
* @see https://trpc.io/docs/client/links/httpSubscriptionLink
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpSubscriptionLink.d.ts","sourceRoot":"","sources":["../../src/links/httpSubscriptionLink.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,0CAA0C,CAAC;AASlD,OAAO,EAAkB,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,OAAO,EAEL,KAAK,8BAA8B,EACpC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAiBnD,KAAK,2BAA2B,CAC9B,KAAK,SAAS,cAAc,EAC5B,YAAY,SAAS,eAAe,CAAC,cAAc,GAAG,OAAO,WAAW,IACtE;IACF;;OAEG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B;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AgB,CAAC,WAAW,CAAC,EAC7B,YAAY,CACb,GACA,QAAQ,CAAC,WAAW,CAAC,CAmKvB"}
|
|
@@ -56,8 +56,7 @@ async function urlWithConnectionParams(opts) {
|
|
|
56
56
|
}),
|
|
57
57
|
signal,
|
|
58
58
|
deserialize: transformer$1.output.deserialize,
|
|
59
|
-
EventSource: opts.EventSource ?? globalThis.EventSource
|
|
60
|
-
reconnectAfterInactivityMs: opts.reconnectAfterInactivityMs
|
|
59
|
+
EventSource: opts.EventSource ?? globalThis.EventSource
|
|
61
60
|
});
|
|
62
61
|
const connectionState = observable.behaviorSubject({
|
|
63
62
|
type: 'state',
|
|
@@ -98,7 +97,7 @@ async function urlWithConnectionParams(opts) {
|
|
|
98
97
|
}
|
|
99
98
|
});
|
|
100
99
|
break;
|
|
101
|
-
case '
|
|
100
|
+
case 'connected':
|
|
102
101
|
{
|
|
103
102
|
observer.next({
|
|
104
103
|
result: {
|
|
@@ -152,7 +151,7 @@ async function urlWithConnectionParams(opts) {
|
|
|
152
151
|
connectionState.next({
|
|
153
152
|
type: 'state',
|
|
154
153
|
state: 'connecting',
|
|
155
|
-
error: new TRPCClientError.TRPCClientError(`Timeout of ${
|
|
154
|
+
error: new TRPCClientError.TRPCClientError(`Timeout of ${chunk.ms}ms reached while waiting for a response`)
|
|
156
155
|
});
|
|
157
156
|
}
|
|
158
157
|
}
|
|
@@ -54,8 +54,7 @@ async function urlWithConnectionParams(opts) {
|
|
|
54
54
|
}),
|
|
55
55
|
signal,
|
|
56
56
|
deserialize: transformer.output.deserialize,
|
|
57
|
-
EventSource: opts.EventSource ?? globalThis.EventSource
|
|
58
|
-
reconnectAfterInactivityMs: opts.reconnectAfterInactivityMs
|
|
57
|
+
EventSource: opts.EventSource ?? globalThis.EventSource
|
|
59
58
|
});
|
|
60
59
|
const connectionState = behaviorSubject({
|
|
61
60
|
type: 'state',
|
|
@@ -96,7 +95,7 @@ async function urlWithConnectionParams(opts) {
|
|
|
96
95
|
}
|
|
97
96
|
});
|
|
98
97
|
break;
|
|
99
|
-
case '
|
|
98
|
+
case 'connected':
|
|
100
99
|
{
|
|
101
100
|
observer.next({
|
|
102
101
|
result: {
|
|
@@ -150,7 +149,7 @@ async function urlWithConnectionParams(opts) {
|
|
|
150
149
|
connectionState.next({
|
|
151
150
|
type: 'state',
|
|
152
151
|
state: 'connecting',
|
|
153
|
-
error: new TRPCClientError(`Timeout of ${
|
|
152
|
+
error: new TRPCClientError(`Timeout of ${chunk.ms}ms reached while waiting for a response`)
|
|
154
153
|
});
|
|
155
154
|
}
|
|
156
155
|
}
|
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.642+5c904587e",
|
|
4
4
|
"description": "The tRPC client library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -73,13 +73,15 @@
|
|
|
73
73
|
"package.json",
|
|
74
74
|
"links",
|
|
75
75
|
"unstable-internals",
|
|
76
|
-
"!**/*.test.*"
|
|
76
|
+
"!**/*.test.*",
|
|
77
|
+
"!**/__tests__"
|
|
77
78
|
],
|
|
78
79
|
"peerDependencies": {
|
|
79
|
-
"@trpc/server": "11.0.0-rc.
|
|
80
|
+
"@trpc/server": "11.0.0-rc.642+5c904587e",
|
|
81
|
+
"typescript": ">=5.6.2"
|
|
80
82
|
},
|
|
81
83
|
"devDependencies": {
|
|
82
|
-
"@trpc/server": "11.0.0-rc.
|
|
84
|
+
"@trpc/server": "11.0.0-rc.642+5c904587e",
|
|
83
85
|
"@types/isomorphic-fetch": "^0.0.39",
|
|
84
86
|
"@types/node": "^22.9.0",
|
|
85
87
|
"eslint": "^9.13.0",
|
|
@@ -88,6 +90,7 @@
|
|
|
88
90
|
"rollup": "^4.24.4",
|
|
89
91
|
"tslib": "^2.8.1",
|
|
90
92
|
"tsx": "^4.0.0",
|
|
93
|
+
"typescript": "^5.6.2",
|
|
91
94
|
"undici": "^6.0.1"
|
|
92
95
|
},
|
|
93
96
|
"publishConfig": {
|
|
@@ -96,5 +99,5 @@
|
|
|
96
99
|
"funding": [
|
|
97
100
|
"https://trpc.io/sponsor"
|
|
98
101
|
],
|
|
99
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "5c904587e6f3e3eaadb1bbd80d6aa38d20c00800"
|
|
100
103
|
}
|
|
@@ -60,10 +60,6 @@ type HTTPSubscriptionLinkOptions<
|
|
|
60
60
|
}) =>
|
|
61
61
|
| EventSourceLike.InitDictOf<TEventSource>
|
|
62
62
|
| Promise<EventSourceLike.InitDictOf<TEventSource>>);
|
|
63
|
-
/**
|
|
64
|
-
* Timeout after inactivity in milliseconds
|
|
65
|
-
*/
|
|
66
|
-
reconnectAfterInactivityMs?: number;
|
|
67
63
|
} & TransformerOptions<TRoot> &
|
|
68
64
|
UrlOptionsWithConnectionParams;
|
|
69
65
|
|
|
@@ -128,7 +124,6 @@ export function unstable_httpSubscriptionLink<
|
|
|
128
124
|
EventSource:
|
|
129
125
|
opts.EventSource ??
|
|
130
126
|
(globalThis.EventSource as never as TEventSource),
|
|
131
|
-
reconnectAfterInactivityMs: opts.reconnectAfterInactivityMs,
|
|
132
127
|
});
|
|
133
128
|
|
|
134
129
|
const connectionState = behaviorSubject<
|
|
@@ -176,7 +171,7 @@ export function unstable_httpSubscriptionLink<
|
|
|
176
171
|
},
|
|
177
172
|
});
|
|
178
173
|
break;
|
|
179
|
-
case '
|
|
174
|
+
case 'connected': {
|
|
180
175
|
observer.next({
|
|
181
176
|
result: {
|
|
182
177
|
type: 'started',
|
|
@@ -228,7 +223,7 @@ export function unstable_httpSubscriptionLink<
|
|
|
228
223
|
type: 'state',
|
|
229
224
|
state: 'connecting',
|
|
230
225
|
error: new TRPCClientError(
|
|
231
|
-
`Timeout of ${
|
|
226
|
+
`Timeout of ${chunk.ms}ms reached while waiting for a response`,
|
|
232
227
|
),
|
|
233
228
|
});
|
|
234
229
|
}
|