Qite.js – Frontend framework for people who hate React and love HTML (qitejs.qount25.dev)

by usrbinenv 147 comments 127 points
Read article View on HN

147 comments

[−] hliyan 53d ago
I'm starting to wonder whether reactivity (not React specifically) was the originally sin that led to modern UI complexity. UI elements automatically reacting to data changes (as oppposed to components updating themselves by listening to events) was supposed to make things easier. But in reality, it introduced state as something distinct from both the UI and the data source (usually an API or a local cache). That introduced state management. It was all downhill from there (starting with two way data binding, Flux architecture, Redux, state vs. props, sagas, prop drilling, hooks, context API, stateful components vs. stateless components, immutability, shallow copy vs. deep copy, so on and so forth).
[−] neya 53d ago
Absolutely. Look at facebook today. Back in 2010, everything had just the right amount of interactivity. Because, separation of concerns existed at the language level - HTML for structure and CSS for presentation, JS for everything else.

Then some bunch of geniuses decided it would be awesome to put everything together in the name of components. Today, you open facebook, the creators of React - normal drop-down with just a list of barely 5-6 items is a fucking component that makes 10 different requests. I would even argue this unnecessary forced interactivity is what perhaps annoyed users the most as everything always has to "load" with a spinner to the point of the platform being unusable.

Same goes for instagram. It's not just that, React is a hot ball of mess. It's not opinionated, so anyone can use anything to do anything. This means if you work with multiple teams, each one uses their own code organisation, state management library and general coding paradigm. Eventually the engineers leave and the new guy decides to do things his own way. I've honestly never seen a company with a great product run over React. Everything always is being re-written, migrated every 3 weeks or straight up is buggy or doesn't work.

React is the worst thing to happen to the Javascript ecosystem. The idea is good, but the execution is just piss poor. I mean look at Vue and Svelte, they managed to do it right.

[−] incrudible 53d ago
If the html+css+js trifecta was any good for creating UI beyond simple forms, we would not have witnessed the cambrian explosion of ways to do it differently. Reactivity itself was an answer to the pain of using MVC and similar approaches in older GUI toolkits not made for the web. The pain did not stop entirely, of course, because GUI is a complicated and ill defined problem - but I don’t look back fondly to programming without it.
[−] codethief 52d ago
What makes React fundamentally worse than Vue or Svelte? In my experience, there are also plenty of crappy Vue-based sites and applications and I'm sure the same is true for Svelte.

> Today, you open facebook, the creators of React - normal drop-down with just a list of barely 5-6 items is a fucking component that makes 10 different requests. I would even argue this unnecessary forced interactivity is what perhaps annoyed users the most as everything always has to "load" with a spinner to the point of the platform being unusable.

That's a design decision, though. Sure, your point is basically that React is not opinionated enough and allows you to do anything. But in the same way you could criticize JavaScript or Python because they allow you to do "anything" and some people write shitty code.

[−] applfanboysbgon 53d ago
I genuinely don't understand why this model is the norm. As a game developer working in my own engine, UI is unbelievably straight-forward: the game has state. The master Render() function draws all of the graphics according to the current state, called at framerate times per second. Nothing in Render() can change the state of the program. The program can be run headlessly with Render() pre-processed out completely. The mental model is so easy to work with. There is a sleep-management routine to save on CPU usage when idle, and dirty logic to avoid re-drawing static content constantly. I feel like the world would save 90% of its GUI development time if it didn't do whatever the fuck reactive UIs are doing.
[−] _heimdall 53d ago
I'd argue that it was all downhill after we moved away from using HTML as the state representation.

Moving state out of HTML and into JS means we now have to walk this ridiculous tightrope walk trying to force state changes back into the DOM and our styles to keep everything in sync.

Given that problem, reactivity isn't the worst solution in my opinion. It tries to automate that syncing problem with tooling and convention, usually declaratively.

If I had to do it all again though, DOM would still be the source of truth and any custom components in JS would always be working with DOM directly. Custom elements are a great fit for that approach if you stick to using them for basic lifecycle hooks, events, and attribute getters/setters.

