react-native 0.83.0-rc.0 → 0.84.0-nightly-20251105-5ec5cc3a3

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 (82) 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/Core/ReactNativeVersion.js +2 -2
  6. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +2 -2
  7. package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +3 -0
  8. package/React/Base/RCTBundleManager.h +59 -7
  9. package/React/Base/RCTBundleManager.m +98 -0
  10. package/React/Base/RCTBundleURLProvider.h +24 -0
  11. package/React/Base/RCTBundleURLProvider.mm +49 -4
  12. package/React/Base/RCTVersion.m +2 -2
  13. package/React/CoreModules/RCTPlatform.mm +3 -2
  14. package/React/CxxBridge/RCTCxxBridge.mm +1 -2
  15. package/React/CxxModule/RCTCxxUtils.mm +1 -11
  16. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +127 -135
  17. package/ReactAndroid/gradle.properties +1 -1
  18. package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.kt +7 -7
  19. package/ReactAndroid/src/main/java/com/facebook/react/ViewManagerOnDemandReactPackage.kt +53 -4
  20. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.kt +99 -9
  21. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/InspectorNetworkHelper.kt +1 -1
  22. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayManager.kt +22 -1
  23. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayView.kt +4 -3
  24. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +2 -8
  25. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +1 -11
  26. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +1 -3
  27. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +1 -3
  28. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +1 -12
  29. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +1 -3
  30. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +2 -2
  31. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.kt +1 -2
  32. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAxOrderHelper.kt +47 -0
  33. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.kt +5 -4
  34. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +23 -3
  35. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +7 -2
  36. package/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionWebSocket.cpp +29 -2
  37. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +1 -15
  38. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +1 -4
  39. package/ReactAndroid/src/main/jni/react/jni/JSLoader.cpp +1 -1
  40. package/ReactAndroid/src/main/jni/react/jni/JSLoader.h +2 -1
  41. package/ReactAndroid/src/main/res/devsupport/drawable/ic_perf_issue.xml +10 -0
  42. package/ReactCommon/cxxreact/JSBigString.h +14 -5
  43. package/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp +4 -5
  44. package/ReactCommon/cxxreact/ReactNativeVersion.h +3 -3
  45. package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +2 -3
  46. package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h +2 -2
  47. package/ReactCommon/jsinspector-modern/PerfMonitorV2.cpp +9 -1
  48. package/ReactCommon/jsinspector-modern/PerfMonitorV2.h +4 -1
  49. package/ReactCommon/jsinspector-modern/TracingAgent.cpp +1 -7
  50. package/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp +3 -55
  51. package/ReactCommon/jsinspector-modern/tests/TracingTest.h +82 -0
  52. package/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp +99 -0
  53. package/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h +47 -1
  54. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +1 -5
  55. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +2 -7
  56. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +18 -36
  57. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +2 -4
  58. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +1 -5
  59. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +1 -10
  60. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +1 -2
  61. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +4 -27
  62. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +1 -6
  63. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +1 -3
  64. package/ReactCommon/react/performance/cdpmetrics/CdpPerfIssuesReporter.cpp +4 -2
  65. package/ReactCommon/react/renderer/css/CSSSyntaxParser.h +7 -0
  66. package/ReactCommon/react/runtime/ReactInstance.cpp +4 -4
  67. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.h +3 -2
  68. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +10 -6
  69. package/ReactCommon/yoga/yoga/style/StyleLength.h +7 -0
  70. package/ReactCommon/yoga/yoga/style/StyleSizeLength.h +7 -0
  71. package/package.json +9 -9
  72. package/sdks/hermes-engine/version.properties +1 -1
  73. package/src/private/components/virtualview/VirtualView.js +16 -9
  74. package/src/private/components/virtualview/logger/VirtualViewLogger.js +21 -0
  75. package/src/private/components/virtualview/logger/VirtualViewLoggerTypes.js +24 -0
  76. package/src/private/featureflags/ReactNativeFeatureFlags.js +2 -7
  77. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +1 -2
  78. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +48 -0
  79. package/types_generated/src/private/components/virtualview/VirtualView.d.ts +3 -1
  80. package/React/CxxModule/RCTCxxModule.h +0 -29
  81. package/React/CxxModule/RCTCxxModule.mm +0 -87
  82. package/sdks/.hermesversion +0 -1
@@ -9,11 +9,17 @@ package com.facebook.react.devsupport
9
9
 
10
10
  import android.os.Handler
11
11
  import android.os.Looper
12
+ import com.facebook.common.logging.FLog
12
13
  import com.facebook.jni.HybridData
