Re:Building a fullstack app with Flask and HTMx
by tomatowurst on Tuesday March 29, 2022 @01:24PM
(#30845659)
what sort of magic does LiveView do here that HTMx doesn't? seems like the difference here is that the article sends a server rendered partial HTML down the wire with HTMx sprinkled on it that gets rendered on the client side. From my basic understanding, LiveView sends HTML to client first, establishes bi-directional WS connection, and proceeds to send JSON data to the client and synchronizes the app state via sending diffs over WS.
Re:Building a fullstack app with Flask and HTMx
by recursivedoubts on Tuesday March 29, 2022 @01:43PM
(#30845935)
yep, exactly, so LiveView needs to have that web socket doing diffs between the client and server side
htmx is just html++: any element can make any sort of HTTP request (GET, DELETE, etc.) based on any event and replace any other element in the DOM.
much simpler and "dumb" when compared w/ liveview, with no particular server-side implementation implied
it tries to extend HTML as a hypermedia, which makes it more general (it can be used with any backend that produces HTML) but also more work to achieve things that, in live view, work magically