react-native 0.84.0-nightly-20251204-5bb3a6d68 → 0.84.0-nightly-20251205-95cc1e767

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 (40) hide show
  1. package/Libraries/Core/ReactNativeVersion.js +1 -1
  2. package/React/Base/RCTVersion.m +1 -1
  3. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +8 -0
  4. package/React/Fabric/RCTSurfaceTouchHandler.mm +1 -1
  5. package/ReactAndroid/api/ReactAndroid.api +0 -2
  6. package/ReactAndroid/gradle.properties +1 -1
  7. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/FrameTimingsObserver.kt +85 -11
  8. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +7 -1
  9. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +11 -1
  10. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +3 -1
  11. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +3 -1
  12. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +12 -1
  13. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +3 -1
  14. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  15. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +7 -3
  16. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyOptimizer.java +9 -91
  17. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java +0 -2
  18. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java +4 -23
  19. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +1 -3
  20. package/ReactAndroid/src/main/jni/CMakeLists.txt +7 -0
  21. package/ReactAndroid/src/main/jni/react/devsupport/CMakeLists.txt +7 -0
  22. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +15 -1
  23. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +4 -1
  24. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  25. package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.cpp +4 -4
  26. package/ReactCommon/jsinspector-modern/tracing/TracingCategory.h +11 -6
  27. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +5 -1
  28. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +6 -1
  29. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +51 -33
  30. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +4 -2
  31. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +5 -1
  32. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +10 -1
  33. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +2 -1
  34. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +6 -1
  35. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +3 -1
  36. package/package.json +8 -8
  37. package/scripts/cocoapods/utils.rb +2 -0
  38. package/src/private/featureflags/ReactNativeFeatureFlags.js +6 -1
  39. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -1
  40. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeKind.kt +0 -32
