Fix optimized bundle stuff.

Reviewed By: davidaurelio, tadeuzagallo

Differential Revision: D3563710

fbshipit-source-id: 2b0a982d388ee5f44b806f8e561ef49a3fd8c8ca
This commit is contained in:
Michał Gregorczyk authored and Facebook Github Bot 7 committed 2016-07-14 15:28:46 -07:00
1 parent 0c0ac6e21c
commit 3c0f428f05
18 files changed
+200 -158

No files matched your search

@@ -38,6 +38,12 @@ import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;
*/
public class UnpackingJSBundleLoader extends JSBundleLoader {
/**
* Flag passed to loadScriptFromOptimizedBundle to let the bridge know that
* the unpacked unpacked js source file.
*/
static final int UNPACKED_JS_SOURCE = (1 << 0);
/**
* Name of the lock files. Multiple processes can be spawned off the same app
* and we need to guarantee that at most one unpacks files at any time. To
@@ -141,10 +147,10 @@ public class UnpackingJSBundleLoader extends JSBundleLoader {
@Override
public void loadScript(CatalystInstanceImpl instance) {
prepare();
// TODO(12128379): add instance method that would take bundle directory
instance.loadScriptFromFile(
new File(mDirectoryPath, "bundle.js").getPath(),
mSourceURL);
instance.loadScriptFromOptimizedBundle(
mDirectoryPath.getPath(),
mSourceURL,
UNPACKED_JS_SOURCE);
}
@Override