DEV Community

Alex Spinov
Alex Spinov

Posted on

Million.js Has a Free API You Should Know About

Million.js is a compiler that makes React components up to 70% faster by replacing React's virtual DOM with a fine-grained reactive system — without changing your code.

Why Million.js Speeds Up React

A React dashboard rendering 10,000 rows was dropping frames on every update. Adding Million.js as a compiler plugin — zero code changes — made updates smooth at 60fps.

Key Features:

  • Drop-In Compiler — No code changes needed
  • 70% Faster Updates — Fine-grained DOM patching
  • Automatic Optimization — Compiler detects what to optimize
  • React Compatible — Works with existing React components
  • Small Overhead — <4KB runtime

Quick Start

npx million@latest
Enter fullscreen mode Exit fullscreen mode

This automatically configures your bundler (Vite, Next.js, webpack).

Usage with Next.js

// next.config.mjs
import million from "million/compiler"

export default million.next({ auto: true })
Enter fullscreen mode Exit fullscreen mode

That's it. Your React components are now optimized automatically.

Manual Optimization

import { block } from "million/react"

const MyComponent = block(function MyComponent({ name, count }) {
  return (
    <div>
      <h1>Hello {name}</h1>
      <p>Count: {count}</p>
    </div>
  )
})
Enter fullscreen mode Exit fullscreen mode

Why Choose Million.js

  1. Zero effort — automatic compiler optimization
  2. Massive speedup — up to 70% faster rendering
  3. No lock-in — remove it anytime, your code doesn't change

Check out Million.js docs to get started.


Need performance tools? Check out my Apify actors or email spinov001@gmail.com for custom solutions.

Top comments (0)