-
Notifications
You must be signed in to change notification settings - Fork 473
Allow consumption of RCTAsyncStorage as TurboModule #965
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
Conversation
In react-native-windows, attributed C++ modules can be consumed as either a legacy native module or TurboModule. This change enables registration of RNCAsyncStorage as a TurboModule.
// TurboModuleRegistry falls back to NativeModules so we don't have to try go | ||
// assign NativeModules' counterparts if TurboModuleRegistry would resolve | ||
// with undefined. | ||
let RCTAsyncStorage = TurboModuleRegistry |
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.
I wonder if we should just bump the minimum requirement to 0.61 so we don't have to do this check. What do you think @krizzu?
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.
I'm fine with the change, although that means we'd have to keep a compatibility table in readme (so that, we show which version is supported by which RN version). I guess it's safe to say we support 0.60 and up version
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.
Okay, let's do this after this PR merges. Can you fix the Release job? It looks like it's unable to fetch user and password for some reason.
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.
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.
Ah, I didn't realize this was an issue. Thanks for looking into it. I guess that means we can merge this now?
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.
Yeah, let's get this in 🙏
🎉 This PR is included in version 1.18.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
In react-native-windows, attributed C++ modules can be consumed as either a legacy native module or TurboModule. This change enables registration of RNCAsyncStorage as a TurboModule.
Test Plan
Tested this out in a react-native-windows C++ app, where instead of using the ReactPackageProvider, I register RNCAsyncStorage.h directly as a TurboModule.