react-native 0.83.0-rc.0 → 0.84.0-nightly-20251106-de5141a3d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/Libraries/AppDelegate/RCTReactNativeFactory.h +3 -0
  2. package/Libraries/AppDelegate/RCTReactNativeFactory.mm +12 -0
  3. package/Libraries/AppDelegate/RCTRootViewFactory.h +10 -4
  4. package/Libraries/AppDelegate/RCTRootViewFactory.mm +21 -5
  5. package/Libraries/Blob/RCTBlobManager.mm +4 -1
  6. package/Libraries/Blob/RCTFileReaderModule.mm +4 -1
  7. package/Libraries/Core/ReactNativeVersion.js +2 -2
  8. package/Libraries/Image/RCTBundleAssetImageLoader.mm +4 -1
  9. package/Libraries/Image/RCTGIFImageDecoder.mm +4 -1
  10. package/Libraries/Image/RCTImageEditingManager.mm +4 -1
  11. package/Libraries/Image/RCTImageLoader.mm +4 -1
  12. package/Libraries/Image/RCTImageStoreManager.mm +4 -1
  13. package/Libraries/Image/RCTImageViewManager.mm +4 -1
  14. package/Libraries/Image/RCTLocalAssetImageLoader.mm +4 -1
  15. package/Libraries/LinkingIOS/RCTLinkingManager.mm +4 -1
  16. package/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm +4 -1
  17. package/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm +4 -1
  18. package/Libraries/Network/RCTDataRequestHandler.mm +4 -1
  19. package/Libraries/Network/RCTFileRequestHandler.mm +4 -1
  20. package/Libraries/Network/RCTHTTPRequestHandler.mm +4 -1
  21. package/Libraries/Network/RCTNetworking.mm +4 -1
  22. package/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm +4 -1
  23. package/Libraries/Settings/RCTSettingsManager.mm +4 -1
  24. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +2 -2
  25. package/Libraries/Text/BaseText/RCTBaseTextViewManager.mm +4 -1
  26. package/Libraries/Text/RawText/RCTRawTextViewManager.mm +4 -1
  27. package/Libraries/Text/Text/RCTTextViewManager.mm +4 -1
  28. package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm +4 -1
  29. package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +3 -0
  30. package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm +4 -1
  31. package/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm +4 -1
  32. package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm +4 -1
  33. package/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm +4 -1
  34. package/Libraries/Vibration/RCTVibration.mm +4 -1
  35. package/React/Base/RCTBundleManager.h +59 -7
  36. package/React/Base/RCTBundleManager.m +98 -0
  37. package/React/Base/RCTBundleURLProvider.h +24 -0
  38. package/React/Base/RCTBundleURLProvider.mm +49 -4
  39. package/React/Base/RCTVersion.m +2 -2
  40. package/React/CoreModules/RCTAccessibilityManager.mm +4 -1
  41. package/React/CoreModules/RCTActionSheetManager.mm +4 -1
  42. package/React/CoreModules/RCTAlertManager.mm +4 -1
  43. package/React/CoreModules/RCTAppState.mm +4 -1
  44. package/React/CoreModules/RCTAppearance.mm +4 -1
  45. package/React/CoreModules/RCTClipboard.mm +4 -1
  46. package/React/CoreModules/RCTDevLoadingView.mm +4 -1
  47. package/React/CoreModules/RCTDevMenu.mm +4 -1
  48. package/React/CoreModules/RCTDevSettings.mm +4 -1
  49. package/React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm +5 -1
  50. package/React/CoreModules/RCTDeviceInfo.mm +4 -1
  51. package/React/CoreModules/RCTEventDispatcher.mm +4 -1
  52. package/React/CoreModules/RCTExceptionsManager.mm +4 -1
  53. package/React/CoreModules/RCTI18nManager.mm +4 -1
  54. package/React/CoreModules/RCTKeyboardObserver.mm +4 -1
  55. package/React/CoreModules/RCTLogBox.mm +4 -1
  56. package/React/CoreModules/RCTPerfMonitor.mm +4 -1
  57. package/React/CoreModules/RCTPlatform.mm +7 -3
  58. package/React/CoreModules/RCTRedBox.mm +4 -1
  59. package/React/CoreModules/RCTSourceCode.mm +4 -1
  60. package/React/CoreModules/RCTStatusBarManager.mm +4 -1
  61. package/React/CoreModules/RCTTiming.mm +4 -1
  62. package/React/CoreModules/RCTWebSocketModule.mm +4 -1
  63. package/React/CoreModules/React-CoreModules.podspec +1 -0
  64. package/React/CxxBridge/RCTCxxBridge.mm +1 -2
  65. package/React/CxxModule/RCTCxxUtils.mm +1 -11
  66. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +135 -143
  67. package/React/Fabric/Surface/RCTFabricSurface.mm +1 -1
  68. package/React/Modules/RCTUIManager.mm +4 -1
  69. package/React/Runtime/React-RCTRuntime.podspec +1 -0
  70. package/React/Views/RCTActivityIndicatorViewManager.m +4 -1
  71. package/React/Views/RCTDebuggingOverlayManager.m +4 -1
  72. package/React/Views/RCTModalHostViewManager.m +4 -1
  73. package/React/Views/RCTModalManager.m +4 -1
  74. package/React/Views/RCTSwitchManager.m +4 -1
  75. package/React/Views/RCTViewManager.m +4 -1
  76. package/React/Views/RefreshControl/RCTRefreshControlManager.m +4 -1
  77. package/React/Views/SafeAreaView/RCTSafeAreaViewManager.m +4 -1
  78. package/React/Views/ScrollView/RCTScrollContentViewManager.m +4 -1
  79. package/React/Views/ScrollView/RCTScrollViewManager.m +4 -1
  80. package/ReactAndroid/gradle.properties +1 -1
  81. package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.kt +7 -7
  82. package/ReactAndroid/src/main/java/com/facebook/react/ViewManagerOnDemandReactPackage.kt +53 -4
  83. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.kt +99 -9
  84. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/InspectorNetworkHelper.kt +1 -1
  85. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayManager.kt +22 -1
  86. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayView.kt +4 -3
  87. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +8 -14
  88. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +11 -21
  89. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +3 -5
  90. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +3 -5
  91. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +12 -23
  92. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +3 -5
  93. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +2 -2
  94. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.kt +1 -2
  95. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAxOrderHelper.kt +47 -0
  96. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.kt +3 -36
  97. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.kt +5 -4
  98. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +27 -3
  99. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +11 -2
  100. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +11 -1
  101. package/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionWebSocket.cpp +29 -2
  102. package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp +36 -26
  103. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +15 -29
  104. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +4 -7
  105. package/ReactAndroid/src/main/jni/react/jni/JSLoader.cpp +1 -1
  106. package/ReactAndroid/src/main/jni/react/jni/JSLoader.h +2 -1
  107. package/ReactAndroid/src/main/res/devsupport/drawable/ic_perf_issue.xml +10 -0
  108. package/ReactCommon/cxxreact/JSBigString.h +14 -5
  109. package/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp +4 -5
  110. package/ReactCommon/cxxreact/React-cxxreact.podspec +1 -0
  111. package/ReactCommon/cxxreact/ReactNativeVersion.h +3 -3
  112. package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +1 -0
  113. package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +2 -3
  114. package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h +2 -2
  115. package/ReactCommon/jsinspector-modern/PerfMonitorV2.cpp +9 -1
  116. package/ReactCommon/jsinspector-modern/PerfMonitorV2.h +4 -1
  117. package/ReactCommon/jsinspector-modern/TracingAgent.cpp +1 -7
  118. package/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp +3 -55
  119. package/ReactCommon/jsinspector-modern/tests/TracingTest.h +82 -0
  120. package/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp +99 -0
  121. package/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h +47 -1
  122. package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +4 -0
  123. package/ReactCommon/jsitooling/React-jsitooling.podspec +1 -0
  124. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +5 -9
  125. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +7 -12
  126. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +85 -103
  127. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +4 -6
  128. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +5 -9
  129. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +10 -19
  130. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +2 -3
  131. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +4 -27
  132. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +6 -11
  133. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +3 -5
  134. package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm +4 -1
  135. package/ReactCommon/react/performance/cdpmetrics/CdpPerfIssuesReporter.cpp +4 -2
  136. package/ReactCommon/react/renderer/css/CSSSyntaxParser.h +7 -0
  137. package/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp +0 -20
  138. package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +3 -3
  139. package/ReactCommon/react/renderer/scheduler/SurfaceManager.cpp +2 -3
  140. package/ReactCommon/react/runtime/ReactInstance.cpp +4 -4
  141. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.h +3 -2
  142. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +10 -6
  143. package/ReactCommon/react/utils/React-utils.podspec +3 -1
  144. package/ReactCommon/yoga/yoga/style/StyleLength.h +7 -0
  145. package/ReactCommon/yoga/yoga/style/StyleSizeLength.h +7 -0
  146. package/package.json +10 -9
  147. package/sdks/hermes-engine/version.properties +1 -1
  148. package/src/private/components/virtualview/VirtualView.js +16 -9
  149. package/src/private/components/virtualview/logger/VirtualViewLogger.js +21 -0
  150. package/src/private/components/virtualview/logger/VirtualViewLoggerTypes.js +24 -0
  151. package/src/private/featureflags/ReactNativeFeatureFlags.js +7 -12
  152. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -3
  153. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +48 -0
  154. package/types_generated/src/private/components/virtualview/VirtualView.d.ts +3 -1
  155. package/React/CxxModule/RCTCxxModule.h +0 -29
  156. package/React/CxxModule/RCTCxxModule.mm +0 -87
  157. package/sdks/.hermesversion +0 -1
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<6f6b5abe79764b88cf3ed62fe0230786>>
7
+ * @generated SignedSource<<9bb9a7cf89c92f5a397b2328fa983dc6>>
8
8
  */
