Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This really depends on your server-side HTML rendering approach. I have a library in which I can do this:

    node +@ Hx.swap_oob "true"
And this adds the `hx-swap-oob=true` attribute to the given node. It makes it trivial to add on any defined markup in an oob swap.

I get that many people prefer template-based rendering, but imho to extract the maximum power from htmx an HTML library that's embedded directly in your programming language is much more powerful.

https://github.com/yawaramin/dream-html/blob/f7928616b9ca1d6...



> to extract the maximum power from htmx an HTML library that's embedded directly in your programming language is much more powerful.

I'm actually using gomponents, but the maintainer doesn't like the vibe of adding attributes to existing nodes.

https://github.com/maragudk/gomponents/issues/276

(I don't really understand his argument, but in general I'm in favor of maintainers doing what they think is the right thing; and in any case I'm using his work without paying, so not gonna complain.)

But even if I had an easy way to add the attribute, the fact that I need to think about that extra step is a bit of extra friction HTMX imposes, which datastar doesn't.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: