This PR adds the stream function to the React-Native gRPC transport.
Because the fetch API is not fully implemented in React-Native (see issue here), I had to polyfill the missing fetch function (package here) and replaced some functions in the global namespace (see here).
On Android, text-streaming doesn't work out-of-the-box on the debug variant. One solution is to comment the NetworkFlipperPlugin (see here). Because we don't use it for the moment, I commented that plugin.
I added a HelloStream API function to test the stream feature.
We can call it in Reac-Native by doing this:
for await (const res of clientInstance.helloStream(new HelloStreamRequest({ name: 'd4ryl00' }))) {
console.log(res.greeting);
}
This PR adds the
stream
function to the React-Native gRPC transport. Because thefetch
API is not fully implemented in React-Native (see issue here), I had to polyfill the missingfetch
function (package here) and replaced some functions in the global namespace (see here).On Android, text-streaming doesn't work out-of-the-box on the
debug
variant. One solution is to comment theNetworkFlipperPlugin
(see here). Because we don't use it for the moment, I commented that plugin.I added a
HelloStream
API function to test the stream feature. We can call it in Reac-Native by doing this: