Skip to content

Commit da74d5d

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Deprecate Legacy Architecture ViewManagers (#53107)
Summary: Pull Request resolved: #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
1 parent 07091a9 commit da74d5d

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.kt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ import com.facebook.react.views.scroll.ReactScrollViewManager
5656
import com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
5757
import com.facebook.react.views.switchview.ReactSwitchManager
5858
import com.facebook.react.views.text.PreparedLayoutTextViewManager
59-
import com.facebook.react.views.text.ReactRawTextManager
6059
import com.facebook.react.views.text.ReactTextViewManager
61-
import com.facebook.react.views.text.ReactVirtualTextViewManager
6260
import com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
6361
import com.facebook.react.views.textinput.ReactTextInputManager
6462
import com.facebook.react.views.unimplementedview.ReactUnimplementedViewManager
@@ -133,6 +131,7 @@ constructor(private val config: MainPackageConfig? = null) :
133131
else -> null
134132
}
135133

134+
@Suppress("DEPRECATION")
136135
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> =
137136
listOf(
138137
ReactDrawerLayoutManager(),
@@ -147,18 +146,19 @@ constructor(private val config: MainPackageConfig? = null) :
147146
FrescoBasedReactTextInlineImageViewManager(),
148147
ReactImageManager(),
149148
ReactModalHostManager(),
150-
ReactRawTextManager(),
149+
com.facebook.react.views.text.ReactRawTextManager(),
151150
ReactTextInputManager(),
152151
if (ReactNativeFeatureFlags.enablePreparedTextLayout()) PreparedLayoutTextViewManager()
153152
else ReactTextViewManager(),
154153
ReactViewManager(),
155-
ReactVirtualTextViewManager(),
154+
com.facebook.react.views.text.ReactVirtualTextViewManager(),
156155
ReactUnimplementedViewManager())
157156

158157
/**
159158
* A map of view managers that should be registered with
160159
* [com.facebook.react.uimanager.UIManagerModule]
161160
*/
161+
@Suppress("DEPRECATION")
162162
@SuppressLint("VisibleForTests")
163163
public val viewManagersMap: Map<String, ModuleSpec> =
164164
mapOf(
@@ -182,7 +182,8 @@ constructor(private val config: MainPackageConfig? = null) :
182182
ReactImageManager.REACT_CLASS to ModuleSpec.viewManagerSpec { ReactImageManager() },
183183
ReactModalHostManager.REACT_CLASS to
184184
ModuleSpec.viewManagerSpec { ReactModalHostManager() },
185-
ReactRawTextManager.REACT_CLASS to ModuleSpec.viewManagerSpec { ReactRawTextManager() },
185+
com.facebook.react.views.text.ReactRawTextManager.REACT_CLASS to
186+
ModuleSpec.viewManagerSpec { com.facebook.react.views.text.ReactRawTextManager() },
186187
ReactTextInputManager.REACT_CLASS to
187188
ModuleSpec.viewManagerSpec { ReactTextInputManager() },
188189
ReactTextViewManager.REACT_CLASS to
@@ -192,8 +193,10 @@ constructor(private val config: MainPackageConfig? = null) :
192193
else ReactTextViewManager()
193194
},
194195
ReactViewManager.REACT_CLASS to ModuleSpec.viewManagerSpec { ReactViewManager() },
195-
ReactVirtualTextViewManager.REACT_CLASS to
196-
ModuleSpec.viewManagerSpec { ReactVirtualTextViewManager() },
196+
com.facebook.react.views.text.ReactVirtualTextViewManager.REACT_CLASS to
197+
ModuleSpec.viewManagerSpec {
198+
com.facebook.react.views.text.ReactVirtualTextViewManager()
199+
},
197200
ReactUnimplementedViewManager.REACT_CLASS to
198201
ModuleSpec.viewManagerSpec { ReactUnimplementedViewManager() })
199202

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactRawTextManager.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ import com.facebook.react.uimanager.ViewManager
2222
*/
2323
@ReactModule(name = ReactRawTextManager.REACT_CLASS)
2424
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
25+
@Deprecated(
26+
message = "This class is part of Legacy Architecture and will be removed in a future release",
27+
level = DeprecationLevel.WARNING)
2528
internal class ReactRawTextManager : ViewManager<View, ReactRawTextShadowNode>() {
2629

2730
override fun getName(): String {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactVirtualTextViewManager.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ import com.facebook.react.uimanager.ThemedReactContext
2222
@Suppress("DEPRECATION")
2323
@ReactModule(name = ReactVirtualTextViewManager.REACT_CLASS)
2424
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
25+
@Deprecated(
26+
message = "This class is part of Legacy Architecture and will be removed in a future release",
27+
level = DeprecationLevel.WARNING)
2528
internal class ReactVirtualTextViewManager : BaseViewManager<View, ReactVirtualTextShadowNode>() {
2629

2730
override fun getName(): String = REACT_CLASS

0 commit comments

Comments
 (0)