Remove getEagerNativeModules()
Summary: An experiment was added to A/B test eager modules. Removing this experiment, as the next diff on this stack has a different way to add eager modules per route. Reviewed By: achen1 Differential Revision: D9685803 fbshipit-source-id: ca6c91ca377b6dfaf5accda1e1f6bbfe17b1d616
This commit is contained in:
parent
6da93a302e
commit
27348f0f07
|
@ -25,17 +25,6 @@ public abstract class TurboReactPackage implements ReactPackage {
|
||||||
"In case of TurboModules, createNativeModules is not supported. NativeModuleRegistry should instead use getModuleList or getModule method");
|
"In case of TurboModules, createNativeModules is not supported. NativeModuleRegistry should instead use getModuleList or getModule method");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This is only a temporary method to test the impact of initializing some modules eagerly. This
|
|
||||||
* will deleted whenn
|
|
||||||
* qe_react_native_startup_module_optimization.eager_init_current_viewer_native_module is removed
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
protected List<String> getEagerNativeModules() {
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The API needed for TurboModules. Given a module name, it returns an instance of {@link
|
* The API needed for TurboModules. Given a module name, it returns an instance of {@link
|
||||||
* NativeModule} for the name
|
* NativeModule} for the name
|
||||||
|
@ -60,7 +49,6 @@ public abstract class TurboReactPackage implements ReactPackage {
|
||||||
final Set<Map.Entry<String, ReactModuleInfo>> entrySet =
|
final Set<Map.Entry<String, ReactModuleInfo>> entrySet =
|
||||||
getReactModuleInfoProvider().getReactModuleInfos().entrySet();
|
getReactModuleInfoProvider().getReactModuleInfos().entrySet();
|
||||||
final Iterator<Map.Entry<String, ReactModuleInfo>> entrySetIterator = entrySet.iterator();
|
final Iterator<Map.Entry<String, ReactModuleInfo>> entrySetIterator = entrySet.iterator();
|
||||||
final List<String> eagerNativeModules = getEagerNativeModules();
|
|
||||||
return new Iterable<ModuleHolder>() {
|
return new Iterable<ModuleHolder>() {
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
|
@ -77,12 +65,7 @@ public abstract class TurboReactPackage implements ReactPackage {
|
||||||
Map.Entry<String, ReactModuleInfo> entry = entrySetIterator.next();
|
Map.Entry<String, ReactModuleInfo> entry = entrySetIterator.next();
|
||||||
String name = entry.getKey();
|
String name = entry.getKey();
|
||||||
ReactModuleInfo reactModuleInfo = entry.getValue();
|
ReactModuleInfo reactModuleInfo = entry.getValue();
|
||||||
if (eagerNativeModules.contains(name)) {
|
return new ModuleHolder(reactModuleInfo, new ModuleHolderProvider(name, reactContext));
|
||||||
return new ModuleHolder(getModule(name, reactContext));
|
|
||||||
} else {
|
|
||||||
return new ModuleHolder(
|
|
||||||
reactModuleInfo, new ModuleHolderProvider(name, reactContext));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue