You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
BaseViewManagerInterface isn't adding much value right now. It was added in D16984121 to allow codegen generated ViewManager delegates to apply to view managers which derive from ViewMangager instead of BaseViewManager (if they did some cleverness, to make VM delegate apply to a no-op class, still implementing all of BaseViewManager's methods).
All of the cases where that was used have since been moved to `SimpleViewManager`, and `BaseViewManagerAdapter` (needed to wire this together) doesn't exist anymore, so it's not possible to take any advantage of this interface existing. We should remove it, since its existence is a source of error (e.g. it was missing setters for `accessibilityValue` or those related to pointer events), and is more generally confusing for anyone adding to `BaseViewManager` in the future.
This is a breaking change, because there are some libraries which vendor a copy of generated ViewManagerDelegate when building against legacy arch to be able to share code normally generated at build time. That means these will need to be updated to maintain compatibility with RN versions of 0.77+ with new arch disabled. This will not effect compatibility of these libraries against the default new arch, and the updated delegate is still compatible with older RN version.
```
sourceSets.main {
java {
if (!isNewArchitectureEnabled()) {
srcDirs += [
"src/paper/java",
]
}
}
}
```
1. `rnmapbox/maps`
2. `react-native-gesture-handler`
3. `react-native-screens`
4. `react-native-svg`
5. `react-native-safe-area-context`
6. `react-native-pdf`
Changelog:
[Android][Breaking] - Remove BaseViewManagerInterface
Differential Revision: D63819044
Copy file name to clipboardExpand all lines: packages/react-native-codegen/e2e/__tests__/components/__snapshots__/GeneratePropsJavaDelegate-test.js.snap
Copy file name to clipboardExpand all lines: packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ package ${packageName};
55
55
56
56
${imports}
57
57
58
-
public class ${className}<T extends ${extendClasses}, U extends BaseViewManagerInterface<T> & ${interfaceClassName}<T>> extends BaseViewManagerDelegate<T, U> {
58
+
public class ${className}<T extends ${extendClasses}, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ${interfaceClassName}<T>> extends BaseViewManagerDelegate<T, U> {
59
59
public ${className}(U viewManager) {
60
60
super(viewManager);
61
61
}
@@ -272,7 +272,8 @@ function getDelegateImports(component: ComponentShape) {
Copy file name to clipboardExpand all lines: packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaDelegate-test.js.snap
Copy file name to clipboardExpand all lines: packages/react-native-popup-menu-android/android/src/main/java/com/facebook/react/viewmanagers/AndroidPopupMenuManagerDelegate.java
Copy file name to clipboardExpand all lines: packages/react-native-test-library/android/src/main/java/com/facebook/react/viewmanagers/SampleNativeComponentManagerDelegate.java
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/api/ReactAndroid.api
+13-49Lines changed: 13 additions & 49 deletions
Original file line number
Diff line number
Diff line change
@@ -4108,7 +4108,7 @@ public final class com/facebook/react/uimanager/BackgroundStyleApplicator {
4108
4108
public static final fun setOutlineWidth (Landroid/view/View;F)V
4109
4109
}
4110
4110
4111
-
public abstract class com/facebook/react/uimanager/BaseViewManager : com/facebook/react/uimanager/ViewManager, android/view/View$OnLayoutChangeListener, com/facebook/react/uimanager/BaseViewManagerInterface {
4111
+
public abstract class com/facebook/react/uimanager/BaseViewManager : com/facebook/react/uimanager/ViewManager, android/view/View$OnLayoutChangeListener {
4112
4112
public fun <init> ()V
4113
4113
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;)V
4114
4114
public fun getExportedCustomBubblingEventTypeConstants ()Ljava/util/Map;
@@ -4187,48 +4187,12 @@ public abstract class com/facebook/react/uimanager/BaseViewManager : com/faceboo
4187
4187
}
4188
4188
4189
4189
public abstract class com/facebook/react/uimanager/BaseViewManagerDelegate : com/facebook/react/uimanager/ViewManagerDelegate {
4190
-
protected final field mViewManager Lcom/facebook/react/uimanager/BaseViewManagerInterface;
4191
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
4190
+
protected final field mViewManager Lcom/facebook/react/uimanager/BaseViewManager;
4191
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
4192
4192
public fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
4193
4193
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
4194
4194
}
4195
4195
4196
-
public abstract interface class com/facebook/react/uimanager/BaseViewManagerInterface {
4197
-
public abstract fun setAccessibilityActions (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
4198
-
public abstract fun setAccessibilityCollection (Landroid/view/View;Lcom/facebook/react/bridge/ReadableMap;)V
4199
-
public abstract fun setAccessibilityCollectionItem (Landroid/view/View;Lcom/facebook/react/bridge/ReadableMap;)V
4200
-
public abstract fun setAccessibilityHint (Landroid/view/View;Ljava/lang/String;)V
4201
-
public abstract fun setAccessibilityLabel (Landroid/view/View;Ljava/lang/String;)V
4202
-
public abstract fun setAccessibilityLabelledBy (Landroid/view/View;Lcom/facebook/react/bridge/Dynamic;)V
4203
-
public abstract fun setAccessibilityLiveRegion (Landroid/view/View;Ljava/lang/String;)V
4204
-
public abstract fun setAccessibilityRole (Landroid/view/View;Ljava/lang/String;)V
4205
-
public abstract fun setBackgroundColor (Landroid/view/View;I)V
4206
-
public abstract fun setBorderBottomLeftRadius (Landroid/view/View;F)V
4207
-
public abstract fun setBorderBottomRightRadius (Landroid/view/View;F)V
4208
-
public abstract fun setBorderRadius (Landroid/view/View;F)V
4209
-
public abstract fun setBorderTopLeftRadius (Landroid/view/View;F)V
4210
-
public abstract fun setBorderTopRightRadius (Landroid/view/View;F)V
4211
-
public abstract fun setElevation (Landroid/view/View;F)V
4212
-
public abstract fun setFilter (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
4213
-
public abstract fun setImportantForAccessibility (Landroid/view/View;Ljava/lang/String;)V
4214
-
public abstract fun setMixBlendMode (Landroid/view/View;Ljava/lang/String;)V
4215
-
public abstract fun setNativeId (Landroid/view/View;Ljava/lang/String;)V
4216
-
public abstract fun setOpacity (Landroid/view/View;F)V
4217
-
public abstract fun setRenderToHardwareTexture (Landroid/view/View;Z)V
4218
-
public abstract fun setRole (Landroid/view/View;Ljava/lang/String;)V
4219
-
public abstract fun setRotation (Landroid/view/View;F)V
4220
-
public abstract fun setScaleX (Landroid/view/View;F)V
4221
-
public abstract fun setScaleY (Landroid/view/View;F)V
4222
-
public abstract fun setShadowColor (Landroid/view/View;I)V
4223
-
public abstract fun setTestId (Landroid/view/View;Ljava/lang/String;)V
4224
-
public abstract fun setTransform (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
4225
-
public abstract fun setTransformOrigin (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
4226
-
public abstract fun setTranslateX (Landroid/view/View;F)V
4227
-
public abstract fun setTranslateY (Landroid/view/View;F)V
4228
-
public abstract fun setViewState (Landroid/view/View;Lcom/facebook/react/bridge/ReadableMap;)V
4229
-
public abstract fun setZIndex (Landroid/view/View;F)V
4230
-
}
4231
-
4232
4196
public abstract interface class com/facebook/react/uimanager/ComponentNameResolver {
4233
4197
public abstract fun getComponentNames ()[Ljava/lang/String;
4234
4198
}
@@ -6297,7 +6261,7 @@ public final class com/facebook/react/util/RNLog {
6297
6261
}
6298
6262
6299
6263
public class com/facebook/react/viewmanagers/ActivityIndicatorViewManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6300
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6264
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6301
6265
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6302
6266
}
6303
6267
@@ -6309,7 +6273,7 @@ public abstract interface class com/facebook/react/viewmanagers/ActivityIndicato
6309
6273
}
6310
6274
6311
6275
public class com/facebook/react/viewmanagers/AndroidDrawerLayoutManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6312
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6276
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6313
6277
public fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
6314
6278
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6315
6279
}
@@ -6326,7 +6290,7 @@ public abstract interface class com/facebook/react/viewmanagers/AndroidDrawerLay
6326
6290
}
6327
6291
6328
6292
public class com/facebook/react/viewmanagers/AndroidHorizontalScrollContentViewManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6329
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6293
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6330
6294
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6331
6295
}
6332
6296
@@ -6335,7 +6299,7 @@ public abstract interface class com/facebook/react/viewmanagers/AndroidHorizonta
6335
6299
}
6336
6300
6337
6301
public class com/facebook/react/viewmanagers/AndroidProgressBarManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6338
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6302
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6339
6303
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6340
6304
}
6341
6305
@@ -6350,7 +6314,7 @@ public abstract interface class com/facebook/react/viewmanagers/AndroidProgressB
6350
6314
}
6351
6315
6352
6316
public class com/facebook/react/viewmanagers/AndroidSwipeRefreshLayoutManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6353
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6317
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6354
6318
public fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
6355
6319
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6356
6320
}
@@ -6366,7 +6330,7 @@ public abstract interface class com/facebook/react/viewmanagers/AndroidSwipeRefr
6366
6330
}
6367
6331
6368
6332
public class com/facebook/react/viewmanagers/AndroidSwitchManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6369
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6333
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6370
6334
public fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
6371
6335
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6372
6336
}
@@ -6385,7 +6349,7 @@ public abstract interface class com/facebook/react/viewmanagers/AndroidSwitchMan
6385
6349
}
6386
6350
6387
6351
public class com/facebook/react/viewmanagers/DebuggingOverlayManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6388
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6352
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6389
6353
public fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
6390
6354
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6391
6355
}
@@ -6397,7 +6361,7 @@ public abstract interface class com/facebook/react/viewmanagers/DebuggingOverlay
6397
6361
}
6398
6362
6399
6363
public class com/facebook/react/viewmanagers/ModalHostViewManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6400
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6364
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6401
6365
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6402
6366
}
6403
6367
@@ -6414,15 +6378,15 @@ public abstract interface class com/facebook/react/viewmanagers/ModalHostViewMan
6414
6378
}
6415
6379
6416
6380
public class com/facebook/react/viewmanagers/SafeAreaViewManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6417
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6381
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6418
6382
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6419
6383
}
6420
6384
6421
6385
public abstract interface class com/facebook/react/viewmanagers/SafeAreaViewManagerInterface {
6422
6386
}
6423
6387
6424
6388
public class com/facebook/react/viewmanagers/UnimplementedNativeViewManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6425
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6389
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6426
6390
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
0 commit comments