Skip to content

Commit c8e5173

Browse files
committed
feat: add react-native streams support
Signed-off-by: D4ryl00 <[email protected]>
1 parent a50596a commit c8e5173

26 files changed

+1599
-320
lines changed

gen.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ceb2922aa6e25cc4b9256163c5a31443770af3a6 Makefile
22
3f8e7619fa38e476bb3d35923f6c2676cfe8809b buf.gen.yaml
3-
8e0d611d49279bc49aa043c5f518326b50dfd76c service/gnomobiletypes/gnomobiletypes.go
4-
50596a8d996f91253ef714fe24b618f05a6f179a service/gnomobiletypes/package.go
5-
cc43128277f99518087578f22e7e56a3de0c0f1f service/rpc/gnomobiletypes.proto
6-
5cf0c76d7a484f82c7c56834983dba63286916f7 service/rpc/rpc.proto
3+
781263c443b6ffebe091128855ce2a8b594fd8ea service/gnomobiletypes/gnomobiletypes.go
4+
c4488aa6a301b2865856719295d704c77ff45512 service/gnomobiletypes/package.go
5+
646d974f3a99753ed94a3d8ba4affb2a0267d3f2 service/rpc/gnomobiletypes.proto
6+
7b283a24b6c14a7e8907d5b82c95f6ffec4b0332 service/rpc/rpc.proto

gnoboard/App.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
import CustomRouter from '@gno/router/custom-router';
2-
import 'fast-text-encoding';
1+
import CustomRouter from "@gno/router/custom-router";
2+
import "react-native-polyfill-globals/auto";
3+
4+
// Polyfill async.Iterator. For some reason, the Babel presets and plugins are not doing the trick.
5+
// Code from here: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-3.html#caveats
6+
(Symbol as any).asyncIterator = Symbol.asyncIterator ||
7+
Symbol.for("Symbol.asyncIterator");
38

49
function App() {
510
return <CustomRouter />;

gnoboard/android/app/src/debug/java/land/gno/gnoboard/ReactNativeFlipper.java

+10-9
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,16 @@ public static void initializeFlipper(Context context, ReactInstanceManager react
3838
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
3939
client.addPlugin(CrashReporterPlugin.getInstance());
4040

41-
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
42-
NetworkingModule.setCustomClientBuilder(
43-
new NetworkingModule.CustomClientBuilder() {
44-
@Override
45-
public void apply(OkHttpClient.Builder builder) {
46-
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
47-
}
48-
});
49-
client.addPlugin(networkFlipperPlugin);
41+
// Need to comment this code to allow gRPC streams to work: https://github.com/react-native-community/fetch/issues/13#issuecomment-1703097655
42+
// NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
43+
// NetworkingModule.setCustomClientBuilder(
44+
// new NetworkingModule.CustomClientBuilder() {
45+
// @Override
46+
// public void apply(OkHttpClient.Builder builder) {
47+
// builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
48+
// }
49+
// });
50+
// client.addPlugin(networkFlipperPlugin);
5051
client.start();
5152

5253
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized

gnoboard/android/app/src/main/java/land/gno/gnomobile/v1/GnomobileServiceGrpc.java

+127-40
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)