Skip to content

Stability & Versioning

The versioning guarantees you get today, the promise that a server and older clients keep working across a deploy, and the capabilities left out on purpose.

This page is the contract between the library and your app. It covers how versions move, what stays stable while we are pre-1.0, how a deployed server and older clients keep working across an upgrade, and which capabilities are deliberately not here.

The public API is in its intended final form: the connection model, the realm and action APIs, the error vocabulary, and the five wire formats. Every guide on this site is written against it.

We are still on the 0.x line, on purpose. The shape is settled, but staying pre-1.0 keeps the freedom to refine a rough edge in a minor release before committing to the stricter 1.0 guarantee below. Read 0.x as “stable enough to build on, not yet frozen.”

Every @nice-code/* package releases in lockstep at one version. @nice-code/wire, @nice-code/realm, @nice-code/action and the rest always share a version number. Upgrade them together; mixing versions across the set is unsupported.

We follow semver, read against where we are:

While 0.x (now):

  • 0.MINOR.0 may contain a breaking change. When it does, it ships with a changelog entry and a migration note. A breaking change is never silent.
  • 0.x.PATCH is fixes only, with no change to the public API.

From 1.0.0 onward (a later, separate release):

  • Breaking changes only in a major, always with migration docs.
  • Minors are additive and patches are fixes, which is the ordinary semver promise.

The move to 1.0.0 will be its own announcement, made once the 0.x surface has soaked with real consumers. Nothing on this page changes silently underneath you before then.

Realms and actions use one first-party protocol generation across the handshake, mux, action and realm codecs, HTTP exchange, reliability controls, and persisted session state. The current generation is protocol v1. Read it from WIRE_PROTOCOL_VERSION; the generations a particular build can actually speak are listed by WIRE_SUPPORTED_PROTOCOL_VERSIONS. Those constants describe the local build. They do not discover a remote peer.

Package versions and protocol generations are separate. Several lockstep package releases can use protocol v1. Within one client or server build, keep all @nice-code/* packages on the same package version. The client and server builds may differ when that release pair is covered by the compatibility matrix and the application definitions remain compatible.

The intended support window for a future wire-breaking release is the current and immediately previous generation. A generation is listed only when complete encoders, decoders, replies, pushes, reconnect, and persisted-session restoration have compatibility coverage. This release implements one codec and therefore lists only [1]; it does not claim a placeholder v2 or v0.

Compatible additions continue to use negotiated capabilities and optional fields. Do not infer that every unknown frame is safe to ignore, or that matching the library protocol makes changed application contracts compatible. Secure links reject a recognized no-common-generation failure with typed protocol_version_mismatch. Plain/no-handshake transports keep using the unnegotiated v1 format and cannot discover the remote version.

For a staggered deployment, keep payload/result semantics, realm definitions, authorization, and explicit dictionary/schema pins stable, and change actions only as What an older client keeps allows. Test both mixed directions against the actual released artifacts before claiming a rolling upgrade:

ClientServerWhy it is required
DeployedDeployedProves the frozen fixture is valid.
DeployedCandidateCovers a server-first upgrade and old-client reconnect.
CandidateDeployedCovers a client-first upgrade or server rollback.
CandidateCandidateCovers the final steady state.

Prefer a server-first canary after both mixed pairs pass, observe handshake/reconnect/realm attach failures, then deploy clients. Keep the tested server artifact available for rollback. If an application schema or handler contract must also change incompatibly, split that migration or use a maintenance window; a matching realm hash or action dictionary alone does not prove matching business semantics.

Release skew is about library versions. This is about your own definitions: what a deploy may change on the server and still serve a client built from the older ones. It is a promise, and the old/new matrix runs it. A client of this release and a client of 0.95.0, each built from an older definition, call a server running a newer one, at every security level.

On the HTTP exchange, plain or secure, a request names its action by domain and id. A client built from an older definition keeps working while the action it calls exists and the input it sends still validates. The server may add domains and actions anywhere, ahead of the old ones included, and may widen an input with optional fields.

LevelWhat else is comparedTo keep older clients
noneNothingNothing to do
authenticated, encryptedThe handshake compares the channel’s dictionaryVersion. A derived one changes whenever an action is added, removed or moved, and the client is refused: handshake_rejected, which a call reports as initialization_failedPin dictionaryVersion on the channel and leave it unchanged. A server that serves several channels (serveChannels, serveWorkers, serveDurableObject with a list) also picks one by its tag, which is derived from the domain names: pin it too

A pin protects one channel. A client that combines channels gets a derived version: see Evolving a deployed API.

An output is validated by the runtime that produces it, not by the one that receives it. An older client is handed a newer reply as sent, after the action’s own unpack: a field it does not know and an enum value it does not list included. This holds over HTTP and on a socket, and in both directions: a server that calls an action on a client receives that client’s output as sent. A check on receipt, if one is ever added, will be an option, off by default.

So an output’s type on the receiving side is a claim about the peer. Code that reads a reply should expect what a newer server may add.

On a socket, an action is addressed by position

Section titled “On a socket, an action is addressed by position”

A duplex carrier sends an action’s place in the channel’s dictionary, not its name. The one change that keeps an older client working on a socket is appending after every existing action of the channel, under a pinned dictionaryVersion left unchanged. Anything else changes what an older call’s number means.

At authenticated and encrypted, a derived version that moved is refused at the handshake. At level none no handshake compares the dictionaries, and at the other levels a pinned version passes the handshake whatever changed. Either way, an older call then runs whichever action holds its place now, with its input. Deploy both ends together, or keep a socket’s channel append-only.

  • An action renamed or removed. The server answers action_not_served (below).
  • An input narrowed so that what an older client sends no longer validates. The server answers action_input_validation_failed.
  • An unpack that cannot read a newer reply. An output’s unpack runs where it is received, so an older client’s unpack meets the newer output.
  • At authenticated and encrypted, a dictionaryVersion or tag that changed. On a socket, any change but appending.

What the library itself tells a client is contract. A change to any of these is a breaking change: made only in a 0.MINOR.0 with an Action required note, and after 1.0 only in a major.

WhenDomainIdHTTP status
The input does not validateerr_nice_actionaction_input_validation_failed400
The action failed, and the caller may not be told howerr_cast_not_niceunhandled, the sealed failure500
The server does not have the action or its domainerr_nice_transportaction_not_served404

A request posted without the library, and the fields of its reply that a reader may rely on, are on Serving & Connecting.

  1. Bump every @nice-code/* dependency to the new version together.
  2. Read the changelog for that minor. In a 0.x minor, a breaking change (if any) is called out there under Action required, with its migration note.
  3. Run the release’s old/new compatibility matrix with your unchanged application definitions.
  4. Deploy the server canary, then clients, while keeping the tested rollback artifact available.

Some capabilities are left out of this release by design, not by omission. Each is a boundary held on purpose, because building it into the core would cost every consumer for a need most don’t have:

  • Per-message priorities and TTLs in the core send path.
  • Exactly-once effects baked into the core. The primitives to build idempotent handling are there, and the delivery guides show the pattern, but the core does not silently promise effect-once for you.
  • Causal ordering across independent actions.
  • Reliable broadcast as a core guarantee.
  • Per-message delivery knobs on the core API.

Where a real need for one of these appears, it arrives as an additive change, such as a new option or a caps-gated protocol addition, that doesn’t break the code you write today. The skew promise above makes that possible: the library can grow into these without a breaking release.