Top
Best
New

Posted by iNic 5 days ago

Please just try HTMX(pleasejusttryhtmx.com)
614 points | 502 comments
recursivedoubts 5 days ago|
Hey, I created htmx and while I appreciate the publicity, I’m not a huge fan of these types of hyperbolic articles. There are lots of different ways to build web apps with their own strengths and weaknesses. I try to assess htmx’s strengths and weaknesses here:

https://htmx.org/essays/when-to-use-hypermedia/

Also, please try unpoly:

https://unpoly.com/

It’s another excellent hypermedia oriented library

Edit: the article is actually not nearly as unreasonable as I thought based on the just-f*king-use template. Still prefer a chill vibe for htmx though.

librasteve 5 days ago||
HTMX Sucks

https://htmx.org/essays/htmx-sucks/

azangru 5 days ago|||
> No Jobs

> Another practical reason not to use htmx is that there are, rounding off, zero htmx jobs.

> I just did a search for htmx jobs on indeed and found a grand total of two: one at Microsoft and one at Oak Ridge National Laboratory.

> A search for “react”, on the other hand, gives 13,758 jobs.

> Seriously, developer, which of these two technologies do you want to hitch your career to?

I do not advocated for htmx; but this take is so bad!

Resume-driven development should not be a thing. If you are a professional developer, building a product for a user, your primary concern should not be the job market for when you quit the company you are working for, but rather making the best product possible for the user within the context of the current company. And if the product is such that it does not call for react, or some other javascript-rich client, then you shouldn't use it however many react jobs there may be on Indeed.

lynndotpy 5 days ago|||
The evidence is so damning that htmx.org even opted to host it. That's not all- the author of the document is the one who developed HTMX!

(In all seriousness, this entire article is facetious and is highlighting the strengths of HTMX. They are not sincerely advocating for 'resume driven development'.)

recursivedoubts 5 days ago||
while the article is tounge-in-cheek, i do think a lot of the criticisms are legitimate
barrkel 5 days ago||||
The author of the article is the creator of htmx. There is some tongue in cheek here.
azangru 5 days ago|||
Right :-) That article did read as satire; but then, it is hard to tell what is satire anymore. I can hear people say the things he catalogues in the article; and I might agree with some of them, like the pollution of the window namespace, or the ancient syntax if this is indeed the case.
puppy_lips 5 days ago|||
As I read, I thought, "I'm pretty sure I disagree with this guy" about once per paragraph. I didn't know. Thank you.
lambdaone 5 days ago||||
At this point, web design 'ecosystems' are essentially money whirlpools. They're complex, so they require programmers skilled in using them, who in turn make more sites which need more programmers, and so on, and the network effect takes over and cements this feedback loop in the structure of the jobs market.

And the frameworks are churned continuously and are also bug-ridden nightmares, so that continuous development and support is needed to keep websites functioning and secure.

Any reduction in framework complexity threatens the whole edifice.

moregrist 5 days ago||||
I think the number of job postings is pretty related to factors that I do consider valid when selecting a piece of technology (eg: language, framework, etc):

- How easy is it to hire people with experience in this?

- Relatedly, how easy will it be for the org to maintain this software after I (or the original team) leaves?

azangru 4 days ago|||
> How easy is it to hire people with experience in this?

When NoRedInk switched to Elm, Richard Feldman, who was asked about whether this impacted their hiring experience in any negative way, said that on the contrary, hiring had never been better, because although the pool of candidates grew smaller, their quality (either prior experience of working with type-safe functional programming languages, or enthusiasm for learning them) got higher.

When Alex Russell announced several openings at Microsoft for development of design systems with web components, and certainly no react, he said this attracted a lot of really strong candidates.

I am not saying that a good web developer should be able to pick up any exotic language, such as elm, or purescript, or rescript, or clojurescript at no time; but what I am saying is that as far as web frameworks are concerned, they shouldn't be a criterion for hiring, and are unlikely to become an obstacle to it.

delifue 1 day ago||
I head that Jane Street use OCaml and said similar thing. Although there are few OCaml developers they are overall better so hiring is easier
63stack 4 days ago||||
You can be productive in htmx after spending less than an hour reading the docs, even though there are (I assume) zero jobs asking for it
s2l 3 days ago|||
Even though I prefer htmx, another emerging gravity is what LLMs are good at. LLM-based coding/debugging/planning is a thing and going to stay, and if there are less code-bases to train LLMs, any new language/framework will be at disadvantage.
Octoth0rpe 5 days ago||||
> Resume-driven development should not be a thing.

Pretend this is not about library choice, but rather about language choice. One language has 2 jobs, and the other language 13k jobs. I doubt you'd think for more than a second.

azangru 5 days ago|||
> One language has 2 jobs, and the other language 13k jobs. I doubt you'd think for more than a second.

The Hacker News website runs on Lisp. How many jobs do you see on the market that ask for Lisp? And yet, for what it is, this site is amazing! I don't see them rushing to migrate to a python backend and a react-based frontend, no matter how many jobs there are for those.

marcus_holmes 5 days ago|||
This is all true. But then, if you ran HN and needed to hire new devs, you could find them extremely easily just by posting on your own site. HN is a well-known project that people would want to work on because it looks great on their resume and gives kudos when talking to other devs.

In other words, HN does not have the problem that you are going to have if you use an unpopular language for your project.

If you choose LISP for your not-HN project, then you have a problem. The chances are very slim of finding any experienced LISP devs who are also in your salary range, within commute distance, want to work on your project, are a good fit for the team, etc.

You're probably going to have to hire a dev who is a good match on all those other things and train them up on LISP. Unless they've had experience with other functional languages (not that unusual, but not common either) then they're going to have to learn an entire new paradigm. All of which means that they'll spend the first six months going slow while they learn, and needing support from the rest of the team.

And you'll need to convince them to join you (probably by paying them more money) because if they spend a few years on your project learning LISP, they probably won't be able to use those skills for their next gig, and their current skills in a popular language will go out of date.

LISP is a great language, and if used well it will probably give you an advantage over the competition using other, more mundane, languages. But is that going to be enough of an advantage to counteract your slower onboarding, higher salaries, and greater recruitment workload?

jimbokun 4 days ago||
No, you will find strong candidates who love Lisp and want to quit their job slinging Java to work on your Lisp project.
marcus_holmes 2 days ago||
Yeah, maybe. Though finding them is still harder than just using Java in the first place.
chuckadams 5 days ago||||
Not just Lisp, but Arc at that. That's about as niche as it gets.
lerp-io 5 days ago||||
this site can also vibe coded in seconds.
mexicocitinluez 4 days ago||
lol Yea what a wild example to pick from. A web programming 101 website being heralded as why it's okay to use a tech like Lisp to build web apps feels pretty standard for HN though.

It's a list of articles and comments. It would take like 3 pages from W3Schools to build this thing.

azangru 4 days ago||
I am deeply baffled by this kind of response.

Firstly, because this site happily handles the amount of traffic that puts many hobbyist sites that happen to get on its front page into a hug of death; so its developers must have done something right on the backend that is probably above the web programming 101 level.

But secondly, because this was precisely my point. One does not need a super popular front-end framework to make an awesome web product, and the HackerNews site is a testament to that.

mexicocitinluez 4 days ago||
> I am deeply baffled by this kind of response.

No you're not. You're just trying to respond with something witty.

It's a message board with 1% of the functionality most sites people are building with frameworks.

> Firstly, because this site happily handles the amount of traffic that puts many hobbyist sites that happen to get on its front page into a hug of death;

Lol are you really implying it's hard to scale a message board?

> One does not need a super popular front-end framework to make an awesome web product, and the HackerNews site is a testament to that.

IT'S A MESSAGE BOARD. Nobody is building message boards anymore. Using HN as an example for anything other than building a dirt simple message boardsays more about your refusal to recognize the need to these new technologies than it does about those technologies.

> awesome web product

A. Message. Board.

azangru 4 days ago||
> Lol are you really implying it's hard to scale a message board?

I am implying that it is beyond the "3 pages from W3Schools", as you put it.

> A. Message. Board.

Yes. A fast, reliable, accessible message board that I and many others thoroughly enjoy. An awesome product.

Again, I have never suggested that its ui is complex. In fact, it's glorious how simple it is. This is the point that those htmx people make: use simple tools for simple UIs; and also, try to make your UIs simple.

mexicocitinluez 3 days ago||
> this site is amazing!

NO. IT. ISN'T.

lol. Anytime React is mentioned people like you rush in to tell others just how great stuff like...checks notes...a message board is. As if it in any, way, shape or form adds to the conversation.

