logoalt Hacker News

wild_eggtoday at 5:04 AM1 replyview on HN

> Or you use HTMX... and you still end up with just as many (partial) views, but now with so much implicit state that you're veering into write-only code.

You're overthinking htmx then. I do some fairly complex stuff with no extra partials. Trick is just always rerender and use hx-select and hx-target to slice out the bits you want to update on the current page.

Server always has authoritative state and code is dead simple to reason about.


Replies

troadtoday at 10:45 AM

> You're overthinking [noun]

Yes, almost certainly!

> I do some fairly complex stuff with no extra partials. Trick is just always rerender and use hx-select and hx-target to slice out the bits you want to update on the current page.

Good trick! My only experience of HTMX in production entailed porting Stimulus code, hence the partials, but your approach is obviously much neater. I'll give it a shot, next time it might be suitable.