The Business Case for Vanilla JS

32 points by ugur


siru

Perhaps frameworks, like React, are a byproduct of their time. When Vanilla JS was not nearly as good or standardized across browsers yet. And then people kept using them after it was no longer necessary because it was the devil they knew. But this is just a guess, as I have never really used JS or React.

mitchhentges

I'm all for reducing the amount of fronted library "noise", but I've always felt that the value of React was to compartmentalize logic and to scope code to the HTML/CSS it's closest to.

Without it, with vanillaJS, most things are just bound to the "global" scope (document, window), right? That's fine for smaller apps, but it gets unwieldy as your app grows.

I'm interested in seeing if a lighter-weight approach comes up that solves this without the complexity of React.

alexjurkiewicz

This idea has been posted a few times lately. Most recently, yesterday: https://lobste.rs/s/qywh3s/with_ai_you_barely_need_frontend

Have you tried to write framework-less JS for a large app? Web Components only support strings for message passing. Have fun JSON-round tripping all your complex data types.

zzing

Angular does a lot for me.

dsh

I think the selling feature of a framework like React is that it can target more than the DOM. There is react-dom which we mostly use for building SPAs, but there is also react-native, react-email, react-pdf etc which target different view layers. I'm not a particular fan of the framework but I think the real sell here is its defined patterns working across different platforms for building frontend UIs.

How true this is in practice - being able to use my react-dom components across in react-native or react-pdf - is not something I have actual experience in. I typically agree with the author though that if you want to add a bit of interactivity and dynamic content to a web page, just use some vanilla javascript.