Conversation
ably-js v3 splits the `ably` package into a shared core plus a
per-runtime client. The Spaces SDK is a library, not an end-user client,
so it takes the core: `@ably/pubsub-core` replaces `ably` as the peer
dependency, pinned to the exact canary
3.0.0-canary.20260917T1031.521a3374 because canary tags move and no
semver range will resolve to a pre-release.
Every `ably` type import becomes `@ably/pubsub-core`, and the IIFE
bundle externalises the new specifier onto the same `Ably` global, so
the CDN build keeps working unchanged.
Two v3 renames reach the test harness:
- `Rest` is now `Http`, so the vitest manual mock takes
`Http.PresenceMessage` for the `fromValues` helper. The mock
directory moves to `__mocks__/@ably/pubsub-core` to match the
scoped specifier vitest now resolves.
- `ClientOptions.environment` is gone, replaced by `endpoint` and its
routing policies. The integration tests and the CDN bundle test
therefore ask for `nonprod:sandbox`, and sandbox app provisioning
moves to sandbox.realtime.ably-nonprod.net to match, which is what
ably-js itself now does. Without both, a sandbox key is offered to
production and every connection fails with a 40400.
The integration tests construct their clients with `createClient` from
`@ably/pubsub-device` rather than the now-deprecated `Realtime`
constructor, since they stand in for device-side consumers; it is a dev
dependency only and never reaches the published package.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The demo and the examples are the device side of the split: browser code running under an end user's control. They take `@ably/pubsub-device`, whose `createClient` is the `Realtime` constructor plus a declaration of which side the connection is on — the thing that tells Ably a connection belongs to a device rather than to one of your own backend services. The React hooks come from the matching `@ably/pubsub-device/react` subpath. Spaces composes with that declaration rather than overwriting it: its own `spaces` agent is merged into `options.agents`, leaving the `ably-pubsub-device` entry intact. The demo's token endpoint is the exception. It runs on Netlify, not on a device, and declaring it a device would inflate the account's monthly active user count, so it keeps a side-less client: `@ably/pubsub-core` and the `Http` constructor that replaced `Rest`. `@ably/pubsub-server` would be the natural home for it, but that package has no canary at the version the rest of this branch pins, and mixing canary timestamps would pull in a second copy of the core. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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, new major release to support new
@ably/pubsub-*packagesDescription
Ably peer dependency replaced by
@ably/pubsub-core, but SDK users should choose between@ably/pubsub-serverand@ably/pubsub-deviceinstead.For example the demo depends on
@ably/pubsub-deviceand builds its client withcreateClient(), so traffic is attributed to a device. Device re-exports the whole core surface, so it needs no core dependency of its own.