+0
日增长
5,545
stars
709
forks
132
watchers
485
prs
310
issues
48
releases
README
Derived Values, Flowing
This, milord, is my family's axe. We have owned it for almost nine hundred years, see. Of course,
sometimes it needed a new blade. And sometimes it has required a new handle, new designs on the
metalwork, a little refreshing of the ornamentation ... but is this not the nine hundred-year-old
axe of my family? And because it has changed gently over time, it is still a pretty good axe,
y'know. Pretty good.
-- Terry Pratchett, The Fifth Elephant
reflecting on identity, flow and derived values (aka The Ship of Theseus)
Overview
re-frame is a ClojureScript framework for building user interfaces.
It has a data-oriented, functional design. Its primary focus is on high programmer productivity and scaling up to larger Single-Page applications.
Developed in late 2014, and released in 2015, it is mature and stable. It is used by both small startups and companies with over 500 developers, and it has delivered into production applications which are 40K lines of code and beyond.
Across the last 10 years, it has outlasted multiple generations of Javascript churn - just imagine your team's productivity if you didn't have to contend with technical churn, and have new magic burn your fingers every two years. Brand new, exciting concepts like recoiljs (in the React world), have been a regular part of re-frame from the beginning.
re-frame is lucky enough to enjoy an unfair advantage - ClojureScript is a Lisp. Alan Kay
once described Lisp as "Maxwell's equations of software". Paul Graham
described how Lisp was a competitive advantage for his startup. When we use Lisp, we
get to leverage 50 years of foliated excellence from the very best minds available.
And then there's also a thriving ClojureScript community which delivers modern ideas and best-in-class tooling.
Although re-frame leverages React (via Reagent), it only needs
React to be the V in MVC, and no more. re-frame takes a different road to the currently-pervasive idea that Views should be causal (colocated queries, ComponentDidMount, hooks, etc).
In re-frame, events are causal, and views are purely reactive.
Documentation
The re-frame documentation is available here.
Programmatic Diagnostics (1.4.6+)
The documentation includes a
Debugging & Instrumentation
guide for devtools and diagnostic code: source-meta macros, trace tag
schema validation, per-dispatch epoch callbacks, dry-run dispatch with
effect overrides, and subscription cache lookups.
Source-meta opt-in
re-frame.core is the stable function API — reg-event-db /
reg-event-fx / reg-event-ctx / reg-sub / reg-fx and the
dispatch / subscribe family are defns, so (map reg-event-db
...), (apply reg-sub ...), (partial reg-fx ...) work as
written.
For call-site {:file :line} metadata in dev / devtools, alias
re-frame.macros instead. Same call shape, source-meta captured at
expansion time and DCE'd in production CLJS:
clojure
;; function API — no source-meta
(:require [re-frame.coreTop issues
#137Global State48 comments · 2015-12-09#639Ordered Effects47 comments · 2020-08-10#644Events Can Be Maps. So Too Subscription Queries31 comments · 2020-09-02#680Derived Values12 comments · 2021-03-10#809[Bug]: Non-daemon executor thread in Clojure prevents clean JVM shutdown9 comments · 2024-11-15#808[Enhancement]: Add a default Effect Handler For Promises7 comments · 2024-11-03#633Improve exception handling associated with subs5 comments · 2020-07-10#589Overview: May 2020 Sprint5 comments · 2020-05-05
Discussions
#826Why the name "re-frame"?1 comments · 2026-01-13#820is it possible to create an interceptor that logs the db state for all events before and after the event handling?3 comments · 2025-08-10#804Handler registration: out of this world?0 comments · 2024-06-20#800Is it safe to deref an external atom inside an event handler?1 comments · 2024-02-15#795Flows - derived data, simplified.3 comments · 2023-10-31#776Subscription Cache, Memoization1 comments · 2023-02-14#767Code trace is not available for this event after build1 comments · 2022-10-30#746Implement a sequential dispatch pattern in re-frame1 comments · 2021-10-31
Latest release
v1.4.7 v1.4.7 2026-04-29Changelog