Code Monkey home page Code Monkey logo

million's Introduction

Million Banner

What is Million?

Million is an extremely fast and lightweight (<4kb) virtual DOM that makes React 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 works with React. Million makes creating web apps just as easy (It's just wrapping a React component!), but with faster rendering and loading speeds. By using a fine-tuned, optimized virtual DOM, Million.js reduces the overhead of React (try it out here)

TL;DR: Imagine React components running at the speed of raw JavaScript.

Installing Million

Inside your project directory, run the following command:

npm install million

Example Usage

Million.js is a library that enables you to create blocks. A block is a special Higher Order Components (HOCs) that can be used as a React component but are hyper-optimized for rendering speed.

Blocks are essentially components wrapped by block(). Below is an example of a React "counter" component that's been wrapped with Million.js.

import { useState } from 'react';
import { block } from 'million/react';

// Just wrap Counter in a block() function!
const Counter = block(function Counter({ initialCount }) {
  const [count, setCount] = useState(initialCount);
  const handleClick = () => {
    setCount(count + 1);
  };

  return <button onClick={handleClick}>{count}</button>;
});

export default Counter;

โ†’ Try the quickstart

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.

You can also track our progress through our Roadmap.

Module Description
million The main Virtual DOM with all of Million's core.
react / react-server / React compatibility for Million.
preact / preact-server / Preact compatibility for Million.
compiler The compiler for Million in React.
jsx-runtime A simple JSX runtime for Million core.
types Shared types between packages

Resources & Contributing Back

Looking for the docs? Check the documentation or the Contributing Guide out. We also recommend reading Virtual DOM: Back in Block to learn more about Million's internals.

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

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

Sponsors

Acknowledgments

Million takes heavy inspiration from the following projects:

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

License

Million is MIT-licensed open-source software by Aiden Bai and contributors:

million's People

Contributors

aidenybai avatar dependabot[bot] avatar willdoescode avatar quiibz avatar sukkaw avatar ftonato avatar cbbfcd avatar tobysolutions avatar exuanbo avatar eniodev avatar jasonappah avatar 38elements avatar andrewhummus avatar rocktimsaikia avatar pringlepot avatar lucacataldo avatar joshgillies avatar destroyer22719 avatar nisargio avatar oliviertassinari avatar rados51 avatar rezarahemtola avatar ricardobeat avatar rschristian avatar stan-kondrat avatar jamesgt avatar pyjun01 avatar fltenwall avatar fossabot avatar meesvandongen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.