Finish lazilyLoadView

Summary:
This API was used by the old architecture to lazily register/load components:
1. Load a ViewManager's class from the disk
2. Register the ViewManager's class with React Native

See: [RCTUIManager lazilyLoadView](https://github.com/facebook/react-native/blob/822bf52c29729d25b2bfb31655cf773609a9283d/packages/react-native/React/Modules/RCTUIManager.m#L1546-L1591)

The new architecture **does not** support lazy loading of **legacy** modules/components.

Therefore, let's leave this API unimplemented until we decide to implement lazy loading of legacy stuff in new architecture.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D52677515

fbshipit-source-id: 8d49a0b54f901a3e9b3e8a9578ebb0c81de522d8
This commit is contained in:
Ramanpreet Nara
2024-01-25 16:56:49 -08:00
committed by Facebook GitHub Bot
parent 3c6c282c0a
commit 4636029aca
4 changed files with 8 additions and 0 deletions
@@ -245,6 +245,11 @@ const UIManagerJSPlatformAPIs = Platform.select({
},
},
ios: {
/**
* TODO(T174674274): Implement lazy loading of legacy view managers in the new architecture.
*
* Leave this unimplemented until we implement lazy loading of legacy modules and view managers in the new architecture.
*/
lazilyLoadView: (name: string): Object => {
raiseSoftError('lazilyLoadView');
return {};
@@ -130,6 +130,7 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
}
// Step 3: check if the module has been registered
// TODO(T174674274): Implement lazy loading of legacy view managers in the new architecture.
NSArray<Class> *registeredModules = RCTGetModuleClasses();
NSMutableDictionary<NSString *, Class> *supportedLegacyViewComponents =
[RCTLegacyViewManagerInteropComponentView _supportedLegacyViewComponents];
@@ -135,6 +135,7 @@ static Class<RCTComponentViewProtocol> RCTComponentViewClassWithName(const char
}
// Fallback 3: Try to use Paper Interop.
// TODO(T174674274): Implement lazy loading of legacy view managers in the new architecture.
if (RCTFabricInteropLayerEnabled() && [RCTLegacyViewManagerInteropComponentView isSupported:componentNameString]) {
RCTLogNewArchitectureValidation(
RCTNotAllowedInBridgeless,
@@ -231,6 +231,7 @@ static Class getFallbackClassFromName(const char *name)
}
if (RCTTurboModuleInteropEnabled()) {
// TODO(T174674274): Implement lazy loading of legacy modules in the new architecture.
NSMutableDictionary<NSString *, id<RCTBridgeModule>> *legacyInitializedModules = [NSMutableDictionary new];
if ([_delegate respondsToSelector:@selector(extraModulesForBridge:)]) {