Releases: dmotz/trystero
0.23.0
This version marks Trystero's biggest update since initial release. The internals have been completely rewritten with minimal changes to the public API. You'll find faster, more robust peering thanks to connection sharing and offer recycling behind the scenes. The test suite has been expanded and hardened and now tests server-side use too. Trystero also has a new public face at trystero.dev.
User-facing changes
- Trystero is now split into scoped packages:
@trystero-p2p/{nostr,mqtt,torrent,supabase,firebase,ipfs}plus@trystero-p2p/core. The roottrysteropackage still defaults to Nostr. trystero/<strategy>imports are now deprecated compatibility entry points; migrate to@trystero-p2p/<strategy>for non-default strategies.joinRoom(config, roomId, onJoinError)is nowjoinRoom(config, roomId, callbacks).onJoinErrormoved tocallbacks.onJoinError, and Nostr/Torrentβs old relay-reconnection flag moved intoconfig.manualRelayReconnection.joinRoom()gained a new admission-handshake layer viaonPeerHandshake(peerId, send, receive, isInitiator)andhandshakeTimeoutMs, so apps can accept or reject peers before they become visible togetPeers(),onPeerJoin(), actions, or media callbacks. You can use this to implement your own custom identity layer with crypto keys.trickleIceis now a public config option and speeds up initial connections. Most strategies default to trickle ICE, while Torrent and IPFS keep it off unless explicitly enabled.@trystero-p2p/corenow exposescreateStrategyand shared types/utilities, making custom signaling strategies a supported extension point. You can use this to run a signaling relay for Trystero on any software you want. The readme shows a basic example using a simple WebSocket server.- Media and event ergonomics improved:
replaceTrack()can now send metadata,onPeerJoin()immediately replays already-active peers to late listeners, and the action name limit increased from 12 bytes to 32 bytes. - Firebaseβs
getOccupants()helper was removed. This was only used by a single strategy and removing it helps keep the API surface small. You can still replicate its functionality with the Firebase API directly. - Server-side use is now a more explicit part of the public surface:
rtcPolyfillis documented/tested, and a recommended polyfill library endorsement forwerift.
Performance and reliability notes
- Peer connection reuse is the biggest runtime change: when the same remote peer appears in multiple rooms, Trystero now reuses a shared underlying
RTCPeerConnectioninstead of renegotiating per room.
Offer pooling/reuse was overhauled, especially for tracker-style signaling, so old offers can be reclaimed and recycled instead of constantly allocating fresh peer connections. - Large and binary sends are more resilient under backpressure, with fixes for stalled sends and related data-channel hangs.
- Relay robustness new public relay lists and better handling of repeated pings/timeouts, which should reduce churn and improve matchmaking stability.
Please share feedback, ideas, and of course, what you build with Trystero, via GitHub discussions/issues. Go forth and build a decentralized web. π€
0.22.0
Breaking changes
- πͺ IPFS - removed
libp2pConfigconfig option
Improvements
- π¦ Nostr and π BitTorrent - new
manualRelayReconnectionboolean flag in config object, which will disable Trystero's automatic relay socket reconnection behavior. This is paired with two top level package exportspauseRelayReconnection()andresumeRelayReconnection(), which allows you to control when Trystero auto-reconnects sockets. Additionally, Trystero will no longer attempt to reconnect sockets when the browser appears to be offline. Thanks to @vrtmrz for implementing. - πͺ IPFS - updated strategy, now reliably working and passing test suite
0.21.8
0.21.7
- Improved reconnection rates when leaving and rejoining rooms, thanks to @jeremyckahn
- Improved type definitions
0.21.4
0.21.3
0.21.2
0.21.1
0.21.0
Improvements
- New, modernized RTCPeerConnection abstraction
- Significantly smaller build sizes
- New
joinRoom()config object options:rtcPolyfill- Use this to pass a custom RTCPeerConnection-compatible constructor. This is useful for running outside of a browser, such as in Node (still experimental, not working yet).turnConfig- Specifies a custom list of TURN servers to use (see Connection issues section). Each item in the list should correspond to an ICE server config object. When passing a TURN config like this, Trystero's default STUN servers will also be used. To override this and use both custom STUN and TURN servers, instead pass the config via the above rtcConfig.iceServers option as a list of both STUN/TURN servers β this won't inherit Trystero's defaults.
0.21.0-beta.1
This beta release introduces a new, homegrown way of handling RTCPeerConnection instances behind the scenes. Trystero previously used simple-peer which is mostly unmaintained and showing its age. The new peer management code uses modern techniques, makes the build significantly lighter, and allows more flexibility for the project, like getting Trystero working in Node (see the new rtcPolyfill option for details).
If you use Trystero in your projects, please test this new beta version and report any issues you find. If you encounter a problem, be sure to confirm the issue does not occur on the latest stable version (0.20.1) under the same network conditions (e.g. peer A on network 1 <-> peer B on network 2).
Try this release via npm i trystero@beta.