Skip to content

Releases: anycable/anycable-client

0.6.0

06 Feb 22:13
Compare
Choose a tag to compare

This is a maintenance release.

Changes

  • @anycable/core: Upgraded nanoevents to 7.0.
  • @anycable/protobuf-encoder: Upgraded protobuf-js to 7.2.
  • @anycable/core: Changed received arguments type to be generic (so you can define your own type).

0.5.0

21 Jul 18:22
Compare
Choose a tag to compare

Features

  • Channel instances are now decoupled from subscriptions, thus making it possible to create many channels with the same identifiers (a single subscription is created under the hood).

See the updated architecture docs.

Changes

  • cable.subscribe(channel) is now synchronous and returns the passed channel itself, so you can chain the execution. The actual subscribe command is sent asynchrounously.

If you still want to wait for channel to be connected, you can use the new ensureSubscribed function:

// Before
await cable.subscribe(channel)

// After
await cable.subscribe(channel).ensureSubscribed()

Similarly, cable.subscribeTo(...) is not longer async and returns the channel instance immediately. You can call channel.ensureSubscribed() to make sure the channel has been connected to the server.

The channel.disconnect() function is no longer async and has not return value. It records the intention to unsubscribe. The actual unsubscribe command is sent asynchrounously (if requried, i.e., if there are no other channel instances with the same identifier).

  • channelsCache is removed since it's no longer needed (and can bring more confusion than value).

Released libraries

  • @anycable/core: 0.5.0
  • @anycable/web: 0.5.0
  • @anycable/turbo-stream: 0.2.0
  • @anycable/msgpack-encoder: 0.2.0
  • @anycable/protobuf-encoder: 0.2.0