The re-frame2 API¶
This is the complete public API reference for the manifest-tracked namespaces of the ClojureScript implementation of re-frame2 — one page per public namespace, with the boundary of "manifest-tracked" set out under Completeness below. The one public surface that falls outside it is the Hicasso view layer, which keeps its own reference: Hicasso API reference. Entries use a consistent shape: Kind, Signature, Description (contract, including error ids where they are part of the surface), and an Example where a call is worth showing. The Example is optional — many contract-only surfaces (compile-time template forms, symbol-resolution vars) carry no runnable call — so its absence is not a gap.
For the mental model, start with the Core guide. This corpus is deliberately terse: it states what you may call, not why the design chose it.
How to read these pages¶
| Audience need | Where |
|---|---|
| Day-to-day app API | re-frame.core (the facade) |
| Optional capabilities | machines, routing, resources, flows, schemas, HTTP, SSR |
| Substrate adapters | re-frame.adapter.{reagent,uix} — first-class and permanent |
| The Hicasso view layer | Hicasso API reference — a separate corpus, not a page here |
| Tests | re-frame.test-support, re-frame.test-helpers |
| Production timing | re-frame.performance |
Facade vs owning namespace. Many optional features re-export registration verbs
through re-frame.core (for example reg-machine, reg-flow, reg-resource). The
core page carries a short entry and points at the owning namespace for the full
contract. Prefer requiring the feature namespace when you need depth; rf/ remains
valid for the re-export.
Keyword surfaces. Events, fx, subs, and similar keyword-addressed
registrations (:rf.http/managed, :rf/machine, …) appear as tables or sections on
the owning page. They are not vars; the api-manifest
tracks vars.
Completeness. Public vars in the manifest with tiers :front-porch,
:advanced, :adapter, or :testing under re-frame.* are expected to appear on
these pages (or as an explicit facade pointer). Tooling and implementation tiers are
out of scope here. This is enforced: the api-manifest doc-api-check reconciles
every eligible manifest namespace against docs/api/, so an eligible namespace with
no page — or an eligible var with no member heading (### \var`, or a#### `var`facade-pointer entry on the owning/facade page) — turns the CI check
red. A member heading may be written bare (### `sub`) or namespace-qualified
(### `re-frame.machines/machine-transition``).
Where Hicasso sits. re-frame.hicasso and its optional modules carry no
api-manifest rows, so the enforcement above neither demands a page here nor notices
their absence. That is deliberate rather than an oversight: the view layer is
pre-alpha, its surface is still moving, and it documents itself in
its own API reference alongside the guide that
teaches it. Read this corpus for the pipeline — events, app-db, subscriptions,
effects, the optional capabilities and the substrate adapters — and read the Hicasso
reference for h/defview, h/sub, h/mount! and the rest of the authoring model.
The two do not overlap: a Hicasso application uses both, because Hicasso replaces the
view notation and nothing else.
Namespaces¶
Facade and core dataflow¶
| Page | Role |
|---|---|
| re-frame.core | Registration, dispatch, subscribe, views (reg-view), frames, boot, interceptors, feature re-exports |
Optional capabilities¶
| Page | Role |
|---|---|
| re-frame.schemas | App / event / effect schemas |
| re-frame.flows | Materialised derivations into app-db |
| re-frame.http | Managed HTTP fx and interceptors |
| re-frame.machines | State machines |
| re-frame.routing | Router, routes, route link |
| re-frame.resources | Resource cache, owners, mutations |
| re-frame.ssr | Server render, head, payloads |
| re-frame.ssr.ring | Ring adapter for SSR |
| re-frame.epoch | Epoch history / time-travel surface |
Adapters, tests, tooling¶
| Page | Role |
|---|---|
| re-frame.adapter.reagent | Stock / slim Reagent substrate |
| re-frame.adapter.uix | UIx substrate |
| re-frame.test-support | Fixtures, registrar snapshot, poll, sequester |
| re-frame.test-helpers | Hiccup walkers, testids |
| re-frame.performance | Compile-time User-Timing flags |
Require patterns¶
;; Typical app — on a Reagent / UIx substrate (both first-class and permanent)
(:require [re-frame.core :as rf]
[re-frame.adapter.reagent :as reagent-adapter])
(rf/init! reagent-adapter/adapter)
;; Tests
(:require [re-frame.core :as rf]
[re-frame.test-support :as ts]
[re-frame.test-helpers :as th])
Related corpora¶
- Core guide — progressive teaching
- Hicasso API reference — the view layer's own corpus, outside the api-manifest
- spec/API.md — normative var catalogue with tiers (projection of the api-manifest)
- Feature guides under Machines, Resources, Routing, SSR, Async tabs