Add plugin assertion to ensure image component is loaded

Summary:
With plugins being used for components, there is danger that someone will remove buck target as dependency and component in the target won't be available for Fabric.

That's where `plugin_assertion` comes into play. For now I hardcoded a list of components. In the future, this list will be generated from JS components that are used in the app.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19197548

fbshipit-source-id: 0d31f53b573c343561715a8fb6fc7f0abfdb5b76
This commit is contained in:
Samuel Susla
2020-01-14 04:03:14 -08:00
committed by Facebook Github Bot
parent e848b0036d
commit 139bf7cffe
@@ -9,7 +9,6 @@
#import <React/RCTAssert.h>
#import <React/RCTConversions.h>
#import <glog/logging.h>
#import <better/map.h>
#import <better/mutex.h>
@@ -59,11 +58,7 @@ static Class<RCTComponentViewProtocol> RCTComponentViewClassWithName(const char
[componentViewFactory registerComponentViewClass:[RCTTextInputComponentView class]];
Class<RCTComponentViewProtocol> imageClass = RCTComponentViewClassWithName("Image");
if (imageClass) {
[componentViewFactory registerComponentViewClass:imageClass];
} else {
LOG(FATAL) << "Image component not found";
}
[componentViewFactory registerComponentViewClass:imageClass];
auto providerRegistry = &componentViewFactory->_providerRegistry;