-
Notifications
You must be signed in to change notification settings - Fork 450
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
fix: react native adjustments #2229
fix: react native adjustments #2229
Conversation
2697619
to
3dee5df
Compare
9664933
to
1a537ee
Compare
cd16f4b
to
6bb459f
Compare
242fd96
to
bca8d6e
Compare
This is the app, very basic so far: https://github.com/ipfs-shipyard/js-libp2p-react-native |
Oh good, react native doesn't support passing async generators to |
Actually it sort of does but generators don't appear to have the |
The crypto situation is pretty dire, from what I can gather there's no SubtleCrypto support and Facebook's response to questions about adding it were lukewarm. This rules out simply following the browser path in modules with node/browser support since they depend on SubtleCrypto. We could shim in pure-js versions of everything but crypto is such a bottleneck for us that doing everything in js on your phone is likely to melt it. The community response yielded react-native-webcrypto but it's incomplete and only works on Android. react-native-webview-crypto is an interesting hack though the library it depends on has a showstopping bug that's only had a PR to fix it open for three years. It also involves stringifying and copying all data to be encrypted/decryped to/from a webview - I haven't measured it but common sense says that will not be a performant approach. We could patch the library to fix the bug and transfer the The other approach is to follow the node path instead and use rn-nodeify to shim node core modules in where necessary. This opens up the possibility of using react-native-quick-crypto which does crypto in C/C++ so would be preferable. Unlike most of the other crypto libraries here, quick-crypto appears to still be under development so that's heartening. |
0e561b0
to
f828e4c
Compare
Actually the sweet spot might be to shim SubtleCrypto with @peculiar/webcrypto - it uses node's |
f828e4c
to
6ebd4cc
Compare
- export typed event emitter separately from setMaxListeners - update react-native overrides in module package.json files - add react-native-webrtc implementation to WebRTC transport
122e420
to
4f63edb
Compare
Related #2136