mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-13 09:21:46 +08:00
Convert ReactPackages in FB4a to switch-case
Reviewed By: achen1 Differential Revision: D9511962 fbshipit-source-id: ea42b25f13b157866057d96d026317098e47ea63
This commit is contained in:
committed by
Facebook Github Bot
parent
0df92afc1c
commit
2f79960a69
@@ -78,7 +78,6 @@ public abstract class LazyReactPackage implements ReactPackage {
|
||||
*/
|
||||
/* package */
|
||||
Iterable<ModuleHolder> getNativeModuleIterator(final ReactApplicationContext reactContext) {
|
||||
final List<String> eagerNativeModules = getEagerNativeModules();
|
||||
final Map<String, ReactModuleInfo> reactModuleInfoMap =
|
||||
getReactModuleInfoProvider().getReactModuleInfos();
|
||||
final List<ModuleSpec> nativeModules = getNativeModules(reactContext);
|
||||
@@ -96,7 +95,7 @@ public abstract class LazyReactPackage implements ReactPackage {
|
||||
String name = moduleSpec.getName();
|
||||
ReactModuleInfo reactModuleInfo = reactModuleInfoMap.get(name);
|
||||
ModuleHolder moduleHolder;
|
||||
if (reactModuleInfo == null || eagerNativeModules.contains(name)) {
|
||||
if (reactModuleInfo == null) {
|
||||
NativeModule module;
|
||||
ReactMarker.logMarker(ReactMarkerConstants.CREATE_MODULE_START, name);
|
||||
try {
|
||||
@@ -131,11 +130,6 @@ public abstract class LazyReactPackage implements ReactPackage {
|
||||
*/
|
||||
protected abstract List<ModuleSpec> getNativeModules(ReactApplicationContext reactContext);
|
||||
|
||||
/** @return list of native modules which should be eagerly initialized. */
|
||||
protected List<String> getEagerNativeModules() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* This is only used when a LazyReactPackage is a part of {@link CompositeReactPackage} Once we
|
||||
* deprecate {@link CompositeReactPackage}, this can be removed too
|
||||
|
||||
Reference in New Issue
Block a user