Releases: anycable/anycable-rails
1.6.0.rc.1
This release adds presence API for channels:
class ChatChannel < ApplicationCable::Channel
def subscribed
room = Chat::Room.find(params[:id])
stream_for room
join_presence(id: current_user.id, info: {name: current_user.name})
end
end
See docs.
1.5.0
Features
-
JWT functionality is available without additional dependencies.
No need to install anycable-rails-jwt anymore.
-
Signed streams support.
Added
#signed_stream_name
helper andAnyCable::Rails.signed_stream_name
helper to generate signed streams. -
Added
websocket_url
parameter to provide a WS server address for clients.This new parameter automatically updates the
config.action_cable.url
to provide the WS server information to clients via#action_cable_meta_tag
(or#action_cable_with_jwt_meta_tag
) helpers. Thus, all you need to point your clients to AnyCable is configure thewebsocket_url
(orANYCABLE_WEBSOCKET_URL
) value, no code changes required. -
Allow specifying the whispering stream via
#stream_from(..., whisper: true)
.You can use specify the stream to use for whispering (client-initiated broadcasts) by adding
whisper: true
to the#stream_from
(or#stream_for
) method call. -
Broadcasting to objects.
Extended
ActionCable.server.broadcast
to accept not only strings but objects (similar toChannel.broadcast_to(...)
).See docs.
-
Extracted
rails g anycable:bin
fromrails g anycable:setup
.This generator creates a
bin/anycable-go
script to run (and install) AnyCable server locally.
1.4.2
Features
- New
broadcast ..., to_others: true
API.
This new API makes it possible to exclude initiator from the list of recipients.
See docs.
- Automatic batch broadcasting.
It's possible to turn batch broadcasting on for web requests, background jobs, or any other units of work in Rails applications. The feature uses new batch broadcasting API.
See docs.
Changes
- Print warning if the database pool size is less than RPC pool size.
1.3.7
1.3.4
Features
- Add support and backport for Connection command callbacks.
- Backport command callbacks, so it could be used in Rails <7.1 (even w/o AnyCable).
1.3.0
This release makes our Action Cable integration more robust and safe to use with other extensions.
We also made it easier to run both Action Cable and AnyCable at the same time, so you can migrate gradually.
Changes
- Action Cable integration is completely rewritten to avoid potential patches incompatibility. The amount of patches code has been minimized, no more open classes, only
Module#prepend
with a feature check.
Features
- Added
AnyCable::Rails.extend_adapter!
method to make any Action Cable pub/sub adapter compatible with AnyCable (i.e., broadcast updates to both Action Cable engine and AnyCable).
Other
- Added a dedicated documentation on using AnyCable with Hotwire focused on the RPC-less use case.
1.2.0 🎄
1.1.0 🚸
This is a maintenance release. Most changes are internal and doesn't affect public APIs.
Requirements
- Ruby >= 2.6 is required.
- Rails >= 6.0 is required.
Changes
- Adding
anycable
orgrpc
gem as an explicit dependency is required.
Now, anycable-rails
depends on anycable-core
, which doesn't include gRPC server implementation.
You should either add anycable
or grpc
(>= 1.37) gem as an explicit dependency.
Features
- Added ability to embed AnyCable RPC into a Rails server process.
Set embedded: true
in the configuration to launch RPC along with rails s
(only for Rails 6.1+).
1.1.0.rc1
See notes for v1.1.0.
1.0.0
See the project's release notes for more information on all AnyCable libraries.
Please, checkout the upgrade notes to learn how to migrate from 0.6 to 1.0.
Features
-
Added interactive
rails g anycable:setup
command for initial AnyCable configuration. -
Added
request
support to channels.
Now you can access underlying HTTP request data in channels, too.
- Added Rack middleware support (incl. out-of-the-box Rails sessions support).
You can enhance request object by passing it through a custom middleware chain (e.g., when using Warden for authentication). By default, we include Rails session middleware, which makes request.session
available in AnyCable without any hacks.
See documentation.
- Added
state_attr_accessor
to persist channels state.
See documentation.
-
Added support for
ActionCable.server.remote_connections.where(...).disconnect
. -
Added compatibility with Rails 6.1.
Including type: :disconnect
messages, Connection.rescue_from
, stop_stream_from
.
Changes
- Using
anycable-go
v1.x is required.