Skip to content

Split SDK into server and device gems - #452

Open
ttypic wants to merge 1 commit into
mainfrom
split-server-device-gems
Open

Split SDK into server and device gems#452
ttypic wants to merge 1 commit into
mainfrom
split-server-device-gems

Conversation

@ttypic

@ttypic ttypic commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces two new gems, ably-pubsub-server and ably-pubsub-device, which separate the SDK into server-side and device-side components. This reflects a similar split implemented in ably-python. Each gem includes specific factories for creating appropriate core clients while ensuring strict version compatibility across the gems.

Key changes:

  • Added Ably::PubSub::Server and Ably::PubSub::Device namespaces for cleaner application-side usage.
  • Introduced deprecation warnings for direct usage of Ably::Rest::Client or Ably::Realtime::Client to guide the migration process.
  • Enhanced specs cover version compatibility, gem packaging, and factory methods.
  • Updated CI pipeline to build and test all three gems (core, server, device).

This change maintains functionality while improving code organization and developer experience.

Add ably-pubsub-server and ably-pubsub-device, two thin gems that add
Ably::PubSub::Server and Ably::PubSub::Device to the namespace the ably gem
provides, so that the gem an application installs names the side it runs on.
Their factories return the core's clients unchanged, and they pin the core
exactly, releasing in lockstep with it. Mirrors the split made in ably-python
(ably/ably-python#681).

Constructing Ably::Rest::Client or Ably::Realtime::Client directly now warns,
naming the factory to migrate to. Ruby has no equivalent of Python's
DeprecationWarning filtering, so Ably::Util::Deprecation warns once per call
site and attributes the warning to the first frame outside the SDK; the
factories suppress it, their callers having nothing to migrate.

Neither Pub/Sub gem may define lib/ably/pubsub.rb: both would ship it and the
load path would pick one, hiding the other's. Specs cover that, what each gem
ships, that the three versions stay in lockstep, and the factory and
deprecation behaviour. A new CI job builds all three gems.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant