paczki
6 days ago
As someone who actively goes out of my way to stick to writing vanilla HTML/CSS/JS as much as possible, it's honestly hard to explain to people who only write within frameworks how good it's gotten. Use the proper tool for the job, of course, but it sparks joy!
yahoosakie
6 days ago
Yes!
I've done the same for years, and it feels a little bit like the IQ bell curve meme, where on the left and right it is like "vanilla HTML/CSS/JS are all you need."
appplication
6 days ago
This is an earnest question but is that really true for reactivity and state management? Of course with vanilla is all things are technically possible, but I feel like last I checked this wasn’t something well supported without really knowing what you’re doing.
zelphirkalt
6 days ago
I nowadays build sites (personal websites and projects) that are much more responsive than most things I see online or on a job, just using modern CSS, a little thinking about how I structure my stylesheets, trying to use semantic HTML and not making a div soup. It works pretty well, if used correctly and given the due attention.
lucumo
6 days ago
Responsiveness has been fine for a while. Not surprising with the smartphone revolution being nearly 2 decades old by now.
GP asked about reactivity. And that still requires some frameworking, either prebuilt or a lightweight self-written one.
oblio
5 days ago
What's reactivity in this context? How quickly a website responds? My personal experience is that fast backends with server side rendered HTML and a bit of dynamic sections are in practice MUCH faster than SPAs, 20 years after using Gmail for the first time. Gmail then was fast, 95% of modern SPAs are slow.
abanana
5 days ago
"State management" is a fancy way to say "your Javascript stores data in variables in some way, which are updated as and when needed".
"Reactivity" means "when those variables change, some generic code already exists to update the DOM instantly". As opposed to writing specific pieces of code to make those changes directly.
Unfortunately, with React, "updating the DOM automatically" generally means: you update the data; React recreates the entire DOM as a new copy in memory; React runs a diff checker to find out what changed from the real DOM; React makes each individual change in the real DOM. With React (or other virtual-DOM-centered alternatives) being used for the smallest of web projects, so many small sites do all that work when the procedure ought to be as simple as: you update the data; you update the DOM directly.
It comes down to inexperienced devs not being able to consider which tool is best for the job at hand, and just hammering nails into every web project in the same way.
tancop
5 days ago
I mean all you have to do is change the framework to a better one. Vue with Vapor mode, Svelte, Solid or Preact. These don't have a VDOM at all or use a super fast minimal one.
Signals are basically as fast as writing event handlers yourself but way less fragile and verbose. React is just shaping everyone's impression of all JS frameworks because it's very popular and very slow.
seanw444
5 days ago
I used to be Reactpilled, but ever since I've tried Svelte, I haven't gone back.
bleuarff
5 days ago
Reactivity is updating the DOM whenever the underlying data is updated. That's one of the most basic reason for existence of all js frameworks. There's TC39 Signals proposal to bring that natively, but for now as said above the choice is either use a framework or recreate one. It's surprisingly easy nowadays using Proxy.
hnlmorg
5 days ago
It’s always been easy to reactively update the DOM. I was doing that in vanilla JS before HTML5 had been formalised.
What the frameworks do is take this concept one step further to create a SPA (single page application) but I honestly think they’re an antipattern that needs to die.
spoiler
5 days ago
The problems are ownership and provenance mainly, and that all DOM access is slow and requires syncing code internally.
Anyone can write code that tweaks nodes or uses templating, but doing it in a consistent way on a project with hundreds of thousands linea of code is challenging, especially if you also need performance and everyone's least favourite child: accessibility.
Sure you don't get some of this with frameworks, but they help a lot.
hnlmorg
5 days ago
Well yeah, obviously frameworks are intended to provide a standard interface for projects that scale. But you’re describing a different problem to the one originally argued.
skydhash
5 days ago
> Reactivity is updating the DOM whenever the underlying data is updated. That's one of the most basic reason for existence of all js frameworks.
Most web apps and websites do not have that much state variables (even though it may be a lot of data). So while React may offer a small dev speed boost, it’s consumed by the need to build stuff and a whole deploy pipeline to nurse.
Libraries like HTMX and Alpine can take care of most the boilerplate for old style imperative patterns. And backend frameworks like Rails, Phoenix, Laravel donhave their own implementation for data updates.
0xpgm
5 days ago
How I've done it is to use some kind of observer pattern, where you register listeners to state changes.
Whenever state is updated, the listeners are all called with the updated state and can update the UI and what not based on the new state.
I haven't profiled this and compared it to frameworks, but feels adequate for the relatively simple UIs I've done.
troupo
5 days ago
In a way that's where all frameworks start.
bluecheese452
5 days ago
I click the upvote button and a number goes from 0 to 1. Somewhere else on the page a banner gets displayed saying you have upvotes.
Your javascript can target those 2 divs, ala doc.getElementById(counter).innerHtml and document.createElement.
Like that kind of works for simple stuff. But it gets more complicated fast. Reactivity is when your counter listens for change in the count and updates itself whenever that count changes.
zelphirkalt
5 days ago
That's why you wouldn't target those 2 divs directly, but have one dedicated place, in which you update the divs and call that place from any other place that needs to update the 2 divs.
Well, that's simplifying the situation, but as those situations become more and more in ones site, at some point one might switch to a mediator pattern, which kind of is very close to signal emit and listening for signals.
6510
5 days ago
For this specifically I would have the "you have upvotes" banner in the dom already with a class display:none.
I consider it a huge advantage to have the code for both the counter and the banner in the same place. thisCounter++; thisBanner.className = "shown";
zahlman
5 days ago
... But vanilla JS with the DOM already has event listeners... ?
troupo
5 days ago
You still have to set them up and twar them down and update the display in disconnected places.
Works well for a small bumber of things to update, quickly becomes unmanageable.
V__
5 days ago
How many sites actually need reactivity? For most sites you can either use a bit of vanilla javascript or htmx.
hirvi74
5 days ago
Vanilla JS handles reactivity just fine with it's built-in methods.
yieldcrv
5 days ago
I also do stuff wayyy more efficiently than I do on a job
But it has no utility
Compute is fine and nearly free
These are just art projects
azangru
6 days ago
> without really knowing what you’re doing
Really knowing what you're doing is the implicit part of the right-hand side of the bell-curve meme :-)
satvikpendem
5 days ago
No, it's not, despite what other comments here say. Of course it's possible but you end up recreating React or another library along the way. JS is getting native signals sometime in the future but for now pure JS is not sufficient for a full, complex app.
abanana
5 days ago
> you end up recreating React or another library along the way
That's always the trotted-out response, most often recited by people who've read someone else saying it but not had the experience to form an opinion for themselves.
You absolutely don't end up recreating a massive, bloated, slow framework that tries to be as generic as possible to try to be everything to everyone. What you end up creating is a relatively tiny, fast, piece of code that is specific to that site's needs. The difference in size, speed and simplicity tends to be absolutely enormous.
reef_sh
5 days ago
For a large ERP-like back-office where leadership didn't want to use an existing reactive framework, I definitely ended up recreating built on top of jQuery ( at the start of the project IE still needed to be supported ).
Once you start adding dynamic forms for managing multiple items of different kinds, dashboards, error states, i18n, etc, you either end up with a homegrown framework, or with a lot of spaghetti.
satvikpendem
5 days ago
Wrong on both counts. I've worked in companies with vanilla JS only and made parts of those frameworks they ended up building. It is absolutely not "relatively tiny, fast, piece of code that is specific to that site's needs" and once we switched to React we actually saw improvements in many parts of the sites' loading speeds. Next you're gonna No True Scotsman me by telling me the company was just bad but I've seen enough examples at other companies to see that using React or a similar framework is simply the right move.
6510
4 days ago
The joke is that those who react have no idea and those who don't have no idea either. I never use react so I'm going to have to go with: Those other companies are also just bad. (joking) If everyone can work with/without it should be fine? As long as you don't try to do both.
publlus_enigma
5 days ago
Hate to tell you this, bit 99% of apps built with React are rebuilding what has already come before. Namely, taking some information from a database and displaying it on a screen, and taking some input from a computer and putting it in a database.
Almost every web application being built today, framework or no framework, is a variation of a theme. We have no issue recreating those ad nauseum, but we draw the line at recreating a framework?
satvikpendem
5 days ago
Who has no issue recreating those? Speak for yourself.
abirch
5 days ago
have you played with lit.dev ? It's part of the OpenJS Foundation (formerly jQuery and Node.js Foundations)
JimDabell
5 days ago
> is that really true for reactivity and state management?
No. Use a framework if you want those things. Everything around reactivity, state management, and components have been badly fumbled by the web platform and the various front-end frameworks are far more ergonomic.
80fj0348i
6 days ago
1. The tools available in vanilla have improved a lot recently and 2. LLMs have made niche skills/knowledge more accessible. SPAs still have their place but the average CRUD app is now really well served by vanilla or lightweight libraries like HTMX.
nkmnz
6 days ago
On the other hand, the average CRUD app doesn’t care about the traffic and rendering overhead of a reactivity library such as Vue. Looking at the boilerplate code needed for basic reactivity that your sibling comment linked to in the Mozilla docs… no, thanks. Just eat the 16kb and have some decent ergonomics.
soperj
6 days ago
CSS was always pretty accessible. You just had to actually care to learn it.
jimbob45
5 days ago
If the rest of you weren’t so stupid, our industry wouldn’t have a problem
This attitude is why we’re all still stuck writing C++ in 2026. Nobody wants to admit that they’re not hardcore enough to write in poorly designed languages so we never make the effort to improve the situation. We all seem to agree that Zig is an upgrade over C. There’s nothing inherently modern about Zig that we couldn’t have written back in 1995 - we just didn’t because nobody wanted to admit that C is frustrating and clunky, albeit fast.
KPGv2
5 days ago
Yeah, people like to talk about how cultish Rust programmers are, but C programmers are so much worse. Just a couple days ago I had one trying to explain to me that all other languages are worse because you don't understand what the machine is doing under the hood. Completely ignoring it doesn't matter because I have a computer from 2023, not 1986.
satvikpendem
5 days ago
Case in point: https://news.ycombinator.com/item?id=50169201
I honestly didn't know people like this still existed, with such strong viewpoints on C.
80fj0348i
5 days ago
> Just a couple days ago I had one trying to explain to me that all other languages are worse because you don't understand what the machine is doing under the hood.
Point out to these people that compilers rewrite your code quite significantly so the choice of language matters a lot less than the choice of debugger, profiler, etc.
zelphirkalt
6 days ago
True, though it is also true that achieving good responsiveness was not as easy in the past, say 10 or more years ago, without flex box and grid and without calc and clamp and such.
I nowadays use flex, calc, clamp, min, max, scoped variables, and even display table sometimes these days and it just works so well. Eliminates almost all hacks.
soperj
5 days ago
I used flexbox 10 years ago for sure. Grid I think was introduced before flexbox, but didn't get proper browser implementations until around covid.
coldtea
5 days ago
>This is an earnest question but is that really true for reactivity and state management?
Yes. We could do those before React and other crap too.
codingdave
5 days ago
> without really knowing what you’re doing.
That is an odd caveat to throw on the end. Sure, to avoid frameworks you have to know what you are doing. Is that really such an outrageous expectation?
bossyTeacher
5 days ago
If people knew what they were doing jQuery, Angular and React would not have existed in the first place. With devs moving companies every two years or so, being able to hit the ground running was very important and you couldn't afford to spend weeks or months learning the idiosyncrasies of your new codebase especially when it came to state management. That's the main problem frameworks and libraries were solving.
chrisweekly
5 days ago
That's not quite right. jQuery was exactly the right tool for those of us who knew what we were doing. Browser inconsistencies in the early days were practically insurmountable without jQuery to provide a consistent API surface.
skydhash
5 days ago
> you couldn't afford to spend weeks or months learning the idiosyncrasies of your new codebase especially when it came to state management. That's the main problem frameworks and libraries were solving.
Not really. Frameworks are usually created to avoid boilerplate and provide some nice scaffolding to support you while you’re coding the business layer. And a lot of them do smooth over accidental complexity, even though the architecture is generic and may hinder you in the future.
But the learning curve still exist, as most of what you interact with is custome codes, modules and components.
onion2k
6 days ago
mb2100
5 days ago
There are JS libs (like Reactive Mastro [1]) that go well with writing otherwise vanilla HTML/CSS/JS, and there are libs (like React) where you're quickly sinking into a mud of abstractions and have to fight the reactivity runtime when you try to write vanilla JS.
satvikpendem
5 days ago
Perhaps put a disclosure that you're the one working on whatever you're linking.
Theoleff
5 days ago
Agreed. I think part of why it's hard to convey is that a lot of people formed their idea of CSS back when flexbox was new. These days an accordion is a few <details>, and a reading progress bar is a fixed div with animation-timeline: scroll(). You don't need JS for either.
(Full disclosure, I wrote a book on this, so I'm not exactly neutral: https://theosoti.com/you-dont-need-js/)
abanana
5 days ago
Flexbox is still fairly new! Hmm, maybe I'm just old.
While a lot of devs love to use brand-new stuff that's only just been added to some browsers, some of us are not willing when we know it won't work for (almost) all users. The scroll() function is too new for use in production, IMO (but good to know it exists, to revisit after a while). If I have to code something else anyway, or copy-and-paste a polyfill, then why not just use a more robust option in the first place.
6510
3 days ago
In this case you can just let it fail. I suspect people on archaic browsers are much more likely to prefer it that way.
DimmieMan
6 days ago
Definitely worth keeping up with as a framework user too.
Smaller bundles, often easier to use, less bug potential. Code's a liability and being able to occasionally rip a bunch out as a feature becomes baseline is always a joy.
flohofwoe
6 days ago
OTH all the complexity ends up baked into the browser where it will be frozen forever (even the shitty/overengineered ideas, like WebAudio). At least frameworks can be discarded and replaced when something better comes along.
IMHO even HTML+CSS should be completely implemented outside the browser in the 'framework layer', but I guess that's not a very popular opinion among the more 'conservative' web devs ;)
afavour
5 days ago
That would mean some shitty load times for even the most basic web site.
But there is probably a world where what you’re describing is possible with WASM and Canvas. Would need to solve for accessibility though.
Rygian
5 days ago
If that means having an "HTML+CSS framework" that I could easily swap out for a "Typst framework" and publish my blog using Typst, then sign me up!
Meanwhile, there's Typst bundles [1], still experimental, that implement the same idea backwards: convergint a Typst project into a set of output files (which can be HTML).
lachlanj
5 days ago
Any good articles or post you could link to, CSS has come so far and I’m trying to gather info on what’s now possible
khalic
5 days ago
They were too slow, people are all tailwind native now and don't know a thing about CSS. I keep seing "full stack devs" complaining about "bleed out" issue, aka C in CSS, cascading
salah7252
5 days ago
After Tailwindcss got bought by the child killers I tore Tailwindcss out of everything.
ARandomerDude
5 days ago
More info please
letrix
5 days ago
Shopify
sourcecodeplz
6 days ago
i also found this to be even more powerful today with AI.
dont need to import libraries anymore, can just build my own.
troupo
5 days ago
> it's honestly hard to explain to people who only write within frameworks how good it's gotten.
What exactly has gotten good?
CSS is the only area that is seeing improvement, and frameworks ... use the same CSS, so no idea what you're talking about.
Most everything outside of CSS has been and continues to be shit.
Edit: Moreover, literally all frameworks as one say: give us good browser APIs so that we don't have to do any of the things we do.
shevy-java
6 days ago
Good how and where? That's a very uncritical take you have here.
I find it is way too complicated with regards to flexbox, grid etc...
Just do a google search for flexible divs side by side. Start with two. Then switch to five. Tell me the solutions that work well.
zelphirkalt
6 days ago
My rule of thumbs is: Use flexbox unless it truly is a grid or repeating rows + "I wonder if a flexbox can be used ... ah yes it can." Flexbox is just made for responsive layouts. It is very good.
nilslindemann
6 days ago
"flexible divs side by side" sounds like something which can be generated in many ways, From display: inline-block, over float:left, col-columns, flex layout, to a grid based layout. Can what you desire be created in, for example, https://grid.layoutit.com/?
azangru
6 days ago
> Just do a google search for flexible divs side by side. Start with two. Then switch to five. Tell me the solutions that work well.
I did like you asked. The first search result on google is a question on stack overflow. And the first comment provides an example that looks very much like flexible divs, side by side, between two and four based on the width of the container.
https://stackoverflow.com/questions/60615826/two-divs-side-b...
What didn't you like about the solution in that comment?
xboxnolifes
6 days ago
flexible divs side by side is trivial with both flexbox and grids. Far, far, far easier than prior to flexbox.
6510
6 days ago
don't search, ask an llm. Ask it to keep it as simple as possible and have it explain the tags you've forgotten.
decksmith
6 days ago
[flagged]
Tadpole9181
6 days ago
I feel like I'm taking crazy pills.
Y'all know React and Vue frameworks still use HTML, CSS, and JS, right? We're using the same thing, with a thin layer of helpers around mounting components and managing their lifetimes...
culi
6 days ago
People who use css-as-an-object type of frameworks or tailwind don't really get to experience what writing CSS is like. styled-components or Linaria or Emotion do though ofc
yard2010
5 days ago
I love emotion.sh with my heart. It used to be so hard to write css for me until I landed on the mental model of styled components
Quothling
6 days ago
As culi also touches on I think it depends on what is meant by frameworks. As someone who belives abstraction are horrible practice unless they serve a really good purpose though, I never bought the "this is easier" part of the big CSS frameworks. I fully accept that people who work on user facing web applications more than I do, which is rarely, had a much easier time using something like bootstrap/tailwind/whatever. I always found having to look up documentation on something wich was infinitely worse than the CSS documentation on developer.mozilla.org to be a a weird experience. I do fully accept that a lot of teams experiences would prove my personal opinions wrong on this.
On the flip-side I always found javascript frameworks to have a purpose. Though to be fair I don't think I've worked with user facing javascript without a framework since jquery came about. I guess you could call that a library, but still.
rimliu
6 days ago
Think layer? Like a page loading 6MB of crap to show 0.5KB of text?
chamomeal
5 days ago
I don’t disagree with you and I lurve frameworks. Yes, I love react. It is so awesome.
But it is SO nice to not have any build step. All of my new projects start as a single babashka script now. You got html templating, throw in a stylesheet. Slap a datastar script tag in there for everything else. It’s just easy peasy.
SlackingOff123
6 days ago
OP might be referring to using React together with a UI library that comes with elements like <Grid>, instead of using just React + CSS grid.
alerighi
5 days ago
Except that with React you usually use something like tailwind or similar that abstracts writing CSS, that do me doesn't make sense.
Of course you can still write plain CSS.