Million: <1kb compiler-focused virtual DOM
Million
<1kb compiler-focused virtual DOM. It's fast!
Current Virtual DOM implementations are inadequate—Ranging from overcomplicated to abandoned, most are unusable without sacrificing raw performance and size. Million aims to fix this, providing a library-agnostic Virtual DOM to serve as the core for Javascript libraries that focus on precompilation and static analysis.
Why Million?
- ? Built for libraries that compile
- ? Lightweight bundle size (<1kb brotli+min)
- ⚡ Fast runtime operations
- ?️ Composable using drivers, sensible by default
Installing Million
Million doesn't require build tools by default, but it is highly recommended you use NPM to install.
npm install million
Hello World Example
Below is an extremely simple implementation of a Hello World page using Million.
import { m, createElement, patch } from 'million';
// Initialize app
const app = createElement(m('div', { id: 'app' }, ['Hello World']));
document.body.appendChild(app);
// Patch content
patch(app, m('div', { id: 'app' }, ['Goodbye World']));
License
Million is [MIT-licensed] open-source software by Aiden Bai.