Skip to content

Commit 108f966

Browse files
davidaureliofacebook-github-bot
authored andcommitted
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
1 parent d4517dd commit 108f966

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.facebook.react.bridge.UiThreadUtil;
2020
import com.facebook.react.common.ReactConstants;
2121
import com.facebook.react.common.network.OkHttpCallUtil;
22+
import com.facebook.react.devsupport.interfaces.DevBundleDownloadListener;
2223
import com.facebook.react.devsupport.interfaces.PackagerStatusCallback;
2324
import com.facebook.react.devsupport.interfaces.StackFrame;
2425
import com.facebook.react.modules.systeminfo.AndroidInfoHelpers;
@@ -391,8 +392,10 @@ public String getInspectorAttachUrl(String title) {
391392
AndroidInfoHelpers.getFriendlyDeviceName());
392393
}
393394

394-
public BundleDownloader getBundleDownloader() {
395-
return mBundleDownloader;
395+
public void downloadBundleFromURL(
396+
DevBundleDownloadListener callback,
397+
File outputFile, String bundleURL, BundleDownloader.BundleInfo bundleInfo) {
398+
mBundleDownloader.downloadBundleFromURL(callback, outputFile, bundleURL, bundleInfo);
396399
}
397400

398401
/**

ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ public void reloadJSFromServer(final String bundleURL) {
10391039

10401040
final BundleDownloader.BundleInfo bundleInfo = new BundleDownloader.BundleInfo();
10411041

1042-
mDevServerHelper.getBundleDownloader().downloadBundleFromURL(
1042+
mDevServerHelper.downloadBundleFromURL(
10431043
new DevBundleDownloadListener() {
10441044
@Override
10451045
public void onSuccess() {

0 commit comments

Comments
 (0)