mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove unused loadSplitBundleFromServer
Summary: This code is not referenced internally or externally and was part of the DevSplitBundleLoader which was removed in D43597007. Changelog: [Android][Breaking][Removed] Removed loadSplitBundleFromServer from DevSupportManager interface Reviewed By: cortinico Differential Revision: D72790533 fbshipit-source-id: 9e0960af4c528d9019943c89466ab442f34619e1
This commit is contained in:
committed by
Facebook GitHub Bot
parent
bf8d6da101
commit
86cd31eb6b
@@ -1936,7 +1936,6 @@ public final class com/facebook/react/defaults/DefaultTurboModuleManagerDelegate
|
||||
public final class com/facebook/react/devsupport/BridgeDevSupportManager : com/facebook/react/devsupport/DevSupportManagerBase {
|
||||
public fun <init> (Landroid/content/Context;Lcom/facebook/react/devsupport/ReactInstanceDevHelper;Ljava/lang/String;ZLcom/facebook/react/devsupport/interfaces/RedBoxHandler;Lcom/facebook/react/devsupport/interfaces/DevBundleDownloadListener;ILjava/util/Map;Lcom/facebook/react/common/SurfaceDelegateFactory;Lcom/facebook/react/devsupport/interfaces/DevLoadingViewManager;Lcom/facebook/react/devsupport/interfaces/PausedInDebuggerOverlayManager;)V
|
||||
public fun handleReloadJS ()V
|
||||
public fun loadSplitBundleFromServer (Ljava/lang/String;Lcom/facebook/react/devsupport/interfaces/DevSplitBundleCallback;)V
|
||||
}
|
||||
|
||||
public final class com/facebook/react/devsupport/BundleDownloader {
|
||||
@@ -2125,7 +2124,6 @@ public class com/facebook/react/devsupport/ReleaseDevSupportManager : com/facebo
|
||||
public fun hidePausedInDebuggerOverlay ()V
|
||||
public fun hideRedboxDialog ()V
|
||||
public fun isPackagerRunning (Lcom/facebook/react/devsupport/interfaces/PackagerStatusCallback;)V
|
||||
public fun loadSplitBundleFromServer (Ljava/lang/String;Lcom/facebook/react/devsupport/interfaces/DevSplitBundleCallback;)V
|
||||
public fun onNewReactContextCreated (Lcom/facebook/react/bridge/ReactContext;)V
|
||||
public fun onReactInstanceDestroyed (Lcom/facebook/react/bridge/ReactContext;)V
|
||||
public fun openDebugger ()V
|
||||
@@ -2202,11 +2200,6 @@ public abstract interface class com/facebook/react/devsupport/interfaces/DevOpti
|
||||
public abstract fun onOptionSelected ()V
|
||||
}
|
||||
|
||||
public abstract interface class com/facebook/react/devsupport/interfaces/DevSplitBundleCallback {
|
||||
public abstract fun onError (Ljava/lang/String;Ljava/lang/Throwable;)V
|
||||
public abstract fun onSuccess ()V
|
||||
}
|
||||
|
||||
public abstract interface class com/facebook/react/devsupport/interfaces/DevSupportManager : com/facebook/react/bridge/JSExceptionHandler {
|
||||
public abstract fun addCustomDevOption (Ljava/lang/String;Lcom/facebook/react/devsupport/interfaces/DevOptionHandler;)V
|
||||
public abstract fun createRootView (Ljava/lang/String;)Landroid/view/View;
|
||||
@@ -2230,7 +2223,6 @@ public abstract interface class com/facebook/react/devsupport/interfaces/DevSupp
|
||||
public abstract fun hidePausedInDebuggerOverlay ()V
|
||||
public abstract fun hideRedboxDialog ()V
|
||||
public abstract fun isPackagerRunning (Lcom/facebook/react/devsupport/interfaces/PackagerStatusCallback;)V
|
||||
public abstract fun loadSplitBundleFromServer (Ljava/lang/String;Lcom/facebook/react/devsupport/interfaces/DevSplitBundleCallback;)V
|
||||
public abstract fun onNewReactContextCreated (Lcom/facebook/react/bridge/ReactContext;)V
|
||||
public abstract fun onReactInstanceDestroyed (Lcom/facebook/react/bridge/ReactContext;)V
|
||||
public abstract fun openDebugger ()V
|
||||
|
||||
-22
@@ -11,7 +11,6 @@ import android.content.Context
|
||||
import com.facebook.debug.holder.PrinterHolder.printer
|
||||
import com.facebook.debug.tags.ReactDebugOverlayTags
|
||||
import com.facebook.infer.annotation.Assertions
|
||||
import com.facebook.react.bridge.JSBundleLoader
|
||||
import com.facebook.react.bridge.ReactMarker
|
||||
import com.facebook.react.bridge.ReactMarkerConstants
|
||||
import com.facebook.react.bridge.UiThreadUtil
|
||||
@@ -21,7 +20,6 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger.assertLegacyArchitecture
|
||||
import com.facebook.react.devsupport.interfaces.DevBundleDownloadListener
|
||||
import com.facebook.react.devsupport.interfaces.DevLoadingViewManager
|
||||
import com.facebook.react.devsupport.interfaces.DevSplitBundleCallback
|
||||
import com.facebook.react.devsupport.interfaces.PausedInDebuggerOverlayManager
|
||||
import com.facebook.react.devsupport.interfaces.RedBoxHandler
|
||||
import com.facebook.react.packagerconnection.RequestHandler
|
||||
@@ -77,26 +75,6 @@ public class BridgeDevSupportManager(
|
||||
override val uniqueTag: String
|
||||
get() = "Bridge"
|
||||
|
||||
override fun loadSplitBundleFromServer(bundlePath: String, callback: DevSplitBundleCallback) {
|
||||
fetchSplitBundleAndCreateBundleLoader(
|
||||
bundlePath,
|
||||
object : CallbackWithBundleLoader {
|
||||
override fun onSuccess(bundleLoader: JSBundleLoader) {
|
||||
val context =
|
||||
requireNotNull(currentReactContext) {
|
||||
"Failed to load split bundle from server due to DevSupportManager.currentReactContext being null"
|
||||
}
|
||||
bundleLoader.loadScript(context.catalystInstance)
|
||||
context
|
||||
.getJSModule(HMRClient::class.java)
|
||||
.registerBundle(devServerHelper.getDevServerSplitBundleURL(bundlePath))
|
||||
callback.onSuccess()
|
||||
}
|
||||
|
||||
override fun onError(url: String, cause: Throwable) = callback.onError(url, cause)
|
||||
})
|
||||
}
|
||||
|
||||
override fun handleReloadJS() {
|
||||
UiThreadUtil.assertOnUiThread()
|
||||
ReactMarker.logMarker(
|
||||
|
||||
-24
@@ -8,12 +8,10 @@
|
||||
package com.facebook.react.devsupport
|
||||
|
||||
import android.content.Context
|
||||
import com.facebook.react.bridge.JSBundleLoader
|
||||
import com.facebook.react.bridge.UiThreadUtil
|
||||
import com.facebook.react.common.SurfaceDelegateFactory
|
||||
import com.facebook.react.devsupport.interfaces.DevBundleDownloadListener
|
||||
import com.facebook.react.devsupport.interfaces.DevLoadingViewManager
|
||||
import com.facebook.react.devsupport.interfaces.DevSplitBundleCallback
|
||||
import com.facebook.react.devsupport.interfaces.DevSupportManager
|
||||
import com.facebook.react.devsupport.interfaces.PausedInDebuggerOverlayManager
|
||||
import com.facebook.react.devsupport.interfaces.RedBoxHandler
|
||||
@@ -74,28 +72,6 @@ internal class BridgelessDevSupportManager(
|
||||
override val uniqueTag: String
|
||||
get() = "Bridgeless"
|
||||
|
||||
override fun loadSplitBundleFromServer(bundlePath: String, callback: DevSplitBundleCallback) {
|
||||
fetchSplitBundleAndCreateBundleLoader(
|
||||
bundlePath,
|
||||
object : CallbackWithBundleLoader {
|
||||
override fun onSuccess(bundleLoader: JSBundleLoader) {
|
||||
try {
|
||||
reactInstanceDevHelper.loadBundle(bundleLoader).waitForCompletion()
|
||||
val bundleURL = devServerHelper.getDevServerSplitBundleURL(bundlePath)
|
||||
val reactContext = reactInstanceDevHelper.currentReactContext
|
||||
reactContext?.getJSModule(HMRClient::class.java)?.registerBundle(bundleURL)
|
||||
callback.onSuccess()
|
||||
} catch (e: InterruptedException) {
|
||||
Thread.currentThread().interrupt()
|
||||
throw RuntimeException(
|
||||
"[BridgelessDevSupportManager]: Got interrupted while loading bundle", e)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(url: String, cause: Throwable) = callback.onError(url, cause)
|
||||
})
|
||||
}
|
||||
|
||||
override fun handleReloadJS() {
|
||||
UiThreadUtil.assertOnUiThread()
|
||||
// dismiss redbox if exists
|
||||
|
||||
-6
@@ -17,7 +17,6 @@ import com.facebook.react.bridge.ReadableArray
|
||||
import com.facebook.react.common.SurfaceDelegate
|
||||
import com.facebook.react.devsupport.interfaces.BundleLoadCallback
|
||||
import com.facebook.react.devsupport.interfaces.DevOptionHandler
|
||||
import com.facebook.react.devsupport.interfaces.DevSplitBundleCallback
|
||||
import com.facebook.react.devsupport.interfaces.DevSupportManager
|
||||
import com.facebook.react.devsupport.interfaces.DevSupportManager.PackagerLocationCustomizer
|
||||
import com.facebook.react.devsupport.interfaces.DevSupportManager.PausedInDebuggerOverlayCommandListener
|
||||
@@ -101,11 +100,6 @@ public open class ReleaseDevSupportManager : DevSupportManager {
|
||||
public override fun reloadJSFromServer(bundleURL: String, callback: BundleLoadCallback): Unit =
|
||||
Unit
|
||||
|
||||
public override fun loadSplitBundleFromServer(
|
||||
bundlePath: String,
|
||||
callback: DevSplitBundleCallback
|
||||
): Unit = Unit
|
||||
|
||||
public override fun isPackagerRunning(callback: PackagerStatusCallback) {
|
||||
callback.onPackagerStatusFetched(false)
|
||||
}
|
||||
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.devsupport.interfaces
|
||||
|
||||
/** Callback class for loading split JS bundles from Metro in development. */
|
||||
public interface DevSplitBundleCallback {
|
||||
/** Called when the split JS bundle has been downloaded and evaluated. */
|
||||
public fun onSuccess()
|
||||
|
||||
/** Called when the split JS bundle failed to load. */
|
||||
public fun onError(url: String?, cause: Throwable?)
|
||||
}
|
||||
-2
@@ -68,8 +68,6 @@ public interface DevSupportManager : JSExceptionHandler {
|
||||
|
||||
public fun reloadJSFromServer(bundleURL: String, callback: BundleLoadCallback)
|
||||
|
||||
public fun loadSplitBundleFromServer(bundlePath: String, callback: DevSplitBundleCallback)
|
||||
|
||||
public fun isPackagerRunning(callback: PackagerStatusCallback)
|
||||
|
||||
public fun setHotModuleReplacementEnabled(isHotModuleReplacementEnabled: Boolean)
|
||||
|
||||
Reference in New Issue
Block a user