Live data from Hacker News

VanJS (Vanilla JavaScript): smallest reactive UI framework

github.com

111–120 of 214 posts

Re: VanJS (Vanilla JavaScript): smallest reactive UI framework

#112
Throwback to ten years ago and libraries like Mercury: https://www.npmjs.com/package/mercury

This is what we were doing before React and Babel came along. No dependencies, no transpiling, light weight, no IDE setup, were all a given and not special features.

Re: VanJS (Vanilla JavaScript): smallest reactive UI framework

#113
post #98

Earlier quoted context omitted.

We struggle to render a few boxes and some text under 16ms Only if a dev has screwed up. Most simple sites are fine. You have to push the DOM quite hard for the browser to be the bottleneck. I've worked on apps that have DOM trees with 60,000+ nodes that remain under 16ms (because very few were actually changing at any given time..) games with vastly more complex sound, network, physics, UI and whatever else systems…

> Only if a dev has screwed up. Most simple sites are fine. You have to push the DOM quite hard for the browser to be the bottleneck. I've worked on apps that have DOM trees with 60,000+ nodes that remain under 16ms (because very few were actually changing at any given time..) You mentioned that frameworks like React make it simpler to get better performance but based on my observations it's quite the opposite and Re…

FWIW the app that pushed 60,000 DOM nodes around at 60fps was entirely in React.

I keep seeing an advert for a Principle Frontend Dev at Reddit on LinkedIn. Maybe I should apply...

Re: VanJS (Vanilla JavaScript): smallest reactive UI framework

#115
post #14

The "Hello World" example is a really good example of why React, Vue, etc are better than something more minimal like this library if you're optimizing for speed. The page will show nothing until the script runs, which requires downloading the VanJS lib and the script itself. You could inline them into the page, but that gets seriously messy at scale. A modern React app that's using some serverside rendering for the…

You are comparing apples to oranges. The author could probably couple their library with https://vite-plugin-ssr.com/ and have something comparable within a day.

The reality is most running React apps today are still traditional SPAs, and chances are likely the same apps can be rewritten with VanJS (or any other SPA framework) and the users would not notice a difference.

Re: VanJS (Vanilla JavaScript): smallest reactive UI framework

#116
post #63
post #49

For comparison, similar tiny JS view libraries - https://redom.js.org 2kB - https://nanojsx.io 1kB

nanojsx looks great! I don't really get why mini-van don't use JSX.. Maybe some people just don't want any html tags in their project ? Or maybe their template engine allows a lighter approach.

You can avoid a build step by not using JSX.

Re: VanJS (Vanilla JavaScript): smallest reactive UI framework

#118
You are not really getting anything in the size difference between this and something like preact, you are going to end up bottlenecked on something else like waiting for CSS to load. This is fine if you just want to write the code in a minimalist style, but I really doubt cutting things back to this extreme has tangible performance benefits for like 99% of applications.

Re: VanJS (Vanilla JavaScript): smallest reactive UI framework

#119
post #33

Web development is going to come full circle once everyone comes to terms with the fact that web development has been overcomplicated and you don't need 1000 packages and abstractions on top of abstractions just to interact with some DOM elements.

The day they make native web components as useful as using Vue or React without needing a single third party library, that is when this might happen. Until then, I dont think its happening any time soon.

Re: VanJS (Vanilla JavaScript): smallest reactive UI framework

#120

I really don't want to be that guy, but... Vanilla JavaScript already exists as a popular term for JavaScript without any framework. No jQuery, no React - just JavaScript. Calling a library VanJS (as short for "Vanilla JavaScript") is just going to cause confusion. The repo's own description uses the phrase vanilla JavaScript in this way, and even mixes both meanings within a single sentence. If the author likes the…

Don’t you know, it’s 2023 and we’ve decided words don’t mean anything?
Post reply on HN