Reverted commit D3207541

Reviewed By: michalgr

Differential Revision: D3207541

fbshipit-source-id: 36366188b7cb74c51d4aa974abd4a648498bcf78
This commit is contained in:
Clement Genzmer
2016-07-07 14:46:12 -07:00
committed by Facebook Github Bot 2
parent 6565edc9ed
commit 80c23ae324
11 changed files with 46 additions and 287 deletions

View File

@@ -412,12 +412,9 @@ import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;
}
private void recreateReactContextInBackgroundFromBundleFile() {
boolean useLazyBundle = mJSCConfig.getConfigMap().hasKey("useLazyBundle") ?
mJSCConfig.getConfigMap().getBoolean("useLazyBundle") : false;
recreateReactContextInBackground(
new JSCJavaScriptExecutor.Factory(mJSCConfig.getConfigMap()),
JSBundleLoader.createFileLoader(mApplicationContext, mJSBundleFile, useLazyBundle));
JSBundleLoader.createFileLoader(mApplicationContext, mJSBundleFile));
}
/**

View File

@@ -161,7 +161,7 @@ public class CatalystInstanceImpl implements CatalystInstance {
MessageQueueThread moduleQueue,
ModuleRegistryHolder registryHolder);
/* package */ native void loadScriptFromAssets(AssetManager assetManager, String assetURL, boolean useLazyBundle);
/* package */ native void loadScriptFromAssets(AssetManager assetManager, String assetURL);
/* package */ native void loadScriptFromFile(String fileName, String sourceURL);
@Override

View File

@@ -28,18 +28,11 @@ public abstract class JSBundleLoader {
public static JSBundleLoader createFileLoader(
final Context context,
final String fileName) {
return createFileLoader(context, fileName, false);
}
public static JSBundleLoader createFileLoader(
final Context context,
final String fileName,
final boolean useLazyBundle) {
return new JSBundleLoader() {
@Override
public void loadScript(CatalystInstanceImpl instance) {
if (fileName.startsWith("assets://")) {
instance.loadScriptFromAssets(context.getAssets(), fileName, useLazyBundle);
instance.loadScriptFromAssets(context.getAssets(), fileName);
} else {
instance.loadScriptFromFile(fileName, fileName);
}