Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ios][expotools] Fixes for versioned TurboModules (#9862)
# Why After versioning, TurboModules integration started to make more harm than good. # How - moved creating of the `JSCExecutorFactory`, which should be versioned, to versioned realm (otherwise we try to pass an unversioned code into a versioned bridge) (huge thanks to C++ senpai @wkozyra95 for assistance) - to achieve this I unfortunately had to modify `react-native` to 1. expect `void *` from `jsExecutorFactoryForBridge:`, otherwise we can't pass versioned factory through unversioned and back into versioned 2. do not detect whether delegate is an instance of `RCTCxxBridgeDelegate` by protocol, but by the actual method used. This is because delegate for all bridges is always `EXReactAppManager` which is not versioned. - another change is that `EXVersionManager` now **holds strongly** one instance of the `JSCExecutorFactory` instead of just creating it on every call. I think this shouldn't break anything, as on each bridge reload we create a new instance of `EXVersionManager` and there shouldn't be more calls to `jsExecutorFactoryForBridge:` apart from when setting the bridge up, but I think it's a note-worthy mention here. - then I bumped into the `XX is not a registered callable module` error which led me to update `expotools`'s pattern for adding `EX_REMOVE_VERSION` to `MessageQueue`. # Test Plan I have verified that these fixes work on a separate branch.
- Loading branch information
Showing
5 changed files
with
36 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Submodule react-native
updated
2 files
+2 −2 | React/CxxBridge/RCTCxxBridge.mm | |
+1 −1 | React/CxxBridge/RCTCxxBridgeDelegate.h |
This file contains 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