A namespace's PUBLIC surface as data, and the difference between two of them.
Pure: takes already-read top-level forms, returns values.
Surface shape: {"ns/name" {:kind :def|:defn|:defmacro|:defprotocol|:defrecord :arities #{0 1 :variadic} :methods {"method" #{1 2}}}}
What counts as public: anything a downstream repo can compile against —
defn/def/defmacro without ^:private (and not defn-), plus every
protocol and its method arities. Private vars are excluded on purpose: they
are not part of the contract and freezing them would freeze refactoring.
A namespace's PUBLIC surface as data, and the difference between two of them.
Pure: takes already-read top-level forms, returns values.
Surface shape:
{"ns/name" {:kind :def|:defn|:defmacro|:defprotocol|:defrecord
:arities #{0 1 :variadic}
:methods {"method" #{1 2}}}}
What counts as public: anything a downstream repo can compile against —
`defn`/`def`/`defmacro` without ^:private (and not `defn-`), plus every
protocol and its method arities. Private vars are excluded on purpose: they
are not part of the contract and freezing them would freeze refactoring.(breaking? diff)True when diff contains anything a consumer could not survive.
True when `diff` contains anything a consumer could not survive.
(describe diff)One line per breaking change, for a human reading CI output.
One line per breaking change, for a human reading CI output.
(diff old new)What changed from old surface to new.
{:removed [qn...] — a public name that no longer exists :arities-lost [{...}] — a public fn that dropped an arity :methods-lost [{...}] — a protocol method removed or narrowed :kind-changed [{...}] — e.g. a defn became a def :added [qn...]} — additive; never a violation
What changed from `old` surface to `new`.
{:removed [qn...] — a public name that no longer exists
:arities-lost [{...}] — a public fn that dropped an arity
:methods-lost [{...}] — a protocol method removed or narrowed
:kind-changed [{...}] — e.g. a defn became a def
:added [qn...]} — additive; never a violation(merge-surfaces surfaces)One surface map for a whole source tree.
One surface map for a whole source tree.
(ns-name-of forms)The namespace symbol declared by forms, or nil.
The namespace symbol declared by `forms`, or nil.
(surface forms)Public API surface of one namespace's forms.
Public API surface of one namespace's `forms`.
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 |