-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add react-native streams support (#55)
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](facebook/react-native#27741)), I had to polyfill the missing `fetch` function (package [here](https://github.com/react-native-community/fetch)) and replaced some functions in the global namespace (see [here](https://github.com/acostalima/react-native-polyfill-globals)). On Android, text-streaming doesn't work out-of-the-box on the `debug` variant. One solution is to comment the `NetworkFlipperPlugin` (see [here](react-native-community/fetch#13 (comment))). 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: ```typescript for await (const res of clientInstance.helloStream(new HelloStreamRequest({ name: 'd4ryl00' }))) { console.log(res.greeting); } ``` Signed-off-by: D4ryl00 <[email protected]>
- Loading branch information
Showing
26 changed files
with
1,577 additions
and
315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
ceb2922aa6e25cc4b9256163c5a31443770af3a6 Makefile | ||
3f8e7619fa38e476bb3d35923f6c2676cfe8809b buf.gen.yaml | ||
8e0d611d49279bc49aa043c5f518326b50dfd76c service/gnomobiletypes/gnomobiletypes.go | ||
50596a8d996f91253ef714fe24b618f05a6f179a service/gnomobiletypes/package.go | ||
cc43128277f99518087578f22e7e56a3de0c0f1f service/rpc/gnomobiletypes.proto | ||
5cf0c76d7a484f82c7c56834983dba63286916f7 service/rpc/rpc.proto | ||
781263c443b6ffebe091128855ce2a8b594fd8ea service/gnomobiletypes/gnomobiletypes.go | ||
c4488aa6a301b2865856719295d704c77ff45512 service/gnomobiletypes/package.go | ||
646d974f3a99753ed94a3d8ba4affb2a0267d3f2 service/rpc/gnomobiletypes.proto | ||
7b283a24b6c14a7e8907d5b82c95f6ffec4b0332 service/rpc/rpc.proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
167 changes: 127 additions & 40 deletions
167
gnoboard/android/app/src/main/java/land/gno/gnomobile/v1/GnomobileServiceGrpc.java
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.