Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add react-native streams support #55

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions gen.sum
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
9 changes: 7 additions & 2 deletions gnoboard/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import CustomRouter from '@gno/router/custom-router';
import 'fast-text-encoding';
import CustomRouter from "@gno/router/custom-router";
import "react-native-polyfill-globals/auto";

// Polyfill async.Iterator. For some reason, the Babel presets and plugins are not doing the trick.
// Code from here: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-3.html#caveats
(Symbol as any).asyncIterator = Symbol.asyncIterator ||
Symbol.for("Symbol.asyncIterator");

function App() {
return <CustomRouter />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ public static void initializeFlipper(Context context, ReactInstanceManager react
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());

NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
// Need to comment this code to allow gRPC streams to work: https://github.com/react-native-community/fetch/issues/13#issuecomment-1703097655
// NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
// NetworkingModule.setCustomClientBuilder(
// new NetworkingModule.CustomClientBuilder() {
// @Override
// public void apply(OkHttpClient.Builder builder) {
// builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
// }
// });
// client.addPlugin(networkFlipperPlugin);
client.start();

// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
Expand Down

Large diffs are not rendered by default.

Loading