Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@replit/river

Package Overview
Dependencies
Maintainers
29
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@replit/river - npm Package Compare versions

Comparing version 0.10.10 to 0.10.11

dist/chunk-KW5VFJRN.js

7

dist/transport/impls/ws/client.d.ts

@@ -32,8 +32,9 @@ import WebSocket from 'isomorphic-ws';

/**
* Creates a new WebSocketTransport instance.
* Creates a new WebSocketClientTransport instance.
* @param wsGetter A function that returns a Promise that resolves to a WebSocket instance.
* @param clientId The ID of the client using the transport.
* @param sessionId The ID of the client using the transport. This should be unique per session.
* @param serverId The ID of the server this transport is connecting to.
* @param providedOptions An optional object containing configuration options for the transport.
*/
constructor(wsGetter: () => Promise<WebSocket>, clientId: TransportClientId, serverId: TransportClientId, providedOptions?: Partial<Options>);
constructor(wsGetter: () => Promise<WebSocket>, sessionId: TransportClientId, serverId: TransportClientId, providedOptions?: Partial<Options>);
createNewConnection(to: string, attempt?: number): Promise<void>;

@@ -40,0 +41,0 @@ close(): Promise<void>;

import {
WebSocketClientTransport
} from "../../../chunk-FTVAZZ6B.js";
} from "../../../chunk-KW5VFJRN.js";
import "../../../chunk-L7D75G4K.js";

@@ -5,0 +5,0 @@ import "../../../chunk-R6H2BIMC.js";

@@ -7,3 +7,3 @@ import {

WebSocketClientTransport
} from "../chunk-FTVAZZ6B.js";
} from "../chunk-KW5VFJRN.js";
import {

@@ -10,0 +10,0 @@ WebSocketServerTransport

{
"name": "@replit/river",
"description": "It's like tRPC but... with JSON Schema Support, duplex streaming and support for service multiplexing. Transport agnostic!",
"version": "0.10.10",
"version": "0.10.11",
"type": "module",

@@ -6,0 +6,0 @@ "exports": {

@@ -92,2 +92,3 @@ # river - Streaming Remote Procedure Calls

import { createClient } from '@replit/river';
import type ServiceSurface from './server';

@@ -122,2 +123,20 @@ const websocketUrl = `ws://localhost:3000`;

To listen for connection status changes,
```ts
transport.addEventListener('connectionStatus', (evt) => {
if (evt.status === 'connect') {
// do something
} else if (evt.status === 'disconnect') {
// do something else
}
});
```
> [!note] WebSocket connection behaviour
> WebSocket is an idle protocol. This means that when the underlying connection drops, the WebSocket
> may still think it is still connected (e.g. turning off the network via devtools).
> You can use `window.addEventListener('online', ...);` and `window.addEventListener('offline', ...);` to
> know if you need to recreate the transport.
### Further examples

@@ -124,0 +143,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc