Permalink
Browse files

add flag to enable lazy view managers

Reviewed By: achen1

Differential Revision: D3981171

fbshipit-source-id: 2f6b8370064a5835e2e3636d4c1a7f42cc28ccaf
  • Loading branch information...
1 parent d89f59d commit 1296cb29ebf4e47333047897051bf084cf158e22 @AaaChiuuu AaaChiuuu committed with Facebook Github Bot Oct 7, 2016
@@ -98,6 +98,8 @@ if (Platform.OS === 'ios') {
});
}
});
+} else if (Platform.OS === 'android' && UIManager.AndroidLazyViewManagersEnabled) {
+ // TODO fill this out
}
module.exports = UIManager;
@@ -71,9 +71,9 @@
private final UIImplementationProvider mUIImplementationProvider;
CoreModulesPackage(
- ReactInstanceManager reactInstanceManager,
- DefaultHardwareBackBtnHandler hardwareBackBtnHandler,
- UIImplementationProvider uiImplementationProvider) {
+ ReactInstanceManager reactInstanceManager,
+ DefaultHardwareBackBtnHandler hardwareBackBtnHandler,
+ UIImplementationProvider uiImplementationProvider) {
mReactInstanceManager = reactInstanceManager;
mHardwareBackBtnHandler = hardwareBackBtnHandler;
mUIImplementationProvider = uiImplementationProvider;
@@ -235,6 +235,7 @@ public static Builder builder() {
protected @Nullable DefaultHardwareBackBtnHandler mDefaultHardwareBackBtnHandler;
protected @Nullable RedBoxHandler mRedBoxHandler;
protected boolean mLazyNativeModulesEnabled;
+ protected boolean mLazyViewManagersEnabled;
protected Builder() {
}
@@ -372,6 +373,11 @@ public Builder setLazyNativeModulesEnabled(boolean lazyNativeModulesEnabled) {
return this;
}
+ public Builder setLazyViewManagersEnabled(boolean lazyViewManagersEnabled) {
+ mLazyViewManagersEnabled = lazyViewManagersEnabled;
+ return this;
+ }
+
/**
* Instantiates a new {@link ReactInstanceManagerImpl}.
* Before calling {@code build}, the following must be called:
@@ -415,7 +421,8 @@ public ReactInstanceManager build() {
mNativeModuleCallExceptionHandler,
mJSCConfig,
mRedBoxHandler,
- mLazyNativeModulesEnabled);
+ mLazyNativeModulesEnabled,
+ mLazyViewManagersEnabled);
}
}
}
@@ -86,8 +86,6 @@
import static com.facebook.react.bridge.ReactMarkerConstants.CREATE_VIEW_MANAGERS_START;
import static com.facebook.react.bridge.ReactMarkerConstants.PROCESS_PACKAGES_END;
import static com.facebook.react.bridge.ReactMarkerConstants.PROCESS_PACKAGES_START;
-import static com.facebook.react.bridge.ReactMarkerConstants.RUN_JS_BUNDLE_END;
-import static com.facebook.react.bridge.ReactMarkerConstants.RUN_JS_BUNDLE_START;
import static com.facebook.react.bridge.ReactMarkerConstants.SETUP_REACT_CONTEXT_END;
import static com.facebook.react.bridge.ReactMarkerConstants.SETUP_REACT_CONTEXT_START;
import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;
@@ -139,6 +137,7 @@
private final @Nullable NativeModuleCallExceptionHandler mNativeModuleCallExceptionHandler;
private final JSCConfig mJSCConfig;
private final boolean mLazyNativeModulesEnabled;
+ private final boolean mLazyViewManagersEnabled;
private final ReactInstanceDevCommandsHandler mDevInterface =
new ReactInstanceDevCommandsHandler() {
@@ -297,7 +296,8 @@ public T get() throws Exception {
NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler,
JSCConfig jscConfig,
@Nullable RedBoxHandler redBoxHandler,
- boolean lazyNativeModulesEnabled) {
+ boolean lazyNativeModulesEnabled,
+ boolean lazyViewManagersEnabled) {
initializeSoLoaderIfNecessary(applicationContext);
@@ -325,6 +325,7 @@ public T get() throws Exception {
mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
mJSCConfig = jscConfig;
mLazyNativeModulesEnabled = lazyNativeModulesEnabled;
+ mLazyViewManagersEnabled = lazyViewManagersEnabled;
}
@Override
@@ -857,7 +858,7 @@ private ReactApplicationContext createReactContext(
"createAndProcessCoreModulesPackage");
try {
CoreModulesPackage coreModulesPackage =
- new CoreModulesPackage(this, mBackBtnHandler, mUIImplementationProvider);
+ new CoreModulesPackage(this, mBackBtnHandler, mUIImplementationProvider);
processPackage(
coreModulesPackage,
reactContext,

0 comments on commit 1296cb2

Please sign in to comment.