Permalink
Browse files

Do not expose `BundleDownloader` from `DevServerHelper`

Summary:
Adds `downloadBundleFromURL` as a delegating method to `DevServerHelper` rather than exposing the underlying `BundleDownloader`.

The additional encapsulation will allow futher factoring of `BundleDownloader` to make logic for different delta bundler clients easier to implement and maintain.

Reviewed By: pakoito

Differential Revision: D6871225

fbshipit-source-id: 6adcab5e69869a234baf38f1f1e60abd34d6b555
  • Loading branch information...
davidaurelio authored and facebook-github-bot committed Feb 5, 2018
1 parent d4517dd commit 108f9664bffd1a4e0a7b2c2da3dc3810f1b29de2
@@ -19,6 +19,7 @@
import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.common.network.OkHttpCallUtil;
import com.facebook.react.devsupport.interfaces.DevBundleDownloadListener;
import com.facebook.react.devsupport.interfaces.PackagerStatusCallback;
import com.facebook.react.devsupport.interfaces.StackFrame;
import com.facebook.react.modules.systeminfo.AndroidInfoHelpers;
@@ -391,8 +392,10 @@ public String getInspectorAttachUrl(String title) {
AndroidInfoHelpers.getFriendlyDeviceName());
}
public BundleDownloader getBundleDownloader() {
return mBundleDownloader;
public void downloadBundleFromURL(
DevBundleDownloadListener callback,
File outputFile, String bundleURL, BundleDownloader.BundleInfo bundleInfo) {
mBundleDownloader.downloadBundleFromURL(callback, outputFile, bundleURL, bundleInfo);
}
/**
@@ -1039,7 +1039,7 @@ public void reloadJSFromServer(final String bundleURL) {
final BundleDownloader.BundleInfo bundleInfo = new BundleDownloader.BundleInfo();
mDevServerHelper.getBundleDownloader().downloadBundleFromURL(
mDevServerHelper.downloadBundleFromURL(
new DevBundleDownloadListener() {
@Override
public void onSuccess() {

0 comments on commit 108f966

Please sign in to comment.