Moon is a minimal reactive UI library for building user interfaces with a component composition framework, client-side routing, server-side rendering, and signals-based reactivity. It provides a virtual DOM diffing engine that computes minimal real DOM mutations, enabling efficient view updates by comparing in-memory UI representations against previous versions.
The library distinguishes itself through a signals-based reactivity system that tracks data dependencies through observable signals, triggering targeted DOM updates only when values change. It implements a state driver pattern for unidirectional data flow, where a centralized state store provides data as input and accepts changes as output. Moon also includes a client-side history router that intercepts URL changes via the History API to swap view components without reloading the page, preserving application state.
The framework supports declarative view rendering using HTML-like markup with embedded expressions for data binding and event handling, along with directive-based behavior for common UI patterns. It offers server-side string rendering that generates complete HTML strings on the server by executing components in a non-browser environment, and includes project scaffolding through a command-line tool that sets up a predefined directory structure and build configuration from a single command.