

Github GitHub - millionjs/million: 🌈 <1kb virtual DOM - it's fast!
source link: https://github.com/millionjs/million
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

<1kb virtual DOM - it's fast!
Current Virtual DOM implementations are too complicated—Whether it be a fully featured yet bloated Virtual DOM in React, or the deprecated virtual-dom
package on NPM, they are basically unusable without sacrificing raw performance and size. Million aims to do this, providing a library-agnostic Virtual DOM to serve as the core for Javascript libraries.
Installing Million
Million doesn't require build tools by default, feel free to just drop a script tag in the head of your webpage.
<script src="https://unpkg.com/million"></script>
It also integrates well with module bundlers like Webpack or Rollup, just install via npm.
Hello World Example
Below is an extremely simple implementation of a Hello World page using Million.
<div id="app"></div> <script> const { m, patch } = Million; const newVNode = m('div', { id: 'app' }, ['Hello World']); const el = document.querySelector('#app'); patch(newVNode, el); </script>
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!
Acknowledgments
Million is MIT-licensed open-source software by Aiden Bai, William Lane et al.
Million takes heavy inspiration from React, and believes in the core philosophies and values behind Lucia and Inferno. Feel free to check them out if you interested in an alternative library to use.
© 2020-2021 Aiden Bai, William Lane.
Recommend
-
105
了不起的Virtual DOM(一):起源发布于 2017-12-22 首先欢迎大家关注我的
-
75
-
42
-
48
一、前言 目前最流行的两大前端框架,React 和 Vue,都不约而同的借助 Virtual DOM 技术提高页面的渲染效率。那么,什么是 Virtual DOM ?它是通过什么方式去提升页面渲染效率的呢?本系列文章会详细讲解 Virtual DOM 的创建过程...
-
3
Plug: I work on Million.js: <1kb virtual DOM - it's fast! TL;DR Virtual DOM needs to leverage the compiler, so...
-
7
-
12
An Ode to jQuery (and a 1kb alternative!)When jQuery came out it really was spectacular, it gave developers a common Vernacular, But times have changed and the year is 2021, and the time for jQuery has passed and gone....
-
10
What is Million? M...
-
10
Making a Website Under 1kBAugust 02, 2022I recently launched (another) website club called the 1kB Club. Unlike the
-
8
Introduction Following a recent announcement by the millionjs creator Aiden Bai about support of Millionjs for Nextjs apps in the newe...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK