Live data from Hacker News

Why you should choose HTMX for your next web-based side project (2024)

hamy.xyz

41–50 of 81 posts

Re: Why you should choose HTMX for your next web-based side project (2024)

#41
post #16

I got a wave of shudder reading the acronym "HAM stack". Yugh. MEAN, MERN, RERN–once hyped up hot air which now sounds so dated and hackneyed. It's cool to be excited about tech but if your main selling point is building "faster and cheaper", I don't know if picking up a minimalistic framework you know nothing about is faster than just re-using your trusty boilerplate. Be it React or Svelte or whatever. With serverle…

cute stack names have gone downhill since LAMP

Re: Why you should choose HTMX for your next web-based side project (2024)

#42
post #30
post #23

Earlier quoted context omitted.

Htmx can scale. It's very basic and Htmx isn't the only technology to use that approach.

It cannot scale because it doesn't have a solution for reusable components. That's why I have abandoned it. Frameworks like React solve this in a much saner way.

You make the reuseable components in the server templating language. It is like saying PHP, Django, Go etc does not scale

Re: Why you should choose HTMX for your next web-based side project (2024)

#43
post #11

Earlier quoted context omitted.

They didn't mention sending JSON though... and you can absolutely return HTML fragments in a JSON response.

But why?

I guess I could see it for decoupling your need to control the API you're using. The case where you have an existing API, whether your own or someone else's, and just want to get a new frontend hooked up to it.

Re: Why you should choose HTMX for your next web-based side project (2024)

#44
great to see yet another H-stack

so far I got HARM (Rust), HARC (Raku) and now HAM (F#) along with Fast HTML / htpy (Python) and GOTHH (Go)

seriously, it is very good news that HTMX has uncoupled web development from the server side language choice

now there is a blossoming of many server side stacks to fill this new opportunity

I wrote https://harcstack.org because Raku is the natural successor to perl and PHP for web development due to its facility with text processing and multi-paradigm chops

Re: Why you should choose HTMX for your next web-based side project (2024)

#45
post #30
post #23

Earlier quoted context omitted.

Htmx can scale. It's very basic and Htmx isn't the only technology to use that approach.

It cannot scale because it doesn't have a solution for reusable components. That's why I have abandoned it. Frameworks like React solve this in a much saner way.

https://harcstack.org does components like this https://rakujourney.wordpress.com/2025/07/06/harc-stack-comp...

  class Counter does Component {
    has Int $.count = 0;

    method increment is controller {
        $!count++;
        self
    }

    method HTML {
        input :id("counter-$.id"),
            :name("counter"), :value($!count)
    }
  }

Re: Why you should choose HTMX for your next web-based side project (2024)

#46
post #31
post #18

HTMX sets up an underlying network traffic pattern: 1. The user interacts with the page. 2. The page sends a request to the server. 3. The server returns one response to the client, containing HTML, which the client inserts into the page. 4. (Optional) If the response includes references to other resources, like images or fonts, the client makes more requests for these. The consequence of the 'one request, one respon…

Is it basically like Ajax?

It's basically the exact type of framework you probably built on your third or fourth Ajax project 15 years ago - declarative, progressively enhanced, simple.

Re: Why you should choose HTMX for your next web-based side project (2024)

#47

Earlier quoted context omitted.

Yes. The cycle has completed and the old new things are new again. But they're still too new and unproven for the React-embroiled companies to switch just yet. HTMX is basically a framework for AJAX that lets you more quickly set up interactions in the markup instead of having to write scripts to manipulate the DOM yourself. It also tells on sending HTML fragments over the asynchronous request instead of JSON that ha…

> But they're still too new and unproven for the React-embroiled companies to switch just yet. I've seen a few of HTMX projects attempted in production, at my previous employer. Decently sized, moderately complex web products for serious commercial purposes I will say though, all three were complete disasters.

Nothing magic about htmx or hypermedia: you still need to organize your code properly, and there are tasks for which it is not suited:

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

However, in many case, it can be much simpler architecture than alternative approaches:

https://htmx.org/essays/a-real-world-react-to-htmx-port/

Re: Why you should choose HTMX for your next web-based side project (2024)

#48

I can't believe they still don't have a way to parse JSON responses automatically. If you combine e.g. hx-post with hx-target, then it will put the text from the response into the target selector... but there is no "hx-source" to select what part of the response to use. I'd really love to be able to set e.g. hx-source="somejsonfield" instead of having to manually handle the response with a custom function that parses…

htmx is hypermedia oriented, so we expect hypermedia responses from the server

we do have a json extension for handling JSON responses, but it's a step away from the hypermedia architecture:

https://github.com/mariusGundersen/htmx-json

Re: Why you should choose HTMX for your next web-based side project (2024)

#50

Considering most of my side projects are web based and I loathe JS and prefer MPA patterns, this is very intriguing. I admit I haven’t been keeping up with HTMX or new web frameworks. Anyone have any examples that are noteworthy?

As I mentioned in a comment above, I've seen a few commercial projects attempted. But I'm hesitant to recommend HTMX, all three of them were failures (and for technical reasons not business ones)

Would you be willing to write an essay on why they failed? I'd be happy to host it here:

https://htmx.org/essays/#on-the-other-hand

Post reply on HN