mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Decouple JSBundleLoader from CatalystInstanceImpl
Summary: Right now JSBundleLoader is tightly coupled to CatalystInstanceImpl; this diffs adds an interface, JSBundleLoaderDelegate, that CatalystInstanceImpl implements so that we can use the bundle loader with other classes. Reviewed By: mdvacca Differential Revision: D13216752 fbshipit-source-id: fc406ef30f12ed9d3ed13a062dedd7b33f3b7985
This commit is contained in:
committed by
Facebook Github Bot
parent
668341a294
commit
a2ead1c7b5
@@ -201,17 +201,8 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||
Collection<JavaModuleWrapper> javaModules,
|
||||
Collection<ModuleHolder> cxxModules);
|
||||
|
||||
/**
|
||||
* This API is used in situations where the JS bundle is being executed not on
|
||||
* the device, but on a host machine. In that case, we must provide two source
|
||||
* URLs for the JS bundle: One to be used on the device, and one to be used on
|
||||
* the remote debugging machine.
|
||||
*
|
||||
* @param deviceURL A source URL that is accessible from this device.
|
||||
* @param remoteURL A source URL that is accessible from the remote machine
|
||||
* executing the JS.
|
||||
*/
|
||||
/* package */ void setSourceURLs(String deviceURL, String remoteURL) {
|
||||
@Override
|
||||
public void setSourceURLs(String deviceURL, String remoteURL) {
|
||||
mSourceURL = deviceURL;
|
||||
jniSetSourceURL(remoteURL);
|
||||
}
|
||||
@@ -221,17 +212,20 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||
jniRegisterSegment(segmentId, path);
|
||||
}
|
||||
|
||||
/* package */ void loadScriptFromAssets(AssetManager assetManager, String assetURL, boolean loadSynchronously) {
|
||||
@Override
|
||||
public void loadScriptFromAssets(AssetManager assetManager, String assetURL, boolean loadSynchronously) {
|
||||
mSourceURL = assetURL;
|
||||
jniLoadScriptFromAssets(assetManager, assetURL, loadSynchronously);
|
||||
}
|
||||
|
||||
/* package */ void loadScriptFromFile(String fileName, String sourceURL, boolean loadSynchronously) {
|
||||
@Override
|
||||
public void loadScriptFromFile(String fileName, String sourceURL, boolean loadSynchronously) {
|
||||
mSourceURL = sourceURL;
|
||||
jniLoadScriptFromFile(fileName, sourceURL, loadSynchronously);
|
||||
}
|
||||
|
||||
/* package */ void loadScriptFromDeltaBundle(
|
||||
@Override
|
||||
public void loadScriptFromDeltaBundle(
|
||||
String sourceURL,
|
||||
NativeDeltaClient deltaClient,
|
||||
boolean loadSynchronously) {
|
||||
|
||||
Reference in New Issue
Block a user