Setup experiment for split packages

Reviewed By: javache

Differential Revision: D5314224

fbshipit-source-id: b9bc28b8f4e058db1dcc0c17f7dc84bf15eb33f9
This commit is contained in:
Kathy Gray 2017-07-04 03:54:57 -07:00 коммит произвёл Facebook Github Bot
Родитель e301a36606
Коммит 3525998884
2 изменённых файлов: 11 добавлений и 3 удалений

Просмотреть файл

@ -223,7 +223,8 @@ public class ReactInstanceManager {
@Nullable DevBundleDownloadListener devBundleDownloadListener, @Nullable DevBundleDownloadListener devBundleDownloadListener,
boolean setupReactContextInBackgroundEnabled, boolean setupReactContextInBackgroundEnabled,
boolean useSeparateUIBackgroundThread, boolean useSeparateUIBackgroundThread,
int minNumShakes) { int minNumShakes,
boolean splitPackagesEnabled) {
Log.d(ReactConstants.TAG, "ReactInstanceManager.ctor()"); Log.d(ReactConstants.TAG, "ReactInstanceManager.ctor()");
initializeSoLoaderIfNecessary(applicationContext); initializeSoLoaderIfNecessary(applicationContext);
@ -256,7 +257,7 @@ public class ReactInstanceManager {
mUseSeparateUIBackgroundThread = useSeparateUIBackgroundThread; mUseSeparateUIBackgroundThread = useSeparateUIBackgroundThread;
mMinNumShakes = minNumShakes; mMinNumShakes = minNumShakes;
if (true) { // TODO Change to a QE-determined experiment variable in separate commit if (!splitPackagesEnabled) {
CoreModulesPackage coreModulesPackage = CoreModulesPackage coreModulesPackage =
new CoreModulesPackage( new CoreModulesPackage(
this, this,

Просмотреть файл

@ -47,6 +47,7 @@ public class ReactInstanceManagerBuilder {
protected boolean mSetupReactContextInBackground; protected boolean mSetupReactContextInBackground;
protected boolean mUseSeparateUIBackgroundThread; protected boolean mUseSeparateUIBackgroundThread;
protected int mMinNumShakes = 1; protected int mMinNumShakes = 1;
protected boolean mEnableSplitPackage;
/* package protected */ ReactInstanceManagerBuilder() { /* package protected */ ReactInstanceManagerBuilder() {
} }
@ -213,6 +214,11 @@ public class ReactInstanceManagerBuilder {
return this; return this;
} }
public ReactInstanceManagerBuilder setEnableSplitPackage(boolean enableSplitPackage) {
mEnableSplitPackage = enableSplitPackage;
return this;
}
/** /**
* Instantiates a new {@link ReactInstanceManager}. * Instantiates a new {@link ReactInstanceManager}.
* Before calling {@code build}, the following must be called: * Before calling {@code build}, the following must be called:
@ -262,6 +268,7 @@ public class ReactInstanceManagerBuilder {
mDevBundleDownloadListener, mDevBundleDownloadListener,
mSetupReactContextInBackground, mSetupReactContextInBackground,
mUseSeparateUIBackgroundThread, mUseSeparateUIBackgroundThread,
mMinNumShakes); mMinNumShakes,
mEnableSplitPackage);
} }
} }