Introduce mobile config flag to load classes for View Managers

Reviewed By: kathryngray

Differential Revision: D6148468

fbshipit-source-id: d0f919f63922dae4b0720f22fa70ab4a7f67b48a
This commit is contained in:
Dmitry Zakharov
2017-10-26 08:51:11 -07:00
committed by Facebook Github Bot
parent 55f75dfd65
commit f0fb720eaa
10 changed files with 269 additions and 211 deletions
@@ -18,11 +18,17 @@ public interface ViewManagerOnDemandReactPackage {
/**
* Provides a list of names of ViewManagers with which these modules can be accessed from JS.
* Typically, this is ViewManager.getName().
*
* @param loadClasses defines if View Managers classes should be loaded or be avoided.
*/
List<String> getViewManagerNames(ReactApplicationContext reactContext);
List<String> getViewManagerNames(ReactApplicationContext reactContext, boolean loadClasses);
/**
* Creates and returns a ViewManager with a specific name {@param viewManagerName}. It's up to
* an implementing package how to interpret the name.
* Creates and returns a ViewManager with a specific name {@param viewManagerName}. It's up to an
* implementing package how to interpret the name.
*
* @param loadClasses defines if View Managers classes should be loaded or be avoided.
*/
@Nullable ViewManager createViewManager(ReactApplicationContext reactContext, String viewManagerName);
@Nullable
ViewManager createViewManager(
ReactApplicationContext reactContext, String viewManagerName, boolean loadClasses);
}