htmx icon indicating copy to clipboard operation
htmx copied to clipboard

Proposal: Support for grpc-web

Open CosminSontu opened this issue 2 years ago • 8 comments

Currently htmx supports AJAX, WebSockets, SSE, but not grpc-web.

I think that would be very useful. I also think it's possible to use grpc-web using some kind of event-based workaround, but it would be great to have first-class support.

I apologize if there's already an issue on grpc-web or a documented way to do grpc-web with htmx, I just did not find it.

Cheers!

CosminSontu avatar Jan 21 '24 12:01 CosminSontu

+1

saadansari93 avatar Jan 24 '24 19:01 saadansari93

https://htmx.org/extensions/#defining

It could be done through extending htmx , it would probably have to be extended anyway in order to serialize/deserialize any grpc messages.

I could be wrong but grpc and protocol buffers requiring serialization/deserialization don't seem to fit the vision of hypermedia?

bshore avatar Jan 25 '24 15:01 bshore

I could be wrong but grpc and protocol buffers requiring serialization/deserialization don't seem to fit the vision of hypermedia?

It's true, but same can be said about WebSockets for example. Should be ok as long as it serves html.

CosminSontu avatar Jan 25 '24 18:01 CosminSontu

+1

loeffel-io avatar Feb 05 '24 11:02 loeffel-io

Hi everyone. I'm trying to create example using gRPC and htmx extension, but don't know how I can paste my response from backend into DOM (here).

My knowledge of Javascript is not sufficient to complete this example. Help pls)).

vildan-valeev avatar Feb 13 '24 22:02 vildan-valeev

Upd: I received string(html) from gRPC,and call selectAndSwap method from htmx.js api. And it's work!

vildan-valeev avatar Feb 23 '24 16:02 vildan-valeev

+1

struckoff avatar Feb 25 '24 23:02 struckoff

ahh.. i was just thinking this and it would be the new standard XD

fadhilaf avatar Jul 19 '24 18:07 fadhilaf