9
9
 
10
10
  /**
@@ -32,6 +32,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
32
32
  private var disableFabricCommitInCXXAnimatedCache: Boolean? = null
33
33
  private var disableMountItemReorderingAndroidCache: Boolean? = null
34
34
  private var disableOldAndroidAttachmentMetricsWorkaroundsCache: Boolean? = null
35
+ private var disableSubviewClippingAndroidCache: Boolean? = null
35
36
  private var disableTextLayoutManagerCacheAndroidCache: Boolean? = null
36
37
  private var enableAccessibilityOrderCache: Boolean? = null
37
38
  private var enableAccumulatedUpdatesInRawPropsAndroidCache: Boolean? = null
@@ -89,7 +90,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
89
90
  private var shouldPressibilityUseW3CPointerEventsForHoverCache: Boolean? = null
90
91
  private var shouldTriggerResponderTransferOnScrollAndroidCache: Boolean? = null
91
92
  private var skipActivityIdentityAssertionOnHostPauseCache: Boolean? = null
92
- private var sweepActiveTouchOnChildNativeGesturesAndroidCache: Boolean? = null
93
93
  private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
94
94
  private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
95
95
  private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
@@ -97,7 +97,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
97
97
  private var useNativeEqualsInNativeReadableArrayAndroidCache: Boolean? = null
98
98
  private var useNativeTransformHelperAndroidCache: Boolean? = null
99
99
  private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
100
- private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
101
100
  private var useRawPropsJsiValueCache: Boolean? = null
102
101
  private var useShadowNodeStateOnCloneCache: Boolean? = null
103
102
  private var useSharedAnimatedBackendCache: Boolean? = null
@@ -188,6 +187,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
188
187
  return cached
189
188
  }
190
189
 
190
+ override fun disableSubviewClippingAndroid(): Boolean {
191
+ var cached = disableSubviewClippingAndroidCache
192
+ if (cached == null) {
193
+ cached = currentProvider.disableSubviewClippingAndroid()
194
+ accessedFeatureFlags.add("disableSubviewClippingAndroid")
195
+ disableSubviewClippingAndroidCache = cached
196
+ }
197
+ return cached
198
+ }
199
+
191
200
  override fun disableTextLayoutManagerCacheAndroid(): Boolean {
192
201
  var cached = disableTextLayoutManagerCacheAndroidCache
193
202
  if (cached == null) {
@@ -758,16 +767,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
758
767
  return cached
759
768
  }
760
769
 
761
- override fun sweepActiveTouchOnChildNativeGesturesAndroid(): Boolean {
762
- var cached = sweepActiveTouchOnChildNativeGesturesAndroidCache
763
- if (cached == null) {
764
- cached = currentProvider.sweepActiveTouchOnChildNativeGesturesAndroid()
765
- accessedFeatureFlags.add("sweepActiveTouchOnChildNativeGesturesAndroid")
766
- sweepActiveTouchOnChildNativeGesturesAndroidCache = cached
767
- }
768
- return cached
769
- }
770
-
771
770
  override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean {
772
771
  var cached = traceTurboModulePromiseRejectionsOnAndroidCache
773
772
  if (cached == null) {
@@ -838,16 +837,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
838
837
  return cached
839
838
  }
840
839
 
841
- override fun useOptimizedEventBatchingOnAndroid(): Boolean {
842
- var cached = useOptimizedEventBatchingOnAndroidCache
843
- if (cached == null) {
844
- cached = currentProvider.useOptimizedEventBatchingOnAndroid()
845
- accessedFeatureFlags.add("useOptimizedEventBatchingOnAndroid")
846
- useOptimizedEventBatchingOnAndroidCache = cached
847
- }
848
- return cached
849
- }
850
-
851
840
  override fun useRawPropsJsiValue(): Boolean {
852
841
  var cached = useRawPropsJsiValueCache
853
842
  if (cached == null) {
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<6b61490a8d6b1df1d6264016455382f8>>
7
+ * @generated SignedSource<<eeb5d70e45eecdef0d9307cbe8ff17c2>>
8
8
  */
