-
public abstract class JSBundleLoader
A class that stores JS bundle information and allows a JSBundleLoaderDelegate (e.g. CatalystInstance) to load a correct bundle through ReactBridge.
-
-
Method Summary
Modifier and Type Method Description static JSBundleLoader
createAssetLoader(Context context, String assetUrl, boolean loadSynchronously)
This loader is recommended one for release version of your app. static JSBundleLoader
createFileLoader(String fileName)
This loader loads bundle from file system. static JSBundleLoader
createFileLoader(String fileName, String assetUrl, boolean loadSynchronously)
static JSBundleLoader
createCachedBundleFromNetworkLoader(String sourceURL, String cachedFileLocation)
This loader is used when bundle gets reloaded from dev server. static JSBundleLoader
createCachedSplitBundleFromNetworkLoader(String sourceURL, String cachedFileLocation)
Same as {createCachedBundleFromNetworkLoader}, but forsplit bundles in development. static JSBundleLoader
createRemoteDebuggerBundleLoader(String proxySourceURL, String realSourceURL)
This loader is used when proxy debugging is enabled. abstract String
loadScript(JSBundleLoaderDelegate delegate)
Loads the script, returning the URL of the source it loaded. -
-
Method Detail
-
createAssetLoader
static JSBundleLoader createAssetLoader(Context context, String assetUrl, boolean loadSynchronously)
This loader is recommended one for release version of your app. In that case local JS executorshould be used. JS bundle will be read from assets in native code to save on passing largestrings from java to native memory.
-
createFileLoader
static JSBundleLoader createFileLoader(String fileName)
This loader loads bundle from file system. The bundle will be read in native code to save onpassing large strings from java to native memory.
-
createFileLoader
static JSBundleLoader createFileLoader(String fileName, String assetUrl, boolean loadSynchronously)
-
createCachedBundleFromNetworkLoader
static JSBundleLoader createCachedBundleFromNetworkLoader(String sourceURL, String cachedFileLocation)
This loader is used when bundle gets reloaded from dev server. In that case loader expect JSbundle to be prefetched and stored in local file. We do that to avoid passing large stringsbetween java and native code and avoid allocating memory in java to fit whole JS bundle in it.Providing correct {@param sourceURL} of downloaded bundle is required for JS stacktraces towork correctly and allows for source maps to correctly symbolize those.
-
createCachedSplitBundleFromNetworkLoader
static JSBundleLoader createCachedSplitBundleFromNetworkLoader(String sourceURL, String cachedFileLocation)
Same as {createCachedBundleFromNetworkLoader}, but forsplit bundles in development.
-
createRemoteDebuggerBundleLoader
static JSBundleLoader createRemoteDebuggerBundleLoader(String proxySourceURL, String realSourceURL)
This loader is used when proxy debugging is enabled. In that case there is no point in fetchingthe bundle from device as remote executor will have to do it anyway.
-
loadScript
abstract String loadScript(JSBundleLoaderDelegate delegate)
Loads the script, returning the URL of the source it loaded.
-
-
-
-