Deprecate Legacy Architecture ViewManagers (#53107)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53107

Deprecate Legacy Architecture ViewManagers, these classes are not used as part of the new architecture and will be deleted in the future

changelog: [Android][Changed] Deprecate Legacy Architecture ViewManagers, these classes are not used as part of the new architecture and will be deleted in the future

Reviewed By: shwanton

Differential Revision: D79676585

fbshipit-source-id: 72cb6fe0bbe666cfa317cf28d6aec475f1c38c35
This commit is contained in:
David Vacca
2025-08-09 04:39:35 -07:00
committed by Facebook GitHub Bot
parent 07091a9ae8
commit da74d5da2c
3 changed files with 16 additions and 7 deletions
@@ -56,9 +56,7 @@ import com.facebook.react.views.scroll.ReactScrollViewManager
import com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
import com.facebook.react.views.switchview.ReactSwitchManager
import com.facebook.react.views.text.PreparedLayoutTextViewManager
import com.facebook.react.views.text.ReactRawTextManager
import com.facebook.react.views.text.ReactTextViewManager
import com.facebook.react.views.text.ReactVirtualTextViewManager
import com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
import com.facebook.react.views.textinput.ReactTextInputManager
import com.facebook.react.views.unimplementedview.ReactUnimplementedViewManager
@@ -133,6 +131,7 @@ constructor(private val config: MainPackageConfig? = null) :
else -> null
}
@Suppress("DEPRECATION")
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> =
listOf(
ReactDrawerLayoutManager(),
@@ -147,18 +146,19 @@ constructor(private val config: MainPackageConfig? = null) :
FrescoBasedReactTextInlineImageViewManager(),
ReactImageManager(),
ReactModalHostManager(),
ReactRawTextManager(),
com.facebook.react.views.text.ReactRawTextManager(),
ReactTextInputManager(),
if (ReactNativeFeatureFlags.enablePreparedTextLayout()) PreparedLayoutTextViewManager()
else ReactTextViewManager(),
ReactViewManager(),
ReactVirtualTextViewManager(),
com.facebook.react.views.text.ReactVirtualTextViewManager(),
ReactUnimplementedViewManager())
/**
* A map of view managers that should be registered with
* [com.facebook.react.uimanager.UIManagerModule]
*/
@Suppress("DEPRECATION")
@SuppressLint("VisibleForTests")
public val viewManagersMap: Map<String, ModuleSpec> =
mapOf(
@@ -182,7 +182,8 @@ constructor(private val config: MainPackageConfig? = null) :
ReactImageManager.REACT_CLASS to ModuleSpec.viewManagerSpec { ReactImageManager() },
ReactModalHostManager.REACT_CLASS to
ModuleSpec.viewManagerSpec { ReactModalHostManager() },
ReactRawTextManager.REACT_CLASS to ModuleSpec.viewManagerSpec { ReactRawTextManager() },
com.facebook.react.views.text.ReactRawTextManager.REACT_CLASS to
ModuleSpec.viewManagerSpec { com.facebook.react.views.text.ReactRawTextManager() },
ReactTextInputManager.REACT_CLASS to
ModuleSpec.viewManagerSpec { ReactTextInputManager() },
ReactTextViewManager.REACT_CLASS to
@@ -192,8 +193,10 @@ constructor(private val config: MainPackageConfig? = null) :
else ReactTextViewManager()
},
ReactViewManager.REACT_CLASS to ModuleSpec.viewManagerSpec { ReactViewManager() },
ReactVirtualTextViewManager.REACT_CLASS to
ModuleSpec.viewManagerSpec { ReactVirtualTextViewManager() },
com.facebook.react.views.text.ReactVirtualTextViewManager.REACT_CLASS to
ModuleSpec.viewManagerSpec {
com.facebook.react.views.text.ReactVirtualTextViewManager()
},
ReactUnimplementedViewManager.REACT_CLASS to
ModuleSpec.viewManagerSpec { ReactUnimplementedViewManager() })
@@ -22,6 +22,9 @@ import com.facebook.react.uimanager.ViewManager
*/
@ReactModule(name = ReactRawTextManager.REACT_CLASS)
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
@Deprecated(
message = "This class is part of Legacy Architecture and will be removed in a future release",
level = DeprecationLevel.WARNING)
internal class ReactRawTextManager : ViewManager<View, ReactRawTextShadowNode>() {
override fun getName(): String {
@@ -22,6 +22,9 @@ import com.facebook.react.uimanager.ThemedReactContext
@Suppress("DEPRECATION")
@ReactModule(name = ReactVirtualTextViewManager.REACT_CLASS)
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
@Deprecated(
message = "This class is part of Legacy Architecture and will be removed in a future release",
level = DeprecationLevel.WARNING)
internal class ReactVirtualTextViewManager : BaseViewManager<View, ReactVirtualTextShadowNode>() {
override fun getName(): String = REACT_CLASS