All notable changes to this project are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning. The normalized vocabularies are the public contract: adding a member is a minor bump, renaming or removing one is a major bump (see ADR 0009).
Internal-namespace housekeeping: the API/implementation boundary is now visible
in the namespace names themselves. Breaking only for code that required
never-public (^:no-doc) internals.
impl — never-public (^:no-doc)
namespaces now live under their area's impl segment so editor autocomplete
distinguishes API from internals: nats-cljc.{auth,error,protocol} →
nats-cljc.impl.{auth,error,protocol}, and
nats-cljc.jetstream.{acks,consumer,error,pub,pull,refill,stream} →
nats-cljc.jetstream.impl.{…}. No deprecation shims (ADR 0005, amended).
The public surface — nats-cljc.core, nats-cljc.codec,
nats-cljc.jetstream, nats-cljc.blocking.core, and the opt-in
nats-cljc.codec.<name> namespaces — is unchanged.nats-cljc.core — normalize-headers,
trim-headers, and effective-codec were public in nats-cljc.core only so
the JetStream facade could reuse them; they now live in the new
nats-cljc.impl.msg, so the public namespaces expose only API. This also
removes the JetStream facade's code dependency on nats-cljc.core.Phase 2: JetStream, tested on the JVM and Node. One new portable namespace,
nats-cljc.jetstream, mirroring the shape of nats-cljc.core.
(jetstream conn) returns one handle for the data
and management planes, verified at entry: a server round-trip on both
platforms so a server or account without JetStream fails fast with
:jetstream-not-enabled at the handle, not on the first operation (ADR 0017).create-stream, update-stream, delete-stream,
purge-stream, stream-info, list-streams, and stream-names, configured
by
portable closed kebab-keyword maps: keyword enums (:storage, :retention),
durations as integer milliseconds with the unit in the key (:max-age-ms),
and a validation error (:unknown-config-key) for any unrecognized key
instead of silent passthrough. Info maps come back normalized the same way,
with ISO-8601 timestamps on every platform.create-consumer, update-consumer,
delete-consumer, consumer-info, list-consumers, and consumer-names,
with
the same closed config-map contract (:ack-policy, :deliver-policy,
:ack-wait-ms, :filter-subjects, …).publish against the JetStream context resolves to a
PubAck {:stream :seq :duplicate :domain}. Supports :msg-id server-side
dedup, :expect optimistic concurrency (a mismatch surfaces as
:wrong-last-sequence), :timeout-ms, and per-publish :codec. A reserved
Nats-* key in user :headers is rejected pre-flight as :reserved-header.next (promise of one message or nil),
fetch (promise of a bounded vector), and consume (continuous delivery
through the same promise-return handler contract as core subscriptions — the
runtime waits for the handler's returned promise before delivering more, so
a slow handler simply slows the pull; no :slow-consumer, no async-library
dependency). consume returns a drainable, unsubscribable handle (ADR 0018).ack, nak (with optional :delay-ms), term,
and working are synchronous, idempotent, and
never throw; double-ack returns a promise of the server's confirmation for
exactly-once-adjacent processing (ADR 0019).{:subject :data :headers :js {…}}; :js carries normalized delivery
metadata (:stream, :consumer, :stream-seq, :delivery-seq,
:delivered, :pending, :redelivered, :timestamp, :domain).ordered-consumer replays a Stream gap-free with no
acks, for simple single-reader stream reads.:types identical on
every platform: :jetstream-not-enabled, :stream-not-found,
:consumer-not-found, :wrong-last-sequence, and the catch-all
:jetstream-api-error carrying the server's {:code :description}.
Consume-time side-band conditions (:heartbeats-missed,
:consumer-deleted, :exceeded-limits) route to a per-consume :on-error.
New validation :types for caller misuse: :invalid-name,
:unknown-config-key, :reserved-header, :no-ack-subject (ADR 0020).@nats-io/jetstream is installed
automatically and version-pinned in lockstep with the core client, so the
duplicate-nats-core hazard cannot arise. The JetStream import is confined to
JetStream namespaces: a core-only browser bundle ships zero JetStream bytes,
enforced by a CI guard (ADR 0016).require-ing every namespace, and the opt-in :json and :transit codec
namespaces pull dependencies (org.clojure/data.json, com.cognitect/transit-*)
that are deliberately absent from the published pom (ADR 0004's clean forced
footprint) — so loading them failed the 0.1.0 doc build. Both namespaces are now
marked ^:no-doc, which excludes them from analysis. The codecs are unchanged and
remain documented via the README, ADR 0011, and nats-cljc.codec. No API or
runtime change.First release: the Phase 1 core and Phase 1.5 blocking layer, tested on the JVM, Node, and the browser.
nats-cljc.core) — one .cljc surface that runs
unchanged on the JVM, the browser, and Node: connect, publish, subscribe,
request/reply, unsubscribe (with auto-unsubscribe), flush, drain,
close, and a subject builder. One-shot operations return the platform-native
promise (CompletableFuture on the JVM, js/Promise on ClojureScript).:queue.:edn by default with zero extra runtime dependencies; opt-in
:json and :transit codecs; custom codecs via nats-cljc.codec/register!.:on-status notifications
with a canonical :type set, identical in shape on every platform.:type set surfaced as ex-info,
identical in shape on every platform, plus a separate validation-error category
for caller misuse.nats-cljc.blocking.core) — the same
verb names, synchronous, with a pull-based subscription model.Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |