Live data from Hacker News

VanJS (Vanilla JavaScript): smallest reactive UI framework

github.com

91–100 of 214 posts

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

#91
post #69
post #64

Earlier quoted context omitted.

Suggestion: call it Bourbon JS. Wikipedia: > The majority of the world's vanilla is the V. planifolia species, more commonly known as Bourbon vanilla.

Wait people write JavaScript without drinking bourbon?

My goto JS drink is Absinthe.

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

#92

That's cool but my favorite vanilla js framework by far is vapor.js. https://github.com/madrobby/vapor.js

The website for this is top-notch. It always turns me off when frameworks have bad websites, thankfully this amazing project doesn't.

http://vaporjs.com/

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

#93
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.

Already happening, see the current popularity of htmx [1]

[1] https://htmx.org/examples/infinite-scroll/

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

#94
post #26

Earlier quoted context omitted.

So now we have a framework that doesn't want to be a framework? They might call it "VoidJS" instead, as in void = vacuum = so lightweight it's almost as if there's nothing there?

Or Null.js. Or undefined.js. And now I want to create a library/framework/whatever called NaN.js...

Or even better: objectObject.js! Also, Infinity.js sounds like a really cool name, too...

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

#95
post #23

Earlier quoted context omitted.

It’s 93 lines, less than most CSS resets. Small enough to copy paste to the top of your index.html in a script tag. You can use it without NPM, webpack, a special compiler pass, or a template language. Seems pretty vanilla compared to the full fat, popular alternatives.

> Seems pretty vanilla No it doesn't, same as "automobile" doesn't seem pretty Saturn-5, despite the fact that both are moving under their own power. Terms have meaning, including meaning derived from communities by and large accepting that a certain term has a certain semantic meaning. And the accepted semantic meaning of "Vanilla Javascript" is "runs without a framework besides the browsers own API". If my code wor…

So loading an external library or framework isn't Vanilla JS, but if I copy/paste the VanJS source into a script tag, nothing gets loaded, there's no syntax magic, just some function calls, so that's Vanilla JS, right? If the latter isn't Vanilla JS by your definition, can I at least copy/paste something from stackoverflow?

Trying to make Vanilla JS a strict definition seems pointless to me in the first place.

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

#96

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…

Kinda like calling a cloud server "serverless."

Or a software development platform a "no-code" solution.

Apparently all the cool marketing kids now want you to call your widget company "widgetless." Paraphrasing EJD's critique of Ada, "This stupid idea will take 5 years and a billion dollars to kill."

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

#97
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?

Vanilla.js is the most popular framework in the world!!!!

http://vanilla-js.com

Also has the smallest footprint:

0 bytes uncompressed, 25 bytes gzipped!

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

#98
post #73
post #60

Earlier quoted context omitted.

you don't need 1000 packages and abstractions on top of abstractions just to interact with some DOM elements I don't think many developers believe that you do. Most of the complexity around 'modern web dev' isn't about achieving the basics of moving DOM nodes around. If that's what you're doing then it's hard to argue that a framework adds much benefit. Frameworks bring two benefits: Firstly, they push you down a spe…

> Building an app that renders a complex page in under 16ms isn't that easy if there's a lot going on We struggle to render a few boxes and some text under 16ms while games with vastly more complex sound, network, physics, UI and whatever else systems render frames in < 8ms at 4k.

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 render frames in

The Servo project is bringing a lot of what makes game UIs fast to browsers. It's a massive shame that it's not a Mozilla/Firefox backed idea any more but it's still going. Hopefully it'll get a bit more mainstream one day.

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

#100
post #82

If I was making this kind of mini framework instead of this a({href: "https://vanjs.org/"}, "VanJS") I would have gone with this shorter way a("VanJS").href("https://vanjs.org/") And make it chainable and allow class names as second argument as in a("About us", ".big.red").href("/about.html").target("_blank")

I think the way it's done is correct, an object passed as a parameter with key value pairs for attributes seems a lot more logical.

Maybe, but I bet this way would be slightly faster, because the library wouldn't have to loop through keys if they write functions for all the most common attributes (href, rel, className, type, etc)
Post reply on HN