Live data from Hacker News

How I use HTMX with Go

alexedwards.net

81–90 of 121 posts

Re: How I use HTMX with Go

#81

HTMX is great for a lot of things, but if you're working in a team, and your colleagues are not on board, it's tough. Lots of "this is not a serious technology" kind of arguments. All kinds of bugs simply initially blamed on the choice of using HTMX. Even if proven wrong afterwards, the damage is already done. And this was in the most excellent team I have worked in so far. I'm happy that I got to experience this and…

I had the same thing but in reverse, it's impossible to convince my company that the React SPA simply doesn't scale despite all the problems we have with it.

They can see each problems one by one but can't put it in the same picture as it's "proven technology"

Re: How I use HTMX with Go

#82
post #43

As someone who tried to build a fairly large project with HTMX + Go, I can say it just wasn't there for me. Maybe it will get there eventually, but I'm not convinced. For simple CRUD apps and admin dashboards, HTMX is great. But once you have lots of interconnected components, shared state, and complex interactions, managing everything quickly becomes difficult. I originally chose HTMX because I really didn't enjoy w…

Isn’t the whole point of HTMX philosophy to question whether you need interconnected components with shared state? Most apps are doing crud on a database at the end of the day.

Yes. And additionally most "apps" are just static web sites with static components.

Re: How I use HTMX with Go

#84
post #4

Love Go + HTMX. I pair it with a-h/templ for a bit more type safety on the template, components and partials. I just shared my whole toolkit too [1], I call it the "GUS stack" -- Go, Unix, SQLite. Inspired heavily by the exe.dev "GUTS" stack [2] but with HTMX instead of Typescript. Some other Go components in the kit... - cockroachdb/errors for errors with stack traces - templ for type-safe HTML templates (with htmx…

I was wondering: would you be able to add an RSS feed to housecat blog I can subscribe to?

Re: How I use HTMX with Go

#85
post #44

Earlier quoted context omitted.

I understand the sentiment. Rails was my introduction to hypermedia and it was convenient and easy, so experiencing friction when building with Go/HTMX came as a surprise. After a few attempts I learned that abstractions are important :D Without a component builder and reversible router is indeed pretty painful (and Rails just ships with these things so you didn't have to worry about it). The biggest benefit for me p…

I’m struggling myself a bit with the components and routers in HTMX/go. Can you recommend any source code or reading on that topic?

There's vuego: https://github.com/titpetric/vuego

And my own version (I learned of vuego only after): https://htmlc.sh

Not a fan of html/template and tmpl myself, because HTML should be treated as tree and not as strings, but everybody has different preferences.

For routing I now use my own library in all projects: https://github.com/dhamidi/dispatch

It's relatively easy to generate your own nowadays, I mostly go through the Ruby on Rails guides and mix and match the pieces I want for go and turn them into libraries :)

Re: How I use HTMX with Go

#86
post #43

As someone who tried to build a fairly large project with HTMX + Go, I can say it just wasn't there for me. Maybe it will get there eventually, but I'm not convinced. For simple CRUD apps and admin dashboards, HTMX is great. But once you have lots of interconnected components, shared state, and complex interactions, managing everything quickly becomes difficult. I originally chose HTMX because I really didn't enjoy w…

Isn’t the whole point of HTMX philosophy to question whether you need interconnected components with shared state? Most apps are doing crud on a database at the end of the day.

I think it very much depends on what you're doing. Would it make sense to build Google Docs in HTMX? Probably not. Does it make sense to roll out SPA + JSON API for something that is basically a reskinned Django Admin? Probably not.

Re: How I use HTMX with Go

#88
post #77

Earlier quoted context omitted.

Exactly the same thing happen to me: https://www.reddit.com/r/htmx/s/DuXyGgsCWK I'm in an advisor position, and I tried very hard to mentor the team, explaining that learning this technology deepens your understanding of the browser. Whereas React etc isolates you from the actual environment you're working in - the browser. On html/template, I like the security by default, and obviously it's built-in. But the dynamic…

yeah with tools like HTMX - your environment shapes you. if your teams is less than 3 people - you've less politics to fight. & chances are people are already capable - no resume padding. so you choose what's pragmatic & that choice ends up being HTMX. for big teams - politics takes over. even though HTMX will be beneficial - might as well go with the 'safer' political choice which doesn't cause much contention ie on…

I have also noticed teams don't seem to "get" htmx.

It is an unbelievably good tool though, and LLM's understand it very well (given some encouragement).

Re: How I use HTMX with Go

#89
post #79
post #43

As someone who tried to build a fairly large project with HTMX + Go, I can say it just wasn't there for me. Maybe it will get there eventually, but I'm not convinced. For simple CRUD apps and admin dashboards, HTMX is great. But once you have lots of interconnected components, shared state, and complex interactions, managing everything quickly becomes difficult. I originally chose HTMX because I really didn't enjoy w…

Just curious: the people behind HTMX have a frontend sibling project called Hyperscript, which handles stuff like frontend state: https://hyperscript.org/docs/reactivity/ Did you give it a try?

At that point just use React.

Re: How I use HTMX with Go

#90
post #87

Why doesn't htmx became ultra popular among devs ?

Because it is good for a very narrow scope of things, once you go beyond that, it becomes a kludge to work with.

People hate on React but it is the product of 2 decades of various experiments. It is popular because it really works.

Post reply on HN