13
14
  import com.facebook.proguard.annotations.DoNotStrip
14
15
  import com.facebook.proguard.annotations.DoNotStripAny
16
+ import com.facebook.react.common.annotations.VisibleForTesting
15
17
  import com.facebook.soloader.SoLoader
16
18
  import java.io.Closeable
19
+ import java.nio.ByteBuffer
20
+ import java.nio.charset.StandardCharsets
21
+ import java.util.ArrayDeque
22
+ import java.util.Queue
17
23
  import java.util.concurrent.TimeUnit
18
24
  import okhttp3.OkHttpClient
19
25
  import okhttp3.Request
@@ -67,7 +73,7 @@ internal class CxxInspectorPackagerConnection(
67
73
  */
68
74
  @DoNotStripAny
69
75
  private interface IWebSocket : Closeable {
70
- fun send(message: String)
76
+ fun send(chunk: ByteBuffer)
71
77
 
72
78
  /**
73
79
  * Close the WebSocket connection. NOTE: There is no close() method in the C++ interface.
@@ -76,6 +82,95 @@ internal class CxxInspectorPackagerConnection(
76
82
  override fun close()
77
83
  }
78
84
 
85
+ /**
86
+ * A simple WebSocket wrapper that prevents having more than 16MiB of messages queued
87
+ * simultaneously. This is done to stop OkHttp from closing the WebSocket connection.
88
+ *
89
+ * https://github.com/facebook/react-native/issues/39651.
90
+ * https://github.com/square/okhttp/blob/4e7dbec1ea6c9cf8d80422ac9d44b9b185c749a3/okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/ws/RealWebSocket.kt#L684.
91
+ */
92
+ private class InspectorPackagerWebSocketImpl(
93
+ private val nativeWebSocket: WebSocket,
94
+ private val handler: Handler,
95
+ ) : IWebSocket {
96
+ private val messageQueue: Queue<Pair<String, Int>> = ArrayDeque()
97
+ private val queueLock = Any()
98
+ private val drainRunnable =
99
+ object : Runnable {
100
+ override fun run() {
101
+ FLog.d(TAG, "Attempting to drain the message queue after ${drainDelayMs}ms")
102
+ tryDrainQueue()
103
+ }
104
+ }
105
+
106
+ /**
107
+ * We are providing a String to OkHttp's WebSocket, because there is no guarantee that all CDP
108
+ * clients will support binary data format.
109
+ */
110
+ override fun send(chunk: ByteBuffer) {
111
+ synchronized(queueLock) {
112
+ val messageSize = chunk.capacity()
113
+ val message = StandardCharsets.UTF_8.decode(chunk).toString()
114
+ val currentQueueSize = nativeWebSocket.queueSize()
115
+
116
+ if (currentQueueSize + messageSize > MAX_QUEUE_SIZE) {
117
+ FLog.d(TAG, "Reached queue size limit. Queueing the message.")
118
+ messageQueue.offer(Pair(message, messageSize))
119
+ scheduleDrain()
120
+ } else {
121
+ if (messageQueue.isEmpty()) {
122
+ nativeWebSocket.send(message)
123
+ } else {
124
+ messageQueue.offer(Pair(message, messageSize))
125
+ tryDrainQueue()
126
+ }
127
+ }
128
+ }
129
+ }
130
+
131
+ override fun close() {
132
+ synchronized(queueLock) {
133
+ handler.removeCallbacks(drainRunnable)
134
+ messageQueue.clear()
135
+ nativeWebSocket.close(1000, "End of session")
136
+ }
137
+ }
138
+
139
+ private fun tryDrainQueue() {
140
+ synchronized(queueLock) {
141
+ while (messageQueue.isNotEmpty()) {
142
+ val (nextMessage, nextMessageSize) = messageQueue.peek() ?: break
143
+ val currentQueueSize = nativeWebSocket.queueSize()
144
+
145
+ if (currentQueueSize + nextMessageSize <= MAX_QUEUE_SIZE) {
146
+ messageQueue.poll()
147
+ if (!nativeWebSocket.send(nextMessage)) {
148
+ // The WebSocket is closing, closed, or cancelled.
149
+ handler.removeCallbacks(drainRunnable)
150
+ messageQueue.clear()
151
+
152
+ break
153
+ }
154
+ } else {
155
+ scheduleDrain()
156
+ break
157
+ }
158
+ }
159
+ }
160
+ }
161
+
162
+ private fun scheduleDrain() {
163
+ FLog.d(TAG, "Scheduled a task to drain messages queue.")
164
+ handler.removeCallbacks(drainRunnable)
165
+ handler.postDelayed(drainRunnable, drainDelayMs)
166
+ }
167
+
168
+ companion object {
169
+ private val TAG: String = InspectorPackagerWebSocketImpl::class.java.simpleName
170
+ private const val drainDelayMs: Long = 100
171
+ }
172
+ }
173
+
79
174
  /** Java implementation of the C++ InspectorPackagerConnectionDelegate interface. */
80
175
  private class DelegateImpl {
81
176
  private val httpClient =
@@ -130,15 +225,8 @@ internal class CxxInspectorPackagerConnection(
130
225
  }
131
226
  },
132
227
  )
133
- return object : IWebSocket {
134
- override fun send(message: String) {
135
- webSocket.send(message)
136
- }
137
228
 
138
- override fun close() {
139
- webSocket.close(1000, "End of session")
140
- }
141
- }
229
+ return InspectorPackagerWebSocketImpl(webSocket, handler)
142
230
  }