9
9
 
10
10
  /**
@@ -39,6 +39,8 @@ public interface ReactNativeFeatureFlagsProvider {
39
39
 
40
40
  @DoNotStrip public fun disableOldAndroidAttachmentMetricsWorkarounds(): Boolean
41
41
 
42
+ @DoNotStrip public fun disableSubviewClippingAndroid(): Boolean
43
+
42
44
  @DoNotStrip public fun disableTextLayoutManagerCacheAndroid(): Boolean
43
45
 
44
46
  @DoNotStrip public fun enableAccessibilityOrder(): Boolean
@@ -153,8 +155,6 @@ public interface ReactNativeFeatureFlagsProvider {
153
155
 
154
156
  @DoNotStrip public fun skipActivityIdentityAssertionOnHostPause(): Boolean
155
157
 
156
- @DoNotStrip public fun sweepActiveTouchOnChildNativeGesturesAndroid(): Boolean
157
-
158
158
  @DoNotStrip public fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean
159
159
 
160
160
  @DoNotStrip public fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean
@@ -169,8 +169,6 @@ public interface ReactNativeFeatureFlagsProvider {
169
169
 
170
170
  @DoNotStrip public fun useNativeViewConfigsInBridgelessMode(): Boolean
171
171
 
172
- @DoNotStrip public fun useOptimizedEventBatchingOnAndroid(): Boolean
173
-
174
172
  @DoNotStrip public fun useRawPropsJsiValue(): Boolean
175
173
 
176
174
  @DoNotStrip public fun useShadowNodeStateOnClone(): Boolean
@@ -13,8 +13,8 @@ public object ReactNativeVersion {
13
13
  @JvmField
14
14
  public val VERSION: Map<String, Any?> = mapOf(
15
15
  "major" to 0,
16
- "minor" to 83,
16
+ "minor" to 84,
17
17
  "patch" to 0,
18
- "prerelease" to "rc.0"
18
+ "prerelease" to "nightly-20251106-de5141a3d"
19
19
  )
20
20
  }
@@ -14,7 +14,6 @@ import com.facebook.infer.annotation.Assertions
14
14
  import com.facebook.react.bridge.ReactContext
15
15
  import com.facebook.react.common.ReactConstants
16
16
  import com.facebook.react.common.annotations.UnstableReactNativeAPI
17
- import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
18
17
  import com.facebook.react.uimanager.common.UIManagerType
19
18
  import com.facebook.react.uimanager.events.EventDispatcher
20
19
  import com.facebook.react.uimanager.events.TouchEvent
@@ -59,7 +58,7 @@ public class JSTouchDispatcher(private val viewGroup: ViewGroup) {
59
58
  dispatchCancelEvent(androidEvent, eventDispatcher)
60
59
  childIsHandlingNativeGesture = true
61
60
 
62
- if (targetTag != -1 && ReactNativeFeatureFlags.sweepActiveTouchOnChildNativeGesturesAndroid()) {
61
+ if (targetTag != -1) {
63
62
  val surfaceId = UIManagerHelper.getSurfaceId(viewGroup)
64
63
  sweepActiveTouchForTag(surfaceId, targetTag, reactContext)
65
64
  }
@@ -11,7 +11,22 @@ import android.view.View
11
11
  import android.view.ViewGroup
12
12
  import com.facebook.react.R
13
13
 
14
+ /**
15
+ * Helper object for managing accessibility order in React Native views.
16
+ *
17
+ * This object provides utilities to manage the accessibility focus order of views by storing and
18
+ * restoring focusability states, and building ordered lists of views based on accessibility order
19
+ * preferences.
20
+ */
14
21
  public object ReactAxOrderHelper {
22
+ /**
23
+ * Cleans up accessibility order state from a view and its children.
24
+ *
25
+ * This method removes stored focusability states and accessibility order parent references from
26
+ * the view hierarchy. It recursively processes all children of ViewGroup instances.
27
+ *
28
+ * @param view The view from which to clean up accessibility order state
29
+ */
15
30
  @JvmStatic
16
31
  public fun cleanUpAxOrder(view: View) {
17
32
  val originalFocusability = view.getTag(R.id.original_focusability) as Boolean?
@@ -31,6 +46,15 @@ public object ReactAxOrderHelper {
31
46
  }
32
47
  }
33
48
 
49
+ /**
50
+ * Restores the original focusability state of a view and its children.
51
+ *
52
+ * This method traverses the view hierarchy and restores the focusability state that was
53
+ * previously saved with the `R.id.original_focusability` tag. This is typically used after
54
+ * accessibility order operations are complete to return views to their original state.
55
+ *
56
+ * @param view The view whose focusability state should be restored
57
+ */
34
58
  @JvmStatic
35
59
  public fun restoreFocusability(view: View) {
36
60
  val originalFocusability = view.getTag(R.id.original_focusability) as Boolean?
@@ -45,6 +69,16 @@ public object ReactAxOrderHelper {
45
69
  }
46
70
  }
47
71
 
72
+ /**
73
+ * Disables focus for all views in the subtree that are not in the accessibility order list.
74
+ *
75
+ * This method recursively traverses the view hierarchy and disables focusability for views that
76
+ * are not included in the provided accessibility order list. It stores the original focusability
77
+ * state before modifying it, allowing for later restoration.
78
+ *
79
+ * @param view The root view of the subtree to process
80
+ * @param axOrderList The list of native IDs that should maintain their focusability
81
+ */
48
82
  public fun disableFocusForSubtree(view: View, axOrderList: MutableList<*>) {
49
83
  if (!axOrderList.contains(view.getTag(R.id.view_tag_native_id))) {
50
84
  if (view.getTag(R.id.original_focusability) == null) {
@@ -60,6 +94,19 @@ public object ReactAxOrderHelper {
60
94
  }
61
95
  }
62
96
 
97
+ /**
98
+ * Builds an ordered list of views based on accessibility order preferences.
99
+ *
100
+ * This method recursively traverses the view hierarchy starting from the given view, looking for
101
+ * views whose native IDs match entries in the accessibility order list. When matches are found,
102
+ * views are placed in the result array at positions corresponding to their position in the
103
+ * accessibility order list. This method also tags each view with its accessibility order parent.
104
+ *
105
+ * @param view The current view being processed in the hierarchy traversal
106
+ * @param parent The parent view that defines the accessibility order context
107
+ * @param axOrderList The list of native IDs defining the desired accessibility order
108
+ * @param result The output array where views are placed according to their order in axOrderList
109
+ */
63
110
  public fun buildAxOrderList(
64
111
  view: View,
65
112
  parent: View,
@@ -7,14 +7,12 @@
7
7
 
8
8
  package com.facebook.react.uimanager.events
9
9
 
10
- import android.os.Handler
11
10
  import android.view.Choreographer
12
11
  import com.facebook.react.bridge.LifecycleEventListener
13
12
  import com.facebook.react.bridge.ReactApplicationContext
14
13
  import com.facebook.react.bridge.ReactSoftExceptionLogger
15
14
  import com.facebook.react.bridge.UiThreadUtil
16
15
  import com.facebook.react.common.annotations.UnstableReactNativeAPI
17
- import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
18
16
  import com.facebook.react.modules.core.ReactChoreographer
19
17
  import com.facebook.react.uimanager.UIManagerHelper
20
18
  import com.facebook.react.uimanager.common.UIManagerType
@@ -41,19 +39,6 @@ internal class FabricEventDispatcher(
41
39
  private val postEventDispatchListeners = CopyOnWriteArrayList<BatchEventDispatchedListener>()
42
40
  private val currentFrameCallback = ScheduleDispatchFrameCallback()
43
41
 
44
- private var isDispatchScheduled = false
45
- private val dispatchEventsRunnable = Runnable {
46
- isDispatchScheduled = false
47
- Systrace.beginSection(Systrace.TRACE_TAG_REACT, "BatchEventDispatchedListeners")
48
- try {
49
- for (listener in postEventDispatchListeners) {
50
- listener.onBatchEventDispatched()
51
- }
52
- } finally {
53
- Systrace.endSection(Systrace.TRACE_TAG_REACT)
54
- }
55
- }
56
-
57
42
  init {
58
43
  reactContext.addLifecycleEventListener(this)
59
44
  eventEmitter.registerFabricEventEmitter(fabricEventEmitter)
@@ -109,14 +94,7 @@ internal class FabricEventDispatcher(
109
94
  }
110
95
 
111
96
  private fun scheduleDispatchOfBatchedEvents() {
112
- if (ReactNativeFeatureFlags.useOptimizedEventBatchingOnAndroid()) {
113
- if (!isDispatchScheduled) {
114
- isDispatchScheduled = true
115
- uiThreadHandler.postAtFrontOfQueue(dispatchEventsRunnable)
116
- }
117
- } else {
118
- currentFrameCallback.maybeScheduleDispatchOfBatchedEvents()
119
- }
97
+ currentFrameCallback.maybeScheduleDispatchOfBatchedEvents()
120
98
  }
121
99
 
122
100
  /** Add a listener to this EventDispatcher. */
@@ -139,9 +117,7 @@ internal class FabricEventDispatcher(
139
117
 
140
118
  override fun onHostResume() {
141
119
  scheduleDispatchOfBatchedEvents()
142
- if (!ReactNativeFeatureFlags.useOptimizedEventBatchingOnAndroid()) {
143
- currentFrameCallback.resume()
144
- }
120
+ currentFrameCallback.resume()
145
121
  }
146
122
 
147
123
  override fun onHostPause() {
@@ -165,12 +141,7 @@ internal class FabricEventDispatcher(
165
141
 
166
142
  private fun cancelDispatchOfBatchedEvents() {
167
143
  UiThreadUtil.assertOnUiThread()
168
- if (ReactNativeFeatureFlags.useOptimizedEventBatchingOnAndroid()) {
169
- isDispatchScheduled = false
170
- uiThreadHandler.removeCallbacks(dispatchEventsRunnable)
171
- } else {
172
- currentFrameCallback.stop()
173
- }
144
+ currentFrameCallback.stop()
174
145
  }
175
146
 
176
147
  private inner class ScheduleDispatchFrameCallback : Choreographer.FrameCallback {
@@ -229,8 +200,4 @@ internal class FabricEventDispatcher(
229
200
  }
230
201
  }
231
202
  }
232
-
233
- private companion object {
234
- private val uiThreadHandler: Handler = UiThreadUtil.getUiThreadHandler()
235
- }
236
203
  }
@@ -29,7 +29,7 @@ internal class PointerEvent private constructor() : Event<PointerEvent>() {
29
29
  private lateinit var _eventName: String
30
30
  private var coalescingKey = UNSET_COALESCING_KEY
31
31
  private var pointersEventData: List<WritableMap>? = null
32
- private lateinit var eventState: PointerEventState
32
+ private var eventState: PointerEventState? = null
33
33
 
34
34
  private fun init(
35
35
  eventName: String,
@@ -84,7 +84,7 @@ internal class PointerEvent private constructor() : Event<PointerEvent>() {
84
84
  return@EventAnimationDriverMatchSpec false
85
85
  }
86
86
  if (isBubblingEvent(eventName)) {
87
- for (viewTarget in eventState.hitPathForActivePointer) {
87
+ for (viewTarget in checkNotNull(eventState).hitPathForActivePointer) {
88
88
  if (viewTarget.getViewId() == viewTag) {
89
89
  return@EventAnimationDriverMatchSpec true
90
90
  }
@@ -97,10 +97,10 @@ internal class PointerEvent private constructor() : Event<PointerEvent>() {
97
97
  }
98
98
 
99
99
  override fun onDispose() {
100
+ eventState = null
100
101
  pointersEventData = null
101
- val motionEvent = motionEvent
102
- this.motionEvent = null
103
102
  motionEvent?.recycle()
103
+ motionEvent = null
104
104
 
105
105
  // Either `this` is in the event pool, or motionEvent
106
106
  // is null. It is in theory not possible for a PointerEvent to
@@ -137,6 +137,7 @@ internal class PointerEvent private constructor() : Event<PointerEvent>() {
137
137
  val pointerEvent = Arguments.createMap()
138
138
  val motionEvent = checkNotNull(motionEvent)
139
139
  val pointerId = motionEvent.getPointerId(index)
140
+ val eventState = checkNotNull(eventState)
140
141
 
141
142
  // https://www.w3.org/TR/pointerevents/#pointerevent-interface
142
143
  pointerEvent.putDouble("pointerId", pointerId.toDouble())
@@ -28,6 +28,7 @@ import android.view.KeyEvent;
28
28
  import android.view.MotionEvent;
29
29
  import android.view.View;
30
30
  import android.view.ViewGroup;
31
+ import android.view.ViewParent;
31
32
  import android.view.accessibility.AccessibilityNodeInfo;
32
33
  import android.widget.HorizontalScrollView;
33
34
  import android.widget.OverScroller;
@@ -290,6 +291,10 @@ public class ReactHorizontalScrollView extends HorizontalScrollView
290
291
 
291
292
  @Override
292
293
  public void setRemoveClippedSubviews(boolean removeClippedSubviews) {
294
+ if (ReactNativeFeatureFlags.disableSubviewClippingAndroid()) {
295
+ return;
296
+ }
297
+
293
298
  if (removeClippedSubviews && mClippingRect == null) {
294
299
  mClippingRect = new Rect();
295
300
  }
@@ -740,6 +745,20 @@ public class ReactHorizontalScrollView extends HorizontalScrollView
740
745
  return handled;
741
746
  }
742
747
 
748
+ private boolean isDescendantOf(View parent, View view) {
749
+ if (view == null || parent == null) {
750
+ return false;
751
+ }
752
+ ViewParent p = view.getParent();
753
+ while (p != null && p.getParent() != null) {
754
+ if (p == parent) {
755
+ return true;
756
+ }
757
+ p = p.getParent();
758
+ }
759
+ return false;
760
+ }
761
+
743
762
  @Override
744
763
  public boolean arrowScroll(int direction) {
745
764
  boolean handled = false;
@@ -751,7 +770,7 @@ public class ReactHorizontalScrollView extends HorizontalScrollView
751
770
  View currentFocused = findFocus();
752
771
  View nextFocused = FocusFinder.getInstance().findNextFocus(this, currentFocused, direction);
753
772
  View rootChild = getContentView();
754
- if (rootChild != null && nextFocused != null && nextFocused.getParent() == rootChild) {
773
+ if (isDescendantOf(rootChild, nextFocused)) {
755
774
  if (!isScrolledInView(nextFocused) && !isMostlyScrolledInView(nextFocused)) {
756
775
  smoothScrollToNextPage(direction);
757
776
  }
@@ -834,8 +853,13 @@ public class ReactHorizontalScrollView extends HorizontalScrollView
834
853
  @Override
835
854
  public void run() {
836
855
  mPostTouchRunnable = null;
837
- // Trigger snap alignment now that scrolling has stopped
838
- handlePostTouchScrolling(0, 0);
856
+ // +1/-1 velocity if scrolling right or left. This is to ensure that the
857
+ // next/previous page is picked rather than sliding backwards to the current page
858
+ int velocityX = (int) Math.signum(hScroll);
859
+ if (mDisableIntervalMomentum) {
860
+ velocityX = 0;
861
+ }
862
+ flingAndSnap(velocityX);
839
863
  }
840
864
  };
841
865
  postOnAnimationDelayed(mPostTouchRunnable, ReactScrollViewHelper.MOMENTUM_DELAY);
@@ -688,8 +688,13 @@ public class ReactScrollView extends ScrollView
688
688
  @Override
689
689
  public void run() {
690
690
  mPostTouchRunnable = null;
691
- // Trigger snap alignment now that scrolling has stopped
692
- handlePostTouchScrolling(0, 0);
691
+ // +1/-1 velocity if scrolling down or up. This is to ensure that the
692
+ // next/previous page is picked rather than sliding backwards to the current page
693
+ int velocityY = (int) -Math.signum(vScroll);
694
+ if (mDisableIntervalMomentum) {
695
+ velocityY = 0;
696
+ }
697
+ flingAndSnap(velocityY);
693
698
  }
694
699
  };
695
700
  postOnAnimationDelayed(mPostTouchRunnable, ReactScrollViewHelper.MOMENTUM_DELAY);
@@ -714,6 +719,10 @@ public class ReactScrollView extends ScrollView
714
719
 
715
720
  @Override
716
721
  public void setRemoveClippedSubviews(boolean removeClippedSubviews) {
722
+ if (ReactNativeFeatureFlags.disableSubviewClippingAndroid()) {
723
+ return;
724
+ }
725
+
717
726
  if (removeClippedSubviews && mClippingRect == null) {
718
727
  mClippingRect = new Rect();
719
728
  }
@@ -32,6 +32,7 @@ import com.facebook.react.bridge.UiThreadUtil.assertOnUiThread
32
32
  import com.facebook.react.bridge.UiThreadUtil.runOnUiThread
33
33
  import com.facebook.react.common.ReactConstants.TAG
34
34
  import com.facebook.react.config.ReactFeatureFlags
35
+ import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
35
36
  import com.facebook.react.touch.OnInterceptTouchEventListener
36
37
  import com.facebook.react.touch.ReactHitSlopView
37
38
  import com.facebook.react.touch.ReactInterceptingViewGroup
@@ -362,8 +363,17 @@ public open class ReactViewGroup public constructor(context: Context?) :
362
363
  }
363
364
 
364
365
  override var removeClippedSubviews: Boolean
365
- get() = _removeClippedSubviews
366
+ get() {
367
+ if (ReactNativeFeatureFlags.disableSubviewClippingAndroid()) {
368
+ return false
369
+ }
370
+ return _removeClippedSubviews
371
+ }
366
372
  set(newValue) {
373
+ if (ReactNativeFeatureFlags.disableSubviewClippingAndroid()) {
374
+ return
375
+ }
376
+
367
377
  if (newValue == _removeClippedSubviews) {
368
378
  return
369
379
  }
@@ -5,6 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ #include <fbjni/ByteBuffer.h>
9
+
8
10
  #include "JCxxInspectorPackagerConnectionWebSocket.h"
9
11
 
10
12
  using namespace facebook::jni;
@@ -12,10 +14,35 @@ using namespace facebook::react::jsinspector_modern;
12
14
 
13
15
  namespace facebook::react::jsinspector_modern {
14
16
 
17
+ namespace {
18
+
19
+ local_ref<JByteBuffer::javaobject> getReadOnlyByteBufferFromStringView(
20
+ std::string_view sv) {
21
+ auto buffer = JByteBuffer::wrapBytes(
22
+ const_cast<uint8_t*>(reinterpret_cast<const uint8_t*>(sv.data())),
23
+ sv.size());
24
+
25
+ /**
26
+ * Return a read-only buffer that shares the underlying contents.
27
+ * This guards from accidential mutations on the Java side, since we did
28
+ * casting above.
29
+ *
30
+ * https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html#asReadOnlyBuffer--
31
+ */
32
+ static auto method =
33
+ buffer->javaClassStatic()->getMethod<JByteBuffer::javaobject()>(
34
+ "asReadOnlyBuffer");
35
+ return method(buffer);
36
+ }
37
+
38
+ } // namespace
39
+
15
40
  void JCxxInspectorPackagerConnectionWebSocket::send(std::string_view message) {
16
41
  static auto method =
17
- javaClassStatic()->getMethod<void(const std::string&)>("send");
18
- method(self(), std::string(message));
42
+ javaClassStatic()->getMethod<void(local_ref<JByteBuffer::javaobject>)>(
43
+ "send");
44
+ auto byteBuffer = getReadOnlyByteBufferFromStringView(message);
45
+ method(self(), byteBuffer);
19
46
  }
20
47
 
21
48
  void JCxxInspectorPackagerConnectionWebSocket::close() {
@@ -166,34 +166,39 @@ void FabricUIManagerBinding::startSurface(
166
166
  return;
167
167
  }
168
168
 
169
- auto layoutContext = LayoutContext{};
170
- layoutContext.pointScaleFactor = pointScaleFactor_;
169
+ SurfaceHandler* surfaceHandler = nullptr;
170
+ {
171
+ std::unique_lock lock(surfaceHandlerRegistryMutex_);
172
+ auto [it, _] = surfaceHandlerRegistry_.try_emplace(
173
+ surfaceId,
174
+ std::in_place_index<0>,
175
+ moduleName->toStdString(),
176
+ surfaceId);
177
+ surfaceHandler = &std::get<SurfaceHandler>(it->second);
178
+ }
171
179
 
172
- auto surfaceHandler = SurfaceHandler{moduleName->toStdString(), surfaceId};
173
- surfaceHandler.setContextContainer(scheduler->getContextContainer());
180
+ surfaceHandler->setContextContainer(scheduler->getContextContainer());
174
181
  if (initialProps != nullptr) {
175
- surfaceHandler.setProps(initialProps->consume());
182
+ surfaceHandler->setProps(initialProps->consume());
176
183
  }
177
- surfaceHandler.constraintLayout({}, layoutContext);
178
184
 
179
- scheduler->registerSurface(surfaceHandler);
185
+ auto layoutContext = LayoutContext{};
186
+ layoutContext.pointScaleFactor = pointScaleFactor_;
187
+ surfaceHandler->constraintLayout({}, layoutContext);
188
+
189
+ scheduler->registerSurface(*surfaceHandler);
180
190
 
181
191
  auto mountingManager = getMountingManager("startSurface");
182
192
  if (mountingManager != nullptr) {
183
193
  mountingManager->onSurfaceStart(surfaceId);
184
194
  }
185
195
 
186
- surfaceHandler.start();
196
+ surfaceHandler->start();
187
197
 
188
198
  if (ReactNativeFeatureFlags::enableLayoutAnimationsOnAndroid()) {
189
- surfaceHandler.getMountingCoordinator()->setMountingOverrideDelegate(
199
+ surfaceHandler->getMountingCoordinator()->setMountingOverrideDelegate(
190
200
  animationDriver_);
191
201
  }
192
-
193
- {
194
- std::unique_lock lock(surfaceHandlerRegistryMutex_);
195
- surfaceHandlerRegistry_.emplace(surfaceId, std::move(surfaceHandler));
196
- }
197
202
  }
198
203
 
199
204
  jint FabricUIManagerBinding::findNextFocusableElement(
@@ -338,31 +343,36 @@ void FabricUIManagerBinding::startSurfaceWithConstraints(
338
343
  constraints.layoutDirection =
339
344
  isRTL != 0 ? LayoutDirection::RightToLeft : LayoutDirection::LeftToRight;
340
345
 
341
- auto surfaceHandler = SurfaceHandler{moduleName->toStdString(), surfaceId};
342
- surfaceHandler.setContextContainer(scheduler->getContextContainer());
346
+ SurfaceHandler* surfaceHandler = nullptr;
347
+ {
348
+ std::unique_lock lock(surfaceHandlerRegistryMutex_);
349
+ auto [it, _] = surfaceHandlerRegistry_.try_emplace(
350
+ surfaceId,
351
+ std::in_place_index<0>,
352
+ moduleName->toStdString(),
353
+ surfaceId);
354
+ surfaceHandler = &std::get<SurfaceHandler>(it->second);
355
+ }
356
+
357
+ surfaceHandler->setContextContainer(scheduler->getContextContainer());
343
358
  if (initialProps != nullptr) {
344
- surfaceHandler.setProps(initialProps->consume());
359
+ surfaceHandler->setProps(initialProps->consume());
345
360
  }
346
- surfaceHandler.constraintLayout(constraints, context);
361
+ surfaceHandler->constraintLayout(constraints, context);
347
362
 
348
- scheduler->registerSurface(surfaceHandler);
363
+ scheduler->registerSurface(*surfaceHandler);
349
364
 
350
365
  auto mountingManager = getMountingManager("startSurfaceWithConstraints");
351
366
  if (mountingManager != nullptr) {
352
367
  mountingManager->onSurfaceStart(surfaceId);
353
368
  }
354
369
 
355
- surfaceHandler.start();
370
+ surfaceHandler->start();
356
371
 
357
372
  if (ReactNativeFeatureFlags::enableLayoutAnimationsOnAndroid()) {
358
- surfaceHandler.getMountingCoordinator()->setMountingOverrideDelegate(
373
+ surfaceHandler->getMountingCoordinator()->setMountingOverrideDelegate(
359
374
  animationDriver_);
360
375
  }
361
-
362
- {
363
- std::unique_lock lock(surfaceHandlerRegistryMutex_);
364
- surfaceHandlerRegistry_.emplace(surfaceId, std::move(surfaceHandler));
365
- }
366
376
  }
367
377
 
368
378
  // Used by non-bridgeless+Fabric