react-native 0.84.0-nightly-20251203-a5e6addc6 → 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 (48) hide show
  1. package/Libraries/Core/ReactNativeVersion.js +1 -1
  2. package/React/Base/RCTVersion.m +1 -1
  3. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +194 -186
  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/tests/TracingTest.cpp +18 -0
  26. package/ReactCommon/jsinspector-modern/tracing/FrameTimingSequence.h +4 -2
  27. package/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.cpp +14 -1
  28. package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.cpp +28 -4
  29. package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.h +13 -1
  30. package/ReactCommon/jsinspector-modern/tracing/TracingCategory.h +11 -6
  31. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +5 -1
  32. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +6 -1
  33. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +51 -33
  34. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +4 -2
  35. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +5 -1
  36. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +10 -1
  37. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +2 -1
  38. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +6 -1
  39. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +3 -1
  40. package/ReactCommon/react/runtime/ReactInstance.cpp +1 -1
  41. package/package.json +10 -10
  42. package/scripts/cocoapods/utils.rb +2 -0
  43. package/scripts/codegen/generate-artifacts-executor/generateSchemaInfos.js +7 -6
  44. package/sdks/hermes-engine/version.properties +1 -1
  45. package/src/private/featureflags/ReactNativeFeatureFlags.js +6 -1
  46. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -1
  47. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeKind.kt +0 -32
  48. /package/ReactCommon/jsi/jsi/{hermes.h → hermes-interfaces.h} +0 -0
@@ -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-20251203-a5e6addc6"
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 ()
@@ -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<<66f2c701d95db2fbeefb2705ae326e08>>
7
+ * @generated SignedSource<<b9af351de972ddff807bd25f98f3ff42>>
8
8
  */
9
9
 
10
10
  /**
@@ -381,6 +381,12 @@ class ReactNativeFeatureFlagsJavaProvider
381
381
  return method(javaProvider_);
382
382
  }
383
383
 
384
+ bool fixTextClippingAndroid15useBoundsForWidth() override {
385
+ static const auto method =
386
+ getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("fixTextClippingAndroid15useBoundsForWidth");
387
+ return method(javaProvider_);
388
+ }
389
+
384
390
  bool fuseboxAssertSingleHostState() override {
385
391
  static const auto method =
386
392
  getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("fuseboxAssertSingleHostState");
@@ -862,6 +868,11 @@ bool JReactNativeFeatureFlagsCxxInterop::fixMappingOfEventPrioritiesBetweenFabri
862
868
  return ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact();
863
869
  }
864
870
 
871
+ bool JReactNativeFeatureFlagsCxxInterop::fixTextClippingAndroid15useBoundsForWidth(
872
+ facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
873
+ return ReactNativeFeatureFlags::fixTextClippingAndroid15useBoundsForWidth();
874
+ }
875
+
865
876
  bool JReactNativeFeatureFlagsCxxInterop::fuseboxAssertSingleHostState(
866
877
  facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
867
878
  return ReactNativeFeatureFlags::fuseboxAssertSingleHostState();
@@ -1224,6 +1235,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
1224
1235
  makeNativeMethod(
1225
1236
  "fixMappingOfEventPrioritiesBetweenFabricAndReact",
1226
1237
  JReactNativeFeatureFlagsCxxInterop::fixMappingOfEventPrioritiesBetweenFabricAndReact),
1238
+ makeNativeMethod(
1239
+ "fixTextClippingAndroid15useBoundsForWidth",
1240
+ JReactNativeFeatureFlagsCxxInterop::fixTextClippingAndroid15useBoundsForWidth),
1227
1241
  makeNativeMethod(
1228
1242
  "fuseboxAssertSingleHostState",
1229
1243
  JReactNativeFeatureFlagsCxxInterop::fuseboxAssertSingleHostState),
@@ -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<<f14600a85cec20388ba1a5bc63010a68>>
7
+ * @generated SignedSource<<c89b15dbb7d1cec571eed1551e1b7162>>
8
8
  */
9
9
 
