Remove the flag about Lazy native modules

Summary: The method removes all settings for mLazyReactModules since Lazy and non lazy modules can exist in a single application now

Reviewed By: achen1

Differential Revision: D9012312

fbshipit-source-id: 0420149654f8146453250d83d4de4b4c2fd31e9f
This commit is contained in:
Ram N 2018-08-02 15:50:03 -07:00 committed by Facebook Github Bot
parent 42146a7a4a
commit 407e033b34
4 changed files with 4 additions and 21 deletions

View File

@ -54,8 +54,7 @@ public class ReactTestHelper {
if (mNativeModuleRegistryBuilder == null) {
mNativeModuleRegistryBuilder = new NativeModuleRegistryBuilder(
(ReactApplicationContext) mContext,
null,
false);
null);
}
Assertions.assertNotNull(nativeModule);
mNativeModuleRegistryBuilder.addNativeModule(nativeModule);
@ -67,8 +66,7 @@ public class ReactTestHelper {
if (mNativeModuleRegistryBuilder == null) {
mNativeModuleRegistryBuilder = new NativeModuleRegistryBuilder(
(ReactApplicationContext) mContext,
null,
false);
null);
}
JavaScriptExecutor executor = null;
try {

View File

@ -30,19 +30,15 @@ public class NativeModuleRegistryBuilder {
private final ReactApplicationContext mReactApplicationContext;
private final ReactInstanceManager mReactInstanceManager;
private final boolean mLazyNativeModulesEnabled;
private final Map<String, ModuleHolder> mModules = new HashMap<>();
private final Map<String,String> namesToType = new HashMap<>();
public NativeModuleRegistryBuilder(
ReactApplicationContext reactApplicationContext,
ReactInstanceManager reactInstanceManager,
boolean lazyNativeModulesEnabled) {
ReactInstanceManager reactInstanceManager) {
mReactApplicationContext = reactApplicationContext;
mReactInstanceManager = reactInstanceManager;
// TODO T32034141 Remove mLazyNativeModulesEnabled
mLazyNativeModulesEnabled = lazyNativeModulesEnabled;
}
public void processPackage(ReactPackage reactPackage) {

View File

@ -158,7 +158,6 @@ public class ReactInstanceManager {
private volatile Boolean mHasStartedDestroying = false;
private final MemoryPressureRouter mMemoryPressureRouter;
private final @Nullable NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler;
private final boolean mLazyNativeModulesEnabled;
private final @Nullable JSIModulePackage mJSIModulePackage;
private List<ViewManager> mViewManagers;
@ -202,7 +201,6 @@ public class ReactInstanceManager {
LifecycleState initialLifecycleState,
NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler,
@Nullable RedBoxHandler redBoxHandler,
boolean lazyNativeModulesEnabled,
boolean lazyViewManagersEnabled,
@Nullable DevBundleDownloadListener devBundleDownloadListener,
int minNumShakes,
@ -236,7 +234,6 @@ public class ReactInstanceManager {
mLifecycleState = initialLifecycleState;
mMemoryPressureRouter = new MemoryPressureRouter(applicationContext);
mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
mLazyNativeModulesEnabled = lazyNativeModulesEnabled;
synchronized (mPackages) {
PrinterHolder.getPrinter()
.logMessage(ReactDebugOverlayTags.RN_CORE, "RNCore: Use Split Packages");
@ -1126,8 +1123,7 @@ public class ReactInstanceManager {
boolean checkAndUpdatePackageMembership) {
NativeModuleRegistryBuilder nativeModuleRegistryBuilder = new NativeModuleRegistryBuilder(
reactContext,
this,
mLazyNativeModulesEnabled);
this);
ReactMarker.logMarker(PROCESS_PACKAGES_START);

View File

@ -45,7 +45,6 @@ public class ReactInstanceManagerBuilder {
private @Nullable Activity mCurrentActivity;
private @Nullable DefaultHardwareBackBtnHandler mDefaultHardwareBackBtnHandler;
private @Nullable RedBoxHandler mRedBoxHandler;
private boolean mLazyNativeModulesEnabled;
private boolean mLazyViewManagersEnabled;
private @Nullable DevBundleDownloadListener mDevBundleDownloadListener;
private @Nullable JavaScriptExecutorFactory mJavaScriptExecutorFactory;
@ -192,11 +191,6 @@ public class ReactInstanceManagerBuilder {
return this;
}
public ReactInstanceManagerBuilder setLazyNativeModulesEnabled(boolean lazyNativeModulesEnabled) {
mLazyNativeModulesEnabled = lazyNativeModulesEnabled;
return this;
}
public ReactInstanceManagerBuilder setLazyViewManagersEnabled(boolean lazyViewManagersEnabled) {
mLazyViewManagersEnabled = lazyViewManagersEnabled;
return this;
@ -270,7 +264,6 @@ public class ReactInstanceManagerBuilder {
Assertions.assertNotNull(mInitialLifecycleState, "Initial lifecycle state was not set"),
mNativeModuleCallExceptionHandler,
mRedBoxHandler,
mLazyNativeModulesEnabled,
mLazyViewManagersEnabled,
mDevBundleDownloadListener,
mMinNumShakes,