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

View File

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

View File

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

View File

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