connectrpc / connect-es

The TypeScript implementation of Connect: Protobuf RPC that works.
https://connectrpc.com/
Apache License 2.0
1.34k stars 76 forks source link

WebTransport transport #1106

Open bhollis opened 3 months ago

bhollis commented 3 months ago

Is your feature request related to a problem? Please describe.

We'd like to make use of bidi and client streaming from web browsers. This is currently not supported by the fetch (browser) transport for connect-es.

Describe the solution you'd like

A new transport based on the WebTransport API. This is also on the roadmap for grpc-web so maybe there's some shared effort possible. WebTransport allows for full duplex streaming, though it isn't yet supported in Safari (they are supportive of it, so it should show up eventually).

This would be primarily useful for the browser, though I suspect server runtimes like NodeJS and Deno will eventually include it.

Describe alternatives you've considered

  1. Implement a WebSockets transport, though that would require server changes.
  2. Implement the WebTransport transport ourselves.
perezd commented 3 months ago

We're interested in seeing bidi streaming support for Connect RPC via WebTransport; we've just not gotten a chance to implement it yet! As you've pointed out, the lack of Safari support has historically made us de-prioritize this effort, but we agree this is needed.

Would you be interested in collaborating on developing this capability?

bhollis commented 3 months ago

Definitely, I've been meaning to get a chance to hack on a WebTransport gRPC implementation.

perezd commented 3 months ago

Great! I'd recommend we do some realtime chatting/meeting about this in our CNCF slack channel (#connectrpc), would you mind joining over there? https://communityinviter.com/apps/cloud-native/cncf