Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

0.25.0 #177

dmotz announced in Announcements
May 25, 2026 · 1 comment
Discussion options

Improvements

  • Actions have a new object-based API with request/response support. makeAction() now returns an action object with send(), onMessage/onRequest, request(), requestMany(), and progress hooks depending on the action kind. Thanks to @Abdullah-Azbah for writing the initial request/response proposal.
  • Added passive room mode for backup peers. Passive rooms stay dormant until they hear an active peer, avoid connecting to other passive peers, and deactivate again when active work is done. This should make standby/server-side peers much cheaper to keep around. You can use these peers for syncing persisted data. Thanks to @tionis for adding this.
  • onJoinError will now report cases where peers exchange SDP but cannot establish a WebRTC connection, which usually means TURN servers are needed or misconfigured.
  • Media APIs now use options objects, matching the new action API shape. This makes targeted sends and metadata clearer across streams, tracks, and replacements.
  • Added createTopicStrategy() that makes writing custom pub/sub signaling strategies even simpler. createStrategy() is still available as the lower-level API for protocols that need more control.
  • Nostr subscriptions are now batched, and Torrent passive rooms announce less aggressively while dormant.

⚠️ Breaking changes

room.makeAction() no longer returns [send, receive, progress]. It now returns an action object:

const drink = room.makeAction('drink')
drink.send({drink: 'negroni'}, {target: peerId})
drink.onMessage = (data, {peerId}) => {
 console.log('got drink from', peerId, data)
}

Request/response actions can be created with kind: 'request':

const isEven = room.makeAction('isEven', {
 kind: 'request',
 onRequest: n => n % 2 === 0
})
const result = await isEven.request(42, {
 target: peerId,
 timeoutMs: 1000
})

Room event handlers are now nullable callback properties instead of registration functions:

room.onPeerJoin = peerId => console.log(`${peerId} joined`)
room.onPeerLeave = peerId => console.log(`${peerId} left`)
room.onPeerStream = (stream, peerId, metadata) => {}
room.onPeerTrack = (track, stream, peerId, metadata) => {}

Media targeting and metadata now use options objects:

room.addStream(stream, {
 target: peerId,
 metadata: {kind: 'screen'}
})

The same shape applies to removeStream(), addTrack(), removeTrack(), and replaceTrack().

This will require existing codebases to migrate syntax when upgrading to 0.25.0.


This discussion was created from the release 0.25.0.
You must be logged in to vote

Replies: 1 comment

Comment options

Congrats on the huge release @dmotz! FYI I've updated Chitchatter to use 0.25.0, in case anyone is looking for prior art for a migration: jeremyckahn/chitchatter@e591b5f

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /