Million.js makes React up to 70% faster by replacing the Virtual DOM with a fine-grained compiler. Drop it into any React project with zero refactoring.
Installation
npx million@latest
It automatically configures your bundler (Vite, Next.js, Webpack).
Automatic Mode (Zero Config)
// next.config.js
import million from "million/compiler";
export default million.next({ auto: true });
That is it. Million.js analyzes your components and optimizes them automatically.
Block Mode (Manual Optimization)
import { block } from "million/react";
function ProfileCard({ name, avatar, bio }) {
return (
<div className="card">
<img src={avatar} alt={name} />
<h2>{name}</h2>
<p>{bio}</p>
</div>
);
}
// Wrap with block() for maximum performance
export default block(ProfileCard);
For Loops (Lists)
import { For } from "million/react";
function TodoList({ todos }) {
return (
<For each={todos}>
{(todo) => <div key={todo.id}>{todo.text}</div>}
</For>
);
}
How It Works
- Compile time: Analyzes JSX to find static parts
- Runtime: Only updates dynamic parts (like Svelte/Solid)
- Result: 70% fewer VDOM operations
Benchmarks
- List rendering: 2-3x faster than vanilla React
- State updates: 50-70% fewer DOM operations
- Bundle size: +1KB gzipped
Key Features
- Drop-in replacement — no code changes needed in auto mode
- Fine-grained rendering — updates only changed DOM nodes
- Works with Next.js, Vite, Webpack
- React 18/19 compatible
Need to scrape or monitor web data at scale? Check out my web scraping actors on Apify — ready-made tools that extract data from any website in minutes. Or email me at spinov001@gmail.com for custom solutions.
Top comments (0)