[−] tobyhinloopen 53d ago
I use Preact without reactivity. That way we can have familiar components that look like React (including strong typing, Typescript / TSX), server-side rendering and still have explicit render calls using an MVC pattern.
[−] ivanjermakov 53d ago
I still believe immediate rendering is the only way for easy-to-reason-about UI building. And I believe this is why early React took off - a set of simple functions that take state and output page layout. Too bad DOM architecture is not compatible with direct immediate rendering. Shadow DOM or tree diffing shenanigans under the hood are needed.
[−] ramesh31 53d ago
Give me state management vs. event bus management any day of the week. The former is fully testable and verifiable. You can even formally define your UI as a state machine. With events you are constantly chasing down race conditions and edge cases, and if your data lives seperately in components there is no clean way to share it horizontally.
[−] pier25 53d ago

>

I'm starting to wonder whether reactivity (not React specifically) was the originally sin that led to modern UI complexity

I've always maintained that no reactivity is a much simpler mental model. Mithril and Imba do this with better than good enough performance.

I think Remix 3 will be following this approach too.

[−] pfraze 53d ago
Reactivity isn’t the problem. Reactivity is one of the few things that helps reduce the complexity of state management. GUI state is just a complex thing. Frontend development doesn’t get enough cred for how deeply difficult it is.
[−] AlienRobot 53d ago
In my view, the problem isn't specifically reactivity but the fact that reactivity isn't actually native of the UI toolkit.

Instead of HTML, think about GTK or Swing.

To add React-style "reactivity" to it, instead of just making a dialog to change the "title" of a document and committing the change when you press OK, you'd need a top-level "App" class that holds all the state, a class for state properties with IDs accessible at runtime which probably would be a variant (accepts any primitive type), a binding class to bind the toolkit's textbox to the App's state "title" property (because you'll probably want to bind a lot of textboxes, so it's easier to separate the code into classes), and then every time the user types something into the textbox, instead of using the toolkit's code that is already written for you which updates the textbox' state directly, you block the state change in an event handler, send the state change to the App class, let the App class figure out the differences between the current state and the new state, and then it calls some callback in the binding class that is responsible for actually changing the text in the textbox to reflect the new App state. You'll probably run into a ton of issues (selections resetting, assistive technologies bugging, etc.) that you'll have to deal with externally somehow. All just to make it do exactly the same thing it would have done anyway.

It's like you have a fully autonomous robot and you want to add marionette strings to make it move.

[−] bikeshaving 52d ago
I’ve written about how Svelte, Vue, and Solid are all reactive and share common pitfalls due to their reactive solutions. My theory is that they all cause worse bugs than they prevent.

https://crank.js.org/blog/why-be-reactive/

[−] mpalmer 53d ago
Why do you list all of these design patterns as though you have to hold them all in your head at the same time? As though each one made the ecosystem successively worse?

    UI elements automatically reacting to data changes (as oppposed to components updating themselves by listening to events)
That's not so much a lack of statefulness as it is making zero effort to lift your application's data model out of platform-specific UI concerns.
[−] ndyg 52d ago
The original sin wasn't reactivity. It was putting state in the wrong place. Making the client state heavy. It's been downhill since then. Now you need to duplicate state handling between your frontend language and your backend language. Which leads to "isomorphic" backends seeming like a good idea.
[−] rglover 53d ago
Yep. It's one of those great on paper, tough in reality models. Used sparingly and wisely, it can make great UX fairly trivial. But sadly, state is more often abused and loaded with tons of data and complexity it shouldn't be holding. Something, something just because you can, doesn't mean you should.
[−] codethief 53d ago

> UI elements automatically reacting to data changes (as oppposed to components updating themselves by listening to events)

Is there really a difference? Angular uses RxJS in a pub-sub scheme. (At least it did when I last used it.)

[−] EGreg 53d ago
Counterpoint to SSR: https://qbix.com/blog/2020/01/02/the-case-for-building-clien...

But yes, React is a mess. JSX was the original sin of mixing HTML inside JS. And those bundlers and tree-shaking at build time? Ugh.

What if you had this instead: https://community.qbix.com/t/loading-at-runtime-the-web-fram...

[−] dminik 53d ago
It's much simpler. Reactive UIs and declarative UIs let you built things more more easily. You can almost entirely ignore an entire class of issues (state mismatch for instance).

That of course led to developers building much more complex UIs. Which offset the gains from reactivity. Hence the mess and we're basically where we started.

