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:
Pull Request resolved: #46809
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. `react-native-picker/picker`
2. `rnmapbox/maps`
3. `react-native-gesture-handler`
4. `react-native-screens`
5. `react-native-svg`
6. `react-native-safe-area-context`
7. `react-native-pdf`
Changelog:
[Android][Breaking] - Remove BaseViewManagerInterface
Reviewed By: cortinico
Differential Revision: D63819044
fbshipit-source-id: 7e4935c8e43706b168f0f599a6676e8abfa66937
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
@@ -4118,7 +4118,7 @@ public final class com/facebook/react/uimanager/BackgroundStyleApplicator {
4118
4118
public static final fun setOutlineWidth (Landroid/view/View;F)V
4119
4119
}
4120
4120
4121
-
public abstract class com/facebook/react/uimanager/BaseViewManager : com/facebook/react/uimanager/ViewManager, android/view/View$OnLayoutChangeListener, com/facebook/react/uimanager/BaseViewManagerInterface {
4121
+
public abstract class com/facebook/react/uimanager/BaseViewManager : com/facebook/react/uimanager/ViewManager, android/view/View$OnLayoutChangeListener {
4122
4122
public fun <init> ()V
4123
4123
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;)V
4124
4124
public fun getExportedCustomBubblingEventTypeConstants ()Ljava/util/Map;
@@ -4197,48 +4197,12 @@ public abstract class com/facebook/react/uimanager/BaseViewManager : com/faceboo
4197
4197
}
4198
4198
4199
4199
public abstract class com/facebook/react/uimanager/BaseViewManagerDelegate : com/facebook/react/uimanager/ViewManagerDelegate {
4200
-
protected final field mViewManager Lcom/facebook/react/uimanager/BaseViewManagerInterface;
4201
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
4200
+
protected final field mViewManager Lcom/facebook/react/uimanager/BaseViewManager;
4201
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
4202
4202
public fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
4203
4203
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
4204
4204
}
4205
4205
4206
-
public abstract interface class com/facebook/react/uimanager/BaseViewManagerInterface {
4207
-
public abstract fun setAccessibilityActions (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
4208
-
public abstract fun setAccessibilityCollection (Landroid/view/View;Lcom/facebook/react/bridge/ReadableMap;)V
4209
-
public abstract fun setAccessibilityCollectionItem (Landroid/view/View;Lcom/facebook/react/bridge/ReadableMap;)V
4210
-
public abstract fun setAccessibilityHint (Landroid/view/View;Ljava/lang/String;)V
4211
-
public abstract fun setAccessibilityLabel (Landroid/view/View;Ljava/lang/String;)V
4212
-
public abstract fun setAccessibilityLabelledBy (Landroid/view/View;Lcom/facebook/react/bridge/Dynamic;)V
4213
-
public abstract fun setAccessibilityLiveRegion (Landroid/view/View;Ljava/lang/String;)V
4214
-
public abstract fun setAccessibilityRole (Landroid/view/View;Ljava/lang/String;)V
4215
-
public abstract fun setBackgroundColor (Landroid/view/View;I)V
4216
-
public abstract fun setBorderBottomLeftRadius (Landroid/view/View;F)V
4217
-
public abstract fun setBorderBottomRightRadius (Landroid/view/View;F)V
4218
-
public abstract fun setBorderRadius (Landroid/view/View;F)V
4219
-
public abstract fun setBorderTopLeftRadius (Landroid/view/View;F)V
4220
-
public abstract fun setBorderTopRightRadius (Landroid/view/View;F)V
4221
-
public abstract fun setElevation (Landroid/view/View;F)V
4222
-
public abstract fun setFilter (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
4223
-
public abstract fun setImportantForAccessibility (Landroid/view/View;Ljava/lang/String;)V
4224
-
public abstract fun setMixBlendMode (Landroid/view/View;Ljava/lang/String;)V
4225
-
public abstract fun setNativeId (Landroid/view/View;Ljava/lang/String;)V
4226
-
public abstract fun setOpacity (Landroid/view/View;F)V
4227
-
public abstract fun setRenderToHardwareTexture (Landroid/view/View;Z)V
4228
-
public abstract fun setRole (Landroid/view/View;Ljava/lang/String;)V
4229
-
public abstract fun setRotation (Landroid/view/View;F)V
4230
-
public abstract fun setScaleX (Landroid/view/View;F)V
4231
-
public abstract fun setScaleY (Landroid/view/View;F)V
4232
-
public abstract fun setShadowColor (Landroid/view/View;I)V
4233
-
public abstract fun setTestId (Landroid/view/View;Ljava/lang/String;)V
4234
-
public abstract fun setTransform (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
4235
-
public abstract fun setTransformOrigin (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
4236
-
public abstract fun setTranslateX (Landroid/view/View;F)V
4237
-
public abstract fun setTranslateY (Landroid/view/View;F)V
4238
-
public abstract fun setViewState (Landroid/view/View;Lcom/facebook/react/bridge/ReadableMap;)V
4239
-
public abstract fun setZIndex (Landroid/view/View;F)V
4240
-
}
4241
-
4242
4206
public abstract interface class com/facebook/react/uimanager/ComponentNameResolver {
4243
4207
public abstract fun getComponentNames ()[Ljava/lang/String;
4244
4208
}
@@ -6307,7 +6271,7 @@ public final class com/facebook/react/util/RNLog {
6307
6271
}
6308
6272
6309
6273
public class com/facebook/react/viewmanagers/ActivityIndicatorViewManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6310
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6274
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6311
6275
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6312
6276
}
6313
6277
@@ -6319,7 +6283,7 @@ public abstract interface class com/facebook/react/viewmanagers/ActivityIndicato
6319
6283
}
6320
6284
6321
6285
public class com/facebook/react/viewmanagers/AndroidDrawerLayoutManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6322
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6286
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6323
6287
public fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
6324
6288
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6325
6289
}
@@ -6336,7 +6300,7 @@ public abstract interface class com/facebook/react/viewmanagers/AndroidDrawerLay
6336
6300
}
6337
6301
6338
6302
public class com/facebook/react/viewmanagers/AndroidHorizontalScrollContentViewManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6339
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6303
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6340
6304
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6341
6305
}
6342
6306
@@ -6345,7 +6309,7 @@ public abstract interface class com/facebook/react/viewmanagers/AndroidHorizonta
6345
6309
}
6346
6310
6347
6311
public class com/facebook/react/viewmanagers/AndroidProgressBarManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6348
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6312
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6349
6313
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6350
6314
}
6351
6315
@@ -6360,7 +6324,7 @@ public abstract interface class com/facebook/react/viewmanagers/AndroidProgressB
6360
6324
}
6361
6325
6362
6326
public class com/facebook/react/viewmanagers/AndroidSwipeRefreshLayoutManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6363
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6327
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6364
6328
public fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
6365
6329
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6366
6330
}
@@ -6376,7 +6340,7 @@ public abstract interface class com/facebook/react/viewmanagers/AndroidSwipeRefr
6376
6340
}
6377
6341
6378
6342
public class com/facebook/react/viewmanagers/AndroidSwitchManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6379
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6343
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6380
6344
public fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
6381
6345
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6382
6346
}
@@ -6395,7 +6359,7 @@ public abstract interface class com/facebook/react/viewmanagers/AndroidSwitchMan
6395
6359
}
6396
6360
6397
6361
public class com/facebook/react/viewmanagers/DebuggingOverlayManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6398
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6362
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6399
6363
public fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
6400
6364
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6401
6365
}
@@ -6407,7 +6371,7 @@ public abstract interface class com/facebook/react/viewmanagers/DebuggingOverlay
6407
6371
}
6408
6372
6409
6373
public class com/facebook/react/viewmanagers/ModalHostViewManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6410
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6374
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6411
6375
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6412
6376
}
6413
6377
@@ -6424,15 +6388,15 @@ public abstract interface class com/facebook/react/viewmanagers/ModalHostViewMan
6424
6388
}
6425
6389
6426
6390
public class com/facebook/react/viewmanagers/SafeAreaViewManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6427
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6391
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6428
6392
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
6429
6393
}
6430
6394
6431
6395
public abstract interface class com/facebook/react/viewmanagers/SafeAreaViewManagerInterface {
6432
6396
}
6433
6397
6434
6398
public class com/facebook/react/viewmanagers/UnimplementedNativeViewManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
6435
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
6399
+
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
6436
6400
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
0 commit comments