Skip to content

Commit

Permalink
Deprecate BridgelessCatalystInstance class (#47385)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #47385

BridgelessCatalystInstance class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.

changelog: [Android][Changed] Deprecate BridgelessCatalystInstance class

Reviewed By: cortinico

Differential Revision: D65430789

fbshipit-source-id: 011b372c93c39862d5821713aa8f673084b52c2a
  • Loading branch information
mdvacca authored and facebook-github-bot committed Nov 5, 2024
1 parent 2168dca commit 72bd840
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ import com.facebook.react.bridge.RuntimeExecutor
import com.facebook.react.bridge.RuntimeScheduler
import com.facebook.react.bridge.UIManager
import com.facebook.react.bridge.queue.ReactQueueConfiguration
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
import com.facebook.react.common.annotations.VisibleForTesting
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModuleRegistry
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder
import com.facebook.react.turbomodule.core.interfaces.NativeMethodCallInvokerHolder

@DoNotStrip
@DeprecatedInNewArchitecture
@Deprecated(
message =
"This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.")
public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) : CatalystInstance {

override fun handleMemoryPressure(level: Int) {
Expand Down Expand Up @@ -147,23 +148,23 @@ public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) :
throw UnsupportedOperationException("Unimplemented method 'setGlobalVariable'")
}

@DeprecatedInNewArchitecture(
@Deprecated(
message =
"This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.")
"This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.")
override fun setTurboModuleRegistry(turboModuleRegistry: TurboModuleRegistry) {
throw UnsupportedOperationException("Unimplemented method 'setTurboModuleRegistry'")
}

@DeprecatedInNewArchitecture(
@Deprecated(
message =
"This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.")
"This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.")
override fun setFabricUIManager(fabricUIManager: UIManager) {
throw UnsupportedOperationException("Unimplemented method 'setFabricUIManager'")
}

@DeprecatedInNewArchitecture(
@Deprecated(
message =
"This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.")
"This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.")
override fun getFabricUIManager(): UIManager {
throw UnsupportedOperationException("Unimplemented method 'getFabricUIManager'")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class BridgelessReactContextTest {
assertThat(bridgelessReactContext.getFabricUIManager()).isEqualTo(fabricUiManager)
}

@Suppress("DEPRECATION")
@Test
fun getCatalystInstanceTest() {
assertThat(bridgelessReactContext.getCatalystInstance())
Expand Down

0 comments on commit 72bd840

Please sign in to comment.