Skip to content

Commit

Permalink
Do not expose BundleDownloader from DevServerHelper
Browse files Browse the repository at this point in the history
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 108f966
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 108f966

Please sign in to comment.