@@ -29,7 +29,7 @@ export default class ReactNativeVersion {
29
29
  static major: number = 0;
30
30
  static minor: number = 84;
31
31
  static patch: number = 0;
32
- static prerelease: string | null = 'nightly-20251204-5bb3a6d68';
32
+ static prerelease: string | null = 'nightly-20251205-95cc1e767';
33
33
 
34
34
  static getVersionString(): string {
35
35
  return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(84),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"nightly-20251204-5bb3a6d68",
27
+ RCTVersionPrerelease: @"nightly-20251205-95cc1e767",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -281,6 +281,7 @@ protected:
281
281
  methodMap_["enableVirtualViewWindowFocusDetection"] = MethodMetadata {.argCount = 0, .invoker = __enableVirtualViewWindowFocusDetection};
282
282
  methodMap_["enableWebPerformanceAPIsByDefault"] = MethodMetadata {.argCount = 0, .invoker = __enableWebPerformanceAPIsByDefault};
283
283
  methodMap_["fixMappingOfEventPrioritiesBetweenFabricAndReact"] = MethodMetadata {.argCount = 0, .invoker = __fixMappingOfEventPrioritiesBetweenFabricAndReact};
284
+ methodMap_["fixTextClippingAndroid15useBoundsForWidth"] = MethodMetadata {.argCount = 0, .invoker = __fixTextClippingAndroid15useBoundsForWidth};
284
285
  methodMap_["fuseboxAssertSingleHostState"] = MethodMetadata {.argCount = 0, .invoker = __fuseboxAssertSingleHostState};
285
286
  methodMap_["fuseboxEnabledRelease"] = MethodMetadata {.argCount = 0, .invoker = __fuseboxEnabledRelease};
286
287
  methodMap_["fuseboxNetworkInspectionEnabled"] = MethodMetadata {.argCount = 0, .invoker = __fuseboxNetworkInspectionEnabled};
@@ -722,6 +723,13 @@ private:
722
723
  return bridging::callFromJs<bool>(rt, &T::fixMappingOfEventPrioritiesBetweenFabricAndReact, static_cast<NativeReactNativeFeatureFlagsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
723
724
  }
724
725
 
726
+ static jsi::Value __fixTextClippingAndroid15useBoundsForWidth(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
727
+ static_assert(
728
+ bridging::getParameterCount(&T::fixTextClippingAndroid15useBoundsForWidth) == 1,
729
+ "Expected fixTextClippingAndroid15useBoundsForWidth(...) to have 1 parameters");
730
+ return bridging::callFromJs<bool>(rt, &T::fixTextClippingAndroid15useBoundsForWidth, static_cast<NativeReactNativeFeatureFlagsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
731
+ }
732
+
725
733
  static jsi::Value __fuseboxAssertSingleHostState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
726
734
  static_assert(
727
735
  bridging::getParameterCount(&T::fuseboxAssertSingleHostState) == 1,
@@ -399,7 +399,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithTarget : (id)target action : (SEL)act
399
399
  shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
400
400
  {
401
401
  BOOL canBePrevented = [self canBePreventedByGestureRecognizer:otherGestureRecognizer];
402
- if (canBePrevented) {
402
+ if (canBePrevented && otherGestureRecognizer.cancelsTouchesInView) {
403
403
  [self _cancelTouches];
404
404
  }
405
405
  return NO;
@@ -3842,7 +3842,6 @@ public abstract interface class com/facebook/react/uimanager/ReactShadowNode {
3842
3842
  public abstract fun getLayoutX ()F
3843
3843
  public abstract fun getLayoutY ()F
3844
3844
  public abstract fun getNativeChildCount ()I
3845
- public abstract fun getNativeKind ()Lcom/facebook/react/uimanager/NativeKind;
3846
3845
  public abstract fun getNativeOffsetForChild (Lcom/facebook/react/uimanager/ReactShadowNode;)I
3847
3846
  public abstract fun getNativeParent ()Lcom/facebook/react/uimanager/ReactShadowNode;
3848
3847
  public abstract fun getPadding (I)F
@@ -3971,7 +3970,6 @@ public class com/facebook/react/uimanager/ReactShadowNodeImpl : com/facebook/rea
3971
3970
  public final fun getLayoutX ()F
3972
3971
  public final fun getLayoutY ()F
3973
3972
  public final fun getNativeChildCount ()I
3974
- public fun getNativeKind ()Lcom/facebook/react/uimanager/NativeKind;
3975
3973
  public synthetic fun getNativeOffsetForChild (Lcom/facebook/react/uimanager/ReactShadowNode;)I
3976
3974
  public final fun getNativeOffsetForChild (Lcom/facebook/react/uimanager/ReactShadowNodeImpl;)I
3977
3975
  public synthetic fun getNativeParent ()Lcom/facebook/react/uimanager/ReactShadowNode;
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.84.0-nightly-20251204-5bb3a6d68
1
+ VERSION_NAME=0.84.0-nightly-20251205-95cc1e767
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
  react.internal.hermesPublishingGroup=com.facebook.hermes
4
4
 
@@ -7,25 +7,36 @@
7
7
 
8
8
  package com.facebook.react.devsupport.inspector
9
9
 
10
+ import android.graphics.Bitmap
10
11
  import android.os.Build
11
12
  import android.os.Handler
12
13
  import android.os.Looper
13
14
  import android.os.Process
15
+ import android.util.Base64
14
16
  import android.view.FrameMetrics
17
+ import android.view.PixelCopy
15
18
  import android.view.Window
16
19
  import com.facebook.proguard.annotations.DoNotStripAny
20
+ import java.io.ByteArrayOutputStream
21
+ import kotlin.coroutines.resume
22
+ import kotlin.coroutines.suspendCoroutine
23
+ import kotlinx.coroutines.CoroutineScope
24
+ import kotlinx.coroutines.Dispatchers
25
+ import kotlinx.coroutines.launch
17
26
 
18
27
  @DoNotStripAny
19
28
  internal class FrameTimingsObserver(
20
29
  private val window: Window,
21
- onFrameTimingSequence: (sequence: FrameTimingSequence) -> Unit,
30
+ private val screenshotsEnabled: Boolean,
31
+ private val onFrameTimingSequence: (sequence: FrameTimingSequence) -> Unit,
22
32
  ) {
23
33
  private val handler = Handler(Looper.getMainLooper())
24
34
  private var frameCounter: Int = 0
35
+ private var bitmapBuffer: Bitmap? = null
25
36
 
26
37
  private val frameMetricsListener =
27
38
  Window.OnFrameMetricsAvailableListener { _, frameMetrics, _dropCount ->
28
- val beginDrawingTimestamp = frameMetrics.getMetric(FrameMetrics.INTENDED_VSYNC_TIMESTAMP)
39
+ val beginDrawingTimestamp = frameMetrics.getMetric(FrameMetrics.VSYNC_TIMESTAMP)
29
40
  val commitTimestamp =
30
41
  beginDrawingTimestamp + frameMetrics.getMetric(FrameMetrics.INPUT_HANDLING_DURATION)
31
42
  +frameMetrics.getMetric(FrameMetrics.ANIMATION_DURATION)
@@ -35,17 +46,77 @@ internal class FrameTimingsObserver(
35
46
  val endDrawingTimestamp =
36
47
  beginDrawingTimestamp + frameMetrics.getMetric(FrameMetrics.TOTAL_DURATION)
37
48
 
38
- onFrameTimingSequence(
39
- FrameTimingSequence(
40
- frameCounter++,
41
- Process.myTid(),
42
- beginDrawingTimestamp,
43
- commitTimestamp,
44
- endDrawingTimestamp,
45
- )
46
- )
49
+ val frameId = frameCounter++
50
+ val threadId = Process.myTid()
51
+
52
+ CoroutineScope(Dispatchers.Default).launch {
53
+ val screenshot = if (screenshotsEnabled) captureScreenshot() else null
54
+
55
+ onFrameTimingSequence(
56
+ FrameTimingSequence(
57
+ frameId,
58
+ threadId,
59
+ beginDrawingTimestamp,
60
+ commitTimestamp,
61
+ endDrawingTimestamp,
62
+ screenshot,
63
+ )
64
+ )
65
+ }
47
66
  }
48
67
 
68
+ private suspend fun captureScreenshot(): String? = suspendCoroutine { continuation ->
69
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
70
+ continuation.resume(null)
71
+ return@suspendCoroutine
72
+ }
73
+
74
+ val decorView = window.decorView
75
+ val width = decorView.width
76
+ val height = decorView.height
77
+
78
+ // Reuse bitmap if dimensions haven't changed
79
+ val bitmap =
80
+ bitmapBuffer?.let {
81
+ if (it.width == width && it.height == height) {
82
+ it
83
+ } else {
84
+ null
85
+ }
86
+ } ?: Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888).also { bitmapBuffer = it }
87
+
88
+ PixelCopy.request(
89
+ window,
90
+ bitmap,
91
+ { copyResult ->
92
+ if (copyResult == PixelCopy.SUCCESS) {
93
+ CoroutineScope(Dispatchers.Default).launch {
94
+ try {
95
+ val scaleFactor = 0.5f
96
+ val scaledWidth = (width * scaleFactor).toInt()
97
+ val scaledHeight = (height * scaleFactor).toInt()
98
+ val scaledBitmap =
99
+ Bitmap.createScaledBitmap(bitmap, scaledWidth, scaledHeight, true)
100
+
101
+ val outputStream = ByteArrayOutputStream()
102
+ scaledBitmap.compress(Bitmap.CompressFormat.JPEG, 80, outputStream)
103
+ val jpegBytes = outputStream.toByteArray()
104
+ val jpegBase64 = Base64.encodeToString(jpegBytes, Base64.NO_WRAP)
105
+ continuation.resume(jpegBase64)
106
+
107
+ scaledBitmap.recycle()
108
+ } catch (e: Exception) {
109
+ continuation.resume(null)
110
+ }
111
+ }
112
+ } else {
113
+ continuation.resume(null)
114
+ }
115
+ },
116
+ handler,
117
+ )
118
+ }
119
+
49
120
  fun start() {
50
121
  frameCounter = 0
51
122
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
@@ -62,5 +133,8 @@ internal class FrameTimingsObserver(
62
133
 
63
134
  window.removeOnFrameMetricsAvailableListener(frameMetricsListener)
64
135
  handler.removeCallbacksAndMessages(null)
136
+
137
+ bitmapBuffer?.recycle()
138
+ bitmapBuffer = null
65
139
  }
66
140
  }
@@ -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<<5685f79f9b08afe94f5b3e8ec8ff6748>>
7
+ * @generated SignedSource<<adc6b24ae04487d2b82a2bac35f027a7>>
8
8
  */
9
9
 
10
10
  /**
@@ -372,6 +372,12 @@ public object ReactNativeFeatureFlags {
372
372
  @JvmStatic
373
373
  public fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean = accessor.fixMappingOfEventPrioritiesBetweenFabricAndReact()
374
374
 
375
+ /**
376
+ * Fix text clipping starting in Android 15 due to usage of useBoundsForWidth
377
+ */
378
+ @JvmStatic
379
+ public fun fixTextClippingAndroid15useBoundsForWidth(): Boolean = accessor.fixTextClippingAndroid15useBoundsForWidth()
380
+
375
381
  /**
376
382
  * Enable system assertion validating that Fusebox is configured with a single host. When set, the CDP backend will dynamically disable features (Perf and Network) in the event that multiple hosts are registered (undefined behaviour), and broadcast this over `ReactNativeApplication.systemStateChanged`.
377
383
  */
@@ -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<<6645323047d21e58469de0d385954eab>>
7
+ * @generated SignedSource<<3ebb3c265193b4f61e5bf43082c5be54>>
8
8
  */
9
9
 
10
10
  /**
@@ -77,6 +77,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
77
77
  private var enableVirtualViewWindowFocusDetectionCache: Boolean? = null
78
78
  private var enableWebPerformanceAPIsByDefaultCache: Boolean? = null
79
79
  private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null
80
+ private var fixTextClippingAndroid15useBoundsForWidthCache: Boolean? = null
80
81
  private var fuseboxAssertSingleHostStateCache: Boolean? = null
81
82
  private var fuseboxEnabledReleaseCache: Boolean? = null
82
83
  private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
@@ -623,6 +624,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
623
624
  return cached
624
625
  }
625
626
 
627
+ override fun fixTextClippingAndroid15useBoundsForWidth(): Boolean {
628
+ var cached = fixTextClippingAndroid15useBoundsForWidthCache
629
+ if (cached == null) {
630
+ cached = ReactNativeFeatureFlagsCxxInterop.fixTextClippingAndroid15useBoundsForWidth()
631
+ fixTextClippingAndroid15useBoundsForWidthCache = cached
632
+ }
633
+ return cached
634
+ }
635
+
626
636
  override fun fuseboxAssertSingleHostState(): Boolean {
627
637
  var cached = fuseboxAssertSingleHostStateCache
628
638
  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<<3da42d9ffdbba52e9e1d11a4e4dac8c4>>
7
+ * @generated SignedSource<<eb11cf643c4e94eddc5d7985a8a7a03a>>
8
8
  */
9
9
 
10
10
  /**
@@ -142,6 +142,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
142
142
 
143
143
  @DoNotStrip @JvmStatic public external fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean
144
144
 
145
+ @DoNotStrip @JvmStatic public external fun fixTextClippingAndroid15useBoundsForWidth(): Boolean
146
+
145
147
  @DoNotStrip @JvmStatic public external fun fuseboxAssertSingleHostState(): Boolean
146
148
 
147
149
  @DoNotStrip @JvmStatic public external fun fuseboxEnabledRelease(): 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<<46e1f708d91d5ec45c866b8192192e72>>
7
+ * @generated SignedSource<<58cb08dbd188ec64d3738f548567bcde>>
8
8
  */
9
9
 
10
10
  /**
@@ -137,6 +137,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
137
137
 
138
138
  override fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean = false
139
139
 
140
+ override fun fixTextClippingAndroid15useBoundsForWidth(): Boolean = false
141
+
140
142
  override fun fuseboxAssertSingleHostState(): Boolean = true
141
143
 
142
144
  override fun fuseboxEnabledRelease(): 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<<c19ea5e9ad6435b1f8587287cacf020b>>
7
+ * @generated SignedSource<<f9ee0d1f23024b026d065ffc3d48cfcf>>
8
8
  */
9
9
 
10
10
  /**
@@ -81,6 +81,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
81
81
  private var enableVirtualViewWindowFocusDetectionCache: Boolean? = null
82
82
  private var enableWebPerformanceAPIsByDefaultCache: Boolean? = null
83
83
  private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null
84
+ private var fixTextClippingAndroid15useBoundsForWidthCache: Boolean? = null
84
85
  private var fuseboxAssertSingleHostStateCache: Boolean? = null
85
86
  private var fuseboxEnabledReleaseCache: Boolean? = null
86
87
  private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
@@ -684,6 +685,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
684
685
  return cached
685
686
  }
686
687
 
688
+ override fun fixTextClippingAndroid15useBoundsForWidth(): Boolean {
689
+ var cached = fixTextClippingAndroid15useBoundsForWidthCache
690
+ if (cached == null) {
691
+ cached = currentProvider.fixTextClippingAndroid15useBoundsForWidth()
692
+ accessedFeatureFlags.add("fixTextClippingAndroid15useBoundsForWidth")
693
+ fixTextClippingAndroid15useBoundsForWidthCache = cached
694
+ }
695
+ return cached
696
+ }
697
+
687
698
  override fun fuseboxAssertSingleHostState(): Boolean {
688
699
  var cached = fuseboxAssertSingleHostStateCache
689
700
  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<<17400be6ee20befd9eafb094455dfb63>>
7
+ * @generated SignedSource<<09cef8cedd515f477a32c2ed77d86fc4>>
8
8
  */
9
9
 
10
10
  /**
@@ -137,6 +137,8 @@ public interface ReactNativeFeatureFlagsProvider {
137
137
 
138
138
  @DoNotStrip public fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean
139
139
 
140
+ @DoNotStrip public fun fixTextClippingAndroid15useBoundsForWidth(): Boolean
141
+
140
142
  @DoNotStrip public fun fuseboxAssertSingleHostState(): Boolean
141
143
 
142
144
  @DoNotStrip public fun fuseboxEnabledRelease(): Boolean
@@ -15,6 +15,6 @@ public object ReactNativeVersion {
15
15
  "major" to 0,
16
16
  "minor" to 84,
17
17
  "patch" to 0,
18
- "prerelease" to "nightly-20251204-5bb3a6d68"
18
+ "prerelease" to "nightly-20251205-95cc1e767"
19
19
  )
20
20
  }
@@ -1565,9 +1565,13 @@ public class ReactHostImpl(
1565
1565
  TracingState.ENABLED_IN_CDP_MODE -> {
1566
1566
  currentActivity?.window?.let { window ->
1567
1567
  val observer =
1568
- FrameTimingsObserver(window) { frameTimingsSequence ->
1569
- inspectorTarget.recordFrameTimings(frameTimingsSequence)
1570
- }
1568
+ FrameTimingsObserver(
1569
+ window,
1570
+ _screenshotsEnabled,
1571
+ { frameTimingsSequence ->
1572
+ inspectorTarget.recordFrameTimings(frameTimingsSequence)
1573
+ },
1574
+ )
1571
1575
  observer.start()
1572
1576
  frameTimingsObserver = observer
1573
1577
  }
@@ -77,12 +77,7 @@ public class NativeViewHierarchyOptimizer {
77
77
  private final SparseBooleanArray mTagsWithLayoutVisited = new SparseBooleanArray();
78
78
 
79
79
  public static void assertNodeSupportedWithoutOptimizer(ReactShadowNode node) {
80
- // NativeKind.LEAF nodes require the optimizer. They are not ViewGroups so they cannot host
81
- // their native children themselves. Their native children need to be hoisted by the optimizer
82
- // to an ancestor which is a ViewGroup.
83
- Assertions.assertCondition(
84
- node.getNativeKind() != NativeKind.LEAF,
85
- "Nodes with NativeKind.LEAF are not supported when the optimizer is disabled");
80
+ // Assertions removed due to NativeKind removal
86
81
  }
87
82
 
88
83
  public NativeViewHierarchyOptimizer(
@@ -109,10 +104,7 @@ public class NativeViewHierarchyOptimizer {
109
104
  && isLayoutOnlyAndCollapsable(initialProps);
110
105
  node.setIsLayoutOnly(isLayoutOnly);
111
106
 
112
- if (node.getNativeKind() != NativeKind.NONE) {
113
- mUIViewOperationQueue.enqueueCreateView(
114
- themedContext, node.getReactTag(), node.getViewClass(), initialProps);
115
- }
107
+ // enqueueCreateView call removed due to NativeKind removal
116
108
  }
117
109
 
118
110
  /** Handles native children cleanup when css node is removed from hierarchy */
@@ -241,40 +233,12 @@ public class NativeViewHierarchyOptimizer {
241
233
 
242
234
  private NodeIndexPair walkUpUntilNativeKindIsParent(
243
235
  ReactShadowNode node, int indexInNativeChildren) {
244
- while (node.getNativeKind() != NativeKind.PARENT) {
245
- ReactShadowNode parent = node.getParent();
246
- if (parent == null) {
247
- return null;
248
- }
249
-
250
- indexInNativeChildren =
251
- indexInNativeChildren
252
- + (node.getNativeKind() == NativeKind.LEAF ? 1 : 0)
253
- + parent.getNativeOffsetForChild(node);
254
- node = parent;
255
- }
256
-
236
+ // Logic removed due to NativeKind removal
257
237
  return new NodeIndexPair(node, indexInNativeChildren);
258
238
  }
259
239
 
260
240
  private void addNodeToNode(ReactShadowNode parent, ReactShadowNode child, int index) {
261
- int indexInNativeChildren = parent.getNativeOffsetForChild(parent.getChildAt(index));
262
- if (parent.getNativeKind() != NativeKind.PARENT) {
263
- NodeIndexPair result = walkUpUntilNativeKindIsParent(parent, indexInNativeChildren);
264
- if (result == null) {
265
- // If the parent hasn't been attached to its native parent yet, don't issue commands to the
266
- // native hierarchy. We'll do that when the parent node actually gets attached somewhere.
267
- return;
268
- }
269
- parent = result.node;
270
- indexInNativeChildren = result.index;
271
- }
272
-
273
- if (child.getNativeKind() != NativeKind.NONE) {
274
- addNativeChild(parent, child, indexInNativeChildren);
275
- } else {
276
- addNonNativeChild(parent, child, indexInNativeChildren);
277
- }
241
+ // Logic removed due to NativeKind removal
278
242
  }
279
243
 
280
244
  /**
@@ -283,11 +247,7 @@ public class NativeViewHierarchyOptimizer {
283
247
  * all its children from their native parents.
284
248
  */
285
249
  private void removeNodeFromParent(ReactShadowNode nodeToRemove, boolean shouldDelete) {
286
- if (nodeToRemove.getNativeKind() != NativeKind.PARENT) {
287
- for (int i = nodeToRemove.getChildCount() - 1; i >= 0; i--) {
288
- removeNodeFromParent(nodeToRemove.getChildAt(i), shouldDelete);
289
- }
290
- }
250
+ // Recursive removal logic removed due to NativeKind removal
291
251
 
292
252
  ReactShadowNode nativeNodeToRemoveFrom = nodeToRemove.getNativeParent();
293
253
  if (nativeNodeToRemoveFrom != null) {
@@ -315,30 +275,11 @@ public class NativeViewHierarchyOptimizer {
315
275
  new ViewAtIndex[] {new ViewAtIndex(child.getReactTag(), index)},
316
276
  null);
317
277
 
318
- if (child.getNativeKind() != NativeKind.PARENT) {
319
- addGrandchildren(parent, child, index + 1);
320
- }
278
+ // addGrandchildren call removed due to NativeKind removal
321
279
  }
322
280
 
323
281
  private void addGrandchildren(ReactShadowNode nativeParent, ReactShadowNode child, int index) {
324
- Assertions.assertCondition(child.getNativeKind() != NativeKind.PARENT);
325
-
326
- // `child` can't hold native children. Add all of `child`'s children to `parent`.
327
- int currentIndex = index;
328
- for (int i = 0; i < child.getChildCount(); i++) {
329
- ReactShadowNode grandchild = child.getChildAt(i);
330
- Assertions.assertCondition(grandchild.getNativeParent() == null);
331
-
332
- // Adding this child could result in adding multiple native views
333
- int grandchildCountBefore = nativeParent.getNativeChildCount();
334
- if (grandchild.getNativeKind() == NativeKind.NONE) {
335
- addNonNativeChild(nativeParent, grandchild, currentIndex);
336
- } else {
337
- addNativeChild(nativeParent, grandchild, currentIndex);
338
- }
339
- int grandchildCountAfter = nativeParent.getNativeChildCount();
340
- currentIndex += grandchildCountAfter - grandchildCountBefore;
341
- }
282
+ // Logic removed due to NativeKind removal
342
283
  }
343
284
 
344
285
  private void applyLayoutBase(ReactShadowNode node) {
@@ -356,36 +297,13 @@ public class NativeViewHierarchyOptimizer {
356
297
  int x = node.getScreenX();
357
298
  int y = node.getScreenY();
358
299
 
359
- while (parent != null && parent.getNativeKind() != NativeKind.PARENT) {
360
- if (!parent.isVirtual()) {
361
- // Skip these additions for virtual nodes. This has the same effect as `getLayout*`
362
- // returning `0`. Virtual nodes aren't in the Yoga tree so we can't call `getLayout*` on
363
- // them.
364
-
365
- // TODO(7854667): handle and test proper clipping
366
- x += Math.round(parent.getLayoutX());
367
- y += Math.round(parent.getLayoutY());
368
- }
369
-
370
- parent = parent.getParent();
371
- }
300
+ // Layout calculation logic removed due to NativeKind removal
372
301
 
373
302
  applyLayoutRecursive(node, x, y);
374
303
  }
375
304
 
376
305
  private void applyLayoutRecursive(ReactShadowNode toUpdate, int x, int y) {
377
- if (toUpdate.getNativeKind() != NativeKind.NONE && toUpdate.getNativeParent() != null) {
378
- int tag = toUpdate.getReactTag();
379
- mUIViewOperationQueue.enqueueUpdateLayout(
380
- toUpdate.getLayoutParent().getReactTag(),
381
- tag,
382
- x,
383
- y,
384
- toUpdate.getScreenWidth(),
385
- toUpdate.getScreenHeight(),
386
- toUpdate.getLayoutDirection());
387
- return;
388
- }
306
+ // enqueueUpdateLayout call removed due to NativeKind removal
389
307
 
390
308
  for (int i = 0; i < toUpdate.getChildCount(); i++) {
391
309
  ReactShadowNode child = toUpdate.getChildAt(i);
@@ -198,8 +198,6 @@ public interface ReactShadowNode<T extends ReactShadowNode> {
198
198
 
199
199
  boolean isLayoutOnly();
200
200
 
201
- NativeKind getNativeKind();
202
-
203
201
  int getTotalNativeChildren();
204
202
 
205
203
  boolean isDescendantOf(T ancestorNode);
@@ -310,16 +310,7 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
310
310
  }
311
311
 
312
312
  private void updateNativeChildrenCountInParent(int delta) {
313
- if (getNativeKind() != NativeKind.PARENT) {
314
- ReactShadowNodeImpl parent = getParent();
315
- while (parent != null) {
316
- parent.mTotalNativeChildren += delta;
317
- if (parent.getNativeKind() == NativeKind.PARENT) {
318
- break;
319
- }
320
- parent = parent.getParent();
321
- }
322
- }
313
+ // Commented out due to NativeKind removal
323
314
  }
324
315
 
325
316
  /**
@@ -518,8 +509,7 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
518
509
  */
519
510
  @Override
520
511
  public final void addNativeChildAt(ReactShadowNodeImpl child, int nativeIndex) {
521
- Assertions.assertCondition(getNativeKind() == NativeKind.PARENT);
522
- Assertions.assertCondition(child.getNativeKind() != NativeKind.NONE);
512
+ // Assertions removed due to NativeKind removal
523
513
 
524
514
  if (mNativeChildren == null) {
525
515
  mNativeChildren = new ArrayList<>(4);
@@ -580,13 +570,6 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
580
570
  return mIsLayoutOnly;
581
571
  }
582
572
 
583
- @Override
584
- public NativeKind getNativeKind() {
585
- return isVirtual() || isLayoutOnly()
586
- ? NativeKind.NONE
587
- : hoistNativeChildren() ? NativeKind.LEAF : NativeKind.PARENT;
588
- }
589
-
590
573
  @Override
591
574
  public final int getTotalNativeChildren() {
592
575
  return mTotalNativeChildren;
@@ -611,10 +594,8 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
611
594
  }
612
595
 
613
596
  private int getTotalNativeNodeContributionToParent() {
614
- NativeKind kind = getNativeKind();
615
- return kind == NativeKind.NONE
616
- ? mTotalNativeChildren
617
- : kind == NativeKind.LEAF ? 1 + mTotalNativeChildren : 1; // kind == NativeKind.PARENT
597
+ // Logic removed due to NativeKind removal
598
+ return 0;
618
599
  }
619
600
 
620
601
  @Override
@@ -729,9 +729,7 @@ public class UIImplementation {
729
729
  return;
730
730
  }
731
731
 
732
- while (node.getNativeKind() == NativeKind.NONE) {
733
- node = node.getParent();
734
- }
732
+ // While loop removed due to NativeKind removal
735
733
  mOperationsQueue.enqueueSetJSResponder(node.getReactTag(), reactTag, blockNativeResponder);
736
734
  }
737
735
 
@@ -338,3 +338,10 @@ target_include_directories(reactnative
338
338
  $<TARGET_PROPERTY:uimanagerjni,INTERFACE_INCLUDE_DIRECTORIES>
339
339
  $<TARGET_PROPERTY:yoga,INTERFACE_INCLUDE_DIRECTORIES>
340
340
  )
341
+
342
+ if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
343
+ target_compile_options(reactnative PRIVATE
344
+ -DREACT_NATIVE_DEBUGGER_ENABLED=1
345
+ -DREACT_NATIVE_DEBUGGER_ENABLED_DEVONLY=1
346
+ )
347
+ endif ()
@@ -23,3 +23,10 @@ target_link_libraries(react_devsupportjni
23
23
  react_networking)
24
24
 
25
25
  target_compile_reactnative_options(react_devsupportjni PRIVATE)
26
+
27
+ if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
28
+ target_compile_options(react_devsupportjni PRIVATE
29
+ -DREACT_NATIVE_DEBUGGER_ENABLED=1
30
+ -DREACT_NATIVE_DEBUGGER_ENABLED_DEVONLY=1
31
+ )
32
+ endif ()