A Clojure/ClojureScript library for managing reloadable application state during REPL-driven development.
Mount is a library for managing application state in Clojure and ClojureScript, specifically designed for REPL-driven development. It allows developers to define stateful components like database connections and web servers with start and stop lifecycle functions, making it easy to reload the entire application state without restarting the REPL. It solves the problem of slow REPL startup times by keeping state reloadable within the same session.
Clojure and ClojureScript developers who work with REPL-driven development and need a simple, non-framework approach to managing reloadable application state like I/O connections, configuration, and servers.
Developers choose Mount because it is lightweight, non-intrusive, and preserves the simplicity and fun of Clojure. Unlike component-based frameworks, it treats states as top-level vars that can be required across namespaces, avoiding complex dependency graphs and allowing flexible composition, mocking, and partial application starts/stops.
managing Clojure and ClojureScript app state since (reset)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Seamlessly integrates with tools like tools.namespace for reloading entire application state without restarting the REPL, as demonstrated in the dev.clj example with (reset).
Enables starting/stopping specific parts, swapping states for testing, and composing with tools like only, except, and swap, detailed in the Composing States section.
Offers full ClojureScript compatibility with cljc mode for cross-platform development, including lazy start options and namespace recompilation handling.
Uses simple defstate with :start and :stop lifecycle functions, keeping state management lightweight and non-intrusive, as shown in basic examples.
Depends on Clojure compiler and require for dependency resolution, which the README contrasts with Component's explicit graphs, potentially limiting control in complex apps.
Requires all namespaces with defstate to be compiled before mount/start, adding complexity when packaging applications as JARs or using web hooks, as noted in the Packaging section.
Lacks integrated logging; developers must add dependencies like mount-up or use manual AOP with robert hooke, which can be an extra setup step.