If you want, I might have a communications use case that I (nor Paul
afaik) wasn't able to solve in a very satisfying way, and for which
maybe you could come up with a better solution with gRPC-Web? Let me
know and I'll send you the details.
Yep, regardless of whether we adopt gRPC-Web, I'm still very
interested to hear of how it would integrate with Perkeep, and how it
would help us. Any time you want to spend on this and report about it
is very welcome.
Hi!
I'm the author of the GopherJS gRPC-Web bindings. I was introduced to Perkeep by Paul Jolly, who is the author of the GopherJS React bindings used by Perkeep to render some of its frontend UI. I thought since Perkeep has already invested in GopherJS through this UI it might be interested in trying out my gRPC-Web bindings to abstract away the communications layer between the frontend and backend in a familiar gRPC/Protobuf fashion.
The bindings are built on top of the Improbable gRPC-Web client. It features support for the Fetch API in supported browsers and automatically downgrades to XHR where necessary. It implements the gRPC-Web spec. However, the gRPC-Web spec only mandates support for unary and server-side streaming at this time. My GopherJS bindings adds support for client-side and bidirectional streaming with a custom Websocket proxy on top. Please see my demo website for an example of this.
It's only a bandaid until the gRPC-Web spec adds support for client-side and bidi-streaming.
I've submitted a small CL with a prototype of what this could look like on a small scale, to show how the bindings are used and hopefully give an idea of the impact on the codebase. At this time I only implemented it in one place, but ideally for something like this the whole communications layer between the frontend and backend would go through the generated interface.
https://camlistore-review.googlesource.com/c/camlistore/+/12406
Please let me know your thoughts!
--
You received this message because you are subscribed to the Google Groups "Camlistore" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camlistore+unsubscribe@googlegroups.com.
This could be nice.But if we get addicted to this, does it also speak JSON for people who want to speak JSON? I'm afraid we'd either let our JSON rot, or we'd have twice the maintenance cost. Ideally we'd get both for free, with one sufficiently-annotated proto file.
--
You received this message because you are subscribed to the Google Groups "Camlistore" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camlistore+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
As for building this into gRPC-web, it'd be a matter of implementing the translation in the proxy. Long term, as gRPC-web approaches the official gRPC protocol this translation will become someone else's job, as the need for the proxy disappears. So I don't think this functionality will be built into existing proxies, and we should just redirect traffic based on headers.
If I find the time I can try to modify my example to respond in JSON to requests providing the application/grpc-web+json content type header.
Johan
To unsubscribe from this group and stop receiving emails from it, send an email to camlistore+...@googlegroups.com.
--
--
You received this message because you are subscribed to the Google Groups "Camlistore" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camlistore+...@googlegroups.com.
> You get small wins like
> automatically marshalled and unmarshalled payloads to the backend, automatic
> HTTP/2 connection and Fetch API instead of XHR where available and other
> things that [Improbable make a much better case
> for](https://improbable.io/games/blog/grpc-web-moving-past-restjson-towards-type-safe-web-apis)
> than I ever could. I would like to think it would make the frontend/backend
> communications more "maintainable", and nicer to work with
If you want, I might have a communications use case that I (nor Paul
afaik) wasn't able to solve in a very satisfying way, and for which
maybe you could come up with a better solution with gRPC-Web? Let me
know and I'll send you the details.