News for hackers. Stuff that matters.
Re:Htmx – high power tools for HTML by nogabebop23 on Thursday May 28, 2020 @09:36AM (#23337051)
Sending back HTML is kind of the point though. The idea is lots of sites built on frameworks (Rails, .NET, Java) already do HTML rendering server-side, so now you can get SPA-like UI without backend changes. If you've got a REST backend (which the former generally don't) I would use one of the many popular client side frameworks. Using HTMX or intercooler or unpoly, doesn't make a lot of sense in this scenario.
Re:Htmx – high power tools for HTML by wenc on Thursday May 28, 2020 @10:03AM (#23337319)
I think that even if a server returns HTML, on the client-side we'd typically like to retain the flexibility to style/restyle/rearrange elements it to fit the current layout. The same response could be used in multiple places with different styles.

What other client-side UI frameworks do you recommend? I'm liking what I'm seeing with HTMX due to its small size and simplicity.

Re:Htmx – high power tools for HTML by recursivedoubts on Thursday May 28, 2020 @10:18AM (#23337524)
with htmx you can send out of band content down that will be swapped in by id:

https://htmx.org/attributes/hx-swap-oob/

you can also select content by a selector:

https://htmx.org/attributes/hx-select/

and there is infrastructure for general response transformations via the extensions mechanism:

https://htmx.org/extensions/client-side-templates/

See the source code here:

https://unpkg.com/[email protected]/dist/ext/client-side-templa...