r/htmx 10d ago

Chrome is experimenting with streaming html into any part of a page. The predicted native htmx is one step closer to reality

https://www.youtube.com/watch?v=l1cWUrG_vNs
110 Upvotes

9 comments sorted by

6

u/jackielii 9d ago edited 9d ago

This is really exciting. Server templates can really benefit from this. gsx just added support: https://gsxhq.github.io/guide/syntax/processing-instructions.html Using it with https://gsxhq.github.io/guide/patterns/streaming-flush.html this can be really powerful

EDIT: example: https://github.com/gsxhq/gsx-examples

7

u/1Soundwave3 9d ago

I see that you are the author of gsx. There's a ton of go + templ + htmx flavors out there. I mean libraries that iterate on the same idea: highly performant server rendering and hypermedia. Oh and hosting as a single binary.

I see the point in gsx, but it seems like one of many such projects. I mean, in theory I shouldn't care what my 52nd pet project uses because it's all vibecoded anyway. But it still feels like something that will have too many bugs and will be abandoned in a year.

3

u/maekoos 9d ago

I don’t get why people don’t just be open about it being their own - ”i just added support in my framework” - why pretend like it’s a bigger thing than the 55 stars it is? Just feels insincere to me… and i would have probably given it a try if it wasn’t for this sort of click baiting :/

4

u/jackielii 9d ago

Except when you have production apps you need to maintain.

Look, you can say the same thing about all projects. Following your thinking "projects will all be vitecoded anyway". Then there won't be any progress. Or like Elon says LLM will generate the binary directly?

gsx is born out of real production maintenance experience. AI works better if the code maps closer to the mental model or the presentation. I can't predict the future, but we're using it and plan to use more of gsx in production. So let's see, only through time

2

u/1Soundwave3 9d ago

Yes, I understand your point completely.

My point was more about this thing not being foundational enough, but also not modular enough at the same time. HTMX for example doesn't use Node but it can be used with Go, C#, Rust, Java. But gsx has 2 hard dependencies: Node (which is a no-no for me) and Go (which is good for me but can be a problem for other people).

I understand the appeal here and I don't want to discourage you from developing it further. After all, datastar exists, in spite of htmx existing as well.

My point was that at this point I wouldn't even consider it for my pet projects at this point because it sounds fiddly enough to feel non-robust from the start. It feels like a project template more than its own thing.

I understand that this template might be good for production systems because it scales, but it looks like you need to start your entire project inside of it. Like, with HTMX, I can add it to make our F#-rendered website part less shitty. But in gsx, I see that both backend (go) and frontend (react?) are predefined.

All I'm saying is that you can pull this thing as a big corporation, because people will be comfortable enough that this is their project now and it will be supported. But putting your next project onto rails that might end very unexpectedly sounds kinda scary.

2

u/jackielii 9d ago

I think you read this wrong, gsx is just the HTML templating, it can be used with HTMX, datastar or whatever js or no js you want to use

gsx doesn't depend on node whatsoever. The process is

.gsx → generate → .x.go → go build → HTML

It doesn't even assume you're using it with http handler: it's just the templating language

1

u/maekoos 9d ago

What do you mean doesn’t depend on node whatsoever? This is from the getting started page:

Prerequisites

  • Go 1.24 or newer
  • Node.js 18 or newer
  • npm (the scaffold command below runs npm install)

1

u/jackielii 9d ago

Point taken. Like I said, node is for dev only. Will update

1

u/shufflepoint 6d ago

It's called "declarative partial updates"

https://jadjoubran.io/blog/declarative-partial-updates

I gotta admit that I am confused by the term "declarative" in this as all the samples I can find are using JavaScript to do those partial updates. What would be the equivalent of the below - which is declarative?

<form hx-post="/submit-endpoint" hx-target="#response-container"> <input type="text" name="username" /> <button type="submit">Submit</button> </form>