-
Notifications
You must be signed in to change notification settings - Fork 54
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(#38): make module TurboModule-compatible #59
base: master
Are you sure you want to change the base?
Conversation
- create JS Codegen spec - use install_modules_dependencies util in podspec if possible, to install React deps - migrate Android module class to conform to codegenerated spec when new arch enabled - copy codegen-ed to oldarch Android source set to make module work when new arch disabled - migrate iOS module class to conform to codegenerated spec when new arch enabled
Hi @LinusU , let me know if there's anything I'd need to improve in this PR |
@LinusU lgtm |
@mateusz1913 is the android newarch folder missing? |
@pinpong no, the codegen spec class is used by default and if old arch enabled, it uses the class from old arch folder |
For some reason; when using the TurboModule implementation - Sentry seems to stop generating its event identifiers correctly for me (only difference is TurboModule/non-TurboModule). When it fails, it falls back to a static ID (10000000100040008000100000000000). |
import { TurboModuleRegistry } from 'react-native'; | ||
|
||
export interface Spec extends TurboModule { | ||
+getRandomBase64: (byteLength: Int32) => string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mateusz1913 When running this, I needed to change this to 'Double' rather than 'Int32' to make the types match correctly in Obj-C.
For a Uint8Array(10), byteLength in getRandomBase64 was "4621819117588971520" in the debugger, and I was receiving "Error: Exception in HostFunction: Failed to aquire secure random bytes".
Changing this type def resolves this issue.
Closes #38
👋 This PR adds TurboModule support
List of changes: