@trpc/client
Advanced tools
Comparing version 11.0.0-rc.498 to 11.0.0-rc.500
{ | ||
"bundleSize": 52634, | ||
"bundleOrigSize": 69964, | ||
"bundleReduction": 24.77, | ||
"bundleSize": 52661, | ||
"bundleOrigSize": 70097, | ||
"bundleReduction": 24.87, | ||
"modules": [ | ||
{ | ||
"id": "/src/links/wsLink.ts", | ||
"size": 13683, | ||
"origSize": 15132, | ||
"size": 13710, | ||
"origSize": 15265, | ||
"renderedExports": [ | ||
@@ -16,4 +16,4 @@ "createWSClient", | ||
"dependents": [], | ||
"percent": 26, | ||
"reduction": 9.58 | ||
"percent": 26.03, | ||
"reduction": 10.19 | ||
}, | ||
@@ -29,3 +29,3 @@ { | ||
"dependents": [], | ||
"percent": 11.14, | ||
"percent": 11.13, | ||
"reduction": 3.51 | ||
@@ -42,3 +42,3 @@ }, | ||
"dependents": [], | ||
"percent": 10.37, | ||
"percent": 10.36, | ||
"reduction": 18.48 | ||
@@ -94,3 +94,3 @@ }, | ||
"dependents": [], | ||
"percent": 7.46, | ||
"percent": 7.45, | ||
"reduction": 4.69 | ||
@@ -154,3 +154,3 @@ }, | ||
], | ||
"percent": 3.69, | ||
"percent": 3.68, | ||
"reduction": 45.43 | ||
@@ -172,3 +172,3 @@ }, | ||
], | ||
"percent": 2.26, | ||
"percent": 2.25, | ||
"reduction": 73.19 | ||
@@ -276,2 +276,12 @@ }, | ||
{ | ||
"id": "/src/index.ts", | ||
"size": 0, | ||
"origSize": 588, | ||
"renderedExports": [], | ||
"removedExports": [], | ||
"dependents": [], | ||
"percent": 0, | ||
"reduction": 100 | ||
}, | ||
{ | ||
"id": "/src/unstable-internals.ts", | ||
@@ -289,12 +299,2 @@ "size": 0, | ||
"reduction": 100 | ||
}, | ||
{ | ||
"id": "/src/index.ts", | ||
"size": 0, | ||
"origSize": 588, | ||
"renderedExports": [], | ||
"removedExports": [], | ||
"dependents": [], | ||
"percent": 0, | ||
"reduction": 100 | ||
} | ||
@@ -301,0 +301,0 @@ ], |
@@ -25,2 +25,6 @@ import type { Observer, UnsubscribeFn } from '@trpc/server/observable'; | ||
/** | ||
* Triggered when a WebSocket connection encounters an error | ||
*/ | ||
onError?: (evt?: Event) => void; | ||
/** | ||
* Triggered when a WebSocket connection is closed | ||
@@ -27,0 +31,0 @@ */ |
@@ -16,3 +16,3 @@ 'use strict'; | ||
function createWSClient(opts) { | ||
const { WebSocket: WebSocketImpl = WebSocket , retryDelayMs: retryDelayFn = exponentialBackoff , onOpen , onClose , } = opts; | ||
const { WebSocket: WebSocketImpl = WebSocket , retryDelayMs: retryDelayFn = exponentialBackoff , } = opts; | ||
const lazyOpts = { | ||
@@ -130,3 +130,3 @@ ...lazyDefaults, | ||
clearTimeout(lazyDisconnectTimer); | ||
const onError = ()=>{ | ||
const onError = (evt)=>{ | ||
self.state = 'closed'; | ||
@@ -136,2 +136,3 @@ if (self === activeConnection) { | ||
} | ||
opts.onError?.(evt); | ||
}; | ||
@@ -163,3 +164,3 @@ run(async ()=>{ | ||
self.state = 'open'; | ||
onOpen?.(); | ||
opts.onOpen?.(); | ||
dispatch(); | ||
@@ -222,3 +223,3 @@ }).catch((cause)=>{ | ||
if (self.state === 'open') { | ||
onClose?.({ | ||
opts.onClose?.({ | ||
code | ||
@@ -225,0 +226,0 @@ }); |
{ | ||
"name": "@trpc/client", | ||
"version": "11.0.0-rc.498+5714423cc", | ||
"version": "11.0.0-rc.500+8e82ac330", | ||
"description": "The tRPC client library", | ||
@@ -79,6 +79,6 @@ "author": "KATT", | ||
"peerDependencies": { | ||
"@trpc/server": "11.0.0-rc.498+5714423cc" | ||
"@trpc/server": "11.0.0-rc.500+8e82ac330" | ||
}, | ||
"devDependencies": { | ||
"@trpc/server": "11.0.0-rc.498+5714423cc", | ||
"@trpc/server": "11.0.0-rc.500+8e82ac330", | ||
"@types/isomorphic-fetch": "^0.0.39", | ||
@@ -100,3 +100,3 @@ "@types/node": "^20.10.0", | ||
], | ||
"gitHead": "5714423cc8d807a11466663b22eff67ec7286909" | ||
"gitHead": "8e82ac3307ecba9362e86fc9ea0491ac8885c32a" | ||
} |
@@ -55,2 +55,6 @@ import type { Observer, UnsubscribeFn } from '@trpc/server/observable'; | ||
/** | ||
* Triggered when a WebSocket connection encounters an error | ||
*/ | ||
onError?: (evt?: Event) => void; | ||
/** | ||
* Triggered when a WebSocket connection is closed | ||
@@ -85,4 +89,2 @@ */ | ||
retryDelayMs: retryDelayFn = exponentialBackoff, | ||
onOpen, | ||
onClose, | ||
} = opts; | ||
@@ -256,3 +258,3 @@ const lazyOpts: LazyOptions = { | ||
const onError = () => { | ||
const onError = (evt?: Event) => { | ||
self.state = 'closed'; | ||
@@ -262,2 +264,3 @@ if (self === activeConnection) { | ||
} | ||
opts.onError?.(evt); | ||
}; | ||
@@ -296,3 +299,3 @@ run(async () => { | ||
onOpen?.(); | ||
opts.onOpen?.(); | ||
dispatch(); | ||
@@ -372,3 +375,3 @@ }).catch((cause) => { | ||
if (self.state === 'open') { | ||
onClose?.({ code }); | ||
opts.onClose?.({ code }); | ||
} | ||
@@ -375,0 +378,0 @@ self.state = 'closed'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
257917
6739