Live data from Hacker News

Please just try HTMX

pleasejusttryhtmx.com

51–60 of 530 posts

Re: Please just try HTMX

#53
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.

Re: Please just try HTMX

#54
post #30
post #21

If you never seen HTMX it is a small js library that lets you swap some part of your dom with the responses from your webserver. This means that in theory you (as a dev) don't need (to write any) js, nor do your users need to download a full page (for any interaction) like it's 1999. Your webserver replies with fully server-renderd HTML but just for the dom node (say a div) that you want to replace. It's fun for very…

> If you never seen HTMX it is a small js library that lets you swap some part of your dom with the responses from your webserver. > This means that in theory you don't need js, nor do your users need to download a full page like it's 1999. Your webserver replies with fully server-renderd HTML but just for the dom node (say a div) that you want to replace. You got this backwards. With HTMX you need js. But just to sw…

You [as a dev] don't need [to write] js.

Your browser will still run js. See sibling thread.

Re: Please just try HTMX

#56
post #50
post #37

Earlier quoted context omitted.

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/

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

Lol, it's ... a feature ... I think

Re: Please just try HTMX

#57

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 arti…

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".

Re: Please just try HTMX

#59
post #15

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 su…

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.

Re: Please just try HTMX

#60
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.

Post reply on HN