Re:Htmx is part of the GitHub Accelerator
by giraffe_lady on Wednesday August 16, 2023 @09:58AM
(#37147088)
For many basic & routine web page interactions, I have not found that to be true.
[ Parent
| on HN ]
Re:Htmx is part of the GitHub Accelerator
by gochi on Wednesday August 16, 2023 @10:05AM
(#37147218)
I can only see that experience being true if you've never used jquery (aka the same shorthands you're relying on within htmx and likely hyperscript).
Re:Htmx is part of the GitHub Accelerator
by Spivak on Wednesday August 16, 2023 @10:15AM
(#37147345)
I think the biggest change from jQuery flows is that the behavior is attached to the elements themselves instead of a script over here poking at the dom from the outside.
Re:Htmx is part of the GitHub Accelerator
by giraffe_lady on Wednesday August 16, 2023 @10:14AM
(#37147331)
My frontend experience predates the rise of react etc. I have used jquery.
The advantage of htmx over jquery is declaring the replace condition & behavior inline as part of the component. Conceptually this is easy to reckon with as a separation of concerns thing as well as a sandi metz-ish "when would this code need to be changed" thing. The html tag is responsible for its own update, and so its update is part of the html tag.
Jquery does the same things but requires you to declare the behavior separately from the component, decide on & maintain abstractions and reuse patterns. And manage code organization so that for any updatable template code you can find the corresponding behavior declarations and understand their scope w/r/t other template code.