143
231
 
144
232
  @DoNotStrip
@@ -152,6 +240,8 @@ internal class CxxInspectorPackagerConnection(
152
240
  SoLoader.loadLibrary("react_devsupportjni")
153
241
  }
154
242
 
243
+ @VisibleForTesting internal const val MAX_QUEUE_SIZE = 16L * 1024 * 1024 // 16MiB
244
+
155
245
  @JvmStatic
156
246
  private external fun initHybrid(
157
247
  url: String,
@@ -66,7 +66,7 @@ internal object InspectorNetworkHelper {
66
66
  response.body().use { responseBody ->
67
67
  if (responseBody != null) {
68
68
  val inputStream = responseBody.byteStream()
69
- val chunkSize = 1024
69
+ val chunkSize = 8 * 1024 // 8Kb
70
70
  val buffer = ByteArray(chunkSize)
71
71
  var bytesRead: Int
72
72
 
@@ -7,6 +7,8 @@
7
7
 
8
8
  package com.facebook.react.devsupport.perfmonitor
9
9
 
10
+ import android.os.Handler
11
+ import android.os.Looper
10
12
  import com.facebook.react.bridge.UiThreadUtil
11
13
  import com.facebook.react.devsupport.interfaces.TracingState
12
14
 
@@ -23,6 +25,7 @@ internal class PerfMonitorOverlayManager(
23
25
  private var view: PerfMonitorOverlayView? = null
24
26
  private var tracingState: TracingState = TracingState.ENABLEDINCDPMODE
25
27
  private var perfIssueCount: Int = 0
28
+ private val handler = Handler(Looper.getMainLooper())
26
29
 
27
30
  /** Enable the Perf Monitor overlay. */
28
31
  fun enable() {
@@ -75,6 +78,7 @@ internal class PerfMonitorOverlayManager(
75
78
  tracingState = state
76
79
  if (state != TracingState.DISABLED) {
77
80
  perfIssueCount = 0
81
+ handler.removeCallbacksAndMessages(null)
78
82
  }
79
83
  UiThreadUtil.runOnUiThread {
80
84
  view?.updateRecordingState(state)
@@ -84,10 +88,23 @@ internal class PerfMonitorOverlayManager(
84
88
  }
85
89
 
86
90
  override fun onPerfIssueAdded(name: String) {
91
+ perfIssueCount++
92
+
87
93
  UiThreadUtil.runOnUiThread {
88
- view?.updatePerfIssueCount(++perfIssueCount)
94
+ view?.updatePerfIssueCount(perfIssueCount)
89
95
  view?.show()
90
96
  }
97
+
98
+ handler.postDelayed(
99
+ {
100
+ perfIssueCount--
101
+ UiThreadUtil.runOnUiThread {
102
+ view?.updatePerfIssueCount(perfIssueCount)
103
+ view?.show()
104
+ }
105
+ },
106
+ PERF_ISSUE_EXPIRY_MS,
107
+ )
91
108
  }
92
109
 
93
110
  private fun handleRecordingButtonPress() {
@@ -105,4 +122,8 @@ internal class PerfMonitorOverlayManager(
105
122
  TracingState.ENABLEDINCDPMODE -> Unit
106
123
  }
107
124
  }
125
+
126
+ companion object {
127
+ private const val PERF_ISSUE_EXPIRY_MS = 20_000L
128
+ }
108
129
  }
@@ -120,12 +120,12 @@ internal class PerfMonitorOverlayView(
120
120
  setTextColor(Color.WHITE)
121
121
  typeface = TYPEFACE_BOLD
122
122
  val alertDrawable =
123
- context.getDrawable(android.R.drawable.ic_dialog_alert)?.apply {
123
+ context.getDrawable(R.drawable.ic_perf_issue)?.apply {
124
124
  setBounds(
125
125
  0,
126
126
  1,
127
- dpToPx(TEXT_SIZE_PRIMARY).toInt(),
128
- dpToPx(TEXT_SIZE_PRIMARY).toInt() + 1,
127
+ dpToPx(ISSUE_ICON_SIZE).toInt(),
128
+ dpToPx(ISSUE_ICON_SIZE).toInt() + 1,
129
129
  )
130
130
  }
131
131
  setCompoundDrawables(alertDrawable, null, null, null)
@@ -214,6 +214,7 @@ internal class PerfMonitorOverlayView(
214
214
  private val COLOR_OVERLAY_BORDER = Color.parseColor("#6C6C6C")
215
215
  private val TEXT_SIZE_PRIMARY = 12f
216
216
  private val TEXT_SIZE_ACCESSORY = 10f
217
+ private val ISSUE_ICON_SIZE = 15f
217
218
  private val TYPEFACE_BOLD = Typeface.create("sans-serif", Typeface.BOLD)
218
219
  }
219
220
  }
@@ -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<<d8dc8c3a2efe8b7e870546e5749ef5ad>>
7
+ * @generated SignedSource<<890156e9513bff7c7c6252f8cf4402e4>>
8
8
  */
9
9
 
10
10
  /**
@@ -379,7 +379,7 @@ public object ReactNativeFeatureFlags {
379
379
  public fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean = accessor.overrideBySynchronousMountPropsAtMountingAndroid()
380
380
 
381
381
  /**
382
- * Enable reporting Performance Issues (`detail.rnPerfIssue`). Displayed in the V2 Performance Monitor and the "Performance Issues" sub-panel in DevTools.
382
+ * Enable reporting Performance Issues (`detail.devtools.performanceIssue`). Displayed in the V2 Performance Monitor and the "Performance Issues" sub-panel in DevTools.
383
383
  */
384
384
  @JvmStatic
385
385
  public fun perfIssuesEnabled(): Boolean = accessor.perfIssuesEnabled()
@@ -420,12 +420,6 @@ public object ReactNativeFeatureFlags {
420
420
  @JvmStatic
421
421
  public fun skipActivityIdentityAssertionOnHostPause(): Boolean = accessor.skipActivityIdentityAssertionOnHostPause()
422
422
 
423
- /**
424
- * A flag to tell Fabric to sweep active touches from JSTouchDispatcher in Android when a child native gesture is started.
425
- */
426
- @JvmStatic
427
- public fun sweepActiveTouchOnChildNativeGesturesAndroid(): Boolean = accessor.sweepActiveTouchOnChildNativeGesturesAndroid()
428
-
429
423
  /**
430
424
  * Enables storing js caller stack when creating promise in native module. This is useful in case of Promise rejection and tracing the cause.
431
425
  */
@@ -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<<447ccc7271b71b0208a2297b7eba5995>>
7
+ * @generated SignedSource<<c62242068e649aa652b1a8f700bf0ab3>>
8
8
  */
9
9
 
10
10
  /**
@@ -85,7 +85,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
85
85
  private var shouldPressibilityUseW3CPointerEventsForHoverCache: Boolean? = null
86
86
  private var shouldTriggerResponderTransferOnScrollAndroidCache: Boolean? = null
87
87
  private var skipActivityIdentityAssertionOnHostPauseCache: Boolean? = null
88
- private var sweepActiveTouchOnChildNativeGesturesAndroidCache: Boolean? = null
89
88
  private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
90
89
  private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
91
90
  private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
@@ -689,15 +688,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
689
688
  return cached
690
689
  }
691
690
 
692
- override fun sweepActiveTouchOnChildNativeGesturesAndroid(): Boolean {
693
- var cached = sweepActiveTouchOnChildNativeGesturesAndroidCache
694
- if (cached == null) {
695
- cached = ReactNativeFeatureFlagsCxxInterop.sweepActiveTouchOnChildNativeGesturesAndroid()
696
- sweepActiveTouchOnChildNativeGesturesAndroidCache = cached
697
- }
698
- return cached
699
- }
700
-
701
691
  override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean {
702
692
  var cached = traceTurboModulePromiseRejectionsOnAndroidCache
703
693
  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<<d6403b67e269ad80ef3e2389ac923c8a>>
7
+ * @generated SignedSource<<9a1bdbc2a3ae299433e690b254d7bf0a>>
8
8
  */
9
9
 
10
10
  /**
@@ -158,8 +158,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
158
158
 
159
159
  @DoNotStrip @JvmStatic public external fun skipActivityIdentityAssertionOnHostPause(): Boolean
160
160
 
161
- @DoNotStrip @JvmStatic public external fun sweepActiveTouchOnChildNativeGesturesAndroid(): Boolean
162
-
163
161
  @DoNotStrip @JvmStatic public external fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean
164
162
 
165
163
  @DoNotStrip @JvmStatic public external fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean
@@ -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<<ab48ba86a7cf3cd35ec530a216aea774>>
7
+ * @generated SignedSource<<0d78a0405db2a10c14bd69aaf2a3708a>>
8
8
  */
9
9
 
10
10
  /**
@@ -153,8 +153,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
153
153
 
154
154
  override fun skipActivityIdentityAssertionOnHostPause(): Boolean = false
155
155
 
156
- override fun sweepActiveTouchOnChildNativeGesturesAndroid(): Boolean = true
157
-
158
156
  override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean = false
159
157
 
160
158
  override fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean = false
@@ -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<<98f16fd1bb180b247ee87bb24b10120e>>
8
8
  */
9
9
 
10
10
  /**
@@ -89,7 +89,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
89
89
  private var shouldPressibilityUseW3CPointerEventsForHoverCache: Boolean? = null
90
90
  private var shouldTriggerResponderTransferOnScrollAndroidCache: Boolean? = null
91
91
  private var skipActivityIdentityAssertionOnHostPauseCache: Boolean? = null
92
- private var sweepActiveTouchOnChildNativeGesturesAndroidCache: Boolean? = null
93
92
  private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
94
93
  private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
95
94
  private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
@@ -758,16 +757,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
758
757
  return cached
759
758
  }
760
759
 
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
760
  override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean {
772
761
  var cached = traceTurboModulePromiseRejectionsOnAndroidCache
773
762
  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<<c810245ced5a83806ace12572e112a70>>
8
8
  */
9
9
 
10
10
  /**
@@ -153,8 +153,6 @@ public interface ReactNativeFeatureFlagsProvider {
153
153
 
154
154
  @DoNotStrip public fun skipActivityIdentityAssertionOnHostPause(): Boolean
155
155
 
156
- @DoNotStrip public fun sweepActiveTouchOnChildNativeGesturesAndroid(): Boolean
157
-
158
156
  @DoNotStrip public fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean
159
157
 
160
158
  @DoNotStrip public fun updateRuntimeShadowNodeReferencesOnCommit(): 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-20251105-5ec5cc3a3"
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,
@@ -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;
@@ -740,6 +741,20 @@ public class ReactHorizontalScrollView extends HorizontalScrollView
740
741
  return handled;
741
742
  }
742
743
 
744
+ private boolean isDescendantOf(View parent, View view) {
745
+ if (view == null || parent == null) {
746
+ return false;
747
+ }
748
+ ViewParent p = view.getParent();
749
+ while (p != null && p.getParent() != null) {
750
+ if (p == parent) {
751
+ return true;
752
+ }
753
+ p = p.getParent();
754
+ }
755
+ return false;
756
+ }
757
+
743
758
  @Override
744
759
  public boolean arrowScroll(int direction) {
745
760
  boolean handled = false;
@@ -751,7 +766,7 @@ public class ReactHorizontalScrollView extends HorizontalScrollView
751
766
  View currentFocused = findFocus();
752
767
  View nextFocused = FocusFinder.getInstance().findNextFocus(this, currentFocused, direction);
753
768
  View rootChild = getContentView();
754
- if (rootChild != null && nextFocused != null && nextFocused.getParent() == rootChild) {
769
+ if (isDescendantOf(rootChild, nextFocused)) {
755
770
  if (!isScrolledInView(nextFocused) && !isMostlyScrolledInView(nextFocused)) {
756
771
  smoothScrollToNextPage(direction);
757
772
  }
@@ -834,8 +849,13 @@ public class ReactHorizontalScrollView extends HorizontalScrollView
834
849
  @Override
835
850
  public void run() {
836
851
  mPostTouchRunnable = null;
837
- // Trigger snap alignment now that scrolling has stopped
838
- handlePostTouchScrolling(0, 0);
852
+ // +1/-1 velocity if scrolling right or left. This is to ensure that the
853
+ // next/previous page is picked rather than sliding backwards to the current page
854
+ int velocityX = (int) Math.signum(hScroll);
855
+ if (mDisableIntervalMomentum) {
856
+ velocityX = 0;
857
+ }
858
+ flingAndSnap(velocityX);
839
859
  }
840
860
  };
841
861
  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);
@@ -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() {