Show HN: Mador – Make any DOM reactive with a tiny 80-line Proxy state tuple
Source Entity
Hacker News

Mador is a lightweight, 80-line reactive DOM runtime designed for developers who prefer direct DOM manipulation over heavy frameworks. It utilizes Proxy-based state management to bind data to elements without the overhead of virtual DOMs or complex templating systems.
The Rise of Minimalist DOM Reactivity
In an era dominated by heavy JavaScript frameworks, Mador emerges as a refreshing alternative for developers seeking simplicity. By stripping away the bloat of virtual DOMs, component lifecycles, and complex build steps, Mador provides a lean, 80-line runtime that focuses on a single objective: making the DOM reactive. This tool is explicitly designed for developers who want to bypass the steep learning curves and heavy payload sizes associated with modern web development stacks.
Core Philosophy: Proxy-Based State Management
The technical foundation of Mador rests on the JavaScript Proxy object, which allows for elegant state tracking. By exposing a simple tuple interface—an 'r' (read/bind) function and a 'w' (write/update) function—Mador enables developers to bind state directly to existing HTML elements. This approach mirrors the trajectory of modern web standards, where native browser capabilities are increasingly prioritized over abstractions that often add unnecessary complexity to simple interactive interfaces.
Bypassing the Framework Overhead
Traditional frameworks often force developers to adopt rigid structures, such as proprietary templating languages or specialized component architectures. Mador rejects this paradigm entirely. Because there are no components or virtual DOM overhead, the library operates with a minimal footprint, making it an ideal choice for smaller projects, progressive enhancement, or developers who prefer to maintain direct control over their DOM nodes. By using Mador, developers can avoid the 'framework fatigue' that occurs when managing large dependencies.
Integration and Developer Experience
Ease of use is central to Mador’s value proposition. As a native ES module, it can be imported directly via CDN or integrated into a standard npm workflow. The syntax—demonstrated by the ability to bind multiple elements to a single state change—is intuitive for anyone familiar with basic JavaScript. By allowing developers to define how specific elements react to state changes, Mador bridges the gap between static HTML and dynamic interactivity without the need for a compilation step.
Broader Implications for Web Architecture
The introduction of tools like Mador signals a growing trend in the web development ecosystem: the 'return to simplicity.' As browser APIs become more powerful, the necessity for massive abstraction layers decreases. Mador represents a shift back toward native DOM manipulation, empowering developers to build performant, reactive applications while keeping their codebase lightweight and maintainable. This trend is likely to continue as developers prioritize performance and long-term maintainability over the 'flavor of the month' framework.
Future Outlook
As web applications become more complex, the demand for modular, micro-libraries will likely grow. Mador is positioned to serve as a building block for specialized use cases where performance and file size are paramount. While it may not replace large-scale enterprise frameworks, it provides an essential tool for developers who value the 'work with the DOM' philosophy, ensuring that the web remains an accessible and efficient space for developers of all skill levels.