10
10
  /**
@@ -201,6 +201,9 @@ class JReactNativeFeatureFlagsCxxInterop
201
201
  static bool fixMappingOfEventPrioritiesBetweenFabricAndReact(
202
202
  facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
203
203
 
204
+ static bool fixTextClippingAndroid15useBoundsForWidth(
205
+ facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
206
+
204
207
  static bool fuseboxAssertSingleHostState(
205
208
  facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
206
209
 
@@ -22,7 +22,7 @@ constexpr struct {
22
22
  int32_t Major = 0;
23
23
  int32_t Minor = 84;
24
24
  int32_t Patch = 0;
25
- std::string_view Prerelease = "nightly-20251203-a5e6addc6";
25
+ std::string_view Prerelease = "nightly-20251205-95cc1e767";
26
26
  } ReactNativeVersion;
27
27
 
28
28
  } // namespace facebook::react
@@ -95,4 +95,22 @@ TEST_F(TracingTest, EmitsRecordedFrameTimingSequences) {
95
95
  EXPECT_THAT(allTraceEvents, Contains(AtJsonPtr("/name", "DrawFrame")));
96
96
  }
97
97
 
98
+ TEST_F(TracingTest, EmitsScreenshotEventWhenScreenshotValuePassed) {
99
+ InSequence s;
100
+
101
+ startTracing({tracing::Category::Screenshot});
102
+ auto now = HighResTimeStamp::now();
103
+ page_->recordFrameTimings(
104
+ tracing::FrameTimingSequence(
105
+ 1, // id
106
+ 11, // threadId
107
+ now,
108
+ now + HighResDuration::fromNanoseconds(10),
109
+ now + HighResDuration::fromNanoseconds(50),
110
+ "base64EncodedScreenshotData"));
111
+
112
+ auto allTraceEvents = endTracingAndCollectEvents();
113
+ EXPECT_THAT(allTraceEvents, Contains(AtJsonPtr("/name", "Screenshot")));
114
+ }
115
+
98
116
  } // namespace facebook::react::jsinspector_modern
@@ -13,6 +13,8 @@
13
13
 
14
14
  namespace facebook::react::jsinspector_modern::tracing {
15
15
 
16
+ using FrameSequenceId = uint64_t;
17
+
16
18
  /**
17
19
  * A struct representing a sequence of frame timings that happened on the Host side.
18
20
  */
