Feels weird to seem to seriously represent your framework as being about size without including a comparison to preact - the obvious choice for a react developer looking to reduce their footprint. Preact claims 3kb on their site, and for a 3-4x savings you're going to need to be fairly compelling. I don't mind paying a modest cost for 10x or 100x improvements, but (call it Stockholm syndrome) I like react syntax
Modern reactive UI frameworks get away from maintaining virtual dom. If you want minimalist vdom preact is a great choice. If you'd like to part ways with vdom while keeping jsx, try svelte or solid-js
VanJS – A no-JSX framework based on vanilla JavaScript
71–80 of 178 posts
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#72This is unacceptably huge compared to the similarly named Vanilla JS. http://vanilla-js.com/
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#73Re: VanJS – A no-JSX framework based on vanilla JavaScript
#74Why do people even reinvent this wheel every few months? Does the Anyone can build a "reactive" type framework by following tutorials online now, they're super in vogue. Is my cynicism here warranted, or am I just jaded from 20 years of watching pendulums swing left and right and watching the wheel be reinvented over and over?
You're jaded. Look at this as someone completing the exercise to understand reactive frameworks by implementing a toy implementation. Like when someone implements yet another lisp. Maybe you disagree with it getting to front page, but then don't upvote & move on. There'll always be some amount of front page content someone considers crap & it's best if we don't collectively fill every comment thread disparaging about…
I don’t think that’s the intention of the author or the person who posted this or the people who voted it to the top of HN
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#75A lot of the heft of React comes from its optimization and reconciliation code. Looking at the examples on the homepage, I’m struggling to see how this framework would efficiently make updates. It seems like it would just need to update the entire component tree down on any update. For any sufficiently large app this becomes very slow very quickly.
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#76Earlier quoted context omitted.
> This is unacceptably huge compared to the similarly named Vanilla JS. It took me a minute to get it. 0 bytes uncompressed, 25 bytes gzipped
Can you enlighten us?
25 bytes is the size of a gzipped empty file.
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#77Why do people even reinvent this wheel every few months? Does the Anyone can build a "reactive" type framework by following tutorials online now, they're super in vogue. Is my cynicism here warranted, or am I just jaded from 20 years of watching pendulums swing left and right and watching the wheel be reinvented over and over?
The problem is not size. The problem is installation, configuration, dependencies, transpilation, IDE setup, etc. And here you have the plain old notepad with browser - nothing else...
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#78This is unacceptably huge compared to the similarly named Vanilla JS. http://vanilla-js.com/
Try to replicate a sample app made by VanJS with Vanilla JS and check the difference
const Counter = () => {
let counter = 0;
const updCounter = (delta) => {
counter += delta;
document.getElementById('count').innerText = `♥ ${counter}`;
};
document.getElementById('up').addEventListener('click', () => updCounter(1));
document.getElementById('down').addEventListener('click', () => updCounter(-1));
updCounter(0);
};
Counter();
*thumbs-up*
*thumbs-down*
15 LoC vs 7 LoC, zero dependencies vs. 0.9kB gzipped or 2.7kB minified.
Additional learning curve: 0h vs 1h (allegedly).Honestly, I am biased and think Vanilla JS wins :D
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#79This is where most libraries are going. Svelte 5 builds upon these signals / derivations as well, and I guess a bunch of other libraries. It would be time for them to get together and standardize on a signals library at this point that could be adopted to be a web standard and help interoperability between web components built with different frameworks.
Re: VanJS – A no-JSX framework based on vanilla JavaScript
#80Also, shameless plug for my own micro JS UI library. No signals, just regular JS variables: https://github.com/kevinfiol/umai