Live data from Hacker News

VanJS (Vanilla JavaScript): smallest reactive UI framework

github.com

181–190 of 214 posts

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

#181
post #8

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…

Yes, please be that guy. Or I'll do it. Vanilla Javascript refers indeed to "javascript without a framework". So creating a framework and calling it "vanilla javascript" is... wrong?

I agree with you and I opened https://github.com/vanjs-org/van/issues/18

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

#182
post #62

Why is everybody so obsessed with size? 100kB means nothing these days.

i'm also a bit confused why e.g. they have an explicit rule that they only use `let` instead of `const` when declaring variables, "for reducing the bundle size", which seems like a bad trade-off in order to save maybe a couple dozen bytes at most?

Don't minifiers convert these anyway?

    const a = 1;
    let b = 2;
    console.log(a, b);
bun build --minify a.js // bundles this to:

    var o=1,l=2;console.log(o,l);
It's not even using const or let, it's flattened these multiple statements into one 'var' statement

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

#183

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…

Yea kinda felt the same, when reading the name and desc. Whats the value of names or terms if we keep reassigning a different meaning to it ? Especially in the tech industry. Also it's almost immoral calling "a new" project "lightweight" and "small". Of course it is lightweight and small, it's a new project ! Wait for bug submissions, feature requests, feature parity, time, edge cases etc. Anywhoo congrats on shippin…

> Also it's almost immoral calling "a new" project "lightweight" and "small". Of course it is lightweight and small, it's a new project !

Unless it's Swing, where a "lightweight" component is one that uses enormous piles of slow Java code to duplicate native platform functionality.

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

#184

HTML-builder APIs like this are a pretty bad idea, IMO. They assume that HTML is a closed system with no new tags, and don't account for custom elements or new tags. It doesn't even have support for existing tags like , , or ( is used by some systems now for icons). It doesn't appear to have a way to emit comments. We have the ability to embed real HTML strings, with expressions, directly into JS, which means that th…

> is used by some systems now for icons

This is somewhat alarming. is still a valid tag and used, e.g., for marking up titles of artistic works, etc. (which is not a use case for , nor for .) Similar goes for , which is (semantically) different from .

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

#185

This is really just a DSL to make dom: https://github.com/vanjs-org/van/blob/3f98060971a8ff141179ef... And a very simple system that replaces the dom from scratch each time any data changes: https://github.com/vanjs-org/van/blob/3f98060971a8ff141179ef... That's bad for performance (recomputing the style/layout and repainting even for minor changes), bad for accessibility, breaks focus, etc. It's unlikely the smaller…

Using tagged template literals with Lit or Preact + htm is more readable than Van.js, is much faster on update, and is also completely vanilla JS (no JSX and so no build step needed)

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

#186
post #182
post #62

Earlier quoted context omitted.

i'm also a bit confused why e.g. they have an explicit rule that they only use `let` instead of `const` when declaring variables, "for reducing the bundle size", which seems like a bad trade-off in order to save maybe a couple dozen bytes at most?

Don't minifiers convert these anyway? const a = 1; let b = 2; console.log(a, b); bun build --minify a.js // bundles this to: var o=1,l=2;console.log(o,l); It's not even using const or let, it's flattened these multiple statements into one 'var' statement

Only if you're targeting super old browsers.

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

#187
post #69

Earlier quoted context omitted.

Wait people write JavaScript without drinking bourbon?

The relationship between Bourbon (spirit), primarily distilled and aged in Kentucky, and Bourbon (vanilla plant), primarily grown in Madagascar is one of fascinating cross-convergence of "things rich French speakers loved", plus the coincident accident of Bourbon, Kentucky being a shipping port (and Oak as an aging vessel high in imparting vanillins). Both are a reminder that vanilla as a flavor was long a spice for…

The etymology is legit and comes from ice cream, for which vanilla is considered the default or “plain” flavoring.

https://en.wikipedia.org/wiki/Plain_vanilla

Vanilla historically being fancy but then becoming an attainable and cheap additive is probably somewhat responsible for it becoming the default ice cream flavor, and thus flipping the idiomatic meaning.

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

#188
post #8

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…

Yes, please be that guy. Or I'll do it. Vanilla Javascript refers indeed to "javascript without a framework". So creating a framework and calling it "vanilla javascript" is... wrong?

I will up you. Using the word "vanilla" to refer to anything neutral, default, or basic is wrong.

Vanilla is a sophisticated flavor, not to mention a precious and expensive ingredient. Most people have never consumed real vanilla in their lifetime.

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

#189

HTML-builder APIs like this are a pretty bad idea, IMO. They assume that HTML is a closed system with no new tags, and don't account for custom elements or new tags. It doesn't even have support for existing tags like , , or ( is used by some systems now for icons). It doesn't appear to have a way to emit comments. We have the ability to embed real HTML strings, with expressions, directly into JS, which means that th…

> is used by some systems now for icons This is somewhat alarming. is still a valid tag and used, e.g., for marking up titles of artistic works, etc. (which is not a use case for , nor for .) Similar goes for , which is (semantically) different from .

For most icon libraries that use for their icons, it's usually just a suggestion and using instead works fine. They mainly use because it's "pretty".

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

#190
post #8

Earlier quoted context omitted.

Yes, please be that guy. Or I'll do it. Vanilla Javascript refers indeed to "javascript without a framework". So creating a framework and calling it "vanilla javascript" is... wrong?

I will up you. Using the word "vanilla" to refer to anything neutral, default, or basic is wrong. Vanilla is a sophisticated flavor, not to mention a precious and expensive ingredient. Most people have never consumed real vanilla in their lifetime.

Similarly, using the word "original" to describe plain potato chips is wrong. It's the most unoriginal flavor of the lot. Just call it "plain".
Post reply on HN