Remix.run Logo
asim 4 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 4 days ago | parent | next [-]

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 4 days ago | parent | next [-]

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 3 days ago | parent [-]

you have a point https://x.com/htmx_org/photo

asim 4 days ago | parent | prev [-]

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 3 days ago | parent | next [-]

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 4 days ago | parent | prev [-]

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

asim 4 days ago | parent [-]

Well I guess part of the problem is I feel like I'm looking at the website with a magnifying glass...

yxhuvud 4 days ago | parent | prev | next [-]

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 4 days ago | parent | prev | next [-]

> 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 4 days ago | parent [-]

It's not less noisy, you just move the noise to the backend

benji-york 4 days ago | parent | prev [-]

> polluted my codebase

I'd love to hear more about that.

asim 4 days ago | parent [-]

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 17 hours ago | parent [-]

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