Reflet is a set of tools for building Re-frame + React based web apps with graph and non-graph data models.
At the core of Reflet is a single macro, with-ref
, that generates
references to any kind of thing, and also transparently manages the
lifecycles of those things throughout your application. This leads to
highly extensible components, and excellent APIs.
Besides with-ref
, Reflet also provides:
- Performant multi-model DB with graph queries and mutations
- Data-driven descriptions: a new kind of polymorphic query
- Simple but powerful hierarchical FSMs
- JS and DOM interop utilities
- Novel API-driven visual debugging of complex apps (don't sleep on this!)
And more!
Reflet aims to be a natural progression on top of Re-frame to support complex, data-driven requirements. In that sense, it is both easy to learn, but powerful. You could say it's sort of like Re-frame++ (or Fulcro for Re-frame). Its main design goals are:
- A la carte feature set: it is not a "framework", so use as much or as little of it as you want
- Power up existing Re-frame applications: iterative, minimal approach to integration, so big re-writes can be avoided
- Graph and non-graph data models can be mixed freely with a single source of truth: a Clojure map
- Entity references connect things together: this encourages excellent, pluggable APIs
- Makes very few assumptions about your application boundaries
- Performance and stability: Reflet has already been deployed in complex, data-driven production applications for 4+ years (e.g. in Bioinformatics, Business analytics... )
- Anyone who needs a powerful graph data model for Re-frame
- You already have an existing non-graph Re-frame application, and need to take it to the next level
- You are learning Re-frame, and want to get started right away with scalable data models and well-built component APIs
At minimum include the following in your deps.edn
:
{:deps {io.zalky/reflet {:mvn/version "0.3.0-rc1"}}}
Or project.clj
:
[io.zalky/reflet "0.3.0-rc1"]
Additionally, React is considered a peer dependency, so you will have to ensure that it is available. The same approach you would use to provide React for Reagent or Re-frame will also work for Reflet.
See the additional notes on how to configure the debugger for development.
Reflet builds on top of the concepts and design patterns of Re-frame, and these resources assume a working knowledge of Re-frame basics. If you are not familiar with Re-frame, check out that documentation first, it is very good. Otherwise:
You can either submit an issue here on Github, or alternatively tag me
(@zalky
) with your question in the #re-frame
channel on the
Clojurians slack.
Special thanks to Inge Solvoll.
Reflet is distributed under the terms of the Apache License 2.0.