Live data from Hacker News

Htmx: Access modern browser features directly from HTML

htmx.org

1–10 of 12 posts

Re: Htmx: Access modern browser features directly from HTML

#3
I still have no idea what benefits having your API serve markup is supposed to confer, but people tell me it's "great".

also, I find your headline misleading. htmx uses javascript, there's no accessing anything "directly from html". you could say that about any framework with directives, ie vue, but we all know better.

Re: Htmx: Access modern browser features directly from HTML

#5
post #3

I still have no idea what benefits having your API serve markup is supposed to confer, but people tell me it's "great". also, I find your headline misleading. htmx uses javascript, there's no accessing anything "directly from html". you could say that about any framework with directives, ie vue, but we all know better.

It's really good for streaming view updates to your users in realtime.

Re: Htmx: Access modern browser features directly from HTML

#6
post #3

I still have no idea what benefits having your API serve markup is supposed to confer, but people tell me it's "great". also, I find your headline misleading. htmx uses javascript, there's no accessing anything "directly from html". you could say that about any framework with directives, ie vue, but we all know better.

It's really good for streaming view updates to your users in realtime.

you mean via SSE? is any part of that an inherent "htmx only" thing, or even a "markup API only" thing?

a framework using a neat piece of technology isn't really a boon for the framework -- the technology of streaming itself is great, sure, but you can do that with any stack.

Re: Htmx: Access modern browser features directly from HTML

#7
post #6

Earlier quoted context omitted.

It's really good for streaming view updates to your users in realtime.

you mean via SSE? is any part of that an inherent "htmx only" thing, or even a "markup API only" thing? a framework using a neat piece of technology isn't really a boon for the framework -- the technology of streaming itself is great, sure, but you can do that with any stack.

Sure, but the browser is fast and rendering HTML so why stream anything else? Why stream javascript + json to build html. You're adding a bunch of marshalling that doesn't need to be there.

Re: Htmx: Access modern browser features directly from HTML

#8
post #6

Earlier quoted context omitted.

you mean via SSE? is any part of that an inherent "htmx only" thing, or even a "markup API only" thing? a framework using a neat piece of technology isn't really a boon for the framework -- the technology of streaming itself is great, sure, but you can do that with any stack.

Sure, but the browser is fast and rendering HTML so why stream anything else? Why stream javascript + json to build html. You're adding a bunch of marshalling that doesn't need to be there.

Yeah, as I understand it the idea is that instead of making the server-side complex and the frontend code complex, you retain as much complexity server-side as possible and treat the browser as just a hypermedia renderer.

If a part of the page needs to change, the server figures out what it should change to and sends that page fragment.

At least, that's my cursory understanding from reading https://hypermedia.systems

Re: Htmx: Access modern browser features directly from HTML

#10
post #8

Earlier quoted context omitted.

Sure, but the browser is fast and rendering HTML so why stream anything else? Why stream javascript + json to build html. You're adding a bunch of marshalling that doesn't need to be there.

Yeah, as I understand it the idea is that instead of making the server-side complex and the frontend code complex, you retain as much complexity server-side as possible and treat the browser as just a hypermedia renderer. If a part of the page needs to change, the server figures out what it should change to and sends that page fragment. At least, that's my cursory understanding from reading https://hypermedia.systems

Right. But, hypermedia systems doesn't go far enough. It can be even simpler then that.

In a video game the "server" doesn't figure out what's changed (that's too much work) it just redraws the frame. So rather than the complexity of working out what has changed you can just send down the whole page again whenever something changes.

This gives you view = f(state) over the wire and has great DX. It's called immediate mode in games.

Post reply on HN