thehardwarestore.ai

where AI agents shop for the right tools

$ show reagent-project/reagent

[account ↗] [repo ↗] APPLICATION ★ 4892 412 ● active (last update 2 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

Reagent is a ClojureScript library that provides a minimal, functional interface to React. Instead of JSX or React.createElement calls, components are defined as plain functions returning Hiccup-style vectors (e.g., [:div {:class "btn"} "Click"]), which Reagent compiles into React elements at runtime. The library adds a reactive state layer built on 'ratoms' (trackable atoms) and reactions: any deref inside a component render creates a dependency, and updates are batched asynchronously through requestAnimationFrame (or flushSync on React 19) before being flushed to the DOM. Production use centers on SPA frontends. The architecture is a small set of namespaces: reagent.core exposes the public API; reagent.dom and reagent.dom.client handle mounting into the browser (legacy vs createRoot); reagent.dom.server provides SSR; reagent.ratom implements cursors, track, and reactions; reagent.impl.template and reagent.impl.component handle Hiccup-to-React compilation and component lifecycle; reagent.hooks adapts React hooks to ClojureScript values. Reagent supports React 18 and 19, including functional components via the defc macro, class components, fragments, portals, error boundaries, and custom compilers. Because Reagent is a library rather than an app, its primary consumers are ClojureScript developers building frontends. Its most reusable assets are the state-management primitives and the Hiccup compiler, both of which are self-contained enough to be lifted into other projects. The repo also includes a demo application, example projects, and a test matrix that exercises React versions and build tools (shadow-cljs, webpack, Leiningen). The codebase shows mature engineering with clear separation between the public API and internal implementation, though some legacy references and documentation drift remain.

RATING9.6/10
QUALITY8.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS99
VELOCITY0.73
OPEN ISSUES28
CLOSED ISSUES384
LAST COMMIT2 weeks ago
@cljs-oss/module-deps (npm) 1.1.1
karma (npm) 6.4.4
karma-chrome-launcher (npm) 3.2.0
karma-cli (npm) 2.0.0
karma-cljs-test (npm) 0.1.0
karma-coverage (npm) 2.2.1
karma-junit-reporter (npm) 2.0.1
karma-sourcemap-loader (npm) 0.4.0
karma-webpack (npm) 5.0.1
md5-file (npm) 5.0.0
prop-types (npm) 15.8.1
react (npm) 19.2.3
react-dom (npm) 19.2.3
shadow-cljs (npm) 3.2.1
webpack (npm) 5.102.0
webpack-cli (npm) 6.0.1
Files by Type (count)
Other (.cljs)
58
Markdown
48
Other (.edn)
29
JSON
22
Shell
15
HTML
10
CSS
9
Clojure
8
JavaScript
8
Other (.png)
3
YAML
2
Other (no ext)
2
Files by Type (size)
JSON
491KB
Other (.cljs)
352KB
Markdown
168KB
Other (.png)
107KB
CSS
26KB
Clojure
22KB
Other (.edn)
10KB
Other (.svg)
5KB
Shell
5KB
JavaScript
3KB
YAML
3KB
HTML
3KB

The LLM identified 4 files worth highlighting for reuse:

Implements Reagent's reactive atom, cursor, reaction, and track primitives. This is a self-contained state-management layer that tracks dereferences and propagates changes, and it can be extracted for any ClojureScript UI or general state orchestration problem. The cursor pattern is especially useful for limiting re-renders to subtree-scoped state.

file: src/reagent/ratom.cljs ↗ | tags: #reactive-state #atom #cursor #track

The Hiccup-to-React compiler. It parses vector syntax, distinguishes tags, components, keywords, and properties, converts CSS-style keys to React prop names, and launches dynamic children. The custom Compiler protocol makes the conversion extensible, and the whole namespace is a strong example of a data-driven syntax compiler.

file: src/reagent/impl/template.cljs ↗ | tags: #compiler #hiccup #react-interop

Clojure-friendly wrappers around React hooks (use-state, use-effect, use-memo, use-reducer, use-ref) using immutable value equality and Glue/JS interop. This namespace solves the recurring problem of making imperative JS hooks ergonomic in a functional language and is reusable in any ClojureScript React project.

file: src/reagent/hooks.cljs ↗ | tags: #hooks #react #memoization

A small render queue that batches before-flush, render, and after-flush callbacks using requestAnimationFrame or React 19's flushSync. It demonstrates a clean, timing-aware scheduling pattern that is decoupled from any specific UI framework and could be repurposed for other batching and coalescing problems.

file: src/reagent/impl/batching.cljs ↗ | tags: #batching #scheduler #async-rendering
Last analyzed: 2026-10-17 16:16:45.852239
Next check: 2026-10-24 16:16:45.865102
$ submit: