Skip to content

Commit

Permalink
Setup experiment for split packages
Browse files Browse the repository at this point in the history
Reviewed By: javache

Differential Revision: D5314224

fbshipit-source-id: b9bc28b8f4e058db1dcc0c17f7dc84bf15eb33f9
  • Loading branch information
Kathy Gray authored and facebook-github-bot committed Jul 4, 2017
1 parent e301a36 commit 3525998
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Expand Up @@ -223,7 +223,8 @@ public static ReactInstanceManagerBuilder builder() {
@Nullable DevBundleDownloadListener devBundleDownloadListener,
boolean setupReactContextInBackgroundEnabled,
boolean useSeparateUIBackgroundThread,
int minNumShakes) {
int minNumShakes,
boolean splitPackagesEnabled) {
Log.d(ReactConstants.TAG, "ReactInstanceManager.ctor()");
initializeSoLoaderIfNecessary(applicationContext);

Expand Down Expand Up @@ -256,7 +257,7 @@ public static ReactInstanceManagerBuilder builder() {
mUseSeparateUIBackgroundThread = useSeparateUIBackgroundThread;
mMinNumShakes = minNumShakes;

if (true) { // TODO Change to a QE-determined experiment variable in separate commit
if (!splitPackagesEnabled) {
CoreModulesPackage coreModulesPackage =
new CoreModulesPackage(
this,
Expand Down
Expand Up @@ -47,6 +47,7 @@ public class ReactInstanceManagerBuilder {
protected boolean mSetupReactContextInBackground;
protected boolean mUseSeparateUIBackgroundThread;
protected int mMinNumShakes = 1;
protected boolean mEnableSplitPackage;

/* package protected */ ReactInstanceManagerBuilder() {
}
Expand Down Expand Up @@ -213,6 +214,11 @@ public ReactInstanceManagerBuilder setMinNumShakes(int minNumShakes) {
return this;
}

public ReactInstanceManagerBuilder setEnableSplitPackage(boolean enableSplitPackage) {
mEnableSplitPackage = enableSplitPackage;
return this;
}

/**
* Instantiates a new {@link ReactInstanceManager}.
* Before calling {@code build}, the following must be called:
Expand Down Expand Up @@ -262,6 +268,7 @@ public ReactInstanceManager build() {
mDevBundleDownloadListener,
mSetupReactContextInBackground,
mUseSeparateUIBackgroundThread,
mMinNumShakes);
mMinNumShakes,
mEnableSplitPackage);
}
}

0 comments on commit 3525998

Please sign in to comment.