Million

<1KB Virtual DOM Implementation

README

CI Code Size NPM Version NPM Downloads
🎦 Watch Video 📚 Read the docs 💬 Join our Discord

What is Million?


Million is a drop-in replacement for React with a lightweight (<1kb) Virtual DOM. It's [_really fast_](https://millionjs.org/benchmarks) and makes it easy to create user interfaces.

Oh man... Another [/virtual dom|javascript/gim](https://regexr.com/6mr5f) library? I'm fine with React already, why should I bother switching?


Million makes creating user interfaces as easy as React, but with faster performance and smaller bundle size for the end user. By computing the user interface beforehand with a compiler, Million reduces the overhead of traditional Virtual DOM.

Okay cool... but why should I use Million if I can just use Preact if I need something a bit more lightweight?


While alternative libraries like Preact reduce bundle sizes by efficient code design, Million takes it a step further byleveraging compilation to make a quantum leap in improving bundle size and render speed.

Think of it as if React's API and Svelte's compiler had a baby. [A baby with _super speed! 👶🚀_](https://millionjs.org/benchmarks)

[📚 Learn Million in 1 minute! →](https://millionjs.org/docs/start-here)


Why Million?


Advantages

Use Cases

  • ⚛️ Familiar React API (with million/react)
  • 🦁 Built for libraries that compile
  • 📦 Lightweight bundle size (<1kb brotli+min)
  • Fast runtime operations
  • 🛠️ Composable using drivers, sensible by default

Note: Million now supports experimental React compatibility.


Installing Million


Inside your project directory, run the following command:

  1. ```sh
  2. npm install million
  3. ```

Codebase


This repo is a "mono-repo" with modules. Million ships as one NPM package, but has first class modules for more complex, but important extensions. Each module has its own folder in the /packages directory.

ModuleDescription
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[`million`](https://github.com/aidenybai/million/tree/main/packages/million)The
[`react`](https://github.com/aidenybai/million/tree/main/packages/react)A
[`router`](https://github.com/aidenybai/million/tree/main/packages/router)A
[`jsx-runtime`](https://github.com/aidenybai/million/tree/main/packages/jsx-runtime)A
[`html`](https://github.com/aidenybai/million/tree/main/packages/html)A
[`morph`](https://github.com/aidenybai/million/tree/main/packages/morph)A
[`utils`](https://github.com/aidenybai/million/tree/main/packages/utils)A
[`vite-plugin-million`](https://github.com/aidenybai/million/tree/main/packages/vite-plugin-million)A

Resources & Contributing Back


Looking for the docs? Check the documentation out.

Want to talk to the community? Hop in our Discord and share your ideas and what you've build with Million.

Have a question about Million? Post it on the Discord or 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](https://github.com/aidenybai/million/blob/main/.github/CONTRIBUTING.md)

Acknowledgments


Million takes heavy inspiration from snabbdom, ivi, mikado, and more. Feel free to check them out if you're interested in an alternative library to use.

Million is being used at companies like Wyze and open source work like Quartz, TinyPages, and more.

Sponsors


Dimension Theatre.js Deta Vercel

Want your logo here? → Sponsor Million

License


Million is MIT-licensed open-source software and research project by Aiden Bai.

View count