Re:PrimateJS: Svelte and Htmx Quick Start
by xmonkee on Tuesday April 11, 2023 @05:57PM
(#35532143)
Because my client knows how to display the data, and my server doesn't? I have a button in my app that, when clicked, sends a mutation to the server, and then changes it's display based on what the server returns. At this point, moving this functionality to htmx means that both my client and my server need to know how to style this button.
[ Parent
| on HN ]
Re:PrimateJS: Svelte and Htmx Quick Start
by listenallyall on Wednesday April 12, 2023 @06:03AM
(#35537306)
This particular example isn't very convincing. All HTMX needs to send back is a button element (or DIV with button inside it, whatever) with a class attribute. You already said the styling is based on what the server returns, so the server is perfectly capable of applying the correct class. Let client-side CSS do the styling, the server doesn't need to know anything.