Million Logo

<1kb compiler-augmented 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.


With Million, you get the declarativity and flexibility of the Virtual DOM, while leveraging the performance of compiler-aware optimizations.


import { m, createElement, patch } from 'million';

// Initialize app
const app = createElement(m('div', { id: 'app' }, ['Hello World']));
// Patch content
patch(app, m('div', { id: 'app' }, ['Goodbye World']));

In this example, a virtual node is constructed and a HTMLElement (<div id="app">Hello World</div>) is created out of it. The HTMLElement is attached to the live page, and then patched (updated) using a virtual node (<div id="app">Goodbye World</div>).

Resources & Contributing Back

Have a question about Million? Post it on the GitHub Discussions and ask the community for help.

Find a bug? Head over to our issue tracker and we'll do our best to help. We love pull requests, too!

We expect all Million contributors to abide by the terms of our Code of Conduct.

→ Start contributing on GitHub