from Hacker News

Show HN: I made Million – It's a Virtual DOM made for the future

by aidenyb on 4/6/22, 5:38 PM with 10 comments

Repo here: https://github.com/aidenybai/million

My name is Aiden Bai and I'm really interested in HCI research, particularly within user interface (UI) and web development. At the time of writing this, I'm a student at Camas High School.

In July 2021, Million.js began as an experiment with Virtual DOM because I was curious with how UI libraries worked. I was frustrated with the lack of a modern, fast, and modular Virtual DOM library for JavaScript. Virtual DOM had been around for almost a decade, yet many Virtual DOM libraries still struggle with render speed compared to newer methods of rendering.

Today, Million.js is the first effort to bring Virtual DOM into the future after hundreds of hours of experimenting. Traditional Virtual DOM libraries have yet to leverage new technological paradigms in the new age of compiled Transitional UI Libraries. Million.js leverages the compiler to create predefined paths, instead of executing all the work in the browser.

Hope this serves as an interesting example of how older technologies (relative to JavaScript time) can evolve to modern time (similar to how Solid took Knockout's fine-grained strategy and applied modern techniques)

  • by JoeyJoJoJr on 4/6/22, 11:48 PM

    Looks pretty cool.

    I’d really like to be able to declare my UI in a “draw” or “render” loop, like how I would do a UI with immediate mode rendering. This way I don’t need to deal with any subscription handlers, actions, etc. I just update the state object and the UI just renders. Would it be practical to use million.js in this fashion?

  • by quackduck on 4/7/22, 3:13 AM

    Absolute legend, I still remember when you pitched this IRL to Guillermo Rauch and Tom P Werner!
  • by victor_e on 4/6/22, 11:52 PM

    I like the SharkTank style presentation. Impressive stuff to be working on at any age but at 17.xxxxxxxx even more so!
  • by donkarma on 4/6/22, 9:47 PM

    What is a virtual DOM?