-1
日增长
17,665
stars
591
forks
59
watchers
571
prs
583
issues
216
releases
README
Want to automatically find and fix performance issues? Check out Million Lint.
📚 Read the docs
🎦 Watch video
💬 Join our Discord
🌐 Follow on Twitter
What is Million.js?
Million.js is an extremely fast and lightweight optimizing compiler that make components up to _70% faster_.
Oh man... Another /virtual dom|javascript/gi framework? I'm fine with React already, why do I need this?
Million.js works with React and makes reconciliation faster. By using a fine-tuned, optimized virtual DOM, Million.js reduces the overhead of diffing (_try it out here_)
TL;DR: Imagine React components running at the speed of raw JavaScript.
👉 Setup Million.js in seconds! →
Installation
The Million.js CLI will automatically install the package and configure your project for you.
bash
npx million@latest
Once your down, just run your project and information should show up in your command line!
Having issues installing? → View the installation guide
Why Million.js?
To understand why to use Million.js, we need to understand how React updates interfaces. When an application's state or props change, React undergoes an update in two parts: rendering and reconciliation.
To show this, let's say this is our App:
jsx
function App() {
const [count, setCount] = useState(0);
const increment = () = setCount(count + 1);
return (
Count: {count}
Increment
);
}
In this App, when I click on the button, the count state will update and the tag will update to reflect the new value. Let's break this down.
Rendering
The first step is rendering. Rendering is the process of generating a snapshot of the current component. You can imagine it as simply "calling" the App function and storing the output in a variable. This is what the App snapshot would look like:
jsx
const snapshot = App();
// snapshot =
Count: 1
Increment
;
Reconciliation
In order to update the interface to reflect the new state, React needs to compare the previous snapshot to the new snapshot (_called "diffing"_). React's reconciler will go to each element in the previous snapshot and compare it to the new snapshot. If the element is the same, it will skip it. If the element is different, it will update it.
- The tag is the same, so it doesn't need to be updated. ✅
- The tag is the same, so it doesn't needs to be updated. ✅
- The text inside the tag is different, so it needs to be updated. ⚠ ️
- The tag is the same, so it doesn't need to be updated. ✅
- The onClick prop is the same, so it doesn't need to be updated. ✅
- The text inside the tag is the same, so it doesn't need to be updated. ✅
_(total: 6 diff checks)_
diff
- Count: 0
+ Count: 1
Increment
From here, we can see that the tag needs to be updated. React will then update the DOM node to reflect the new value.
jsTop issues
#1186Repository Compromised with Shai-Hulud `.claude/settings.json` and `.vscode/tasks.json` files4 comments · 2026-05-20#1188Block rendering ignores CSS custom properties in dynamic styles0 comments · 2026-10-23#1187React Review Audit0 comments · 2026-05-20
Latest release
v3.1.0 v3.1.0 2024-05-21What's Changed fix: broken block link by @seren5240 in https://github.com/aidenybai/million/pull/984 fix: 996 Handle property alias by @AlexanderArvidsson in https://github.com/aidenybai/million/pull/997 fix: log compiler option by @rnln in https://github.com/aidenybai/million/pull/1009 Feat/million rc release by @NisargIO in https://github.com/aidenybai/million/pull/1035 feat(cli): replace wizard with @million/install by @xinyao27 in https://github.com/aidenybai/million/pull/1034 New Contributors @seren5240 made their first contribution in https://github.com/aidenybai/million/