mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-21 19:11:22 +08:00
add API to CatalystInstanceImpl for executing optimized bundle
Reviewed By: tadeuzagallo Differential Revision: D3545345 fbshipit-source-id: 538fec77b816c3fd767e8c2eda81c78971996b17
This commit is contained in:
committed by
Facebook Github Bot 2
parent
a665914d18
commit
1331e20db5
@@ -30,18 +30,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user