Add support for enabled TurboModules in Expo#418
Merged
krizzu merged 1 commit intoreact-native-async-storage:masterfrom Aug 16, 2020
Merged
Add support for enabled TurboModules in Expo#418krizzu merged 1 commit intoreact-native-async-storage:masterfrom
krizzu merged 1 commit intoreact-native-async-storage:masterfrom
Conversation
brentvatne
approved these changes
Aug 12, 2020
krizzu
reviewed
Aug 13, 2020
Contributor
Author
|
Thank you for merging it and verifying that the fix is correct! I'm sorry to ask you more of your time, but would you care to publish a new version of |
Member
|
v1.12.0 is out :) |
sjchmiela
added a commit
to expo/expo
that referenced
this pull request
Aug 18, 2020
# Why We need to enable TurboModules to be able to include Reanimated v2. > A known issue with this PR is that the community AsyncStorage seizes to work — it expects only native module, isn't compatible with TurboModule AsyncStorage and we do not import the AsyncStorage community module properly. > > **Actually**, react-native-async-storage/async-storage#418 should be enough. # How Apart from the more or less usual TurboModules setup (imports, headers, flags, C++ dialect) I had to move native modules that we override in Expo from `extraModulesForBridge:` to `getModuleInstanceFromClass:`. I don't like that we have to use `RCTLogFunction` in `EXVersionManager` now (otherwise the code wouldn't compile), but I guess that if the type ever changes somebody will notice and backport the change to versioned SDKs. # Test Plan Expo Client compiled, home ran.
|
would it make sense to not put this under an |
djhr
pushed a commit
to smartHelios/async-storage
that referenced
this pull request
Oct 5, 2020
prakashbask
pushed a commit
to prakashbask/expo
that referenced
this pull request
Mar 16, 2022
# Why We need to enable TurboModules to be able to include Reanimated v2. > A known issue with this PR is that the community AsyncStorage seizes to work — it expects only native module, isn't compatible with TurboModule AsyncStorage and we do not import the AsyncStorage community module properly. > > **Actually**, react-native-async-storage/async-storage#418 should be enough. # How Apart from the more or less usual TurboModules setup (imports, headers, flags, C++ dialect) I had to move native modules that we override in Expo from `extraModulesForBridge:` to `getModuleInstanceFromClass:`. I don't like that we have to use `RCTLogFunction` in `EXVersionManager` now (otherwise the code wouldn't compile), but I guess that if the type ever changes somebody will notice and backport the change to versioned SDKs. # Test Plan Expo Client compiled, home ran.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
At Expo we're on the verge of enabling TurboModules in SDK 39 (expo/expo#9687). While we haven't added the native code for this module to the SDK yet, we want to maintain the
.expo.jsfallback, so it resolves with the React Native'sAsyncStorage.Test Plan:
I have verified manually that copying and pasting this code to an appropriate file in
node_modulesfor a running Expo project fixes the[@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.error.The
if (TurboModuleRegistry)helps to not break this code on older versions of RN which do not have TMR (I hope).