connect-es icon indicating copy to clipboard operation
connect-es copied to clipboard

Use the Fetch with ReadableStream to support request streams in the Connect for Web.

Open gartz opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. Use the bytes feature to upload files from the browser to the server using request stream.

Describe the solution you'd like Connect for Web : Add support to request stream using ReadableStream instance being passed to the request body.

Describe alternatives you've considered If you've proposed a solution, are there any alternatives? Why are they worse than your preferred approach? Using unary. It's worse because large files it quite loads the client and server memory. Also there is no way to implement resuming upload when using unary calls.

gartz avatar May 01 '23 00:05 gartz

Hey Gabriel, we have our eyes on this feature, but unfortunately, it is not widely available yet. See https://developer.mozilla.org/en-US/docs/Web/API/Request/body#browser_compatibility for context.

It might be worth giving it a try with the full implementation of the Transport (instead of the slimmed down one from @bufbuild/connect-web). You can see an example here: https://github.com/bufbuild/connect-es/issues/577#issuecomment-1503185372

timostamm avatar May 01 '23 12:05 timostamm