[−] rounce 53d ago
Why have
instead of using a
element?
[−] voidUpdate 53d ago
At some point, someone is going to come out with a no-JS, no-NPM, no-SSR framework and we're just going to have invented HTML again
[−] egeozcan 53d ago
IMHO, you shouldn't make "hate" part of your tagline.

Maybe focus on a use-case? Something like, "No-build, no-NPM, SSR-first JavaScript framework specializing in Time-to-interactive" - maybe?

[−] ale 53d ago
Build steps are realistically speaking inevitable because of minification, tree-shaking, etc. which is not even a big deal these days with tools like esbuild. For a "true" DOM-first component reactive system just use Web Components and any Signals library out there and you're good.
[−] febusravenga 53d ago
"If you hate react" feels like very bad argument in engineering.

Anyway, interesting approach for up to medium pages (not apps!). Totally not replacement for react.

[−] eknkc 53d ago
I thought I hated React until I saw the samples on this page...
[−] usrbinenv 52d ago
Btw, looking back at the index page, I think I might have made the initial example a little bit too much (because realistically, you don't often get components that complex). If you guys want a simpler saner example, the one the second page looks nicer: https://qitejs.qount25.dev/Explained-by-ducks.html
[−] cies 53d ago
I went with SSR for a new project started 2025Q4. I'm not against React, but when I have to make an SPA (or very interactive component in an SSR app) I much rather use Elm.

In order to do the JS that I have to do with an SSR app I went with Alpine.js. It reduces the JS I have to write and that fits my SSR approach.

It feels a bit like a modern jQuery to be honest: you cannot build whole apps with it, but just to sprinkle on top of an SSR it does really well.

[−] bartwaardenburg 53d ago
The fields/flags state model is a nice idea, having structured values separate from boolean state is something I haven't seen in other frameworks. How does this compare to Alpine.js or htmx in practice? They're in a similar space (no build, SSR-first) but I'm curious what made you go with a new framework rather than building on top of those?
[−] JSR_FDED 53d ago
Philosophically Datastar is on the same page. Incredible performance and dramatic reduction in complexity.
[−] anthk 53d ago
If the point it's to run propietary code, do yourselves a favor, ditch JS, and enable WASM for webapps and make most of the text web HTML5+CSS3 only. At least I won´t need to mangle User Agents to just read simple articles and images froma blog or a news site.
[−] johnisgood 52d ago

>

https://qitejs.qount25.dev/Ajax.html

Oh my. If it works just like Ajax from >10-15 years ago, then I will be super happy. :D

[−] Aldipower 53d ago
Hate and love, the borderline framework for borderliners. SCNR
[−] wg0 53d ago
Have tried multiple approaches. Sevelte. HTMX. Everything in between.

And came to conclusion that after certain complexity of UI - React kind of components are unavoidable if you want to be able to reason about your code.

Think of Shopify admin panel with product variations each variation having different pictures and what not.

Not saying not doable in plain JS.

But then Chrome can be written in NASM too, C++ is just...

[−] bearjaws 53d ago
Why use JS at all for SSR?

It's not a great language for it.

[−] jwlake 52d ago
The "isPresent()" in the example gives me alot of ick. It's confusing why thats not actual javascript.
[−] lo_fye 53d ago
I wonder how many users would prefer to have full page reloads (aka traditional server-side rendering) when navigating instead of all the insane http requests and ads we have today?

See also: HTMX and possibly even jQuery

[−] dhalucario 49d ago
Is there a reason it uses a seperate Ajax module over just using fetch?
[−] Bengalilol 53d ago
I must have overlooked the site, but are there any working examples?
[−] dmix 53d ago
Rails does this perfectly with Turbo and Stimulus, Turbo does HTML-over-the-wire via SSR-first, server responds with small updates/appends of HTML as need etc, and then you lightly use stimulus JS controllers for the small stuff where HTML/forms don't make sense. https://hotwired.dev/
[−] proc0 52d ago
And we've come full circle, haha.
[−] exabrial 53d ago
What a breath of fresh air
[−] joeyguerra 53d ago
There are people who hate react?
[−] peytongreen_dev 53d ago
[flagged]
[−] chattermate 53d ago
[dead]
[−] rsmtjohn 53d ago
[flagged]
[−] kitsune1 53d ago
[dead]
[−] QubridAI 52d ago
[flagged]
[−] 1GZ0 53d ago
Yeah, no thanks..

I'll just stick with a $5 vps with lamp and jjquery