Repository navigation
Migrates Chat to the new @ably/pubsub-* packages - #734
Merged
Merged
Conversation
|
Important Review skippedToo many files! This PR contains 112 files, which is 12 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.
|
ttypic
force-pushed
the
integration/v2
branch
from
October 30, 2026 10:08
aaba717 to
cfac19d
Compare
ttypic
force-pushed
the
integration/v2
branch
from
October 30, 2026 10:22
cfac19d to
6e10a62
Compare
ttypic
force-pushed
the
integration/v2
branch
from
October 30, 2026 10:28
6e10a62 to
b1449fe
Compare
Ably Pub/Sub v3 splits the `ably` package into a shared core plus two side-declaring wrappers. Point the SDK and the demo at the halves that match how each of them runs. The SDK depends on `@ably/pubsub-core@^3.0.0`. Core is the right half for a library: it declares no side, leaving that to the client the caller passes in. `@ably/pubsub-server` and `@ably/pubsub-device` ^3.0.0 are optional peer dependencies, one of which the application installs to create that client. The demo depends on `@ably/pubsub-device` and builds its client with `createClient()`, so browser traffic is attributed to a device. The README quickstarts move the same way. Adapt to the breaking changes in v3: - Ably.Realtime is gone; use the PubSubRealtimeClient interface for types. The v3 renames (`Rest*` to `Http*`) and removals (`environment`, `restHost`, `realtimeHost`, the callback overloads) are all things chat never used. - pubsub-core only ships ErrorInfo, EventEmitter and PartialErrorInfo at runtime, so the chat EventEmitter now builds directly on the exported, typed Ably.EventEmitter, narrowing emit, on and off to its EventsMap. - PresenceMessage gains a required memberKey, implemented as a getter. Our spread into PresenceMember would drop it, so omit it from the PresenceMember type to keep the public API unchanged. - RealtimeChannel.publish gains a deprecated callback overload declared last, which vi.spyOn infers; tests now spy via a PublishableChannel type pinned to the promise overload. Tests build clients with `createClient` from `@ably/pubsub-device`, and the mock client moves to `__mocks__/@ably/pubsub-device`, so mocked suites and the shared client helper construct it through the same module. ESLint drops import/named and import/namespace for TS (they can't follow the nested `export *` chains in the new typings) and allows spreading Message and PresenceMessage, which are now declared as classes. The UMD global for the external is now declared explicitly as `Ably` instead of left to rollup to guess from the package name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ttypic
force-pushed
the
integration/v2
branch
from
October 30, 2026 10:40
b1449fe to
334ead5
Compare
Make ChatClient an interface exposing only the public surface, and create clients via a new createChatClient(realtime, clientOptions?) factory. The implementation moves to an internal DefaultChatClient class, which keeps the internal logger and agent methods used by the React bindings, matching the Rooms/DefaultRooms pattern. This is a breaking change: `new ChatClient(...)` no longer works. UPGRADING.md, the README, the demo and doc examples are updated, and unit tests cover the factory. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ttypic
force-pushed
the
integration/v2
branch
from
October 30, 2026 10:54
334ead5 to
853b00a
Compare
Node.js 20 is end of life, so raise the minimum to 22, the oldest supported LTS release line. Update engines, drop 20 from the CI test matrix, move the remaining workflows from 20 to 22, and note the change in the README and the 2.0.0 upgrade guide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ttypic
force-pushed
the
integration/v2
branch
from
October 30, 2026 11:12
853b00a to
8d6c6fb
Compare
Open
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Based on PDR-091: a new major release (2.0.0) to support the new
@ably/pubsub-*3.0.0 packages.Description
ablypeer dependency is replaced by@ably/pubsub-core. Apps install either@ably/pubsub-serveror@ably/pubsub-device(optional peers) to create the client they pass to Chat. The demo and README use@ably/pubsub-device.createChatClientfactory:ChatClientis now an interface.new ChatClient(...)is replaced bycreateChatClient(realtime, clientOptions?).enginesand CI now require Node.js 22 or newer.All three changes break existing code.
UPGRADING.mdcovers the migration.