Liking cljdoc? Tell your friends :D

Reflet

Clojars Project

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:

  1. Performant multi-model DB with graph queries and mutations
  2. Data-driven descriptions: a new kind of polymorphic query
  3. Simple but powerful hierarchical FSMs
  4. JS and DOM interop utilities
  5. 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:

  1. A la carte feature set: it is not a "framework", so use as much or as little of it as you want
  2. Power up existing Re-frame applications: iterative, minimal approach to integration, so big re-writes can be avoided
  3. Graph and non-graph data models can be mixed freely with a single source of truth: a Clojure map
  4. Entity references connect things together: this encourages excellent, pluggable APIs
  5. Makes very few assumptions about your application boundaries
  6. Performance and stability: Reflet has already been deployed in complex, data-driven production applications for 4+ years (e.g. in Bioinformatics, Business analytics... )

Who Is This For?

  1. Anyone who needs a powerful graph data model for Re-frame
  2. You already have an existing non-graph Re-frame application, and need to take it to the next level
  3. You are learning Re-frame, and want to get started right away with scalable data models and well-built component APIs

Installation

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.

Resources

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:

  1. Rationale and Overview
  2. Quick Start
  3. Configuration
  4. Features
  5. Example Client
  6. General Development Tips

Getting Help

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.

Contribution Acknowledgements

Special thanks to Inge Solvoll.

License

Reflet is distributed under the terms of the Apache License 2.0.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close