You just couldn['t help yourself from rushing in to defend the simplest site on the planet (lol written in LISP) as if it demonstrates anything other than some rando building a w3 schools site in a language no one uses anymore.

azangru 3 days ago||
> rushing in to defend the simplest site on the planet

This 'simplest site on the planet' does the job that it is tasked to do. Brilliantly. I am baffled by why you would scorn at simplicity.

> as if it demonstrates anything

It demonstrates that a great product (a product that many people use and love) can be built with simple tools. At least on the frontend.

mexicocitinluez 4 days ago||||
> The Hacker News website runs on Lisp.

You mean the message board? The website that has a grand total of 2 functions: post and comment?

> And yet, for what it is, this site is amazing!

It's 2 colors and text. That's it.

> ! I don't see them rushing to migrate to a python backend and a react-based frontend, no matter how many jobs there are for those.

It's A MESSAGE BOARD. A. MESSAGE. BOARD.

azangru 4 days ago||
> It's A MESSAGE BOARD. A. MESSAGE. BOARD.

Have you seen how many blog or portfolio sites people build with react? Sometimes even adding nextjs into the mix? Blogs!

mexicocitinluez 4 days ago||
So? That doesn't change the fact that HN is a dirt simple message board anybody could build.
azangru 4 days ago||
> That doesn't change the fact that HN is a dirt simple message board anybody could build.

What is this an objection to? If you follow this thread upwards, where was it suggested that we should be talking about things so complex that nobody, or only very few, could build? The whole pitch of htmx is that it is proposed for building things that anybody could build. The article in the title assumes that the target audience isn't building Google Docs, Figma, video editors, or CAD tools.

mexicocitinluez 3 days ago||
It's an objection to this:

> How many jobs do you see on the market that ask for Lisp? And yet, for what it is, this site is amazing! I don't see them rushing to migrate to a python backend and a react-based frontend, no matter how many jobs there are for those.

You pointing out that the dumb simple message board is written in LISP and doesn't need anymore more is a bit absurd.

No shit they aren't rushing to upgrade it. IT BARELY DOES ANYTHING TO BEGIN WITH.

Anytime a certain class of developer see the word "React" that end up saying the most ridiculous shit. Nobody, I mean nobody, thinks HN is a site worthy of replicating or achieving unless they're part of the .0000002% who couldn't find a prepackaged board from Google search results.

azangru 3 days ago||
> Nobody, I mean nobody, thinks HN is a site worthy of replicating or achieving

Wait what? You haven't seen all the hackernews clones that people make as an exercise of website building? You haven't seen lobste.rs?

krapp 3 days ago||
lobste.rs is people from HN who think HN isn't nearly strict and niche enough.

All of those hacker news clones are by Hacker News people for Hacker News people, usually to implement features Hacker News never will.

Nobody outside of the HN community is holding up Hacker News as an exemplar of superior design or engineering, much less of a Lisp implementation. Anyone who's touched the Arc Lisp forum code knows how few fucks pg gave about the design of anything but the language itself. And still the original forum was so inefficient it would keel over and die under moderate traffic and internal links would time out and people's comments would just never post.

petre 2 days ago|||
Except it's not a language. It's a library. Both of them are, in fact.
intrasight 5 days ago|||
One language - JSX - has 10 jobs.

The other language - HTML - has over 30,000 jobs

mexicocitinluez 4 days ago||
lol JSX isn't a language. There aren't "JSX" jobs.

I feel like only a backend developer trying to score "gotcha" points could make this argument and be confident about it.

endofreach 4 days ago|||
> backend developer

You mean a real developer?

mexicocitinluez 3 days ago||
The real developer who doesn't know that JSX isn't a language? lol Sure.
intrasight 4 days ago|||
There are emacs modes for it, so I claim it's a language.
fithisux 4 days ago||||
you are right and wrong.

Survival is more important.

On the other hand htmx is nice to have, if it solves your problem. Still you should use what benefits you in the context of a customer.

If you ask me, I think the web is for viewing static content, download content, or share links that your browser should delegate to an app.

nsonha 3 days ago||||
That's obviously just an article pretending to criticise htmx
johnnyanmac 5 days ago||||
>Resume-driven development should not be a thing

Reality is often disappointing. I'd love to be working deep in my Vulkan rendering knowledge, but it's clear right now with my lack of job that I need to grind leetcode instead and work on personal projects first. Graphics programming is already such a stiff bar to get into and it's only gotten stiffer as I go along.

I'm going a little bit on a limb by also cultivating Rust, so I'm not optimizing my RDD. But I still looked for a compromise of what I like and what's in demand.

lbreakjai 5 days ago|||
I appreciate the idealism but I appreciate being able to pay my mortgage more.
recursivedoubts 5 days ago||||
so true
Biganon 5 days ago||
I have to say: I absolutely love the kind of unhinged energy you radiate. Please keep being yourself.
almosthere 5 days ago|||
Everything in that resonated with me.
PaulHoule 5 days ago|||
If you are comfortable building web apps like the early adopters did in 1999 that later got mainstreamed with Ruby-on-Rails and related frameworks, HTMX adds a wonderful bit of extra interactivity with great ease.

Want to make a dropdown that updates a enumerated field on a record? Easy.

Want to make a modal dialog when users create a new content item? Easy.

Want a search box with autocomplete? Easy.

As I see it the basic problem of RIA front ends is that a piece of data changed and you have to update the front end accordingly. The complexity of this problem ranges from:

(1) One piece of information is updated on the page (Easy)

(2) Multiple pieces of information are updated but it's a static situation where the back end knows what has to be updated (Easy, HTMX can update more than one element at a time)

(3) Multiple pieces of information but it's dynamic (think of a productivity or decision support application which has lots of panes which may or may not be visible, property sheets, etc -- hard)

You do need some adaptations on the back end to really enjoy HTMX, particularly you have to have some answer to the problem that a partial might be drawn as part of a full page or drawn individually [1] and while you're there you might as well have something that makes it easy to update N partials together.

[1] ... I guess you could have HTMX suck them all down when the page loads but I'd be worried about speed and people seeing incomplete states

refulgentis 5 days ago||
Why did you reply to this comment?

None of this mentions anything at all mentioned in the parent post.

Was it just a shameless way to ride on what would become a top comment?

viiralvx 5 days ago|||
Damn, Unpoly looks great! Never tried HTMX but have been a fan of it, it solves a UX problem that frameworks like Django and Rails suffer from, without needing to bring in something heavy like React.

I'm currently working on a side project in Rails using Stimulus but sometimes I wonder if Stimulus is overkill with all of the controllers and stuff as well. Do you have an opinion on when you should reach for something like Inertia or Stimulus over htmx?

mostlysimilar 5 days ago|||
In most simple cases you probably don't want to be handling request-response initiated DOM updates in a Stimulus controller. Turbo Frames and Turbo Streams are the more htmx-like in functionality and they're excellent for this.
cassiogo 4 days ago|||
I think the htmx counterpart from Rails folks would be Turbo not Stimulus
nrclark 5 days ago|||
fwiw I'm the CEO of htmx, and I am a huge fan of these types of hyperbolic articles.
puppy_lips 5 days ago|||
I am starting to understand htmx.
jabbywocker 5 days ago||
As the CEO of HTMX I can assure you that you’ve only scratched the surface of the HATEOAS doctrines
lgvld 5 days ago|||
I love Unploy, the documentation as well, but I find it a bit too complex. For even simpler usecases I often use Alpine AJAX [1], which is an Alpine.js plugin giving your links and forms -- only, because progressive enhancement -- basic AJAX capabilities.

[1] https://alpine-ajax.js.org/

rodolphoarruda 5 days ago||
I first read about Unpoly in Stephan Schmidt's Radical Simplicity website[1], I liked it's value prop and decided to try it. I found it bit too complex just as you said. A long time later I came across htmx and decided to try it even after reading a side comment that the library was "like unpoly". 15 minutes later I had a simple to-do list running htmx ajax calls using php and mysqlite in the backend. It was so easy I could not believe such thing could exist. Then I decided to read the Hypermedia book and never stopped using htmx in my projects.

[1] https://www.radicalsimpli.city/

naasking 5 days ago|||
I didn't find it too hyperbolic, I think they were very clear on where htmx can help, eg. the section "you're not building Google docs".
recursivedoubts 5 days ago||
Agree updated my comment
jadbox 5 days ago|||
How does Unpoly and htmx differ?
recursivedoubts 5 days ago|||
unpoly is a more complete framework with concepts like layers and best in class progressive enhancement

htmx is lower level and focuses on generalizing the idea of hypermedia controls

https://dl.acm.org/doi/abs/10.1145/3648188.3675127

JodieBenitez 5 days ago||||
HTMX is lower level. I think it would make a good web standard for libraries like Unpoly to build upon. Unpoly works best as progressive enhancement for frameworks like Rails or Django where most of the view logic is executed on the server. I love it, it's excellent. Just like Django (or rails), it's a practical tool refined after actual needs and experience, not a solution looking for a problem. And like Django it stood the test of time and is very well maintained.
ZeroConcerns 5 days ago|||
LLMs know nothing about Unpoly, and quite a bit about htmx. This requires you to actually learn Unpoly, because, well, even pointing your LLM-of-choice at the Unpoly docs (which are quite okay!) makes it regress-to-the-ugly-Javascript-workarounds-mean pretty much on try #1.

I'm not yet sure whether this is a good thing or not -- I'll let you know once my latest iteration of my web framework is finally working as I envisioned, he-said sort-of-jokingly, which should be Soon Now.

But yeah, either alternative still beats React by a country mile, since everything related to that descends into madness right away.

recursivedoubts 5 days ago||
I don’t think there is anything in unpoly that a good llm couldn’t figure out with a look over the docs pretty quickly. It’s pretty simple and has some great functionality, especially if you are shooting for progressive enhancement.
ZeroConcerns 5 days ago||
Well, I actually use Unpoly, and I can assure you that LLMs don't get it, no matter how many pointers to the (excellent!) docs one includes.

Like, even just now, Claude Code with Opus 4-dot-latest, is absolutely convinced you need a bunch of fragile cascading Javascript listeners to dismiss a lower-level menu in case a dialog is opened, while the Unpoly docs, correctly and clearly, point out that 'shatter' exists for just that purpose.

And this is one of the use cases that I continue to highlight as the achilles heel of LLMs. I'm not holding it wrong: they're not reading it right.

recursivedoubts 5 days ago|||
ah, then I defer to your experience, i hope that it improves: unpoly is an excellent library
adamzwasserman 5 days ago|||
I have the same problem. I guess we will just have to train our own SLM with a carefully selected (unpolluted) training corpus.
yomismoaqui 5 days ago|||
> Still prefer a chill vibe for htmx though.

Said the horse with laser eyes (¬_¬)

recursivedoubts 5 days ago|||
it is a MEDICAL CONDITION
DANmode 5 days ago|||
No avatars here.
dpifke 5 days ago|||
https://unpoly.com touts "progressive enhancement."

Third link on the page ("read the long story") points to https://triskweline.de/unpoly-rugb/, which renders as a blank page with NoScript enabled.

Sigh.

irq-1 5 days ago||
It's because of the demo wrapper/layers. Try just the raw demo: https://unpoly.com/examples/modal/preview.html

Still not perfect -- the demos should work too. I love the idea of a progressive framework and am willing to work around a few things to get it.

dec0dedab0de 5 days ago|||
I haven't really tried htmx yet, but I used to love intercooler, and your essays are always a fun read. When I saw the title I thought it was some kind of joke from you, because it's like the opposite of your normal style.
adamzwasserman 5 days ago|||
here is the long-promised frontal assault on Big State: dataos.software
lagniappe 5 days ago|||
I'm curious if the author of the article is an HN reader, and if yes, how this comment is received.
algallagla 5 days ago|||
I'm the author of the original article. fwiw, I haven't seen anything that bothers me.

And if there was originally a harsher response which I missed, well then I hope it wasn't merited.

I'm pretty light-hearted about this topic! It's more fun that way.

moralestapia 5 days ago|||
I will never ever ever ever touch htmx after this interaction I just witnessed.
recursivedoubts 5 days ago||
what do you mean?
forzerpendulum 4 days ago|||
Htmx is pleasant to use, but I lost a little respect for you after this prudish comment.
recursivedoubts 4 days ago||
my bad
internet2000 5 days ago||
You really need to shut this down dude. If HTMX becomes famous for having overbearing advocates that's a really bad look. Look at what happened with Rust.
bccdee 5 days ago|||
"What happened to Rust" is that it got a lot of coverage for being good, then a few people were annoying about how good it is, and now a large number of other people have become annoying in their complaints about how annoying the first group was. Meanwhile, Rust & its community remain unaffected; adoption continues to grow, and Rust now used in the kernel, Windows, Android, AWS infra, etc.

The problem you've encountered is that people are annoying. I'm afraid that's not specific to any one technology or community. Fortunately, annoying blog posts are easily ignored and would never stop a useful tool from being adopted anyway.

jonathrg 5 days ago||||
Rust is doing great.
g947o 5 days ago||
I am tired of people using the smallest "Hello World" example to demonstrate how something is better than React -- "See, you don't need all these things to get a website up and running!"

Of course it will work. I can vibe code the most terrible web framework you have seen within 20 minutes and claim it is better than React, but what does it prove?

> You write zero JavaScript > The whole library is ~14kb gzipped

Oh sure, if there is nothing else in your UI, and if your Python/Go/whatever backend server has 0 dependency, which almost never happens.

mikepurvis 5 days ago||
To put a bit more colour on this, I think the fear of most devs with an ultra-simple framework like this is that eventually you hit a wall where you need it to do something it doesn't natively do, and because the only thing you know is these magical declarative hx-whatever attributes, there's no way forward.

I appreciate the basic demos, but I think what would really sell me is showing the extensibility story. Show me what it looks like when I need it to do something a bit beyond what it has in the box. Where do I add the JavaScript for that? Is it raw, inline, or are we back to packages and bundling and a build step? Am I building application JS, or some kind of extension or plugin to htmx itself? How chained am I going to be to its specific paradigms and opinions?

The page says htmx isn't for writing a true SPA like Google Docs, but where's the line? Show me an app that has pushed up against the limits of this system, and what happens in that scenario.

gregmac 5 days ago|||
> To put a bit more colour on this, I think the fear of most devs with an ultra-simple framework like this is that eventually you hit a wall where you need it to do something it doesn't natively do, and because the only thing you know is these magical declarative hx-whatever attributes, there's no way forward.

I'm not sure "fear" is exactly the right word here, but it's something I consciously evaluate for when looking at any new framework or library. Anything that has a lot of "magic" or "by-convention" type config is subject to this.

You start with the "hello world" example, and then you hit that wall. The test of an awesome framework vs a fundamentally limited (or even broken) one is: can you build on what you have with extensions, or do you have to rewrite everything you did? There's a lot of these where as soon as you want to do something slightly custom, you can't use _any_ of the magic and have to redo everything in a different way.

This isn't just libraries either. Another almost worse example is AWS Elastic Beanstalk. Simple way to get an app up and going, and it handles a lot of the boilerplate stuff for you. The problem is as soon as you want to extend it slightly, like have another custom load balancer route, you actually have to completely abandon the entire thing and do _everything_ yourself.

This is a really hard thing to get right, but in my view is one of the things that contributes to a framework's longevity. If you hit that wall and can't get past it, the next project you do will be in something else. Once enough people start posting about their experiences hitting the wall, other people won't even pick it up and the framework dwindles to a niche audience or dies completely.

lunar_mycroft 5 days ago||||
(Disclaimer: I haven't actually run into a case where I had to move from HTMX to a SPA framework, even partially, so this is largely an educated guess)

I think this scenario would either be very apparent early on in the project, or wouldn't actually be that challenging. There are a couple ways you could run into the limits of HTMX:

1. You require purely client side interactivity. The right (IMO) way to use HTMX is as a replacement for sending JSON over the wire and rendering it into HTML on the client, so if your app has features that _wouldn't_ be done that way, you should reach for something else. Fortunately there's lots of solutions to this problem. You can use built in browser features to achieve a lot of the basics now (e.g. the <details> tag means you don't really need custom scripts if you just want an accordion), write simple vanila scripts, or adopt light weight libraries like alpinejs or the creator of HTMX's (only slightly deranged) hyperscript.

2. Maybe your purely client side interactivity needs are complex enough that you do need a SPA framework. At that point you can adopt the islands architecture and create interactive components in your fraemwork of choice, but continue to use hypermedia to communicate with the backend.

3. If you can't easily separate client side state (handled with javascript, potentially with the aid of frameworks) from server state (handled on the server and sent to the client via hypermedia), you can again adopt the islands architecture and have your islands manage their own network requests to the backend.

4. If the above applies to all of your app, then hypermedia/HTMX is a bad fit. But this should generally be pretty obvious early on, because it's about the basic, fundamental nature of the app. You probably know you're building google docs when you start build google docs, not mid-way through.

adamzwasserman 5 days ago||
multicards is almost purely client side interactivity. I STILL use htmx for a number of reasons:

- No JSON serialization: HTMX sends form data natively no JSON.stringify() needed - Less JavaScript: Declarative hx-* attributes replace imperative fetch code. in my world declarative always wins. - Automatic headers: HTMX handles X-User-Id and other headers configured globally - Built-in error handling: hx-on::error instead of .catch() chains - Swapping flexibility: Can show success/error feedback via hx-swap without custom JS - Request indicators: Free loading states with hx-indicator - Debugging: HTMX events visible in browser devtools; fetch requires console.log

and most all: performance. multicardz goes like stink. 100/100 lighthouse scores, First Contentful Paint 0.4 s, Largest Contentful Paint 0.5 s, Total Blocking Time 0 ms, Cumulative Layout Shift 0, Speed Index, 0.5 s

still prerelease, but cautiously hope to go general availability by and of year.

lunar_mycroft 5 days ago||
You won't keep those performance numbers if the network conditions are bad, unfortunately. For things that require a network round trip, that's fine, because doing it via JSON (or some other serialization format) won't save you anyway. On the other hand, if it can be done entirely on the client, adding network round trips will slow the interaction down. It sounds like you're mostly doing the former (otherwise loading indicators and serialization wouldn't matter), but it's a point that should still be emphasized.
adamzwasserman 5 days ago||
I think you misunderstood me. I use htmx where most people would use fetch. I do not just use htmx willy nilly for no reason.

I use pure front end manipulation to set state, then I send the state to the stateless back end with pure functions, and I get amazing performance: www.multicardz.com public test bed, 1M records, round trip usually around 160 ms for anywhere between 1 to 100K hits

chrisweekly 5 days ago||||
This is where I think Astro shines, with its "islands of interactivity" approach. Keep things as simple as reasonably possible, and provide an idiomatic, first-class mechanism for supporting more complexity where appropriate.
alfonsodev 5 days ago||
I overlooked Astro for a long time, I didn't really get it, and my journey back to it went something like this:

- 1 Getting burned out by Nextjs slowness in a complex production project that shouldn't be that complex or slow on the dev side, (this was 2022 approx)

- 2 Taking a break from React

- 3 Moving back to classic server side rendering with python and Go and dealing now with template engines. Hyped with HTMX and loving it, but my conclusion after so many years of react was that template partials don't feel right to me and templates engines are somewhat not maintained and evolved as used to be. I found my self not feeling naturally inclined to reach for the htmx way and just let the coding agent do it the way they wanted AND stating to notice again the burn out.

- 4 Looking with some envy to co-workers using shadcn how fast they are getting things done and how good they look.

- 5 Wondering would be a way to use JSX with HTMX server side, I miss components, I don't want partial templates.

And then I found Astro, ahhh now I get it, Astro prioritizes generation over run time, and that unlocks a lot of gradual complexity where you can choose how to mix things ( islands ) you get something way more interesting than a template engine, and it uses JSX so you can benefit from React ecosystem.

This where I am now, but yet I have to complete a side project with it to know if I fully get it and love it.

So far seems to me is the answer I was looking for.

mal-2 5 days ago|||
This is what doesn't get discussed enough around htmx, in my opinion. So much of the difficult steps are left for the templating system, and template systems aren't great in general. You need to track a lot of identifiers for htmx to work properly, and your template and view logic needs to make that make sense. For the templating systems I've seen, that's not so simple to do.
farmeroy 5 days ago||
1000% this. I actually am using htmx at ${JOB} and this is essentially the only downside to htmx. I want to know which template partial is getting swapped. My IDE doesn't know. I need to track countless html ids to know what will be swapped where... how? It hasn't been a big deal because I alone write the frontend code so I have all my hacks to navigate and my intimate knowledge of the code, but if we need more devs on the frontend, or if the frontend drastically grows feature wise, i will need to tackle this issue post haste. I think template partials could help, but then we also would end up with giant template files and that would also be annoying.
DANmode 5 days ago||
How does it feel to be one of 3 HTMX related jobs in the universe (according to the comments in this thread)? heh.
ViewTrick1002 5 days ago||||
Last time I dabbled in a front-end I tried out Astro but felt like it just added another layer of complexity without much gain when all my components were just wrapping React in different ways. I went with react router instead.

I can see the value of the "islands" concept when you have a huge front-end that's grown over generations of people working on it.

For my constrained front-end debugging Astro errors on top of React errors on top of whatever all the turtles down felt a like a step too far.

Am I in my Rust centered back-end driven brain missing something?

merely-unlikely 5 days ago||||
> 5 Wondering would be a way to use JSX with HTMX server side, I miss components, I don't want partial templates.

I'm playing with JSX, Hono, and Bun right now to do just that. It's early but will see how it goes.

adzm 5 days ago|||
Astro is great. If you are familiar with React, you can pick it up pretty much instantly. The design is simple enough to extend when needed as well for custom things.
jabbywocker 5 days ago||||
>Where do I add the JavaScript for that? Is it raw, inline, or are we back to packages and bundling and a build step?

That’s really your call to make. I’ve never went the full build step with it, but I’ve only built some internal dashboards and crud apps with it.

CooCooCaCha 5 days ago|||
What I don’t get is why I’d use it if I can’t write a reasonable complex SPA with it.

React is easy for small websites so why would I use a separate framework when I can use one framework for everything?

WorldMaker 5 days ago|||
What's your decision tree for when you feel you need a SPA in 2025?

At least some of what you may not be getting in this space is how many developers right now seem to be hugely deprioritizing or just dropping SPA from their decision trees lately. Recent advances in CSS and ESM and Web Components such as View Transitions and vanilla/small-framework JS (ESM) tree-shaking/"unbundling"/importmaps give MPAs more of the benefits of a complex SPA with fewer of the downsides (less of a "mandatory" build process, smaller initial bundle load). It is easy to feel less of a need for "complex SPA" to be on your architecture options board.

mixmastamyk 5 days ago||||
I recently tried a hello-world in react. It made ten network requests on page load and probably had a sizable first download. That’s why web pages are so slow today.
CooCooCaCha 5 days ago||
Hello world in react is just a few lines of code that mounts a react component to a dom element. There should be zero network requests beyond the initial download of html and js.

You’re either doing something wrong or not actually doing a hello world.

mixmastamyk 5 days ago||
I don’t know but vite was involved, looks like it was setting up live updates. This is part of the problem, you can’t just include a script apparently.
iloveplants 5 days ago|||
vite adds additional things to your page in dev so that it's easier to debug. when you are running it in production, it is just one js bundle & one css file.
afavour 5 days ago||||
That’s just Vite’s dev mode. I think React is way overused but your example here is a bad one. You just weren’t aware what the dev tool was doing, it has nothing to do with the experience end users will have. It isn’t even anything to do with React.
NewsaHackO 5 days ago|||
Was it in Dev mode?
JCattheATM 12 hours ago||||
Because React is bloat, especially for something trivial where it isn't needed.

Use the right tool for the job, instead of using the one tool you are comfortable with for everything.

krzyk 5 days ago|||
> What I don’t get is why I’d use it if I can’t write a reasonable complex SPA with it.

Because most webpages don't need to be SPAs. I miss the days of jquery and html+css, where everything was snappy, and wasn't an SPA.

CooCooCaCha 5 days ago||
Plain react is arguably just as simple if not simpler than jquery.

And I’m not saying every site needs to be an SPA. I’m saying if I can write everything from a simple site to an SPA in a single framework then why not use that for everything?

H1Supreme 5 days ago||
How do you handle routing with plain React?
codedokode 5 days ago|||
React is an implementation of View component of MVC, View is responsible for displaying Model contents, not for handling routes. You are trying to use the wrong tool.
CooCooCaCha 5 days ago|||
Using built-in browser apis. Not sure what you’re getting at.
foldr 5 days ago|||
In fairness, the article has a section titled “The Numbers” which links to this: https://htmx.org/essays/a-real-world-react-to-htmx-port/
g947o 5 days ago||
Different teams/projects have different needs and require different solutions. While it's good it worked in their favor, I am quite confident that someone else can tell a completely different story. In fact, there are some comments in this very HN discussion that detail their negative experience with htmx. I would not use one or the other to "convince" anybody to go with either solution like what this article attempts to do.
testermelon 4 days ago||
Disliking evangelism is something most of us can relate. I give you that. And everything you said is very reasonable.

But have you tried it though? Don’t you think it’s time to give your story? Slam your needs to htmx and see what comes out of it’s ruins?

g947o 2 days ago||
I did something similar to htmx over a decade ago, so I know what it's about. And everything I need to say is already said by others in a more elegant way.

> Don’t you think it’s time to give your story?

I am afraid that's completely irrelevant to my comments here. If you read my posts carefully, you'll notice that I haven't said a single negative thing about htmx itself, because I want to very cautious in giving opinions. Everything I said was specifically about the horrible arguments in this article.

yoyohello13 5 days ago|||
For what it's worth. Our intranet apps run on a combination of Python + HTMX. We haven't run in to anything we couldn't do yet. The paradigm of swapping parts of the DOM in and out is very easy to work with.
epolanski 5 days ago|||
There's also the opposite camp: when you show very complex scenarios being simple in some technology but the hello world is harder.

e.g. effect-ts which makes error handling, dependency injection, concurrency, retries, stack safety, interruptions, etc, simple but the hello world already hits people with "wait, it's 6 lines of code to print hello world!? Trash".

calhotel 4 days ago|||
No one is forcing you to use it. I haven't used it myself, but htmx looks to be a good solution for many web applications.
g947o 2 days ago||
Is this comment relevant at all???
weiliddat 5 days ago|||
Here's a real-time-ish planning poker written in Go + Htmx in ~500 LoC

App (can take a few seconds to spin up if dormant): https://estimate.work/

Source: https://github.com/weiliddat/estimate-work

ceuk 4 days ago||
I mean I built a pretty featureful P2P planning poker app using React and it's around 1300 lines of typescript.

More, but I don't think it's a mind-blowing difference and I wasn't playing code golf when I wrote it. I wouldn't have used redux if I was!

https://github.com/ceuk/planning-poker

weiliddat 3 days ago||
Oh cool, very interesting approach!

Did a quick test, since before this I also used some very ad-heavy p2p solution, and I see similar issues there. Not sure if you're looking for feedback, but these were all issues I considered before settling on a server-based HTMX long-interrupted-polling approach, which if you think about having server + client + realtime-ish features in the context of "just htmx" + tiny LoC is pretty cool (well I think it's pretty cool :D)

In the WebRTC p2p approach, without some sort of sync protocol that validates the state of data:

- the host must be online / already there to join a room; the host leaving the room means everyone gets kicked!

- if you rejoin a room and don't receive updates, you get a partial view of the data

- if you have data connectivity issues, you get a partial view of the data

- you must have a WebRTC capable browser and Internet connection

ceuk 3 days ago||
Yeah I set out to build something with WebRTC rather than to build a planning poker app if that makes sense. Just wanted to test out the tech.

Having said that, I do still use this off and on and personally the limitations don't bug me too much. Would be a nightmare for more mission-critical software though

adamzwasserman 5 days ago|||
DecisionMe is one the apps I created using htmx. I am not the owner of the company, so I cannot comp you, but I can promise in good faith: this is not a toy app.
AstroBen 5 days ago|||
Check out Fizzy from 37signals. They used a similar HATEOAS approach to build it with Hotwire

https://www.fizzy.do

source: https://github.com/basecamp/fizzy

I don't think this is a better approach than React. It's just an approach. It's viable. It's fine

komali2 5 days ago||
Right, it's also bothered me that the Vue docs spend so much time showing how it's a "progressive" framework. "Just use it for one component!" And show examples of how it can be lazy loaded in for your special complex spot that needs vue.

Like c'mon, if I'm using Vue, I'm using Vue. Same for React. Strap me into the native state management solution for your framework, your router, your preconfigured bundler. I'm not here to mess about or I'd have just stuck with vanilla.

jtbaker 5 days ago||
Not having to deal with npm and a build step can remove a huge barrier to adoption for a large number of potential adopters, or people that just want some lightweight interactivity in an app.
Austizzle 5 days ago|||
That's what got me into Vue and I still use build less Vue all the time for tiny little sites that aren't worth setting up a whole CI process for. It's really lovely that it's an option.

Just like how easy jQuery was to get started with back in the day, but a whole framework

mos_basik 5 days ago|||
Yep, can confirm. I first used Vue in 2016 to write some simple calculators for my group's use in Eve Online. Without its "progressive" affordances, I don't think I would have gotten anything off the ground. I had no idea how to set up a build pipeline at that point, and I think Vue was new enough that there weren't many vue-specific tutorials so I'd have been learning from React tutorials and trying to figure out what to change with zero JS background.
perardi 5 days ago||
I did.

My startup did.

And now we’re going to rip it all out and move to a React front-end.

HTMX makes response handling much more complex. Every endpoint returns 3–5 different HTML fragments. Frontend and backend must agree on every scenario — success, validation errors, system errors, partial updates, full reloads.

And HTMX is still a fairly obscure library. The documentation and examples are lacking, there isn’t a real set of established best practices at scale, and not for nothing, LLMs aren’t great at it.

React is mature, used at scale, provides separation of concerns, and is great for agentic AI coding. HTMX has its place for simple projects, but for anything non-trivial, it’s a no for me.

adamzwasserman 5 days ago||
I was able to find architectural patters that work smooth as glass.

Here is what my htmx apps have: - Single-purpose endpoints: Each endpoint returns ONE thing (a card list, a tag cloud, a form fragment) - Optimistic UI: Preferences like font/theme update the DOM immediately; the save is fire-and-forget with no response needed - Simple error handling: Most endpoints either succeed (return HTML) or fail (HTTP error code) - No fragment orchestration: Not returning 3-5 fragments; using hx-swap-oob sparingly

Here is how I update fonts on screen in user prefs: User selects font → JS updates body class immediately → htmx.ajax() saves in background → done

vs. the anti-pattern you're describing:

User submits form → backend validates → returns success fragment OR error fragment OR partial update OR redirect signal → frontend must handle all cases

No language or programming paradigm is perfect. All programming is an exercise in tradeoffs. The mark of a good CTO or architect is that ability to draw out the best of the technology selection and minimize the tradeoffs.

djeastm 5 days ago|||
Please do a write up of the best practices you've found. I tried htmx a few years ago for a side project and while I appreciated the simplicity of a lot of it, I had trouble understanding how/when to use it and in what ways. I think I was trying to contort it too much into my understanding of api/spa. That or my interactivity needs were too complex for it, I can't tell.

These days, I admit, though, the ship has sailed for me and htmx. My main app frontend is React and since the LLMs all know much more than I do about how to build out UIs and are 100x faster than me, I'll probably be sticking with React.

adamzwasserman 5 days ago|||
That is what DATAOS.software is all about. It is a manifesto of my proposed best practices somewhat like Hypermedia Systems, but more hands on, more of a cookbook.
nymanjon 3 days ago||
Interesting read. I haven't quite finished it all. I haven't ever needed anything like that when writing web pages with HTMX, html-form (my own), nor htmz-be (another one I wrote based off of htmz but the back end decided where the HTML will go, similar to data-star and nomini). When I write code from the back end and target the front end I can use middleware to common updates.

Here's the most complex app I've made with it. The most complex part of the app is the match page. I just use morphdom for that part of the app and it makes it super easy, I just send the whole main part of the page back and let a dom diff happen.

https://github.com/jon49/Soccer

nymanjon 3 days ago|||
Here's an example offline-first hypermedia-driven soccer application. The match page is the most complex part of the application and I use Morphdom to just do a diff on the main section of the page. I find hypermedia-driven development to be super simple.

I find React to be really complex. What normally takes me just some HTML rendered from the back end and some interactivity on the front end can be done in just a few lines of code, but React takes 10s of lines of code for what I can write in a single line of code using vanilla js. The virtual dom causes it to make everything state. I always find it odd that people reach for that as their front end. I could understand something like Svelte, but even that is too complex for my needs. But I'm always writing CRUD apps, so there is some complexity but not that much, React just makes something that was simple, super complex.

https://github.com/jon49/Soccer

yellow_lead 5 days ago||||
How do you handle HTTP errors?

Just curious because when I used HTMX I didn't enjoy this part.

wvbdmp 5 days ago|||
I like to return errors as text/plain and I have a global event handler for failed requests that throws up a dialog element. That takes care of most things.

Where appropriate, I use an extension that introduces hx-target-error and hx-swap-error, so I can put the message into an element. You can even use the CSS :empty selector to animate the error message as it appears and disappears.

Usually the default behavior, keeping the form as-is, is what you want, so users don’t lose their input and can just retry.

adamzwasserman 5 days ago|||
Honestly? I never think about it. I've never had to. What did you run into? Curious what the pain point was.
yellow_lead 5 days ago||
I had a site where the user can upload a file < 5MB. There may be a way to check this on the frontend, but for security reasons, it has to be checked on the backend too.

If it exceeds it, I returned 400. I had to add an event listener to check for the code (htmx:afterRequest) and show an alert(), but this gets difficult to manage if there's multiple requests to different endpoints on the page. Looking at it now, maybe I should have configured HTMX to swap for 4xx.

MrPowerGamerBR 5 days ago|||
I have something similar on my website, and my solution was to make server driven modal/toast responses.

Allow the server to return a modal/toast in the response and, in your frontend, create a "global" listener that listens to `htmx:afterRequest` and check if the response contains a modal/toast. If it does, show the modal/toast. (or, if you want to keep it simple, show the content in an alert just like you already do)

This way you create a generic solution that you can also reuse for other endpoints too, instead of requiring to create a custom event listener on the client for each endpoint that may require special handling.

If you are on htmx's Discord server, I talked more about it on this message: https://discord.com/channels/725789699527933952/909436816388...

At the time I used headers to indicate if the body should be processed as a trigger, due to nginx header size limits and header compression limitations. Nowadays what I would do is serialize the toast/modal as a JSON inside the HTML response itself then, on `htmx:afterRequest`, parse any modals/toasts on the response and display them to the user.

yellow_lead 5 days ago||
Good idea, thanks for sharing! Nice design also
adamzwasserman 5 days ago||
hx-trigger in the response header would handle that cleanly. Fires an event client-side; one global handler shows the error.

Similar to wvbdmp's approach but without needing the extension

yawaramin 4 days ago|||
See https://dev.to/yawaramin/handling-form-errors-in-htmx-3ncg
IgorPartola 5 days ago|||
I have never loved the idea of the server rendering HTML which is probably why I have such a hard time with HTMX. In every other paradigm you clearly separate your server API and UI rendering/logic. Web apps are the only place where it seems common to have the server render UI components. Imagine if you had a Java or Swift application and had the server sending your phone UI screens. I don’t even know how you would pitch that. About the only thing I have seen that makes some sort of sense here is video game rendering to be able to play on really limited devices with quick internet access.

The problem with SPAs is the ecosystem. I recently found packages like this [1] and this [2] in my node_modules and that is insanity. But the architecture honestly makes way more sense than any other paradigm: server side is a well defined API and the client renders UI and handles local state.

[1] https://www.npmjs.com/package/isarray

[2] https://www.npmjs.com/package/is-string

arethuza 5 days ago|||
X (the Window System not the thing that was Twitter) explicitly allowed a remote machine to send rendering commands over a network to the local machine? (I'm avoiding using the term "server" as X has this round the other way - from the users perspective the server is local and the client can be remote).

Sun's NeWS also allowed something similar - but with a large amount of programmability using PostScript.

IgorPartola 4 days ago||
Sure but that was with the idea that everything happens synchronously. TeamViewer also renders the UI remotely. Any system where the client actually does any state management and not just pixel/character rendering does not use this. While the X system did allow this, real world systems did not use any of these remote rendering commands besides “render pixels”.
adamzwasserman 5 days ago|||
At the end of the day, personal preferences play a huge role. All programming is a compromise between tradeoffs.

React has a lot going for it. It's simply that I prefer htmx; it feels cleaner to me.

krzyk 5 days ago|||
> Frontend and backend must agree on every scenario — success, validation errors, system errors, partial updates, full reloads.

Well, frontend and backend always need to agree on every scenario, that's why I prefer to do validation on backedn and frontend to just display it and not do any validation.

epolanski 5 days ago||
That makes for some nasty debugging and unsafety. Both sides should parse both times, unless you're encountering real (not imaginary) performance issues.

As someone who's been parsing everything entering the system from 2018, I don't believe you can have performance issues by parsing the data entering the system, the only exception I can name in a decade was real time trading app where the data coming in all time was just gargantuan that parsing it all the time was impacting UX and even then there should be an argument for the backend insisting on sending whole data instead of the latest value.

array_key_first 5 days ago||
Frontend and backend will always diverge and 90% of your bugs will be around that. Mitigating the divergence is the primary goal of every web framework, both backend and frontend, when you sit back and think about it.
slekker 5 days ago|||
> and is great for agentic AI coding.

Definitely sad to see this everywhere nowadays, tech choices made because of AI

Hammershaft 4 days ago||
We are locking in path dependence on flawed technologies because by nature newer technologies lack the training distribution needed for good LLM output. Our industry is in a pretty dismal state.
mixmastamyk 5 days ago|||
I found the book (hyper media systems) to be better at explaining full integration than the library site, which gives nuts and bolts and big picture, but not much intermediate info.
naasking 5 days ago|||
> Frontend and backend must agree on every scenario

When is this not the case?

wrs 5 days ago|||
I suspect the hidden assumption here is that frontend and backend are written by different people/teams with a narrow interface between them. Because they use different technologies and build tools it’s easy for them to end up being competely siloed, which IMO is one of the worst aspects of how webdev evolved in the last 20 years.

Thus, it’s considered normal that the backend team spits out some JSON and doesn’t know or care what the frontend team does with it.

With HTMX that distinction doesn’t exist so much (the frontend consists of fragments generated by the backend) so you will need a different organizational approach. The “frontend” folks will need to write a lot of “backend” code, but presumably in a separable layer.

naasking 5 days ago||
It is true that htmx requires some straddling backend and frontend. I think the organizational approaches that split them is dumb to begin with personally. Good UI/UX almost always impacts the backend.
samtheprogram 5 days ago|||
When an API returns JSON, your JS framework can decide what to do with it. If its returning HTML that's intended to go in a particular place on a page, the front-end has far less flexibility and pretty much has to put it in a specific place. Hence why they said endpoints can return 3-5 different versions of HTML.
naasking 5 days ago|||
> When an API returns JSON, your JS framework can decide what to do with it.

The JS framework is the frontend, so you're still coordinating.

> If its returning HTML that's intended to go in a particular place on a page, the front-end has far less flexibility and pretty much has to put it in a specific place.

Well yes, because presumably that's what the app is supposed to do. If it's not supposed to put it in that place, why would that be the specified target?

If this kind of static assignment of targets is not flexible enough for some reason, then use OOB updates which lets you replace fragments by id attribute. That lets you decouple some of these kinds of decisions.

Although "endpoints can return 3-5 different versions of HTML" is also a bit of a red flag that you're not using htmx correctly, generally endpoints should be returning 1, maybe 2 fragments in unusual cases.

In any case, you might find DataStar more to your liking, it's partway between React and htmx.

nchmy 5 days ago||
To clarify, there's nothing React or SPA about datastar. Moreover, HTMX v4 is essentially Datastar-lite (but heavier, and less capable)
naasking 5 days ago||
There is, Datastar has client-side rendering based on signals [1]. Datastar is also very explicitly designed to be modular and extensible, so you can extend the client-side with more features, as they've done with Web Components.

[1] https://data-star.dev/guide/reactive_signals

nchmy 5 days ago||
Signals aren't even really "rendering". And react and spas dont have a monopoly on doing things on the client - that's just javascript. I dare you to go to the datastar discord and tell them that they're React-adjacent, and SPA-like
listenallyall 5 days ago|||
"framework can decide what to do with it" sounds like a feature (more flexibility) but is actually often the source of errors and bugs.

A single, consistent, canonical response, generated by the server, taking into account all relevant state (which is stored on the server) is much cleaner. It's deterministic and therefore much more testable, predictable and easier to debug.

For pure UI-only logic (light/dark mode, etc) sure you can handle that entirely client-side, but my comment above applies to anything that reads or writes persistent data.

firemelt 16 hours ago|||
what state management do you use? for the react
stefan_ 5 days ago|||
It's terrible, why would I want my endpoints to return random HTML fragments? I realize thats how you did it in the JQuery times, but I was never in those - at that time we simply had template engines in the backend so this HTML slop wouldn't contaminate everywhere..

Most of the frontend stuff I do is for internal pages on embedded devices, and I'm very happy with a structure where I have the frontend being a full React fancy component lib SPA that is eventually just compiled down to a zip bundle of files that the backend needs to know nothing about and can serve as dumb files. The backend is a JSON API of sorts that I would need to build anyway for other use cases.

bottlepalm 5 days ago|||
Returning HTML sounds like a styling nightmare, if anyone changes the structure, unintended consequences. Plus it’s difficult to reason possible states of the UI with fragments sitting on the server, possibly dynamically built on the server. Very jquery/PHP ish. I had my fun and don’t want to go back.
listenallyall 5 days ago|||
To "get" HTMX, you have to think server-first. State is persisted on the server and all state-change logic is performed on the server (often triggered by http requests from a "dumb" client).

If you hang on to "possible states of the UI" that are client-side only then yes you'll have some difficulty implementing server-generated HTMX responses but more importantly, when your client has state that sometimes isn't in sync with, or shared with, or validated by your server, you're setting yourself up for errors and bugs that will exist regardless of framework.

In short, HTMX forces you to apply "single source of truth" concepts to your application.

robinhood 5 days ago|||
Clearly you haven't used something like HTMX. Do you understand what "returning HTML by the server" mean? You are basically sending back a view, like you would in any other framework actually. This would be the exact same pattern as displaying or dynamically adding a new component from either React or Vue. It doesn't create any styling issue at all, nor any unintended consequences.
bottlepalm 5 days ago||
I’ve used jquery which is very heavy into html fragments. It can get unwieldy compared to keeping all your rending logic in one place and applying data to it like in React. Other comments here validate the suspicion that HTMX can fall apart in large systems.

Unless you’re saying the components returned by HTMX are using the shadow dom for isolation, you can very easily run into styling problems by changing a style and not realizing some injected fragment of HTML somewhere relies on it being a certain way. I hope you’re using a monorepo because unlike typescript APIs, those HTML fragments and CSS styles are not type checked.

bccdee 5 days ago|||
Well yeah, HTMX wouldn't be a good fit for micro-frontends, but I didn't think many people were actually using those. You have to write all your html in accordance with a single stylesheet, but that strikes me as the least of HTMX's impositions.
array_key_first 5 days ago|||
That's because jquery takes a very global approach to the DOM, which will naturally lead to spaghetti code.

Every backend framework, be it dotnet or Symphony or Rails, has a concept of components. It's a non-issue.

drcongo 5 days ago||||
The HTML fragments aren't random.
ErroneousBosh 5 days ago|||
> It's terrible, why would I want my endpoints to return random HTML fragments?

What would you return instead? It's easy to generate HTML, because that's what your server is already generating (and that's about all it should generate).

stefan_ 5 days ago||
HTML is the last thing I would ever want to generate on my embedded device, it's a terribly verbose string-based mess invariably coupled with stylistic choices. Which is why my servers don't generate any of that, they serve static files - and any interactive information in something that looks a lot more like an interface definition.
wrs 5 days ago|||
I don’t get what you’re saying (maybe there’s a typo). With React, generating HTML on the embedded device is exactly what you’re doing — twice (virtual and real DOM).
ErroneousBosh 5 days ago|||
Okay, so what do you your servers actually serve stuff to?

I kind of don't get why if you want to display something in a web browser you'd generate anything other than HTML.

leoedin 5 days ago||
I think the parent's point is that when you have a react front-end, your back-end basically just deals in structs of data. There's no HTML or templating to think about. It's just JSON-serialisable structs. That makes the code on the back end much simpler, which makes it easier to run in a resource-constrained environment.

The only exposure the back-end has to HTML is streaming the static files to the browser. Which can be done in small chunks.

If your back-end is rendering HTML with every request, it has to do a lot more work. It has to load HTML templates into memory and insert strings into them.

ErroneousBosh 5 days ago|||
Okay, so how do you actually show the stuff to the end user?

Just raw structs of data? Or do you turn that back into HTML?

Now you've got two sets of templates to cope with...

Why would I care about how much effort it is for the server to generate? It's already generating HTML from templates, and it's more-or-less infinitely capable of doing so.

bccdee 5 days ago||||
> It has to load HTML templates into memory and insert strings into them.

In practice, I doubt this is much slower than serializing JSON. Keeping a couple kilobytes of HTML templates in memory is nothing. Conversely, running a whole vdom on the frontend (typically more resource-constrained than the server) is a much bigger performance issue.

stefan_ 5 days ago||
Three levels down and people have entirely forgotten what my post was. My "server" is some anemic ARM core built into real physical hardware with 64M of read-only storage. I don't want it spending its time "hydrating" some DOM, I don't want to bring any of this frontend insanity on there at all. No code hosted on npm shall ever run on that processor or I can't go to sleep in peace.

So how do we still get a fancy SPA website? Build it all down to a simple zip bundle, the ARM can serve those static files just fine. The SPA talks to the ARM via a few JSON APIs. Very nice clean boundary.

listenallyall 5 days ago|||
Yes, if your server is a weak, limited processor, you want to keep the demands on it as low and lean as possible, and let the client do the heavy lifting. HTMX is not a good fit for this scenario, just like PostgreSQL is not a good database to embed on your devices.

This isn't a controversial idea and nobody would try to sell you on HTMX for your use case.

bccdee 5 days ago||
1. No, templating strings is actually quite cheap. I'm doubtful that you could benchmark any substantial difference between templating html and serializing json.

2. Who has a server with a weak, limited processor? HTML templates power Django, Rails, and PHP. This paradigm worked fine on the servers of 20 years ago, in the slowest languages we use. I could serve a Django app on my phone and see reasonable performance.

listenallyall 5 days ago||
I agree that templating is very fast and efficient, probably faster than serializing to JSON.

Read the OP's posts - he is talking about a "server" being an embedded device with 64mb of read-only storage. My assumption is that the data output format is basically hard-coded in the device's OS and doesn't even rely on JSON serialization.

bccdee 5 days ago||
Oh wait, oh my god

> Three levels down and people have entirely forgotten what my post was.

I missed this reply entirely. Whoops.

That said, I do feel like you can do HTML templates on a tiny chip with 64 megs of memory. I've seen NASes with comparably tiny & terrible chips serve their web UIs this way: paper-thin html templates with <form>s for interactivity and <table>s for layout.

ErroneousBosh 5 days ago||
But that's the point of something like HTMX, though.

You draw a simple web page with very basic elements, tag them with an HTMX element, and let the client side javascript turn that into something that "does stuff".

I wrote a phone directory with find-as-you-type using Django (because it's what I had lying around) and HTMX (because I read somewhere that it was cool and fun and I should try it, and I bow easily to peer pressure), and then min.css to make it not look shit.

All totally vendored, just download the appropriate .js and .css file and check them into your source control.

When you type it hits an endpoint that returns a bit of HTML that contains a table, and swaps it into a div. The querying part and the drawing part is client-side and there's nothing stopping you passing a query string to the endpoint and getting just a bare table out.

Indeed there's nothing stopping you detecting if it's an HTMX request and only returning the fragment, or if it's "bare" returning a full valid page. You know what? I should do that, I'll log a feature request on my project for it.

I've gotten a little away from the original point.

You use HTMX on the client side, to turn a plain HTML page with no interactivity into something that will pull data from a backend and swap it into the DOM. If you want to return JSON and render that with yet another library you can, but you're probably already filling in the blanks in an HTML template as it is.

array_key_first 5 days ago||||
My understanding is that HTML templating is often cheaper server-side than JSON serialization.
ErroneousBosh 5 days ago|||
What's npm got to do with it?

Why can't your code fill in the blanks in some HTML template instead of filling in the blanks in some JSON?

ErroneousBosh 5 days ago||||
What's the difference between rendering HTML and rendering JSON?

Why are you then offloading rendering HTML from JSON to a painfully slow scripting language on the client?

goodpoint 5 days ago|||
This is plain false.
dev_l1x_be 5 days ago|||
Real world examples with error handling would be great for HTMX. Now in the LLM era you might get away without those. I just don't understand why can't we have complete documentation for the most basic scenarios.
epolanski 5 days ago|||
So first you choose a nicher solution you didn't fully understand and now you jump into another one (full of issues but popular) you likely don't understand the trade offs too?
dubcanada 5 days ago|||
Just to be completely clear... you do not need React just so you can turn JSON into HTML. HTMX can 100% can do that.

You're argument is fine assuming you wish to become another react frontend in a sea of react frontends.

But the documentation example is a terrible argument, the benefit of HTMX is it is easy to understand what is actually happening. There is no magic, you don't need to dive through millions of lines of code to figure out what this is doing like react. It's very basic javascript. Just read the library, frankly you don't even need any documentation. Just take 15 mins and read the entire library.

xXSLAYERXx 5 days ago||
> become another react frontend in a sea of react frontends

Whats the big deal here?

MrPowerGamerBR 5 days ago||
> Every endpoint returns 3–5 different HTML fragments. Frontend and backend must agree on every scenario — success, validation errors, system errors, partial updates, full reloads.

And why would that differ from React?

When I was building a website with React, I needed to model a "apply coupon" endpoint with different states (coupon applied, coupon does not exist, coupon exists but has reached its max usage limit) and it was so annoying because you needed to

1. The backend route that returns JSON with a different model depending on the coupon state

2. The JSON models for each response type

3. And then on the frontend you need to load the data, parse the JSON, figure out which "response state" it is (http status code? having a "type" field on the JSON?) convert the JSON to HTML and then display it to the user

In my experience it added a lot of extra "mental overhead". It is something that should be extremely simple that ends up being unnecessarily complex, especially when you need to do that for any new feature you want to add.

When using htmx, a simple implementation of that would be

1. A backend route that returns HTML depending on the coupon state

2. Some htmx attributes (hx-post, hx-swap) on the frontend to make the magic happen

Don't get me wrong, there are places that you wouldn't want to use htmx (heavily interactive components) but that's why htmx recommends the "islands of interactivity" pattern. This way you can make the boring things that would add unnecessary complexity when using React with htmx, and then you can spend the unused "mental overhead" with the interactive components. (which, IMO, makes it a more enjoyable experience)

At the end of the day it is just choices: Some people may prefer the React approach, some people may prefer the htmx approach. All of them have their own upsides and downsides and there isn't a real answer to which is better.

But for my use case, htmx (truth to be told: I use my own custom library that's heavily inspired by htmx on my website, but everything that I did could be done with htmx + some htmx extensions) worked wonderfully for me, and I don't plan on "ripping it all out" anytime soon.

0x3f 5 days ago||
The thing is React is usually fine, and even if you don't have to build _this_ thing in React due to simplicity, why bother learning two paradigms when you can just use the heavier one for everything and most likely never encounter any real practical showstopping issue?
purerandomness 5 days ago||
The reality of React is that you have to keep re-learning and un-learning stuff if you want to keep up with React's ecosystem, because the surface area of the libraries is so large. (see "JavaScript fatigue")

Whereas with HTMX you learn a very, very basic concept in 15mins, and you're good to go for the next decade(s), and it will be more than enough for 80% of your projects.

Same as with vim and Emacs vs. proprietary IDEs and text editors.

0x3f 5 days ago||
I agree that people often do this but I don't think you _have_ to. You could have freely ignored SSR, RSC, etc. and kept on making boring old React SPAs. The churn is largely opt-in.
H1Supreme 5 days ago|||
> The churn is largely opt-in.

It is not. React 18 changed damn near everything. You can't create a new React 17 project without jumping through serious hoops. React 19.5 introduced the compiler, so you can stop using useCallback and useMemo. Except for "common scenarios" where you still need it. Which are about as clear as mud.

I can only imagine what React 20 is going to introduce.

the_other 5 days ago|||
My current app is a boring SPA. SSR, RSC wouldn’t make sense for it. My previous app was a video player with UI drawn in React: couldn’t SSR that.
ajross 5 days ago|||
> you can just use the heavier one for everything

Because people don't like using heavyweight solutions needlessly. That's the logic that begat C++ and Ada and Multics and ASN.1 and CORBA. All of which were good solutions useful for "everything" in their domain. But people hate them, mostly.

Historically big "everything" solutuions end up losing in the market to lighter weight paradigms with more agility and flexibility. Almost every time. React[1] was such a solution once!

[1] Which really is a shorthand for "modern node-based web development with tens of thousands of npm dependencies and thirteen separately-documented API and deployment environemnts to learn".

0x3f 5 days ago||
The thing is most of us have jobs where we can't unilaterally switch to the 'cooler' solution, and I value my own context-switching overhead much more than I value a slightly smaller bundle or dep tree. I'll much sooner optimize the former than the latter and so the general purpose solution that will solve both my own projects and the work ones typically wins.
ajross 5 days ago||
> most of us have jobs where we can't unilaterally switch to the 'cooler' solution

Which is exactly why the uncool solutions persist in the market. They're useful and practical! If they weren't they never would have been successful at all. I'm just saying that that this is fundamentally the logic of the frumpy old curmudgeon, and the kids will always have something better to offer along with their confusing new ideas.

And to be clear, I'm also just saying that as someone looking in from the outside (I do firmware!) the front end webdev developer onboarding story has long since jumped the complexity shark and things are quite frankly an impenetrable disaster ripe for disruption.

avisser 5 days ago|||
> why bother learning two paradigms

Objection. Your React is ultimately turning into HTML so you DO have to learn HTML + CSS. You just have an abstraction over it.

xnorswap 5 days ago|||
That's like saying my C# is getting turned into CLR bytecode, so I do have to learn CLR bytecode because I have an abstraction over it.

Yet I know roughly what it is, but I couldn't begin to actually write the stuff myself.

Good abstractions mean you don't have to worry about the layer below.

Now of course it's not really the case that React holds up to being a good abstraction, especially when it comes to CSS and styling, but I don't think it's a forgone conclusion that abstractions force you to learn the level below.

Otherwise we'd all spend half our time learning assembly.

I do have sympathy though for a developer who just wants to focus on the higher level paradigm and let the library maintainers worry about the innards.

forgotpwd16 5 days ago|||
React is an abstraction over UI state, not the platform (ie HTML/CSS). This is by design and non-parallel to C#/CLR case. If you want something akin to this, then Flutter is what you should be looking at.
komali2 5 days ago||||
> That's like saying my C# is getting turned into CLR bytecode, so I do have to learn CLR bytecode because I have an abstraction over it.

For a good part of your career this is true, but eventually you will need to justify your senior salary by being able to debug react via looking at library code itself, or understanding the event bubbling under the hood, or figure out why the output css isn't working.

Saw a video, wish I could remember who, someone developing a game in c-something. There was some bug they couldn't figure out so they jumped into I guess the assembly for that block of higher abstracted code, and was able to find some kind of memory issue. Vague, sorry, but point is I remember being really impressed, thinking oh shit yeah if I really want to be an expert in my field I better be able to really understand my stack all the way to the bones.

naasking 5 days ago|||
> That's like saying my C# is getting turned into CLR bytecode, so I do have to learn CLR bytecode because I have an abstraction over it.

That's not a valid analogy, 99.99% of C# developers never see or touch CLR bytecode, where every React developer is still working with HTML+CSS.

xnorswap 5 days ago||
That's possibly true, but I wonder why react as an abstraction fails to deliver that kind of independence.

In theory, react developers ought to be able to code against the react API in typescript, without seeing the "raw" HTML+JS that gets delivered to the browser.

So what's failing those developers? Is it the tooling, the abstraction itself, or something else?

dalmo3 5 days ago|||
> So what's failing

You're failing to understand the difference between react and react-dom.

> be able to code against the react API in typescript

https://github.com/chentsulin/awesome-react-renderer

avisser 5 days ago||||
Off the top of my head, C# is both the language & the runtime. React only throws things over the fence to browsers.

Probably helps a lot to keep abstractions from leaking.

wrs 5 days ago|||
That seems like an odd take. I don’t know that anyone ever intended React to completely insulate you from the actual UI framework (HTML/CSS in this case). You’d have to reinvent a whole new set of layout and styling features. Why would you bother? React is for orchestrating your use of the UI framework, not for replacing it.
0x3f 5 days ago||||
That just makes HTML/CSS part of the React paradigm though. You can still use all those features in a React app, after all. The 'new paradigm' to learn with HTMX is how it does reactivity/interactivity.
culi 5 days ago||||
This featured article is about HTMX not HTML. Ofc everyone working in the FE should know HTML/CSS
css_apologist 5 days ago|||
honestly both the react haters & the htmx haters are wrong on this

if you care about have a solid UI, you should learn everything

you should learn css, react, svelte, vue, rails, tailwind, html

if you don't and you say you actually care about your UI, your opinion is actually irrelevant

krzyk 5 days ago|||
React (and Angular) is an MVC framework pushed on top of a MVC framework in the backend. Why make things so complex?
adamzwasserman 5 days ago||
Performance
hard_times 5 days ago||
Not HTMX but Alpine.js has been a complete revelation to me. What clicked for me was that you're enhancing server-rendered HTML, not replacing it. Need a dropdown menu? Add x-data="{ open: false }" and you're done. Want to show/hide elements? x-show does exactly what you expect etc.

No bundler required, no compilation step.

kitd 5 days ago||
Alpine even has a plugin to perform the same function as Htmx if you need it

https://alpine-ajax.js.org/

pkorzeniewski 5 days ago|||
Same here, using Alpine.js is a breeze and it made working on frontend fun again, everything is so easy and intuitive to implement and manage, even on large projects. It's definitiely my favourite frontend framework right now and a default for new projects.
CodingJeebus 5 days ago|||
I worked on a large commercial AlpineJS app and grew to really, really hate it. It's great for smallish projects where the limits of the tool are known, but it is in no way a drop-in replacement for something like React (and I am no fan of React). People like to throw around how easy it is to do basic things, but building a real app using Alpine is an absolute nightmare.

Alpine data objects can grow to be quite large, so you wind up inlining hundreds of lines of JS as strings within your HTML template, which often limits your editor's ability to do JS checks without additional config.

State management in Alpine is implicit and nested and not a serious solution for building commercial apps IMO.

And don't even get me started on unsafe-eval.

If it's your hobby app and you are the developer and the product owner, go for Alpine. If you're working at a company that is asking you to build a competitive web product in 2025, use a more robust tool. Hotwire and Stimulus has scaled much better from an organization standpoint in my experience.

fzumstein 5 days ago|||
Have you tried the CSP build of AlpineJS? It takes the code out of the template into a proper JS file, no unsafe-eval. Isn't state management mostly handled on the backend when you use AlpineJS?
65 5 days ago|||
On the contrary, I've built some very complicated apps with Alpine and it handled the use cases every time. You are right with string methods creating it hard to click to go to the function in your IDE, but I'vd never had a problem with state management. Perhaps it depends on the setup.
adamzwasserman 5 days ago||
Declarative is the way.
asim 5 days ago||
Man I did try htmx, and I was hopeful, right until I saw how it polluted my codebase. I can't say I have the answers, but writing a pure Go app, I'm currently using one giant css file, custom styling and inline html.

And now I'm at the breaking point. So I'm planning to move to tailwind and Go templates, but honestly, i was hopeful for htmx, so I need to properly see the usecase. Which i don't know is this. It reminds me of Angular a lot...

kitd 5 days ago||
This is the thing. Htmx is great if you only consider the frontend. But it does require fixing up the backed to match. A framework like that needs to integrate the front & back ends fairly tightly to have good UX. You may be interested in Datastar which does this better IMHO

https://data-star.dev/

qingcharles 5 days ago|||
My current plan is to switch to Datastar too, although the devs seem a little odd. The guys writing HTMX seem like a more professional bunch.
sudodevnull 5 days ago||
you have a point https://x.com/htmx_org/photo
asim 5 days ago|||
Thanks I'll look into it, but on first glance I feel like I just got space blasted by the website! What happened to simple websites eh
nchmy 5 days ago|||
I assume youre referring to the "starfield" on the home page. That's just showcasing their "Rocket" webcomponents tool, which makes it vastly simpler to make WCs.

It is otherwise a very simple website, and the framework and its SDKs are much simpler, yet more powerful, than HTMX

kitd 5 days ago|||
Lol, it's ... a feature ... I think
asim 5 days ago||
Well I guess part of the problem is I feel like I'm looking at the website with a magnifying glass...
yxhuvud 5 days ago|||
Turbo with a small sprinkling of stimulus may be closer to what you are hoping for - turbo especially is a lot more opinionated than htmx.
elevation 5 days ago|||
> it polluted my codebase

HTMX is less noisy if you integrate it into your backend framework.

A contact of mine build a python/flask app. To simplify coding, he wrote a file to extend the flask framework to support the HTMX patterns he needed with just a single line of boilerplate. Took him about a day, his team is happy with the results.

zihotki 5 days ago||
It's not less noisy, you just move the noise to the backend
benji-york 5 days ago||
> polluted my codebase

I'd love to hear more about that.

asim 5 days ago||
Well listen, we have two modes of operation. It's either html/js/css in the classic sense, or Go templating with some tailwind and JQuery (or whatever the kids are calling it these days). In the case of react, something totally different. But essentially when you try to go that middle path with something that defines its own syntax, it starts to bleed into everything. It's not self contained. I'd argue maybe tailwind is like that as well, so you want to put it in templates or something. But if your htmx code lives in your actual code the way it does with Go a lot of the times because they promote building these partial functions, it looks horrible, very hard to reason or manage. I'm not talking one or two snippets, I'm talking when you have a full blown web app.

The reality is it's going to suit some people and some languages really well and others not so well. I think I like html/css/js and using AI to generate that. But I also like Go templates and trying to isolate that in a programmatic way. I find htmx in principle, a good idea, but when I actually tried to use it, fundamentally the wrong tool for me.

yawaramin 2 days ago||
That's why you need something that lets you componentize your templates. React did this really well with JSX. But classic-style templating languages are not great at this. Django just recently introduced a 'partial templates' feature. I built my own: https://github.com/yawaramin/dream-html/blob/todoapp/app/REA...
philipwhiuk 5 days ago||
The proselyting over frameworks is the worst bit of the web ecosystem.

If your solution is actually good, it will get adopted eventually...

Forget React, there's still stuff written in jQuery and JSP.

Why the rush to convert everything - you're not a missionary on a mission, just build your stuff in stuff you like?

The attack on npm is ridiculous, when (apart from introducing a permanent vulnerability in the form of a runtime dependency on a third party site), you still need npm for htmx.

culi 5 days ago||
> If your solution is actually good, it will get adopted eventually...

I used to believe this when I first started in tech. The truth is even something as seemingly innocent as javascript runtimes now have an incredible amount of money behind them. And sometimes even marketing budgets. Deno released a high-production trailer for their 2.0 release last year

https://www.youtube.com/watch?v=swXWUfufu2w

I've also seen some really cool and well-thought out technologies simply not gain any traction.

The truth is you ultimately do need some big company behind you or major personality writing blog posts to ultimately make it.

Techies don't like to admit it but we're just as reliant on influencers as anyone else.

dec0dedab0de 5 days ago|||
You definitely don't need npm for htmx, it's one file with no dependencies.
jollyllama 5 days ago||
For all of the esoteric talk about hypermedia and things like this, this is the greatest advantage of HTMX, why I use and, and also why GP is dead wrong.
dubcanada 5 days ago|||
> If your solution is actually good, it will get adopted eventually...

This has never been more incorrect. The entire world of software is people using garbage solutions because the CTO is convinced Oracle/Microsoft/what ever new random software is the best thing since sliced bread. In no fashion has the best software solution ever been a factor.

internet_points 5 days ago|||
https://www.monash.edu/business/marketing/marketing-dictiona...
purerandomness 5 days ago||
> If your solution is actually good, it will get adopted eventually...

I wish this were true.

Unfortunately, often the things that get adopted are the things hyped up the most, not the ones which are technically superior.

Popularity, marketing budgets and inertia often dictate what's popular.

As with all biases, we need to actively and deliberately work against these forces, if we value craftsmanship and professionalism.

komali2 5 days ago||
Nextjs, great example of this. I've yet to find an actually valid use case to choose it outside of "our incestor's relationship got us unlimited vercel credits for like three years."
mrinterweb 5 days ago||
HTML over the wire frameworks like HTMX, Hotwire (rails), LiveView (phoenix), Livewire (laravel), LiveView (django), etc. They all have the same basic idea with differences in how they achieve it. I feel this approach is overlooked, and it drives me crazy. There is a huge complexity cost attached with JS frontend app + backend that everyone seems to have accepted as reality. HTML over the wire (really need a catchy acronym maybe HotW) can greatly simplify and speed up development with pretty much the same end user experience as a react app.
ChocolateGod 5 days ago|
Using JSON over the wire means you can re-use your backend between multiple frontends (like with mobile apps).
mrinterweb 5 days ago|||
I have lost track of the number of times I have heard that argument, and implemented the API only to never have other API clients, or the API clients that do come later have very different needs and I need to create another API for that. I don't think API re-use is a strong argument unless the other client will be consuming the API imminently. I've heard the of "course we will have a native mobile app" argument enough times to often identify it as wishful thinking. Many clients are often satisfied with with a good web app.
yawaramin 5 days ago||||
You can also reuse your backend if you server HTML, thanks to content negotiation. The frontend sends a header that indicates what type of content it accepts, and the backend serves the according type.

Also, mobile apps often have different API needs than webapps, so they end up getting different APIs anyway.

array_key_first 5 days ago||||
You can certainly try, but a lot of times the applications are different applications with different semantics so this doesn't work and you create a bunch more endpoints.
Lio 5 days ago||||
You could use Hotwire Native for that. Also backends like Rails give you JSON APIs for free if you want them.
mrinterweb 5 days ago||
Hotwire Native would be a great option, but I will argue that I've never felt that I got JSON APIs for free with rails. Thousands of my rails dev hours spent writing APIs would say otherwise.
mrinterweb 5 days ago|||
Not all web applications need to be have an API that serves other clients. Often web apps are enough.
grugdev42 5 days ago||
Ultimately the complexity does have to live somewhere.

The idea that HTMX removes all the complexity is false. However it does remove some of it, and moves the rest onto the backend.

I find the backend easier to work with, so that's a win for me.

And a batteries included framework (like Laravel or Django) makes HTMX even more appealing. They already have everything you need! :)

allan_s 5 days ago|
I would even say that even "just html" is enough for most website/app. We've been using "just html" at my company ( rosaly.com) for 5 years, we've raised 10 million, have hundreds of customer, and nobody ever complained. And the Android/Ios applications are 234 lines of React-Native which is just embedding a webview , a bit of error screen when there's no internet connection , and intercom library for notification.
More comments...