@@ -20,7 +22,7 @@ struct FrameTimingSequence {
20
22
  FrameTimingSequence() = delete;
21
23
 
22
24
  FrameTimingSequence(
23
- uint64_t id,
25
+ FrameSequenceId id,
24
26
  ThreadId threadId,
25
27
  HighResTimeStamp beginDrawingTimestamp,
26
28
  HighResTimeStamp commitTimestamp,
@@ -38,7 +40,7 @@ struct FrameTimingSequence {
38
40
  /**
39
41
  * Unique ID of the sequence, used by Chrome DevTools Frontend to identify the events that form one sequence.
40
42
  */
41
- uint64_t id;
43
+ FrameSequenceId id;
42
44
 
43
45
  /**
44
46
  * The ID of the native thread that is associated with the frame.
@@ -100,7 +100,7 @@ constexpr int FALLBACK_LAYER_TREE_ID = 1;
100
100
  chunk.push_back(
101
101
  TraceEventSerializer::serialize(std::move(setLayerTreeIdEvent)));
102
102
 
103
- for (const auto& frameTimingSequence : frameTimings) {
103
+ for (auto&& frameTimingSequence : frameTimings) {
104
104
  if (chunk.size() >= chunkSize) {
105
105
  chunkCallback(std::move(chunk));
106
106
  chunk = generateNewChunk(chunkSize);
@@ -121,6 +121,19 @@ constexpr int FALLBACK_LAYER_TREE_ID = 1;
121
121
  chunk.push_back(TraceEventSerializer::serialize(std::move(commitEvent)));
122
122
  chunk.push_back(
123
123
  TraceEventSerializer::serialize(std::move(endDrawingEvent)));
124
+
125
+ if (frameTimingSequence.screenshot.has_value()) {
126
+ auto screenshotEvent = TraceEventGenerator::createScreenshotEvent(
127
+ frameTimingSequence.id,
128
+ FALLBACK_LAYER_TREE_ID,
129
+ std::move(frameTimingSequence.screenshot.value()),
130
+ frameTimingSequence.endDrawingTimestamp,
131
+ processId,
132
+ frameTimingSequence.threadId);
133
+
134
+ chunk.push_back(
135
+ TraceEventSerializer::serialize(std::move(screenshotEvent)));
136
+ }
124
137
  }
125
138
 
126
139
  if (!chunk.empty()) {
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  #include "TraceEventGenerator.h"
9
+ #include "Timing.h"
9
10
  #include "TracingCategory.h"
10
11
 
11
12
  namespace facebook::react::jsinspector_modern::tracing {
@@ -21,7 +22,7 @@ namespace facebook::react::jsinspector_modern::tracing {
21
22
 
22
23
  return TraceEvent{
23
24
  .name = "SetLayerTreeId",
24
- .cat = {Category::Timeline},
25
+ .cat = {Category::HiddenTimeline},
25
26
  .ph = 'I',
26
27
  .ts = timestamp,
27
28
  .pid = processId,
@@ -45,7 +46,7 @@ TraceEventGenerator::createFrameTimingsEvents(
45
46
 
46
47
  auto beginEvent = TraceEvent{
47
48
  .name = "BeginFrame",
48
- .cat = {Category::Timeline},
49
+ .cat = {Category::Frame},
49
50
  .ph = 'I',
50
51
  .ts = beginDrawingTimestamp,
51
52
  .pid = processId,
@@ -55,7 +56,7 @@ TraceEventGenerator::createFrameTimingsEvents(
55
56
  };
56
57
  auto commitEvent = TraceEvent{
57
58
  .name = "Commit",
58
- .cat = {Category::Timeline},
59
+ .cat = {Category::Frame},
59
60
  .ph = 'I',
60
61
  .ts = commitTimestamp,
61
62
  .pid = processId,
@@ -65,7 +66,7 @@ TraceEventGenerator::createFrameTimingsEvents(
65
66
  };
66
67
  auto drawEvent = TraceEvent{
67
68
  .name = "DrawFrame",
68
- .cat = {Category::Timeline},
69
+ .cat = {Category::Frame},
69
70
  .ph = 'I',
70
71
  .ts = endDrawingTimestamp,
71
72
  .pid = processId,
@@ -77,4 +78,27 @@ TraceEventGenerator::createFrameTimingsEvents(
77
78
  return {std::move(beginEvent), std::move(commitEvent), std::move(drawEvent)};
78
79
  }
79
80
 
81
+ /* static */ TraceEvent TraceEventGenerator::createScreenshotEvent(
82
+ FrameSequenceId frameSequenceId,
83
+ int sourceId,
84
+ std::string&& snapshot,
85
+ HighResTimeStamp expectedDisplayTime,
86
+ ProcessId processId,
87
+ ThreadId threadId) {
88
+ folly::dynamic args = folly::dynamic::object("snapshot", std::move(snapshot))(
89
+ "source_id", sourceId)("frame_sequence", frameSequenceId)(
90
+ "expected_display_time",
91
+ highResTimeStampToTracingClockTimeStamp(expectedDisplayTime));
92
+
93
+ return TraceEvent{
94
+ .name = "Screenshot",
95
+ .cat = {Category::Screenshot},
96
+ .ph = 'O',
97
+ .ts = expectedDisplayTime,
98
+ .pid = processId,
99
+ .tid = threadId,
100
+ .args = std::move(args),
101
+ };
102
+ }
103
+
80
104
  }; // namespace facebook::react::jsinspector_modern::tracing
@@ -9,6 +9,7 @@
9
9
 
10
10
  #include "TraceEvent.h"
11
11
 
12
+ #include <jsinspector-modern/tracing/FrameTimingSequence.h>
12
13
  #include <react/timing/primitives.h>
13
14
 
14
15
  #include <tuple>
@@ -35,13 +36,24 @@ class TraceEventGenerator {
35
36
  * Creates canonical "BeginFrame", "Commit", "DrawFrame" trace events.
36
37
  */
37
38
  static std::tuple<TraceEvent, TraceEvent, TraceEvent> createFrameTimingsEvents(
38
- uint64_t sequenceId,
39
+ FrameSequenceId sequenceId,
39
40
  int layerTreeId,
40
41
  HighResTimeStamp beginDrawingTimestamp,
41
42
  HighResTimeStamp commitTimestamp,
42
43
  HighResTimeStamp endDrawingTimestamp,
43
44
  ProcessId processId,
44
45
  ThreadId threadId);
46
+
47
+ /**
48
+ * Creates canonical "Screenshot" trace event.
49
+ */
50
+ static TraceEvent createScreenshotEvent(
51
+ FrameSequenceId frameSequenceId,
52
+ int sourceId,
53
+ std::string &&snapshot,
54
+ HighResTimeStamp expectedDisplayTime,
55
+ ProcessId processId,
56
+ ThreadId threadId);
45
57
  };
46
58
 
47
59
  }; // namespace facebook::react::jsinspector_modern::tracing