Compare commits

...
Author SHA1 Message Date
Pieter De Baetsandmeta-codesync[bot] 693e9628e8 Mark mOnViewAttachMountItems as final in SurfaceMountingManager.java (#54344)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54344

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D85904478

fbshipit-source-id: 961d12bf1cbf04b9087a518531b20d87be3ccb63
2025-10-31 15:50:52 -07:00
David Vaccaandmeta-codesync[bot] 0e3a210be1 Add comprehensive KDoc documentation to FilterHelper (#54350)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54350

Added comprehensive KDoc documentation to the FilterHelper object and its primary public method for parsing and applying CSS filter effects on Android S+ (API 31+).

changelog: [internal] internal

Reviewed By: lenaic

Differential Revision: D85926889

fbshipit-source-id: e20bb0697753e710d66acc3ef4078ab009d6dc5d
2025-10-31 14:42:30 -07:00
David Vaccaandmeta-codesync[bot] b8f9d982f5 Add KDoc documentation to ComponentNameResolverBinding (#54349)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54349

Added comprehensive KDoc documentation to the ComponentNameResolverBinding object and its JNI method for installing component name resolvers into the JavaScript runtime.

changelog: [internal] internal

Reviewed By: lenaic

Differential Revision: D85926888

fbshipit-source-id: 253577d4c5d48bee22acb5666680becd4e632879
2025-10-31 14:42:30 -07:00
David Vaccaandmeta-codesync[bot] 7d7d843666 Add KDoc documentation to ComponentNameResolver interface (#54348)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54348

Added comprehensive KDoc documentation to the ComponentNameResolver interface and its property providing access to registered component names.

changelog: [internal] internal

Reviewed By: lenaic

Differential Revision: D85926887

fbshipit-source-id: ae12629e27f88555c7876d3343a146b1b5c3dec0
2025-10-31 14:42:30 -07:00
David Vaccaandmeta-codesync[bot] 89bcc02a07 Add KDoc documentation to BlendModeHelper (#54347)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54347

Added comprehensive KDoc documentation to the BlendModeHelper object and its public method for parsing CSS mix-blend-mode properties on Android Q+.

changelog: [internal] internal

Reviewed By: lenaic

Differential Revision: D85926891

fbshipit-source-id: bcafa6b02281d5265f59b34641847bc3b19d6604
2025-10-31 14:42:30 -07:00
David Vaccaandmeta-codesync[bot] ad0210c535 Add comprehensive KDoc documentation to BackgroundStyleApplicator (#54346)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54346

Added comprehensive KDoc documentation to the BackgroundStyleApplicator class and all 25 public methods covering backgrounds, borders, outlines, and box shadows.

changelog: [internal] internal

Reviewed By: lenaic

Differential Revision: D85926890

fbshipit-source-id: 5a398bf8d57d6b6dff6b012ac225bc96d56e2573
2025-10-31 14:42:30 -07:00
David Vaccaandmeta-codesync[bot] cc2101d063 Add KDoc documentation to FloatUtil class (#54345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54345

Added comprehensive KDoc documentation to the `FloatUtil` class and its public methods to improve code readability and developer experience.

The documentation explains:
- The purpose of epsilon-based floating-point comparison and why it's necessary
- The role of the EPSILON constant in determining equality
- Special case handling for NaN values (both considered equal when both are NaN)
- Null value handling in the nullable overload
- Method parameters and return values

This documentation will help developers understand the rationale behind using this utility instead of direct float equality comparisons, which can be unreliable due to floating-point precision issues.

changelog: [internal] internal

Reviewed By: lenaic

Differential Revision: D85923748

fbshipit-source-id: d054099de3d9903801aadca4cfcd3127bb6d5297
2025-10-31 14:42:30 -07:00
Gianni Moschiniandmeta-codesync[bot] e2b62bc435 fix code snippet text container in AnsiHiglight (#54360)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54360

## Changelog:

[General] [Fixed] - Fixing an issue with the error LogBox formatting on windows causing text to wrap

Reviewed By: rickhanlonii, yannickl

Differential Revision: D76845667

fbshipit-source-id: 4b1ce705396f9818cbe9be80d521478b5eba632b
2025-10-31 13:24:51 -07:00
Luna Weiandmeta-codesync[bot] 025e0e47ef Remove clipping check on scrollview (#54357)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54357

Changelog: [Internal] - Ignore whether ScrollView enables subview clipping and just use the drawing rect for forwarding a clippingRect for VirtualView

Reviewed By: yungsters

Differential Revision: D85817030

fbshipit-source-id: e89298d106ec993ce1ca63131da002e0685c34dd
2025-10-31 13:23:26 -07:00
Rubén Norteandmeta-codesync[bot] 15589485c5 Remove legacy profiling for network requests (#54353)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54353

Changelog: [internal]

We have support for the network track in performance traces so we no longer need this custom integration.

Reviewed By: huntie

Differential Revision: D85946500

fbshipit-source-id: 4efa132a6524af6595ddf9f8c2b5651959fa1f94
2025-10-31 11:11:33 -07:00
Rubén Norteandmeta-codesync[bot] ad5ff285a9 Unify perf tracks under a React Native track group (#54354)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54354

Changelog: [internal]

This just renames the tracks for network, etc. to go under a "⚛ Native" track group.

Reviewed By: huntie

Differential Revision: D85946501

fbshipit-source-id: f7ea65bfd84ed4965749f7e22091bcaff38a5bc3
2025-10-31 11:11:33 -07:00
Rubén Norteandmeta-codesync[bot] 3806edc1bd Use try/finally for performance measure for device events (#54355)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54355

Changelog: [internal]

Small refactor to make sure profiling timespans don't break if there's an exception in one of the listeners.

Reviewed By: huntie

Differential Revision: D85951560

fbshipit-source-id: 162672a7e644893f46a3b0100284bc4125a83757
2025-10-31 11:11:33 -07:00
nishan (o^▽^o)andmeta-codesync[bot] 20ba98e00d feat(iOS) - Add contrast and hue rotate filter (#54294)
Summary:
This PR adds support for `contrast` and `hueRotate` filter support on iOS as discussed here - https://github.com/react-native-community/discussions-and-proposals/issues/927

## Changelog:

[IOS] [ADDED] - Add contrast and hue-rotate CSS filters

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/54294

Test Plan:
Test Filter screen in RNTester app. Checkout contrast and hue-rotate examples. Results are consistent on android and iOS.

<img width="300" height="auto" alt="Screenshot 2025-10-28 at 6 43 10 AM" src="https://github.com/user-attachments/assets/da7e4166-5723-4e4d-8d94-df9efb127672" />

<img width="300" height="auto" alt="Screenshot 2025-10-28 at 6 02 40 AM" src="https://github.com/user-attachments/assets/2d332202-6b2e-4269-93ed-3f80d3e03e4a" />

cc - joevilches thanks! remaining filters are `invert` and `sepia`. These are a bit tricky as they don't have direct SwiftUI equivalents. I am trying a few things, will do a PR when I get it working.

Reviewed By: jorge-cab

Differential Revision: D85961419

Pulled By: joevilches

fbshipit-source-id: f4628b17570e5b8fd3092392224f2d84b7d47d1d
2025-10-31 11:09:37 -07:00
Alex Huntandmeta-codesync[bot] a74387be66 Add Performance Issues to Perf Monitor (2/2) (#54266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54266

Introduces the concept of **Performance Issues**, an experimental performance signals concept for React Native.

**Design**

Performance Issues are an **experimental** user space API via the User Timings `detail` object.

```
performance.measure({
  start,
  end,
  detail: {
    devtools: {
      ...
    },
   rnPerfIssue: {
     name: 'React: Cascading Update',
     severity: 'warning', // 'info' | 'warning' | 'error',
     description:
      'A cascading update is a update that is triggered by a previous update. This can lead to performance issues and should be avoided.',
    learnMoreUrl:
      'https://react.dev/reference/dev-tools/react-performance-tracks#cascading-updates',
    }
  }
});
```

When `rnPerfIssue` is present, we eagerly report an the event over CDP, regardless of an active performance trace, via the `"__react_native_perf_issues_reporter"` runtime binding.

**This diff**

- Updates the V2 Perf Monitor UI (Android) to display Performance Issues as a count.
    - (UI parts of this diff, including `HostTarget::installPerfIssuesBinding` are reinstated from the previous INP design, removed in D82208400).

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D85448199

fbshipit-source-id: 0cee0eff275219fa46ccf788a6208889d3a0506e
2025-10-31 09:39:10 -07:00
Alex Huntandmeta-codesync[bot] ee9ef3bf2d Add Performance Issues to Perf Monitor (1/2) (#54265)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54265

Introduces the concept of **Performance Issues**, an experimental performance signals concept for React Native.

**Design**

Performance Issues are an **experimental** user space API via the User Timings `detail` object.

```
performance.measure({
  start,
  end,
  detail: {
    devtools: {
      ...
    },
   rnPerfIssue: {
     name: 'React: Cascading Update',
     severity: 'warning', // 'info' | 'warning' | 'error',
     description:
      'A cascading update is a update that is triggered by a previous update. This can lead to performance issues and should be avoided.',
    learnMoreUrl:
      'https://react.dev/reference/dev-tools/react-performance-tracks#cascading-updates',
    }
  }
});
```

When `rnPerfIssue` is present, we eagerly report an the event over CDP, regardless of an active performance trace, via the `"__react_native_perf_issues_reporter"` runtime binding.

**This diff**

- Adds a `perfIssuesEnabled` feature flag.
- Initial implementation of the above API.
- Initially reports a "Cascading Render" issue, aligning 1:1 with the corresponding React performance track event (note: to be added in the React codebase, see https://github.com/facebook/react/pull/34961).

This feature is gated by the `perfMonitorV2Enabled` feature flag.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D85448200

fbshipit-source-id: e5aed5138682331e1cd3a713a5f09fb6745138bc
2025-10-31 09:39:10 -07:00
Alex Huntandmeta-codesync[bot] 6d68cdf5c3 Fix missing jsi dependency following #54262 (#54341)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54341

Changelog: [Internal]

{F1983141005}

Reviewed By: cipolleschi

Differential Revision: D85888301

fbshipit-source-id: 54cfaf2995bf0231e661fc11e115266578e1f692
2025-10-31 05:57:29 -07:00
Pieter De Baetsandmeta-codesync[bot] 6757e547c5 Mark private static fields as final in ReactHorizontalScrollView (#54343)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54343

Fixed NotWrittenPrivateField lint warnings in ReactHorizontalScrollView.java by marking three private static fields as final:

- DEBUG_MODE: Changed from `private static boolean` to `private static final boolean`
- TAG: Changed from `private static String` to `private static final String`
- NO_SCROLL_POSITION: Changed from `private static int` to `private static final int`

These fields are initialized once and never modified, making them compile-time constants. Marking them as final follows Java best practices and prevents potential issues with Redex code optimization.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D85904890

fbshipit-source-id: f83a19392a2418d8415936421f1e021316643056
2025-10-31 04:23:26 -07:00
Nolan O'Brienandmeta-codesync[bot] 3ff4ab2290 Fix missing enum values in switch statements (#54342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54342

`-Wswitch-enum` was introduced in 2024 and is beneficial because it will err when switch statement is missing a case for an enum, even with `default:` present.  This helps alert developers when they add an enum value of all the switch statements that need updating.

These diffs are to help progress the codebase so that we can enable `-Wswitch-enum` by default in `fbobjc`

## Changelog:
[General] [Fixed] - Add missing value to switch for `-Wswitch-enum` builds

Differential Revision: D85835952

fbshipit-source-id: e56c45895a63325e565315a39ea59df769c4a3ad
2025-10-30 21:01:45 -07:00
Vladimir Makaevandmeta-codesync[bot] ae4d79d279 Daily arc lint --take CLANGFORMAT
Reviewed By: ionutluzinschi

Differential Revision: D85728900

fbshipit-source-id: 022ac989ce5519b5b065a9fa8a20ce6438309b4c
2025-10-30 15:56:46 -07:00
Alex Huntandmeta-codesync[bot] 7403e85233 Update debugger-frontend from 96e6bb8...7aa57d1 (#54340)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54340

Changelog: [Internal] - Update `react-native/debugger-frontend` from 96e6bb8...7aa57d1

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/96e6bb8ecdff166816e2a469b7594f1276bda8c1...7aa57d13e50ce9d74a91c9315c9b0ded00fbc19f).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [7aa57d13e](https://github.com/facebook/react-native-devtools-frontend/commit/7aa57d13e) | Alex Hunt (hello@alexhunt.dev) | 2025-10-30T19:45:26+00:00 | [Add AGENTS.md (#215)](https://github.com/facebook/react-native-devtools-frontend/commit/7aa57d13e) |
| [d524f81db](https://github.com/facebook/react-native-devtools-frontend/commit/d524f81db) | Alex Hunt (hello@alexhunt.dev) | 2025-10-30T18:43:44+00:00 | [Enable Performance panel by default (#216)](https://github.com/facebook/react-native-devtools-frontend/commit/d524f81db) |
| [62f76dfbb](https://github.com/facebook/react-native-devtools-frontend/commit/62f76dfbb) | Alex Hunt (hello@alexhunt.dev) | 2025-10-30T17:01:50+00:00 | [Update project name in setup script (#214)](https://github.com/facebook/react-native-devtools-frontend/commit/62f76dfbb) |

Reviewed By: hoxyq

Differential Revision: D85888511

fbshipit-source-id: fbe4be107d8be6db7b91199dfe44b604b5be0036
2025-10-30 13:31:38 -07:00
Eric Rozellandmeta-codesync[bot] 600a8dc1da Allow customization of requestChildFocus scroll behavior in ScrollView (#54325)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54325

Apps that override ScrollView may need to customize the auto scroll behavior on focus.  This adds a protected method for apps that override ReactScrollView to customize focus behaviors.

## Changelog
[Internal]

Reviewed By: joevilches

Differential Revision: D85779339

fbshipit-source-id: 1ba978ed14ceb224ddc1d0da97727ff9702972e7
2025-10-30 12:22:50 -07:00
Alex Huntandmeta-codesync[bot] 9693a2b855 Support parsing of detail arg from console.timeStamp (#54262)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54262

Similar to `performance.measure()`, Chrome is adding an optional `detail` arg to `console.timeStamp`. Here we implement this for React Native, by direct passing to the `"TimeStamp"` trace event args.

[`console.timeStamp()`](https://developer.mozilla.org/en-US/docs/Web/API/console/timeStamp_static) remains an experimental, non-standard API.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D85437162

fbshipit-source-id: 36f5f6207cf205df5a216bde95013ea9540fc082
2025-10-30 11:42:24 -07:00
Rubén Norteandmeta-codesync[bot] e8fcde50e3 Simplify module after DOM API feature flag cleanup (#54323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54323

Changelog: [internal]

We no longer need to lazily load these modules, because they're always used now.

Reviewed By: lunaleaps

Differential Revision: D85782126

fbshipit-source-id: 263eb234558b90d9cf5c6d55bccb39eb8d1c6a48
2025-10-30 08:37:04 -07:00
Rubén Norteandmeta-codesync[bot] 234b53d0f8 Merge tests for legacy node methods into ReactNativeElement test (#54321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54321

Changelog: [internal]

Just moving some tests from `ReactFabricPublicInstance` to `ReactNativeElement` now that they're only used for that class.

Reviewed By: lunaleaps

Differential Revision: D85782130

fbshipit-source-id: 1445f61df2cbd691e09187b3b122032ad941cd67
2025-10-30 08:37:04 -07:00
Rubén Norteandmeta-codesync[bot] 8217165442 Delete unused legacy ReactFabricHostComponent class (#54320)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54320

Changelog: [internal]

This class is no longer used after we shipped DOM APIs.

Reviewed By: lunaleaps

Differential Revision: D85782129

fbshipit-source-id: 7ffa33aa1bade777d2b3fb7ae8b7c136376983a7
2025-10-30 08:37:04 -07:00
Rubén Norteandmeta-codesync[bot] 9c4601abec Clean up feature flag "enableAccessToHostTreeInFabric" (#54322)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54322

Changelog: [internal]

This just cleans up the feature flag, which is set to `true` by default and it's been enabled in `stable` already.

Reviewed By: lunaleaps, yungsters

Differential Revision: D85782127

fbshipit-source-id: 0a6174708066cfe597b4c6dbc8bb33829c6155e9
2025-10-30 08:37:04 -07:00
Rubén Norteandmeta-codesync[bot] beccee2164 Promote Web Performance APIs to stable (#54324)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54324

Changelog: [General][Added] - Enable Web Performance APIs

This promotes the Web Performance APIs from canary to stable.

Reviewed By: cipolleschi

Differential Revision: D85783108

fbshipit-source-id: 8d8b4565f28dc20d63e677c01366f4f37d5c46e4
2025-10-30 08:34:57 -07:00
Samuel Suslaandmeta-codesync[bot] 71f5c744db add name of command for systrace for easier debugging (#54328)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54328

changelog: [internal]

makes debugging easier if there is name of command.

Reviewed By: christophpurrer, javache

Differential Revision: D85784113

fbshipit-source-id: 14f89ea8b8401dce2dc84d14caaecc6cacda04b2
2025-10-30 06:04:42 -07:00
Harini Malothuandmeta-codesync[bot] f9754d3459 Ccomparison between signed and unsigned values, causing a error (#54318)
Summary:
We saw this error while integrating  changes in react native windows
https://github.com/microsoft/react-native-windows/issues/15292
Fixed type consistency in cloneMultipleRecursive by using size_t for loop iterator to properly match vector size type, improving type safety when iterating over children nodes.

## Changelog:
[GENERAL][FIXED] - Use size_t instead of int for vector iteration in cloneMultipleRecursive
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

|GENERAL|FIXED|- Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/54318

Reviewed By: christophpurrer

Differential Revision: D85800905

Pulled By: javache

fbshipit-source-id: 2fdb539e1c9af56eebdd5c7a900fa0e697bcab3a
2025-10-30 03:52:14 -07:00
Jorge Cabiedes Acostaandmeta-codesync[bot] d0015e0838 Fix visual artifacts when sometimes using decimal assymetric borderRadii (#54237)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54237

Before we were adding a single pixel for the stretchable area. in RCTViewComponentView we calculate what percentage is 1 pixel from the entire image to create the unit rectangle:
```
    CGRect contentsCenter = CGRect{
        CGPoint{imageCapInsets.left / imageSize.width, imageCapInsets.top / imageSize.height},
        CGSize{(CGFloat)1.0 / imageSize.width, (CGFloat)1.0 / imageSize.height}};
```

However sometimes when dividing `1.0 / imageSize.width` we would get a big enough float that causes a rounding error essentially having part of the border bleed into the stretchable region.

The easiest way to fix this is give the stretchable region a little more space so to prevent the bleeding.

We can do this by rounding the edgeInsets that give the border area its size

The alternative is some shockingly complex math to appropriately calculate the most convenient stretchable area size

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D85260693

fbshipit-source-id: 50eaba2189f3ff524be730211f8d19023522c68a
2025-10-29 20:31:35 -07:00
Peter Abbondanzoandmeta-codesync[bot] 26ad9492b3 Implement resizeMethod="resize" for image prefetching (#54228)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54228

## Issue
When prefetching images with the `resizeMethod` prop set, there's a brief period of time where the image has not laid out and the dimensions are 0x0. Since `ImageSource.h` only considers the `type` and `uri` properties for equality, two different `ImageSource` objects would be considered equal despite having different `size`. We would continue on to prefetch the image in its fullest quality and retain that image in `ImageState`, and upon subsequent requests once we have non-zero layouts, we would bail out early in the `ImageShadowNode::updateStateIfNeeded` method since both the old image source and image request params are equal in this case.

## Fix
Rather than adding `size` to the equality check, this change adds identical logic directly from `ReactImageView` to determine if we should postpone the image request: if the image is resizable and we don't have a width or a height, postpone!

## Additional Context
I noodled with a few spots of where this should ultimately live, but this seemed like the least invasive without making some larger refactors. The other approach I considered was to instead return an optional `ImageRequest` object from `ImageManager->requestImage call` to signal that no request was ever made, and using the `ImageRequest` response as part of the equality check.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D85200818

fbshipit-source-id: 82090feb500dafa47af14220a17262d715d20a7a
2025-10-29 16:52:18 -07:00
Zeya Pengandmeta-codesync[bot] b5e209181e Fix EXC_BAD_ACCESS introduced in #54211 (#54319)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54319

## Changelog:

[Internal] [Changed] - Fix EXC_BAD_ACCESS introduced in #54211

Reviewed By: sammy-SC

Differential Revision: D85779978

fbshipit-source-id: 7b240e1484fdcc57283325febf75faedaba585cd
2025-10-29 16:33:13 -07:00
Eric Rozellandmeta-codesync[bot] 8a3cc6411e Remove unnecessary local variable in for deferred focus (#54326)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54326

This variable was not needed, isAttachedToWindow was working as expected.

## Changelog
[Internal]

Reviewed By: Abbondanzo

Differential Revision: D85798355

fbshipit-source-id: 1716b323b4ac0d1d6f3e29370223db66540020d2
2025-10-29 16:18:32 -07:00
Rubén Norteandmeta-codesync[bot] b68329f7ca Implement Kotlin API for PerformanceTracer in RNDT (#54316)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54316

Changelog: [internal]

This defines an internal class in Kotlin to access `PerformanceTracer` methods, necessary for platform-specific integrations on Android.

Reviewed By: sbuggay

Differential Revision: D85689126

fbshipit-source-id: 84cb675984b90c677c3a322b191e24cc6b58c74f
2025-10-29 15:35:35 -07:00
Rubén Norteandmeta-codesync[bot] 712c544be6 Implement method to subscribe to tracing start/stop in RNDT (#54315)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54315

Changelog: [internal]

This adds methods to `PerformanceTracer` so consumers can be notified when tracing starts/stop. This is necessary to activate features necessary for tracing that would be costly to enable all the time.

Reviewed By: sbuggay

Differential Revision: D85689124

fbshipit-source-id: 9f9f79162dcb988ac4be02a8911401ce448461a9
2025-10-29 15:35:35 -07:00
Eric Rozellandmeta-codesync[bot] 9d498f676d Defer focus until attached (#54309)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54309

We can encounter cases where something is rendered by React but not yet attached to Android at the point focus is called.

If we defer focus until the View is attached to the window, we can avoid apps needing to add annoying timeouts or other creative mechanisms to wait for native mount before calling imperative focus.

The only caveat here is that if you call imperative focus on something offscreen initially that is attached later (e.g., due to clipping), apps could encounter undesirable bugs where focus jumps at the point the previously detached view is now attached. One might also argue it's  bug prone to call focus on something that is far offscreen / you don't plan to mount onscreen immediately.

## Changelog

[Android][Fixed] Defers focus until View is attached

Reviewed By: sbuggay

Differential Revision: D85727424

fbshipit-source-id: 677834aa2d9ba2d3247d1e71b3fe0cdd9a6ec4aa
2025-10-29 11:56:02 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] da5f15a25b Update draft release creation with Hermes V1 (#54313)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54313

This change updates the draft release workflow to add dSYMS for Hermes V1 and also updating the url from where the dSYMs can be downloaded.

## Changelog:
[Internal] -

Reviewed By: j-piasecki

Differential Revision: D85758123

fbshipit-source-id: 7d771266de5b3829e9a39c649b610aaf79aa6206
2025-10-29 11:15:18 -07:00
Peter Abbondanzoandmeta-codesync[bot] b0b434469e Add feature flag for checking if components should send key presses (#54295)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54295

Sets up a feature flag for keydown/keyup events. Split out from actual work implementing the feature to avoid having to run codegen each commit

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D84938062

fbshipit-source-id: b556f347720b4a651cd321996f2914a9c670c7a1
2025-10-29 09:38:32 -07:00
Pieter De Baetsandmeta-codesync[bot] aec3294807 Enable k2 for all targets, remove compiler warnings (#54284)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54284

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D85563230

fbshipit-source-id: 6eb7c6479ad3d0f6d6249a6a320e7835dc298db6
2025-10-29 09:30:10 -07:00
Peter Abbondanzoandmeta-codesync[bot] 242728d6c1 Set sweepActiveTouchOnChildNativeGesturesAndroid default feature flag value to true (#54307)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54307

First of the remaining steps to fully rollout `sweepActiveTouchOnChildNativeGesturesAndroid`. It's already enabled by default everywhere an override is set, letting this bake for a week then going to remove

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D85700377

fbshipit-source-id: 81f5b8679e5562ba6c5dfae331052b181b5258ec
2025-10-29 08:28:49 -07:00
generatedunixname537391475639613andmeta-codesync[bot] a7973378ba xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java (#54311)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54311

Reviewed By: javache

Differential Revision: D85546696

fbshipit-source-id: aec0b077bca68c4a9abef98ee9db41f80edb09d9
2025-10-29 04:39:18 -07:00
Tim Yungandmeta-codesync[bot] 3f971d931c Pressability: Setup Insertion Effect Experiment (#54292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54292

Sets up a feature flag to experiment with using `useInsertionEffect` in `Pressability`, instead of `useEffect.

Using `useInsertionEffect` enables `Pressability` to behave more predictability in component trees with `<Activity mode="hidden">` because the events are scheduled more similarly to platform controls (e.g. focus and blur events will still fire even when "hidden").

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D85612742

fbshipit-source-id: c2faab25bfcf7f964521e680eb3c4132c1087ef4
2025-10-28 12:27:37 -07:00
Phil Pluckthunandmeta-codesync[bot] c0290329cd Fix outputs when iOS artifacts generator is run from Xcode script phase (#54066)
Summary:
An earlier change (0.79 and onwards, I believe?) runs the iOS artifacts code generator script in Xcode as well as from Cocoapods. This duplication runs it twice, but the second step isn't able to load the new `autolinking.json` correctly; See: https://github.com/facebook/react-native/pull/53503

This PR "double" fixes this by:
- simply passing the "real" output directory to the artifacts generator in (`script_phases.sh`) where it's called by Xcode, rather than a temporary directory
- preferring `$RCT_SCRIPT_OUTPUT_DIR` if it's set as an environment variable in the artifacts generator (which it is by `script_phases.sh`)

While this is technically redundant, future changes here make this feel like a safer option, since both conventions overlap in these two places, and the double fix may prevent a regression here in the shortterm and convey what this path is supposed to be in both places.

## Changelog:

[IOS] [FIXED] - Fix autolinking-generated react-native-config output not being used in ReactCodegen script phase due to temp output directory

Pull Request resolved: https://github.com/facebook/react-native/pull/54066

Test Plan:
- Prefer `$RCT_SCRIPT_OUTPUT_DIR` env var for finding `build/generated/autolinking/autolinking.json`
- Always use real `$RCT_SCRIPT_OUTPUT_DIR` as output in `withCodegenDiscovery` in `react_native_pods_utils/script_phases.sh` (which is called by Xcode rather than Cocoapods to invoke the artifacts generator) since the temporary output directory isn't necessary

Reviewed By: javache

Differential Revision: D85673625

Pulled By: cipolleschi

fbshipit-source-id: 9d297fb0ee24f52a0bb7c5a8f41bf770bf63b18f
2025-10-28 10:45:33 -07:00
Peter Abbondanzoandmeta-codesync[bot] 99273f4b01 Replace deprecated postOnAnimationDelayed calls (#54285)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54285

`View#postOnAnimationDelayed` has existed [since API 16](https://developer.android.com/reference/android/view/View#postOnAnimationDelayed(java.lang.Runnable,%20long)) and has been marked as deprecated in ViewCompat [since 1.13.0](https://developer.android.com/reference/androidx/core/view/ViewCompat#postOnAnimationDelayed(android.view.View,java.lang.Runnable,long)). Let's clean it up!

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D85569478

fbshipit-source-id: 7cedf59c9c8fe44d2cec63d7539d955a4fa597e3
2025-10-28 10:10:37 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] 28101284a9 Bump eslint-plugin-react-hooks to 7.0.1 (#54303)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54303

React 19.2.0 introduces the `useEffectEvent`, which are functions that can be used inside `useEffect` but that should not be listed in the `useEffect` dependencies.

Without this bump, eslint will still tell the user to add the function declared with `useEffectEvent` into the dependency array of a useEffect.

## Changelog:
[General][Changed] - Bump eslint-plugin-react-hooks to 7.0.1

Reviewed By: huntie

Differential Revision: D85658780

fbshipit-source-id: 75860f06a2875b53de61f4f99572277d9d04839f
2025-10-28 08:01:13 -07:00
Samuel Suslaandmeta-codesync[bot] a18f7a7c7b Back out "Remove UIManagerCommitHookManager 2/2" (#54302)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54302

Changelog: [Internal]

Original commit changeset: 1c7705187346

Original Phabricator Diff: D85261208

Reviewed By: javache, rubennorte

Differential Revision: D85660275

fbshipit-source-id: 19e6c44871660a53399276445bc2d3ee97cd2ac0
2025-10-28 05:22:28 -07:00
Ruslan Lesiutinandmeta-codesync[bot] afb504c11e Update debugger-frontend from 54afd87...96e6bb8 (#54287)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54287

Changelog: [Internal] - Update `react-native/debugger-frontend` from 54afd87...96e6bb8

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/54afd8765db32a9640edef3788085b991fe4b88a...96e6bb8ecdff166816e2a469b7594f1276bda8c1).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [96e6bb8ec](https://github.com/facebook/react-native-devtools-frontend/commit/96e6bb8ec) | Ruslan Lesiutin (28902667+hoxyq@users.noreply.github.com) | 2025-10-27T14:51:39Z | [feat: use scoped field in trace events to propagate stack traces (#213)](https://github.com/facebook/react-native-devtools-frontend/commit/96e6bb8ec) |

Reviewed By: huntie

Differential Revision: D85579573

fbshipit-source-id: b35d40a79890356761bfdfaeb7ba5c2bc19b93a5
2025-10-28 05:11:21 -07:00
Christoph Purrerandmeta-codesync[bot] e81626e34e Expose MultiPostProcessor for testing (#54296)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54296

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D85624761

fbshipit-source-id: 3adf5edafe7ed8bf416048a347a1fd9e60bfea2a
2025-10-28 00:55:00 -07:00
Nolan O'Brienandmeta-codesync[bot] 916e53f845 Fix implicit fallthrough in switch statements (#54290)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54290

A few places where we fall through intentionally are implicit.  We can make those explicit with `NS_FALLTHROUGH`.  Many places, however, are bugs from failing to add a `break` :eek: -- fix those places too.

These are all found via `-Wimplicit-fallthrough`... we will seek to make this an error by default (vs only in `CompilerWarningLevel.MEDIUM` or higher).

## Changelog:
[iOS] [Fixed] - Add missing `break;` to `-[RCTViewManager pointerEvents]`

Reviewed By: philIip

Differential Revision: D85583441

fbshipit-source-id: e8959b27a2e23ccfc6581286257d5d41b18c5630
2025-10-27 19:35:58 -07:00
Eric Rozellandmeta-codesync[bot] 363d297260 Mitigate int overflow in findNextFocusableElement (#54291)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54291

We are computing a weighted distance by squaring the major and minor axis distance. For particularly long lists, this means that items that are quite far away have a tendency to overflow the int value when squared, producing a negative number that becomes the smallest weighted distance.

Switching the computed value to double should mitigate the issue, since MAX_DOUBLE >>> MAX_INT ^ 2.

## Changelog

[Android][Fixed] - Resolves an int overflow in findNextFocusableElement

Reviewed By: martinbooth

Differential Revision: D85598005

fbshipit-source-id: 2a5de4e10c21f3d42ae5872d311e714b3f92efad
2025-10-27 19:04:38 -07:00
Christoph Purrerandmeta-codesync[bot] d9019a0b27 Remove UIManagerCommitHookManager 2/2 (#54235)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54235

Changelog: [Internal]

Reverting `experimental_prefetchResources` back to `experimental_prefetchResource` for simplicity of use

Reviewed By: lenaic, mdvacca

Differential Revision: D85261208

fbshipit-source-id: 1c7705187346a2422dddb5c106fd372a8ee49283
2025-10-27 18:40:58 -07:00
Intl Schedulerandmeta-codesync[bot] 7a73c8a8a0 translation auto-update for batch 0/61 on master
Summary:
Chronos Job Instance ID: 1125908095431451
Sandcastle Job Instance ID: 2285883636

Processed xml files:
../xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values/strings.xml
../xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/res/systeminfo/values/strings.xml
android_res/rendercore/res/values/strings.xml
../xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/res/devsupport/values/strings.xml
android_res/com/facebook/common/util/res/values/strings.xml
android_res/com/facebook/content/res/values/strings.xml
android_res/com/facebook/common/i18n/res/values/strings.xml
android_res/com/facebook/common/timeformat/res/values/strings.xml
android_res/com/facebook/resources/res/values/strings.xml
android_res/com/facebook/iorg/common/upsell/res/values/strings.xml
android_res/com/facebook/iorg/common/res/values/strings.xml
android_res/com/facebook/dialtone/res/values/strings.xml
android_res/com/facebook/common/strings/external/res/values/strings.xml
android_res/com/facebook/common/strings/res/values/strings.xml
android_res/com/facebook/fbui/widget/pagerindicator/res/values/strings.xml
android_res/com/facebook/fbui/widget/contentview/res/values/strings.xml
android_res/com/facebook/zero/messenger/semi/res/values/strings.xml
android_res/com/facebook/zero/res/values/strings.xml
android_res/com/facebook/zero/common/res/values/strings.xml
android_res/com/facebook/widget/facepile/res/values/strings.xml
android_res/com/facebook/widget/res/values/strings.xml
android_res/com/facebook/tabbar/res/values/strings.xml
android_res/com/facebook/ui/toolbar/res/values/strings.xml
android_res/com/facebook/dialtone/messenger/res/values/strings.xml
libraries/foa/ui/cds/widgets-litho/brandasset/res/values/strings.xml
android_res/com/oculus/twilight/app/res/values/strings.xml
android_res/com/bloks/foa/cds/bottomsheet/strings/res/values/strings.xml
android_res/com/facebook/reportaproblem/res/values/strings.xml
android_res/com/facebook/catalyst/shell/res/values/strings.xml
android_res/com/facebook/horizon/res/values/strings.xml
android_res/com/oculus/twilight/reportaproblem/res/values/strings.xml
android_res/com/facebook/config/appspecific/res/values/strings.xml
android_res/com/facebook/fbavatar/res/values/strings.xml
android_res/com/facebook/messaging/ui/stickerstore/res/values/strings.xml
android_res/com/facebook/stickers/res/values/strings.xml
android_res/com/facebook/messaging/shared/res/values/strings.xml
android_res/com/facebook/caspian/res/values/strings.xml
android_res/com/facebook/timeline/widget/actionbar/res/values/strings.xml
android_res/com/facebook/showpages/res/values/strings.xml
android_res/com/facebook/nux/res/values/strings.xml
android_res/com/facebook/facecast/common/badge/res/values/strings.xml
android_res/com/facebook/nativetemplates/res/values/strings.xml
android_res/com/facebook/video/components/feed/res/values/strings.xml
android_res/com/facebook/runtimepermissions/res/values/strings.xml
android_res/com/oculus/twilight/gcm/messaging/res/values/strings.xml
android_res/com/oculus/twilight/gcm/res/values/strings.xml
android_res/com/oculus/twilight/gcm/messageinvite/res/values/strings.xml
android_res/com/oculus/twilight/gcm/messagefollowback/res/values/strings.xml
android_res/com/oculus/twilight/gcm/followrequest/res/values/strings.xml
android_res/com/facebook/rtc/notification/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/common/res/values/strings.xml
android_res/com/facebook/rtc/runtimepermissions/manager/res/values/strings.xml
android_res/com/facebook/rtc/connectionservice/res/values/strings.xml
android_res/com/facebook/rtc/helpers/connectionservicecoordinator/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/callstatus/participantinfo/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/callstatus/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/incoming/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/participant/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/pip/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/header/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/callcontrols/audioselector/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/callcontrols/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/incall/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/ended/res/values/strings.xml
android_res/com/facebook/payments/dcp/res/values/strings.xml
libraries/smartcapture/common/common-ui/res/values/strings.xml
android_res/com/bloks/common/components/autogenmediagallery/res/values/strings.xml
android_res/com/facebook/ui/mainview/res/values/strings.xml
android_res/com/facebook/audience/stories/storysurface/activity/main/res/values/strings.xml
android_res/com/facebook/wearable/companion/settings/keys/res/values/strings.xml
android_res/com/facebook/stella/res/values/strings.xml
android_res/com/meta/fxmetalogin/res/values/strings.xml
libraries/smartcapture/selfie/selfie-ui/res/values/strings.xml
libraries/smartcapture/id/id-ui/res/values/strings.xml
libraries/smartcapture/id/id-ui-components/res/values/strings.xml
libraries/smartcapture/id/id-sdk/impl/res/values/strings.xml
android_res/com/facebookpay/widget/res/values/strings.xml
android_res/com/facebookpay/ecpexception/res/values/strings.xml
android_res/com/facebookpay/expresscheckout/res/values/strings.xml
android_res/com/fbpay/auth/res/values/strings.xml
android_res/com/oculus/twilight/hsrmobile/res/values/strings.xml
android_res/com/oculus/twilight/calling/res/values/strings.xml
../xplat/messengervr/msys/feature_aggregation/src/i18n/res/values/strings.xml
android_res/com/oculus/socialplatform/msys/res/values/strings.xml
android_res/com/facebook/voltron/fbdownloader/res/values/strings.xml
android_res/com/facebook/ui/emoji/res/values/strings.xml
android_res/com/facebook/ui/emoji/common/res/values/strings.xml
android_res/com/facebook/presence/status/res/values/strings.xml
android_res/com/facebook/auth/res/values/strings.xml
android_res/com/facebook/rooms/mainapp/permissions/res/values/strings.xml
android_res/com/facebook/rooms/mainapp/precheck/res/values/strings.xml
android_res/com/facebook/messaging/presence/res/values/strings.xml
android_res/com/oculus/twilight/primarydex/res/values/strings.xml
android_res/com/facebook/appupdate/res/values/strings.xml
android_res/com/facebook/wearable/apps/activities/res/values/strings.xml
android_res/com/facebook/wearable/apps/activities/dailynudge/res/values/strings.xml
android_res/com/facebook/wearable/apps/activities/socialwellness/res/values/strings.xml
android_res/com/facebook/wearable/apps/activity_watchface/res/values/strings.xml
android_res/com/facebook/wearable/apps/assistant/res/values/strings.xml
android_res/com/facebook/wearable/apps/avatar/res/values/strings.xml

allow-large-files
ignore-conflict-markers
opt-out-review
drop-conflicts

Differential Revision: D85620003

fbshipit-source-id: 48bf25db80a647fb558d7cca1c960a4a909c6388
2025-10-27 16:57:13 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] b5321041a1 Bump Machines to macos-15 (#54280)
Summary:
GH asked us to bump the machines from macos-14 to macos-15

## Changelog:
[Internal] -

Pull Request resolved: https://github.com/facebook/react-native/pull/54280

Test Plan: GHA

Reviewed By: javache

Differential Revision: D85570467

Pulled By: cipolleschi

fbshipit-source-id: 659b9c538a883b7bca1c6aeb2d1a7dceb6a22663
2025-10-27 15:41:36 -07:00
nishan (o^▽^o)andmeta-codesync[bot] 1198a55d50 Add grayscale, drop-shadow and saturate filter support on iOS (#53873)
Summary:
This PR adds support for `grayscale`, `drop-shadow` and `saturate` filter support on iOS as discussed here - https://github.com/react-native-community/discussions-and-proposals/issues/927

## Changelog:

[IOS] [ADDED] - Add grayscale, drop-shadow and saturate CSS filters

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/53873

Test Plan:
Test Filter screen in RNTester app. Checkout `grayscale`, `drop-shadow` and `saturate` examples. Results are consistent on android and iOS.

<img width="auto" height="300" alt="Screenshot 2025-09-22 at 1 07 28 PM" src="https://github.com/user-attachments/assets/f26fc60a-48f6-4aa2-82e9-56e986082fed" />

<img width="auto" height="300" alt="Screenshot 2025-09-22 at 1 08 08 PM" src="https://github.com/user-attachments/assets/d87925c8-f05c-4ed2-a651-8c7670339f87" />

<img width="auto" height="300" alt="Screenshot 2025-09-22 at 2 37 30 PM" src="https://github.com/user-attachments/assets/582fcadf-1189-4f01-9868-ff9fe71eeda0" />

## Aside

Will do one more PR to add remaining filters. Splitting into two to keep it easier to review.

Reviewed By: cipolleschi, jorge-cab

Differential Revision: D85352008

Pulled By: joevilches

fbshipit-source-id: 33931ceeaa6f47cf39988c8696bd90f659ade730
2025-10-27 14:50:27 -07:00
Ruslan Lesiutinandmeta-codesync[bot] f9e3db512b jsinspector: refactor domain notifications implementation (#54244)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54244

# Changelog: [Internal]

Refactors the logic a bit.

We will use `Runtime` domain as a signal for installation of `console.createTask()` implementation.

Reviewed By: huntie

Differential Revision: D85274860

fbshipit-source-id: 80c91a8a83ba2b95b70aa38a72529bbd20275c0d
2025-10-27 08:32:46 -07:00
Ruslan Lesiutinandmeta-codesync[bot] 8253a34883 Remove unused methods from RuntimeAgent (#54261)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54261

# Changelog: [Internal]

These are actually unused and we've changed the approach - CDP agents do not control tracing status.

Reviewed By: huntie

Differential Revision: D85436029

fbshipit-source-id: faa79bbda92c0e0c55f26389bfe0c6efcf9e76c8
2025-10-27 08:32:46 -07:00
LS Hungandmeta-codesync[bot] 796d182d89 Add missing INIT_REACT_RUNTIME_START and APP_STARTUP_START in loadScript (#54255)
Summary:
Resolves https://github.com/facebook/react-native/issues/53818

On a freshly init bare react native project, upon booting up the iOS simulator, the logs shows the following warnings:
```
Unbalanced calls start/end for tag 20
Unbalanced calls start/end for tag 19
```

The detailed cause is explained in [this comment in the issue thread](https://github.com/facebook/react-native/issues/53818#issuecomment-3441319443), and I'm copying it here for ease of reading:

> The `Unbalanced calls start/end for tag 20` message comes from [RCTPerformanceLogger.markStartForTag](https://github.com/facebook/react-native/blob/2d980558a616d13c542a1d0f8659beb04d31ab08/packages/react-native/React/Base/RCTPerformanceLogger.mm#L78)
>
> 19 represents `RCTPLAppStartup` case of `RCTPLTag` (react performance logger tag), and 20 represents `RCTPLInitReactRuntime`
>
> In C++, they are also referred to as `ReactMarker::APP_STARTUP_STOP` and `ReactMarker::INIT_REACT_RUNTIME_STOP` respectively (see [here](https://github.com/facebook/react-native/blob/2d980558a616d13c542a1d0f8659beb04d31ab08/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTPerformanceLoggerUtils.mm#L21) and [here](https://github.com/facebook/react-native/blob/2d980558a616d13c542a1d0f8659beb04d31ab08/packages/react-native/React/CxxBridge/RCTCxxBridge.mm#L116))
>
> The performance logger logs these "stop" events inside [ReactInstance::loadScript](https://github.com/facebook/react-native/blob/2d980558a616d13c542a1d0f8659beb04d31ab08/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp#L270-L271).
>
> Notice that [L267-272](https://github.com/facebook/react-native/blob/2d980558a616d13c542a1d0f8659beb04d31ab08/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp#L267-L272), we have:
> ```
>     if (hasLogger) {
>       ReactMarker::logTaggedMarkerBridgeless(
>           ReactMarker::RUN_JS_BUNDLE_STOP, scriptName.c_str());
>       ReactMarker::logMarkerBridgeless(ReactMarker::INIT_REACT_RUNTIME_STOP);
>       ReactMarker::logMarkerBridgeless(ReactMarker::APP_STARTUP_STOP);
>     }
> ```
>
> But earlier in [L241-244](https://github.com/facebook/react-native/blob/2d980558a616d13c542a1d0f8659beb04d31ab08/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp#L241-L244), we have:
> ```
>     if (hasLogger) {
>       ReactMarker::logTaggedMarkerBridgeless(
>           ReactMarker::RUN_JS_BUNDLE_START, scriptName.c_str());
>     }
> ```

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[IOS] [FIXED] - Address unexpected warning about "Unbalanced calls start/end for tag 20/19"

Pull Request resolved: https://github.com/facebook/react-native/pull/54255

Test Plan:
Steps to reproduce are described by original issue reporter [here](https://github.com/facebook/react-native/issues/53818#issue-3426203510). The issue surfaced in a freshly init bare react native project

1. Create a bare react-native project
2. Run iOS simulator
3. "Unbalanced calls start/end for tag 20/19" does not show up in Xcode terminal

Reviewed By: javache

Differential Revision: D85421729

Pulled By: cipolleschi

fbshipit-source-id: f80c0dd18e1d4817b1111af29ca516b494742d5a
2025-10-27 04:00:29 -07:00
Daewoon Kimandmeta-codesync[bot] 0cadb8cfc8 Suppress DEPRECATION warnings for checking scaledDensity on some tests (#54278)
Summary:
Suppress DEPRECATION warnings for checking scaledDensity on some tests.

## Changelog:

[Internal] Suppress DEPRECATION warnings for checking scaledDensity on some tests.

Pull Request resolved: https://github.com/facebook/react-native/pull/54278

Test Plan: none

Reviewed By: cipolleschi, fabriziocucci

Differential Revision: D85554602

Pulled By: javache

fbshipit-source-id: 26a8e6a4c658581dbf17358f7b1a791513fb1933
2025-10-27 03:32:41 -07:00
Nikita Lutsenkoandmeta-codesync[bot] 59affc38a6 clang-format | Format fbsource with clang-format 21.
Reviewed By: ChristianK275

Differential Revision: D85317706

fbshipit-source-id: b399c5c4b75252999442b7d7d2778e7a241b0025
2025-10-26 23:40:59 -07:00
Zeya Pengandmeta-codesync[bot] 43f464b218 pass down isAsync arg to start/stopOnRenderCallback to indicate thread (#54252)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54252

## Changelog:

[Internal] [Added] - pass down isAsync arg to start/stopOnRenderCallback to indicate thread

make it more explicit where start/stopOnRenderCallback is invoked so we can handle it on each platform in a more thread safe way

Reviewed By: lenaic

Differential Revision: D85365058

fbshipit-source-id: 5f0ee1343547fe3466fcd23282e0f27e129a2e7d
2025-10-24 11:52:48 -07:00
Daewoon Kimandmeta-codesync[bot] 642f086b8c Fix text not scaling down when system fontScale < 1.0 (#54238)
Summary:
Fixes https://github.com/facebook/react-native/issues/54168

In React Native 0.82.0, text on Android does not scale down when the system font scale is set to less than 1.0 (e.g., 85%). This regression was introduced when `PixelUtil.toPixelFromSP()` was changed to use `DisplayMetricsHolder.getScreenDisplayMetrics()` instead of `getWindowDisplayMetrics()` in commit [1ad2ec09](https://github.com/facebook/react-native/commit/1ad2ec099ac0ccc7402c37783004fbad3dbe0484).

The issue occurs because:
1. **windowDisplayMetrics** is obtained from `context.resources.displayMetrics` and includes the system font scale from `Configuration`
2. **screenDisplayMetrics** is populated by `Display.getRealMetrics()`, which returns physical display metrics **without** the system font scale setting ([Reference](https://developer.android.com/reference/android/view/Display#getRealMetrics(android.util.DisplayMetrics)))

When `getRealMetrics()` is called, it overwrites the `scaledDensity` value (which is `density * fontScale`), effectively resetting it to just `density` and losing the user's font scale preference.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ANDROID] [FIXED] - Fix text not scaling down when system fontScale < 1.0

Pull Request resolved: https://github.com/facebook/react-native/pull/54238

Test Plan:
https://github.com/kdwkr/rn-0.82.0-android-layout-scale
Tested with this reproducer

 ---

Reviewed By: javache

Differential Revision: D85350263

Pulled By: alanleedev

fbshipit-source-id: ff646cf0405f689ff2a9166a1474fdb8b1b85fd6
2025-10-24 10:49:55 -07:00
Nick Lefeverandmeta-codesync[bot] 851d59a620 Add fantom test for syncOnCommit with passChildrenWhenCloning bug fix (#54264)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54264

Implementing a fantom test covering the correct update of runtime shadow node references when using passChildrenWhenCloningPersistedNodes combined with syncOnCommit.

Changelog: [Internal]

Reviewed By: sbuggay

Differential Revision: D85437783

fbshipit-source-id: adad786e293c1acfe13e3a07ffb210dec0c17292
2025-10-24 10:20:43 -07:00
Nick Lefeverandmeta-codesync[bot] 91d5e99158 Fix missing reference updates with syncOnCommit (#54263)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54263

When enabling `passChildrenWhenCloningPersistedNodes` and `updateRuntimeShadowNodeReferencesOnCommit`, updates inserting shadow nodes between existing child shadow nodes would result in shadow node reference updates being skipped.

Since `passChildrenWhenCloningPersistedNodes` requires that the react fiber references the mounted shadow node instance at all times, this would result in invalid react renders, bringing back old revisions holding invalid layout metrics.

This diff updates the reference update applied on commit, submitting the updated shadow node references for added shadow nodes. Inserted shadow nodes between existing child shadow nodes will move the previously mounted shadow nodes to the end of the child array. This leads to the `updateMountedFlag` pass to consider these as "added" shadow nodes.

Changelog: [Internal]

Reviewed By: sbuggay

Differential Revision: D85406405

fbshipit-source-id: 7bd9a492fc67549970183c0932cfd7c8b7e61312
2025-10-24 10:20:43 -07:00
nishan (o^▽^o)andmeta-codesync[bot] 3d08683d0f feat(JS): background-size, position and repeat styles (#52284)
Summary:
This PR adds support for background size, position and repeat styles. It follows the [CSS](https://www.w3.org/TR/css-backgrounds-3/#backgrounds) spec. Currently we default to `background-origin: padding-box` and `background-clip : border-box` to match the web's behavior. We can introduce these styles later. I have split the PR intro three parts for review. This PR includes JS parsing and style propagation to native changes. I wanted to introduce one style at a time, but CSS spec is such that size, position and repeat are intertwined.

## Changelog:
[GENERAL][ADDED] - Background size, position and repeat styles.
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/52284

Test Plan:
Merge the [iOS](https://github.com/facebook/react-native/pull/52283) and [android](https://github.com/facebook/react-native/pull/52282) PR into this, this PR includes `BackgroundImageExample`. I have also added testcases for parsing syntax in JS.

https://github.com/user-attachments/assets/b7192fdf-52ba-4eb0-a1be-d47c72d87e92

Reviewed By: joevilches

Differential Revision: D82973282

Pulled By: jorge-cab

fbshipit-source-id: a94e33962c6708be963e1cac049da50d4764da64
2025-10-24 10:13:25 -07:00
nishan (o^▽^o)andmeta-codesync[bot] e859293674 feat(android): background-size, position and repeat styles (#52282)
Summary:
This PR adds support for background size, position and repeat styles. It follows the [CSS](https://www.w3.org/TR/css-backgrounds-3/#backgrounds) spec. Currently we default to `background-origin: padding-box` and `background-clip : border-box` to match the web's behavior. We can introduce these styles later. I have split the PR intro three parts for review. This PR includes android only changes. I wanted to introduce one style at a time, but CSS spec is such that size, position and repeat are intertwined.

## Changelog:
[ANDROID][ADDED] - Background size, position and repeat styles.
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/52282

Test Plan:
Merge the [JS](https://github.com/facebook/react-native/pull/52284) PR, rebuild android app and test RNTester app, it includes `BackgroundImageExample`. I have also added testcases for parsing syntax in JS.

https://github.com/user-attachments/assets/b7192fdf-52ba-4eb0-a1be-d47c72d87e92

Reviewed By: joevilches

Differential Revision: D82993837

Pulled By: jorge-cab

fbshipit-source-id: 52859e51d2c4bab27823d3eb913993fdfbb4c04d
2025-10-24 10:13:25 -07:00
nishan (o^▽^o)andmeta-codesync[bot] d8c2f1c883 feat(iOS): background-size, position and repeat styles (#52283)
Summary:
This PR adds support for background size, position and repeat styles. It follows the [CSS](https://www.w3.org/TR/css-backgrounds-3/#backgrounds) spec. Currently we default to `background-origin: padding-box` and `background-clip : border-box` to match the web's behavior. We can introduce these styles later. I have split the PR intro three parts for review. This PR includes iOS only changes. I wanted to introduce one style at a time, but CSS spec is such that size, position and repeat are intertwined.

## Changelog:
[IOS][ADDED] - Background size, position and repeat styles.
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/52283

Test Plan:
Merge the [JS](https://github.com/facebook/react-native/pull/52284) PR, run `pod install` and test RNTester example, it includes `BackgroundImageExample`. I have also added testcases for syntax parsing in JS.

https://github.com/user-attachments/assets/b7192fdf-52ba-4eb0-a1be-d47c72d87e92

Reviewed By: joevilches

Differential Revision: D82993888

Pulled By: jorge-cab

fbshipit-source-id: af545acaf4b9d116b5905f912c494d2e77324380
2025-10-24 10:13:25 -07:00
Alex Huntandmeta-codesync[bot] d9262c60f4 Update BG trace label based on touch support (#54247)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54247

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D85253083

fbshipit-source-id: 4f87e9200c1ade237fd184349add88ca263aaab3
2025-10-24 04:08:17 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] c7fb31ce5d Fix releases and nightlies after moving hermes to Hermes repo (#54257)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54257

When moving Hermes to the Hermes repo, we mistakenly updated the nightly and the publish_release job to depend on an non-existing job

## Changelog:
[Internal] - Fix CI jobs for nightlies and releases

Reviewed By: huntie

Differential Revision: D85422837

fbshipit-source-id: 18d4ef73c80032b55f09f27e4b58b399f0a148c9
2025-10-24 03:19:44 -07:00
Jakub Piaseckiandmeta-codesync[bot] 58bd51e7e2 Increase the maximum number of pointers tracked at the same time on iOS to 17 (#54248)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54248

Changelog: [IOS][FIXED] - Raised the maximum number of pointers tracked at the same time to 17

The current pool of pointer ids that can be used at the same time has the size of 11, while the maximum supported by some of the devices is 17 - https://developer.apple.com/forums/thread/17606.

To reproduce this problem use the iPad pro and place more than 11 pointers on the screen - the app becomes unresponsive due to [an infinite loop](https://github.com/facebook/react-native/blob/d93d32547bfadba731999ea251ca5e1d6c6c8912/packages/react-native/React/Fabric/Utils/RCTIdentifierPool.h#L22).

Reviewed By: cipolleschi

Differential Revision: D85345975

fbshipit-source-id: df6ba61f933406e7dc4e31382b35f002611fa433
2025-10-24 03:03:03 -07:00
Jakub Piaseckiandmeta-codesync[bot] fcb51b1392 Change value of HERMESVM_HEAP_HV_MODE on Android (#54240)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54240

Changelog: [Android][Changed] Changed value of `HERMESVM_HEAP_HV_MODE` to `HEAP_HV_PREFER32` for Hermes V1

Reviewed By: cipolleschi

Differential Revision: D85329156

fbshipit-source-id: c7d0a948b1262d081cf0b2c9972f89a8efcf3808
2025-10-24 02:59:21 -07:00
Christoph Purrerandmeta-codesync[bot] 2d980558a6 Remove UIManagerCommitHookManager 1/2 (#54234)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54234

Changelog: [Internal]

This feature does not work reliably and caused crashes during experimentation

Reviewed By: lenaic

Differential Revision: D85259390

fbshipit-source-id: 5b3d48e411f1e8fae2ee8c64166b53a28b1211d1
2025-10-23 18:57:28 -07:00
Ruslan Lesiutinandmeta-codesync[bot] d93d32547b Group sampling methods in header files (#54243)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54243

# Changelog: [Internal]

Just formatting.

Reviewed By: sbuggay

Differential Revision: D85266409

fbshipit-source-id: 7435fe1cb82d94a9e19cbba631f812d2b821f68a
2025-10-23 07:35:41 -07:00
Vitali Zaidmanandmeta-codesync[bot] 94995fdd9f add rules to prefer Error objects to be thrown and rejected (#54229)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54229

Changelog: [General][Added] Added eslint rule to warn when a non-error is being thrown from a function or rejected for a promise.

Reviewed By: huntie

Differential Revision: D85237916

fbshipit-source-id: e0e4fbc6b4620a19be1959d3953856c7e44ad4e0
2025-10-23 06:42:55 -07:00
Vitali Zaidmanandmeta-codesync[bot] 9cadfe6607 add meaningful error reported from functions (#54230)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54230

Changelog: [General][Added] add meaningful error reporting when `AccessibilityInfo`'s methods are not available.

Reviewed By: javache

Differential Revision: D85162912

fbshipit-source-id: 3a233cfa54cefd3463e59d125053d4ffdd32be9b
2025-10-23 06:42:55 -07:00
Sam Zhouandmeta-codesync[bot] a729160dfa Deploy 0.289.0 to xplat
Summary:
[changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D85310296

fbshipit-source-id: 5c657dd986c85c1b6d29f627bc55d7f85b4e5d36
2025-10-23 06:42:11 -07:00
Jakub Piaseckiandmeta-codesync[bot] b8463053d4 Add Hermes version to the new app screen (#54241)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54241

Changelog: [Internal]

Added Hermes version besides information that the app is running using Hermes. This information will be helpful now that Hermes is being published independently from React Native and users are able to choose between two versions at a time (current and V1).

Reviewed By: cipolleschi

Differential Revision: D85333735

fbshipit-source-id: b07b75be3e3d4b5424d4c2185916bac507fc5eca
2025-10-23 04:45:45 -07:00
Luna Weiandmeta-codesync[bot] b823b26a37 Add support for rootMargin (#54176)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54176

Changelog: [Internal] - Add support for `rootMargin` for IntersectionObserver.

Reference:
- https://www.w3.org/TR/intersection-observer/#dom-intersectionobserver-rootmargin
- https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/rootMargin

Reviewed By: rubennorte

Differential Revision: D84787370

fbshipit-source-id: 752a9a32becde73d1a92469f9b74240918519b24
2025-10-22 16:40:18 -07:00
Peter Abbondanzoandmeta-codesync[bot] ed75963c0d Run flingAndSnap logic from ACTION_SCROLL events (#54226)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54226

https://github.com/facebook/react-native/pull/54226

Joysticks, mouse wheels, and trackpads can issue an `ACTION_SCROLL` event when performing scroll. However, the `ACTION_SCROLL` generic motion event does not run the post touch runnable and paging/snap alignment is not honored when these events are received. To fix this, both ScrollView implementations should call `handlePostTouchScrolling` with a 0 velocity, ensuring that momentum events are sent, fabric scroll state is updated, and `flingAndSnap` is properly called to align to a page.

This change adds some checks to queue a runnable that calls `handlePostTouchScrolling` after no more `ACTION_SCROLL` events are received in the same 20ms delay it uses to determine a stable frame. The end result is that snap alignments are correctly honored

Changelog: [Android][Fixed] - Controller-driven scroll events now honor paging/snap alignment

Reviewed By: javache

Differential Revision: D85172309

fbshipit-source-id: 5818777b3c371b3da4aa925a8c840e0da89bf6a4
2025-10-22 15:45:47 -07:00
Calix Tangandmeta-codesync[bot] 6f8432330c Hotfix VirtualViewContainerStateExperimental delete (#54236)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54236

Changelog[Internal] -
Fix faulty changes made to Interval Tree in previous diff.

The issue was in the right-right rotation case of the internal Interval Tree implementation:

```
// Right heavy
    if (bf < -1) {
      if (balanceFactor(node.right) > 0) {
        node.right =
            rotateRight(...)
```

This diff also includes a minor update to logic in IntervalTree's `delete` operation.  There was previously a missing `balance` operation.

Reviewed By: lunaleaps

Differential Revision: D85263661

fbshipit-source-id: 8636984161a8668d74973b6aebad9842d4d7f34f
2025-10-22 14:04:26 -07:00
Zeya Pengandmeta-codesync[bot] 9f7a3bb2ff Allow passing down frameRateListenerCallback in cxx animated (#54142)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54142

## Changelog:

[Internal] [Added] - Allow passing down frameRateListenerCallback in cxx animated

exposing `frameRateListenerCallback` to add instrumentation at animation frame and stop
we're deferring the actual implementation of frame rate listening/logging to app/platform side

Reviewed By: sammy-SC

Differential Revision: D84510183

fbshipit-source-id: d8835542e8e50c5018032c951a510fec27b5a4d5
2025-10-22 11:45:32 -07:00
Zeya Pengandmeta-codesync[bot] 4c7351d9b1 always invoke onRender via UIManagerNativeAnimatedDelegate (#54211)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54211

## Changelog:

[Internal] [Added] - always invoke onRender via UIManagerNativeAnimatedDelegate

Previously only android invokes `onRender` via UIManagerNativeAnimatedDelegate::runAnimationFrame()
consolidating so it's easier for debugging, also in cases where we want to add extra work per frame (e.g. add performance logging) in AnimatedNodesManagerProvider

Reviewed By: sammy-SC

Differential Revision: D85071075

fbshipit-source-id: 770df523de506c8442d063c417229e36bcf5dd31
2025-10-22 11:45:32 -07:00
Rick Hanlonandmeta-codesync[bot] a6fab2192a remove isomorphic version checks from legacy react native renderers (#54232)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54232

We're not syncing the legacy renderers, which means the React package will continue to move forward while these stay frozen. That means we need to remove the version compatibility checks between react and the legacy ReactNativeRenderers.

Changelog:
[Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D85248891

fbshipit-source-id: 19e0812c59f69301e2666e6272c10ac56ecbde1f
2025-10-22 11:01:43 -07:00
Jakub Piaseckiandmeta-codesync[bot] 5fcbd64986 Clean up hermes-utils (#54208)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54208

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D85047132

fbshipit-source-id: 859ca41e5513e914a708b43c0cd795cb665a5ea4
2025-10-22 09:48:13 -07:00
Jakub Piaseckiandmeta-codesync[bot] 77164aaa29 Don't publish Hermes artifacts from the React Native Repository (#53986)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53986

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D83137498

fbshipit-source-id: 63203406002a31d0f2d9cf7577274f6e33544c74
2025-10-22 09:48:13 -07:00
Jakub Piaseckiandmeta-codesync[bot] e2165619dd Remove steps related to building hermes (#53901)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53901

Changelog: [Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D83051151

fbshipit-source-id: a88efd5ff908568a7b85ce6a6812103ee963766e
2025-10-22 09:48:13 -07:00
Jakub Piaseckiandmeta-codesync[bot] e3287d9699 Use the Hermes artifacts in actions (#53837)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53837

Changelog: [Internal]

Replaces usage of Hermes built inside the React Native repository with the release published from the Hermes repo.

Reviewed By: cipolleschi

Differential Revision: D82721725

fbshipit-source-id: 357d5e2b914675ec6e60f810c382a945aa461732
2025-10-22 09:48:13 -07:00
Jakub Piaseckiandmeta-codesync[bot] 27bb34c006 Always use Hermes artifacts published from Hermes repository (#53833)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53833

Changelog: [GENERAL][CHANGED] - Use Hermes artifacts published independently from React Native

Reviewed By: cortinico

Differential Revision: D82626463

fbshipit-source-id: 99a34a34c53b7f8f1c0da3da8a0e750e42a2e9b7
2025-10-22 09:48:13 -07:00
Jakub Piaseckiandmeta-codesync[bot] 406dd87290 Update release processes to update the Hermes versions independently from React Native (#53985)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53985

Changelog: [Internal]

Updates the release scripts to set the Hermes version independently from React Native.

Reviewed By: cipolleschi

Differential Revision: D82438054

fbshipit-source-id: 154c19d1d0d16fd5879ad663428d803ceadc5a1f
2025-10-22 09:48:13 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] 93c17cd0c4 Add changelog for 0.79.7 (#54224)
Summary:
Add changelog for 0.79.7

## Changelog:
[Internal] -

Pull Request resolved: https://github.com/facebook/react-native/pull/54224

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D85168976

Pulled By: cipolleschi

fbshipit-source-id: 6807d1df9da62043f87bedf0d0209cd81fda816c
2025-10-21 16:59:30 -07:00
Rick Hanlonandmeta-codesync[bot] 0c5a22003b Apply fixup patch to fbsource
Summary:
This is an automatically generated fixup patch to bring fbsource back into sync with
facebook/react's builds/facebook-fbsource branch on GitHub. Land this patch as soon as possible, as the difference
reflected on here is already on GitHub and future changes may depend on these
changes!

<< DO NOT EDIT BELOW THIS LINE >>
diff-train-skip-merge

Generated by: https://www.internalfb.com/intern/sandcastle/job/9007201517475550/

GitHub Repo: facebook/react

# Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D84722100

fbshipit-source-id: cbc6f4cdec01124b00ca011b1667c4f7bdb98a37
2025-10-21 15:20:16 -07:00
Ramanpreet Naraandmeta-codesync[bot] e2c803435c c++: Simplify native module lookup (#54227)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54227

All these flags were introduced for rollout purposes. We no longer need them. Let's get rid of them

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D85171189

fbshipit-source-id: 4bd0531dfc3a9841fbe7db9a8f80329e04896e08
2025-10-21 15:05:35 -07:00
Rubén Norteandmeta-codesync[bot] 1a02e8bffe Simplify tests passing refs to Fantom instead of nodes (#54222)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54222

Changelog: [internal]

Reduce boilerplate in some tests now that we can pass refs to some Fantom APIs.

Reviewed By: javache

Differential Revision: D85143176

fbshipit-source-id: 0e107891f1027a185821e21e5fa76f019cec5bb1
2025-10-21 09:34:49 -07:00
Rubén Norteandmeta-codesync[bot] e58bbbcd8e Allow passing refs where nodes are expected (#54221)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54221

Changelog: [internal]

Small change in the Fantom API to accept refs and reduce boilerplate. See next diff for examples

Reviewed By: javache

Differential Revision: D85143177

fbshipit-source-id: fd65abcc1b107df8726fee172b284f5dc96e88a6
2025-10-21 09:34:49 -07:00
Alan Hughesandmeta-codesync[bot] bd004e0c12 Add changelog for v0.82.1 (#54216)
Summary:
Add Changelog for 0.82.1

## Changelog:
[Internal] - Add Changelog for 0.82.1

Pull Request resolved: https://github.com/facebook/react-native/pull/54216

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D85137528

Pulled By: cortinico

fbshipit-source-id: 3705a91227874f3ac5e006b8b3e2d26acaf91a2f
2025-10-21 08:24:36 -07:00
Moti Zilbermanandmeta-codesync[bot] 74d3472e2f Better source locations for EXPECT_CALL failures (#54129)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54129

Changelog: [Internal]

The team maintaining gmock is [uninterested, as a matter of principle,](https://github.com/google/googletest/issues/2646#issuecomment-630919122) in improving the ergonomics of writing helper functions around `EXPECT_CALL`. However, such helpers have proven very useful for the `jsinspector-modern` C++ test suite. The out-of-the-box ergonomics *are* pretty bad, though, so this diff tries to improve the situation.

The biggest offender in our test suite is the `expectMessageFromPage` helper function - if a test fails because an expectation isn't met, the error message points to the `EXPECT_CALL` line inside `expectMessageFromPage`, which is utterly useless compared to the line of test code that *called* `expectMessageFromPage`.

Here, we reach into gmock's internals slightly to create a variant of the `EXPECT_CALL` macro that allows passing in a [`std::source_location`](https://en.cppreference.com/w/cpp/utility/source_location.html) (thanks, C++20!). We then teach `expectMessageFromPage` and other such helpers to capture a source location at the call site (using a parameter with a default value to `source_location::current()`) and use the modified macro to pass it into gmock.

Reviewed By: huntie

Differential Revision: D84368993

fbshipit-source-id: 62f64b6c5f626a54bc3da7143d84ee2d75d16ac6
2025-10-21 08:19:02 -07:00
Moti Zilbermanandmeta-codesync[bot] f7cc2e565a Add tests for Tracing domain reporting of network requests (#54128)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54128

Changelog: [Internal]

Adds an integration test for `NetworkReporter`'s CDP Tracing domain output (via `PerformanceTracer` behind the scenes), i.e. the traces that power the Network track in the Performance panel in React Native DevTools.

The test covers the `Tracing` and `Network` domains being enabled simultaneously, as well as `Tracing` on its own.

Reviewed By: huntie

Differential Revision: D84337901

fbshipit-source-id: f82af33575806fc3b99636cdb1eb9803c04c8c07
2025-10-21 08:19:02 -07:00
Pieter De Baetsandmeta-codesync[bot] 708f527ec7 Ensure JVM thread is attached when destroying FabricMountingManager (#54218)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54218

Observed some crashes coming from `schedulerDidRequestPreliminaryViewAllocation` which seemed to point at the FabricMountingManager being destroyed from the Hades GC thread. That thread is not attached to the JVM, so would crash when trying to destroy this global_ref.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D85143603

fbshipit-source-id: 2ecd42d57188e6f3d69a6124e21ee8913b3d5b89
2025-10-21 06:33:11 -07:00
Ruslan Lesiutinandmeta-codesync[bot] f4a942254a fix: add clearMarks and clearMeasures to performance global stub (#54214)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54214

# Changelog: [Internal]

React started using `clearMeasures` in https://github.com/facebook/react/pull/34803. It only does it if `performance.measure()` is defined. This should be enough for a  feature check of User Timings API presence, but out stub doesn't follow the same spec.

Adding `clearMarks()` and `clearMeasures()` stubs to the object.

Reviewed By: rubennorte

Differential Revision: D85082720

fbshipit-source-id: 3b117a6545e131cdbb2d5efb73d500a928469864
2025-10-21 06:18:18 -07:00
Dawid Maleckiandmeta-codesync[bot] 4ddf2ce64f Android: Add new configuration for DevSupportManager (#53557)
Summary:
Following the [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/925), this PR adds new `DevMenuConfiguration` object and extends `ReactHost` API for passing settings to the particular `DevSupportManager`.  The `DevMenuConfiguration` includes:

- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled,

## Changelog:

[ANDROID][ADDED] - Add new configuration for `RCTDevMenu`

Pull Request resolved: https://github.com/facebook/react-native/pull/53557

Test Plan:
Tested with different configuration on `DevMenuConfiguration`:

<details>
<summary>Click to view code</summary>

```kt
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    fullyDrawnReporter.addReporter()
    maybeUpdateBackgroundColor()

    reactDelegate?.reactHost?.let { reactHost ->
      val devMenuConfiguration = DevMenuConfiguration(
        isDevMenuEnabled = true,
        isShakeGestureEnabled = false,
        areKeyboardShortcutsEnabled = false,
      )
      reactHost.setDevMenuConfiguration(devMenuConfiguration)
    }

    // register insets listener to update margins on the ReactRootView to avoid overlap w/ system
    // bars
    reactDelegate?.reactRootView?.let { rootView ->
      val insetsType: Int =
          WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout()

      val windowInsetsListener = { view: View, windowInsets: WindowInsetsCompat ->
        val insets = windowInsets.getInsets(insetsType)

        (view.layoutParams as FrameLayout.LayoutParams).apply {
          setMargins(insets.left, insets.top, insets.right, insets.bottom)
        }

        WindowInsetsCompat.CONSUMED
      }
      ViewCompat.setOnApplyWindowInsetsListener(rootView, windowInsetsListener)
    }
  }
```

</details>

Reviewed By: vzaidman, cortinico

Differential Revision: D81684310

Pulled By: coado

fbshipit-source-id: 4e2c27ffc68037432587f4920b243f3dfdccb2fb
2025-10-21 02:38:33 -07:00
Calix Tangandmeta-codesync[bot] 328d07a30d Implement VirtualViewContainerStateExperimental (interval tree, updateModes optimization) (#54213)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54213

## Changelog: [Internal]
Modifies `VirtualViewContainerStateExperimental` to use an interval tree to store the container's VirtualViews. Interval tree's query allows us to lower the frequently-used updateModes() operation from `O(n)` to `O(m + log n)`, where `m` is the number of VirtualViews in the hysteresis range. General layout changes incur a penalty due to the requirement of maintaining a balanced BST.

Performance Changes:
* updateModes(): `O(n) -> O(m + log n)` (new algo)
* updateMode(): `O(1) -> O(1)`
* add VV: `O(1) -> O(log n)`
* update VV: `O(1) -> O(log n)`
* delete VV: `O(1) -> O(log n)`

We expect scrolling to be much more frequent than a total layout change/updating many of the elements in the container at once. However, the initial load of a page will take `O(n log n)` time rather than `O(n)` time.

We also include some bookkeeping sets for "old" hysteresis, prerender, and visible VVs. This will increase the memory footprint of `VirtualViewContainerState` by `O(m)`.

More details are in https://docs.google.com/document/d/1Cmamx6fNfruoHLApX8tedqNVZsCEUyoBvQWpMvBsfcY/edit?tab=t.gqla6vu3231k.

### Note
This diff only covers the Android version. iOS may follow after experimentation.

Reviewed By: lunaleaps

Differential Revision: D83783201

fbshipit-source-id: 93a7a93784d668e09d8ddacc7e30d289ccd8b7a2
2025-10-20 19:08:52 -07:00
Calix Tangandmeta-codesync[bot] 793f99d949 Split VirtualViewContainerState into classic, experimental versions [Android] (#54162)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54162

Changelog [Internal]:

Splits VirtualViewContainerState implementation into three parts: (1) an abstract parent class, (2) the "classic" version (existing version), and (3) the "experimental" version (new changes to be made). The experimental version is a copy of the classic version for now.

Reviewed By: lunaleaps

Differential Revision: D84569206

fbshipit-source-id: b41cd9faf06d2de0dff17148ded72193107e5b9e
2025-10-20 19:08:52 -07:00
Calix Tangandmeta-codesync[bot] f4acf23374 Refactor debugLog in ReactVirtualViewExperimental.kt (#54157)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54157

Changelog [Internal]
Removes unnecessary `debugLog` import in ReactVirtualViewExperimental and refactors the debug function

Reviewed By: lunaleaps

Differential Revision: D84608555

fbshipit-source-id: 548076537c26a4fffba2c47be47d1cee4cf6f3ef
2025-10-20 19:08:52 -07:00
Calix Tangandmeta-codesync[bot] 0b05253dec Add VirtualViewContainerState version native feature flag (#54156)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54156

Changelog: [Internal]

Introduces new React Native feature flag for VirtualViewContainerState versioning changes.

Follow up diffs will create classic and experimental versions of VirtualViewContainerState. This feature flag is meant to eventually be overridden with MetaConfig variables.

Reviewed By: lunaleaps

Differential Revision: D84569199

fbshipit-source-id: aaca31bd1946c56f7de3d7fd52a126b0165e59d4
2025-10-20 19:08:52 -07:00
Christoph Purrerandmeta-codesync[bot] a63262f4bd use ThemedReactContext for resource prefetching (#54201)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54201

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D85015776

fbshipit-source-id: 1a237aa7cae39ddb242c09f202f3566c03baefed
2025-10-20 12:14:14 -07:00
Christoph Purrerandmeta-codesync[bot] 6a37389e28 Image prefetcher > Correctly set blurRadius data type (#54200)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54200

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D85014621

fbshipit-source-id: f4ff244443ce0fef5b9cdd6005da002445f3f632
2025-10-20 12:14:14 -07:00
Rubén Norteandmeta-codesync[bot] 05ec7e0ad1 Add basic definition of DOM APIs in legacy TypeScript types (#54124)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54124

Changelog: [General][Fixed] Fixed missing type definitions for new DOM APIs in legacy TypeScript types.

Fixes https://github.com/facebook/react-native/issues/54103.

Reviewed By: huntie

Differential Revision: D84363784

fbshipit-source-id: f92362c78c72da986b26ea18c673f90fd4b48fca
2025-10-20 11:38:35 -07:00
generatedunixname89002005232357andmeta-codesync[bot] 2f8392387b Revert D84624705 (#54209)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54209

Changelog: [Internal]

This diff reverts D84624705
The marker is logged even if there is a full bundle reload.

Depends on D84624705

Reviewed By: hoxyq

Differential Revision: D85048405

fbshipit-source-id: 0d634a034efe42b404abe1992a4f82280dbeedec
2025-10-20 08:40:01 -07:00
Nicola Cortiandmeta-codesync[bot] 50b1bec2d5 RNGP - Move matchingFallbacks to be called inside maybeCreate("debugOptimized") (#54186)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54186

The `marchingFallback` directive is applied directly on the build type.
However here is invoked inside the `externalNativeBuild` making it confusing, because in reality
it has nothing to do with `externalNativeBuild`. So I'm moving it to the correct location
(this has no effect on the build setup, is just to make the code easier to read).

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D84921628

fbshipit-source-id: 064336ad64a8e1de20b747276f6e5ca7ce7cb677
2025-10-20 08:01:26 -07:00
Pieter De Baetsandmeta-codesync[bot] bc906488ae Add Fantom test for backgroundImage parsing (#54185)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54185

Validate that the changes in D83341309 work across both experiment variants.

Changelog: [Internal]

Reviewed By: andrewdacenko

Differential Revision: D84924308

fbshipit-source-id: 7bf13d00f32c7af778b142ff3abdd0c2f7a5ba24
2025-10-20 07:00:42 -07:00
nishan (o^▽^o)andmeta-codesync[bot] a9780f9102 feat: background image native CSS parser (#53609)
Summary:
This PR adds native CSS parser for `backgroundImage` property. Currently, it supports linear-gradient and radial-gradient spec compliant CSS syntax.

## Changelog:

[GENERAL] [ADDED] - background image native parser.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/53609

Test Plan:
- Replicated existing testcases from JS. Currently i've added CSS syntax testcases. Checkout `CSSBackgroundImageTest.cpp`

### Verify example screens in RNTester
- Set `enableNativeCSSParsing` to true in `ReactNativeFeatureFlags.config.js` and run `yarn featureflags --update`
- Rebuild the project and verify `LinearGradientExample` and `RadialGradientExample` screens on both platforms.

### Notes
- Currently it is difficult to run CSS renderer tests. I made a custom cmake config to get it working, some steps would be helpful.
- Right now the new CSS renderer seems to be only working on iOS. NickGerleman mentioned there is some WIP to get it working on android. So please test this PR on iOS.

Reviewed By: mdvacca

Differential Revision: D83341309

Pulled By: javache

fbshipit-source-id: 91b88e3df164766c1f0021283697b1e5f9b44bfc
2025-10-20 07:00:42 -07:00
Nick Lefeverandmeta-codesync[bot] 4c4270d6c7 Add endFillColor prop to scroll view (#54203)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54203

Adding the Android `endFillColor` property to the scroll view props, setting the default value to `TRANSPARENT`.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D85021077

fbshipit-source-id: 73eb12671035b1b2e2ca95a08b7c73b55ce2c0da
2025-10-20 04:36:52 -07:00
Nick Lefeverandmeta-codesync[bot] df7508db58 Add overScrollMode prop to scroll view (#54202)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54202

Adding the `overScrollMode` property to the Android scroll view props.

Changelog: [Internal]

Differential Revision: D85019462

fbshipit-source-id: 2809743a89e80ad851fce4f90da6a8f7a67e1501
2025-10-20 04:36:52 -07:00
David Vaccaandmeta-codesync[bot] d9ea1b2453 Delete unused imports (#54195)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54195

Delete unused imports

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D84955362

fbshipit-source-id: 1d89271b72080690a139d9dc99f1bf1576e3f4e9
2025-10-18 09:39:02 -07:00
David Vaccaandmeta-codesync[bot] eafc472b7e Explicitly set default values for fields of ShadowNodeUpdateInfo (#54194)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54194

Explicitly set default values for fields of ShadowNodeUpdateInfo

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D84954459

fbshipit-source-id: 0b2fc7d35ec8e515db91f86cea85bb78cf746cd1
2025-10-18 09:39:02 -07:00
David Vaccaandmeta-codesync[bot] 6237882055 Explicitly set default values for fields of ShadowViewNodePair (#54193)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54193

Explicitly set default values for fields of ShadowViewNodePair

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D84954458

fbshipit-source-id: 7ca2ed92d5622cf4dc01088d4e53b946d1bbd279
2025-10-17 21:28:39 -07:00
David Vaccaandmeta-codesync[bot] 0a3344c31f Explicitly set default values for fields of ResourceTimingData (#54192)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54192

Explicitly set default values for fields of ResourceTimingData

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D84954457

fbshipit-source-id: 9f121a9e8567b851fa74756a2fa58dab9fd60827
2025-10-17 21:28:39 -07:00
David Vaccaandmeta-codesync[bot] 82826f24d5 Explicitly set default values for fields of NetworkResource (#54191)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54191

Explicitly set default values for fields of NetworkResource

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D84954456

fbshipit-source-id: 27f48ca0c174045023da4d87429973b26a788103
2025-10-17 21:28:39 -07:00
David Vaccaandmeta-codesync[bot] 9d172c0b37 Explicitly set default values for field of structTraceEvent (#54190)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54190

Explicitly set default values for field of structTraceEvent

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D84954461

fbshipit-source-id: 51b950d26d4236ff561b77751983defaccd799b0
2025-10-17 21:28:39 -07:00
David Vaccaandmeta-codesync[bot] ff50b29050 Explicitly set default values for fields of struct JSRuntimeFlags (#54189)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54189

Explicitly set default values for fields of struct JSRuntimeFlags

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D84952242

fbshipit-source-id: 41de7eb791c9880c83573d670f4a777bf0a753d9
2025-10-17 21:28:39 -07:00
David Vaccaandmeta-codesync[bot] c3868e5e4c Explicitly set default values for fields of HostTargetMetadata struct (#54188)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54188

Explicitly set default values for fields of HostTargetMetadata struct

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D84952243

fbshipit-source-id: e01b8137dac571a6e001681184bca2eef7cc9ee8
2025-10-17 21:28:39 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] 535efc1403 Fixed tint color for action sheets (#54180)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54180

in iOS 26, the tintColor prop is not applied by default to the action sheets buttons.

This change fixes it by restoring the same behavior we had before iOS 26.

## Changelog:
[iOS][Fixed] - Apply tint color to Actions sheets buttons

Reviewed By: cortinico

Differential Revision: D84844319

fbshipit-source-id: e211d0a735ea2da35f825c3568d66ba83e4ad832
2025-10-17 09:47:58 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] 82d2352b19 Fix ActionSheet presented with an interactive background (#54179)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54179

iOS 26 changed how the `popoverPresentationController.sourceView`and the `popoverPresentationController.sourceRect` are handled by iOS.

Before iOS 26, those two properties were ignored by iPhones but used by iPads.

After iOS 26, those two properties are used by both iPhones and iPads.

This introduced an issue where users presenting an action sheet were actually able to interact with the back button on iPhone even ehwn they were not supposed to.

This change adds a condition over the idiom used (iPhone/iPad) to make sure that we use the anchors only with the iPad idions as it used to be before.

## Changelog:
[iOS][Fixed] - Revert action sheet behavior not to break apps on iOS 26

Reviewed By: RSNara

Differential Revision: D84842625

fbshipit-source-id: 347dfc21ee478abd02ba26078cb27d05e9cb64c5
2025-10-17 09:47:58 -07:00
Tomasz Sapetaandmeta-codesync[bot] be4fcdafb1 Improve decoding full-sized images in RCTImageLoader (#54184)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54184

In Expo, someone reported (https://github.com/expo/expo/issues/40158) that `expo-image-manipulator` causes memory crashes when processing large images (> 30MB).
Image manipulator uses `RCTImageLoader` to load and decode images. As opposed to the Image component, it always requests for images in full size. For large images it may crash at `CGImageSourceCreateThumbnailAtIndex` which in the provided repro slowly increases memory usage until it finally crashes after a few seconds of running.
I figured out that not including the `kCGImageSourceThumbnailMaxPixelSize` option works much better, but using `CGImageSourceCreateImageAtIndex` instead of `CGImageSourceCreateThumbnailAtIndex` works even better – it's faster and consumes less memory during decoding. This is more or less what `SDWebImage` library does, see [`SDImageIOAnimatedCoder`](https://github.com/SDWebImage/SDWebImage/blob/master/SDWebImage/Core/SDImageIOAnimatedCoder.m#L488-L509).
With the proposed changes, it's still crashing but only for the largest image (64MB), other images (40MB and 50MB) are now working fine. Obviously, it cannot be fixed entirely and it's not recommended to load such big images without downscaling them.

## Changelog:

[IOS] [CHANGED] - Use `CGImageSourceCreateImageAtIndex` instead of `CGImageSourceCreateThumbnailAtIndex` to decode full-sized images

Pull Request resolved: https://github.com/facebook/react-native/pull/54127

Test Plan: I've tested the examples of the `Image` component in RNTester as well as the repro provided in https://github.com/expo/expo/issues/40158

Reviewed By: javache

Differential Revision: D84835416

Pulled By: cipolleschi

fbshipit-source-id: a182dd00f00194f0463ad4f583cc695647414fca
2025-10-17 09:00:45 -07:00
Dawid Maleckiandmeta-codesync[bot] 269b0bd877 fix(android): displaying dev menu items in light mode (#54119)
Summary:
Fixes displaying dev menu items to also take into account the current theme mode. Previously, in light mode, items were not visible because the text was white on a white background for enabled options.

## Changelog:

[ANDROID][FIXED] - fixed displaying dev menu items in light mode.

Pull Request resolved: https://github.com/facebook/react-native/pull/54119

Test Plan:
Checked in light and dark mode with all options enabled except for "Open DevTools" being disabled.

| Before | After |
|:------:|:-----:|
|<img  alt="before-light" src="https://github.com/user-attachments/assets/5a08cb92-8822-4af3-976d-c20db408bcaa" /> |<img alt="after-light" src="https://github.com/user-attachments/assets/02561c15-b6ec-499a-bf83-99bc0c2a9471" />|

| Before | After |
|:------:|:-----:|
| <img alt="before-dark" src="https://github.com/user-attachments/assets/44b2c59e-2fc2-41cc-a599-136ac455afbb" /> |<img alt="after-dark" src="https://github.com/user-attachments/assets/51e6167b-4d3a-4686-a20e-eca17c3b0e10" />|

Reviewed By: sbuggay, cortinico

Differential Revision: D84346125

Pulled By: coado

fbshipit-source-id: e082d1985fdcafe8620cbd02a78a1b122fb08e53
2025-10-17 01:34:22 -07:00
Luna Weiandmeta-codesync[bot] 802e1a7726 Support edge-adjacent intersections (#54175)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54175

Changelog: [Internal] - Fix a bug with IntersectionObserver where we weren't considering edge-adjacent intersections.

So it is valid for `intersectionRatio` to be 0, but still be intersecting.

Reviewed By: mdvacca

Differential Revision: D84787414

fbshipit-source-id: ef6ab35be594f5b734c8c25d2475ee2a6dba1fe5
2025-10-16 23:26:47 -07:00
Luna Weiandmeta-codesync[bot] 9d6fa7d77e Use 'explicit root' instead of 'custom root' terminology (#54177)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54177

Changelog: [Internal] - Rename the term "custom root" to "explicit root" to align with w3c spec. And "implicit root" for the document root.

Reviewed By: mdvacca

Differential Revision: D84795887

fbshipit-source-id: afec23f6763af56c6de1d3fce2f9501187559fb9
2025-10-16 23:26:47 -07:00
Nick Lefeverandmeta-codesync[bot] ae5728bbb4 Extract ValueUnit percent formatting to separate file (#54170)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54170

This diff extracts the `toString(double, char)` function used to format percent values from `ValueUnit` into a separate `DoubleConversions` file.

This was added to graphics directly instead of moving it to core to avoid introducting cyclic dependencies since core depends on graphics.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D84714535

fbshipit-source-id: e41be90d211c28dba12e0920293698b3e1d3a1c7
2025-10-16 17:16:31 -07:00
Peter Abbondanzoandmeta-codesync[bot] 7c543db181 Fix resizeMethod prop (#54178)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54178

The `resizeMethod` prop was reading from `internal_analyticTag` and not setting on the backing image, this change remaps it

Changelog: [General][Fixed] resizeMethod was not propagated correctly on Android with Props 2.0

Reviewed By: javache

Differential Revision: D84716400

fbshipit-source-id: 320aded79cba787585d875fc46111bca34c0c30c
2025-10-16 15:26:46 -07:00
Nicola Cortiandmeta-codesync[bot] 40ac4478fb Move to use proguard-android-optimize.txt inside RNTester (#54143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54143

This will become the default in AGP 9.x so let's update it inside RNTester as well.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D84548388

fbshipit-source-id: 755344b93204f074926e47ef2a5c980b60e9121b
2025-10-16 13:46:38 -07:00
Andrew Datsenkoandmeta-codesync[bot] 9ab95dd2b5 Delete unused script (#54171)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54171

Changelog: [Internal]

Remove outdated and unused script.

Reviewed By: cortinico

Differential Revision: D84636692

fbshipit-source-id: 402c15735ec1d5a646147b83a1c8def4de9811d0
2025-10-16 12:54:47 -07:00
Nick Lefeverandmeta-codesync[bot] 2ab23aeb40 Add fadingEdgeLength prop to android scroll view props (#54164)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54164

Adding `fadingEdgeLength` prop to the Android scroll view props together with prop diffing support for Props 2.0.

Changelog: [Internal]

Differential Revision: D84788963

fbshipit-source-id: 6cf8011816311797fe0d805f68ccb026e32d7bff
2025-10-16 06:49:58 -07:00
Andrew Datsenkoandmeta-codesync[bot] e79920c662 Fix EXC_BAD_ACCESS for animated (#54158)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54158

Changelog: [Internal]

Animated was capturing `self` directly in C++ std::function contexts. When capturing Objective-C objects in C++ lambdas, they aren't automatically retained. When these lambdas were invoked later (potentially after `self` was deallocated), accessing `_onRender` and other instance variables caused the crash.

Reviewed By: zeyap

Differential Revision: D84638972

fbshipit-source-id: 38f8630cf4f677e29afff07348c2d5dbb1f5cd08
2025-10-15 08:29:24 -07:00
Alex Huntandmeta-codesync[bot] 094794ac92 Add performance marker for Fast Refresh update (#54154)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54154

Adds a prominent vertical "Fast Refresh ⚛︎" marker entry in the performance timeline when a Fast Refresh update is complete.

This is available in apps with `performance.mark()` enabled (Canary feature).

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D84624705

fbshipit-source-id: 6c0ae0b8ae0acaaaba559a1854f64218bf5feabb
2025-10-14 17:51:13 -07:00
Will Spagnoliandmeta-codesync[bot] 0b68dcfac8 Update copyright from Facebook to Meta Platforms (#54144)
Summary:
Fix sync script to emit “Meta Platforms, Inc.” instead of "Facebook, Inc."

## Changelog:

[General] [Fixed] - Updated sync script to emit “Meta Platforms, Inc.” instead of "Facebook, Inc." in copyright notice.

Pull Request resolved: https://github.com/facebook/react-native/pull/54144

Test Plan: Tests Required: No

Reviewed By: cortinico

Differential Revision: D84636157

Pulled By: andrewdacenko

fbshipit-source-id: 51f199ff31d7406519e1b985393b7e5b6f4cd602
2025-10-14 13:29:05 -07:00
Rob Hoganandmeta-codesync[bot] 670a4d942f Babel preset: Add unstable_preserveClasses to experiment with disabling class transforms for SH (#54153)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54153

Disable `babel/plugin-transform-classes` and `babel/plugin-transform-class-properties` when `customTransformOptions.unstable_preserveClasses` is truthy.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D84506895

fbshipit-source-id: 6c66cf6cea037ec183235a058a86b558a7876582
2025-10-14 10:52:16 -07:00
Nick Lefeverandmeta-codesync[bot] 93278d548b Fix binary size regression for BackgroundImage (#54126)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54126

The binary size for RN builds increased by ~180KiB due to the implementation of the `experimental_backgroundImage` property diffing.

This diff removes default inlining for the `toDynamic` serialization functions of the structs used by the linear and radial gradient styles.

Combined with the binary size improvements done previously for `ColorStop` and `ValueUnit`, the binary size has been reduced by 176.0KiB

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D84214151

fbshipit-source-id: 58b045eee839beb4f944689e752096df8f310e77
2025-10-14 10:46:02 -07:00
Nick Lefeverandmeta-codesync[bot] fc74d8c579 Disable inlining of ColorStop and ValueUnit toDynamic conversion (#54125)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54125

With ColorStop and ValueUnit being used at multiple locations, inlining the `toDynamic` conversion used for RN Android and using `std::format` to convert floating point values to string increased the binary size of RN Android by ~180KiB. This diff declares the functions outside the header to avoid inlining the functions and removes the dependency on `std::format` for the percent value string formatting.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D84349391

fbshipit-source-id: 2aab6f057f8b69d0af3779f6edabdd42705d0445
2025-10-14 10:46:02 -07:00
lukmccallandmeta-codesync[bot] 39ede95921 Fix request permission is not always resolving in Android 16 (#53898)
Summary:
Fixes: https://github.com/facebook/react-native/issues/53887
Fixes: https://github.com/expo/expo/issues/39480

In the latest Android 16 update, requesting permissions does not always change the app's state (the `onPause` and `onResume` functions aren't called). For instance, when you deny permission 3 times, the last promise won't resolve until you move the app to the background. The current logic inside the `ReactActivityDelegate` assumes that Android will call `onResume` after receiving permission state information from the system, which is no longer the case.

Probably connected with [this commit](https://android.googlesource.com/platform/packages/modules/Permission/%2B/5dca0ccb26f2b99d706a1d3e9402f851e849c913)

## Changelog:

[ANDROID] [FIXED] - Fix request permission not always resolving in Android 16

Pull Request resolved: https://github.com/facebook/react-native/pull/53898

Test Plan:
- I've tested it in the RNTester by denying the camera permission three times.
- I've also checked if the patch works with the Expo permissions code.

Reviewed By: javache

Differential Revision: D83059478

Pulled By: cortinico

fbshipit-source-id: 7bf33b379a1b6606ad2da2f75d337bf951e3986b
2025-10-14 09:03:29 -07:00
Vitali Zaidmanandmeta-codesync[bot] d7bcaf6cb4 Update debugger-frontend from 8cce390...54afd87 (#54152)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54152

Changelog: [Internal] - Update `react-native/debugger-frontend` from 8cce390...54afd87

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/8cce39003f66f66a8fb4c0e581a2b5046cf9c1d1...54afd8765db32a9640edef3788085b991fe4b88a).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [54afd8765](https://github.com/facebook/react-native-devtools-frontend/commit/54afd8765) | Vitali Zaidman (vzaidman@gmail.com) | 2025-10-13T15:50:57-04:00 | [fix memory profiling race condition (#211)](https://github.com/facebook/react-native-devtools-frontend/commit/54afd8765) |
| [b8e5768ec](https://github.com/facebook/react-native-devtools-frontend/commit/b8e5768ec) | Alex Hunt (hello@alexhunt.dev) | 2025-09-30T21:20:30+01:00 | [Re-enable Network Request Initiator view (#210)](https://github.com/facebook/react-native-devtools-frontend/commit/b8e5768ec) |

Reviewed By: huntie

Differential Revision: D84542157

fbshipit-source-id: f29ec029b05decbc3ab1cd412df06af55981fc21
2025-10-14 08:45:28 -07:00
Marco Wangandmeta-codesync[bot] 2c749a814a Deploy 0.288.0 to xplat (#54145)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54145

[changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D84571624

fbshipit-source-id: 7bb915d544ac539b055c32ddec9a52d05cec0a99
2025-10-14 00:07:14 -07:00
Marc Rousavyandmeta-codesync[bot] 5ffff0153c perf: Move func into CallInvoker::invokeAsync (#54141)
Summary:
Instead of copying the `std::function` into `invokeAsync`, we now move it.

## Changelog:

[GENERAL] [CHANGED] - Move `std::function` into `CallInvoker::invokeAsync` instead of copying it

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/54141

Test Plan: Build, run. A lot of code still uses the old `invokeAsync` function.

Reviewed By: christophpurrer

Differential Revision: D84563949

Pulled By: javache

fbshipit-source-id: 283be3d12f1ac1c7f3da528c6b50b36cc81cd82a
2025-10-13 23:49:08 -07:00
Christoph Purrerandmeta-codesync[bot] 6d7a93f2b1 Add GTest utility methods to test C++ Turbo Module EventEmitters (#54060)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54060

Changelog: [Internal]

Adds a test case to assert Turbo Module eventEmitter properties in GTests

Reviewed By: javache

Differential Revision: D83280050

fbshipit-source-id: 6c05d779c38a6988f07a11ccb436429aa1a12975
2025-10-13 20:21:32 -07:00
Christoph Purrerandmeta-codesync[bot] 0fd24c75a1 Simplify C++ TM base classes (#54059)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54059

Changelog: [Internal]

Right now for a simple spec as
```
import type {CodegenTypes, TurboModule} from 'react-native';

import {TurboModuleRegistry} from 'react-native';

export type ScreenshotManagerOptions = CodegenTypes.UnsafeObject;

export interface Spec extends TurboModule {
  +getConstants: () => {};
  takeScreenshot(
    id: string,
    options: ScreenshotManagerOptions,
  ): Promise<string>;
}

const NativeModule = TurboModuleRegistry.get<Spec>('ScreenshotManager');
export function takeScreenshot(
  id: string,
  options: ScreenshotManagerOptions,
): Promise<string> {
  if (NativeModule != null) {
    return NativeModule.takeScreenshot(id, options);
  }
  return Promise.reject();
}
```

we generate **TWO** `facebook::react::TurboModule` sub classes (`NativeScreenshotManagerCxxSpecJSI` and `NativeScreenshotManagerCxxSpec`) to construct ONE C++ TM.

In particular header
```
#pragma once

#include <ReactCommon/TurboModule.h>
#include <react/bridging/Bridging.h>

namespace facebook::react {

class JSI_EXPORT NativeScreenshotManagerCxxSpecJSI : public TurboModule {
 protected:
  NativeScreenshotManagerCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);

 public:
  virtual jsi::Object getConstants(jsi::Runtime& rt) = 0;
  virtual jsi::Value
  takeScreenshot(jsi::Runtime& rt, jsi::String id, jsi::Object options) = 0;
};

template <typename T>
class JSI_EXPORT NativeScreenshotManagerCxxSpec : public TurboModule {
 public:
  jsi::Value create(jsi::Runtime& rt, const jsi::PropNameID& propName)
      override {
    return delegate_.create(rt, propName);
  }

  std::vector<jsi::PropNameID> getPropertyNames(
      jsi::Runtime& runtime) override {
    return delegate_.getPropertyNames(runtime);
  }

  static constexpr std::string_view kModuleName = "ScreenshotManager";

 protected:
  NativeScreenshotManagerCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
      : TurboModule(
            std::string{NativeScreenshotManagerCxxSpec::kModuleName},
            jsInvoker),
        delegate_(reinterpret_cast<T*>(this), jsInvoker) {}

 private:
  class Delegate : public NativeScreenshotManagerCxxSpecJSI {
   public:
    Delegate(T* instance, std::shared_ptr<CallInvoker> jsInvoker)
        : NativeScreenshotManagerCxxSpecJSI(std::move(jsInvoker)),
          instance_(instance) {}

    jsi::Object getConstants(jsi::Runtime& rt) override {
      static_assert(
          bridging::getParameterCount(&T::getConstants) == 1,
          "Expected getConstants(...) to have 1 parameters");

      return bridging::callFromJs<jsi::Object>(
          rt, &T::getConstants, jsInvoker_, instance_);
    }
    jsi::Value takeScreenshot(
        jsi::Runtime& rt,
        jsi::String id,
        jsi::Object options) override {
      static_assert(
          bridging::getParameterCount(&T::takeScreenshot) == 3,
          "Expected takeScreenshot(...) to have 3 parameters");

      return bridging::callFromJs<jsi::Value>(
          rt,
          &T::takeScreenshot,
          jsInvoker_,
          instance_,
          std::move(id),
          std::move(options));
    }

   private:
    friend class NativeScreenshotManagerCxxSpec;
    T* instance_;
  };

  Delegate delegate_;
};

} // namespace facebook::react
```
and cpp
```
#include "AppSpecsJSI.h"

namespace facebook::react {

static jsi::Value __hostFunction_NativeScreenshotManagerCxxSpecJSI_getConstants(
    jsi::Runtime& rt,
    TurboModule& turboModule,
    const jsi::Value* args,
    size_t count) {
  return static_cast<NativeScreenshotManagerCxxSpecJSI*>(&turboModule)
      ->getConstants(rt);
}

static jsi::Value
__hostFunction_NativeScreenshotManagerCxxSpecJSI_takeScreenshot(
    jsi::Runtime& rt,
    TurboModule& turboModule,
    const jsi::Value* args,
    size_t count) {
  return static_cast<NativeScreenshotManagerCxxSpecJSI*>(&turboModule)
      ->takeScreenshot(
          rt,
          count <= 0 ? throw jsi::JSError(
                           rt, "Expected argument in position 0 to be passed")
                     : args[0].asString(rt),
          count <= 1 ? throw jsi::JSError(
                           rt, "Expected argument in position 1 to be passed")
                     : args[1].asObject(rt));
}

NativeScreenshotManagerCxxSpecJSI::NativeScreenshotManagerCxxSpecJSI(
    std::shared_ptr<CallInvoker> jsInvoker)
    : TurboModule("ScreenshotManager", jsInvoker) {
  methodMap_["getConstants"] = MethodMetadata{
      0, __hostFunction_NativeScreenshotManagerCxxSpecJSI_getConstants};
  methodMap_["takeScreenshot"] = MethodMetadata{
      2, __hostFunction_NativeScreenshotManagerCxxSpecJSI_takeScreenshot};
}

} // namespace facebook::react
```

The goal of this change is to simplify that and only have **ONE** `facebook::react::TurboModule` base class for a concrete Cxx TM as this header

```
/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#pragma once

template <typename T>
class JSI_EXPORT NativeScreenshotManagerCxxSpec : public TurboModule {
public:
  static constexpr std::string_view kModuleName = "ScreenshotManager";

protected:
  NativeScreenshotManagerCxxSpec(std::shared_ptr<CallInvoker> jsInvoker) : TurboModule(std::string{NativeScreenshotManagerCxxSpec::kModuleName}, jsInvoker) {
    methodMap_["getConstants"] = MethodMetadata {.argCount = 0, .invoker = __getConstants};
    methodMap_["takeScreenshot"] = MethodMetadata {.argCount = 2, .invoker = __takeScreenshot};
  }

private:
  static jsi::Value __getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
    static_assert(
      bridging::getParameterCount(&T::getConstants) == 1,
      "Expected getConstants(...) to have 1 parameters");
    return bridging::callFromJs<jsi::Object>(rt, &T::getConstants,  static_cast<NativeScreenshotManagerCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
  }

  static jsi::Value __takeScreenshot(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
    static_assert(
      bridging::getParameterCount(&T::takeScreenshot) == 3,
      "Expected takeScreenshot(...) to have 3 parameters");
    return bridging::callFromJs<jsi::Value>(rt, &T::takeScreenshot,  static_cast<NativeScreenshotManagerCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
      count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
      count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt));
  }
};
```

This reduces the generated code from 101 lines to 31 - **REDUCTION of 2/3**

Reviewed By: javache

Differential Revision: D83810977

fbshipit-source-id: 6d0c0271846c8544399c7050b7331b0180cbbadf
2025-10-13 20:21:32 -07:00
vineethkuttanandmeta-codesync[bot] c629019080 Avoid data loss during conversion (#54132)
Summary:
Avoid data loss during conversion which fixes https://github.com/microsoft/react-native-windows/issues/14698

## Changelog:

Added a one-line fix to static_cast to a float

Pick one each for the category and type tags:

[GENERAL] [FIXED] - Avoid data loss during conversion

Pull Request resolved: https://github.com/facebook/react-native/pull/54132

Test Plan: Working in react native windows

Reviewed By: javache

Differential Revision: D84510049

Pulled By: cortinico

fbshipit-source-id: 37691a9169bf143d19d438e2ce2bbea67f711b3a
2025-10-13 19:47:34 -07:00
Nicola Cortiandmeta-codesync[bot] 69dc655005 RNGP - Fix build failures encounted with AGP 9.0.0-alpha05 - Round 1 (#53778)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53778

I've been looking into the next major bump of AGP to 9:
https://developer.android.com/build/releases/agp-preview#android-gradle-plugin-built-in-kotlin

This change adapts our project so that it keeps on buildign with AGP 8
(as the bump to 9 would be a breaking change), but it addresses some of the build
failures we'll be having with AGP 9:

- Set `resValues` build option to true (default was changed true -> false in AGP 9)
- Opts out our project from `android.builtInKotlin` and `android.newDsl` for the time being.

Changelog:
[Android] [Fixed] - Fix build failures with RNGP due to AGP 9.0.0-alpha05

Reviewed By: alanleedev

Differential Revision: D82452555

fbshipit-source-id: 99561f039bf943f5ce99008ce073ca86431cfaed
2025-10-13 18:16:18 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] b44d4b4292 Add function to coordinate the headers preparation for the app (#53677)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53677

## Context

When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.

## Changed

Add a function that runs `prepareHeaders` that configures the headers for React Native and Codegen targets.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81778440

fbshipit-source-id: 26b973c07e82f30663e51c4a8e0e72f54765115e
2025-10-13 16:30:51 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] 2ea9fd6c86 Add function to generate artifact for codegen (#53676)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53676

## Context

When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.

## Changed

Add a function that generates codegen artifacts. Those are required by React Native and by the app to build properly.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81778439

fbshipit-source-id: 7fe5cc0b612d2d9324d68fe04ec556e986ec14af
2025-10-13 16:30:51 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] 7a86ee0aef Add function to create hard links for the app (#53675)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53675

## Context

When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.

## Changed

Add a function that create hardlinks for React Native so it can build from source

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81778454

fbshipit-source-id: 702a603629e4fad154b5d79dea6d96fcd80235b9
2025-10-13 16:30:51 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] d45523639d Add function to set build from source to true (#53674)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53674

## Context

When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.

## Changed

Add a function updates the PAckage.swift file to set BUILD_FROM_SOURCE to true

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81778460

fbshipit-source-id: b06ebc546aa8e87acdb15706a0559e9046173784
2025-10-13 16:30:51 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] 87d6043788 Add function to configure the app for swift by creating modulemap and umbrella header (#53673)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53673

## Context

When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.

## Changed

Add a function that configure React Native to be swift compatible by creating the React-umbrella and modulemap

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81778437

fbshipit-source-id: 8bfd0df3abed813a221e5ef7972f4b7a6e292e76
2025-10-13 16:30:51 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] c827474b58 Configure Package.swift file to be able to build from source (#53667)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53667

This change updates the Package.swift file to enable building RNTester and HelloWorld from source.

The set of changes is the following:
- add a BUILD_FROM_SOURCE flag to toggle between building for creating prebuilds and building an app from source
- configure the proper header search path based on whether we want to build an app from source or not
- split the ReactFabricComponents target in multiple subtargets. This is required because when building from source we can't have targets whose Source folder is overlapping.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81778452

fbshipit-source-id: 00553a9966e7d96177e70d45179e712536c23124
2025-10-13 15:36:36 -07:00
Devan Buggayandmeta-codesync[bot] f4e93df55e Add custom dimension provider to RCTDeviceInfo (#54107)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54107

Adds a dimension provider override to RCTDeviceInfo.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D84131733

fbshipit-source-id: 2419bcb9a23486eee61f203414084d5105a091f8
2025-10-11 00:47:42 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] 6f482708b5 Sync React 19.2 into React Native (#54109)
Summary:
X-link: https://github.com/facebook/metro/pull/1598

Pull Request resolved: https://github.com/facebook/react-native/pull/54109

This change syncs React 19.2 into React native.

bypass-github-export-checks
## Changelog
[General][Changed] - Bump React version to 19.2

Reviewed By: cortinico

Differential Revision: D84282848

fbshipit-source-id: 8bc57be1f39a913c284fb782883ce91fae6750fc
2025-10-10 11:44:06 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] 2fe008b902 Add configure iOS prebuilds (hermes and dependencies) (#53671)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53671

## Context

When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.

## Changed

Add a function that prepares the prebuilds for ios so we can leverage them when building from source

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81778467

fbshipit-source-id: bacfcfd3d646bfa27dcd800417e4787308a51a86
2025-10-10 11:19:38 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] a1575d04ce Add function to run pod deintegrate (#53706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53706

## Context

When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.

## Changed

Add a function that runs `pod deintegrate` to remove remainings of cocoapods

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81778468

fbshipit-source-id: 20e1cfefcef8318d63d4a6ff92050ced0f91ef53
2025-10-10 11:19:38 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] f0725f7802 Add script to find the directory that contains the Xcodeproj (#53669)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53669

## Context

When configuring an app to build with SwiftPM from source, there is a sequence of operations we need to run in order to prepare the project correctly.

## Changed

Add a function that given the root of the app and the name of the xcodeproject file, can return the path to the Xcode project file

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81778456

fbshipit-source-id: f7050bcb049d75a5b1cabf340a5b98f4736e60b3
2025-10-10 11:19:38 -07:00
Zeya Pengandmeta-codesync[bot] 53464e8483 make NativeAnimatedNodesManagerProvider owner of animationBackend (#54079)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54079

## Changelog:

[Internal] [Changed] - make NativeAnimatedNodesManagerProvider owner of animationBackend

so NativeAnimatedNodesManager and NativeAnimatedNodesManagerProvider don't both keep a shared_ptr reference

Reviewed By: sammy-SC

Differential Revision: D83870762

fbshipit-source-id: e3d27f4a58830405196f728cbe5400364ba9f95b
2025-10-10 08:55:37 -07:00
Moti Zilbermanandmeta-codesync[bot] 487844e533 Android: Report fetch(), XHR and RCTNetworking call stacks to Network panel (#54084)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54084

Android port of D83754145.

1. Teaches the native networking module on IOS to track a `devToolsRequestId` along with each request, and use it instead of the internal `requestId` to identify the request to `NetworkReporter`.
2. Uses `__NETWORK_REPORTER__.createDevToolsRequestId` (D83238216) to generate a `devToolsRequestId` from JS and pass it into native. This records a JavaScript call stack as the [initiator](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Network#type-Initiator) of the request.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D83981793

fbshipit-source-id: b4b8828433881c15e44a0468275a5cf398e7d050
2025-10-10 07:08:55 -07:00
Sam Zhouandmeta-codesync[bot] 5f5a77c342 Fix https://github.com/facebook/react-native/issues/54102 by wrapping the prettier mock in a try-catch (#54114)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54114

This setup script will be published in the react-native package.
Other people might not have prettier installed, so it will crash the mock below.
Therefore, we wrap this mock in a try-catch.

Changelog: [General][Fixed] Fixed https://github.com/facebook/react-native/issues/54102

Reviewed By: cortinico

Differential Revision: D84292458

fbshipit-source-id: e884b02eec6abb7a964e01dd01f72f6e2ee31dab
2025-10-10 06:30:08 -07:00
aialokandmeta-codesync[bot] 118a6621f5 Updated copyright header from Facebook to Meta in yoga-config.cmake.in (#54087)
Summary:
Update the copyright header in packages/react-native/ReactCommon/yoga/cmake/yoga-config.cmake.in from
```
# Copyright (c) Facebook, Inc. and its affiliates.
```
 to
 ```
 # Copyright (c) Meta Platforms, Inc. and affiliates.
 ```
 for consistency with the rest of the codebase. This change does not affect functionality.

 close https://github.com/facebook/react-native/issues/54086

## Changelog:
[GENERAL] [CHANGED] - Updated copyright header in Yoga CMake file from Facebook to Meta.

Pull Request resolved: https://github.com/facebook/react-native/pull/54087

Test Plan: Tests Required: No

Reviewed By: robhogan

Differential Revision: D84101874

Pulled By: cortinico

fbshipit-source-id: 534fb700dcbb14d0e91c8c287e8a9af251cba4f9
2025-10-10 05:39:56 -07:00
Moti Zilbermanandmeta-codesync[bot] 30999b868c Deprecate NetworkingModule.sendRequestInternal (#54101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54101

Changelog:
[Android][Deprecated] Mark `NetworkingModule.sendRequestInternal` as deprecated

The `NetworkingModule.sendRequestInternal` method is an implementation detail of the `sendRequest` method and does not need to be public. In this diff, we mark it as deprecated ahead of removing it from the public API in a future release of React Native.

Reviewed By: javache

Differential Revision: D84250142

fbshipit-source-id: fad62eeae4f9bf06e00578b3cfb6c2c077c08e5c
2025-10-10 02:15:32 -07:00
Nick Lefeverandmeta-codesync[bot] e926ad0428 Allow overriding the horizontal scroll position restore (#54115)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54115

Horizontal scroll view extensions should be able to  customize the scrolling behavior for state restores. This adds the `restoreScrollTo` function that will be called to restore the scroll position to the location provided by the shadow node state.

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D84310601

fbshipit-source-id: 007caa3d0922a5430ffc6f970eebb180a112f894
2025-10-09 20:59:18 -07:00
Nick Lefeverandmeta-codesync[bot] 78bdf584e2 Enable scroll state restore for Trait::hidden (#54113)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54113

With `Trait::hidden` unmounting and remounting views for shadow nodes holding scroll state, we have to restore the scroll position from the shadow node state when the scroll view is being remounted

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D84291899

fbshipit-source-id: 596839f56757dbdf9485e82380af31a71865e1df
2025-10-09 19:40:45 -07:00
Nick Lefeverandmeta-codesync[bot] 8d245e9f61 Control trait::hidden support through feature flag (#54112)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54112

This diff adds the possibility to control the use of `Trait::Hidden` on Android platforms through feature flags. The feature flag is Android specific and only accessed on Android platforms.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D84289662

fbshipit-source-id: 0ee1d0702aa36df25c842017673176a9c7984b23
2025-10-09 19:40:45 -07:00
Zeya Pengandmeta-codesync[bot] d2eca58996 use processor flag -DRN_USE_ANIMATION_BACKEND to gate animation backend dep (#54091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54091

## Changelog:

[Internal] [Changed] - use processor flag -DRN_USE_ANIMATION_BACKEND to gate animation backend dep

So it's only enabled for catalyst and fantom when building with BUCK while gated from other meta apps, and enabled by default in oss version

Reviewed By: sammy-SC

Differential Revision: D84157729

fbshipit-source-id: e822f11c4b64b77b17a698bf3b60b5c5a4faf4f4
2025-10-09 19:01:20 -07:00
Pieter De Baetsandmeta-codesync[bot] e8988e9460 Remove RCTFBSystrace (#54097)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54097

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D84196086

fbshipit-source-id: b178b541224c6376bf78dc19fc9051bca4c46023
2025-10-09 18:56:15 -07:00
Pieter De Baetsandmeta-codesync[bot] 7787d2fbb5 Move RCTAnimatedModuleProvider to open-source (#54096)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54096

Exporting this since we have some incoming changes to Animated which okwasniewski wants to make and should be applied to CxxAnimated too.

This is not hooked up to any OSS apps yet.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D84200113

fbshipit-source-id: 7a278ebf3f9c2b0779971591804d3fbd89ce4723
2025-10-09 16:29:42 -07:00
David Vaccaandmeta-codesync[bot] e5e8e637db Delete LayoutDirectionUtil from fbsource
Summary:
LayoutDirectionUtil is part of legacy architecutre, in this diff I'm deleting it from fbsource

changelog: [internal] internal

Reviewed By: shwanton, cortinico

Differential Revision: D83984648

fbshipit-source-id: 161e4347ccab160fb1be66cba05f9474c0ad3b72
2025-10-09 14:49:30 -07:00
generatedunixname537391475639613andmeta-codesync[bot] e4da3437d9 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoHelpers.kt (#54106)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54106

Reviewed By: javache

Differential Revision: D84130472

fbshipit-source-id: a1bfff89e0b6d36d2bcb3045a35ca15c6599f9d8
2025-10-09 14:41:55 -07:00
Zeya Pengandmeta-codesync[bot] 1e1af623b1 Defer to responder system to terminate on scroll (#54007)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54007

## Changelog:

[Android] [Changed] - Defer to responder system to terminate on scroll

when FeatureFlag responderTerminateOnScrollAndroid is turned on

on ios, we don't dispatch TouchCancel at scroll to terminate scrollview's children, instead, responder system handles responder termination when it receives onScroll event

Currently, TouchCancel native event at scroll will stop any ongoing touch events dispatched from native, and will unexpectedly terminate responder even if responder has transferred from child of scrollView to parent view, because of race condition. Fixing this will require revisiting a large part of the native touch system on android.

Reviewed By: sammy-SC

Differential Revision: D83584281

fbshipit-source-id: 10b3c98c30037b50f1705e11aa9ca016a6c3d974
2025-10-09 13:58:04 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] 5abda9c7da Add env var to compile-out legacy arch (#53975)
Summary:
In this change, we are allowing users to install cocoapods with the RCT_REMOVE_LEGACY_ARCH flag enabled to compile out the legacy architecture.

For it to work, we had to adjust some part of the framework that we forgot about when working on the internal side of this feature.

bypass-github-export-checks

## Changelog:
[iOS][Added] - Added way to set the RCT_REMOVE_LEGACY_ARCH flag from Cocoapods to compile ou the legacy arch

Pull Request resolved: https://github.com/facebook/react-native/pull/53975

Test Plan:
Tested locally with RNTester and HelloWorld:

```
cd packages/rn-tester
RCT_REMOVE_LEGACY_ARCH=1 bundle exec pod install
open RNTesterPods.xcworkspace
```

Then build and run and verify that the app keeps running.

Same check with Hello World.

Reviewed By: cortinico

Differential Revision: D83471112

Pulled By: cipolleschi

fbshipit-source-id: e5c8fe4eccb3c25510228f20e9e6da3980b0bf0d
2025-10-09 11:27:33 -07:00
Eric Rozellandmeta-codesync[bot] 8cc9bbc892 Execute commands in order (#54074)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54074

Currently, we dispatch view commands eagerly at the beginning of a batch. This behavior originated with https://github.com/facebook/react-native/commit/b54257c628b1a174a2c41960e7fc4d2d719ad731.

However, this can make it difficult to allow developers to control mount item execution order. For example, someone may want to make sure a view command is processed *after* a particular mount item, and not exclusively rely on retryable command exceptions.

This change sets up a feature flag to enable in-order execution of view command mount items.

## Changelog

[Internal]

Reviewed By: mdvacca, sammy-SC

Differential Revision: D84061054

fbshipit-source-id: 7cb68c43823ed67f541f4e8f2d7471629609a905
2025-10-08 21:19:30 -07:00
Devan Buggayandmeta-codesync[bot] e3a5af6a99 Re-land - Genalize focus/blur behavior in JS (#54085)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54085

Re-land generalized focus/blur commands.

Changelog: [Internal]

Reviewed By: rozele, javache

Differential Revision: D84082783

fbshipit-source-id: 8c2ae87ad878f3cb95a6449f2bd6a80fe590d149
2025-10-08 20:31:00 -07:00
Moti Zilbermanandmeta-codesync[bot] 24d0d4414f Fix __DEBUGGER_SESSION_OBSERVER__ for concurrent sessions (#54083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54083

Changelog: [Internal]

Fixes a bug in `__DEBUGGER_SESSION_OBSERVER__` where the wrong state could be reported if more than one session existed. Now we reuse the accurate domain status tracking mechanism added in D83847356.

Reviewed By: hoxyq

Differential Revision: D84007326

fbshipit-source-id: e7f2c33286aa69c3bd9d5662d35dad579ca3c770
2025-10-08 17:40:25 -07:00
Moti Zilbermanandmeta-codesync[bot] 5c7cbebfee Refactor console API implementation to use tryExecuteSync for clarity (#54069)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54069

Changelog: [Internal]

D83238216 added a `tryExecuteSync` function for use with `EnableExecutorFromThis` objects - concretely, for calling functions on  a `weak_ptr<RuntimeTarget>` from the JS thread while ensuring the `RuntimeTarget` is always destroyed on the inspector thread.

`tryExecuteSync` is a generalisation of the lambda-based `delegateExecutorSync` helper from `RuntimeTargetConsole`, so in this diff we refactor the latter to use the more general and better-documented function.

Reviewed By: huntie

Differential Revision: D83838062

fbshipit-source-id: 85fd5a43e204cc634b573e2a3bda47a9ec523fca
2025-10-08 17:38:42 -07:00
Moti Zilbermanandmeta-codesync[bot] 81d652543b iOS: Report fetch(), XHR and RCTNetworking call stacks to Network panel (#54052)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54052

1. Teaches the native networking module on IOS to track a `devToolsRequestId` along with each request, and use it instead of the internal `requestId` to identify the request to `NetworkReporter`.
2. Uses `__NETWORK_REPORTER__.createDevToolsRequestId` (D83238216) to generate a `devToolsRequestId` from JS and pass it into native. This records a JavaScript call stack as the [initiator](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Network#type-Initiator) of the request.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D83754145

fbshipit-source-id: ee08f419d2a7013bbc915ee40b1428d7810e6c42
2025-10-08 15:26:25 -07:00
Moti Zilbermanandmeta-codesync[bot] aa685408a2 Check Network domain state in RuntimeTargetNetwork (#54082)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54082

Changelog: [Internal]

Followup from D83238216.

Adds bookkeeping in `RuntimeTarget` to allow checking from the JS thread whether there is a session with the `Network` CDP enabled. We then use this in the implementation of `__NETWORK_REPORTER__.createDevToolsRequestId` as a more precise alternative to checking the `NetworkHandler` singleton's state.

This is a first step towards breaking up the `NetworkHandler` singleton, subsuming its responsibilities into the Target/Agent architecture of `jsinspector-modern` and fixing a variety of bugs in the process.

NOTE: The additions to `RuntimeTarget` are more general than just tracking the `Network` domain - I'll use them in an upcoming diff to fix a concrete bug related to concurrent session support in `DebuggerSessionObserver`.

Reviewed By: huntie

Differential Revision: D83847356

fbshipit-source-id: 3384e3feb44adbd9ed4d54a20875669d63ae8764
2025-10-08 15:26:25 -07:00
Moti Zilbermanandmeta-codesync[bot] a4be9b236f Add JS API for allocating network request IDs, capturing call stacks (#54051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54051

Adds the private, experimental `__NETWORK_REPORTER__.createDevToolsRequestId()` JavaScript method behind the Fusebox network inspection feature flag.

`createDevToolsRequestId()` returns a unique string ID for a network request, and records the current call stack as the request's [initiator](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Network#type-Initiator). If the native networking layer passes the same request ID into the C++ `NetworkReporter::reportRequestStart` method, the corresponding CDP [`requestWillBeSent`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Network#event-requestWillBeSent) event will contain the stack trace.

Changelog: [Internal]

Reviewed By: robhogan, huntie

Differential Revision: D83238216

fbshipit-source-id: 5076d887254cd9711f86f72792e791eabc43f297
2025-10-08 15:26:25 -07:00
Moti Zilbermanandmeta-codesync[bot] d932f28209 Add generateRandomUuidString C++ helper (#54089)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54089

Changelog: [Internal]

Adds a minimal standards-compliant UUID v4 generator to `react/utils` for use elsewhere in React Native. We don't need UUID parsing, support for UUID versions other than 4, a UUID value type, or extremely high performance - which makes inlining this simple, portable implementation directly in our codebase acceptable.

Reviewed By: robhogan

Differential Revision: D84149720

fbshipit-source-id: 399d88f4adaff3be4fef5dd1abab3c8552ca1a75
2025-10-08 15:26:25 -07:00
Nick Lefeverandmeta-codesync[bot] 9afd6bb2f4 Fix transformOrigin conversion ignoring unit type (#54092)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54092

The `transformOrigin` conversion didn't call into the `toDynamic` conversion for the underlying `ValueUnit` instances for the x and y coordinates. This diff fixes the conversion so that percentages would be correctly converted.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D84165034

fbshipit-source-id: 40bf32a45770cd43fc67103f4c2e9785abffb033
2025-10-08 15:25:41 -07:00
generatedunixname537391475639613andmeta-codesync[bot] 0e8065cfee xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/InterpolationAnimatedNode.kt (#54094)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54094

Reviewed By: javache

Differential Revision: D83948964

fbshipit-source-id: 217a6dd51f44781961b1a6e22c6eb85e39346e2c
2025-10-08 14:25:20 -07:00
Phillip Panandmeta-codesync[bot] 0dcb939247 introduce response listener in native network (#54093)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54093

Changelog: [Internal]

adding a private! api so we can parse text payloads

Reviewed By: mdvacca

Differential Revision: D83939903

fbshipit-source-id: 8f348648f16d53f2bd86046fb0c3689d7bae3d93
2025-10-08 13:03:32 -07:00
Zeya Pengandmeta-codesync[bot] 197783be1e create UIManagerAnimationBackend to replace forward declare class AnimationBackend (#54058)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54058

## Changelog:

[Internal] [Changed] - create UIManagerAnimationBackend to replace forward declare `class AnimationBackend`

for other delegates in UIManager, we usually explicitly create an interface in UIManager package with the public APIs we want to expose, we can follow that pattern here, so we avoid the forward declaration without definition situation, and decoupling UIManager with AnimationBackend

also this way, in the future, animation runtimes that consume AnimationBackend can just include `UIManagerAnimationBackend` (where we expose all of public APIs of AnimationBackend) and remain somewhat decoupled too

Reviewed By: sammy-SC

Differential Revision: D83679693

fbshipit-source-id: e58d180b7d36a3f0e766c2914b16128346abe070
2025-10-08 12:51:23 -07:00
Moti Zilbermanandmeta-codesync[bot] 52b2c466c5 Support recording request initiator call stacks in NetworkHandler (#54050)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54050

Changelog: [Internal]

A naive approach to keeping track of request initiators inside the `NetworkHandler` singleton for CDP reporting purposes:

1. Expose a new `recordRequestInitiatorStack` method.
2. Keep the CDP-formatted stack trace (as a `folly::dynamic`) in a map keyed by request ID.
3. Destructively consume the stack trace during `onRequestWillBeSent`.

Reviewed By: huntie

Differential Revision: D83754143

fbshipit-source-id: 4f5a335f2eed66a168f9d39a66c8af6ccee23d6f
2025-10-08 10:28:07 -07:00
Andrew Datsenkoandmeta-codesync[bot] 5b9873ff35 PlatformColor caching & invalidation (#54076)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54076

Changelog: [Internal]
Add PlatformColor caching so we do not need to make as many JNI calls which helps with perf.

Reviewed By: javache

Differential Revision: D83050864

fbshipit-source-id: 56a53a5facccdbbb3ff18a66df9e07d794bb074c
2025-10-08 07:41:37 -07:00
Moti Zilbermanandmeta-codesync[bot] b31a2fb4b8 Add RuntimeTargetDelegate::serializeStackTrace API (#54048)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54048

Changelog: [Internal]

Adds an engine-agnostic mechanism for serialising a previously captured stack trace as a CDP [`Runtime.StackTrace`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Runtime#type-StackTrace). This complements the existing `RuntimeTargetDelegate::captureStackTrace` method, which returns an opaque, engine-specific representation of a stack trace.

This can be used as a building block for implementing higher-level CDP message types like [`Network.Initiator`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Network#type-Initiator) within React Native, while keeping the underlying stack trace representation private to each engine.

NOTE: This diff includes an implementation for Hermes that duplicates logic from the Hermes codebase. Further up the stack, I have diffs to replace this with a new API to be provided by Hermes.

Reviewed By: huntie

Differential Revision: D83754142

fbshipit-source-id: 1439ea446665562e5f92c7b1dcb6ab65af1324cd
2025-10-08 05:51:42 -07:00
Gang Zhaoandmeta-codesync[bot] e32307e054 Revert deletion of old Hermes CDPHandler (#54078)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54078

Changelog:
[General][Fixed] 6e1c0a removed old Hermes CDPHandler, which is a
breaking change, revert here.

Reviewed By: cipolleschi

Differential Revision: D84076229

fbshipit-source-id: 7ac426178754d6320c1803a50d57afa10e3126e5
2025-10-07 19:39:29 -07:00
Nick Lefeverandmeta-codesync[bot] 31bff4e093 Restore scroll state of horizontal scroll view on mount (#54001)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54001

This diff adds support for state restore to the horizontal scroll view. The same logic was applied as for the vertical scroll view. The only difference being that the shadow node for the horizontal scroll view needed to be updated to add `ScrollState`.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D83247017

fbshipit-source-id: 7c26901df4c43ed70addc7b6d8afb9a6d3e549a8
2025-10-07 19:20:15 -07:00
Nick Lefeverandmeta-codesync[bot] 2bbea50991 Restore scroll state of scroll view on mount (#54000)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54000

Update the scroll view manager to load the fabric state and restore the scroll position and scroll away top padding on mount. Restoring the scroll view happens in the react scroll view state setter, which gets called by the `ReactScrollViewHelper` with the deserialized state provided on mount.

The state loading will happen only until the scroll view itself submits a new state to Fabric (due to scrolling). This guarantees that we only restore the initial state on mount.

This diff also updates the scroll away top padding setter to support setting a new value without triggering a fabric state update.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D83247016

fbshipit-source-id: 7ae44b9f69c58da9e5163574073767aea2713b62
2025-10-07 19:20:15 -07:00
Nick Lefeverandmeta-codesync[bot] aa85da33a5 Support loading and assigning scroll state from scroll view helper (#53999)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53999

Update the `ScrollViewHelper` class to support reading the scroll state from the provided `stateWrapper` and assigning it to the view implementing the `HasScrollState` interface.

This will be used in a future diff to implement scroll state loading on the scroll view component in the scroll state setter function. This enables having one implementation of the state loading for all variants of the scroll view (vertical and horizontal scroll views).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D83247018

fbshipit-source-id: 44f10edab2341981b85d6ab8b83c7bea96c1e09d
2025-10-07 19:20:15 -07:00
Vitali Zaidmanandmeta-codesync[bot] aa492fadab combine all 0.82.0 changelog entries (#54088)
Test Plan:
## Changelog: [INTERNAL]

Pull Request resolved: https://github.com/facebook/react-native/pull/54088
Imported from GitHub, without a `Test Plan:` line.

Reviewed By: fabriziocucci

Differential Revision: D84105761

Pulled By: vzaidman

fbshipit-source-id: 0f3ad014f04b02d91cbb2fb7951d7a57d27df963
2025-10-07 17:10:02 -07:00
Zeya Pengandmeta-codesync[bot] 4740f211ae Extract helper function from AnimatedColor.js to process input color value (#54077)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54077

## Changelog:

[Internal] [Changed] - Extract helper function from AnimatedColor.js to process input color value

Reviewed By: rozele

Differential Revision: D84062952

fbshipit-source-id: 2005dc33d7fd6928ba2638d0d99a2e5faa8448d8
2025-10-07 15:39:32 -07:00
Zeya Pengandmeta-codesync[bot] 9e98c72ad3 Move using declarations into AnimationBackend class (#54057)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54057

## Changelog:

[General] [Changed] - Move using declarations into AnimationBackend class

names like `facebook::react::Callback` is a bit too generic and it'll be included in the scope whenever AnimationBackend.h is included in; `StartOnRenderCallback` already exists in c++ native animated (there we also nest the `using`s under class)

Reviewed By: sammy-SC

Differential Revision: D83867098

fbshipit-source-id: a50144bbbd1b441e3ef7b2884a19b091c3190c44
2025-10-07 14:34:25 -07:00
Zeya Pengandmeta-codesync[bot] 4a88282a9c create feature flag responderTerminateOnScrollAndroid (#54008)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54008

## Changelog:

[Internal] [Added] - create feature flag responderTerminateOnScrollAndroid

Reviewed By: javache

Differential Revision: D83584280

fbshipit-source-id: aa9633d61c0d2cc6af7da839c065f20da698995b
2025-10-07 12:39:55 -07:00
Christoph Purrerandmeta-codesync[bot] 38f52a5bc8 Use correct base class for NativeReactNativeFeatureFlags (#54046)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54046

Changelog: [Internal]

Per documentation the base class to extend from is the non `JSI` one:

https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules#3-write-the-native-code

Reviewed By: rubennorte

Differential Revision: D83815509

fbshipit-source-id: b05b80d2c6102bf27905411a299ec09e16bb8c25
2025-10-07 11:31:08 -07:00
Riccardo Cipolleschiandmeta-codesync[bot] 58afeeff1d Split macro for static module registration (#53992)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53992

This change descouple the Static Module registration from the Disable Legacy arch macro

## Changelog:
[Internal] -

Reviewed By: RSNara

Differential Revision: D83554091

fbshipit-source-id: 515aecc00428281a95441954513ccf21ff180f6f
2025-10-07 10:54:32 -07:00
Christoph Purrerandmeta-codesync[bot] 44725b88be Fix race condition in ImageFetcher when registering/unregistering commitHooks (#53862)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53862

Recently, we observed a `use-after-free race condition` where the ImageFetcher object was destroyed while it was still registered as a UIManagerCommitHook.

The crash occurred in `std::vector::size()` at line 635 when accessing corrupted memory.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D82846245

fbshipit-source-id: fe0d9156ec6bc004339ed987bb5937699ebdf23b
2025-10-07 10:22:29 -07:00
Moti Zilbermanandmeta-codesync[bot] 83fbb0b536 Track Network domain status in SessionState (#54068)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54068

Changelog: [Internal]

Adds a `SessionState::isNetworkDomainEnabled` bit, managed in `HostAgent`, to align with other domains. Network support is still gated behind feature flags as before.

Reviewed By: hoxyq

Differential Revision: D83847357

fbshipit-source-id: 8f94c803d04256a7e41503f2a690e97b91e3ed5e
2025-10-07 02:52:48 -07:00
James Moranandmeta-codesync[bot] c24e67fb53 Removing all references of hz_tracing V2 from the codebase (#54062)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54062

Renaming every V2 tracing macro so that it no longer has `_V2` suffixed. This diff completes the migration of the hz_tracing V1->V2 API.

This is a very large diff but is comprised of mostly mechanical changes. Most of these files were edited using `find` and `sed`, specifically:
`find . -type f \( -name "*.h" -o -name "*.cpp" \) -exec sed -i 's/HZT_\(.*\)_V2/HZT_\1/g' {} +`.

Since this is just a rename, no difference in functionality is expected.

Changelog: [Internal]

Differential Revision: D83808657

fbshipit-source-id: 64effdf701b1ff600185abfb737f9c0fa2250ddf
2025-10-06 22:15:27 -07:00
generatedunixname537391475639613andmeta-codesync[bot] 8542682754 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessReactContext.kt (#54071)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54071

Reviewed By: ianlevesque

Differential Revision: D83924405

fbshipit-source-id: a1bc441cb818ccde8038ea9a3a3ce20f4a4571db
2025-10-06 16:34:32 -07:00
Andrew Datsenkoandmeta-codesync[bot] 8ed0e1eba5 Add Platform Color example (#53908)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53908

Changelog: [Internal]
Add an example to show how Platform Color can react to changes in appearance.
This currently works on iOS for all colors, but for Android we need to "reset" desired tree with `key`.

Reviewed By: zeyap

Differential Revision: D82751014

fbshipit-source-id: 3e4b2b3ddff8c003ca835d6f26dbf9f7e82d413d
2025-10-06 12:05:31 -07:00
generatedunixname89002005287564andmeta-codesync[bot] 064fd59602 Fix CQS signal readability-redundant-smartptr-get in xplat/js/react-native-github/packages (#54065)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54065

Reviewed By: javache

Differential Revision: D83817146

fbshipit-source-id: 36bafe7d363d7978e2d74a98aee444af9f538de4
2025-10-06 10:43:45 -07:00
Gabriel Donadelandmeta-codesync[bot] 3f7f9d8fb8 Expose NativeComponentRegistry API to index.d.ts (#54043)
Summary:
Follow up of https://github.com/facebook/react-native/pull/52999 so that users can import `NativeComponentRegistry` from react-native when using typescript

On 0.82 when users try to import `NativeComponentRegistry` without using the Strict TypeScript API they get:
```
Module '"react-native"' has no exported member 'NativeComponentRegistry'.ts(2305)
```

## Changelog:

[GENERAL] [ADDED] - Expose NativeComponentRegistry API to index.d.ts

Pull Request resolved: https://github.com/facebook/react-native/pull/54043

Test Plan: CI should be green

Reviewed By: christophpurrer

Differential Revision: D83830024

Pulled By: huntie

fbshipit-source-id: e63258b30aed4b33b2881656df0ad88a4a7d670a
2025-10-06 09:42:28 -07:00
generatedunixname89002005287564andmeta-codesync[bot] b9baddfd5d Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [B] (#54003)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54003

Reviewed By: javache

Differential Revision: D83622358

fbshipit-source-id: e0b4bdd65d8af9ec0e25c28a2e02371d52154c2d
2025-10-06 08:00:57 -07:00
Christian Falchandmeta-codesync[bot] 068ec39aea fixed cp command to work with gnu coreutils (#54063)
Summary:
When using gnu coreutils, installation of ReactNativeDependenices on iOS fails at compile time with errors like in the following issue (in the Expo repo):

https://github.com/expo/expo/issues/38992

This is caused by a missing `.` in the end of the path name that the built-in MacOS cp command handles well, but that will create an extra Headers folder when using cp from gnu coreutils.

This commit fixes this by adding the missing `.`

## Changelog:

[IOS] [FIXED] - Fixed issue when using gnu coreutils cp command when using precompiled binaries causing compilation error

Pull Request resolved: https://github.com/facebook/react-native/pull/54063

Test Plan:
- Verify that you're running gnu coreutils (`cp --version`)
- Create new expo app `npx create-expo-app`
- Build on iOS - should error without this fix, should work with the fix.

Reviewed By: christophpurrer

Differential Revision: D83964083

Pulled By: javache

fbshipit-source-id: 46dc074ca9b7fc97fa5a37ef48d68a895e3310ff
2025-10-06 07:51:25 -07:00
Moti Zilbermanandmeta-codesync[bot] 5027375851 Lightly refactor DebuggerSessionObserverTest (#54055)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54055

Changelog: [Internal]

TSIA

Reviewed By: robhogan

Differential Revision: D83841197

fbshipit-source-id: e263f4098e09d0789abc1c33ee7ca4dac44600b2
2025-10-06 03:52:38 -07:00
Christian Falchandmeta-codesync[bot] 07f40ec6b4 add support for symbolication of precompiled React.xcframework (#54033)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54033

This commit adds support for symbolication of the XCFrameworks on request.

Symbol files are big and only needed if you need to debug React Native itself - f.ex. if you are a framework developer like Expo.

Symbolication can be performed by setting the `RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS=1` environment variable. This will cause the `ReactNativeCoreUtils` class to download symbol files and symbolicate the XFrameworks by doing the following:

- After downloading the requested React.XCFramework the symbols will also be downloaded and places in the artifacts folder.
- The XCFrameworks will be expanded and the folders in the symbol archive will be extracted into the XCFramework before it is zipped up again.

<img width="400" alt="image" src="https://github.com/user-attachments/assets/ec8dd2e1-c7f8-4d5f-a3b6-b8ffbb678c95" />

## Changelog:

[IOS] [FIXED] - Added support for symbolication of precompiled React.xcframework

Test Plan:
```
RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS=1 RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 bundle exec pod install
```

Remember to clean (remove the Pods directory) before turning on/off.

Reviewed By: christophpurrer

Differential Revision: D83753187

Pulled By: cipolleschi

fbshipit-source-id: f1522e1befdea99fb8c65695322ea3ed68e6caed
2025-10-04 10:21:21 -07:00
Christian Falchandmeta-codesync[bot] 12850c2962 add building blocks to symbolicate precompiled React.xcframework (#54032)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54032

This commit adds building blocks to support the symbolication of the XCFrameworks on request.

Symbol files are big and only needed if you need to debug React Native itself - f.ex. if you are a framework developer like Expo.

This change introduces some helper function that are needed to handle the dSYMS:
- `processDSYMs` the main function that unzip the symbols and prepare the framework for them
- `remap_sourcemaps_for_symbols` a support function that creates a mapping symbol -> file so that the debug can interpret them properly
- `generate_plist_content` a support function that generates the plist with all the mappings

These functions are used in the next commit of the stack.

## Changelog:

[Internal] - Added building blocks to support symbolication

Test Plan:
These functions are used in the next commit.
We split the commit to simplify the review. See the Test plan of the next commit to test them.

Reviewed By: cortinico

Differential Revision: D83753189

Pulled By: cipolleschi

fbshipit-source-id: 5d8027f5393a4e5a11f1b736c9901d40e7c5139b
2025-10-04 10:21:21 -07:00
Christian Falchandmeta-codesync[bot] 0a71b43fbc Update the sourceproperty to avoid multiple downloads (#54031)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54031

This commit updates the cocoapods source for RNDependencies so that the source for the package is the locally downloaded file so we don't download twice!

## Changelog:

[IOS] [FIXED] - Update the `source`property to avoid multiple downloads

Test Plan:
Run:
```
RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 bundle exec pod install
```

Multiple times and observe that the dependencies are not downloaded multiple times.

Reviewed By: christophpurrer

Differential Revision: D83753188

Pulled By: cipolleschi

fbshipit-source-id: e3fedca921b0ff9ba10ec3e5a7ba18dfbdffc3ba
2025-10-04 10:21:21 -07:00
Christian Falchandmeta-codesync[bot] f0f8b95719 Improve logging functions (#53976)
Summary:
This change remove some unnecessary logs and improve the logging functions for the prebuilds

bypass-github-export-checks

## Changelog:

[IOS] [CHANGED] - Updated logging functions for prebuilds

Pull Request resolved: https://github.com/facebook/react-native/pull/53976

Test Plan:
Run:
```
RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 bundle exec pod install
```

Reviewed By: christophpurrer

Differential Revision: D83481709

Pulled By: cipolleschi

fbshipit-source-id: bad358c6e6abfcb1568344e5161109dff7ee06ab
2025-10-04 10:21:21 -07:00
Gang Zhaoandmeta-codesync[bot] 36e1c0afed Remove old CDPHandler (#53983)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53983

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D83525759

fbshipit-source-id: 0a223a54339496e4e85ecb173b3c7e0012c4fba8
2025-10-03 10:29:45 -07:00
James Moranandmeta-codesync[bot] b3341d3541 Replace hz_tracing V1 macros with newer V2 variants (#54036)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54036

We are migrating away from the older V1 macros to the V2 macros, which have better code-stripped functionality and less business logic embedded in the API.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D83760301

fbshipit-source-id: b6c9ea155ebe22d6d4ce023a1dbb2cfd52fb8394
2025-10-03 10:05:29 -07:00
Moti Zilbermanandmeta-codesync[bot] fc60030a34 Add basic test for NetworkReporter and CDP Network domain (#54049)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54049

Changelog: [Internal]

Adds `JsiIntegrationTest`-based tests for the C++ layer responsible for handling the CDP `Network` domain. The tests use `NetworkReporter` to mimic the behaviour of a React Native platform that is generating network events.

NOTE: There are **significant problems** with the `NetworkReporter` / `NetworkHandler` singleton design: cross-Host and cross-Instance data pollution/corruption, inability to inspect multiple Hosts at once, inconsistency between the singleton's state and the CDP session's state, etc. The singletons similarly lack any kind of mechanism for test isolation (e.g. methods for clearing state between tests). As we iteratively fix these problems, the tests will require updating (and we'll be able to write stricter tests to cover the fixes).

Reviewed By: huntie

Differential Revision: D83746505

fbshipit-source-id: 7ee3c68e67f0d29587cbfafa98cf107d27065ffc
2025-10-03 06:10:29 -07:00
Moti Zilbermanandmeta-codesync[bot] c0e381db1c Reduce log spam from naggy mocks in tests (#54047)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54047

TSIA

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D83825727

fbshipit-source-id: a4a8ffc38571596985ae2687142dbc8a974be39c
2025-10-03 06:10:29 -07:00
generatedunixname537391475639613andmeta-codesync[bot] 6db4a0171e xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarShadowNode.cpp (#54054)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54054

Reviewed By: rshest

Differential Revision: D83735540

fbshipit-source-id: e4284fdb76344584a983cfd242c2463912f3a6bf
2025-10-03 04:35:31 -07:00
Nick Lefeverandmeta-codesync[bot] 88cf30a675 Add backgroundImage prop diffing to View (#54042)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54042

Update the View component props to diff the `backgroundImage` property and assign the value to `experimental_backgroundImage` which maps to the `backgroundImage` property on the Android `ReactViewManager`.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D83788008

fbshipit-source-id: 5f9d93403af483c9494d2782aedad604cbb7cbbc
2025-10-02 22:00:56 -07:00
Nick Lefeverandmeta-codesync[bot] d9d3b3e08b Add toDynamic conversion for RadialGradient (#54041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54041

Implement toDynamic conversion of the RadialGradient following the parse logic as described here: https://www.internalfb.com/code/fbsource/[28de0c66daab]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/RadialGradient.kt?lines=33-129

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D83788007

fbshipit-source-id: 305e6f5011f16103a559132e61b6d4eae24cc137
2025-10-02 22:00:56 -07:00
Nick Lefeverandmeta-codesync[bot] c53541f3a1 Add toDynamic conversion for LinearGradient (#54040)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54040

Implement toDynamic conversion of the LinearGradient following the parse logic as described here: https://www.internalfb.com/code/fbsource/[5fa7eb2b733a]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/LinearGradient.kt?lines=24-76

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D83788005

fbshipit-source-id: 9114451b12e31ad86abde54dbe2c8819a304e777
2025-10-02 22:00:56 -07:00
Nick Lefeverandmeta-codesync[bot] e88962bb1a Add toDynamic conversion for ValueUnit and ColorStop (#54039)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54039

Adding toDynamic conversion to `ColorStop` and `ValueUnit` structs which are being used by the linear and radial gradient data structures.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D83788006

fbshipit-source-id: 1ec0300ac4f17b65b6896d4d2c131eb05a059a22
2025-10-02 22:00:56 -07:00
Eric Rozellandmeta-codesync[bot] 26502c6319 Do not scroll to child inside nested scroll view (#54044)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54044

In rare cases, there may be a vertical ScrollView nested inside another vertical ScrollView. In these cases, when the requestChildFocus method is called, we may attempt to bring the entire focused child into view. However, we really only want to bring the entire nested ScrollView into view.

## Changelog

[Android][Fixed] Focused scroll into view behaviors for nested vertical scroll views

Reviewed By: bvanderhoof

Differential Revision: D83804043

fbshipit-source-id: 8df8f637e7f908cc283f55c0d78ee03ed3bb9117
2025-10-02 21:20:53 -07:00
David Vaccaandmeta-codesync[bot] aab0d3397c Add a Log error to discourage usages of getJSModule(RCTEventEmitter) in new architecture (#54038)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54038

This diff adds a Log error to discourage usages of getJSModule(RCTEventEmitter) in new architecture, recommending migration to new API

changelog: [Android][Changed] Add Log error to discourage usages of getJSModule(RCTEventEmitter) API

Reviewed By: shwanton

Differential Revision: D83523928

fbshipit-source-id: d967456087a59366a3bca9590cb4d6d1fdd5b60d
2025-10-02 14:04:02 -07:00
Sam Zhouandmeta-codesync[bot] 36a9b7eda7 Replace React.ElementProps in tests and examples (#54035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54035

`React.ElementConfig` is often the better choice. See https://flow.org/en/docs/react/types/#toc-react-elementprops

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D83749631

fbshipit-source-id: 81b21c1a0dced5bc578d3a5752c303b57b467f7b
2025-10-02 13:48:56 -07:00
Sam Zhouandmeta-codesync[bot] 041b4c3dd0 Replace React.ElementProps with React.ElementConfig in createAnimatedComponent.js (#54034)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54034

`React.ElementConfig` is often the better choice. See https://flow.org/en/docs/react/types/#toc-react-elementprops

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D83750127

fbshipit-source-id: 788169d73cccc2ed7c9b250845ad7277fe79c47f
2025-10-02 13:47:40 -07:00
generatedunixname89002005287564andmeta-codesync[bot] 481df76c24 Fix CQS signal readability-named-parameter in xplat/js/react-native-github/packages [B] (#54028)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54028

Reviewed By: javache

Differential Revision: D83719979

fbshipit-source-id: 4d683f7f95b2dc8502653d22a9a1d9fd6ab03b81
2025-10-02 12:55:56 -07:00
Devan Buggayandmeta-codesync[bot] 8c90f81aab Improve DevMenu for Android 11 (#54023)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54023

Android 12 introduced a new AlertDialog that better fits a longer list of content.
Android 11 and earlier have an AlertDialog that has a very small list view, requiring users to scroll through to find what they need. This change also fixes Android 12+ enable/disable states on menu items, as it no longer uses `isEnabled` for styling.

Before:
{F1982416953}

After:
{F1982416486}

Android 12:
{F1982430956}

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D83688775

fbshipit-source-id: a96120142f648e849be670bde5897c884f1f5f52
2025-10-02 09:30:08 -07:00
Devan Buggayandmeta-codesync[bot] 6e8fab96fa Harden perf monitor to metro connection changes (#54022)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54022

Perf monitor shows in a broken state if metro is started while the app is running. This change improves the tracing and monitor lifecycle around the metro connection events.

Before:
{F1982430185}

After:
{F1982430062}

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D83714223

fbshipit-source-id: 76826122924baa1a80c04dcc5ff18bc756a8e816
2025-10-02 09:30:08 -07:00
Vitali Zaidmanandmeta-codesync[bot] 6c874f25e2 Fix SoLoader race condition in InspectorNetworkRequestListener (#54029)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54029

Changelog: [Android][Fixed] Fixed `SoLoader` race condition in `InspectorNetworkRequestListener`

When enabling `LoadNetworkResrouce` with flag `nativeSourceCodeFetching` in `InspectorInterfaces.h`, running the app, and opening the debugger, the app was crashing with
```
No implementation found for void com.facebook.react.devsupport.inspector.InspectorNetworkRequestListener.onHeaders(int, java.util.Map)
(
tried
  Java_com_facebook_react_devsupport_inspector_InspectorNetworkRequestListener_onHeaders
and
  Java_com_facebook_react_devsupport_inspector_InspectorNetworkRequestListener_onHeaders__ILjava_util_Map_2
) - is the library loaded, e.g. System.loadLibrary?
```

Reviewed By: huntie

Differential Revision: D83741114

fbshipit-source-id: b878fb4680e6a51f9403e8dea2872da85254e024
2025-10-02 07:36:10 -07:00
Devan Buggayandmeta-codesync[bot] 53dc68a31d Don't flash the performance monitor there's no metro connection (#54019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54019

Currently the performance monitor flickers on boot if there's no metro connection. This change checks first if we have a packager before enabling the monitor.

No metro connection:
{F1982423105}

Metro connection:
{F1982423112}

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D83701372

fbshipit-source-id: d099880d3ab509942a937a6bde11ebdde13450cd
2025-10-02 07:21:18 -07:00
Devan Buggayandmeta-codesync[bot] 84947fb0de Fix performance analyze path from DevMenu (#54018)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54018

The DevMenu path for perf analyzing no-ops. This is due to incorrectly not inverting the bool result of `pauseAndAnalyzeBackgroundTrace()`. See https://www.internalfb.com/code/fbsource/%5Bfcebbc02e701%5D/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayManager.kt?lines=73-75.

{F1982418482}

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D83691623

fbshipit-source-id: a16e39b00c07b6846092cc29bc656a08a61d20bb
2025-10-02 07:21:18 -07:00
Rob Hoganandmeta-codesync[bot] 89f0a37800 Minor bump Metro to ^0.83.3 (#54010)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54010

Bump Metro minimum to 0.83.3

This release fixes a regression in loading config files that export promises.

Full changelog: https://github.com/facebook/metro/releases/tag/v0.83.3

Changelog:
[General][Changed] Metro bump to ^0.83.3

Reviewed By: vzaidman

Differential Revision: D83655569

fbshipit-source-id: 106a957620e4591ef3cce21d327886354913560b
2025-10-02 06:53:57 -07:00
generatedunixname89002005287564andmeta-codesync[bot] 880b7e2c3a Fix CQS signal readability-named-parameter in xplat/js/react-native-github/packages [B] (#54025)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54025

Reviewed By: rshest

Differential Revision: D83704348

fbshipit-source-id: 8f5e34aa1b344a30dfea26661ac7b71fa4b2ddb1
2025-10-02 06:50:35 -07:00
generatedunixname89002005287564andmeta-codesync[bot] bcf974838e Fix CQS signal readability-named-parameter in xplat/js/react-native-github/packages [A] (#54027)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54027

Reviewed By: javache

Differential Revision: D83703007

fbshipit-source-id: 36f08f1b48f52750065a39ef322cc675aa828f9e
2025-10-02 06:41:54 -07:00
generatedunixname89002005287564andmeta-codesync[bot] fd95f824d0 Fix CQS signal readability-named-parameter in xplat/js/react-native-github/packages [A] (#54026)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54026

Reviewed By: javache

Differential Revision: D83719624

fbshipit-source-id: 9e43d15dd4b44c9c7b3be711d62541135031d1f8
2025-10-02 06:24:14 -07:00
generatedunixname537391475639613andmeta-codesync[bot] 47d1d2b256 xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp (#54024)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54024

Reviewed By: rshest

Differential Revision: D83641704

fbshipit-source-id: 2d102bc1078a951aefee2097914477c6508cc988
2025-10-02 06:22:42 -07:00
Nick Lefeverandmeta-codesync[bot] 0e03adcc79 Add support for nextFocus props to View (#54021)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54021

Adding missing `nextFocus*` props to the View props to enable correct Props 2.0 diffing.

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D83714902

fbshipit-source-id: 9b47ba5ea3e177e72b77b1df4b6b6082848c77a4
2025-10-01 20:14:24 -07:00
David Vaccaandmeta-codesync[bot] 07fcdfebae Fix publish-updated-packages-test (#54017)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54017

Fix test: publish-updated-packages-test
changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D83699726

fbshipit-source-id: 45f4713d18ed74a6b344f34ab9b3dd7760088fcc
2025-10-01 17:22:35 -07:00
Moti Zilbermanandmeta-codesync[bot] 7dc26f58ee Allow tests to run against all versions of Hermes (#54011)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54011

Gets the `jsinspector-modern` (CDP backend) integration tests in React Native to pass when run against all relevant versions of Hermes: Legacy Hermes (`xplat/hermes`), Static Hermes stable (`xplat/shermes/stable`), and Static Hermes trunk (`xplat/static_h`).

This involves disabling the two types of failing test:

1. Tests that should be legitimately disabled because Static Hermes omits the legacy, pre-Fusebox debugger infra (see changes to `ReactInstanceIntegrationTest.cpp`)
2. Tests that should be passing but expose a current bug in Static Hermes (see changes to `JsiIntegrationTest.cpp`)

This provides a useful baseline for upcoming work in CDPDebugAPI (etc) across the different versions of Hermes.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D83564896

fbshipit-source-id: c27f02266d63d58983c660ba0e4be5c44f02c9b6
2025-10-01 12:48:25 -07:00
David Vaccaandmeta-codesync[bot] 10c5c75de4 Delete Legacy Architecture class CoreModulesPackage (#53787)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53787

CoreModulesPackage is part of legacy architecture and unused on new architecture, let's delete it

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D82235543

fbshipit-source-id: bd18a1e26929c1f4533175d7567c552e142fbebb
2025-10-01 10:55:17 -07:00
generatedunixname1395667395051502andFacebook GitHub Bot 8825ec7464 Update React Native DevTools binaries
Summary:
Automated update of React Native DevTools binaries
bypass-github-export-checks
Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D83661214

fbshipit-source-id: f1de9dc96d30c46da986f52c6bdb623eeee469dc
2025-10-01 08:54:14 -07:00
Nicola CortiandFacebook GitHub Bot d9a582e949 Bump packages to 0.83.0-main (#54009)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54009

Packages haven't been bumped on main ahead of 0.83. This takes care of it.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi, huntie

Differential Revision: D83580515

fbshipit-source-id: 7471e77f74e3fb3b4ee6538a49369b5df1393098
2025-10-01 07:13:33 -07:00
Bartłomiej BłoniarzandFacebook GitHub Bot e091759947 Animation Backend init (#53526)
Summary:
This diff adds AnimatedProps class that allows prop diffs to be passed to the backend. Currently it is implemented through subclassing, but the implementation details are subject to change. To simplify integration with animation frameworks AnimatedPropsBuilder class was created - frameworks can use it to prepare their diffs.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[GENERAL] [ADDED] - AnimatedProps.h AnimatedPropsBuilder.h
[GENERAL] [CHANGED] - AnimationBackend initialisation and style updates

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/53526

Test Plan:
js1 fantom AnimatedBackend-itest.js
js1 fantom Animated-itest.js

Reviewed By: zeyap

Differential Revision: D81309558

Pulled By: bartlomiejbloniarz

fbshipit-source-id: 92476568b6498d7ee64203f70a17c3e578de7ac1
2025-10-01 04:15:11 -07:00
Bartlomiej BloniarzandFacebook GitHub Bot 7ec470d49a Expose the backend via UIManager (#53995)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53995

### Summary

Exposes the animation backend via UIManager by introducing two new methods: `unstable_setAnimationBackend` and `unstable_getAnimationBackend`. The `NativeAnimatedNodesManagerProvider` is updated to initialize the animation backend using the `useSharedAnimatedBackend` feature flag.

## Changelog:

[GENERAL] [ADDED] - unstable_setAnimationBackend, unstable_getAnimationBackend in UIManager
[GENRAL] [CHANGED] - call unstable_setAnimationBackend in NativeAnimatedNodesManager

Reviewed By: zeyap

Differential Revision: D81137954

fbshipit-source-id: b9a45b1d1e694e28865c27181bcbd578c1b7b9a0
2025-10-01 04:15:11 -07:00
Bartlomiej BloniarzandFacebook GitHub Bot 3f396616d2 Init the backend closer to the uiManager (#53996)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53996

## Summary

This diff makes changes to the `NativeAnimatedNodesManager` and `AnimationBackend` to initialize the backend closer to the `UIManager`.

## Changelog:

[GENERAL] [CHANGED] - initialize the backend in NativeAnimatedNodesManagerProvider

Reviewed By: sammy-SC

Differential Revision: D81138133

fbshipit-source-id: 5be0c8d5f5e3593bcd8111bbd1d0e90502a53a0d
2025-10-01 04:15:11 -07:00
Bartlomiej BloniarzandFacebook GitHub Bot 325c681cb1 boostrap shared animation backend (#53994)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53994

# Summary

This diff introduces the Shared Animation Backend - a class that can be used by animation frameworks to schedule and run animation updates.

## Changelog:

[GENERAL] [ADDED] - AnimationBackend-itest.js AnimationBackend BUCK/CmakeLists
[GENERAL] [ADDED] - useSharedAnimationBackend feature flag
[GENERAL] [CHANGED] - make AnimatedNodesManager use the backend behind the flag

Reviewed By: zeyap, sammy-SC

Differential Revision: D80809364

fbshipit-source-id: dbfe273362410cdf2f9fc37d78adac7faf4cd118
2025-10-01 04:15:11 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 33bc2716e4 Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [A] (#54002)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54002

Reviewed By: javache

Differential Revision: D83622069

fbshipit-source-id: 70b1393dc71ea80d9910682ce86ffd7dd8cd04d5
2025-10-01 04:10:58 -07:00
Dawid MaleckiandFacebook GitHub Bot 29d5aa582f iOS: Add new configuration for RCTDevMenu (#53505)
Summary:
Following the [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/925), this PR adds new `RCTDevMenu` configuration  and extends `RCTReactNativeFactory` API for passing it to the particular `RCTHost`.  The `RCTDevMenuConfiguration` includes:

- isDevMenuEnabled,
- isShakeGestureEnabled,
- areKeyboardShortcutsEnabled

## Changelog:

[IOS][ADDED] - Add new configuration for `RCTDevMenu`

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/53505

Test Plan:
Tested with different configurations on `RCTDevMenuConfiguration`:

<details>
<summary>Click to view code</summary>

```objc
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self];
#if USE_OSS_CODEGEN
  self.dependencyProvider = [RCTAppDependencyProvider new];
#endif

  RCTDevMenuConfiguration *devMenuConfiguration = [[RCTDevMenuConfiguration alloc] initWithDevMenuEnabled:true shakeGestureEnabled:false keyboardShortcutsEnabled:false];

  [self.reactNativeFactory setDevMenuConfiguration:devMenuConfiguration];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

  [self.reactNativeFactory startReactNativeWithModuleName:@"RNTesterApp"
                                                 inWindow:self.window
                                        initialProperties:[self prepareInitialProps]
                                            launchOptions:launchOptions];

  [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];

  return YES;
}
```

</details>

Run helloworld:

<img src="https://github.com/user-attachments/assets/16c35176-6fbe-498c-96fd-a0fe988a5e3c" alt="hello-world-screenshot" width="300">

Reviewed By: cipolleschi

Differential Revision: D81684275

Pulled By: coado

fbshipit-source-id: 500e170c93df25949de433970442d20c442be7f2
2025-10-01 02:42:54 -07:00
React Native BotandFacebook GitHub Bot 3766e58b9a Add changelog for v0.82.0-rc.5 (#53993)
Summary:
Add Changelog for 0.82.0-rc.5

## Changelog:
[Internal] - Add Changelog for 0.82.0-rc.5

Pull Request resolved: https://github.com/facebook/react-native/pull/53993

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D83564973

Pulled By: vzaidman

fbshipit-source-id: 411da5ee9f1be6e9a8891c12a5e5e2e09c5c15f6
2025-10-01 00:35:58 -07:00
Chi TsaiandFacebook GitHub Bot 6031905711 Fix JSI isArray method to match JS Array.isArray (#53998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53998

As the previous few diffs, JSI `isArray` API should follow
`Array.isArray` from the JS spec.

The current implementation does not consider Proxy objects, only Array
exotic objects.

Changelog: [Internal]

Reviewed By: lavenzg

Differential Revision: D83391784

fbshipit-source-id: 6db8e5a48458a1aa57006fb0747f62ec78efa675
2025-09-30 20:17:12 -07:00
Fernando GorodscyandFacebook GitHub Bot 990ca0d100 Add support for .ktx images (#53991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53991

As part of D83474751 to migrate Store from arvr to xplat we discovered that ktx images are not setup correctly in xplat. Adding support for it in flow and jest

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D83562581

fbshipit-source-id: 8c7205417dc24ca2d48a2e2fa1ca7dea40504c18
2025-09-30 18:36:11 -07:00
Jakub PiaseckiandFacebook GitHub Bot e02e7b1a29 Request layout on configuration change only when the font scale has changed (#53984)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53984

Changelog: [ANDROID][CHANGED] - Request layout on configuration change only when the font scale has changed

Wraps call to `requestLayout` in a condition to only run layout when the font scale has changed to prevent it from executing in response to other configuration changes.

Reviewed By: Abbondanzo

Differential Revision: D83546632

fbshipit-source-id: 41a5199dd2ef72b8f6257637c1d35d4a790ea006
2025-09-30 08:40:09 -07:00
Pieter De BaetsandFacebook GitHub Bot af904e563e Unbreak Fb4aReactPackageTest (#53988)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53988

These broke during Kotlin conversions etc as `context.getSystemService` is nullable.

Changelog: [Internal]

Reviewed By: lenaic, rshest

Differential Revision: D83503457

fbshipit-source-id: f4d2a09d60c38e6e5ae2b01d61fa73459b0f7f4d
2025-09-30 05:03:42 -07:00
Nick LefeverandFacebook GitHub Bot a073080810 Fix serialization for vector of primitive type (#53982)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53982

This diffs adds specific `toDynamic` conversions for props defined as arrays holding primitive types. This fixes the serialization of `std::vector<Float>` that was failing to correctly convert to a `folly::dynamic` type when using Props 2.0.

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D83520605

fbshipit-source-id: 80a6ce2b3a265601f945ff3b76840c04e46aacdc
2025-09-29 18:17:49 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 5a4ed2d955 Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [B] [B] [B] (#53970)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53970

Reviewed By: rshest

Differential Revision: D83404453

fbshipit-source-id: 852d553b9c70a00c8493f8f0ad2d55df0a6093ea
2025-09-29 16:52:55 -07:00
Chris LewisandFacebook GitHub Bot 0a3bcc97ec Back out "Genalize focus/blur behavior in JS" (#53979)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53979

This reverts a previous change that modified how focus behavior is handled in JavaScript. That change caused hierarchy rows to no longer be focusable, either manually or programmatically as they were before, which in turn broke arrow key navigation in entity lists. Reverting the change restores the expected focus behavior and re-enables proper arrow key functionality within entity lists.

Changelog: [Internal]

Differential Revision: D83390685

fbshipit-source-id: 165567eceedce5d0a2e664a9ef3070d5a2bf9b67
2025-09-29 16:09:05 -07:00
Pieter De BaetsandFacebook GitHub Bot a81e94a40c Fix useNativeTransformHelper behaviour when frame size is 0 (#53978)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53978

Inconsistency between the previous and old version of `processTransform` - if frameSize is 0, the transform was being ignored, which is not correct when considering a fixed transform origin and a rotation animation for example. Instead, always apply the transform origin if it's set.

Changelog: [Android][Fixed] Fixed representation of transforms when view is originally zero-sized

Reviewed By: mdvacca

Differential Revision: D83469083

fbshipit-source-id: e9ae1500f64c700708edb00b2d5871e3f224fb07
2025-09-29 15:37:24 -07:00
generatedunixname89002005287564andFacebook GitHub Bot fa465c6da9 Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [B] [A] [B] (#53972)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53972

Reviewed By: rshest

Differential Revision: D83405113

fbshipit-source-id: 5e7b3c37e08d49991fd112180625953a0edca047
2025-09-29 12:36:44 -07:00
Devan BuggayandFacebook GitHub Bot 0b14a19ea6 Migrate ReactRoot to Kotlin (#53238)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53238

Changelog:
[Android][Changed] - Migrated ReactRoot to Kotlin

Reviewed By: cortinico

Differential Revision: D80074359

fbshipit-source-id: 273f5bfc2826f59f2bb1521b8dbd95c48e5eb0c4
2025-09-29 12:28:02 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 3774f75705 Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [A] (#53969)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53969

Reviewed By: rshest

Differential Revision: D83350635

fbshipit-source-id: 48ec748e3ffadd9985daa40895ffbbd1dd40e946
2025-09-29 10:34:02 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 279835dc14 Daily arc lint --take KTFMT (#53974)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53974

Reviewed By: VladimirMakaev

Differential Revision: D83454863

fbshipit-source-id: 6742bac1207743f3fc58c48d1261de00bcfacf85
2025-09-29 10:05:01 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 3fb6c12ec8 Fix CQS signal readability-const-return-type in xplat/js/react-native-github/packages (#53940)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53940

Reviewed By: javache

Differential Revision: D83238455

fbshipit-source-id: ea3d3180f37151b3bba432d55324f2d854f29bc4
2025-09-29 08:16:45 -07:00
generatedunixname89002005287564andFacebook GitHub Bot fe043446e8 Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [A] (#53971)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53971

Reviewed By: rshest

Differential Revision: D83395511

fbshipit-source-id: 832901c112d6ebf0b58280bf12a50f7845251c5c
2025-09-29 06:30:14 -07:00
generatedunixname89002005232357andFacebook GitHub Bot c47205990d Revert D82781491 (#53968)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53968

This diff reverts D82781491
(The context such as a Sandcastle job, Task, SEV, etc. was not provided.)

Depends on D82781491

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D83442434

fbshipit-source-id: bd570564ee22d57bd7a3ca7f6990230de3e5ac4e
2025-09-28 22:09:03 -07:00
Nick LefeverandFacebook GitHub Bot 2f40224faf Add support for global view culling outset ratio setting (#53845)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53845

Adding a feature flag controlling the outset ratio set on the culling context frame. This feature flag value will add an outset on the width and height calculated by multiplying these with the provided ratio value. This will offset each side of the frame, maintaining the center of the frame at the same location.

This outset ratio helps mitigate async scroll blanking and focus handling on host platforms.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D82684027

fbshipit-source-id: 3d1aaf680c5896fd4bb992b272b650ab2c097905
2025-09-28 15:13:07 -07:00
Fernando GorodscyandFacebook GitHub Bot fb09b37646 Move files from arvr/js/apps/Store to xplat/js/RKJSModules/public/HzStoreVR
Summary:
# What

Moving Store from `arvr/js` to `xplat/js`.
This will enable Store to use xplat modern infra. Being on arvr/js legacy infra has created many problems [over the years](https://fb.workplace.com/groups/storecore/posts/2344707442611890/?comment_id=2345657702516864). Examples:

**2025**: https://fb.workplace.com/groups/storecore/permalink/2344707442611890/
**2024**: https://fb.workplace.com/groups/oculusjs/permalink/3366314690341563/
**2023**: https://fb.workplace.com/groups/xplatreact.engineering/permalink/730125568732098/

# How
## Previous Diff
* Remove usage of the legacy `react-router-3`. We don't want to carry this as a dependency to xplat/js.

## This Diff
This diff is the combination of several diffs (created to facilitate reviewing):

1. - D82581768 - Just move files from arvr/js/apps/Store to xplat/js/RKJSModules/public/HzStoreVR (Except for the index file and some mockUtils)
2. - D82581767 - Setup getConfig.js to generate a single BUCK for HzStoreVR and remove circular dependencies
3. - D82581769 - Fix location/import of assets
4. - D82581766 - Fix relay imports that were not using Haste
5. - D82664586 - Remove usage of old url module
6. - D83156829 - Fix buck: run js1 build buckfiles and build_and_run.sh
7. - D82844768 - Make arvr/js tests run with xplat Store
8. - D83005059 - Fix Flow errors
9. - D83259512 - Delete duplicated test files to make flow happy
10. - D83005098 - Fix Relay config for new Store VR location in xplat
11. - D83005073 - Enable React Forget on new HzStoreVR directory
12. - D83345573 - Fix arc lint -a
13. - D83403188 - Fix relay prefetch queries

## Next diffs
* Migrate tests to xplat jest config (renaming from *-rntest.js to *-test.js)
* Migrate other source code like arvr/js/libraries/store

## Open Source PR
For the change to RN open source .flowconfig to add .ktx image support: https://github.com/facebook/react-native/pull/53964
Changelog: [Internal]

Reviewed By: Tom910, mullender

Differential Revision: D82781491

fbshipit-source-id: 5ce6433916e5b144965e8906005e2e26fdcfcc95
2025-09-27 17:13:39 -07:00
Sam ZhouandFacebook GitHub Bot 488b31d29a Deploy 0.287.0 to xplat (#53965)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53965

[changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D83415742

fbshipit-source-id: ff6faa673a70cb8dc958ef2ad46245c720f3df9a
2025-09-27 14:01:43 -07:00
David VaccaandFacebook GitHub Bot 99b7cb77a7 Delete ReactRawTextShadowNode from codebase (#53949)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53949

ReactRawTextShadowNode is part of legacy architecture and unused, let's delete it

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D83188351

fbshipit-source-id: 19514d8e5d96d2d2fb4fb4b25d422282894c8c18
2025-09-26 14:07:25 -07:00
David VaccaandFacebook GitHub Bot 969e14271c Delete ReactRawTextManager from codebase (#53947)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53947

ReactRawTextManager is legacy architecture and unused, let's delete it

changelog: [internal] internal

Reviewed By: alanleedev

Differential Revision: D83187075

fbshipit-source-id: 4e4f7feb3178b3f95a71ff805ec7d784f2811285
2025-09-26 14:07:25 -07:00
David VaccaandFacebook GitHub Bot 8386a9e4f1 Delete ReactVirtualTextShadowNode (#53948)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53948

ReactVirtualTextShadowNode is par of legacy architecture and unused, let's delete it

changelog: [internal] internal

Reviewed By: alanleedev

Differential Revision: D83187955

fbshipit-source-id: d8bd0aa9cece68c7b4a4d5674ce97a8ef43a7fc5
2025-09-26 14:07:25 -07:00
David VaccaandFacebook GitHub Bot 163d553ba2 Delete NoSuchNativeViewException (#53946)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53946

NoSuchNativeViewException is legacy architecture and unused, let's delete it

changelog: [internal] internal

Reviewed By: alanleedev

Differential Revision: D83186872

fbshipit-source-id: cbd3b2f537673745e634d0bfc8717fc93f1c0c5f
2025-09-26 14:07:25 -07:00
David VaccaandFacebook GitHub Bot 589bf35cd1 Delete ReactVirtualTextViewManager from codebase (#53945)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53945

ReactVirtualTextViewManager is an internal legacy architecture class that's unused, we are deleting it

changelog: [internal] internal

Reviewed By: alanleedev

Differential Revision: D83186611

fbshipit-source-id: 323c77077ab91ffec35af8e4c12da4bdf13fa233
2025-09-26 14:07:25 -07:00
David VaccaandFacebook GitHub Bot dd6c23fb61 Delete YogaNodePool (#53944)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53944

YogaNodePool is an internal API used only by LegacyArchitecture of React Native Android, which is unused

This diff deletes YogaNodePool from the codebase

changelog: [internal] internal

Reviewed By: alanleedev, cortinico

Differential Revision: D83184441

fbshipit-source-id: 7c358985d9f19b38c28cca7fb0acf9322e97d87c
2025-09-26 14:07:25 -07:00
Devan BuggayandFacebook GitHub Bot 218d2f6fdc PerfMonitor - Add show/hide to dev menu (#53958)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53958

Adds a dev menu option to enable/disable the overlay, in case devs want to screenshot/record without disabling it at buildtime.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D83293591

fbshipit-source-id: 3564b83a279db296d1cd22a8e8a83876cc705dbd
2025-09-26 12:28:25 -07:00
Devan BuggayandFacebook GitHub Bot 456e01bf3f PerfMonitor - Fix enable/disable states (#53957)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53957

There are cases where the overlay can get enabled multiple times, creating more than one view. This change no-ops enabling if the overlay is already enabled and just uses enable/disable for showing/hiding the view.
{F1982272836}

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D83275253

fbshipit-source-id: 4b468171a582e134071875f718c66d1659d67782
2025-09-26 12:28:25 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 8bc133c6c1 Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages (#53962)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53962

Reviewed By: javache

Differential Revision: D83330024

fbshipit-source-id: f35898ba42dc06909b927d5c4b5477e7d8c8e966
2025-09-26 10:50:27 -07:00
SimpleCreationsandFacebook GitHub Bot f7ea40bc28 Fix TypeScript types of positions in GradientValue (#53942)
Summary:
The original type of the `positions` property was mistakenly declared as a 2-dimensional array, which is not accepted in runtime. In reality, a flat string array is expected as per [linear gradient examples](https://github.com/facebook/react-native/blob/18ba21149ae46d3fa97fe0dcbe165999009d2a6e/packages/rn-tester/js/examples/LinearGradient/LinearGradientExample.js#L230).

## Changelog:

[General] [Fixed] - TypeScript types of `positions` in `GradientValue`

Pull Request resolved: https://github.com/facebook/react-native/pull/53942

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D83342637

Pulled By: javache

fbshipit-source-id: 556618dd43861b3d3f1728c089f790815f2f011b
2025-09-26 10:13:27 -07:00
Nurtau ToganbayandFacebook GitHub Bot ad5949ffd6 Fix TaskDispatchThread (#53961)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53961

Changelog: [Internal]

Fixed a bug in TaskDispatchThread. To understand bug, let me show an example. The task is scheduled to run after several seconds. It reaches loopCv_.wait_until() and waits there. There are 2 bad scenario:
1. wait_until spuriously wakes up and async task runs even before its scheduled time
2. new task is added with runSync(). New task gets added to the queue and loopCv_ is notified. Async task will run before its scheduled time and even worse queue_.pop() will remove sync task. Therefore runSync will be blocked for forever.

To fix this bug, we need to add `continue` after wait_until().

Also I added new test to prevent this bug in future.

Reviewed By: rshest

Differential Revision: D83345047

fbshipit-source-id: 37962613a123a123c0e110426ae782effe5a81c1
2025-09-26 08:54:24 -07:00
Rob HoganandFacebook GitHub Bot 2d2011c7ae Invalidate transform cache on update of/local changes to @react-native/babel-preset (#53867)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53867

`react-native/metro-babel-transformer` implements `getCacheKey` for Metro, but does not vary the cache key on changes to `react-native/babel-preset`, one of its dependencies, leading to false positive cache hits (changes not being reflected).

This is particularly a problem in development, although it potentially also leads to issues in the unusual case that `react-native/babel-preset` is updated via npm, but no other package is.

This adds a `getCacheKey` to `react-native/babel-preset` and incorporates it into `react-native/metro-babel-transformer`'s `getCacheKey`. It's based on `package.json#version` in production and a hash of package contents in development (`version.endsWith('-main')`).

Changelog:
[General][Fixed] Invalidate transform cache when `react-native/babel-preset` is updated

Reviewed By: huntie

Differential Revision: D82893894

fbshipit-source-id: 9bbc034eaf68ee0e5b3078fb2fe8f30caa7f11c9
2025-09-26 08:13:44 -07:00
Pieter De BaetsandFacebook GitHub Bot 29b74061e4 Inline lazy fields in core data types (#53959)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53959

These data-types are super common in React Native, and the anonymous inner classes add significantly to the GC workload we see. For ReadableMap this means we can save 6 additional object allocations for each LazySynchronizedImpl and the lambda that's passed in to it. On synthetic benchmarks this seems to improve core operations around ~10%.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D83245864

fbshipit-source-id: 69b314a1f52a32375b5e1f591555f50bfbc31843
2025-09-26 07:20:06 -07:00
Jakub PiaseckiandFacebook GitHub Bot 4f2755bda5 Update the version of Hermes V1 (#53930)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53930

Changelog: [GENERAL][CHANGED] - Update version of Hermes V1 used for React Native

Reviewed By: cortinico

Differential Revision: D83234930

fbshipit-source-id: 7cbad6c4b4fe6d7c8fe3ac25bea30bb25100ee18
2025-09-26 01:33:12 -07:00
Nivaldo BondançaandFacebook GitHub Bot 64d34080af Update ktfmt component on FBS:master (#53956)
Summary:
X-link: https://github.com/facebookexternal/meta-ar-mr-tooling/pull/200

Pull Request resolved: https://github.com/facebook/react-native/pull/53956

Reviewed By: jselbo

Differential Revision: D82570814

fbshipit-source-id: 6eeade55734548d057c5eae77a9188172473a819
2025-09-26 01:00:36 -07:00
Eric RozellandFacebook GitHub Bot b9dcc1b670 Flip the order of component descriptor registration (#53953)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53953

For TurboModule registration, we register custom / app-specific TurboModules before core TurboModules to ensure that app-specific module overrides are preferred over core / default behaviors.

This provides a similar behavior for Fabric component descriptor registration.

## Changelog

[Internal]

Reviewed By: alanleedev

Differential Revision: D83273376

fbshipit-source-id: fd0fb5f10d2bc29839ae554f0e3cfc18d7957848
2025-09-25 19:56:41 -07:00
Eric RozellandFacebook GitHub Bot 49b0045669 Unseal ScrollViewProps (#53952)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53952

In React Native Android, you can technically override core components like ScrollView to add additional props and behaviors, but doing so in the new architecture requires ensuring that these props are tracked in the C++ props object.

This change unseals ScrollViewProps so they can be overridden in (rather rare and generally unsupported) cases where you need to customize ScrollView behaviors for a specific app.

## Changelog

[Internal]

Reviewed By: Abbondanzo

Differential Revision: D83268457

fbshipit-source-id: d1d895e9f060dcf94bf82538a33bf5f2fbb135d7
2025-09-25 19:56:41 -07:00
Ramanpreet NaraandFacebook GitHub Bot 2b5938c900 Remove legacy validation warning infra (#53792)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53792

This validation infra served us well, but it's no longer needed.

All the legacy architecture classes have been identified and deprecated. And in the next major release, we will simply remove them.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D82470292

fbshipit-source-id: 44b58e63b7aca4fa22ac6b891275417bf1add8d1
2025-09-25 17:58:52 -07:00
Ramanpreet NaraandFacebook GitHub Bot d3890080c8 Consolidate all c macros (#53823)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53823

Let's just use the same flag to compile out everything. I don't think we'll need the utility of separate flags.

Reviewed By: fkgozali

Differential Revision: D82476933

fbshipit-source-id: 1b5fbfad7d54e0af7db5459772b3e7a8472c1eb1
2025-09-25 16:59:07 -07:00
Luna WeiandFacebook GitHub Bot 62fd6895e3 fbsource//xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/viewexperimental:viewexperimentalAndroid (#53782)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53782

Changelog: [Internal] - Remove unnecessary ?. in VirtualViewExperimental

Reviewed By: yungsters

Differential Revision: D82426042

fbshipit-source-id: 2ba012b421b1d5000892e085a3277506829e7be2
2025-09-25 15:21:30 -07:00
Nurtau ToganbayandFacebook GitHub Bot 7b8590f860 Correctly join thread in TaskDispatchThread (#53943)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53943

Changelog: [Internal]

Thread join should happen only during TaskDispatchThread dtor, otherwise if quit is called on the same thread (thread_), then thread_ will get detached, which can lead to use of already deleted fields (queue_, running_) of TaskDispatchThread.

But we also need to make sure that on quit() call, loop is getting stopped, otherwise in loop, already running task will use already deleted fields of captured object. If quit() is called as task on thread_, then there is no need to wait for future because loop will organically end since running_ is false.

Reviewed By: rshest

Differential Revision: D83044012

fbshipit-source-id: a2da97a89093c47c64b693e3c9e5d6f7297c038e
2025-09-25 14:21:07 -07:00
Alex HuntandFacebook GitHub Bot 4e595b7c7d Update debugger-frontend from 8b84a77...8cce390 (#53941)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53941

Changelog: [Internal] - Update `react-native/debugger-frontend` from 8b84a77...8cce390

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/8b84a77b2c82c670886ef064dfc92d6bce83e579...8cce39003f66f66a8fb4c0e581a2b5046cf9c1d1).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [8cce39003](https://github.com/facebook/react-native-devtools-frontend/commit/8cce39003) | Alex Hunt (hello@alexhunt.dev) | 2025-09-25T15:05:50+01:00 | [Update Welcome panel assets and styling (#208)](https://github.com/facebook/react-native-devtools-frontend/commit/8cce39003) |
| [7724ccb99](https://github.com/facebook/react-native-devtools-frontend/commit/7724ccb99) | Alex Hunt (hello@alexhunt.dev) | 2025-09-25T08:46:01+01:00 | [Disable Perf Insights subpanel, collapse sidebar by default (#209)](https://github.com/facebook/react-native-devtools-frontend/commit/7724ccb99) |
| [538c309a3](https://github.com/facebook/react-native-devtools-frontend/commit/538c309a3) | Vitali Zaidman (vzaidman@gmail.com) | 2025-09-18T12:20:22+01:00 | [track when all startup resources are loaded (#205)](https://github.com/facebook/react-native-devtools-frontend/commit/538c309a3) |

Reviewed By: hoxyq

Differential Revision: D83248877

fbshipit-source-id: e5d7fb009a89bd97c8aac5f0a09b5733b8249651
2025-09-25 11:32:17 -07:00
riteshshukla04andFacebook GitHub Bot ed24a4d05b fix-types in Refresh control (#53907)
Summary:
Fixes https://github.com/facebook/react-native/issues/53893
The size should be of type string (large or default) . Typescript says number

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL][FIXED] Fixed Types in Refresh control

Pull Request resolved: https://github.com/facebook/react-native/pull/53907

Test Plan: N/A

Reviewed By: javache

Differential Revision: D83161286

Pulled By: arushikesarwani94

fbshipit-source-id: 4e557bc3780f297551b913c5c763c369cf3e374c
2025-09-25 11:15:16 -07:00
Vitali ZaidmanandFacebook GitHub Bot 92cae27cb2 only remove the Fast Refresh "Refreshing..." toast when all bundles being loaded finished loading. (#53937)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53937

Changelog: [General][Fixed] only remove the Fast Refresh "Refreshing..." toast when all bundles being loaded finished loading.

Reviewed By: huntie

Differential Revision: D83246895

fbshipit-source-id: f02fac9fe16b307ae4b36f09bc88f5261c590b15
2025-09-25 11:07:38 -07:00
Pieter De BaetsandFacebook GitHub Bot 490b05d0d8 Extract SynchronousMountItem (#53936)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53936

Align with other mount items and make it easier to identify in memory traces.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D83241794

fbshipit-source-id: 9df1523e265e560c15f93bad8cd91a651bc5a4e2
2025-09-25 10:04:48 -07:00
Pieter De BaetsandFacebook GitHub Bot 09441d8691 Fix ReactViewManager subclasses triggering view recycling (#53933)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53933

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D83238077

fbshipit-source-id: d3dc4f96b9934fcbcd9a80354f976d5eb0bc9f0c
2025-09-25 10:04:48 -07:00
generatedunixname1395667395051502andFacebook GitHub Bot 5735bb5955 Update React Native DevTools binaries
Summary:
Automated update of React Native DevTools binaries
bypass-github-export-checks
Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D83233752

fbshipit-source-id: 4f87b05e552d728314d3c7be1d28267d58b8f19c
2025-09-25 06:17:47 -07:00
generatedunixname537391475639613andFacebook GitHub Bot 6e9a46ab81 xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm (#53931)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53931

Reviewed By: javache

Differential Revision: D83144241

fbshipit-source-id: 115f085974ca6cc13c1412ab59881e4f819b594b
2025-09-25 04:49:34 -07:00
Moti ZilbermanandFacebook GitHub Bot f599e2a613 Fix custom prebuilt binary handling in unstable_prepareDebuggerShell (#53927)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53927

Changelog: [Internal]

Fixes a bug that broke `unstable_prepareDebuggerShell` (and therefore the RNDT shell) in OSS.

Reviewed By: vzaidman

Differential Revision: D83178777

fbshipit-source-id: cfd93b14e2a94e36d8a3ee9f4605036a4279ef8c
2025-09-25 02:29:11 -07:00
Alex HuntandFacebook GitHub Bot b577679746 Update DevTools windowKey to a sha256 hash (#53923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53923

Motivated by feedback on D83070252. This prevents us from including decodable information about debug targets in these values.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D83139401

fbshipit-source-id: 01b01d23e4dfb06e400729b8cedf1fe2e098b209
2025-09-25 01:22:58 -07:00
Alex HuntandFacebook GitHub Bot 88f05b219c Fix build for debugger-shell (#53924)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53924

Fix failing `yarn build` runs following D83070252.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D83161092

fbshipit-source-id: 3e9e984699750add82794281a387eac0534da60d
2025-09-25 01:22:58 -07:00
Sam ZhouandFacebook GitHub Bot dc3736893d Deploy 0.286.0 to xplat (#53929)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53929

[changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D83192932

fbshipit-source-id: 0457464a1ae1907a6906a26faa3ff319f01f9356
2025-09-24 18:25:10 -07:00
Vitali ZaidmanandFacebook GitHub Bot 3a954caf4f don't require projectRoot in devMiddleware (#53921)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53921

Changelog: [Internal] `devMiddleware` removed the unused option `projectRoot`

This option was used only in a dead branch of the code inside `InspectorProxy`.

The scenario where it appeared was enabling resolving script sources (`Debugger.getScriptSource`) starting with `file://` which were coming from the file system. However, we don't seem to ever point scripts at the filesystem this way.

Reviewed By: huntie

Differential Revision: D82739662

fbshipit-source-id: 9a130eaa83cb94ae0e36a5a1102c56ff8a36cffc
2025-09-24 12:47:24 -07:00
Calix TangandFacebook GitHub Bot 2dfb36e3c6 Simplify VirtualViewContainer hysteresis window logic (#53914)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53914

Pulls hysteresis window computation out of for loop. Simplify the remaining code.

Changelog: [Internal] - Same as general summary.

Reviewed By: lunaleaps

Differential Revision: D83005735

fbshipit-source-id: 824863c649406a750d44b31ac92878505ab61596
2025-09-24 10:05:34 -07:00
Christoph PurrerandFacebook GitHub Bot 10b45b6200 Add Unit Tests (#53913)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53913

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D83091947

fbshipit-source-id: 63baf543b180070591d4779b1203909359aec132
2025-09-24 08:56:01 -07:00
Alex HuntandFacebook GitHub Bot 430765b071 Update SafeAreaViewExample to lazily require deprecated API (#53922)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53922

Minor change motivated by restoring a clean JS console on startup for RNTester.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D83145673

fbshipit-source-id: be64b057b842f4922328f5bc62dc001d016fd0b7
2025-09-24 06:05:26 -07:00
generatedunixname537391475639613andFacebook GitHub Bot ed6aa0f25a xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp (#53919)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53919

Reviewed By: javache

Differential Revision: D83044510

fbshipit-source-id: df05c27f5863b6eac6c37ebe75343b30e515be7a
2025-09-24 05:15:26 -07:00
Alex HuntandFacebook GitHub Bot 8027067322 Implement saved window positioning per target (#53910)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53910

NOTE: Resubmission of D82236159 — The `electron-store` dependency is now replaced with a local implementation.

As titled. A long awaited quality of life improvement that we can now deliver with our desktop shell.

Window arrangements are saved per [`windowKey`](https://github.com/facebook/react-native/blob/da7bf9c54567aae62ff355b79e66f511cb382065/packages/dev-middleware/src/middleware/openDebuggerMiddleware.js#L193), mapping to each previously opened debugger target.

**Limitations**

- Does not save/restore macOS fullscreen app state.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D83070252

fbshipit-source-id: a77f106b6db31571313acd0270b87703e4de049d
2025-09-24 04:59:43 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot eb9e94256e Fix potential attempt to execute a task after shut down in TaskDispatchThread (#53900)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53900

# Changelog:
[Internal] -

There is a crash reported, which looks like it may be potentially caused by some scenarios when we are trying to execute a scheduled task after the TaskDispatchThread instance had been quit.

This adds a missing extra check in the corresponding code to avoid such scenarios.

Reviewed By: christophpurrer, lenaic

Differential Revision: D83050169

fbshipit-source-id: 0ee0fa5848b070c2dc3dd92dbad4e6d5996734b3
2025-09-24 04:27:30 -07:00
Kacper KafaraandFacebook GitHub Bot dc4a6d2c7e Add invalidation callback for non-recycled component instances on iOS (#53708)
Summary:
Since the view recycling is optional on iOS [since 0.74](https://github.com/facebook/react-native/commit/613a5a75977d84333df7cbd5701e01a7ab5a3385) when a view (with disabled view recycling) is unmounted / destroyed there is no lifecycle callback for a component view to notify it of such event. Currently we (`react-native-screens`) are forced to scan mutation list of every mounting transaction in every of ours container components. Components with view recycling turned on, get `prepareForRecycle` callback on Fabric & on old architecture, there was `invalidate` message sent (`RCTInvalidating` protocol). It would be nice & useful to have something like this for components with view recycling disabled, or enabled but not recycled due to pool being full.

In particular in `react-native-screens` we need an information that the component is being destroyed to release retained resources (view controllers & others).

I have concern regarding naming of this method, as it could collide / be mistaken with `invalidate` method of `RCTInvalidating` protocol, but naming is hard & I don't see a name that fits better 😄 Open for suggestions!

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[IOS] [ADDED] - Add invalidation callback for non-recycled component instances

Pull Request resolved: https://github.com/facebook/react-native/pull/53708

Test Plan:
Apply this patch to `RNTMyNativeViewComponentView.mm`:

```objective-c

 diff --git a/packages/rn-tester/NativeComponentExample/ios/RNTMyNativeViewComponentView.mm b/packages/rn-tester/NativeComponentExample/ios/RNTMyNativeViewComponentView.mm
index 2eb7bff28e..8464da603b 100644
 --- a/packages/rn-tester/NativeComponentExample/ios/RNTMyNativeViewComponentView.mm
+++ b/packages/rn-tester/NativeComponentExample/ios/RNTMyNativeViewComponentView.mm
@@ -123,6 +123,16 @@ using namespace facebook::react;
   [_view removeOverlays];
 }

+- (void)invalidate
+{
+  NSLog(@"RCTComponentViewProtocol invalidate called");
+}
+
++ (BOOL)shouldBeRecycled
+{
+  return NO;
+}
+
 - (void)fireLagacyStyleEvent
 {
   RNTMyNativeViewEventEmitter::OnLegacyStyleEvent value = {"Legacy Style Event Fired."};

```

& render `MyNativeView` in any of the RNTester screens / examples. Unmount the view & observe the log in XCode.

https://github.com/user-attachments/assets/be3f67bb-73e0-4af2-9ca1-f2eb9f3347bb

(called twice, because there are two components rendered at a time)

Reviewed By: javache

Differential Revision: D83139361

Pulled By: cipolleschi

fbshipit-source-id: 17ef964648ac44b583503b6b00fc5dd457887061
2025-09-24 04:26:38 -07:00
Jakub PiaseckiandFacebook GitHub Bot 417e068220 Relayout surfaces on font scale change (#53770)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53770

Changelog: [ANDROID][FIXED] - Request layout on attached surfaces when font scale changes

Reviewed By: rshest

Differential Revision: D82422608

fbshipit-source-id: c087054a709f8d31a298cd8d83363fac1e23d03a
2025-09-24 04:16:33 -07:00
Riccardo CipolleschiandFacebook GitHub Bot dc132a4fd4 Crash the app when Legacy Arch is enabled (#53911)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53911

This change mimics what we implemented on Android to crash the app.

This is in general never going t be triggered. It will be triggered only if users are actually going through the old way to initialize React Native, i.e. by using the RCTRootView class which creates thebridge, or if they are creating the bridge themselves.

## Changelog:
[iOS][Added] - Crash the app if they force the legacy architecture.

Reviewed By: RSNara, cortinico

Differential Revision: D83066377

fbshipit-source-id: 0907effceb9a3655ec8d6bde8e0986f50f1ab663
2025-09-24 02:45:46 -07:00
Moti ZilbermanandFacebook GitHub Bot 18ba21149a Run prebuilt standalone shell directly from fbsource on laptops (#53878)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53878

Changelog: [Internal]

Adds the `prebuiltBinaryPath` option to `unstable_spawnDebuggerShellWithArgs` and `unstable_prepareDebuggerShell`, for advanced integrations that need to change how the React Native DevTools prebuilt binary is distributed.

Reviewed By: huntie

Differential Revision: D82956699

fbshipit-source-id: 30f9c461c7d8f22a553f278bbe42b86742c98da7
2025-09-24 00:22:32 -07:00
Calix TangandFacebook GitHub Bot 53f89bacd4 VirtualView v2 support in HorizontalScrollView native component (Android) (#53890)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53890

Changelog: [Internal] -  Adds support for VirtualView v2 in Android HorizontalScrollView native component by implementing VirtualViewContainer interface. Only on Android because iOS equivalent native components are already set up to support virtualview v2 on horizontal scrollviews.

## Changes in Detail

Adds necessary changes to Android `HorizontalScrollView` native component to support the experimental version of VirtualView.

Reviewed By: lunaleaps

Differential Revision: D82783403

fbshipit-source-id: 1e55eb054ab098af5ca8dd526b27c574025943c4
2025-09-23 16:06:40 -07:00
Devan BuggayandFacebook GitHub Bot 14dc03e2bd Genalize focus/blur behavior in JS (#53829)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53829

Forwards along focus and blur calls to their respective native commands, leaving the TextInput path intact for now.

There are a few ways places to implement this, all with different trade offs. I decided to leave TextInputState.js intact and instead only go down the original path if the focused/blurred element is a TextInput by using the registered inputs in TextInputState. This revealed a subtle issue where the TextInputs aren't registered in time for the ref callback, meaning you can't focus them there if you rely on the registered list.

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D82676628

fbshipit-source-id: d39c92dfc99ec4b5e100203bb43c8a4f9c80a649
2025-09-23 14:37:56 -07:00
Andrew DatsenkoandFacebook GitHub Bot 22002bb70c Allow to disable coverage via flag & disable it for benchmarks (#53912)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53912

Changelog: [Internal]
Add new fantom flag `fantom_disable_coverage` to be used in tests that are sensitive to things like memory allocation.
Also disable coverage for any benchmark test.

Reviewed By: arushikesarwani94

Differential Revision: D83070065

fbshipit-source-id: a885e79e3d0c88cfb7adef30cb60ab46a617edac
2025-09-23 13:40:31 -07:00
Devan BuggayandFacebook GitHub Bot b00d3be572 Make perf overlay more transparent (#53904)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53904

Adds more transparency to the background of the perf overlay, we got some feedback about it visually obscuring elements behind it.

{F1982191377}

{F1982191388}

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D83037721

fbshipit-source-id: e70c799ea7942c6aea886e9a3580e324c4238048
2025-09-23 12:53:43 -07:00
Devan BuggayandFacebook GitHub Bot 4acb3d3e7c Remove "Background" from perf overlay title (#53903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53903

Removes unnecessary "background" from title, narrowing the width of the overlay.
{F1982191268}

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D83036209

fbshipit-source-id: 0a11f38e544e3d667a9a1fb957e351716f625f3e
2025-09-23 12:53:43 -07:00
Alex HuntandFacebook GitHub Bot f4b6131850 Harden lifecycle handling for Perf Monitor (#53905)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53905

Updates `PerfMonitorOverlayManager` so that it is minimally and correctly integrated in the `DevSupportManagerBase` reload cycle — attempting to fix a bug where the background profiling state on startup / subsequent packager connections would be out of sync.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D83058519

fbshipit-source-id: 9a9bb32d3215ccf722aa39ca0ca943449f7ae62e
2025-09-23 11:47:50 -07:00
generatedunixname89002005287564andFacebook GitHub Bot b9e6e349f5 Fix CQS signal readability-avoid-const-params-in-decls in xplat/js/react-native-github/packages [B] (#53902)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53902

Reviewed By: javache

Differential Revision: D83033554

fbshipit-source-id: 85b48fb7051e3f58ee00cd6a160086701c66d7a2
2025-09-23 08:40:16 -07:00
React Native BotandFacebook GitHub Bot 1c2b9f9206 Add changelog for v0.82.0-rc.4 (#53886)
Summary:
Add Changelog for 0.82.0-rc.4

## Changelog:
[Internal] - Add Changelog for 0.82.0-rc.4

Pull Request resolved: https://github.com/facebook/react-native/pull/53886

Test Plan: N/A

Reviewed By: fabriziocucci

Differential Revision: D82993264

Pulled By: vzaidman

fbshipit-source-id: e1aba15613d5e62fcd503e15c878697adc088816
2025-09-23 05:00:38 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 1c5fb903fd Fix CQS signal readability-avoid-const-params-in-decls in xplat/js/react-native-github/packages [A] (#53897)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53897

Reviewed By: javache

Differential Revision: D83033417

fbshipit-source-id: 4aa2bfd49433a1f9c741241dcffe714b5091506b
2025-09-23 04:18:47 -07:00
Vitali ZaidmanandFacebook GitHub Bot 6936bd9f6b Dismiss DevLoadingView toast on touch (#53885)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53885

Changelog: [General][Added] DevServer banners can now be closed on tap. On iOS, don't close them after 15s anymore.

Banners, on iOS, but not Android, are currently closed after 15s since {D47478373} where it was introduced to deal with the banner telling users they need to connect to Metro stuck forever.

Instead of closing it after 15 seconds, allow the users on both Android and iOS to close it via a touch.

Reviewed By: huntie

Differential Revision: D82727997

fbshipit-source-id: 5aa2af78a4dbcd95b69423d52421900d4ab35244
2025-09-23 02:06:18 -07:00
generatedunixname1395667395051502andFacebook GitHub Bot 8c2f9e47fa Update React Native DevTools binaries
Summary:
Automated update of React Native DevTools binaries
bypass-github-export-checks
Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D83031681

fbshipit-source-id: 0290d423b758ce42cd9a9c8cccc0f2cf16ad992b
2025-09-23 01:46:27 -07:00
Gabriel DonadelandFacebook GitHub Bot ee811a82ec Add changelog for v0.81.4 (#53720)
Summary:
Add Changelog for 0.81.4

## Changelog:
[Internal] - Add Changelog for 0.81.4

Pull Request resolved: https://github.com/facebook/react-native/pull/53720

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D83013088

Pulled By: arushikesarwani94

fbshipit-source-id: 3693bf6582543465102cea5dbd7dd17dffe0a272
2025-09-23 01:19:46 -07:00
Marco WangandFacebook GitHub Bot 2e55154665 Deploy 0.285.0 to xplat (#53895)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53895

[changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D83000230

fbshipit-source-id: 7c070358623e9b68043bb8666f5c9dfc632ff2fb
2025-09-22 22:42:28 -07:00
Sam ZhouandFacebook GitHub Bot 5c369aa34c Add annotations to fix future natural inference errors in xplat/js: 6/n (#53894)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53894

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D83000736

fbshipit-source-id: 3ba5c59d9b2f7b967c0dccd24a73056430153bdc
2025-09-22 21:55:34 -07:00
Arushi KesarwaniandFacebook GitHub Bot 2065c31800 Updating ReactAndroid.api to unblock stable (#53891)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53891

D82726743 missed updating the ReactAndroid.api which was blocking fbandroid/stable:

https://www.internalfb.com/sandcastle/workflow/797137134054937206

Hence ran `buck2 run //xplat/js/scripts/rn-api:generate-rn-api-metadata` to update

Changelog: [Android][Fixed] - Fixed ReactAndroid.api

Reviewed By: mdvacca, sumkit, jorge-cab

Differential Revision: D83001140

fbshipit-source-id: 85e4f2005a28a3c98999198284133e4af1eaed89
2025-09-22 18:32:51 -07:00
David VaccaandFacebook GitHub Bot 5684546251 Delete LayoutAnimation (#53785)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53785

LayoutAnimation is part of legacy architecture and unused, let's delete it

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D82235542

fbshipit-source-id: c0e2f08bcdffb9c5e102df7cca799f3a25296afe
2025-09-22 17:45:08 -07:00
David VaccaandFacebook GitHub Bot f09f4a779e Remove code from public LayoutAnimationController class (#53784)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53784

LayoutAnimation is part of legacy architecture, I'm deleting the code used from its non supported public APIs

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D82235545

fbshipit-source-id: 9665c57b68eba9d958d3f8b9dd4224558cc8e9f6
2025-09-22 17:45:08 -07:00
David VaccaandFacebook GitHub Bot ec5bc3b285 Delete LayoutAnimation tests (#53783)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53783

LayoutAnimation is part of legacy architecture, I'm deleting unused tests

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D82254268

fbshipit-source-id: df53215f126e37d8422ece46552596c31b11f61b
2025-09-22 17:45:08 -07:00
Christoph PurrerandFacebook GitHub Bot 46c75c1043 Add ImagePrefetching feature flag for JNI calls (#53865)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53865

This adds an additional feature flag to enable/disable image prefetch requests via JNI batching

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D82871006

fbshipit-source-id: 6cd2577f26e6d4c906e7be2f62a397177691538f
2025-09-22 17:04:55 -07:00
Vitali ZaidmanandFacebook GitHub Bot e3bf881ae6 remove connection hints from being logged for the user (#53884)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53884

Changelog: [Internal]

Now that there's a clear display for when HMR is disconnected, we don't want to show messages regardless devices connection and disconnection to the DevServer because they are too partial.

Reviewed By: huntie

Differential Revision: D82727105

fbshipit-source-id: 32dd077f85d2044f89ae2d8d60a37c0ec6cccbbf
2025-09-22 15:55:25 -07:00
Sam ZhouandFacebook GitHub Bot e4368154a5 Turn on react.ref_as_prop=experimental.store_ref_in_props
Summary: Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D82932016

fbshipit-source-id: a391bdc06eef60d3054b8440c4ccfbaf62bc931a
2025-09-22 14:46:56 -07:00
Vitali ZaidmanandFacebook GitHub Bot 4148746941 add disconnection message (#53883)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53883

Changelog: [General][Added] - new banner added to indicate that Fast Refresh has lost connection, and that the app needs to be restarted to reconnect

When HMR were getting disconnected, we were not giving any indication for the user.

This lead to situations were the connection is re-established, but HMR is still disconnected, which is unexpected for users.

Instead, raise a banner hinting the user to reload the app to reconnect.

Reviewed By: huntie

Differential Revision: D82726853

fbshipit-source-id: d5f264547b2af89e9dc2a9046d063efe1145d690
2025-09-22 13:25:42 -07:00
generatedunixname537391475639613andFacebook GitHub Bot 34f7137cdc xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/text/RawTextShadowNode.cpp (#53874)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53874

Reviewed By: rshest

Differential Revision: D82804676

fbshipit-source-id: 90a426cfeb4fe264d523dafe56d2d83f1ed3da11
2025-09-22 12:35:11 -07:00
Vitali ZaidmanandFacebook GitHub Bot 4d45e5987c Align Android with iOS in displaying HMR "refreshing" in color (#53846)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53846

Changelog: [Android][Added] - hot reload banner is now displayed in blue background like on iOS

iOS has a colorful "Refreshing..." banner:
 {F1982086204}

While android doesn't respect the color HMR asks it to set up for the banner:
 {F1982086218}

Reviewed By: cortinico

Differential Revision: D82726743

fbshipit-source-id: 4042851f5a8fd7d4f238f25e2d83f77144742de9
2025-09-22 11:41:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 2e4da10b52 fix coverage patterns (#53881)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53881

Changelog: [Internal]
To make sure that coverage is insertect correctly when run in different metro setup where patterns do not match perfectly, we need to add glob prefix

Reviewed By: sammy-SC

Differential Revision: D82968565

fbshipit-source-id: c2676ef4c774411938039fc5b98a3b953f6ec916
2025-09-22 10:48:45 -07:00
Riccardo CipolleschiandFacebook GitHub Bot b10faf6c02 Create the orchestration function to coordinate the creation of the hard links (#53642)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53642

## Context

One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in  SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`).

To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers.

## Changed

In this change we are adding a function that is used to orchestrate the helpers function defined in previous changes.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81778457

fbshipit-source-id: b4ab8c902d6d7e6ca4b89ccbab75c1b5d84ce00a
2025-09-22 10:14:58 -07:00
Riccardo CipolleschiandFacebook GitHub Bot c6395eccd4 add function hard links for headers from ReactCodegen (#53640)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53640

## Context

One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in  SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`).

To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers.

## Changed

In this change we are adding an helper function to create hard links to Codegen Headers so that other libraries can access them.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81778450

fbshipit-source-id: e9f62f1c81ce8a635cc880007f495de342342a25
2025-09-22 10:14:58 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 515c735347 Add function to create hard links for headers of the third-party dependencies (#53638)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53638

## Context

One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in  SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`).

To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers.

## Changed

In this change we are adding an helper function that creates links for the ThirdPartyDependencies that React native and libraries might need to access.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81778459

fbshipit-source-id: b8f9f207a0fbe2265e2861bf508516946905b472
2025-09-22 10:14:58 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 6807231120 Create function to create hardlink to header required to build React Native Core (#53635)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53635

## Context

One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in  SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`).

To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers.

## Changed

In this change we did two things:
1. we move the helper functions to a headers-utils.js file (and the tests to the `headers-utils-test.js` file)
2. we added a function that coordinates the creation of the header links *and added tests for it)

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81778464

fbshipit-source-id: fd8eb5a7af55db0a08c4d299c5470058d5424768
2025-09-22 10:14:58 -07:00
Riccardo CipolleschiandFacebook GitHub Bot fc4a692b8e Create utility function to create the right folder structure for headers in the ReactCommon folder (#53631)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53631

## Context

One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in  SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`).

To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers.

## Changed

In this change we are adding an helper function that creates links for the ReactCommon folder that has a complex structure and complex mapping requirements

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81778470

fbshipit-source-id: e0f4001048fcde0e988fc3a05b53efb1de70460b
2025-09-22 10:14:58 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 8db93abf12 Create utility function to create the right folder structure for headers in the ReactApple folder (#53629)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53629

## Context

One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in  SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`).

To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers.

## Changed

In this change we are adding a function to properly create the header structure for the headers in ReactApple that requires a special case.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81778471

fbshipit-source-id: 095d901dce139cf8221251f952f474be943a5ab3
2025-09-22 10:14:58 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 7cd3328b21 Create script to create hard links for headers from a source path to a destination path (#53620)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53620

## Context

One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in  SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`).

To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers.

## Changed

In this change we are adding an helper function that creates links between a source folder and a destination folder.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81778469

fbshipit-source-id: 3954bc219f32ea53744393a83f3179beeaca95b3
2025-09-22 10:14:58 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 072b105f52 Add function to extract headers from a folder (#53737)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53737

This change add a utility function to extract headers (both .h and .hpp) from a folder. It also allow to exclude some specific folders (e.g.: `tests`, non supported platforms, ...)

## Context
SwiftPM is very picky in how the header structure must be.
In order to preserve the import/include statements as much as possible when building from source, we can recreate the header structure in a temporary folder inside the react-native package using symlinks.

In this way, users can still modify the headers and build RNTester and HelloWorld using SwiftPM without breaking changes.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D82205692

fbshipit-source-id: 4fa6dee2ae4790c583beb96a959b0c3045c7b50a
2025-09-22 10:14:58 -07:00
Riccardo CipolleschiandFacebook GitHub Bot c1827fcd04 Add simple function to handle symlinks (#53736)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53736

This change adds a simple function that manages symlinks. This is used through the stack of changes to avoid code repetition.

## Context
SwiftPM is very picky in how the header structure must be.
In order to preserve the import/include statements as much as possible when building from source, we can recreate the header structure in a temporary folder inside the react-native package using symlinks.

In this way, users can still modify the headers and build RNTester and HelloWorld using SwiftPM without breaking changes.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D82202860

fbshipit-source-id: 0baa348c84f966a2e1eeb85b008f8e653bffe96c
2025-09-22 10:14:58 -07:00
Nicola CortiandFacebook GitHub Bot 0915833f7c Follow-up from previous transform matrix fix (#53876)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53876

This is just a couple of small nits after D82836192

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D82953710

fbshipit-source-id: 1a98c54a110ee1a72225de331bfe2efa4e4225c0
2025-09-22 09:48:59 -07:00
Pieter De BaetsandFacebook GitHub Bot 57a1820c85 Remove unused RCTHermesInstance field (#53858)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53858

We only use static methods from `HermesInstance`

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D82816061

fbshipit-source-id: 515dad2e8d6e0a6f6ac26f93d5a86aedf875f93e
2025-09-22 08:47:33 -07:00
Nick LefeverandFacebook GitHub Bot e1a6c38cc1 Fix overflow with Props 2.0 in horizonal scroll view (#53872)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53872

This diff fixes the mismatch between the overflow initial value between the horizontal scroll view component initialization and the React core props instance initial value by applying the same correction as for the vertical scroll view component.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D82919365

fbshipit-source-id: 70e40f56ffa3ea87fa74035c885608f633890610
2025-09-22 04:19:36 -07:00
Nick LefeverandFacebook GitHub Bot e314f6161a Fix scrollview overflow prop not set with Props 2.0 (#53871)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53871

The props defined in `YogaStylableProps` define the overflow to be set to `Overflow::Visible` by default.

The scroll view initialized the overflow setting to `Overflow.SCROLL`. This meant that Props 2.0 would only set the overflow prop if it was different from Visible, leading to the scroll view not being configured correctly when asking for the overflow to be visible.

This diff assigns the correct initial value to the scrollview overflow setting only when enabling Props 2.0 to avoid any unexpected behavior changes when not using Props 2.0.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D82919286

fbshipit-source-id: d5368500cc4504164d6fdf7cf60042a9d5792853
2025-09-22 04:19:36 -07:00
Nicola CortiandFacebook GitHub Bot ce243df972 Correctly implement transform: matrix with 2d matrices (#53860)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53860

Fixes https://github.com/facebook/react-native/issues/53639

I've realized that our docs and validation logic states that we do support
3x3 matrixes (for 2d transforms). However they're not properly processed
as the values are just copied into a 4x4 matrix.

This can be verified by applying the 3x3 identity matrix on any transform.

I'm fixing it by correctly populating the 4x4 matrix getting the values from the 3x3 matrix in input.

Changelog:
[General] [Fixed] - 9-element (2d) transform matrix are not correctly working

Reviewed By: christophpurrer

Differential Revision: D82836192

fbshipit-source-id: 12029b37ffd8375fff48ea7f9386b849dfe96a62
2025-09-22 03:28:31 -07:00
David VaccaandFacebook GitHub Bot 23b2b99c4b Fix incorrect validation of feature flags in DefaultNewArchitectureEntryPoint.loadWithFeatureFlags() method (#53863)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53863

In this diff I'm fixing an incorrect validation of feature flags in DefaultNewArchitectureEntryPoint.loadWithFeatureFlags() method.

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D82841006

fbshipit-source-id: 6f50f2475255d7b841d9224bc8808119dcc68aec
2025-09-22 02:34:59 -07:00
Sam ZhouandFacebook GitHub Bot 5ef054921c Turn on react.ref_as_prop=experimental.store_ref_in_props_but_remove_ref_in_react_element_config in fbsource (#53870)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53870

Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D82913848

fbshipit-source-id: c23f564404143535622fab3133d092d1fb566711
2025-09-21 14:04:21 -07:00
Sam ZhouandFacebook GitHub Bot 71b7dd8519 Prepare createAnimatedComponent API for flow's upcoming better react 19 ref-as-prop support (#53869)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53869

This is a prep step to enable better Flow support for react 19 ref-as-prop. While it causes changes in the ReactNativeApi.d.ts snapshot, it should preserve the existing type behavior, since in the TS version, the ref prop will be excluded anyways: https://github.com/facebook/react-native/blob/a4d43290c82e8ad93f03b304a78cdf0eaf41fba1/packages/react-native/ReactNativeApi.d.ts#L1434

Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D82916014

fbshipit-source-id: 2e62aab493dcf6f8f5e382c0739060c88e6f7ed5
2025-09-21 10:49:53 -07:00
Sam ZhouandFacebook GitHub Bot 5b544c7cd8 Simplify some RN types (#53868)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53868

This is a prep step to enable better Flow support for react 19 ref-as-prop. While it causes changes in the ReactNativeApi.d.ts snapshot, this diff simply inlines what these `React.ElementRef` evaluates into.

Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D82915646

fbshipit-source-id: 64179eac7dde91381361fb9f1053d58100d864c3
2025-09-21 10:49:53 -07:00
Alex HuntandFacebook GitHub Bot a4d43290c8 Tweak Dev Menu appearance for iOS 26 (#53844)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53844

Small UI tweaks that help when scanning more visually spread out alert actions on iOS 26.

- Use bold (iOS 26 style) alert title.
- Differentiate "Cancel" actions with red system style.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D82731784

fbshipit-source-id: 0a0215fc75a4832e742e22328d5e21eee3808972
2025-09-20 03:23:31 -07:00
Nikita LutsenkoandFacebook GitHub Bot 7fb90c3f1b jsi | Remove unnecessary semicolons. (#53864)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53864

Changelog: [Internal] Removed unnecessary semicolons, improving code quality.

Reviewed By: cortinico

Differential Revision: D82828986

fbshipit-source-id: aaafc332a1dc5944cb136bf6dd105d68c1c99e8d
2025-09-20 03:15:57 -07:00
Christoph PurrerandFacebook GitHub Bot 362ed179a8 Fix race condition between experimental_prefetchResources and surface stop (#53861)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53861

Changelog: [Internal]

The issue is a race condition in the React Native Fabric mounting system where `experimental_prefetchResources` is called on a `SurfaceMountingManager` after the surface has been stopped.

1.) `experimental_prefetchResources` is called
2.) Concurrently, `stopSurface()` *can be* called, which sets `mThemedReactContext = null`
3.) `experimental_prefetchResources` then tries to access `mThemedReactContext` via `Assertions.assertNotNull(mThemedReactContext)`
4.) Since `mThemedReactContext` is now `null`, the assertion fails and throws an AssertionError

The fix involves adding a guard to check if the surface is stopped before accessing `mThemedReactContext`

Follows existing patterns used by other methods in the same class

https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java#L201-L213

Reviewed By: lenaic

Differential Revision: D82842572

fbshipit-source-id: 723bad24a075efa219766b0e148080dd42d59fba
2025-09-19 17:27:14 -07:00
Pieter De BaetsandFacebook GitHub Bot fcbe4d1677 Split off MessageQueueThread header to separate target (#53857)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53857

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D82625359

fbshipit-source-id: 7650dcd424299a21388c7bcf6c33c89b9f09171d
2025-09-19 14:02:47 -07:00
Christoph PurrerandFacebook GitHub Bot 390c9d30dc Update ## v0.82.0-rc.0 (#53847)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53847

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D82753924

fbshipit-source-id: a5a2036ccd74cc7f7dd463d82e96f156a4e309e2
2025-09-19 13:46:17 -07:00
Kræn HansenandFacebook GitHub Bot 0198c92c71 Export @react-native/typescript-config/strict shorthand (#53564)
Summary:
Extending a tsconfig seems simpler than adding `compilerOptions` with `customConditions`.

### Before

```jsonc
{
  "extends": "react-native/typescript-config",
  "compilerOptions": {
    // ...
    "customConditions": ["react-native-strict-api", "react-native"]
  }
}
```

### After

```jsonc
{
  "extends": "react-native/typescript-config/strict"
  // ...
}
```

## Changelog:

[GENERAL] [ADDED] - Add `react-native/typescript-config/strict` export enabling the `react-native-strict-api` custom condition.

Pull Request resolved: https://github.com/facebook/react-native/pull/53564

Test Plan:
### `package.json`

```
{
  "name": "react-native-ts-test",
  "private": true,
  "version": "0.1.0",
  "scripts": {
    "build": "tsc --noEmit"
  },
  "devDependencies": {
    "react-native/typescript-config": "^0.81.1",
    "typescript": "^5.9.2",
    "jest": "^30.1.2"
  },
  "dependencies": {
    "react-native": "^0.81.1"
  }
}
```

### `tsconfig.json`

```
{
  "extends": "react-native/typescript-config/strict",
  "include": ["src/index.ts"]
}
```

### `src/index.ts`

```
import { View } from "react-native";
```

Run `npx resolution-explorer` and select "react-native from src/index.ts to node_modules/react-native/types_generated/index.d.ts" to verify the types are resolved correctly.

```
Explicitly specified module resolution kind: 'Bundler'.
Resolving in CJS mode with conditions 'import', 'types', 'react-native-strict-api'.
File '/Users/kraen.hansen/Repositories/react-native-ts-test/src/package.json' does not exist.
Found 'package.json' at '/Users/kraen.hansen/Repositories/react-native-ts-test/package.json'.
Loading module 'react-native' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration, JSON.
Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration.
Directory '/Users/kraen.hansen/Repositories/react-native-ts-test/src/node_modules' does not exist, skipping all lookups in it.
Found 'package.json' at '/Users/kraen.hansen/Repositories/react-native-ts-test/node_modules/react-native/package.json'.
Entering conditional exports.
Matched 'exports' condition 'react-native-strict-api'.
Using 'exports' subpath '.' with target './types_generated/index.d.ts'.
File '/Users/kraen.hansen/Repositories/react-native-ts-test/node_modules/react-native/types_generated/index.d.ts' exists - use it as a name resolution result.
'package.json' has a 'peerDependencies' field.
Resolving real path for '/Users/kraen.hansen/Repositories/react-native-ts-test/node_modules/react-native', result
'/Users/kraen.hansen/Repositories/react-native-ts-test/node_modules/react-native'.
Failed to find peerDependency 'types/react'.
Found 'package.json' at '/Users/kraen.hansen/Repositories/react-native-ts-test/node_modules/react/package.json'.
Found peerDependency 'react' with '19.1.1' version.
Resolved under condition 'react-native-strict-api'.
Exiting conditional exports.
Resolving real path for '/Users/kraen.hansen/Repositories/react-native-ts-test/node_modules/react-native/types_generated/index.d.ts', result
'/Users/kraen.hansen/Repositories/react-native-ts-test/node_modules/react-native/types_generated/index.d.ts'.
======== Module name 'react-native' was successfully resolved to
'/Users/kraen.hansen/Repositories/react-native-ts-test/node_modules/react-native/types_generated/index.d.ts' with Package ID
'react-native/types_generated/index.d.ts@0.81.1+react@19.1.1'. ========
```

Reviewed By: robhogan

Differential Revision: D82791201

Pulled By: philIip

fbshipit-source-id: f58d3b8fcf3d7f18dd29eef18a3c8c0cb57d1d78
2025-09-19 13:28:31 -07:00
SimekandFacebook GitHub Bot 34cd61f0d5 fix C++ in-code docs comments to silence warnings (#53835)
Summary:
Address invalid C++ in-code docs comments to silence few warnings. Ref:
* https://www.doxygen.nl/manual/commands.html#cmdtparam

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[INTERNAL][FIXED] - Address invalid C++ in-code docs comments to silence the warnings.

Pull Request resolved: https://github.com/facebook/react-native/pull/53835

Test Plan: Building RNTester app locally does not output the warnings related to in-code docs comments.

Reviewed By: cortinico

Differential Revision: D82791099

Pulled By: philIip

fbshipit-source-id: 2f93bfd4cd303471b2c52fcdf74871e5dee8c06a
2025-09-19 13:12:23 -07:00
David VaccaandFacebook GitHub Bot e349009cb8 Refactor ReactNativeNewArchitectureFeatureFlagsDefaults to remove legacy architecture configuration (#53791)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53791

I'm removing parameter to configure new architecture in ReactNativeNewArchitectureFeatureFlagsDefaults because the new architecture is enabled by default everywhere.

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D82241552

fbshipit-source-id: 9c5cee4befc914d95b84b01325485923e17ff6da
2025-09-19 13:01:08 -07:00
David VaccaandFacebook GitHub Bot f847496749 Refactor ReactNativeFeatureFlagsOverrides_RNOSS_Stable_Android to enable new arch (#53790)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53790

New architecture should we enabled by default everywhere, Stable releases should use new arch now

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D82241551

fbshipit-source-id: 2a1bf14f2f1da6e441a58b083ca5a55618eec256
2025-09-19 13:01:08 -07:00
Sam ZhouandFacebook GitHub Bot 2590cd739a Deploy 0.284.0 to xplat
Summary:
[changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D82786580

fbshipit-source-id: 8caa7802025004fce6cb5067c191b681087cb979
2025-09-19 07:33:42 -07:00
Sam ZhouandFacebook GitHub Bot 7ba64ca0f1 Pre-suppress errors for improved typing of Array.{includes,indexOf,lastIndexOf} in xplat
Summary:
In Flow 0.284, we will have a stricter version of `Array<T>.includes`. Instead of accepting `mixed`, we will only accept `T` to help catch logical errors. We did the same for `Array.indexOf` and `Array.lastIndexOf` as well.

This diff pre-suppresses newly discovered errors in part of the codebase.

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D82784398

fbshipit-source-id: 6cb11809844f964e0604d33b9f7a3989074cd1cc
2025-09-19 07:17:14 -07:00
Ruslan LesiutinandFacebook GitHub Bot 0e77015a85 Fix unkown name for Timestamps on Timings track (#53854)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53854

# Changelog: [Internal]

This fixes the unkown names message for TimeStamps on Timings track

Reviewed By: rubennorte

Differential Revision: D82812849

fbshipit-source-id: 91101998b4b7befa08bf0e45cae494765d5f2b6d
2025-09-19 06:53:23 -07:00
Ruslan LesiutinandFacebook GitHub Bot 1b5e8e63b6 Manually preserve ordering for Scheduler and Components tracks (#53853)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53853

# Changelog: [Internal]

Chrome DevTools orders tracks based on the timestamp of the first entry.

For React on Web we emit a few entries to establish the ordering:
https://github.com/facebook/react/blob/6eda534718d09a26d58d65c0a376e05d7e2a3358/packages/react-reconciler/src/ReactFiberPerformanceTrack.js#L57-L96

We are doing the same thing here, but in C++.

Reviewed By: rubennorte

Differential Revision: D82811889

fbshipit-source-id: cfc4060de05a3d74e240f019dbeaa910fa93eb0b
2025-09-19 06:53:23 -07:00
Tim YungandFacebook GitHub Bot 03d9f34a82 RN: Deprecate InteractionManager (#53832)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53832

Deprecates `InteractionManager` by adding a warning when it is imported.

Changelog:
[General][Changed] - InteractionManager has been deprecated and no longer respects interaction handles. Instead, it is now recommended to avoid executing long-running JavaScript tasks by breaking them up into smaller tasks and scheduling them using `requestIdleCallback()`.

Reviewed By: javache

Differential Revision: D82704809

fbshipit-source-id: 99474cd7949abfe323c366b9ab8d8fc195578395
2025-09-19 05:10:47 -07:00
Tim YungandFacebook GitHub Bot 4a1388268d RN: Remove References to InteractionManager (#53830)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53830

Now that `InteractionManager` is deprecated (and no-ops), this removes all remaining references to it — in `Animated` and `PanResponder` — from the React Native repository.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D82690242

fbshipit-source-id: d101d47d1f8640f70e2d199492d4345b63663251
2025-09-19 05:10:47 -07:00
generatedunixname1395667395051502andFacebook GitHub Bot b821bc3aba Update React Native DevTools binaries
Summary:
Automated update of React Native DevTools binaries
bypass-github-export-checks
Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D82813624

fbshipit-source-id: 51fe7a84af2d4f2da7027e1649ec038517f9d561
2025-09-19 04:53:33 -07:00
Moti ZilbermanandFacebook GitHub Bot e16b6470e4 Backout D82236159: [RN][debugger-shell] Implement saved window positioning per target (#53816)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53816

Changelog: [Internal]

D82236159 introduced the first `node_modules` dependency in the Electron part of `react-native/debugger-shell`. This is not currently handled correctly by the build script, so this resulted in an instacrashing binary.

I'm temporarily backing out D82236159 until we have a proper fix for the build script.

Reviewed By: robhogan

Differential Revision: D82632937

fbshipit-source-id: 6c7c182e2a7c89e6ea2761096dcc426dbf2ae5cb
2025-09-19 02:38:00 -07:00
Alex HuntandFacebook GitHub Bot cb7453fb9f Improve Network trace event field coverage (#53840)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53840

After this diff, successful network events are displayed as fully hydrated timespans in the Performance panel network track, with all metadata needed to usefully populate the UI.

**Changes**

Adds:
- `"ResourceFinish"`: `encodedDataLength`, `decodedBodyLength`
- `"ResourceReceiveResponse"`: Populates `data.timing` members, which enables *"Request sent and waiting"* to be rendered correctly in the timeline.

Removes:

- `"ResourceWillSendRequest"` events — very rarely emitted by Chrome and are extraneous for our use case.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D82636798

fbshipit-source-id: a4b0f0671b97aaadc279ac56d39fee0c95d4ddc7
2025-09-18 14:41:16 -07:00
nishan (o^▽^o)andFacebook GitHub Bot c8e5f9766b fix(iOS): boxShadow + overflow hidden combination affecting pointer event box-none and scale transform. (#52413)
Summary:
This issue is only reproducible with combination of `overflow: hidden` and `boxShadow` i.e. when a [container view](https://github.com/facebook/react-native/blob/2ce7eab5f998788ffa8346b63cc4901d026456ba/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm#L799) is added to the hierarchy.

### Case 1:

```jsx
<Pressable
  pointerEvents="box-none"
  style={{ width: 300, height: 300, boxShadow: "0 0 100px 0 rgba(0, 0, 0, 0.5)", overflow: "hidden" }}
  onPress={() => {
    alert("Tapped");
  }}
/>
```

Here the view has `box-none` but it will still trigger the press event because this [line](https://github.com/facebook/react-native/blob/2ce7eab5f998788ffa8346b63cc4901d026456ba/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm#L658) returns the `_containerView` as `hitView` and this condition gets [fullfilled](https://github.com/facebook/react-native/blob/2ce7eab5f998788ffa8346b63cc4901d026456ba/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm#L676) (since it is not self). To fix this issue we should iterate on `self.currentContainerView.subviews`.

### Case 2:

Transform scale clipping child view.

```jsx
<Pressable
  pointerEvents="box-none"
  style={{ width: 300, height: 300, overflow: "hidden",
    transform: [
      { scale: 0.5 },
    ],
    boxShadow: "0 0 100px 0 rgba(0, 0, 0, 0.5)",
  }}
  onPress={() => {
    alert("parent view");
  }}
>
  <Pressable
    style={{
      position: "absolute",
      bottom: 0,
      right: 0,
      backgroundColor: "blue",
      height: 50,
      width: 100,
    }}
    onPress={() => {
      alert("child view");
    }}
  >
    <Text>Press me</Text>
  </Pressable>
</Pressable>;
```

The above style hides the child view on iOS whereas it is visible on android.

| iOS | Android |
   |---|---|
   | <img src="https://github.com/user-attachments/assets/14713ec9-1ae7-4425-9348-946d507188e8" width="200px" /> | <img src="https://github.com/user-attachments/assets/0f6e2368-037d-4b03-8a85-8a08f1578ff6" width="200px" /> |

This happens because `containerView` uses `self.frame` property which gets mutated due to scale transform. So containerView becomes `actualSize * scale * scale` instead of `actualSize * scale` and ends up clipping child views because of overflow hidden. Please checkout the layout hierarchy in the below screenshot. To fix it we need to use `self.bounds` instead of `self.frame` when setting the frame for container.

<img src="https://github.com/user-attachments/assets/9ce41756-f41f-4782-bfc9-b0c281f314b7" width="300px" />

## Changelog:

[IOS] [FIXED] - boxShadow + overflow hidden combination interfering with pointerEvents and transform scale.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/52413

Test Plan:
Test above example snippets and pointer events examples in RNTester.

cc - joevilches

Reviewed By: cortinico, jorge-cab

Differential Revision: D77872110

Pulled By: joevilches

fbshipit-source-id: e9693c79b47379531510607921ffaa6d6cc5c17b
2025-09-18 14:06:00 -07:00
Nicola CortiandFacebook GitHub Bot 1c5e0ffd9f Do not reset the native artifacts version to 1000.0.0 on release branches (#53817)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53817

What is currently happening, is that the various commits on the release branches like `0.82-stable` are resetting the version of native artifacts to `1000.0.0-<SHA>`.

The reason is that during the `test-all` workflow, we pass the `dry-run` as release type.
That's to prevent the various tools from calling `npm publish` and so on.

The problem is that on the releases branches, the version was already set at branch cut time.
Therefore, we see the version 1000.0.0 reappearing during Android E2E test in the emulator. Similary this is also affecting iOS prebuilds so I'm attempting to fix it here.

Changelog:
[Internal] [Changed] -

Reviewed By: huntie

Differential Revision: D82553599

fbshipit-source-id: 31a52e7df036e700663b3d3dd677973a7a210a30
2025-09-18 10:53:25 -07:00
Alex HuntandFacebook GitHub Bot 5b8827939d Support additional PerformanceResourceTiming fields (#53815)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53815

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D82561777

fbshipit-source-id: f387c4bca2112111e736433af90ada16efd14e8b
2025-09-18 09:57:25 -07:00
Andrew DatsenkoandFacebook GitHub Bot e97ef8f1fb Fix dotslash issue in OD (#53842)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53842

Changelog: [Internal]
There is a conflict between dotslash in node_modules and in OD it does not invoke buck2

Reviewed By: javache

Differential Revision: D82724326

fbshipit-source-id: c90cab58818e0245f8763b729c7e5432735eb05e
2025-09-18 07:39:22 -07:00
Nick LefeverandFacebook GitHub Bot e6390703e7 Fix scroll view FPS listener reset on init (#53838)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53838

The FPS listener is being assigned to all scroll view instances by the scroll view manager. This listener should not be reset when the view is being recycled and should stay assigned at all times.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D82720151

fbshipit-source-id: a2a37bad93efaa6e435725adf16c9ad1b4207ba0
2025-09-18 05:35:09 -07:00
generatedunixname537391475639613andFacebook GitHub Bot aacb9898f2 xplat/js/react-native-github/packages/react-native/ReactCommon/react/utils/TemplateStringLiteral.h (#53836)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53836

Reviewed By: rshest

Differential Revision: D82428779

fbshipit-source-id: 2716784a85c4885fe438348666b4772c2da3c400
2025-09-18 04:56:38 -07:00
Nicola CortiandFacebook GitHub Bot 460394e4b8 Turn on enableSwiftUIBasedFilters in the experimental channel (#53794)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53794

Basically what the title says. This is needed by Expo for experimetation.

Changelog:
[Internal] [Changed] -

Reviewed By: joevilches

Differential Revision: D82530292

fbshipit-source-id: 82ce8b1e8fc8d954cc04ec456ad80f769aedafe7
2025-09-18 04:34:47 -07:00
Nicola CortiandFacebook GitHub Bot 968ec9e093 Unpin version from react-native-android in run_fantom_tests (#53795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53795

I've published another docker image that should now work and unblock `run_fantom_tests`
so we don't need to pin the version to `v18.0` anymore:
https://github.com/react-native-community/docker-android

Changelog:
[Internal] [Changed] -

Reviewed By: huntie

Differential Revision: D82532516

fbshipit-source-id: 980c2feb053f9d096e70f37bb690e18cc8b87dc0
2025-09-18 04:12:50 -07:00
Alex HuntandFacebook GitHub Bot 6ef351b3ce Move trace event handling into NetworkReporter (#53776)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53776

Refactor and improve how we emit CDP trace events for network requests.

Key changes:
- Split up `PerformanceTracer` methods into discrete trace events.
- Move event calls out of `PerformanceEntryReporter` (upwards) into `NetworkReporter`. This now:
    - Aligns better with the matching source `NetworkReporter` events.
    - Removes metadata pieces from `PerformanceEntryReporter` that weren't part of the Web `PerformanceResourceTiming` API.
- Populate additional fields on `ResourceReceiveResponse`.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D82433225

fbshipit-source-id: 4fce219f0c86a7257b8df250ef9f2b4ec8bd8de3
2025-09-18 03:01:22 -07:00
Jakub PiaseckiandFacebook GitHub Bot 674fb77d93 Update coordinates for remote artifacts of Hermes V1 (#53822)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53822

Changelog: [GENERAL][FIXED] - Fixed coordinates for Hermes V1 artifacts

Reviewed By: cortinico

Differential Revision: D82639319

fbshipit-source-id: becfab3248f2314af97549eb94feb27b19f5d1af
2025-09-18 01:26:08 -07:00
Devan BuggayandFacebook GitHub Bot 14458d8699 Add focus/blur commands to View (#53828)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53828

Adds focus and blur commands to Android views.

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D82644681

fbshipit-source-id: 96fa6370e177c91742d285b0b158b77447d105f6
2025-09-18 00:36:55 -07:00
Devan BuggayandFacebook GitHub Bot 2945fa6e0e Hook up focus/blur events (#53827)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53827

Hook up focus/blur events to view.

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D82146291

fbshipit-source-id: 3cb90d22c00d067099c4c6fac734f27030d87639
2025-09-18 00:36:55 -07:00
Devan BuggayandFacebook GitHub Bot 07b5802ee5 focus/blur event emission (#53826)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53826

Wires up focus/blur events to the base event emitter, gated by enabledImperativeFocus feature flag.

https://docs.google.com/document/d/1L4ViBnXq5hw858VoecZPmJE2llOB97Tjs2VtJ7RHlNI/edit?tab=t.0

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D82146275

fbshipit-source-id: 4b7bb1336f74bb0de2d7ecf0737dd63067bd558f
2025-09-18 00:36:55 -07:00
Devan BuggayandFacebook GitHub Bot 3e5838086f Add focus/blur commands to View (#53825)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53825

Adds focus/blur commands to View on iOS.
https://docs.google.com/document/d/1L4ViBnXq5hw858VoecZPmJE2llOB97Tjs2VtJ7RHlNI/edit?tab=t.0#heading=h.azm4b33t75uk

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D82146249

fbshipit-source-id: 582f448f4d7525560ef74a23c0762e86d74550d4
2025-09-18 00:36:55 -07:00
Devan BuggayandFacebook GitHub Bot 596dece4c0 enableImperativeFocus feature flag (#53824)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53824

Creates a new feature flag to control focus/blur commands and event emissions for arbitrary views https://docs.google.com/document/d/1L4ViBnXq5hw858VoecZPmJE2llOB97Tjs2VtJ7RHlNI/edit?tab=t.0#heading=h.azm4b33t75uk

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D82146210

fbshipit-source-id: 59f3e6c8740b0c006f8930541205aa15192a9f59
2025-09-18 00:36:55 -07:00
Sam ZhouandFacebook GitHub Bot 4d2e38edd9 Deploy 0.283.0 to xplat (#53820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53820

[changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D82636194

fbshipit-source-id: 620016043bed481e43d0d4216280517c2890bfd7
2025-09-17 09:29:52 -07:00
React Native BotandFacebook GitHub Bot 926af3bc36 Add changelog for v0.82.0-rc.3 (#53813)
Summary:
Add Changelog for 0.82.0-rc.3

## Changelog:
[Internal] - Add Changelog for 0.82.0-rc.3

Pull Request resolved: https://github.com/facebook/react-native/pull/53813

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D82628336

Pulled By: vzaidman

fbshipit-source-id: 2ade8a48981a70e571e7a8db0e15af0c722f82ba
2025-09-17 06:03:11 -07:00
Vitali ZaidmanandFacebook GitHub Bot de4e01bcc6 add the nodejs type for process.memoryUsage.rss() (#53805)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53805

Changelog: [Internal]

https://nodejs.org/docs/latest-v24.x/api/process.html#processmemoryusagerss

Reviewed By: huntie

Differential Revision: D82550739

fbshipit-source-id: 11026fb82608e004b10426776592f22e67eb0720
2025-09-17 01:24:59 -07:00
Marco WangandFacebook GitHub Bot 7d73d39535 Deploy 0.282.0 to xplat (#53810)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53810

[changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D82597378

fbshipit-source-id: 40d601956d9f69ec8d68a2c324bb3449ee27c931
2025-09-16 23:32:23 -07:00
Eric RozellandFacebook GitHub Bot eba38b831c Fix DefaultNewArchitectureEntryPoint config validation (#53807)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53807

We need to read the values off feature flags before checking them.

## Changelog
[Internal]

Reviewed By: javache

Differential Revision: D82572898

fbshipit-source-id: 09fbc09570c78b41d9c25fb03c5557e390da7cae
2025-09-16 20:20:14 -07:00
David VaccaandFacebook GitHub Bot 18cb4edfa7 Ensure legacy architecture can't be initialized in Android (#53806)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53806

The Legacy architecture of React Native is not supported anymore, let's ensure nobody can initialize it anymore

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D82465004

fbshipit-source-id: 099764fb59d906b11cf6ad0cc6208f56df029d19
2025-09-16 17:33:14 -07:00
Sam ZhouandFacebook GitHub Bot dadd7cdaf7 Make ref prop optional in xplat: 1/n (#53801)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53801

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D82507711

fbshipit-source-id: 27c8004c0475765705a01c0b6afb274dab443a38
2025-09-16 09:10:22 -07:00
Tom ScallonandFacebook GitHub Bot 4308185b64 Allow EventEmitters to be reported as optional (#53804)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53804

## Changelog:

[General] [Fixed] - Allow `EventEmitter`s to be optional (for push safety)

Reviewed By: javache

Differential Revision: D82509571

fbshipit-source-id: 801a22b10b2709968009527130cfa890d30a4f3a
2025-09-16 08:59:12 -07:00
Nicola CortiandFacebook GitHub Bot d0d08e4554 Runtime check that NewArchitecture is enabled in DefaultNewArchitectureEntryPoint (#53780)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53780

This is a commit we're going to pick in 0.82 as we want to make sure users cannot invoke `load()`
from `DefaultNewArchitectureEntryPoint` with flags that are not true,true,true.

Changelog:
[Android] [Changed] - Runtime check that NewArchitecture is enabled in DefaultNewArchitectureEntryPoint

Reviewed By: mdvacca

Differential Revision: D82456975

fbshipit-source-id: 749996a3491913cfe400173608218077c3ffbc10
2025-09-16 07:30:55 -07:00
Nicola CortiandFacebook GitHub Bot 4858a0f469 Mark ReactTextInlineImageShadowNode as @LegacyArchitecture (#53735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53735

This class should have been marked as LegacyArchitecture back then but was forgotten.
I'm doing it now.

Changelog:
[Internal] -

Reviewed By: javache

Differential Revision: D82219780

fbshipit-source-id: 5119b7469733d5d2d4b16e976b09231ad5f71f5f
2025-09-16 07:23:51 -07:00
Vitali ZaidmanandFacebook GitHub Bot f93506fb23 Fix typo in CHANGELOG.md (#53796)
Summary:
Fix typo in CHANGELOG.md

Changelog: [INTERNAL]

Pull Request resolved: https://github.com/facebook/react-native/pull/53796

Test Plan: Fix typo in CHANGELOG.md

Reviewed By: fabriziocucci

Differential Revision: D82535096

Pulled By: vzaidman

fbshipit-source-id: fe93adf86ff48f0095312edbfce7b3ae6984198a
2025-09-16 06:49:03 -07:00
Moti ZilbermanandFacebook GitHub Bot f4aef39563 Revert D82459089: Update React Native DevTools binaries
Differential Revision:
D82459089

Original commit changeset: 3ccf7a1f07da

Original Phabricator Diff: D82459089

fbshipit-source-id: 9ab8827bfb534e5236c37a8a47206f891741a8e0
2025-09-16 05:33:44 -07:00
Ruslan LesiutinandFacebook GitHub Bot af7fc1b424 Update debugger-frontend from 5a792db...8b84a77 (#53789)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53789

Changelog: [Internal] - Update `react-native/debugger-frontend` from 5a792db...8b84a77

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/5a792db1225adda206313e9bf751198a1ca7851a...8b84a77b2c82c670886ef064dfc92d6bce83e579).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [8b84a77b2](https://github.com/facebook/react-native-devtools-frontend/commit/8b84a77b2) | Ruslan Lesiutin (28902667+hoxyq@users.noreply.github.com) | 2025-09-15T17:28:39+01:00 | [fix: avoid race conditions when fetching background trace (#206)](https://github.com/facebook/react-native-devtools-frontend/commit/8b84a77b2) |
| [95bd36ce9](https://github.com/facebook/react-native-devtools-frontend/commit/95bd36ce9) | Ruslan Lesiutin (28902667+hoxyq@users.noreply.github.com) | 2025-09-15T14:45:07+01:00 | [feat: use application display name for trace title (#207)](https://github.com/facebook/react-native-devtools-frontend/commit/95bd36ce9) |

Reviewed By: huntie

Differential Revision: D82464061

fbshipit-source-id: c33db7a535a148f8316730009580aef00afe04f1
2025-09-16 05:18:00 -07:00
Zeya PengandFacebook GitHub Bot 8d03e63265 Revert D82461457: Clean up batchingControlledByJS in NativeAnimated kotlin
Differential Revision:
D82461457

Original commit changeset: a1208720b83e

Original Phabricator Diff: D82461457

fbshipit-source-id: 99416873f66c45ccf61614d3e356e6a777bbad6b
2025-09-16 03:39:45 -07:00
Alex HuntandFacebook GitHub Bot fae11d58bd Replace trivial uses of string_view (#53775)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53775

A refactor to align our C++ code style within `jsinpector-modern`.

We prefer `std::string` and `const std::string&` everywhere (see [C++ Core Guidelines F.15](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-conventional)), except for when we are handing potentially very large strings — in which case we must use `string_view` all the way down.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D82446939

fbshipit-source-id: 4b1c43068d1339f4b4a4c7eb06b392d0b0f624e1
2025-09-16 03:17:57 -07:00
Alex HuntandFacebook GitHub Bot 6eb456bc4e Fix data race condition in NetworkHandler (#53788)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53788

Fix thread safety issue due to member variable  in `NetworkHandler` singleton without mutex.

Also intend to un-singleton this class in the imminent future.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D82460574

fbshipit-source-id: c0c614f8f1bb5ffba22872ae5717fbd2ca01f2e9
2025-09-16 03:03:06 -07:00
Nicola CortiandFacebook GitHub Bot 27630d3106 Remove unused --otp property from release infrastructure (#53779)
Summary:
The `--otp` flag is completely unused now, therefore it can be removed.
We don't pass the `NPM_CONFIG_OTP` env variable either as this was done back in the days of CircleCI so I'm cleaning this up.

## Changelog:

[INTERNAL] - Remove unused --otp property from release infrastructure

Pull Request resolved: https://github.com/facebook/react-native/pull/53779

Test Plan: CI

Reviewed By: lunaleaps

Differential Revision: D82453539

Pulled By: cortinico

fbshipit-source-id: 84a6b82a037c754165c21e17976dc534d9a7ba4c
2025-09-16 02:52:58 -07:00
Pieter De BaetsandFacebook GitHub Bot 96c33a8b0b Update ws to 7.5.10 (#53781)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53781

Fixes deprecation warning printed when starting various `js1` tools

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D82449982

fbshipit-source-id: 852b5a6980badef146b4e194434f2f9c6dd9a1d5
2025-09-16 02:51:06 -07:00
Zeya PengandFacebook GitHub Bot c9dcd64ed5 Clean up batchingControlledByJS in NativeAnimated kotlin (#53793)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53793

## Changelog:

[Android] [Deprecated] - Clean up batchingControlledByJS in NativeAnimated kotlin

`start/finishOperationBatch` will no longer be called on kotlin NativeAnimated since D78005971 (https://github.com/facebook/react-native/pull/52521), so `batchingControlledByJS` will remain false. Cleaning up some logic and TODO comments there

this feature was added in D23010844

Reviewed By: christophpurrer

Differential Revision: D82461457

fbshipit-source-id: a1208720b83e614c2a5f994ec1a5005189c5f197
2025-09-16 00:44:23 -07:00
generatedunixname537391475639613andFacebook GitHub Bot 15daa27871 xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/view/LayoutConformanceShadowNode.h (#53772)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53772

Reviewed By: javache

Differential Revision: D82292073

fbshipit-source-id: 3a3f8e54b4217c8ce9432520e04c4f232b538687
2025-09-15 16:11:00 -07:00
nishan (o^▽^o)andFacebook GitHub Bot b365e26593 feat(iOS) - blur filter using SwiftUI (#52495)
Summary:
As per the discussion on the previous [PR thread](https://github.com/facebook/react-native/pull/52028#issuecomment-2979481948), this PR uses `SwiftUI` to implement blur filter on iOS.

## Approach:

To implement blur filter on iOS, we have two options:

1. Use `CAFilter` (private API, app can get rejected/API can break). Earlier [PR](https://github.com/facebook/react-native/pull/52028) was using that approach. Thanks to Nick for suggesting SwiftUI API.

2. Use `SwiftUI`. Wrap the view in a SwiftUI view and apply [blur](https://developer.apple.com/documentation/swiftui/view/blur(radius:opaque:)). This PR builds on top of that approach. This also enables a way to add `SwiftUI` only features like this one. Additional filters (grayscale, saturate, contrast, hueRotate) can also be added.

There are a few ways we can implement the SwiftUI approach:

1. Create a new `RCTSwiftUIComponentView` -> do style flattening in View -> check if `filter` is present and conditionally render the `RCTSwiftUIComponentView` on iOS, wrap children with a `SwiftUI` view. Tradeoff with this approach is that it adds `StyleSheet.flatten` overhead on JS side.
2. Add a `SwiftUI` container view inside of `RCTViewComponentView`. Tradeoff with this approach is that it complicates `RCTViewComponentView` a bit.

I decided to go with **2** to avoid the flattening tradeoff and try to minimize complicating `RCTViewComponentView`. it only adds the wrapper if it's required and removes if not (in this PR, blur filter style will add the wrapper, it will get removed if blur filter styling gets removed). It uses the existing container view pattern.

## Changelog:
[IOS][ADDED] - Filter blur

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/52495

Test Plan:
Test filter blur example on iOS. SwiftUI view should be added to the hierarchy.

<img src="https://github.com/user-attachments/assets/742539f4-a96d-45f4-94ba-5eb588d0ad5a" width="300px" />

## Aside:

- This PR also adds a new swift podspec. Creating a new podspec felt the right approach as adding swift in existing ones were adding some complexity. But open for changes here. Also, need some eyes on the podspec configs. cc - chrfalch  🙏   this might also affect the SPM migration.
- Unrelated: Existing brightness filter has some inconsistency compared to android and web, it uses [self.layer.opacity](https://github.com/facebook/react-native/blob/6892dde36373bbef2d0afe535ae818b1a7164f08/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm#L1008) so transparent background color do not blend well unless the view has an opacity. One solution would be to calculate true background color by using brightness or else use the `SwiftUI`'s [brightness](https://developer.apple.com/documentation/swiftui/view/brightness(_:)), which would be cleaner imo (tested and it works).

Reviewed By: cipolleschi

Differential Revision: D79666764

Pulled By: joevilches

fbshipit-source-id: 05e43d75ce7b6f25b67b4eed632524a559ea1c2e
2025-09-15 15:04:54 -07:00
generatedunixname537391475639613andFacebook GitHub Bot 7e85653c18 xplat/js/react-native-github/packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/internal/PrepareGlogTaskTest.kt (#53750)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53750

Reviewed By: cortinico

Differential Revision: D82293987

fbshipit-source-id: 46bf93c7b8a2bf48a2246d9f5fc4ab8c1163badf
2025-09-15 13:04:17 -07:00
Ruslan LesiutinandFacebook GitHub Bot 01b4749f6a Emit stashed trace to an active Fusebox client (#53771)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53771

# Changelog: [Internal]

Instead of opening DevTools every time we emit a background trace, we are going to check if there is an active session with Fusebox client and will send it to the first one registered.

Reviewed By: huntie

Differential Revision: D82321146

fbshipit-source-id: 46b4d090ae9a6f8b4fc98181b303ff552c561eb8
2025-09-15 12:45:53 -07:00
Ruslan LesiutinandFacebook GitHub Bot 1b6d3c9ce1 refactor: emit the trace recoding on ReactNativeApplication domain initialization (#53760)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53760

# Changelog: [Internal]

This is a different approach from the one that I've introduced initially in [1].

This saves us from the scenario, where any local session could snatch the stashed trace recording. For example, if some session was created for a Runtime binding right after we've stashed the trace and before initializing real CDP session with the Frontend.

Reviewed By: huntie

Differential Revision: D82316584

fbshipit-source-id: 806a0f6dbdb4e4e928ce33af228cae86d43772e9
2025-09-15 12:45:53 -07:00
generatedunixname1395667395051502andFacebook GitHub Bot fedad125bf Update React Native DevTools binaries
Summary:
Automated update of React Native DevTools binaries
bypass-github-export-checks
Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D82459089

fbshipit-source-id: 3ccf7a1f07da7e79732c785afda1b938ee585ea6
2025-09-15 11:54:30 -07:00
Pieter De BaetsandFacebook GitHub Bot 64b30a9376 Fix newarch ignoring defaultfonthandler (#53755)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53755

Changelog: [iOS][Fixed] Make `RCTSetDefaultFontHandler` compatible with the new arch, and add a more powerful version as `RCTSetDefaultFontResolver`

Reviewed By: fkgozali

Differential Revision: D82207676

fbshipit-source-id: eeeaf708491de9156ef4f1e045864e4322213902
2025-09-15 11:31:30 -07:00
ismarbesicandFacebook GitHub Bot 07da2ff3e1 feat(ios): support condensed system font on fabric (#52259)
Summary:
This PR adds support for using the condensed system font on iOS when passing "SystemCondensed" as fontFamily. This behavior existed in the old architecture but was never ported to the new one, see [RCTFont.mm](https://github.com/facebook/react-native/blob/main/packages/react-native/React/Views/RCTFont.mm#L434) as reference. Fixes https://github.com/facebook/react-native/issues/52258.

## Changelog:

[IOS] [ADDED] - Add support for condensed system font when using the new react native architecture.

Pull Request resolved: https://github.com/facebook/react-native/pull/52259

Test Plan:
Before:
<img width="275" src="https://github.com/user-attachments/assets/8744a5ae-252c-46db-b5f9-b803f3e1c671" />

After:
<img width="275" src="https://github.com/user-attachments/assets/69ec27a3-5c9a-46e3-a80a-0e02b76d8813" />

Reviewed By: cortinico

Differential Revision: D82208140

Pulled By: javache

fbshipit-source-id: b23a97c94bf45144c3f0860c30e35cae88c7dc2f
2025-09-15 11:31:30 -07:00
Alex HuntandFacebook GitHub Bot 90ac3ac7bd Expose unstable_NativeText and unstable_NativeView components (#53777)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53777

Expose `unstable_NativeText` and `unstable_NativeView` components as root exports of the `react-native` package.

These are exposed as `unstable_` APIs which have no semver guarantee.

**Motivation**

There is significant community interest / dependance on the currently private `TextNativeComponent` and `ViewNativeComponent` deep imports, to access the faster-performing inner versions of these UI components.

Using `<Text>` and `<View>`, while recommended and stable, has led to measurable performance overhead in some apps when compared with these `<Native*>` counterparts.

Notably, these APIs are also referenced by low-level libraries such as React Strict DOM.

I am proposing this change in order to:
- Unblock libraries which safely use these.
- Meet users where they are at.
- Unblock us from enabling the Strict TypeScript API (no deep imports).

References:

- https://github.com/react-native-community/discussions-and-proposals/discussions/893#discussioncomment-13452047
- https://javascript.plainenglish.io/optimizing-text-component-rendering-in-react-native-b9d3565659d9
- https://github.com/search?type=code&q=react-native%2FLibraries%2FText%2FTextNativeComponent

**Ideal future state**

We are exposing these as unstable APIs because they should not be part of React Native's final API. The ideal end state is we improve the regular `<Text>` and `<View>` components to eliminate performance overhead and the need to access any lower level API.

Changelog:
[General][Added] - `unstable_NativeText` and `unstable_NativeView` are now exported from the `react-native` package

Reviewed By: javache

Differential Revision: D81588145

fbshipit-source-id: 2ea9b7f822286de85f49607944c6a484d1fcf242
2025-09-15 10:55:55 -07:00
Alex HuntandFacebook GitHub Bot dba8dbdeeb Implement support for Network trace events (#53761)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53761

Updates `NetworkReporter` and `PerformanceEntryReporter` to populate (minimal) `"ResourceSendRequest"` and `"ResourceFinished"` events when a CDP performance trace is active. This allows the Chrome DevTools Performance panel to display the "Network" track.

**Notes**

- The trace events that Chrome requires need extra fields which aren't present on `PerformanceResourceTiming`, hence the new + optional `devtoolsRequestId`, `requestMethod`, `resourceType` params. We only populate these in debug builds.

**Limitations**

- We emit a *complete trace event set* within `reportResourceTiming`, implementing basic initial support in the Performance panel Network track. This means 1/ either all/no events are sent for a given request (rather than incrementally), 2/ we aren't yet handling failed/cancelled requests in this pipeline.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D82212362

fbshipit-source-id: 4c6d5d2510cc98ddc819a2778222b835411295c8
2025-09-15 07:45:32 -07:00
Jakub PiaseckiandFacebook GitHub Bot 0caf8e70d5 Add dependency on hermes-compiler (#53773)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53773

Changelog: [GENERAL][ADDED] - Added a dependency on hermes-compiler

Reviewed By: cortinico

Differential Revision: D82437752

fbshipit-source-id: 3b2d92b765f3a5ba949363ce7656e936403a1155
2025-09-15 06:16:25 -07:00
Luna WeiandFacebook GitHub Bot 56e5dff73f Hysteresis window for VirtualViewExperimental (#53765)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53765

Changelog: [Internal] Introduce hysteresis window for experimental VirtualView

Reviewed By: yungsters

Differential Revision: D82354142

fbshipit-source-id: 13ec0e3a46930d3bea0ea67060c5f0e1c137dec1
2025-09-13 21:41:49 -07:00
Luna WeiandFacebook GitHub Bot 4f20e4d0fc Subview clipping for VirtualViewExperiment (#53759)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53759

Changelog: [Internal] - Enable subview clipping for experimental version of VirtualView

Reviewed By: mdvacca

Differential Revision: D82313841

fbshipit-source-id: c6726fd5f443a55ec47c93ef13092fe8bb9297e0
2025-09-13 21:41:49 -07:00
Alex HuntandFacebook GitHub Bot 09a7e0a0fc Restore NOT_FOCUSABLE flag on Perf Monitor overlay (#53754)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53754

Fix following D82302063.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D82311593

fbshipit-source-id: 07305c8d3fdbd9199662e20a813ccfbf46e6491b
2025-09-13 06:23:56 -07:00
David VaccaandFacebook GitHub Bot 4fb42c84d8 Delete ScreenshotTestsManagerModule (#53746)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53746

ScreenshotTestsManagerModule and ReactAppScreenshotTestActivity are not in use anymore, let's delete them

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D82249453

fbshipit-source-id: 73b0f2ef2e9a5370057c07c3bee03f9c0793d61a
2025-09-12 11:43:51 -07:00
generatedunixname89002005287564andFacebook GitHub Bot ebe51d6ce8 Fix CQS signal readability-static-accessed-through-instance in xplat/js/react-native-github/packages (#53756)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53756

Reviewed By: javache

Differential Revision: D82289100

fbshipit-source-id: 432d9cdf4116aadbd6f21e8fdb994a91a163bfd5
2025-09-12 10:18:49 -07:00
vladandFacebook GitHub Bot 81bbbe3c45 Fix deprecation message (#53751)
Summary:
This pull request fixes a small error in the deprecation message for `ReactContextBaseJavaModule#getCurrentActivity()`, where the reference to `getReactApplicationContext().getCurrentActivity()` contained a syntax error.

## Changelog:

[ANDROID] [FIXED] - Correct deprecation message for `ReactContextBaseJavaModule#getCurrentActivity()`

Pull Request resolved: https://github.com/facebook/react-native/pull/53751

Reviewed By: javache

Differential Revision: D82302032

Pulled By: cortinico

fbshipit-source-id: 130991ef514663223165c30fccb920ce87403148
2025-09-12 09:11:04 -07:00
Alex HuntandFacebook GitHub Bot 35f6ed1146 Update SectionList to accept React elements for separators (#53599)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53599

Runtime and types fix for the `ItemSeparatorComponent` prop on `virtualized-list` components (`FlatList`, `SectionList`, `VirtualizedList`).

- Docs source, where this prop (adjacent to other `*Component` props) is documented as accepting elements: https://reactnative.dev/docs/virtualizedlist#itemseparatorcomponent.
- Existing runtime behaviour matching this definition: https://github.com/facebook/react-native/blob/8d33e1c205b12fe27f4319e6566bb0c088197810/packages/virtualized-lists/Lists/VirtualizedListCellRenderer.js#L197-L203

**Changes**

- Update Flow, manual TS type defs.
- Align runtime behaviour in `VirtualizedSectionList` to add matching `React.isValidElement()` behaviour.

Resolves https://github.com/facebook/react-native/issues/53531.

Changelog:
[General][Fixed] - The `ItemSeparatorComponent` prop on list components now accepts a React element as well as a component function.

Reviewed By: cortinico

Differential Revision: D81675423

fbshipit-source-id: 3eed93b1bea89554988d6e20fa61b72e17be55df
2025-09-12 07:54:04 -07:00
Nicola CortiandFacebook GitHub Bot f59a6f9508 Do not crash inside getEncodedScreenSizeWithoutVerticalInsets if SurfaceMountingManager is null (#53752)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53752

Currently we `Objects.requireNotNull` on the `SurfaceMountingManager` inside the `getEncodedScreenSizeWithoutVerticalInsets`
function. However the `SurfaceMountingManager` could be null.
In that scenario, I'm returning 0 here (that will restore the old broken behavior, with the modal rendering on the top left corner for the first frame), instead of letting the app crash.

Changelog:
[Android] [Fixed] - Do not crash inside getEncodedScreenSizeWithoutVerticalInsets if SurfaceMountingManager is null

Reviewed By: javache

Differential Revision: D82225855

fbshipit-source-id: df84db612e77b6b981bc28afc0d293867b5d3b2e
2025-09-12 07:44:00 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 91d427fe52 Fix Switch layout with iOS26 (#53326)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53326

Apple changed the sizes of the UISwitchComponent and now, if you build an iOs app using the <Switch> component, the layout of the app will be broken because of wrong layout measurements.
This has been reported also by [https://github.com/facebook/react-native/issues/52823](https://github.com/facebook/react-native/issues/52823).

The `<Switch>` component was using hardcoded values for its size.
This change fixes the problem by:
- Using codegen for interface only
- Implementing a custom Sadow Node to ask the platform for the Switch measurements
- Updating the JS layout to wrap the size around the native component.

## Changelog:

[iOS][Fixed] - Fix Switch layout to work with iOS26

Reviewed By: sammy-SC

Differential Revision: D80454350

fbshipit-source-id: 1d468910276f7fde4559d2ae87cf60c8494caceb
2025-09-12 07:16:20 -07:00
Alex HuntandFacebook GitHub Bot d28ee162e3 Restore background tracing touch target (#53753)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53753

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D82302063

fbshipit-source-id: 25c99c2449fd72b81ce3ac25473c41304993cbc1
2025-09-12 06:51:53 -07:00
Alex HuntandFacebook GitHub Bot 136d795c22 Implement saved window positioning per target (#53743)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53743

As titled. A long awaited quality of life improvement that we can now deliver with our desktop shell.

Window arrangements are saved per [`windowKey`](https://github.com/facebook/react-native/blob/da7bf9c54567aae62ff355b79e66f511cb382065/packages/dev-middleware/src/middleware/openDebuggerMiddleware.js#L193), mapping to each previously opened debugger target.

**Limitations**

- Does not save/restore macOS fullscreen app state.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D82236159

fbshipit-source-id: e3c2f9c0cb05a3b8ef2208eb4a288e0be064489a
2025-09-12 05:26:27 -07:00
Alex HuntandFacebook GitHub Bot 88f3452992 Add website links to Help menu (#53741)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53741

Adds a couple of web link options to populate the "Help" menu in the RNDT desktop app. The default menu is otherwise unchanged.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D82231524

fbshipit-source-id: 9a57e6067854716691dc35938d6f27735b8c8448
2025-09-12 04:13:25 -07:00
Alex HuntandFacebook GitHub Bot 408abf66d7 Fix user facing display name for debugger-shell (#53740)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53740

Adjusts user facing app name used by Electron, which previously used `package.json#name` and led to this leaking into unwanted parts of the UI — e.g. "[About|Hide|Quit] react-native/debugger-shell" in the macOS menu bar.

**Changes**

- Set the `productName` field in `package.json` ([docs](https://www.electronjs.org/docs/latest/api/app#appname:~:text=npm%20modules%20spec.-,You%20should%20usually%20also%20specify%20a%20productName%20field%2C%20which%20is%20your%20application%27s%20full%20capitalized%20name%2C%20and%20which%20will%20be%20preferred%20over%20name%20by%20Electron.,-app.userAgentFallback%E2%80%8B)).

**Notes**

- This **changes** the `User-Agent` header sent by the app, now of the form `"... ReactNativeDevTools/0.82.0-main-dev ..."`.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D82228307

fbshipit-source-id: dd316ce5580a3ddf4138c7c3bf76aff99e4f4801
2025-09-12 04:13:25 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 82708c775e Fix CQS signal readability-isolate-declaration in xplat/js/react-native-github/packages (#53747)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53747

Reviewed By: javache

Differential Revision: D82197859

fbshipit-source-id: e76e29754188ff15c7b4ebde8060c04f89aa3b52
2025-09-12 03:52:25 -07:00
Gabriel DonadelandFacebook GitHub Bot bcf9d5850a Add changelog for v0.81.3 (#53694)
Summary:
Add Changelog for 0.81.3

## Changelog:
[Internal] - Add Changelog for 0.81.3

Pull Request resolved: https://github.com/facebook/react-native/pull/53694

Test Plan: N/A

Reviewed By: fabriziocucci

Differential Revision: D82111771

Pulled By: cortinico

fbshipit-source-id: a67f64e81afa794eb4ba260701a187cac9ca55bd
2025-09-12 03:49:52 -07:00
Vojtech NovakandFacebook GitHub Bot bc3503452f chore: improve codegen error when native project not found (#53726)
Summary:
While working on a somewhat non-standard library setup I ran into:

`[Codegen] TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined`

which was caused by `xcodeproj` file not found. The issue was on the project side rather than codegen, but the error message was rather unhelpful, so this improves it.

## Changelog:

[General][Changed] - improve codegen error when ios native project not found

Pull Request resolved: https://github.com/facebook/react-native/pull/53726

Test Plan:
tested locally, received the improved error message:

`[Codegen] Error: Cannot find .xcodeproj file inside /Users/some_project. This is required to determine codegen spec paths relative to native project.`

Reviewed By: cortinico

Differential Revision: D82226931

Pulled By: cipolleschi

fbshipit-source-id: dd851205655048fc35ed9f5266cefdbfb067d211
2025-09-12 03:41:50 -07:00
Nicola CortiandFacebook GitHub Bot c4d2ac6401 Temporarily disable prebuilds for template e2e tests on main branch (#53715)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53715

This is a backport of https://github.com/facebook/react-native/commit/ee08261123ac513941189cf7566337156576d4dd
on `main` as otherwise 0.83 will also be affected by the same problem (CI broken for iOS on the release branch).

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D82119125

fbshipit-source-id: 6fbdcd42b446bd49ac71bbe834181ba91cc67990
2025-09-12 03:03:28 -07:00
Zeya PengandFacebook GitHub Bot 54ebfafb21 ensure animatedNodes collection is only accessed on render thread (#53734)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53734

## Changelog:

[Internal] [Changed] - ensure animatedNodes collection is only accessed on render thread

now `createAnimatedNode` can be called async from js thread (since https://github.com/facebook/react-native/pull/53476), `animatedNodes_` will be written on both threads, there was no proper locking mechanism for read

we can simply add locks wherever we read/write animatedNodes_; but there's way to use fewer locking - since AnimatedNode is created async, but will not be R/W async anywhere else, we can add a new collection to temporarily hold nodes created async and flush it on render thread

Reviewed By: lenaic

Differential Revision: D82119554

fbshipit-source-id: 7f29e9e046cdf2e233c548442d70f1ff5b931cdd
2025-09-11 20:29:00 -07:00
Yury DymovandFacebook GitHub Bot a7dc5051d3 React Native (#53651)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53651

## Stack
We aim to remove +load methods from the codebase to reduce pre-main startup time and to unblock enabling startup optimizations

## Diff
Diff removes `+load` API from `RCT_EXPORT_MODULE` macro.
It introduces new parameter for `react_native_module_provider` function `eager`, which adds legacy RN modules to newly created socket `REACT_MODULE_EAGER_REGISTRATION_SOCKET`. This socket is invoked right before the RCTBridge is being initialized.

Impact: 137 static loaders are removed from the startup path

## RN
Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D81727845

fbshipit-source-id: 4904499f2e8587717b26579364ed48ffed934774
2025-09-11 18:55:40 -07:00
Alex HuntandFacebook GitHub Bot 6e011c98c1 Strip back V2 Perf Monitor to status only (#53742)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53742

Simplify scope for the internal V2 Perf Monitor prototype, and clean up the current perf metrics approach.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D82208400

fbshipit-source-id: a03eb5f493064fc4b554d56a36a48df889f276b2
2025-09-11 14:21:00 -07:00
Peter AbbondanzoandFacebook GitHub Bot 0ee665ce12 Add API 26 check to ReactScrollViewHelper (#53688)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53688

Support for the `removeIf` method was [added to CopyOnWriteArrayList with AOSP in API 26](https://android-review.googlesource.com/c/platform/libcore/+/304056). On devices with API 24 and 25, invocations of either `ReactScrollViewHelper#removeScrollListener` or `ReactScrollViewHelper#removeLayoutChangeListener` would cause a crash. Rather than bump the required API version and lock out apps targeting API 24/25, this adds a separate code path to bulk remove items from the array list.

Changelog: [Internal]

Differential Revision: D82039300

fbshipit-source-id: 6509dc637534b8e546f84447dbcdce1c5bca42f0
2025-09-11 11:34:09 -07:00
Peter AbbondanzoandFacebook GitHub Bot 2dada2193a Apply LINEAR_TEXT setting with custom typefaces set (#53692)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53692

With some custom typefaces, font hinting causes "jittery" artifacts upon scaling the text. We already set the subpixel text flag for views with custom or modified typefaces and this change also sets the linear text flag. Per [Android documentation](https://developer.android.com/reference/android/graphics/Paint#SUBPIXEL_TEXT_FLAG), it's recommended that both of these flags are set together to avoid this exact artifacting. This change is being gated behind a feature flag to evaluate the performance impact of disabling glyph caches for all text, and may drive the need to introduce a prop that controls this setting in the future.

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D82050029

fbshipit-source-id: 9e6e023ff723641f663935b6cd7aae07045834bc
2025-09-11 11:32:18 -07:00
Panos VekrisandFacebook GitHub Bot 3d4f0f48fe fix flow typing of mockComponent (#53739)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53739

The previous condition `typeof isESModule extends true` in the definition of `mockComponent` is always `true` (this is expected by semantics of conditional types).

See [try-Flow](https://flow.org/try/#1N4Igxg9gdgZglgcxALlAIwIZoKYBsD6uEEAztvhgE6UYCe+JADpdhgCYowa5kA0I2KAFcAtiRQAXSkOz9sADwxgJ+NPTbYuQ3BMnTZA+Y2yU4IwRO4A6SFBIrGVDGM7c+h46fNRLuKxJIGWh8MeT0ZfhYlCStpHzNsFBAMIQkIEQwJODAQfiEyfBE4eWw2fDgofDBMsAALfAA3KjgsXGxxZC4eAw0G-GhcWn9aY3wWZldu-g1mbGqJUoBaCRHEzrcDEgBrbAk62kXhXFxJ923d-cPRHEpTgyEoMDaqZdW7vKgoOfaSKgOKpqmDA+d4gB5fMA-P6LCCMLLQbiLOoYCqgh6-GDYRYIXYLSgkRZkCR4jpddwPfJLZjpOBkUEKTwJEJ+DAkMiUFSwkyZCC3dbdAC+-EgGiSAB1YA9lHBoAACXmICrcAAUAEpZcAJbLtbKYFL4VBdVBlWhkLK0MRnlBVWaVsYIDBzbKFAsoGwSLKpDJZQB+WUARllZoATBrZSwJEJKIbgwBuWUCiVanW2eyy+SBgC8RuVXuwqvjAHpC7LM2XZcHk9qM7LWQGiyWTJReVX04G63Gk4aU9A0-JQ9mYMayfmG6Xy5Xu9XQ3X-WOmy2p+mZx7O1BE1AuxK9Y8DbriqU1RrWzvpXKhwAeABCZotECtAD4TWarzbZVfnfJXe7PfpfQGgwrMMIyjQ1lQABlrD1gVoAtZULAAqWUHjtVg0DaWUEJLDdW1TCQ21LHM8zg4tx2zf1WxrWdY0o9tV3nahF1w3t8P7Qih2VEcSJLMts0nHVlyg+t4MbRjKEolcK3jCUBVyEAGhMEgZSgJIGnAqxgwADn9KxwJAAUgA)

A bug in Flow made it so that when this type was exported `typeof isESModule` became `any`, which made it so that the conditional always evaluated to the first part. The bug is fixed in D82193099.

This diff uses a type parameter, which can be correctly instantiated at the call site.

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D82226987

fbshipit-source-id: 411047c10ad88be867fe9b4c5a1672775b3c9322
2025-09-11 11:22:41 -07:00
Gabriel DonadelandFacebook GitHub Bot da7bf9c545 Add changelog for v0.81.2 (#53691)
Summary:
Add Changelog for 0.81.2

## Changelog:
[Internal] - Add Changelog for 0.81.2

Pull Request resolved: https://github.com/facebook/react-native/pull/53691

Test Plan: N/A

Reviewed By: fabriziocucci

Differential Revision: D82111764

Pulled By: cortinico

fbshipit-source-id: 90a140b7114861afecfa1c65cd69adbeff178e14
2025-09-11 10:35:54 -07:00
Nicola CortiandFacebook GitHub Bot 29c1f72801 Do not invoke project. inside BundleHermesCTask (#53718)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53718

I've just realized we ended up invoking `project.` inside the execution of `BundleHermesCTask`.
This is an anti-pattern and is breaking Gradle Configuration caching.

Instead we should be checking if hermesV1Enabled is set during the Task registration and pass over this information
to the task.

Changelog:
[Internal] [Changed] -

Reviewed By: j-piasecki

Differential Revision: D82130643

fbshipit-source-id: d2026711666867b3767824381cc5be0af3b476cc
2025-09-11 07:20:25 -07:00
Jakub PiaseckiandFacebook GitHub Bot ae89022f9a Use artifacts published from Hermes repository when using Hermes V1 (#53725)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53725

Changelog: [GENERAL][CHANGED] - Changed the coordinates of hermes artifacts when using Hermes V1

Adds a new `version.properties` file to keep which hermes versions should be consumed from Maven once the versions of Hermes and React Native are decoupled. This diff only implements changes necessary for consuming Hermes V1, as we don't want to migrate everything quite yet (0.82).

Reviewed By: cortinico

Differential Revision: D82204203

fbshipit-source-id: d712257a73f7ba54612a55c1b312416376f28b56
2025-09-11 06:36:23 -07:00
Nicola CortiandFacebook GitHub Bot 7438fcd5d2 Unblock run_fantom_tests by pinning react-native-android to v18.0 (#53732)
Summary:
This temporarly unblocks `run_fantom_tests` till we find a solution for the docker image bump. See:
- https://github.com/react-native-community/docker-android/pull/242#issuecomment-3280029122

## Changelog:

[INTERNAL] -

Pull Request resolved: https://github.com/facebook/react-native/pull/53732

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D82212022

Pulled By: cortinico

fbshipit-source-id: 652926addf12cc2d88ac2139d3ec58a266ced9ef
2025-09-11 06:21:39 -07:00
Rubén NorteandFacebook GitHub Bot 5ae5a120a7 Ship Web Performance APIs in canary (#53712)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53712

Changelog: [internal]

This enables the new Web Performance APIs in the canary channel.

Reviewed By: cortinico

Differential Revision: D82117694

fbshipit-source-id: 370b8397eeec350be8434728ab9d8ce1f5926117
2025-09-11 06:09:29 -07:00
Rubén NorteandFacebook GitHub Bot 9962add377 Remove redudant fields from ReactNativeStartupTiming (#53711)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53711

Changelog: [internal]

This removes some fields that contain the same time as `endTime`, which is confusing when documenting them.

Reviewed By: christophpurrer

Differential Revision: D82112473

fbshipit-source-id: 461e2b4b495ae641dcb3233874360a4f7b90dabf
2025-09-11 06:09:29 -07:00
Rubén NorteandFacebook GitHub Bot c015f626a8 Make eventCounts a getter (#53710)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53710

Changelog: [internal]

This should be a getter according to the spec.

Reviewed By: hoxyq

Differential Revision: D82111779

fbshipit-source-id: 614bb4848907bacd80ef228aa747ae685cf2c1f7
2025-09-11 06:09:29 -07:00
Vitali ZaidmanandFacebook GitHub Bot cda0ad8c5f Update debugger-frontend from e87564a...5a792db (#53714)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53714

Changelog: [Internal] - Update `react-native/debugger-frontend` from e87564a...5a792db

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/e87564a24cf233c60aaebee8c418ec85724f7214...5a792db1225adda206313e9bf751198a1ca7851a).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [5a792db12](https://github.com/facebook/react-native-devtools-frontend/commit/5a792db12) | Vitali Zaidman (vzaidman@gmail.com) | 2025-09-01T11:06:46+01:00 | [track clicks on script links (#204)](https://github.com/facebook/react-native-devtools-frontend/commit/5a792db12) |
| [7edec7c48](https://github.com/facebook/react-native-devtools-frontend/commit/7edec7c48) | Vitali Zaidman (vzaidman@gmail.com) | 2025-08-28T10:24:49+01:00 | [track the duration between user setting a breakpoint and the breakpoint being painted (#201)](https://github.com/facebook/react-native-devtools-frontend/commit/7edec7c48) |
| [273f02681](https://github.com/facebook/react-native-devtools-frontend/commit/273f02681) | Ruslan Lesiutin (28902667+hoxyq@users.noreply.github.com) | 2025-08-27T19:33:26+01:00 | [Revert "Add landingView query param enabling view focus on launch (#197)" (#202)](https://github.com/facebook/react-native-devtools-frontend/commit/273f02681) |
| [1e19c4454](https://github.com/facebook/react-native-devtools-frontend/commit/1e19c4454) | Vitali Zaidman (vzaidman@gmail.com) | 2025-08-21T16:23:44+01:00 | [Fixed Protocol Manager displaying events with no params as "(pending)". (#200)](https://github.com/facebook/react-native-devtools-frontend/commit/1e19c4454) |

Reviewed By: robhogan

Differential Revision: D82117068

fbshipit-source-id: 4112be5e8a4f643dffc46e7956c821041dad3b26
2025-09-11 03:49:25 -07:00
Riccardo CipolleschiandFacebook GitHub Bot dab8a45623 cipolleschi/fix rctnetworking not building (#53713)
Summary:
Fix Cocoapods builds with static libraries and dynamic frameworks

## Changelog:
[Internal] -

Pull Request resolved: https://github.com/facebook/react-native/pull/53713

Test Plan: Tested locally on RNTester

Reviewed By: cortinico

Differential Revision: D82118127

Pulled By: cipolleschi

fbshipit-source-id: 73736c2382be5f6b0770bb7154780e6dcc4aca1c
2025-09-10 12:14:14 -07:00
generatedunixname537391475639613andFacebook GitHub Bot 40c60adacf xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java (#53704)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53704

Reviewed By: cortinico

Differential Revision: D82098400

fbshipit-source-id: e692b8e2bad976805657c2f406831c346198554f
2025-09-10 07:23:21 -07:00
Riccardo CipolleschiandFacebook GitHub Bot a7cd3cc08f Make codegen generate a Package.swift file for Codegen'd target (#53619)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53619

With this change, we are making Codegen generate a Package.swift file so that we can integrate the `ReactCodegen` and the `ReactAppDependencyProvider` in apps only using SwiftPM

## Changelog
[iOS][Added] - Make codegen generate PAckage.swift file for the codegen targets

Reviewed By: cortinico

Differential Revision: D81769543

fbshipit-source-id: 1f1a1b9f41126e142931d5eda6e75109a69f828c
2025-09-10 05:25:54 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 87f8e85b7f Move generated code to ReactCodegen and ReactappDependencyProvider folder (#53618)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53618

This change makes sure that we generate the codegen files in the ReactCodegen and ReactAppDependencyProvider folder.

This is necessary as Swift PM needs the source code of packages to be grouped in folders that are children of where the Package.swift is located.

This is not a breaking change, because Cocoapods has been updated accordingly, import/include paths are not changed and the folder layout should not be accessed by anybody directly

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81769522

fbshipit-source-id: 7c70f96a9aa503c4faaf173b94c8ee0e326094a1
2025-09-10 05:25:54 -07:00
Phil PluckthunandFacebook GitHub Bot f6f5ea0b2e Remove outdated artifacts codegen early return (#53690)
Summary:
Follow-up to https://github.com/facebook/react-native/issues/53503 for a regression

When no React Native module is present this bail condition stops us from generating the artifacts podspec that's needed to complete build.

## Changelog:

[IOS] [FIXED] - Fix regression that skips artifacts code generation

Pull Request resolved: https://github.com/facebook/react-native/pull/53690

Test Plan:
- Create an app **without** any React Native modules, run `pod install`; without this fix the podspec will be missing and the build will fail
  - With expo this can be reproduced using `create-expo-app --template blank-typescript@next` on `react-native@0.81.2`
  - With the community CLI this can be reproduced using `npx react-native-community/cli@latest init test --skip-install --version 0.81.2` and uninstalling `react-native-safe-area-context`

Reviewed By: javache

Differential Revision: D82103491

Pulled By: cipolleschi

fbshipit-source-id: 3d9619b5a935ca920220824b3963a9a107f926ca
2025-09-10 05:24:28 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 6c49572ee4 Make sure we don't run RN CI on forks (#53707)
Summary:
We had reports from the Community of the RN CI running on forks and causing high costs and bills for them
This change should make sure that the most impactful jobs only runs on the React Native CI and not on forks.

## Changelog:
[Internal] -

Pull Request resolved: https://github.com/facebook/react-native/pull/53707

Test Plan: GHA

Reviewed By: cortinico

Differential Revision: D82107313

Pulled By: cipolleschi

fbshipit-source-id: ff7f418344975e7bb8306a6356d774c26bea3db1
2025-09-10 04:49:14 -07:00
Rubén NorteandFacebook GitHub Bot 529f55c8c9 Implement performance.timeOrigin (#53660)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53660

Changelog: [internal]

(This is internal because these APIs aren't enabled in OSS yet)

Implements `performance.timeOrigin` to allow converting timestamps from `performance.now()` to be based on the Unix epoch.

This implementation isn't fully spec-compliant to align with the current implementation of `performance.now()`, where the base of the clock is system boot time instead of app startup / navigation time.

Reviewed By: huntie

Differential Revision: D82016724

fbshipit-source-id: e3a066721cecf41e2fd963beb94a0a2f1c5d6493
2025-09-10 04:48:55 -07:00
generatedunixname537391475639613andFacebook GitHub Bot 481fb612a2 xplat/js/react-native-github/packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/internal/PrepareGflagsTaskTest.kt (#53702)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53702

Reviewed By: cortinico

Differential Revision: D82093601

fbshipit-source-id: 133936f59d155fa1d68358abe4015c7b7b1613a6
2025-09-10 04:41:29 -07:00
Oskar KwaśniewskiandFacebook GitHub Bot 3ce6a05aac fix: add conditional checks for facebook/react-native repo for nightly (#53700)
Summary:
This PR adds additional checks to run nightly jobs only on the main repo.

I noticed pretty heavy usage on my fork of React Native:

<img width="951" height="179" alt="Screenshot 2025-09-10 at 11 47 29" src="https://github.com/user-attachments/assets/91cb9e4a-8658-42bd-bbfe-ffba01b0b3b3" />

I also noticed a typo in this file with output instead of outputs

## Changelog:

[INTERNAL] [FIXED] - add conditional checks for facebook/react-native repo for nightly workflow

Pull Request resolved: https://github.com/facebook/react-native/pull/53700

Test Plan: Check if the syntax is correct.

Reviewed By: cortinico

Differential Revision: D82104958

Pulled By: cipolleschi

fbshipit-source-id: fc2e6e0299345ebd115c7a574a5a8161f2b0ca5c
2025-09-10 03:57:54 -07:00
Jakub PiaseckiandFacebook GitHub Bot 813b9441ca Read Hermes V1 opt-in flag from the app's properties (#53665)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53665

Changelog: [ANDROID][FIXED] - Read the Hermes V1 opt-in flag from the apps properties when building from source

Reviewed By: cortinico

Differential Revision: D82018545

fbshipit-source-id: f3c6fdbac190f47b6bf6836105d9e0909d8b86ba
2025-09-10 00:51:41 -07:00
Zeya PengandFacebook GitHub Bot cf5040b4f8 fix array type parsing in DynamicEventPayload::extractValue (#53689)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53689

## Changelog:

[General] [Fixed] - fix array type parsing in DynamicEventPayload::extractValue

When unwrapping event mapping like `e.nativeEvent.touches[0].locationX` e.g. for Animated.event like below,

```
onTouchMove={Animated.event(
  [
    {
      nativeEvent: {
        touches: {
          0: {locationX: animatedValue},
        },
      },
    },
  ],
  {useNativeDriver: true},
)}
```
here it'll throw exception `terminating due to uncaught exception of type folly::TypeError: TypeError: expected dynamic type 'object', but had type 'array'` when getting into folly dynamic array, because array index in the event path is string instead of integer

Reviewed By: rozele

Differential Revision: D82050538

fbshipit-source-id: ed25c8917b90190c995d1fcd6d60af207e72e270
2025-09-09 21:12:26 -07:00
Luna WeiandFacebook GitHub Bot 019a553ea4 Remove enable_eager_alternate_state_node_cleanup param (#53693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53693

Changelog: [Internal] - Remove usage of `enableEagerAlternateStateNodeCleanup`  as it is default true now

Reviewed By: yungsters

Differential Revision: D81962955

fbshipit-source-id: 80b0d9321b1162dd79d052b05acb3dc9459e37d2
2025-09-09 18:46:39 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 2ae5a74f06 Fix CQS signal modernize-use-using in xplat/js/react-native-github/packages (#53661)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53661

Reviewed By: javache

Differential Revision: D81764229

fbshipit-source-id: 617716ddb5cf17d41a4927c3a6cce6074278d8b0
2025-09-09 11:37:24 -07:00
generatedunixname537391475639613andFacebook GitHub Bot 3d4a4caac8 xplat/js/react-native-github/packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GeneratePackageListTaskTest.kt (#53614)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53614

Reviewed By: javache

Differential Revision: D81764947

fbshipit-source-id: de19d7d89f3a7e19285928f9541b0b47b503d160
2025-09-09 11:34:37 -07:00
Alex HuntandFacebook GitHub Bot cdc4a8ead4 Wire up background tracing and actions in Perf Monitor (#53460)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53460

Completes the first pass of adding background performance trace controls in the V2 Perf Monitor UI.

Key changes:
- Initiates background trace on `PerfMonitorOverlayManager::init`.
- Wires up background trace recording states in button dialog, and connects `pauseAndAnalyzeBackgroundTrace` and `resumeBackgroundTrace` actions.
- Moves UI manager/view classes into `perfmonitor` subpackage.
- Fixes `responsivenessScore` determination/UI coloring.
- Adds tooltip UI to the overlay view.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D80807554

fbshipit-source-id: 53360c2d454adfbba40fd795d400b28d90ff9e61
2025-09-09 10:31:04 -07:00
generatedunixname537391475639613andFacebook GitHub Bot 226d2ba160 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt (#53656)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53656

Reviewed By: cortinico

Differential Revision: D82005918

fbshipit-source-id: 5b0728e68fff865e8a9271c0dfc0a3cc19baa54c
2025-09-09 08:13:12 -07:00
Rubén NorteandFacebook GitHub Bot a16c6c9477 Add feature flag to enable Web Performance APIs by default (#53547)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53547

Changelog: [internal]

This creates a new feature flag to enable the modern Web performance APIs in RN by default. It's disabled by default so it shouldn't have any effect at the moment.

Reviewed By: rshest

Differential Revision: D80811430

fbshipit-source-id: 47d5fd12ac8809aa3c5ad37cdd31c0d9e3ed5912
2025-09-09 08:07:31 -07:00
Vitali ZaidmanandFacebook GitHub Bot 59b8974d3c changelog/v0.80.0-rc.1 (#53662)
Summary:
Changelog: [Internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/53662

Reviewed By: fabriziocucci

Differential Revision: D82020526

Pulled By: vzaidman

fbshipit-source-id: 43eb1d038f71dbeb30bd1bf4a94779a9fad56215
2025-09-09 07:46:35 -07:00
generatedunixname537391475639613andFacebook GitHub Bot 2c30215bc7 xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/core/tests/TestComponent.h (#53658)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53658

Reviewed By: javache

Differential Revision: D81904578

fbshipit-source-id: 03725446586cc206690995f7d2d274c0b1249abe
2025-09-09 04:57:44 -07:00
generatedunixname537391475639613andFacebook GitHub Bot f568c9b953 xplat/js/react-native-github/packages/gradle-plugin/shared-testutil/src/main/kotlin/com/facebook/react/tests/OsRule.kt (#53655)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53655

Reviewed By: cortinico

Differential Revision: D82008708

fbshipit-source-id: 9ba77512a5e6e7749981726d739d88df287a63d3
2025-09-09 03:42:58 -07:00
25harshandFacebook GitHub Bot 968909488a fix(iOS): Fix RCTDeviceInfo crash when application.delegate.window is nil (#53645)
Summary:
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

Fixes a crash in `RCTDeviceInfo.interfaceOrientationDidChange` when `application.delegate.window` is nil. This crash affects multiple modern iOS app architectures where the traditional window property may not be set:

- **SwiftUI apps using `main`** instead of traditional AppDelegate
- **Brownfield React Native integrations** where the host app manages windows
- **Scene-based lifecycle apps** (iOS 13+) using SceneDelegate
- **Custom window management** setups

**The Problem:**
```
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[MyApp.AppDelegate window]: unrecognized selector sent to instance'
```

This occurs when trying to access `.frame` on a nil window object during orientation changes. Modern iOS development patterns don't always require setting `application.delegate.window`, but React Native's RCTDeviceInfo assumes this property exists.

**The Solution:**
Replace direct `application.delegate.window` access with `RCTKeyWindow()` and add nil-safe fallback:

```objc
// Before (crashes in modern apps)
BOOL isRunningInFullScreen =
    CGRectEqualToRect(application.delegate.window.frame, application.delegate.window.screen.bounds);

// After (safe for all app configurations)
UIWindow *delegateWindow = RCTKeyWindow();
BOOL isRunningInFullScreen = delegateWindow ?
    CGRectEqualToRect(delegateWindow.frame, delegateWindow.screen.bounds) : YES;
```

This approach:
- Uses `RCTKeyWindow()` pattern already established elsewhere in RCTDeviceInfo
- Provides safe fallback defaulting to fullscreen when window state is unknown
- Maintains existing multitasking detection behavior (Split View, Slide Over)
- Is backward compatible with traditional React Native apps

## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[IOS][FIXED] - Fix RCTDeviceInfo crash when application.delegate.window is nil in modern iOS app architectures

Pull Request resolved: https://github.com/facebook/react-native/pull/53645

Test Plan:
### Manual Testing

**1. SwiftUI main App Test:**
```bash
# Created SwiftUI app with main lifecycle
# Integrated React Native component
# Result: No crash during orientation changes, fullscreen detection works
 PASS: Orientation changes handled safely
 PASS: Multitasking detection stable
```

**2. Traditional React Native App:**
```bash
# Tested with standard RN template app
# Verified existing behavior unchanged
 PASS: Existing functionality preserved
 PASS: No regressions in dimension reporting
```

**3. Brownfield Integration:**
```bash
# Integrated RN in existing iOS app without window property
# Triggered orientation changes and multitasking transitions
 PASS: No crashes during orientation events
 PASS: Split View and Slide Over work correctly
```

**4. Scene-based Lifecycle App:**
```bash
# Created app using SceneDelegate for window management
# Tested orientation and multitasking scenarios
 PASS: Proper handling when SceneDelegate manages windows
 PASS: No crashes during app lifecycle transitions
```

### Edge Case Testing

**RCTKeyWindow() Returns Nil:**
- Confirmed defaults to `YES` (fullscreen)
- No crashes when no key window available
- Multitasking detection remains stable

**Multiple Window Scenarios:**
- Tested with iPad multiple windows
- Uses correct key window for measurements
- Proper behavior in complex window hierarchies

**Orientation During Transitions:**
- App backgrounding/foregrounding during orientation
- Multitasking mode changes during rotation
- No crashes or inconsistent states

### Automated Testing

```bash
# All existing tests pass
yarn test
 RCTDeviceInfoTests pass

# Code style compliance
yarn lint
 Follows React Native Objective-C guidelines
```

### Impact Verification

**Before Fix:**
- Crash in SwiftUI apps using main
- Crash in Scene-based lifecycle apps
- Crash in brownfield integrations

**After Fix:**
- All app architectures work safely
- Multitasking detection preserved
- Backward compatibility maintained
- No performance impact

Rollback Plan:

Reviewed By: javache

Differential Revision: D81931754

Pulled By: cipolleschi

fbshipit-source-id: c3ea1a2922b1d48ca6bc1fc32861b490322fd254
2025-09-09 02:23:52 -07:00
Alex HuntandFacebook GitHub Bot e7ce4ff0bf Move NetworkReporter out of jsinspector-modern (#53484)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53484

Refactor to better organise network event reporting features.

- Introduce new `ReactCommon/react/networking` package, containing `NetworkReporter` class (outer-most interface with each platform).
    - Move `ReactCommon/performance/timeline` dependency to this level, removing jsinspector→performance dependency.
- Simplifies the remaining `NetworkHandler` in `jsinspector-modern/network` — which now is only focused on CDP network reporting.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D81129562

fbshipit-source-id: 6c36045e872b0fd9510d0fa3e98acb0969e74d72
2025-09-08 13:35:23 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 49be01add1 Move headers from .h to .mm file (#53617)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53617

In the RCTAppDelegate.h file there are a couple of headers that are not used and that can be either removed or moved to the .mm file.
This reduce the coupling between the AppDelegate library and React Core and allow us to reduce the size of the exported headers in the umbrella header.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D81769485

fbshipit-source-id: b811dde0331e8a668618e0c8eb250fd81bf48545
2025-09-08 10:27:24 -07:00
Nicola CortiandFacebook GitHub Bot 13120f630d Remove unnecessary extra quote on hermesVersionProvider (#53641)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53641

This extra quote is causing the build on the 0.82-stable to fail. The reason is that the Path for the `.hermesversion` file is composed wrongly so we attempt to build hermes from the `main` branch.

Changelog:
[Internal] [Changed] -

Created from CodeHub with https://fburl.com/edit-in-codehub

Reviewed By: j-piasecki, vzaidman

Differential Revision: D81925624

fbshipit-source-id: 700f9d44b6c7efdb845232dad8ca7c2e3136385d
2025-09-08 09:09:23 -07:00
Rick HanlonandFacebook GitHub Bot d0140ce53b enable opt-in for enableDefaultTransitionIndicator (#34373)
Summary:
So we can test the feature.

DiffTrain build for [3168e08f8389d258de9eb7c8d19b9d44a0f250f2](https://github.com/facebook/react/commit/3168e08f8389d258de9eb7c8d19b9d44a0f250f2)

Reviewed By: kassens

Differential Revision: D81599263

fbshipit-source-id: a33ca01250206a2a35350f7fad09e43071522df7
2025-09-08 08:43:40 -07:00
Jakub PiaseckiandFacebook GitHub Bot d0fb33822d Check value of the Hermes V1 flag instead of whether it's defined (#53637)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53637

Changelog: [ANDROID][FIXED] - Check for the value of the HERMES_V1_ENABLED flag instead of whether it's defined

Reviewed By: cortinico

Differential Revision: D81920483

fbshipit-source-id: 550ae9fd27f666affe102b1c5c3f51bde7b5923e
2025-09-08 07:16:48 -07:00
Rob HoganandFacebook GitHub Bot 2152180fa0 Minor bump memfs dev dependency (#53628)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53628

Bump the `memfs` dependency used in tests to the latest minor - there have been a considerable number of updates since 4.7 including support for various newer (and some old) Node fs APIs: https://github.com/streamich/memfs/blob/master/CHANGELOG.md

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D81879137

fbshipit-source-id: e75946dac100809cb39c88971fd6ed397dc9f49e
2025-09-08 06:54:09 -07:00
Ramanpreet NaraandFacebook GitHub Bot e7aeea26bd Deprecate legacy javascript apis (#53630)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53630

These JavaScript apis were a part of react native's legacy architecture. Let's deprecate them, so that we can eventually remove them in the future.

Changelog: [General][Deprecated] - Deprecate legacy javascript react native apis

Reviewed By: cortinico

Differential Revision: D81795732

fbshipit-source-id: 0a2bd142fa7e08c1f3daaa437ee127a2156e045b
2025-09-08 04:30:21 -07:00
Bartosz KaszubowskiandFacebook GitHub Bot c04248dc5c chore: Add Bluesky badge to README (#53616)
Summary:
Add Bluesky badge to README.

## Changelog:

[INTERNAL][ADDED] Add Bluesky badge to README

Pull Request resolved: https://github.com/facebook/react-native/pull/53616

Test Plan:
The updated README has been checked out on the PR branch.

## Preview:

<img width="1880" height="746" alt="Screenshot 2025-09-05 at 13 00 34" src="https://github.com/user-attachments/assets/dc1dfa9c-9e08-449d-82b8-dcb92ae92268" />

Reviewed By: cipolleschi

Differential Revision: D81909921

Pulled By: cortinico

fbshipit-source-id: b5fa79f152f126944bc1c31c8fbb86889f0f25db
2025-09-08 03:48:46 -07:00
Nick LefeverandFacebook GitHub Bot 02e3a999ed Back out "Use uint32_t as internal Color representation" (#53622)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53622

Reverting to avoid lossy conversion on hosts expecting signed int values for color conversion.

Changelog: [Internal]

Reviewed By: rozele, javache

Differential Revision: D81785268

fbshipit-source-id: 4a8d099e378fa55e76a58c2ab0356d88e344de2c
2025-09-05 20:37:58 -07:00
Mark VerlingieriandFacebook GitHub Bot 44b2da0df2 Revert D81766029: Make feature flag "enableViewRecyclingForScrollView" true by default
Differential Revision:
D81766029

Original commit changeset: df4a260b9bde

Original Phabricator Diff: D81766029

fbshipit-source-id: f1cd2a2cef632cfe9cbf0cd13e9ec20cfa5cc6ae
2025-09-05 11:58:48 -07:00
Zeya PengandFacebook GitHub Bot dae2f606c7 Course correct props at SurfaceMountingManager.updateProps() (#53589)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53589

## Changelog:

[Android] [Changed] - [c++ animated] Course correct props at SurfaceMountingManager.updateProps()

Sometimes a React update will try to commit to the same view that native animated modified before via direct manipulation, and after the update host view will use the prop value currently in Fabric. In `AnimatedMountingOverrideDelegate` there's logic to course correct at ShadowTree mount, but if this update is from JS thread, it takes some time to reach mounting layer, at the same time UI thread can still be doing more direct animation updates, and once the corrected change gets there it's already stale.

In this diff I added mechanism to keep track of direct manipulation props (or "synchronous mount props" to match the naming of java function `synchronouslyUpdateView...`) and use it to correct what reaches host view. `SurfaceMountingManager.updateProps()` is called by both regular mount and direct manipulation and it's always called on UI thread, so it could be a good candidate to synchronize these 2 scenarios

Reviewed By: sammy-SC

Differential Revision: D81611823

fbshipit-source-id: 638a59bcd94b3d7e8bab68defd472b2b482dc92f
2025-09-05 09:18:50 -07:00
Zeya PengandFacebook GitHub Bot 5774bd105d create FeatureFlag overrideBySynchronousMountPropsAtMountingAndroid (#53603)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53603

## Changelog:

[General] [Added] - create FeatureFlag overrideBySynchronousMountPropsAtMountingAndroid

Reviewed By: rshest

Differential Revision: D81690079

fbshipit-source-id: cb381004135ef9cd072c6f99703d9e7f4a40dd6a
2025-09-05 09:18:50 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 3a3f3a417d Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages [B] (#53611)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53611

Reviewed By: rshest

Differential Revision: D81699709

fbshipit-source-id: 6f512fcc01e3f1d33b4e94c4766ee3ab759463e5
2025-09-05 06:37:04 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 71edbe1548 Make feature flag "enableViewRecyclingForScrollView" true by default
Summary:
## Changelog:
[Internal] -

Noticed that the default value for this one is inconsistent with all the other similar ones, which can cause confusion during setting up the experiment, fixing it.

Note that top level view recycling is still controlled via `enableViewRecycling`, which will also disable all the other ones when false (which it is by default).

bypass-github-export-checks

Reviewed By: lenaic

Differential Revision: D81766029

fbshipit-source-id: df4a260b9bde20d1c85b7786df00fa91298a27b7
2025-09-05 06:01:47 -07:00
generatedunixname89002005287564andFacebook GitHub Bot f6a4f24090 Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages [A] (#53612)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53612

Reviewed By: rshest

Differential Revision: D81699159

fbshipit-source-id: b711e066b206d70ec40570b63dd1290d800e531f
2025-09-05 03:05:35 -07:00
Jakub PiaseckiandFacebook GitHub Bot 1be852781d Add tests for isHermesV1Enabled (#53601)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53601

Changelog: [Internal]

Adds tests covering the `isHermesV1Enabled` utility function.

Reviewed By: cortinico

Differential Revision: D81681635

fbshipit-source-id: c2c50db65f93b8b58ce1730ccfdf4367a024ce7b
2025-09-04 23:31:08 -07:00
Tim YungandFacebook GitHub Bot a50ddf3d8e JS: Upgrade to signedsource@2.0.0 (#53606)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53606

Upgrades projects to `signedsource@2.0.0`, which includes a critical bug fix to the `isSigned` and `signFile` functions:

```lang=diff
isSigned(data) {
-  return !PATTERN.exec(data);
+  return PATTERN.exec(data) != null;
},
```

Changelog:
[Internal]

Reviewed By: bvanderhoof, jehartzog

Differential Revision: D81723007

fbshipit-source-id: 0606eef35df1e5ec988b537aa012bc2c6d3c2d3a
2025-09-04 19:12:08 -07:00
Sam ZhouandFacebook GitHub Bot 020c92efac Deploy 0.281.0 to xplat (#53607)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53607

[changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D81728906

fbshipit-source-id: 161eb62d7520398c97f05db40676e1ea2ac4d0a9
2025-09-04 16:51:26 -07:00
Gang ZhaoandFacebook GitHub Bot d7315563fe Allow ReactInstance to evaluate SH unit when possible (#53471)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53471

When IHermes::getSHUnitCreator() returns non-null pointer, call
`evaluateSHUnit()` on that instead of `evaluateJavaScript()`.

Changelog: [Internal]

Reviewed By: dannysu

Differential Revision: D80916868

fbshipit-source-id: 9c1e2327b720cab4b374d4752a9c64f87c592ad6
2025-09-04 16:27:46 -07:00
Moti ZilbermanandFacebook GitHub Bot 1f57ae5249 Distribute React Native DevTools binaries via GitHub Releases (#52930)
Summary:
bypass-github-export-checks

OSS release infrastructure for the (experimental) React Native DevTools standalone shell.

Currently, binaries are built continuously on Meta infra and served from the Meta CDN using fbcdn.net URLs checked into a DotSlash file in the repo, e.g.:

https://github.com/facebook/react-native/blob/15373218ec572c0e43325845b80a849ad5174cc3/packages/debugger-shell/bin/react-native-devtools#L9-L18

For open source releases we want to primarily distribute the binaries as GitHub release assets, while keeping the Meta CDN URLs as a secondary option. This PR makes the necessary changes to the release workflows to support this:

* `workflows/create-release.yml` (modified): As part of the release commit, rewrite the DotSlash file to include the release asset URLs.
  * **NOTE:** After this commit, **the new URLs don't work yet**, because they refer to a release that hasn't been published. Despite this, the DotSlash file remains valid and usable (because DotSlash will happily fall back to the Meta CDN URLs, which are still in the file).
* `workflows/create-draft-release.yml` (modified): After creating a draft release, fetch the binaries from the Meta CDN and reupload them to GitHub as release assets. This is based on the contents of the DotSlash file rewritten by `create-release.yml`.
* `workflows/validate-dotslash-artifacts.yml` (new): After the release is published, all URLs referenced by the DotSlash (both Meta CDN URL and GH release asset URLs) should be valid and refer to the same artifacts. This workflow checks that this is the case.
  * If this workflow fails on a published release, the release may need to be burned or a hotfix release may be necessary - as the release will stop working correctly once the Meta CDN stops serving the assets.
  * This workflow will also be running continuously on `main`. If it fails on a commit in `main`, there might be a connectivity issue between the GHA runner and the Meta CDN, or there might be an issue on the Meta side.

NOTE: These changes to the release pipeline are generic and reusable; if we later add another DotSlash-based tool whose binaries need to be mirrored as GitHub release assets, we just need to add it to the `FIRST_PARTY_DOTSLASH_FILES` array.

## Changelog:

[Internal] Mirror React Native DevTools binaries in GitHub Releases

Pull Request resolved: https://github.com/facebook/react-native/pull/52930

Test Plan:
### Step 0: Unit tests

I've added unit tests for `dotslash-utils`, `curl-utils`, and for the majority of the logic that makes up the new release scripts (`write-dotslash-release-assets-urls`, `upload-release-assets-for-dotslash`, `validate-dotslash-artifacts`).

### Step 1: Test release commit

Created a test branch and draft PR: https://github.com/facebook/react-native/pull/53147.

Locally created a release commit, simulating the create-release GH workflow:

```
node scripts/releases/create-release-commit.js --reactNativeVersion 0.82.0-20250903-0830 --no-dry-run
```

This updated the DotSlash file in the branch: https://github.com/facebook/react-native/pull/53147/commits/2deeb7e70376ee80b99f27bea4825789f22a89a3#diff-205a9ff6005e30be061eaa64b9cb50b15b0e909dd188e0866189e952655a3483

NOTE: I've also ensured that the `create-release-commit` script correctly updates the DotSlash file when running from a branch that already has a release commit - see screenshot:
<img width="1483" height="587" alt="image" src="https://github.com/user-attachments/assets/1ffd859b-e02b-483d-8067-9cc9116829a4" />

### Step 2: Test draft release

Enabled testing the create-draft-release GH workflow in the test branch using these temporary hacks:

* https://github.com/facebook/react-native/pull/53147/commits/81f334eac5147d4dbf5f6d7d627ddfa52cd197be
* https://github.com/facebook/react-native/pull/53147/commits/6d8851657629de7e0b710ed8f5dd7d0f7b9847cc
* https://github.com/facebook/react-native/pull/53147/commits/1428a8da8b9fb29c45fc33d79f311dd1fe273433

Workflow run: https://github.com/facebook/react-native/actions/runs/17426711373/job/49475327346
Draft release: https://github.com/facebook/react-native/releases/tag/untagged-c6a62a58e5baa37936e1
Draft release screenshot for posterity (since we'll likely delete the draft release after landing this):

<img width="1024" height="814" alt="image" src="https://github.com/user-attachments/assets/1900da15-48f6-4274-b29c-0ac2019d92c0" />

### Step 3: Test post-release validation script

For obvious reasons, I've avoided actually publishing the above draft release. But I have run the `validate-dotslash-artifacts` workflow on the *current* branch to ensure that the logic is correct: https://github.com/motiz88/react-native/actions/runs/17426885205/job/49475888486

Running `node scripts/releases/validate-dotslash-artifacts.js` in the release branch (without publishing the release first) fails, as expected:

<img width="1105" height="748" alt="image" src="https://github.com/user-attachments/assets/ed23a2e2-7a31-42eb-a324-f1d50eafe2fb" />

## Next steps

This PR is all the infra needed ahead of the 0.82 ~~branch cut~~ infra freeze to support the React Native DevTools standalone shell, at least on the GitHub side. ~~Some minor infra work remains on the Meta side, plus some product/logic changes to the React Native DevTools standalone shell that I'm intending to finish in time for 0.82 (for an experimental rollout).~~ EDIT: All the planned work has landed; the feature is code-complete on `main` as well as in `0.82-stable` (apart from this infra change).

As a one-off, once we've actually published 0.82.0-rc.1, we'll want to have a human look at the published artifacts and CI workflow logs to ensure everything is in order. (I'll make sure to communicate this to the 0.82 release crew.) Afterwards, the automation added in this PR should be sufficient.

Reviewed By: huntie

Differential Revision: D81578704

Pulled By: motiz88

fbshipit-source-id: 6a4a48c3713221a89dd5fc88851674c1ddc6bb10
2025-09-04 11:25:39 -07:00
Vitali ZaidmanandFacebook GitHub Bot 47f32ffae0 add comments regarding RCTPackagerConnection's reconnect (#53558)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53558

Changelog: [Internal]
Got confused regarding why "reconnect" does not actually trigger a reconnect. It turns out, it only triggers a reconnect if the URL has changed.

Reviewed By: cipolleschi, huntie

Differential Revision: D80629308

fbshipit-source-id: 098ef5e91f3748deb9bc707b79bc0395d2442ca4
2025-09-04 10:00:18 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 0a3b3fcd18 Add RN feature flag for Image view recycling (#53600)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53600

# Changelog:
[Internal] -

Adds the corresponding feature flag, similarly as it's done for other component types.

The flag is used in the next diff.

Reviewed By: mdvacca

Differential Revision: D81681404

fbshipit-source-id: f9f155379034695f5df6cc4f0d3787ff4c69df7f
2025-09-04 09:47:15 -07:00
Vitali ZaidmanandFacebook GitHub Bot 2b4c48ae47 export Logger type from dev-middleware (#53586)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53586

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D81588537

fbshipit-source-id: e6537dd831cfb73ce93326e2e0c0a2bcd3929caa
2025-09-04 08:13:04 -07:00
Jakub PiaseckiandFacebook GitHub Bot 2e0bd13a25 Use hermesc from node_modules when consuming prebuilt hermes (#53581)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53581

Changelog: [General][Changed] - Changed the source of hermesc binary to be an npm package

Reviewed By: cipolleschi, cortinico

Differential Revision: D81224001

fbshipit-source-id: 552d0e66fb891974d7b688bfc0bec95e19345d86
2025-09-04 07:42:12 -07:00
Jakub PiaseckiandFacebook GitHub Bot 3e9990f860 Allow to opt-in to use the new Hermes on Android (#53580)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53580

Changelog: [ANDROID][ADDED] Added opt-in to use the new Hermes

Reviewed By: cortinico

Differential Revision: D81035114

fbshipit-source-id: d01e44190941d161cf641ec4e03ed487aff18dd8
2025-09-04 07:42:12 -07:00
Jakub PiaseckiandFacebook GitHub Bot e9cdc308b4 Allow to opt-in to use the new Hermes on iOS (#53579)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53579

Changelog: [IOS][ADDED] Added opt-in to use the new Hermes

Reviewed By: cipolleschi

Differential Revision: D81035113

fbshipit-source-id: b12ca68824ec4e736edd4393a93c28803312eb32
2025-09-04 07:42:12 -07:00
Jakub PiaseckiandFacebook GitHub Bot 30432addfb Gate legacy debugger behind a preprocessor directive (#53578)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53578

Changelog: [Internal]

Adds a new preprocessor directive which should be set when the new Hermes is being used. This directive will disable the legacy debugger which isn't supported by it.

Reviewed By: cipolleschi, cortinico

Differential Revision: D81035112

fbshipit-source-id: b30ae348b3419ec2d064dfe7f91c9d664a66f5cf
2025-09-04 07:42:12 -07:00
Andrew DatsenkoandFacebook GitHub Bot 10a46f7b52 Add support for JS coverage (#53410)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53410

Changelog: [Internal]
Adding babel-istanbul-plugin to instrument bundle code with coverage reporting.
Metro will transform source code only when coverage flag is set up globally in jest.
Coverage map is then provided by runner as part of test result.

Reviewed By: sammy-SC

Differential Revision: D80716433

fbshipit-source-id: 3831f227f8793f874f0d2366759bb6916e747c72
2025-09-04 07:19:56 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 8d33e1c205 Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages (#53593)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53593

Reviewed By: rshest

Differential Revision: D81573635

fbshipit-source-id: a367572b7d2b3a9422e47fa05d3c001e607ec0e3
2025-09-04 04:01:12 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 95b187bb37 Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages (#53596)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53596

Reviewed By: rshest

Differential Revision: D81574342

fbshipit-source-id: 9423d3341a9c349d7e7519b5acb7ee41f6ceb2b3
2025-09-04 03:56:08 -07:00
generatedunixname537391475639613andFacebook GitHub Bot 7a4d5ad644 xplat/js/react-native-github/packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GenerateAutolinkingNewArchitecturesFileTaskTest.kt (#53597)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53597

Reviewed By: cortinico

Differential Revision: D81662100

fbshipit-source-id: f41c89a059dd0d8e312e5edc07172e1d8cac6597
2025-09-04 03:49:37 -07:00
generatedunixname89002005287564andFacebook GitHub Bot b0db8aa26b Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages (#53592)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53592

Reviewed By: rshest

Differential Revision: D81569365

fbshipit-source-id: 88ec1b964a37774f29df9cbabca3c0e2c5ee4c53
2025-09-04 03:47:53 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 4553f87489 Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages (#53591)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53591

Reviewed By: rshest

Differential Revision: D81571883

fbshipit-source-id: 479a0764eabeac968028814ec6aafa32687b0905
2025-09-04 03:13:49 -07:00
Gang ZhaoandFacebook GitHub Bot 863184fcf8 Move dumpOpcodeStats() to jsi::Instrumentation, remove IHermesExtra (#53475)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53475

This is cleanup of IHermesExtra. Move the last method in IHermesExtra,
dumpOpcodeStats(), to jsi::Instrumentation, since other profile stats
dumping methods live in that interface as well.

Changelog: [Internal]

Reviewed By: tsaichien

Differential Revision: D81087047

fbshipit-source-id: e145aafea7459a161fca04ffc30f0838ee6c03c6
2025-09-04 03:06:33 -07:00
Gang ZhaoandFacebook GitHub Bot 8c9f366bdc Move methods from IHermesExtra to IHermes (#53473)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53473

This is a cleanup of IHermesExtra:
1. Move dumpSampledTraceToProfile() and debugJavasScript() to IHermes.
I'm still keeping the empty DebugFlags, since changing that requires
more changes. It's also possible that we may need it in the future.
2. Remove `dumpBasicBlockProfileTrace`. Use
writeBasicBlockProfileTraceToFile` if users need to dump the profile.

Changelog: [Internal]

Reviewed By: tsaichien

Differential Revision: D81075460

fbshipit-source-id: b81005e531809cfd870fd9bdb5c0e17864ed92fb
2025-09-04 03:06:33 -07:00
Gang ZhaoandFacebook GitHub Bot 89d9533a97 getSHUnitCreator() to IHermes (#53419)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53419

By default, this function returns nullptr. User can pass a preprocessor
definition "-DHERMES_SH_UNIT_FN=sh_export_<unit_name>" (where
<unit_name> is the name passed to shermesc when compiling the JS
input), so that this function returns the function pointer, which can
be passed to `evaluateSHUnit` for evaluation.

Changelog: [Internal]

Reviewed By: avp

Differential Revision: D80747463

fbshipit-source-id: a798a7a572679444fca111c34674fd7ced9311f3
2025-09-04 03:06:33 -07:00
Gang ZhaoandFacebook GitHub Bot 48998b4c11 Move IHermes to jsi/hermes.h (#53418)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53418

Expose these methods so that we can access from RN code. To minimize
the change, a few methods that depend on other headers or preprocessor
flags are wrapped into IHermesExtra in hermes/API/hermes.h.

Changelog: [Internal]

Reviewed By: tsaichien

Differential Revision: D80740969

fbshipit-source-id: 79565d851bc1b0833931f4fe7fb62d89d3d669ef
2025-09-04 03:06:33 -07:00
Christoph PurrerandFacebook GitHub Bot 5d65794ee4 Don't crash on reload (#53590)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53590

Changelog: [General][Fixed] ReactCxxPlatform] Don't crash on reload

Reviewed By: shwanton

Differential Revision: D81626640

fbshipit-source-id: 31016c67a1913a8be8578848e756e0447b802484
2025-09-03 19:01:15 -07:00
Christoph PurrerandFacebook GitHub Bot 43ad2c0abb Remove contextContainer !=. nullptr check in ImageFetcher (#53574)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53574

Changelog: [Internal]

This field is always non nullptr

Reviewed By: javache

Differential Revision: D81556283

fbshipit-source-id: d75b9cf9730f47c3d2d1ef028c2e738eda3dd785
2025-09-03 15:39:45 -07:00
Pieter De BaetsandFacebook GitHub Bot 9a95e19b36 Simplify BridgelessReactStateTracker (#53577)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53577

Simplify the API to keep all formatting inside of ReactHostStateTracker and remove the `bridgeless` part of the name. Bit more efficient binary-size wise.

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D81445833

fbshipit-source-id: 5bc8bc9e3de326f23e95e01e889b4e2806438c06
2025-09-03 13:51:37 -07:00
Ruslan LesiutinandFacebook GitHub Bot f9cecc5f00 fix: correctly assign name to both begin and end events for measures (#53588)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53588

# Changelog: [Internal]

Since the `name` was already moved for the begin event, there is nothing to be moved for `end` event. Instead, we will be creating a copy for the `begin` event.

This was actually affecting some entries on a timeline, like component triggers (yellow ones).

Reviewed By: vzaidman

Differential Revision: D81589847

fbshipit-source-id: 3b7d801d3429217ce279ed7de41c40c3838a5f37
2025-09-03 10:11:41 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 8d8452173a Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages (#53584)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53584

Reviewed By: rshest

Differential Revision: D81565980

fbshipit-source-id: e9c7eeb3219ee56b693583a6cf8a7905ac360324
2025-09-03 08:12:28 -07:00
generatedunixname89002005287564andFacebook GitHub Bot e41dce3b4e Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages (#53583)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53583

Reviewed By: rshest

Differential Revision: D81575288

fbshipit-source-id: 0315c0ac759799dc9a84e68fa8d957b5547b1682
2025-09-03 07:59:56 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 2cd06ad69a Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages (#53582)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53582

Reviewed By: rshest

Differential Revision: D81567762

fbshipit-source-id: af4e8cc78675b0941a3fb41a7c0eb6f08dc728c1
2025-09-03 07:38:09 -07:00
Christian KruseandFacebook GitHub Bot cc83f6e84a Fix extra semi colon (#53483)
Summary:
Changelog: [Internal]
Fix extra semi colon warning

Pull Request resolved: https://github.com/facebook/react-native/pull/53483

Reviewed By: cortinico, kuwerty

Differential Revision: D81032496

fbshipit-source-id: da7d6f8355fd6ae228033a380d38d677632bafaf
2025-09-03 07:11:08 -07:00
Oskar KwaśniewskiandFacebook GitHub Bot 3a0c402d26 fix(iOS): modal swipe dismissal works only for the first time (#53499)
Summary:
This PR fixes swipe dismissal to work each time the modal is shown. Previously modalInPresentation was set on the view controller which gets destroyed every time user dismisses the modal. This makes sure that modal in presentation is correctly preserved when showing multiple modals.

https://github.com/user-attachments/assets/c7f140e5-1c4f-4809-8453-148d4becc9eb

## Changelog:

[IOS] [FIXED] - modal swipe dismissal works only for the first time

Pull Request resolved: https://github.com/facebook/react-native/pull/53499

Test Plan:
1. Open RN Tester
2. Check allow swipe dismissal
3. Check closing it multiple times

Reviewed By: javache

Differential Revision: D81312918

Pulled By: cipolleschi

fbshipit-source-id: 4f7cc60762660e5d5310f4973fe8df340c1ba52b
2025-09-03 07:07:39 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 87a1b510b7 Fix build with Cocopaods and Dynamic frameworks (#53367)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53367

We are missing a dependency in the React-jsinspector podspec that prevents React Native from building with dynamic frameworks.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D80619664

fbshipit-source-id: 1c87ef4d3614ceea3a23196831479ecae0a5acc8
2025-09-03 06:24:23 -07:00
Pieter De BaetsandFacebook GitHub Bot 2ed6a08ef3 Mark JavaTimerManager idle callback methods as @LegacyArchitecture (#53570)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53570

Idle callbacks are implemented as a C++ module in the new architecture, this code should not be used.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D81485912

fbshipit-source-id: 18103bb96441880ff3de423aa6c03a176f6ff5de
2025-09-03 06:17:35 -07:00
Pieter De BaetsandFacebook GitHub Bot dc54eaebac Decouple TimerExecutor creation from ReactInstance (#53569)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53569

Simplify construction to save a JNI call, slightly more efficient on binary size too (1KiB hah)

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D81445834

fbshipit-source-id: b0ec84d5e04d364e34eef4c3b712c62f878325cf
2025-09-03 06:17:35 -07:00
Phil PluckthunandFacebook GitHub Bot f170db412b Use autolinking react-native-config output in iOS artifacts generator (#53503)
Summary:
Resolves https://github.com/facebook/react-native/issues/53501

This is a pretty major oversight of (presumably) the old autolinking refactor. The iOS autolinking's second stage, invoked in `use_react_native!` does not accept the `react-native-config` sub-command's `react-native-config` output. This is only invoked and used in the prior step, `use_native_modules`.

The second step instead invokes old code that does something _similar_ to the new autolinking in `scripts/generate-artifacts-executor`, and happens to align in most cases. (But it does "autolinking" from scratch). tl;dr: When the results don't match up, things go wrong.

Instead, we now write the autolinking (react native config) results to a file, then read the output back in the second step.

This doesn't affect Android/Gradle, which are implemented correctly.

## Changelog:

[IOS] [FIXED] - Use autolinking-generated react-native-config output in second step of cocoapods linking that generates artifacts and generated source

Pull Request resolved: https://github.com/facebook/react-native/pull/53503

Test Plan:
- See https://github.com/facebook/react-native/issues/53501 for failing repro
- Clone for working repro: https://github.com/byCedric/react-native-codegen-ios-autolinking/tree/fix-54503
  - Note: Contains this PR's changes as a patch
  - `bun install`
  - `bun expo run:ios`

Reviewed By: cortinico

Differential Revision: D81490755

Pulled By: cipolleschi

fbshipit-source-id: eefe786a116404f4ed24bd7125dfb108a811f71e
2025-09-03 05:34:11 -07:00
Samuel SuslaandFacebook GitHub Bot 3895831c2b ship releaseImageDataWhenConsumed (#53576)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53576

## Changelog:

[iOS] [Fixed] - Images are removed from memory more aggressively to prevent OOMs

Reviewed By: rshest

Differential Revision: D81490116

fbshipit-source-id: d6b12af2d80e1c0a9ab3c624a549088b300feb3e
2025-09-03 04:41:32 -07:00
Nicola CortiandFacebook GitHub Bot 9fbce3eff1 Fix build from source for 0.82 due to Gradle 9.0 (#53560)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53560

Since Gradle 9.0, all the projects in the path must have an existing folder.
As we build :packages:react-native:ReactAndroid, we need to declare the folders
for :packages and :packages:react-native as well as otherwise the build from
source will fail with a missing folder exception.

Changelog:
[Android] [Fixed] - Fix build from source due to missing folder error on Gradle 9.0

Reviewed By: fabriziocucci

Differential Revision: D81482789

fbshipit-source-id: 609b503755486e10060a0f321bd0a38bd71864a1
2025-09-03 03:55:49 -07:00
Alex HuntandFacebook GitHub Bot 7aef79bd78 Remove UNSAFE-ALLOW-SUBPATHS exports condition (#53566)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53566

TLDR; we never advertised this and it's not in use. We have an updated incoming plan for exposing internal private code to Expo / other frameworks.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D81490655

fbshipit-source-id: f3d64582f5e6092e4928865d868ea26867ee7e47
2025-09-03 03:05:31 -07:00
Christoph PurrerandFacebook GitHub Bot 9ef0d21344 Pass surfaceId to imageRequest (#53572)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53572

Changelog: [Internal]

Code refactoring to pass actual `surfaceid` to PrefetchResourcesMountItem

Reviewed By: andrewdacenko

Differential Revision: D81506929

fbshipit-source-id: 6c1cb91180cc23930986b258e2a8842560c0851a
2025-09-03 00:07:26 -07:00
Sam ZhouandFacebook GitHub Bot 4365c1c9f7 Cleanup codeless suppressions in xplat/js (#53573)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53573

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D81552699

fbshipit-source-id: 71b104174a8ad7fbf360cdd87109ce034f49ec70
2025-09-02 21:56:09 -07:00
Christoph PurrerandFacebook GitHub Bot f33a1cd260 Android: Schedule image prefetching on tree commit (#53555)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53555

Changelog: [Internal]

## TLDR;
We run the `ReactVitoImageManager.kt` on the Java Message Queue Thread (`mqt`) > Maybe running it on the `UiThread` (as Android view creation) solves the QE reegressions

## Issue
> Your experiment [qe:enable_image_prefetching_android_v4] is significantly moving important metric(s)

T235749297 > e.g negatively impact `sp_core` (Scroll Performance Core)

https://fburl.com/deltoid3/ef2fd92e

{F1981479985}

## Observation

After adding Perfetto traces in D80717558 and building a `automation_fbandroid_art_arm64_for_perftest_profileable` build > I see 'larger amounts' of `experimental_prefetchResource` on the JavaScript Message Queue Thread

 {F1981479808}

We do run this entire logic on the JavaScript Message Queue Thread

https://www.internalfb.com/code/fbsource/[368503303835439955d87d79439a3d19d979cd40]/fbandroid/java/com/facebook/fresco/vito/rn/ReactVitoImageManager.kt?lines=253-260

However when normally `mounting` Shadow Nodes in RN Android we jump from the  JavaScript Message Queue Thread to the Android UI Thread

https://www.internalfb.com/code/fbsource/[68603b276cb9de1ae2ecb83ec4a789ae3db3b051]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp?lines=626%2C638

->

https://www.internalfb.com/code/fbsource/[68603b276cb9de1ae2ecb83ec4a789ae3db3b051]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp?lines=690%2C701%2C872-883

->

https://www.internalfb.com/code/fbsource/[68603b276cb9de1ae2ecb83ec4a789ae3db3b051]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java?lines=897%2C943

->

https://www.internalfb.com/code/fbsource/[68603b276cb9de1ae2ecb83ec4a789ae3db3b051]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java?lines=938-946

## Idea

Run `imagePrefetcher?.prefetchResource` also on the UI thread

## Resources

### :: GDoc
- Image Prefetching for Android https://docs.google.com/document/d/1Yc5G5vuollx0I4tdXpE8Hgwn2DuIhJKwOTHak3g4Gu8/edit?fbclid=IwY2xjawLjgcBleHRuA2FlbQIxMQBicmlkETFra3N5WHg3OGV6UndYUmVTAR5KiXIDgrH2FW4HEBdezFBr2NqX4KPT6FzYQXD1sBRjEfq8d_x0JwQfeL_TXg_aem_ZqWb9dAJ59pHFfoHsrzwbw&pli=1&tab=t.0#heading=h.udv4z3lhwhf7
- React Field of View https://docs.google.com/document/d/1gHLF3oAv9JhKKcztM56iZZUPPWp0mBbjqDlosBkL1kE/edit?tab=t.0#heading=h.36p5puf8ufz7

### :: Fb4A (Facebook for Android)
The debug package name for fb4a `com.facebook.katana` is typically `com.facebook.wakizashi`

### :: Links
- How to Perfetto profile fb4a https://www.internalfb.com/wiki/Luna_Wei/Building_a_fb4a_Profile_Build/
- Building Catalyst Profile Build https://www.internalfb.com/wiki/Luna_Wei/Building_Catalyst_Profile_Build/
- Marketplace QE Regression Guide https://www.internalfb.com/intern/staticdocs/marketplace/performance/my-experiment-is-regressing-perf/
- Install for Profileable build https://www.internalfb.com/wiki/Metatrace/Metatrace-install_for_Profileable_build/
- Metatrace https://www.internalfb.com/wiki/Metatrace/

### Android Java Debug
https://www.internalfb.com/wiki/Platfrom_Health_Learnings/Onboarding_Material_or_New-hired_Engineers/How_to_Debug_FB4A_0/

```
arc focus clean --invalidate-caches-only
arc focus --targets <YOUR_TARGET> --open
```
in this case
```
arc focus --targets fb4a --open
```
It creates a `monoproject` now

 {F1981501090}

Reviewed By: javache

Differential Revision: D80950423

fbshipit-source-id: 5f1c4c096adab218a2d765d262901521bab2e6b3
2025-09-02 17:48:39 -07:00
Tim YungandFacebook GitHub Bot d6ed32f8d6 VirtualView: Configurable Hidden Layout (#53571)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53571

Changes `VirtualView` so that its layout when hidden can be configured by call sites.

Previously, it was hardcoded to only retain the last known height. However, this logic only works for `VirtualView` children oriented in a column layout.

This change enables the use of `VirtualView` in more flexible abstractions that require different hidden styles (e.g. row or grid orientations).

Also, this changes the default behavior to set `minWidth` and `minHeight`, so that the default behavior is more general and more likely to work in a reasonable manner in more use cases.

NOTE: Ideally, we would be able to default to using `flexBasis` instead. However, the `hiddenStyle` function receives a `Rect` and does not know whether the parent's flex direction is row or column to influence whether to use `targetRect.width` or `targetRect.height`. This is an opportunity for future improvement.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D81344126

fbshipit-source-id: 33d9e81601b671059f97b4590816243cbd24734a
2025-09-02 16:28:02 -07:00
Tim YungandFacebook GitHub Bot 1604232e8d VirtualView: Create Experimental Feature Flag (#53533)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53533

Creates a new `enableVirtualViewExperimental` feature flag that determines whether `VirtualView` uses the old or new implementation.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D81340963

fbshipit-source-id: f550fe4e4573e080eb8668077d0ad3ca53cd4d33
2025-09-02 16:28:02 -07:00
generatedunixname537391475639613andFacebook GitHub Bot c1320eb2e1 xplat/js/react-native-github/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt (#53559)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53559

Reviewed By: cortinico

Differential Revision: D81476261

fbshipit-source-id: f3f38664a7dc63a11b027ab2b6a5a65ca374ebaa
2025-09-02 14:58:53 -07:00
Oskar KwaśniewskiandFacebook GitHub Bot 05c4321b19 fix: fallback alert controller to UIScreen size (#53500)
Summary:
This PR falls back to UIScreen when windowScene is not available.

<img width="500" alt="CleanShot 2025-08-28 at 14 30 59@2x" src="https://github.com/user-attachments/assets/9dda3153-dfe7-48a5-9d0e-5416c2e34c64" />

## Changelog:

[IOS] [FIXED] - Simplify RCTAlertController, don't create additional UIWindow

Pull Request resolved: https://github.com/facebook/react-native/pull/53500

Test Plan:
Open the alert multiple times to check if everything works as expected.

Rollback Plan:

Reviewed By: javache

Differential Revision: D81410450

Pulled By: cipolleschi

fbshipit-source-id: c27ea98d9e811c2f259f0ff3c6689482d116c418
2025-09-02 11:19:42 -07:00
Christoph PurrerandFacebook GitHub Bot 61deab7f94 Add feature flag to trigger Android image prefetch request on the UI thread (#53554)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53554

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D81468680

fbshipit-source-id: 9da40feaf90756645d2aed5c051dc137d7a90534
2025-09-02 10:44:59 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot e1071ce683 Clean up legacy CSSBackgroundDrawable.java and enablNewBackgroundAndBorderDrawables featureflag (#53534)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53534

BackgroundDrawable and BorderDrawable have already substituted CSSBackgroundDrawable en every Android surface.
- Deleting CSSBackgroundDrawable.java and its callsites
- Deleting enableNewBackgroundAndDrawable featureflag

Just cleaning up what at this point is just dead code.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D81330969

fbshipit-source-id: bcf66ec8d3225802432ae1d93a2b26ea65cfcda0
2025-09-02 10:19:57 -07:00
generatedunixname537391475639613andFacebook GitHub Bot b2b992c5bb xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt (#53545)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53545

Reviewed By: cortinico

Differential Revision: D81428987

fbshipit-source-id: 7bd04528384bd96f659cf969806d367296665d97
2025-09-02 08:11:47 -07:00
Zeya PengandFacebook GitHub Bot 716cbae68d support ObjectAnimatedNode (#53517)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53517

## Changelog:

[Internal] [Added] - support ObjectAnimatedNode

Reviewed By: christophpurrer, fabriziocucci

Differential Revision: D81260836

fbshipit-source-id: 82bdda59d54140189684003adfb1adf5c8e2904d
2025-09-02 07:06:09 -07:00
Vitali ZaidmanandFacebook GitHub Bot 5128d35e69 changelog/v0.82.0-rc.0 (#53562)
Summary:
Changelog: [Internal] changelog for v0.82.0-rc.0

Pull Request resolved: https://github.com/facebook/react-native/pull/53562

Reviewed By: fabriziocucci, cortinico

Differential Revision: D81483668

Pulled By: vzaidman

fbshipit-source-id: 6f044ce9918f147d981f87c9988e27600cac0ab7
2025-09-02 06:11:26 -07:00
Nick LefeverandFacebook GitHub Bot 8f0713fd4b Add test for empty layout culling skip (#53551)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53551

See title.

Follow up on D81044841

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D81447133

fbshipit-source-id: 7e6ca4523401c30c4861606c795f306193d97a15
2025-09-02 03:25:54 -07:00
Vitali ZaidmanandFacebook GitHub Bot 6e47c953d3 fix release script testing artifact for rntester (#53552)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53552

Changelog: [Internal]

Reviewed By: fabriziocucci, cortinico, hoxyq

Differential Revision: D81452967

fbshipit-source-id: 3032b49b6c7fd49901b8f47886084c98479b368f
2025-09-02 03:01:57 -07:00
Phil PluckthunandFacebook GitHub Bot 9731e8ebc5 Replace execSync with spawnSync for tarball extraction paths that need to be escaped (#53540)
Summary:
Follow-up to https://github.com/facebook/react-native/issues/53194

This wasn't previously visible in testing without prebuilds and without a release build. This doesn't show up in debug builds.

When testing more against paths that contain spaces, I noticed that release builds can still run into trouble due to the use of `execSync` without escaping paths. While, in other scripts that aren't used in user-projects (afaict), we often escape with quotes and rely on `execSync` calling the shell (due to its `shell: true` default), in some scripts we don't have quote escapes.

That said, since paths could in theory contain quotes, adding quotes wouldn't be sufficient. Instead, since the affected `tar` calls are really trivial, we can instead use `spawnSync` with the `shell: false` default, which escapes arguments automatically.

## Changelog:

[IOS] [FIXED] - fix Node scripts related to prebuilt tarball extraction for paths containing whitespaces

Pull Request resolved: https://github.com/facebook/react-native/pull/53540

Test Plan: - Create a project in a folder `with spaces` and build a release build

Reviewed By: cipolleschi, cortinico

Differential Revision: D81406841

Pulled By: robhogan

fbshipit-source-id: 08bb06b2cd2b15dc17c2f95fab9024129deca6f3
2025-09-01 13:32:10 -07:00
Rubén NorteandFacebook GitHub Bot 727caca09c Set up modern performance APIs if the native module is available (#53431)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53431

Changelog: [internal]

This renames `setUpPerformanceObserver` as `setUpPerformanceModern` and removes the need to call it manually. If the native module is defined, we define the whole new API.

Reviewed By: javache

Differential Revision: D80803626

fbshipit-source-id: ef41cb9aa959ee898d32724c102d7597e6bee84e
2025-09-01 09:18:19 -07:00
Rubén NorteandFacebook GitHub Bot 1716b3ca5c Implement private constructors for Performance APIs (#53430)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53430

Changelog: [internal]

This fixes the spec-compliance of several classes in the Performance API by not allowing userland code to instantiate them directly.

This also exposes some missing interfaces from the Performance API in the global scope.

Reviewed By: rshest

Differential Revision: D80800076

fbshipit-source-id: f6439b9c7914817ef552e78fd61646ccab1e1de2
2025-09-01 09:18:19 -07:00
Rubén NorteandFacebook GitHub Bot bb508a4d94 Refactor PerformanceEntry and subclasses to use interfaces for initialization (#53429)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53429

Changelog: [internal]

This is a refactor of the types in `PerformanceEntry` and subclasses to accept interfaces instead of objects. This allows us to pass down the init object from subclasses to the superclass without having to create intermediate objects.

Additionally, this is also more semantically correct, as existing APIs don't need those options to be own properties of the init object.

Existing benchmark for Performance doesn't show any significant impact.

Reviewed By: rshest

Differential Revision: D80800075

fbshipit-source-id: ab439d70f4db9ce60e3089d89ccb105a91e7ef48
2025-09-01 09:18:19 -07:00
Rubén NorteandFacebook GitHub Bot 81f8b0a6bf Implement PerformanceObserver.takeRecords() (#53428)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53428

Changelog: [internal]

This is the last method in `PerformanceObserver` to implement. For some reason we never added it, even though it was trivial.

Reviewed By: rshest

Differential Revision: D80717237

fbshipit-source-id: ae3bd243d0f3f0fe4f0705437d78d14c532515f7
2025-09-01 09:18:19 -07:00
Rubén NorteandFacebook GitHub Bot 8ed0fa8dda Remove unnecessary references to internal types in performance tests (#53427)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53427

Changelog: [internal]

Migrate the imported types to the globally defined ones, so we follow the good practice of only accessing the public API in Fantom tests.

Reviewed By: rshest

Differential Revision: D80807160

fbshipit-source-id: 77d792b56b53c8da8409dd9133cd111afb8084f1
2025-09-01 09:18:19 -07:00
Rubén NorteandFacebook GitHub Bot 05be3742d4 Define Flow types for Performance APIs (#53433)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53433

Changelog: [internal]

This adds the definitions for the Web Performance APIs in the global scope.

Reviewed By: zeyap

Differential Revision: D80811659

fbshipit-source-id: a81117a27a480ba03f8feb2e813a3a66a10307f9
2025-09-01 09:18:19 -07:00
Alex HuntandFacebook GitHub Bot 0a0b48b5ff Expose ListViewToken type as root export (#53539)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53539

Resolves https://github.com/react-native-community/discussions-and-proposals/discussions/893#discussioncomment-14190663.

Changelog:
[General][Added] - `ListViewToken` is now exposed when using `"react-native-strict-api"`

Reviewed By: rshest

Differential Revision: D81380882

fbshipit-source-id: 1da5c50eaec2f8dc4a8cde60e7441249556053a8
2025-09-01 08:39:22 -07:00
Pieter De BaetsandFacebook GitHub Bot 46278e30e3 Dedupe Accessibility enum string conversions (#53550)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53550

Noticed some duplication between `getDiffProps` and `accessibilityPropsConversion`

Changelog: [Internal]

Reviewed By: lenaic, rshest

Differential Revision: D81435037

fbshipit-source-id: b2701f1aec5e647c165a0212f6180edba90fd9f9
2025-09-01 08:38:27 -07:00
Ruslan LesiutinandFacebook GitHub Bot e64dce582a Set threshold for a number of unique nodes in ProfileChunk (#53536)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53536

# Changelog: [Internal]

For every chunk, we already have a threshold for the number of samples captured in this chunk.

There could be really tall call stacks, where we could record hundreds of unique nodes, which makes the chunk already big enough for a CDP traffic on android.

We are adding a threshold for a number of unique nodes in a single chunk. If the chunk has a greater number of nodes recorded, it will be dispatched over CDP.

Reviewed By: huntie

Differential Revision: D81339677

fbshipit-source-id: 388d14c64c4c3f60918a8526025f79d19d397cb4
2025-09-01 07:12:55 -07:00
Ruslan LesiutinandFacebook GitHub Bot 8eea1660f4 Add support for recording Runtime Profiles for multiple JavaScript threads (#53535)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53535

# Changelog: [Internal]

This primarily addressed the case when we have captured a Runtime Profile during the app startup. The Hermes Runtime is created on the main thread, so the first few samples will be recorded there, but then it will be moved to JavaScript thread.

Reviewed By: huntie

Differential Revision: D81339676

fbshipit-source-id: 8202ca03df54134330aa921a9a0a97816c51cea5
2025-09-01 07:12:55 -07:00
Pieter De BaetsandFacebook GitHub Bot bae99efc26 Add test for aria-hidden to View (#53548)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53548

Add tests to View similar to D81043503, and clarify why `accessibilityElementsHidden` does not show up in the rendered component tree (because Fantom uses the Android platform for bundling, and Android does not have accessibilityElementsHidden in its BaseViewConfig.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D81437063

fbshipit-source-id: aa10573aee686d1d650b152365607877f34f8508
2025-09-01 06:31:04 -07:00
Maciej JastrzębskiandFacebook GitHub Bot 0f39fc3000 fix(a11y): aria-hidden support for Text, non-editable TextInput and Image (#53364)
Summary:
Fixes https://github.com/facebook/react-native/issues/53350

This PR adds support for missing `aria-hidden` prop handling on:
- `Text`
- non-editable `TextInput`
- `Image`

The changes are pretty simple and analogous to `View` logic:
- iOS: setting `accessibilityElementsHidden`, `accessible` (for `Image`)
- Android: setting `importantForAccessibility="no-hide-descendents"

Note: [according to MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-hidden) `aria-hidden` should not be used on focusable elements, which excludes editable `TextInput`

## Changelog:

[GENERAL] [FIXED] `aria-hidden` support for `Text`, non-editable `TextInput` and `Image`

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/53364

Test Plan:
Added new section to RN Tester (APIs => Accessibility => aria-hidden

### After (iOS/Android)

https://github.com/user-attachments/assets/c62f8beb-7cb1-4919-833d-3fb906309cac

https://github.com/user-attachments/assets/78ca5e28-a858-4fd6-ac1c-5ec87872f3fc

### Before (iOS/Android)

https://github.com/user-attachments/assets/84560373-4b31-4793-8997-ee14daa77990

https://github.com/user-attachments/assets/b20074c9-f021-4a90-bce5-75e440a4bbc3

Reviewed By: rshest

Differential Revision: D81043503

Pulled By: javache

fbshipit-source-id: 26b2660a75afcdedba07bee980d8c7f154087ae2
2025-09-01 06:05:43 -07:00
Nicola CortiandFacebook GitHub Bot 2246e2b82c Fix wrong default for jsBundleAssetPath on DefaultReactHost (#53546)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53546

The default for `DefaultReactHost.getDefaultReactHost(...,jsBundleAssetPath,...)` is wrong.
The default should be `index.android.bundle`.

That's the same value we had for the same field in ReactNativeHost:
https://www.internalfb.com/code/fbsource/[76a814c7d27036f7056c9f2c7e1370746ed4ccd4]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java?lines=225-227

Having just `index` as default cause the app to instacrash on release because the bundle can't be found.

Reviewed By: fabriziocucci

Differential Revision: D81435921

fbshipit-source-id: ea871f771fd61e9d838a800e988f2edc308ec8ea
2025-09-01 04:49:17 -07:00
Moti ZilbermanandFacebook GitHub Bot 529fd97c62 Changelog for 0.81.1 (#53527)
Summary:
Changelog:
[Internal]

TSIA

Pull Request resolved: https://github.com/facebook/react-native/pull/53527

Reviewed By: cortinico

Differential Revision: D81312343

Pulled By: motiz88

fbshipit-source-id: 37cb37002d4af0c851416d6b8a0ac310153bd68e
2025-09-01 03:13:42 -07:00
Alex HuntandFacebook GitHub Bot 024d25794a Expose Animated.CompositeAnimation type (#53538)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53538

Resolves https://github.com/react-native-community/discussions-and-proposals/discussions/893#discussioncomment-14190598.

Changelog:
[General][Added] - `Animated.CompositeAnomation` is now exposed when using `"react-native-strict-api"`

Reviewed By: rshest

Differential Revision: D81380950

fbshipit-source-id: f90f175cfd6f34c6a9564a8e340156103887d710
2025-09-01 02:57:25 -07:00
Christoph PurrerandFacebook GitHub Bot 544f3b345d Android: Schedule image prefetching on tree commit (#53491)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53491

Changelog: [Internal]

Reviewed By: lenaic, cipolleschi

Differential Revision: D81106112

fbshipit-source-id: b06643312836bd018bfc9a1565b76976cd55dac9
2025-08-31 08:32:54 -07:00
Alex HuntandFacebook GitHub Bot 83e19813ff Deprecate StyleSheet.absoluteFillObject (#53530)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53530

Deprecate the `StyleSheet.absoluteFillObject` API in favour of `StyleSheet.absoluteFill` (functionally identical).

Secondly, refine the type definitions in our source code (and Strict TS API) from `any` → `AbsoluteFillStyle` — resolves https://github.com/facebook/react-native/issues/53470.

This will be followed with updates to our docs.

Changelog:
[General][Deprecated] - `StyleSheet.absoluteFillObject` is deprecated in favor of `StyleSheet.absoluteFill` (equivalent).

Reviewed By: yungsters

Differential Revision: D81327548

fbshipit-source-id: 2bcf14694dc1bd959419629ce717760086b80ec3
2025-08-30 03:58:51 -07:00
Christoph PurrerandFacebook GitHub Bot e30f34eda6 Android: Image Prefetching send ImageResizeMode as enum value (#53516)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53516

Changelog: [General][Breaking] Android: Image Prefetching send ImageResizeMode as enum value

Idea: Reduce JNI payload by sending int values instead of strings

Reviewed By: lenaic

Differential Revision: D81252246

fbshipit-source-id: 7ba128725900422f8654b3019014fd49ec8152b6
2025-08-29 22:33:49 -07:00
generatedunixname537391475639613andFacebook GitHub Bot d1c5dae2e6 xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewShadowNode.cpp (#53525)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53525

Reviewed By: rshest

Differential Revision: D81217006

fbshipit-source-id: 8c156b24438f8427a5ce953ebdcdf7d223bf1b60
2025-08-29 22:25:30 -07:00
Intl SchedulerandFacebook GitHub Bot d3574313c8 translation auto-update for batch 0/60 on master
Summary:
Chronos Job Instance ID: 1125907998678314
Sandcastle Job Instance ID: 36028799140146546

Processed xml files:
android_res/com/facebook/common/util/res/values/strings.xml
android_res/com/oculus/auth/authenticator/meta/res/values/strings.xml
android_res/com/oculus/os/q4b/mma/res/values/strings.xml
android_res/com/oculus/horizon/common/res/values/strings.xml
android_res/com/oculus/horizon/platformplugin/res/values/strings.xml
android_res/com/oculus/horizon/try_before_you_buy/res/values/strings.xml
android_res/com/oculus/horizon/mediaupload/res/values/strings.xml
android_res/com/oculus/horizon/linkedaccounts/res/values/strings.xml
android_res/com/oculus/auth/authenticator/work/res/values/strings.xml
android_res/com/oculus/auth/authenticator/oculus/res/values/strings.xml
android_res/com/oculus/auth/authenticator/instagramsso/res/values/strings.xml
android_res/com/oculus/auth/authenticator/horizonworldsplatform/res/values/strings.xml
android_res/com/oculus/auth/authenticator/facebooksso/res/values/strings.xml
android_res/com/oculus/auth/authenticator/facebook/res/values/strings.xml
android_res/com/oculus/demoapp/res/values/strings.xml
apps/fblite/xMob-android/scripts/strings/values/strings.xml
apps/fblite/xMob-android/res/values/strings.xml
android_res/com/facebook/resources/res/values/strings.xml
android_res/com/facebook/liblite/res/values/strings.xml
android_res/com/facebook/iorg/common/upsell/res/values/strings.xml
android_res/com/facebook/iorg/common/res/values/strings.xml
android_res/com/facebook/iorg/lib/res/values/strings.xml
android_res/com/facebook/iorg/app/res/values/strings.xml
android_res/rendercore/res/values/strings.xml
android_res/com/facebook/content/res/values/strings.xml
../xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values/strings.xml
../xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/res/systeminfo/values/strings.xml
../xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/res/devsupport/values/strings.xml
android_res/com/facebook/common/i18n/res/values/strings.xml
android_res/com/facebook/common/timeformat/res/values/strings.xml
android_res/com/facebook/common/strings/external/res/values/strings.xml
android_res/com/facebook/common/strings/res/values/strings.xml
android_res/com/facebook/fbui/widget/pagerindicator/res/values/strings.xml
android_res/com/facebook/fbui/widget/contentview/res/values/strings.xml
android_res/com/facebookpay/widget/res/values/strings.xml
android_res/com/facebookpay/ecpexception/res/values/strings.xml
android_res/com/facebookpay/expresscheckout/res/values/strings.xml
android_res/com/fbpay/auth/res/values/strings.xml
android_res/com/facebook/widget/res/values/strings.xml
android_res/com/facebook/config/appspecific/res/values/strings.xml
android_res/com/facebook/ui/mainview/res/values/strings.xml
android_res/com/facebook/audience/stories/storysurface/activity/main/res/values/strings.xml
android_res/com/facebook/ui/emoji/res/values/strings.xml
android_res/com/facebook/ui/emoji/common/res/values/strings.xml
android_res/com/facebook/nativetemplates/res/values/strings.xml
android_res/com/facebook/dialtone/res/values/strings.xml
android_res/com/facebook/zero/messenger/semi/res/values/strings.xml
android_res/com/facebook/zero/res/values/strings.xml
android_res/com/facebook/zero/common/res/values/strings.xml
android_res/com/facebook/widget/facepile/res/values/strings.xml
android_res/com/facebook/tabbar/res/values/strings.xml
android_res/com/facebook/ui/toolbar/res/values/strings.xml
android_res/com/facebook/dialtone/messenger/res/values/strings.xml
android_res/com/facebook/feedback/reactions/res/values/strings.xml
android_res/com/facebook/ufiservices/res/values/strings.xml
android_res/com/facebook/ui/edithistory/res/values/strings.xml
android_res/com/facebook/pages/common/userinviter/res/values/strings.xml
android_res/com/facebook/pages/common/bannedusers/res/values/strings.xml
android_res/com/facebook/friending/common/res/values/strings.xml
android_res/com/facebook/messaging/ui/stickerstore/res/values/strings.xml
android_res/com/facebook/stickers/res/values/strings.xml
android_res/com/facebook/messaging/shared/res/values/strings.xml
android_res/com/facebook/caspian/res/values/strings.xml
android_res/com/facebook/timeline/widget/actionbar/res/values/strings.xml
android_res/com/facebook/showpages/res/values/strings.xml
android_res/com/facebook/nux/res/values/strings.xml
android_res/com/facebook/facecast/common/badge/res/values/strings.xml
android_res/com/facebook/feedbase/res/values/strings.xml
android_res/com/facebook/feedback/ui/res/values/strings.xml
android_res/com/facebook/video/player/res/values/strings.xml
android_res/com/facebook/spherical/res/values/strings.xml
android_res/com/facebook/saved/common/res/values/strings.xml
android_res/com/facebook/video/comments/res/values/strings.xml
android_res/com/facebook/messaging/media/picker/res/values/strings.xml
android_res/com/facebook/messaging/media/res/values/strings.xml
android_res/com/facebook/messaging/res/values/strings.xml
android_res/com/facebook/ui/media/contentsearch/res/values/strings.xml
android_res/com/facebook/transliteration/res/values/strings.xml
android_res/com/facebook/bookmark/res/values/strings.xml
android_res/com/facebook/orca/res/values/strings.xml
android_res/com/facebook/workshared/userstatus/donotdisturb/res/values/strings.xml
android_res/com/facebook/widget/tokenizedtypeahead/res/values/strings.xml
android_res/com/facebook/widget/refreshableview/res/values/strings.xml
android_res/com/facebook/rtc/common/res/values/strings.xml
android_res/com/facebook/payments/ui/res/values/strings.xml
android_res/com/facebook/fig/mediagrid/res/values/strings.xml
android_res/com/facebook/pages/app/clicktomessengerads/messagesuggestion/ui/res/values/strings.xml
android_res/com/facebook/messagingneue/res/values/strings.xml
android_res/com/facebook/messaging/widget/toolbar/res/values/strings.xml
android_res/com/facebook/messaging/users/username/res/values/strings.xml
android_res/com/facebook/messaging/tincan/messenger/res/values/strings.xml
android_res/com/facebook/messaging/threadview/quickpromotion/res/values/strings.xml
android_res/com/facebook/messaging/threadview/message/res/values/strings.xml
android_res/com/facebook/messaging/threadview/games/res/values/strings.xml
android_res/com/facebook/messaging/xma/res/values/strings.xml
android_res/com/facebook/messaging/threadview/admin/res/values/strings.xml
android_res/com/facebook/messaging/reactions/res/values/strings.xml
android_res/com/facebook/messaging/threadview/attachment/video/res/values/strings.xml
android_res/com/facebook/messaging/settings/res/values/strings.xml
android_res/com/facebook/messaging/searchnullstate/res/values/strings.xml

allow-large-files
ignore-conflict-markers
opt-out-review
drop-conflicts

Differential Revision: D81370215

fbshipit-source-id: 3263546330d3930944d0666759960859918c4a7e
2025-08-29 18:51:42 -07:00
Ramanpreet NaraandFacebook GitHub Bot 9539cd2626 both: Deprecate c++ legacy core classes (#53454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53454

Let's deprecate all the classes that aren't used by interop or the new architecture.

Changelog: [General][Deprecated] - Deprecate all the c++ classes not used by interop, or the new architecture.

Reviewed By: arushikesarwani94

Differential Revision: D80575767

fbshipit-source-id: 1d485300cbe24260d77bbeac75fe5b839121b6c8
2025-08-29 17:54:23 -07:00
Chi TsaiandFacebook GitHub Bot 028e582043 Make jsi::Object constructor explicit (#53521)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53521

Make `jsi::Object` constructor explicit, so its creation is explicit and
intentional. This prevents any sad foot-gun of constructing an Object
implicitly from a Runtime, which is certainly not a JS object.

Changelog: [Internal]

Reviewed By: avp

Differential Revision: D81274439

fbshipit-source-id: 5a9d9907f9deff7625dcff9c1072eb135ab7840e
2025-08-29 12:46:38 -07:00
Alan LeeandFacebook GitHub Bot 1ad2ec099a replace getWindowDisplayMetrics with getScreenDisplayMetrics (#53523)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53523

update `DisplayMetricsHolder.getWindowDisplayMetrics()` to `getScreenDisplayMetrics()`.

Where window width and height is not needed, prefer to use `screenDisplayMetrics` as with upcoming diff `windowDisplayMetrics` initialization only happen using UiContext and have potential to cause more issues if used unnecessarily.

Changelog: [Internal] Update `DisplayMetricsHolder.getWindowDisplayMetrics()` to use `.getScreenDisplayMetrics()`

 ---

Reviewed By: mlord93

Differential Revision: D81270196

fbshipit-source-id: 5b392d67449ddceebbc0fe81db15fa61ae44108f
2025-08-29 12:21:57 -07:00
Alex HuntandFacebook GitHub Bot a4581ecd8b Fix/simplify invariant for ColorSchemeName, align manual typedef (#53397)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53397

This is a runtime behaviour fix and an API change to `Appearance.setColorScheme`, motivated by a user report where providing `'unspecified'` (valid) to this function would trigger an incorrect invariant throw. Furthermore, there is already a [first party use](https://github.com/facebook/react-native/blob/aec35b896053d9372ccdaf67c939b2eb216d3455/packages/react-native/Libraries/Utilities/Appearance.js#L101) where we call `Appearance.setColorScheme('unspecified')`.

**Changes**

- `Appearance.d.ts` (current public API, manual types): Fix `ColorSchemeName` type to include `'unspecified'` value, and narrow to remove nullability — aligning with existing Flow source for this type in `NativeAppearance`.
- `Appearance.js` (implementation): Fix the invariant throw by **removing it**, and instead narrowing the input type to non-nullable. Redundant work in `getState` and `getColorScheme` is removed.

Changelog: [General][Breaking] `Appearance.setColorScheme` no longer accepts a nullable value

Reviewed By: andrewdacenko

Differential Revision: D80705652

fbshipit-source-id: cf221a33447606653050d471ca2d0347ab30db81
2025-08-29 11:42:14 -07:00
Andrew DatsenkoandFacebook GitHub Bot b7e64bea29 Ignore unusually early timestamps (#53514)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53514

Changelog: [Internal]
Add a way to ignore unusually early timestamps, in our example those are artificial marks to create web tracks in correct order, coming from console.timeStamp via React. These markers are ignore in RNDT on Chrome, but not excluded in perfetto.

Reviewed By: hoxyq

Differential Revision: D81246527

fbshipit-source-id: d3342036698d1607c98e5bb4273ea1a3716fcb03
2025-08-29 11:30:34 -07:00
Christoph PurrerandFacebook GitHub Bot 0121208a96 Simplify ImageRequest conversion (#53492)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53492

Changelog: [Internal]

Goal is to simplify code and to lower the JNI payload

- Send values as `int` instead of `Double` if they are converted to `int` on the Java side
- We only have 2 optional values - all others are mandatory

Reviewed By: lenaic

Differential Revision: D81202196

fbshipit-source-id: df8b7d9e6a98e7c919de9be6a277876684f0383c
2025-08-29 10:03:16 -07:00
Sam ZhouandFacebook GitHub Bot 6c7c518d42 Turn on experimental.natural_inference.local_object_literals.followup_fix in xplat (#53528)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53528

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D81289138

fbshipit-source-id: 05e2f5ad337f616a92df97ea52af8891448e122f
2025-08-29 06:25:57 -07:00
generatedunixname537391475639613andFacebook GitHub Bot 8f8d6f0689 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.kt (#53524)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53524

Reviewed By: rshest

Differential Revision: D81210918

fbshipit-source-id: 9c68952d658b846194fbcb0ccf79d3dc6878ef2b
2025-08-29 03:36:29 -07:00
Devan BuggayandFacebook GitHub Bot 52937337c3 Remove legacy perf overlay from DevMenu (#53328)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53328

Disables the legacy performance overlay toggle from the Android DevMenu to make way for V2.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D79791703

fbshipit-source-id: c99ac95e2907ce978ef0c2711ad304c9a3f278ec
2025-08-29 03:14:56 -07:00
Devan BuggayandFacebook GitHub Bot 6a0b9d135d Add Analyze Performance option to DevMenu (#53334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53334

Adds background performance tracing options to the DevMenu based on the current background tracing state. Analyzing a trace will automatically open dev tools, navigate to the performance tab, and show the last 20 seconds of recorded performance data.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D79714164

fbshipit-source-id: 72ad4be4604c5f4e304b49877b2699be36562655
2025-08-29 03:14:56 -07:00
generatedunixname1395667395051502andFacebook GitHub Bot 84472d9ebc Update React Native DevTools binaries
Summary:
Automated update of React Native DevTools binaries
bypass-github-export-checks
Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D81253369

fbshipit-source-id: fa6c5fca5e865c787434c1466574aad5acc15a61
2025-08-29 02:11:12 -07:00
Pieter De BaetsandFacebook GitHub Bot b02251e7f5 Simplify RawValue container type checks (#53508)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53508

Simplify the expressions for checking a type of a container by always returning instead of falling through and returning.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D81230049

fbshipit-source-id: 02fd827462c9acf05a83bf88ed6bd0e6db55ebc8
2025-08-29 00:49:21 -07:00
Pieter De BaetsandFacebook GitHub Bot a44c5a0dbf Use uint32_t as internal Color representation (#53507)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53507

We need this to be an unsigned value everywhere but all the API's and interfaces described this a signed number. While this doesn't make a difference in practice, it's better to explicit.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D81230050

fbshipit-source-id: 1eb914a79b9b94654cfa54c20a81ce689f79dcb9
2025-08-29 00:49:21 -07:00
Christoph PurrerandFacebook GitHub Bot 5858c8309d Don't prefetch Android res images with int ids (#53493)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53493

Changelog: [Internal]

Don't prefetch local images shipped with the app

Reviewed By: lenaic

Differential Revision: D81200872

fbshipit-source-id: 8578b1be2d92e88a618dac5f2a27ba7c4484fa88
2025-08-28 23:31:24 -07:00
Christoph PurrerandFacebook GitHub Bot a2c6a3e246 Preparation to prefetch image requests in batch mode (#53490)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53490

Changelog: [Internal]

Sending individual image prefetch request on Android over JNI is causing measurable performance regression. The idea here is batch all image prefetch request for a given shadowNodeTree and then flush it all at once - **DONE** in the next change.

Another optimization we should consider is to execute the batch on `n imagePrefetchRequest` off the JavaScript thread `mqt_v_js` and instead on e.g. the UiThread (on which currently Android Image UI initiates image resource downloads)

Reviewed By: lenaic

Differential Revision: D81186916

fbshipit-source-id: f8b24e70f2ded237be96bdb973b72acbbb8b1c20
2025-08-28 21:03:56 -07:00
Chi TsaiandFacebook GitHub Bot b2d25c8731 Add Value override for has/get/setProperty (#52910)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52910

For `get/has/setProperty`, we should also be able to take in a generic
JS Value as the property key. This change adds the Value overload for
these APIs.

The default implementation will use `Reflect.get`, `Reflect.has`, and
`Reflect.set`.

Changelog: [Internal]

Reviewed By: lavenzg

Differential Revision: D79120823

fbshipit-source-id: 7e2e5ff1ca93397c549e7dd922797fe77aa97940
2025-08-28 19:21:27 -07:00
Tim YungandFacebook GitHub Bot f06f9c9be6 RN: Remove Feature Flag Override Argument (#53513)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53513

D62853299 introduced the `defaultValue` argument to feature flag override functions, with the intent of enabling override functions to do something like this:

```
myFeatureFlag: (defaultValueForFlag) => someCondition ? value : defaultValueForFlag
```

However, there are no current use cases for this. This particular use case can also be solved by expanding support for override functions to return `null` or `undefined` which falls back to using the default value.

Furthermore, the type system has a difficult time representing the constraints when there are non-boolean JavaScript-only overrides (which was introduced recently).

This diff removes the argument and adds support for override functions to return `null` or `undefined`.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D81163557

fbshipit-source-id: 38876c83d51d857dbea889928248410041c5d6d7
2025-08-28 14:48:25 -07:00
Luna WeiandFacebook GitHub Bot 41a1467db3 Fix VirtualViewExperimental alignment for empty cases (#53519)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53519

Changelog: [Internal] - Remove empty checks on the target rects and early return for empty ScrollView rects -- aligning the implementation with v1 of VirtualView

Reviewed By: yungsters

Differential Revision: D81247994

fbshipit-source-id: 4fda9f90e18d736944fe4236a4b79f0681e1564c
2025-08-28 14:34:49 -07:00
Luna WeiandFacebook GitHub Bot 09be5d91c6 Listen to onSizeChanged and update debugLogs (#53518)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53518

Changelog: [Internal] - Listen to `onSizeChanged` for VirtualViewExperimental and VirtualViewContainer (ScrollView) and add more debug logs and format the virtualViewID consistently for easier grepping

Reviewed By: yungsters

Differential Revision: D81184013

fbshipit-source-id: a4314ab0f94a87e97a7d9b74696726803525c698
2025-08-28 14:34:49 -07:00
Christoph PurrerandFacebook GitHub Bot 0808af3724 Use RuntimeSchedulerKey instead of stringly typed name (#53509)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53509

Changelog : [Internal]

Reviewed By: lenaic

Differential Revision: D81206776

fbshipit-source-id: e71842e50da71ff27fbcd37faf28d883ec0f809a
2025-08-28 14:07:40 -07:00
Joe VilchesandFacebook GitHub Bot dae87c484e Use designated initializer list in ScrollViewShadowNode (#53512)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53512

Noticed a lint for this so decided to change

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D81159958

fbshipit-source-id: c0b4b73055de26ea089e3cdb4edb7f073bd751d5
2025-08-28 13:26:26 -07:00
Alex HuntandFacebook GitHub Bot 9dba7112cf Consolidate API changes to openDebugger (#53502)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53502

Follows D81138169.

- This simplifies the total changes needed on implementing DevSupport classes.
- Widen outer API to accept any `String` panel name (futureproofing).
- Also add a complete set of supported values `DebuggerFrontendPanelName`.

Changelog:
[Android][Changed] - DevSupport `openDebugger()` methods now accept a `panel: String?` param. Frameworks directly implementing `DevSupportManager` will need to adjust call signatures.

Reviewed By: hoxyq, cortinico

Differential Revision: D81227870

fbshipit-source-id: 57b73703557971332e05076fb4ccac218079652a
2025-08-28 11:32:13 -07:00
Moti ZilbermanandFacebook GitHub Bot 9d3bcb4404 Auto-hide main menu on Windows/Linux (#53511)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53511

Changelog: [Internal]

TSIA

Reviewed By: huntie

Differential Revision: D81237715

fbshipit-source-id: 79dac7424e925539ba39706710c743c22d094976
2025-08-28 11:14:59 -07:00
Ramanpreet NaraandFacebook GitHub Bot 5e80d5c76f ios: Deprecate legacy core components (#53455)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53455

All these components have fabric replacements.

Let's deprecate them, so we can remove them eventually.

Changelog: [iOS][Deprecated] Deprecate all the legacy core components that have replacement implementations in fabric.

Reviewed By: cipolleschi

Differential Revision: D80973216

fbshipit-source-id: 2b20da0800f099244b4813abf9d8af175627a445
2025-08-28 11:13:17 -07:00
Ramanpreet NaraandFacebook GitHub Bot 70f53ac4ea ios: Deprecate objc legacy core classes (#53453)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53453

Let's deprecate all the classes that aren't used by interop, or the new architecture.

Changelog: [iOS][Deprecated] Deprecate all the objc classes not used by interop, or the new architecture.

Reviewed By: javache

Differential Revision: D80575768

fbshipit-source-id: ad12e4b639c21d608636eedbc7cd502fa9d7f461
2025-08-28 11:13:17 -07:00
Tiangong LiandFacebook GitHub Bot 79f0466b45 Suppress a kotlin 2.2.0 bug of IDENTITY_SENSITIVE_OPERATIONS_WITH_VALUE_TYPE (#53489)
Summary:
Changelog: [Internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/53489

For error
```
Identity-sensitive operation on an instance of value type 'Int?' may cause unexpected behavior or errors.
```
due to https://youtrack.jetbrains.com/issue/KT-78352/

Reviewed By: cortinico

Differential Revision: D81174630

fbshipit-source-id: c68e3a348e75b7bceb183b77a45b2729f1e70bcd
2025-08-28 10:58:59 -07:00
generatedunixname537391475639613andFacebook GitHub Bot 0e1b1ad469 xplat/js/react-native-github/packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/internal/PrepareGlogTaskTest.kt (#53506)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53506

Reviewed By: javache

Differential Revision: D81222404

fbshipit-source-id: 514cbe3689a6e71d08266cdab33b8f84f318c118
2025-08-28 10:48:59 -07:00
Moti ZilbermanandFacebook GitHub Bot d1a99907cb Work around Electron Windows command-line args quirk (#53510)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53510

Changelog: [Internal]

Electron imposes a [strange undocumented limitation](https://github.com/electron/electron/pull/13039) on the format of command-line arguments, which for some reason only affects Windows. Basically, the command line is truncated after the first argument that looks like a URL.

Electron's recommendation for avoiding this is to prefix the argument list with `--`,  but I prefer switching to a different arg format (`--x=y` instead of `--x y`) that will prevent us from ever running into this issue.

NOTE: I will follow up with a diff to harden arg parsing in our Electron code so that it only accepts the `--x=y` format.

Reviewed By: huntie

Differential Revision: D81237713

fbshipit-source-id: a255dc63b6486b96d9f7ccf780d1b09bc4ddf7e0
2025-08-28 10:27:22 -07:00
Pieter De BaetsandFacebook GitHub Bot 31b9f10364 Fix int overflow in useRawPropsJsiValue (#53504)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53504

Casting directly from double to int loses precision. Instead, match the (accidental) behaviour of the folly version, which always access the value as an int64_t first.

```
double value = 4294967040
(int)value = 2147483647 (overflow)
(int)(int64_t)value = -256 (signed version of 4294967040)
```

Changelog: [General][Fixed] Casting rawValue to int was incorrectly truncating

Reviewed By: zeyap, sammy-SC

Differential Revision: D81228983

fbshipit-source-id: d68d4e63d7c7bc9a9226592756a1e53666d58978
2025-08-28 10:04:07 -07:00
Christoph PurrerandFacebook GitHub Bot c05f39ec3e Remove duplicated to_underlying helper method (#53494)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53494

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D81203760

fbshipit-source-id: 185d6b3a6cd06d58c770dd04c68cc707a7621f08
2025-08-28 09:48:57 -07:00
SimekandFacebook GitHub Bot 830bc8c77e upgrade jest-junit to remove old Jest dependencies (#53444)
Summary:
When aligning Jest versions recently I have spotted that some old Jest (v24) dependencies are still fetched. After looking at lock the traces lead to outdated `jest-junit` dependency.

This PR updates the `jest-junit` package to get rid of those old Jest dependencies. I have went through [the release changelogs](https://github.com/jest-community/jest-junit/releases) to make sure there are no breaking changes with the current setup.

## Changelog:

[INTERNAL][CHANGED] - upgrade `jest-junit` to remove old Jest dependencies from the workspace

Pull Request resolved: https://github.com/facebook/react-native/pull/53444

Test Plan: I have made sure that `test-ci` tests are passing, and correct `junit.xml` is generated locally after the run.

Reviewed By: cortinico, christophpurrer

Differential Revision: D80904710

Pulled By: robhogan

fbshipit-source-id: 9b4c65e2fd370bbdb429fb628f79f94698e9c4c2
2025-08-28 08:10:23 -07:00
generatedunixname537391475639613andFacebook GitHub Bot daecb7a059 xplat/js/react-native-github/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PreparePrefabHeadersTask.kt (#53497)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53497

Reviewed By: cortinico

Differential Revision: D81219754

fbshipit-source-id: a1798365904da1c94d913017950cd5d0469d11a2
2025-08-28 06:56:39 -07:00
generatedunixname537391475639613andFacebook GitHub Bot abb310e089 xplat/js/react-native-github/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/BundleHermesCTask.kt (#53498)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53498

Reviewed By: cortinico

Differential Revision: D81218257

fbshipit-source-id: ccb912733e9d3f393e06aad6d38ac1809aa62218
2025-08-28 04:30:16 -07:00
generatedunixname1395667395051502andFacebook GitHub Bot be78564820 Update React Native DevTools binaries
Summary:
Automated update of React Native DevTools binaries
bypass-github-export-checks
Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D81155400

fbshipit-source-id: b9aa0b10abe4e89e27746862d7631a66286eac66
2025-08-28 03:46:05 -07:00
Pieter De BaetsandFacebook GitHub Bot fafbee2402 Remove CxxSharedModuleWrapper from open-source (#52672)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52672

This was used internally to work around some limitations of the bridge lifecycle. Given that we now have C++ TurboModules which are much more versatile, let's remove unnecessary concepts externally, as we move towards deprecating legacy C++ modules entirely.

Changelog: [General][Breaking] Removed CxxSharedModuleWrapper

Reviewed By: rshest

Differential Revision: D78484221

fbshipit-source-id: 95ed46b597dac55d823b70abe196264ce5b326ab
2025-08-28 03:39:42 -07:00
Tim YungandFacebook GitHub Bot 72158fc13a VirtualView: Create Activity Experiment (#53488)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53488

Creates a new feature flag to experiment with `Activity` in `VirtualView`.

The feature flag enables the following treatments:

- `no-activity` is the same as what we currently do — no `Activity` and we render `null` for hidden elements.
- `activity-without-mode` wraps the children in `Activity` but does not set `mode` and still renders `null` for hidden elements.
- `activity-with-hidden-mode` wraps the children in `Activity` and sets `mode="hidden"` and continues providing `children` (not `null`) for hidden elements.

Changelog:
[Internal]

Reviewed By: rickhanlonii

Differential Revision: D81149561

fbshipit-source-id: ea2c319139962de30836d80a2492d8147cbe82ba
2025-08-27 21:26:52 -07:00
Sam ZhouandFacebook GitHub Bot 502325fbce Turn on flags that will be on by default in 0.281 in oss projects
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D81190534

fbshipit-source-id: 83be2aed3d13e225bfc9c07c57da22324c04ce77
2025-08-27 19:15:07 -07:00
Kaining ZhongandFacebook GitHub Bot a03780d279 fix: use the first available locale to decide directionality on Android (#53417)
Summary:
On iOS, if the default locale is not supported in the app, it will fall back to the first available locale to decide if RTL layout should be enabled or not; however on Android, we use the default locale. So if the first locale is a RTL locale and not supported by the app on Android, the app will fall back to the first available locale which might not be RTL, but the layout would be decided as RTL according to the default locale.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID] [FIXED] - use the first available locale instead of the default one to decide `isDevicePreferredLanguageRTL`

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [FIXED] - use the first available locale instead of the default one to decide `isDevicePreferredLanguageRTL`

Pull Request resolved: https://github.com/facebook/react-native/pull/53417

Test Plan:
I set my phone's locale to this order: Hebrew, English and enabled RTL layout:
```
import { I18nManager } from 'react-native';

I18nManager.allowRTL(true);
I18nManager.swapLeftAndRightInRTL(true);
```

Prior to my PR, the app would use RTL layout with English on Android which doesn't make much sense (iOS is LTR + English). With my PR Android app will behave exactly the same as the iOS app.

Reviewed By: rshest

Differential Revision: D80821903

Pulled By: zeyap

fbshipit-source-id: c1bd9b45341c344833a8fdfacc2c786ee8437415
2025-08-27 18:15:36 -07:00
Sam ZhouandFacebook GitHub Bot 09312027db Require error code in suppressions, and kill $FlowIssue and $FlowIgnore in react-native (#53487)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53487

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D81150232

fbshipit-source-id: 23320495061c7c78ced8f95db90101c4b55d9690
2025-08-27 13:14:20 -07:00
Moti ZilbermanandFacebook GitHub Bot adf1b62c76 Normalise shell name/version strings, add commit hash when prebuilt (#53480)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53480

Changelog: [Internal]

Improves the way `--version` and the User-Agent header work in `debugger-shell`.

* The same app name and version string format will be used across the `dev` and `prebuilt` flavours. Previously, `dev` would report itself as being `Electron v37.2.6` while `prebuilt` would report `react-native/debugger-shell v0.82.0-main`.
* `prebuilt` now also reports the original Meta-internal commit hash as a suffix `-rFBS..........` added to the semver string taken from `package.json`, while `dev` will have a `-dev` suffix in the same place.
  * We do **not** modify the version in `package.json` during the build, nor do we pass the commit hash to `electron/packager`, because this would impose inconvenient platform-specific restrictions on the version string's format.

Reviewed By: huntie

Differential Revision: D81120181

fbshipit-source-id: e730dd35da78dfbb8de326f9a3ab76b747fdb0b3
2025-08-27 11:05:02 -07:00
Alex HuntandFacebook GitHub Bot 7eb3536728 Add openDebugger overload with target panel name (#53485)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53485

Adds new `openDebugger(panel)` overload on `DevSupportManager` (following D79329081).

Changelog:
[Android][Added] - `DevSupportManager::openDebugger` now supports an optional `panel` param

Reviewed By: hoxyq

Differential Revision: D81138169

fbshipit-source-id: 282da9fbc055fa4ce94cd2d0790ca4d29c55bfa8
2025-08-27 10:38:42 -07:00
Sam ZhouandFacebook GitHub Bot 1618a8ed4f Deploy 0.280.0 to xplat (#53486)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53486

[changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D81138527

fbshipit-source-id: c17ba243ef18cb4f9e107b717c6875b2868fea45
2025-08-27 10:18:17 -07:00
Alex HuntandFacebook GitHub Bot 63948350e0 Clear XHRExampleFetch interval on unmount (#53481)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53481

Small fix to this RNTester example to clean up hanging `setInterval` side effect making repeat network fetches.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D81127809

fbshipit-source-id: 6036dd254888eb6160d2b1e116bbce63e5fd9328
2025-08-27 09:46:15 -07:00
Riccardo CipolleschiandFacebook GitHub Bot d503ea4efc Add deprecation for legacy arch APIs (#53368)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53368

This change introduces deprecation messages for several APIs used by the legacy arch in the RCTAppDelegate Library

## Changelog:
[iOS][Added] - Add deprecation message for RCTAppdelegate APIs

Reviewed By: cortinico

Differential Revision: D80618102

fbshipit-source-id: db77f8602a521557ed26822f27d54c6fc70c49bf
2025-08-27 08:12:21 -07:00
Christian FalchandFacebook GitHub Bot e723ca4d6b Support dynamic static linkage with prebuilts (#53432)
Summary:
To be able to handle cocoapods USE_FRAMEWORKS with both dynamic/static linkage and precompiled we needed a common way to resolve this.

The issue was that when using precompiled and USE_FRAMEWORKS our precompiled framework caused the resulting Pods project to only include header files - hence there where no need to change the header_mappings_dir which a lot of the podspecs did.

When using precompiled and building with frameworks (USE_FRAMEWORKS) we need to explicitly add the correct path to ReactCodegen when calling `create_header_search_path_for_frameworks` to ensure libraries can access their codegen files.

- Added method that handles this in a generic way
- Replaced logic for resolving header mappings and module name using the new method `resolve_use_frameworks` in all podspecs.
- Add an explicit check to make sure we add the correct path when using frameworks and the pod is ReactCodegen.
- Added includes in the NativeCXXModuleExample.cpp file to test this.

## Changelog:

[IOS] [FIXED] - Fixed using USE_FRAMEWORKS (static/dynamic) with precompiled binaries

Pull Request resolved: https://github.com/facebook/react-native/pull/53432

Test Plan:
Build RN-Tester with USE_FRAMEWORKS static and dynamic

### Tests ran:

  Build with source and no USE_FRAMEWORKS
  Build with source and USE_FRAMEWORKS = static
 🔴 Build with source and USE_FRAMEWORKS = dynamic

 Undefined symbols for architecture arm64:
   "facebook::react::oscompat::getCurrentProcessId()", referenced from:

Reviewed By: motiz88

Differential Revision: D81127796

Pulled By: cipolleschi

fbshipit-source-id: 1f55bf31240ac93cb8b93751b3e37ff6d517f49b
2025-08-27 08:12:07 -07:00
Moti ZilbermanandFacebook GitHub Bot 111187f6a4 Document unstable_experiments.enableStandaloneFuseboxShell (#53482)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53482

Changelog: [Internal]

TSIA

Reviewed By: huntie

Differential Revision: D81127995

fbshipit-source-id: cad5720b41ce409e9db1972bea3844ff0e0724ce
2025-08-27 08:11:51 -07:00
Christian KruseandFacebook GitHub Bot 9240b78a34 Fix extra semi colon (#53461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53461

Changelog: [Internal]

Reviewed By: mamun4122

Differential Revision: D81032488

fbshipit-source-id: 5d22b43be44c5f1461f9101aa090cde3ce3dd41c
2025-08-27 08:08:52 -07:00
Zeya PengandFacebook GitHub Bot d9d9a49e18 allow calling createAnimatedNode without batching (#53476)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53476

## Changelog:

[General] [Added] - allow calling createAnimatedNode without batching

Enable setting `nativeCreateUnbatched` config on an AnimatedNode, when it's true, the call to Animated nativeModule's createAnimatedNode will skip signal batching (will call over JSI before React rendering is finished) and batching in c++, and the creation will be executed at next UI thread render.

This will only make AnimatedNodes creation happen early, but node/view connections, node deletion or event drivers will still be batched like before

Reviewed By: yungsters

Differential Revision: D80968512

fbshipit-source-id: afb607410a174fb85107ef270b9d6f3d61617daf
2025-08-27 08:08:45 -07:00
Samuel SuslaandFacebook GitHub Bot 79a8354c59 attempt to fix maintain visible content position prop with view culling (#53472)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53472

changelog: [internal]

I am looking into stalls when View Culling is turned on together with immediate state updates. This is one of the places where stalls are concentrated and this seems like a possible culprit:
When view is moved outside of the viewport, it is immediately reused. Therefore, we must check view's identity to make sure it is the same view before and after transaction.

Reviewed By: lenaic

Differential Revision: D81044328

fbshipit-source-id: 796b71219e5fc94c1f98319b73f4655b9c13000f
2025-08-27 05:58:06 -07:00
Moti ZilbermanandFacebook GitHub Bot 37b61aca1b Drop mention of Chrome/Edge if standalone shell enabled (#53464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53464

Changelog: [Internal]

Minor followup from D78351937 - the Fusebox console notice still mentions that RNDT requires Chrome or Edge. Let's remove this mention for users opted into the standalone shell experiment.

Reviewed By: huntie

Differential Revision: D81040965

fbshipit-source-id: a290d3164261f8a1087229edfe3f69a2a9b49960
2025-08-27 05:09:30 -07:00
Moti ZilbermanandFacebook GitHub Bot ab1af2844b Support Fusebox shell experiment in OSS without a custom BrowserLauncher (#53435)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53435

Changelog: [Internal] Support setting `enableStandaloneFuseboxShell: true` in OSS with no custom `BrowserLauncher`

Makes it possible for frameworks to enable the React Native DevTools standalone shell in open source by passing `unstable_experiments: {enableStandaloneFuseboxShell: true}` to `createDevMiddleware()`.

When this experiment is enabled:

* The RNDT shell binary will be prefetched in the background as soon as the dev server starts (into a local cache managed by [DotSlash](https://dotslash-cli.com/)).
* If prefetching is successful, then "Open DevTools" actions will be handled by launching the RNDT frontend in the standalone shell, instead of in Chrome/Edge.
* If prefetching is not successful, then we'll notify the user about the error, and "Open DevTools" will continue to be handled by Chrome/Edge, as before.
* If the user attempts to open DevTools more than once for the same app, the standalone shell will reuse the existing window (as opposed to the current behaviour of always creating a new Chrome/Edge window).
* The appropriate DevTools window will automatically foreground itself upon pausing on a breakpoint.

Reviewed By: huntie

Differential Revision: D78351937

fbshipit-source-id: 6d5baa8fa866760f1d527108cd3c42bcab68cf57
2025-08-27 05:09:30 -07:00
generatedunixname537391475639613andFacebook GitHub Bot f215d4c797 xplat/js/react-native-github/packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GenerateCodegenArtifactsTaskTest.kt (#53479)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53479

Reviewed By: javache

Differential Revision: D81024444

fbshipit-source-id: 6b39f1c915f1340cb985c4a74d3ec1adfd8324d8
2025-08-27 04:45:02 -07:00
Moti ZilbermanandFacebook GitHub Bot ba24f5f903 Demote electron to devDependency (#53438)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53438

Changelog: [Internal]

Makes `flavor: 'prebuilt'` the default mode of launching the RNDT standalone shell, and the *only* mode supported in the published version of the package. See D78351931 for more context.

With this, we can demote `electron` from `dependencies` to `devDependencies`. This makes it possible to make `debugger-shell` a dependency of `dev-middleware` (and thus of all major frameworks) without significantly impacting `npm install` times. We'll add this dependency on `debugger-shell` in an upcoming diff (D78351937).

We also stop publishing the `dist/electron` subdirectory (and `src/electron` for good measure) since the corresponding code will always be bundled into the prebuilt binary instead.

Reviewed By: huntie

Differential Revision: D78351934

fbshipit-source-id: 2a4b03e852c4d0330250567c41dca09d1c4f3abd
2025-08-27 02:50:05 -07:00
Moti ZilbermanandFacebook GitHub Bot b5dfb32ed3 Support preparing debugger shell ahead of "open DevTools" (#53437)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53437

Changelog: [Internal]

The React Native DevTools standalone shell is distributed as a DotSlash file that downloads the required binaries lazily. This diff adds support in dev-middleware for a new `BrowserLauncher.unstable_prepareFuseboxShell` method that integrations can use to kick off the download early. Integrations are expected to implement this by calling the `unstable_prepareDebuggerShell` function (added to the `debugger-shell` package in D78413091).

If `BrowserLauncher.unstable_prepareFuseboxShell` returns an error, dev-middleware will fall back to the browser-based launch flow, even for users opted into the `enableStandaloneFuseboxShell` experiment.

Reviewed By: huntie

Differential Revision: D78413092

fbshipit-source-id: 6868bf07e16353fcd83337ae54c87c5a641a0f99
2025-08-27 02:50:05 -07:00
Moti ZilbermanandFacebook GitHub Bot 7046c24702 Expose DotSlash prefetching as unstable_prepareDebuggerShell (#53434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53434

Changelog: [Internal]

The React Native DevTools standalone shell is distributed as a DotSlash file that downloads the required binaries lazily. This diff gives integrations a mechanism for kicking off the download early (but without slowing down `npm install react-native`). This will be integrated into dev-middleware in an upcoming diff.

Reviewed By: huntie

Differential Revision: D78413091

fbshipit-source-id: caf2010edd1bcdd139d37d7849212cd1cbb64f46
2025-08-27 02:50:05 -07:00
Moti ZilbermanandFacebook GitHub Bot 0f4e5c382e Provisionally support using prebuilt shell binaries via DotSlash (#53436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53436

Changelog: [Internal]

Adds a `flavor` option to `unstable_spawnDebuggerShellWithArgs` to select between two modes:

1. `flavor: 'dev'` (current behaviour) - launching a stock Electron binary (from the `electron` package) and pointing it directly at the shell code from the `src/electron` directory.
2. `flavor: 'prebuilt'` (new in this diff) - launching the prebuilt React Native DevTools binary included in the package (built continuously at Meta and committed as a DotSlash file in automated diffs e.g. D79836825). Note that this binary includes Electron *and* a frozen version of the shell code from `src/electron`.

Going forward, `'dev'` will only be used when developing the package (e.g. in D78351934 we will move `electron` to `devDependencies`). The published version of the package is only intended to work with `flavor: 'prebuilt'`.

Reviewed By: huntie

Differential Revision: D78351931

fbshipit-source-id: d0e66b54c142dc2910619ba3d6d149d88324c872
2025-08-27 02:50:05 -07:00
Ruslan LesiutinandFacebook GitHub Bot 5e74dc7fca Use panel query param instead of landingView (#53468)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53468

# Changelog: [Internal]

I've just discovered today that Chrome DevTools has a native support for `panel` query parameter, we don't need a custom one.

Reviewed By: alanleedev

Differential Revision: D81052828

fbshipit-source-id: 6f8ef5b576dbff70cabd6ab792bc0f6e615928e7
2025-08-26 19:14:12 -07:00
Sam ZhouandFacebook GitHub Bot c120587fe5 Add annotations to fix future natural inference errors in xplat/js: 4/n (#53469)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53469

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D81067843

fbshipit-source-id: f75116da9be89d35c5befb4c90272ecc67d52caf
2025-08-26 16:42:25 -07:00
Samuel SuslaandFacebook GitHub Bot d0d853b252 add option to disable prop scrollView.maintainVisibleContentPosition (#53465)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53465

changelog: [internal]

I am debugging an issue with Fabric View Culling + immediate state update.
The problem appears to be in logic handling `maintainVisibleContentPosition`. I want to try to disable the prop to see if the problem goes away.

Reviewed By: rshest

Differential Revision: D81030436

fbshipit-source-id: 8efeb1151ad3e12b812cafd073348502510ef01d
2025-08-26 15:12:41 -07:00
Nick LefeverandFacebook GitHub Bot 2b99204e06 Fix culling of views having no layout breaking embedded Text event handlers (#53466)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53466

This is a follow-up on D80631997. When enabling View Culling on Android, wrapped Text components would lead to event handlers set by the inner Text component not being set on the attributed string.

```
<Paragraph>
  <Text onPress={myHandler}>  <- This handler is not set
    <RawText/>
  </Text>
</Paragraph>
```

This was due to the inner Text component having no size and hence being culled by the View Culling algorithm.

This diff disables view culling for views having no size, since no layout means no valid decision can be made as to the visibility of the component within the viewport.

It also removes the change made by D80631997. This means Text views with a layout size set can be culled again.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D81044841

fbshipit-source-id: e9b01dcb8030b271876329b9b2c5bda36ba2b87a
2025-08-26 12:54:54 -07:00
Christoph PurrerandFacebook GitHub Bot a4bf14a9af imagemanager / primitives > avoid copy of debug string (#53451)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53451

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D80946627

fbshipit-source-id: c7604366f97b1b8336f3792d434d5873c810cec7
2025-08-26 10:55:00 -07:00
Zeya PengandFacebook GitHub Bot 7ea7c40e32 Add missing node null check in AnimationDriver (#53462)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53462

## Changelog:

[Internal] [Chanaged] - Add missing node null check in AnimationDriver

Reviewed By: lenaic

Differential Revision: D80949230

fbshipit-source-id: b08258671fbf0a011aa6a48501fdd83a706b1f1f
2025-08-26 09:27:49 -07:00
Christian KruseandFacebook GitHub Bot b7de7abd80 Fix extra semi colon (#53459)
Summary:
X-link: https://github.com/facebook/hermes/pull/1770

Pull Request resolved: https://github.com/facebook/react-native/pull/53459

Changelog: [Internal]
This is preventing enabling arfx_cxx_extra_semi_error

Reviewed By: cortinico

Differential Revision: D80532814

fbshipit-source-id: 61f5ad356180485498d652337754285453118542
2025-08-26 08:00:40 -07:00
Vitali ZaidmanandFacebook GitHub Bot c9573dad52 removed reconnect logic that is never reached (#53369)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53369

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D80541401

fbshipit-source-id: 0816b71e8dfe2a86f6fe5af049fbabff68b13940
2025-08-26 06:46:31 -07:00
generatedunixname537391475639613andFacebook GitHub Bot b7ac655a11 xplat/js/react-native-github/packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tests/TaskTestUtils.kt (#53458)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53458

Reviewed By: rshest

Differential Revision: D80931289

fbshipit-source-id: 5da865e62ae5d4ef248d7e7f17357386f0b2b9b4
2025-08-26 05:23:42 -07:00
Moti ZilbermanandFacebook GitHub Bot 4831314c1b Update React Native DevTools binaries
Summary:
Automated update of React Native DevTools binaries
bypass-github-export-checks
Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D80804474

fbshipit-source-id: 74aa1542b8cfb55cea414f1cacbffb8d04a31c7d
2025-08-26 03:43:22 -07:00
Christian FalchandFacebook GitHub Bot 939a75b5ce add SWIFT_ENABLE_EXPLICIT_MODULES to xcode 26 (#53457)
Summary:
XCode 26 introduces building explicit swift modules turned on (SWIFT_ENABLE_EXPLICIT_MODULES). This breaks building with precompiled binaries.

This commit fixes this by adding a step when not building from source where we explicitly set the `SWIFT_ENABLE_EXPLICIT_MODULES` flag to `NO`.

## Changelog:

[IOS] [FIXED] - Added setting SWIFT_ENABLE_EXPLICIT_MODULES=NO when using precompiled to support Xcode 26

Pull Request resolved: https://github.com/facebook/react-native/pull/53457

Test Plan:
```bash
npx react-native-community/cli init MyApp --version nightly --skip-install
cd MyApp
yarn
cd ios
bundle install
RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 bundle exec pod install
```

Build above app with Xcode 26 and verify that it no longer fails

Reviewed By: motiz88

Differential Revision: D81025367

Pulled By: cipolleschi

fbshipit-source-id: 1db7c4d7de07d62f43b355aa784d7d9de478023c
2025-08-26 03:39:49 -07:00
generatedunixname537391475639613andFacebook GitHub Bot ec1ee19cda xplat/js/react-native-github/packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/internal/PrepareBoostTaskTest.kt (#53358)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53358

Reviewed By: cortinico, cipolleschi

Differential Revision: D80605883

fbshipit-source-id: cf576ee6e6c941eaef25ebf835c771e9bb3d5669
2025-08-25 18:37:02 -07:00
Luna WeiandFacebook GitHub Bot 792e450aff Introduce hysteresis window (#53345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53345

Changelog: [Internal] - Introduce hysteresis window that is nested between the prerender and hidden window sizes. Currently set to enlargening the prerender window by hysteresis ratio

When a VirtualView intersects with the hysteresis window, it mode remains unchanged.

This prevents us dispatch mode changes for things like overscroll.

I put the hysteresis between prerender and hidden because we already avoid dispatching mode changes from visible -> prerender. For prerender -> visible, we use renderState

Reviewed By: yungsters

Differential Revision: D80511627

fbshipit-source-id: cd14256abc898e7120705e277147d52a06c865a9
2025-08-25 12:58:22 -07:00
Pieter De BaetsandFacebook GitHub Bot 870836ff84 Namespace Perfetto usage (#53424)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53424

Use the namespaced version of these macros to avoid symbol conflicts when multiple instances of `PERFETTO_DEFINE_CATEGORIES` are in the same binary.

The current macro is effectively deprecated: https://github.com/a6f/perfetto_protos/blob/master/CHANGELOG#L691-L696

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D80697205

fbshipit-source-id: 713fec4d41137ddd2f025c7e7130dc44c5a3a656
2025-08-25 11:16:51 -07:00
Andrew DatsenkoandFacebook GitHub Bot 42b94fc709 Add babel-plugin-istanbul for code covearage (#53413)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53413

Changelog: [Internal]
Add dependency on istanbul plugin so we can collect code coverage.

Reviewed By: christophpurrer

Differential Revision: D80723825

fbshipit-source-id: bf0ac0e49e12ea1b01f72c11362019ef68e09ff9
2025-08-25 10:45:16 -07:00
Pieter De BaetsandFacebook GitHub Bot 8881faa7ec Rollout useRawPropsJsiValue (#53426)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53426

Experiment review for this was completed internally, and we can now change the default behaviour to no longer allocate an intermediate folly::dynamic when parsing props.

RawValue will continue supporting a folly::dynamic constructor as some paths go through code path (eg animations)

There should be no user-visible difference in parsing behaviour.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D80799833

fbshipit-source-id: 8eeae656157757eb38f69a2af14409da23b510c8
2025-08-25 07:09:34 -07:00
Phil PluckthunandFacebook GitHub Bot b054540092 Mark @react-native/metro-config as optional peer to fix warning (#53314)
Summary:
The `react-native/metro-config` peer was added in https://github.com/facebook/react-native/commit/fe2bcbf4ba7ce983fac0cd09727c165517b6337f / https://github.com/facebook/react-native/issues/51836 by robhogan

Side-note: It's pulled in via `react-native/community-cli-plugin` which is a direct dependency of `react-native` for the `scripts/bundle.js` script. While, for expo, we'd love to find a way to make this an optional dependency (to avoid excessive deps that `expo` replaces otherwise), for now, it's a direct dependency.

The problem here is that this isn't optional, which means:
- with auto-installing peer dependencies it is directly fulfilled (while `react-native-community/cli` is already marked as optional and skipped)
- with legacy/non-auto peer-dependencies it is flagged as missing, but in an Expo project it wouldn't make sense to install directly

This causes a **package manager regression in the form of either a peer dependency warning**, that shouldn't be fulfilled in an Expo project, or (in the best case scenario) pulls in dependencies [that a user does not need](https://npmgraph.js.org/?q=%40react-native%2Fmetro-config#zoom=w&select=exact%3A%40react-native%2Fmetro-config%400.81.0).

An error message is already in place to inform the user of this being missing when it's not installed, so marking it as optional seems appropriate.

## Changelog:

[INTERNAL] [FIXED] Mark added `react-native/metro-config` peer dependency as optional

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/53314

Test Plan:
Warnings like the following won't occur in fresh Expo (54/preview/`next`) projects
```
warning "workspace-aggregator-484d9ec3-587b-43cb-97de-4dcce3876578 > microfoam-mobile > react-native > react-native/community-cli-plugin@0.81.0" has unmet peer dependency "react-native/metro-config@*".
```

Reviewed By: cortinico

Differential Revision: D80450287

Pulled By: robhogan

fbshipit-source-id: c622fd4c24025676c0ec74de826f863f1e291669
2025-08-24 14:18:42 -07:00
Tim YungandFacebook GitHub Bot bf12e30cb7 VirtualView: Remove Unnecessary ?. in updateClippingRect() (#53442)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53442

Refactors `VirtualView` to remove this unnecessary `?.` in `updateClippingRect()`.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D80600713

fbshipit-source-id: 1a11b302f069e3b35db70831fd4f7a9bd7471cc6
2025-08-22 17:49:05 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot ec1e97342a View recycling for ScrollView native component on Android (#53395)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53395

# Changelog
[Internal] -

This enables view recycling for both ScrollView and HorizontalScrollView on Android.

The feature is gated by the corresponding RN feature flag, `enableViewRecyclingForScrollView` (which is false by default for now, will be enabled in an experiment).

Reviewed By: lenaic

Differential Revision: D80611087

fbshipit-source-id: b3026affc0ea61bc7739126d6529c83f2a653183
2025-08-22 13:54:51 -07:00
Nicola CortiandFacebook GitHub Bot cf528526cc Remove dead Inspector.kt/JInspector.h/.cpp code (#53403)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53403

This code is Legacy and totally unused. It should be safe to remove it altogether.
This class is public but no one is using it in OSS + no one should be using it, so I don't think we'll need the full deprecation cycle for it.

Changelog:
[Android] [Removed] - Removed unused `Inspector` public class from React Android

Reviewed By: cipolleschi

Differential Revision: D80711515

fbshipit-source-id: 83134851877fcbccd50f7a5b75b2ab8906b3416a
2025-08-22 11:13:31 -07:00
Sam ZhouandFacebook GitHub Bot 0530ea3349 Migrate to suppression with error code in xplat: 1/n (#53439)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53439

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D80809220

fbshipit-source-id: 6f432d8302934b9fee9780ac1d6ba6c87c0b3899
2025-08-22 10:35:39 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 56ab2e72b2 Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [B] [A] [A] (#53401)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53401

Reviewed By: cipolleschi

Differential Revision: D80713611

fbshipit-source-id: 73dc034d966eea5b388a51ab84da2416531c7376
2025-08-22 07:02:13 -07:00
generatedunixname89002005287564andFacebook GitHub Bot e60ddf0adb Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [B] [B] (#53425)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53425

Reviewed By: javache

Differential Revision: D80619000

fbshipit-source-id: d012c170ed366904b39ef335fea5241b604461ec
2025-08-22 05:52:14 -07:00
Ruslan LesiutinandFacebook GitHub Bot 4b34be445d Release PerfMetricsBinding to avoid memory leak (#53420)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53420

# Changelog: [Internal]

HostRuntimeBinding owns a connection, which is stored as a session on HostTarget, so we need to release it first in order to satifsy the assertion in the destructor.

Reviewed By: huntie

Differential Revision: D80778273

fbshipit-source-id: be7bf085fadd8808fd5e5c621c3990a5e7e0186d
2025-08-22 05:07:02 -07:00
Ruslan LesiutinandFacebook GitHub Bot 8d8245123e Create endpoints for tracing and stashing on Bridgeless Android ReactHost (#53416)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53416

# Changelog: [Internal]

Creates methods on Bridgeless Android Host for starting / stopping tracing and implements logic for storing the recording that will be transferred to `jsinspector-modern` stack via HostTargetDelegate when CDP session is created.

Reviewed By: sbuggay

Differential Revision: D79725161

fbshipit-source-id: f3e3b39f6d94a6548cf227394f7328f6913c33e4
2025-08-22 04:12:22 -07:00
Ruslan LesiutinandFacebook GitHub Bot 80f340e81c Send custom CDP Event to Frontend to prepare for displaying a trace (#53079)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53079

# Changelog: [Internal]

We need this to notify Frontend, so it updates the local state before receiving `Tracing.dataCollected` events.

Corresponding change in CDT fork - https://github.com/facebook/react-native-devtools-frontend/pull/199.

Reviewed By: sbuggay

Differential Revision: D79672598

fbshipit-source-id: b2928cb3942e34a1f4723516ecdf5062d4331591
2025-08-22 04:12:22 -07:00
Ruslan LesiutinandFacebook GitHub Bot e1b76ab2d5 Add a mechanism for emitting stashed trace recording (#53078)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53078

# Changelog: [Internal]

When CDP session is created via `HostTarget::connect`, it will ask `HostTargetDelegate` is there is a previously recorded trace that Host wants to display in the Frontend.

`TracingAgent` will serialize and send the recording at the initialization time in constructor.

Reviewed By: huntie

Differential Revision: D79672597

fbshipit-source-id: 241c9d367ab65ef1e95c62d5025b3bc14bf42608
2025-08-22 04:12:22 -07:00
generatedunixname537391475639613andFacebook GitHub Bot 5848252ee2 xplat/js/react-native-github/packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/internal/PreparePrefabHeadersTaskTest.kt (#53423)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53423

Reviewed By: rshest

Differential Revision: D80786149

fbshipit-source-id: 81df8592b142df2f9d9178c13a9480a7186c2604
2025-08-22 04:12:06 -07:00
Moti ZilbermanandFacebook GitHub Bot 33be0606c1 Always reload the frontend when launching, even in an existing window (#53407)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53407

Changelog: [Internal]

## Context

Upon receiving a launch command, the RNDT shell either:

1. Creates a new window and navigates to the requested frontend URL.
2. Brings an existing window to the foreground *with no further navigation*.

In the happy path, (2) is a pretty nice experience: it preserves all prior UI state in the frontend and leaves the user with an instantly responsive debugger - this can be quite a bit faster than (1) because of the overhead of loading and parsing source maps for example. However, this breaks down if the frontend is not in a usable state to begin with. This is, sadly, a frequent-enough occurrence that we must account for it: the CDP connection may have been lost, the frontend app itself might have failed to load the last time, etc.

Preserving everything that's nice about (2) while also making it fully reliable - incrementally bringing the frontend to the state specified by a new URL - would require delicate engineering across the shell and frontend codebases, which is an amount of complexity I would like to sidestep for now.

NOTE: The more complex solution **is 100% worth implementing in the long term,** as it has tangible benefits for the user, and matches Chrome best.

## This diff

Here we take a much cheaper approach than the one described above: the shell will *always* initiate navigation to the new frontend URL, regardless of whether it does so in a new window or a previously opened one. This will consistently bring the user to a state where the frontend is open and working (although it will reset any ephemeral UI state in the process, and typically take a noticeable amount of time to load).

Even with this simplified approach, the standalone shell still offers a better experience than launching in a browser (if only because it is zero-install and avoids the "dead tab spam" problem).

Reviewed By: huntie

Differential Revision: D80711185

fbshipit-source-id: 8f376ccf1717c48a1742c798da3171ac6d2f8af0
2025-08-22 04:03:08 -07:00
Christian FalchandFacebook GitHub Bot a843119ff1 Fix copy symbol files in RNDeps precompile (#53353)
Summary:
Symbol files wasn't copied correctly when building - as with bundles we did overwrite the files and ended up with only the last symbol file.

This commit fixes this by mapping the framework build folder architecture type to the xcframework slices creating the correct file structure under the Symbols folder.

- Each slice gets a folder with the architecture name under Symbols containing the dSym folder for that slice
- Refactored getting correct architecture folder into a separate function.
- Refactored target folder lookup in copyBundles
- Removed unused async modifier on function

## Changelog:

[IOS] [FIXED] - Fixed how we copy and build the Symbols folder when precompiling ReactNativeDependencies

Pull Request resolved: https://github.com/facebook/react-native/pull/53353

Test Plan: Run nightlies and verify that ReactNativeDependencies.framework.dSym files contains symbol files for all architectures.

Reviewed By: cortinico

Differential Revision: D80692019

Pulled By: cipolleschi

fbshipit-source-id: 77983bc29d1965edf3bc0fcbd9cb3177071991d3
2025-08-22 03:26:54 -07:00
Christian FalchandFacebook GitHub Bot 8c444f773a aligned symbol folders with RNdeps (#53354)
Summary:
After fixing an isssue with ReactnativeDependencies and how it built symbols (https://github.com/facebook/react-native/issues/53353) this commit will align the output of the Symbols folder for the two frameworks.

Previously we had an output in the Symbols folder that looked like this (from a local build on my machine)

- catalyst
- iphone
- iphonesimulator

After this we now have the more correct arcitecture names on these folders:

- ios-arm64
- ios-arm64_x86_64-simulator
- ios-arm64_x86_64-maccatalyst

This is in line with how the ReactNativeDependencies Symbol folder is set up.

## Changelog:

[IOS] [FIXED] - Aligned Symbols folder in React.xcframework symbols with ReactNativeDependencies.xcframework symbols.

Pull Request resolved: https://github.com/facebook/react-native/pull/53354

Test Plan: Nightlies

Reviewed By: cortinico

Differential Revision: D80692098

Pulled By: cipolleschi

fbshipit-source-id: e952b087d5dbdeb929b45d9e6d3d7e077c9d05cc
2025-08-22 03:23:24 -07:00
Alex HuntandFacebook GitHub Bot 3292cb1dc9 Fix incorrectly hardcoded landingView for open debugger action (#53400)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53400

In D79329081, we accidentally hardcoded the `landingView` parameter in the default Dev Menu handler to open React Native DevTools. Reset this.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D80710487

fbshipit-source-id: 9066ffafcb17a6ff46650f7081d9a662f186d995
2025-08-22 03:09:50 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot d0744f7e59 Use Map as recyclable views container (#53394)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53394

# Changelog:
[Internal] -

This just fixes a linter warning I noticed when working on related code.

Reviewed By: cortinico

Differential Revision: D80702545

fbshipit-source-id: fecfed9e9946b971864706306b03b57cd3111aee
2025-08-22 01:35:18 -07:00
Chi TsaiandFacebook GitHub Bot 646945c2f2 Add deleteProperty API (#52911)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52911

Add a new `deleteProperty` API to JSI. As the name implies, allows users
to delete properties from Objects through JSI.

The default implementation uses `Reflect.deleteProperty.` For the
`PropNameID` overload, convert the propNameID to a String and pass into
the `deleteProperty` function.

Changelog: [Internal]

Reviewed By: dannysu

Differential Revision: D79120814

fbshipit-source-id: e30f383247d94bb5971e4909f004c75e8165adda
2025-08-21 17:35:55 -07:00
Marco WangandFacebook GitHub Bot da9136f587 Turn on null strict comparison check for xplat js (#53379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53379

X-link: https://github.com/facebook/react/pull/34240

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D80648362

fbshipit-source-id: cc47ae207f29a3ddb68bc0e029b8773f89503c52
2025-08-21 16:46:23 -07:00
Nikita LutsenkoandFacebook GitHub Bot ffe52b75a3 xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.cpp (#53412)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53412

Changelog:
[General][Internal] - Encapsulated internal class into anonymous namespace to ensure no collisions with public symbols.

Differential Revision: D80689084

fbshipit-source-id: 53ebd8a16a3c217efead0bfe91f66bd50bb6dd2f
2025-08-21 14:59:24 -07:00
Ruslan LesiutinandFacebook GitHub Bot a2a73739d8 fix: use ThreadId when event is captured, not when transformed (#53411)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53411

# Changelog: [Internal]

This regressed after D80263154, when we introduced a local struct for PerforamanceTracerEvent.

We should use id of the thread where event was captured (registered), not where the transform to TraceEvent happened.

This makes sure that events like Event Loop tick or Microtasks phase tick are correctly point to JavaScript thread, not the thread where the transform could've taken place.

Reviewed By: sbuggay

Differential Revision: D80728931

fbshipit-source-id: d3af16e68adece9ebc37368fec2b8a17c1293b4b
2025-08-21 14:18:27 -07:00
Nicola CortiandFacebook GitHub Bot 046ff8e58b Make OnBatchCompleteListener interface internal (#53409)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53409

This interface is public and is part of Legacy Architecture.

Having this interface as `public` was a mistake, as users can't really do much with it.
There is only one old library that is going to be affected by this change:
https://github.com/spoke-ph/react-native-threads
The library appears unmaintained since RN 0.69 + no NewArch support so I won't consider this a breaking change
given this will land in 0.82.

I'm making it internal so we can remove it more easily later.

Changelog:
[Android] [Changed] - Make OnBatchCompleteListener interface internal

Differential Revision: D80715625

fbshipit-source-id: 94fe80eeba95222deab7ca89c5fcafca8fcee0b7
2025-08-21 14:05:47 -07:00
Nicola CortiandFacebook GitHub Bot fb114da8a4 Remove unused internal UIManagerModuleListener (#53404)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53404

This interface is part of Legacy Architecture. No one is using it either internally or externally,
so it's safe to remove now. Interface was also `internal` so this is not a breaking change.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D80714721

fbshipit-source-id: 82cc6152af7d7980119d2eda704ae50d8e81fd2b
2025-08-21 12:25:38 -07:00
Umar MohammadandFacebook GitHub Bot 191ddc1ec7 Fix React Native Commands Export Validation in Coverage Mode (#53381)
Summary:
Changelog: [GENERAL] [FIXED] - Fixed babel plugin validation error when coverage instrumentation is enabled

Pull Request resolved: https://github.com/facebook/react-native/pull/53381

### Problem

[Workplace post](https://fb.workplace.com/groups/235694244595999/permalink/1278937163605030/)

React Native tests were failing **only when coverage collection was enabled** with the error:

`'Commands' is a reserved export and may only be used to export the result of codegenNativeCommands.`

### Root Cause

The React Native Babel plugin's `codegenNativeCommands` validation logic only handled direct `CallExpression` AST nodes. When coverage instrumentation was enabled, it transformed:

**Normal code:**

`export const Commands = codegenNativeCommands<NativeCommands>({...})`

**With coverage:**

`export const Commands = (cov_xxx().s[0]++, codegenNativeCommands<NativeCommands>({...}))`

The plugin failed to recognize the valid `codegenNativeCommands` call wrapped in a `SequenceExpression` by coverage instrumentation.

### **Solution**

Added `isCodegenNativeCommandsDeclaration` function to handle:

1.  **Coverage instrumentation**: `SequenceExpression` nodes containing the function call
2.  **Flow type casts**: `TypeCastExpression` and `AsExpression`
3.  **TypeScript assertions**: `TSAsExpression`
4.  **Direct calls**: Original `CallExpression` (backward compatibility)

Reviewed By: andrewdacenko

Differential Revision: D80572666

fbshipit-source-id: 465f4312a0229d8a92e495c685f46b607ce326e4
2025-08-21 11:33:52 -07:00
Nicola CortiandFacebook GitHub Bot aaa7ba4ab3 HelloWorld should not use ReactNativeHost (#53399)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53399

We currently create application template that are still using `ReactNativeHost`.
As this is a legacy arch class, we should remove it from the template ASAP so that
users can organically migrate away from it.

I will also update https://github.com/react-native-community/template with
the same changes I'm applying here.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D80708461

fbshipit-source-id: e0d4a1f817e6fdddd93405decf77fd115956ec51
2025-08-21 11:16:20 -07:00
Nicola CortiandFacebook GitHub Bot 2689d4d372 RNTester should not use ReactNativeHost (#53398)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53398

ReactNativeHost is a legacy architecture class.
This migrates the app away from it and converts it to use DefaultReactHost instead.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D80708460

fbshipit-source-id: 7d88c440414c979a2968fc9c910e828f5851195c
2025-08-21 11:16:20 -07:00
Nicola CortiandFacebook GitHub Bot d35ddb5e59 Delete unused DefaultReactHost.getDefaultReactHost() overload (#53396)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53396

This overload for `getDefaultReactHost` is missing the last 2 parameters
and provides the same default as the full method.

In OSS is unused as we used the one with `ReactNativeHost`.
I'm removing it as it's causing an overload resolution failure internally.

This won't be a breaking change for Kotlin users are the signatures are compatibles,
but it will be breaking for Java users. I've verified that there are no OSS users.

Developers should use Kotlin default parameters + the method `getDefaultReactHost()`
with all the params + defaults for ease of use of this API.

Changelog:
[Android] [Removed] - Delete unused `DefaultReactHost.getDefaultReactHost()` overload

Reviewed By: mdvacca

Differential Revision: D80704987

fbshipit-source-id: 0b3a61aad3f18cde77bac78e3ba413d7f9166ede
2025-08-21 11:16:20 -07:00
Nicola CortiandFacebook GitHub Bot 8e514a8a10 Annotate ReactNativeJNISoLoader as InteropLegacyArchitecture (#53406)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53406

The `ReactNativeJNISoLoader` class (previously called BridgeSoLoader)
is actually a Legacy Architecture class.
However is used by `CxxModuleWrapperBase` which is needed by interop, so we need to keep it around.
I'm adding the annotation so we won't forget about it.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D80710951

fbshipit-source-id: ed353e2b14c742b25962f0b81beba6dc90157709
2025-08-21 10:52:56 -07:00
Nicola CortiandFacebook GitHub Bot e28784d4b6 Remove unnecessary NativeArgumentsParseException (#53408)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53408

This class is internal + legacy arch so can safely be removed now.
I've replaced the throw/catch site with the superclass of this exception.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D80710950

fbshipit-source-id: 96615835588ce409de40d31ee83b82c88d3a07a0
2025-08-21 10:52:56 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 28275a0f7b Fix Crash when rendering Switch component (#53393)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53393

When implementing the changes for the Switch component for iOS 26, I didn't realize that the code in [`RCTIntance.mm`](https://www.internalfb.com/code/fbsource/[a54514baccf4e1f828ef46af8180555754c405d8]/xplat/js/react-native-github/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm?lines=344-375) was running behind a feature flag.
This means that all the users not in the experiment where the feature flag is turned on will experience a crash as soon as they navigate to a React Native screen that contains a Switch.

This change fixes the problem by adding a jump to the right queue and it also fixes a measurement issue with the Switch.

## Changelog:
[iOS][Fixed] - Fixed a crash when rendering the Switch component

bypass-github-export-checks

Reviewed By: GijsWeterings

Differential Revision: D80702245

fbshipit-source-id: 480ea061233d35e31679b4b30758dbc133ff0a77
2025-08-21 10:13:22 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot bcf76e8bb0 Add RN feature flag for ScrollView view recycling (#53373)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53373

# Changelog:
[Internal] -

Creates a RN feature flag for enabling/disabling view recycling for ScrollView native component on Android.

Reviewed By: lenaic

Differential Revision: D80625656

fbshipit-source-id: 23eae07512e0ba2ea014404e7afa19db900f7c47
2025-08-21 09:47:23 -07:00
Lauren TanandFacebook GitHub Bot c2d96d3a5b Add flow suppression for Constant Condition rollout (#34243)
Summary: DiffTrain build for [83c7379b9601f25463826449256f0cd3d283702d](https://github.com/facebook/react/commit/83c7379b9601f25463826449256f0cd3d283702d)

Reviewed By: marcoww6

Differential Revision: D80661139

fbshipit-source-id: 8ccf2dccba9a07ffd38f50da2c1ded8ebfa78c89
2025-08-21 09:35:19 -07:00
Nicola CortiandFacebook GitHub Bot c557311ed8 Ship useNativeEqualsInNativeReadableArrayAndroid and useNativeTransformHelperAndroid to stable (#53372)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53372

We verified that those feature flags are not regressing the experience + we got confirmation from Software Mansion that the fix
is effectively mitigating the regression on Android mounting.

Hence we can ship this to production.

Fixes: https://github.com/facebook/react-native/issues/51869

Changelog:
[Android] [Fixed] - Fix mounting is very slow on Android by shipping native transform optimizations

Reviewed By: javache

Differential Revision: D80624739

fbshipit-source-id: 2e185434f08b5ea0339d59a6ea006017e5abeff2
2025-08-21 09:32:21 -07:00
Nicola CortiandFacebook GitHub Bot 3f74a87027 Reland: Remove deprecated DefaultReactHost.getDefaultReactHost() overload - part 1 & 2
Summary:
This is a reland of D80622058 + D80623826 + fixes for all the apps.

This method was deprecated in React Native 0.79. We should be able to remove it without impact in 0.82.
I also verified that there are no users of this API in OSS.

There is also a 1:1 replacement for this API which is the other non-deprecated `getDefaultReactHost()` method.

bypass-github-export-checks

Changelog:
[Internal] - Skipping changelog as main already contains a changelog entry

Reviewed By: javache

Differential Revision: D80704320

fbshipit-source-id: c9aa26b83dbd9f4bf97d0a9e9c6dcaa6eb0afdca
2025-08-21 09:31:30 -07:00
Christoph PurrerandFacebook GitHub Bot 9793542555 Align ImageManager and ImageFetcher requestImage API (#53382)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53382

changelog: [internal]

Reviewed By: rshest

Differential Revision: D80679608

fbshipit-source-id: 1a9b5f6a82b1f46e006983f5013272fca4e931bb
2025-08-21 08:46:32 -07:00
Rubén NorteandFacebook GitHub Bot b899e18d1c Do not report mount for mount items with empty surfaceId (#53391)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53391

Changelog: [internal]

Some mount items dispatched to Fabric don't have an associated surface ID (they use -1), which causes some log spam when we try to validate that the surface ID exist when we report mount for those surfaces.

This checks if the surface ID has a valid surface ID before adding it to the list of surfaces to report mount.

Reviewed By: rshest

Differential Revision: D80698363

fbshipit-source-id: 63dc13d53b8bbc2742171b1f444c80ce867e2351
2025-08-21 07:54:00 -07:00
Juan PenalozaandFacebook GitHub Bot aec35b8960 Revert D80622058: Remove deprecated DefaultReactHost.getDefaultReactHost() overload - part 1
Differential Revision:
D80622058

Original commit changeset: 4667683be151

Original Phabricator Diff: D80622058

fbshipit-source-id: c6c119df3b4f849a5c66fbbb619017ae837260c8
2025-08-21 06:26:35 -07:00
Juan PenalozaandFacebook GitHub Bot 3c79d7c18d Revert D80623826: Remove deprecated DefaultReactHost.getDefaultReactHost() overload - part 2
Differential Revision:
D80623826

Original commit changeset: f201e99f7cd4

Original Phabricator Diff: D80623826

fbshipit-source-id: 006bef0883f8cc82b333a68b9260b77afaae060f
2025-08-21 06:26:35 -07:00
Jakub PiaseckiandFacebook GitHub Bot 7f051c5470 Change leftover references to hermes.framework (#53390)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53390

Changelog: [General][Fixed] - Change leftover references to `hermes.framework` to `hermesvm.framework`

Reviewed By: cipolleschi

Differential Revision: D80701257

fbshipit-source-id: 9c0e8e49e50f515941e48de2219fb7730d8896bd
2025-08-21 06:24:32 -07:00
Nicola CortiandFacebook GitHub Bot 8bdb34732b Delete internal ReactPackageLogger as no longer necessary (#53387)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53387

This interface was internal and legacy arch only, so it can safely be removed.
I've also removed the logic inside `ReactInstanceManager` that was using it as no longer necessary.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D80626639

fbshipit-source-id: b173e71b92e29cebbfc5ed589e01ac295eda2bf0
2025-08-21 05:31:55 -07:00
Nicola CortiandFacebook GitHub Bot 4583fbe052 Deprecate BridgelessReactContext.getCatalystInstance() (#53388)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53388

This method is deprecated and should not be invoked in NewArch, therefore I'm deprecating it now.

Changelog:
[Android] [Deprecated] - Deprecate `BridgelessReactContext.getCatalystInstance()` method

Reviewed By: cipolleschi

Differential Revision: D80626638

fbshipit-source-id: d4ed26021c376f54c732154c153bf60fea2bf5e3
2025-08-21 05:31:55 -07:00
Nicola CortiandFacebook GitHub Bot fbef891573 Fix build race condition with preparePrefab missing 3p headers (#53384)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53384

Occasionally, the `preparePrefab` task might run before other tasks that
are responsible of populating the 3p headers, such as `prepareNative3pDependencies`.

This was evident in the latest nightly which is missing the fast_float headers in the
Android prefab.

Adding a dependsOn fixes it.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D80695212

fbshipit-source-id: 6e0dd17e5cf8c33d14812e5cb8fdc8b800897816
2025-08-21 05:31:40 -07:00
Nicola CortiandFacebook GitHub Bot bda6acf3b0 Remove deprecated DefaultReactHost.getDefaultReactHost() overload - part 2 (#53374)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53374

This method was deprecated in React Native 0.79. We should be able to remove it without impact in 0.82.
I also verified that there are no users of this API in OSS.

There is also a 1:1 replacement for this API which is the other non-deprecated getDefaultReactHost() method.

Changelog:
[Android] [Removed] - Remove deprecated DefaultReactHost.getDefaultReactHost() overload - part 2

Reviewed By: mdvacca

Differential Revision: D80623826

fbshipit-source-id: f201e99f7cd437a47919c36eced5637481151822
2025-08-21 04:51:13 -07:00
Nicola CortiandFacebook GitHub Bot 474f455a75 Remove deprecated DefaultReactHost.getDefaultReactHost() overload - part 1 (#53371)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53371

This method was deprecated in React Native 0.79. We should be able to remove it without impact in 0.82.
I also verified that there are no users of this API in OSS.

There is also a 1:1 replacement for this API which is the other non-deprecated `getDefaultReactHost()` method.

Changelog:
[Android] [Removed] - Remove deprecated DefaultReactHost.getDefaultReactHost() overload - part 1

Reviewed By: mdvacca

Differential Revision: D80622058

fbshipit-source-id: 4667683be151bc7ef1926a21306e088185695369
2025-08-21 04:51:13 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 2ad87cdc50 Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [A] [B] (#53385)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53385

Reviewed By: rshest

Differential Revision: D80617317

fbshipit-source-id: b06cb66d93b90c571f17184fa78a54f79f43b8a3
2025-08-21 04:32:52 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 5d41129ce1 Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages [A] [A] (#53386)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53386

Reviewed By: rshest

Differential Revision: D80617203

fbshipit-source-id: c38c3e69eda4d09b416270d4a672cc087b203b6a
2025-08-21 04:23:44 -07:00
Jakub PiaseckiandFacebook GitHub Bot 776fca1e7c Change hermes atrifact names (#53094)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53094

Changelog: [General][Changed] - Changed names of hermes binaries

Reviewed By: cipolleschi, cortinico

Differential Revision: D79163127

fbshipit-source-id: 54be34ba1f6ce90067768394ca9a6e9c4048be90
2025-08-21 04:00:04 -07:00
Alex HuntandFacebook GitHub Bot 3d1d81cddc Remove Perf Monitor hooks from DevSupport API (#53349)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53349

Follows feedback on D78904767, refactoring how we pass data to `PerfMonitorOverlayViewManager` to avoid API additions on `DevSupport`.

New interfaces under `com.facebook.react.devsupport.perfmonitor`:

- `PerfMonitorUpdateListener` is implemented by the view class to receive updates from the C++ `HostTargetDelegate`.
- `PerfMonitorInspectorTargetBinding` exposes an API on `ReactHostInspectorTarget` to send CDP actions down to C++ (stub for now).
- `PerfMonitorDevHelper` allows us to use the internal `ReactHostImplDevHelper` to expose the `ReactHostInspectorTarget` instance from the runtime.

Changelog: [Internal]

Reviewed By: cortinico, rshest

Differential Revision: D80464093

fbshipit-source-id: b88e270c0211e4adf52c015ac700df7f44945a5a
2025-08-21 03:06:52 -07:00
Alex HuntandFacebook GitHub Bot 62b8a7b4ef Switch Perf Monitor metric to Long Tasks (#53297)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53297

Pivots our display metric for the V2 Perf Monitor experiment by switching to Long Tasks.

- Implements a new "__ReactNative__LongTask" metrics event (note: prefixed, since this sits outside the Web Vitals spec).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D79556595

fbshipit-source-id: 239cf44884f67bf62295b92e2262ae1811d17e4a
2025-08-21 03:06:52 -07:00
Nick LefeverandFacebook GitHub Bot 70d5c97ab4 Make Text shadow nodes uncullable on Android (#53376)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53376

When encountering embedded <Text> components, with the parent <Text> component setting event handlers, culling away the child <Text> components will break the assignment of the event handlers to the text spans on Android.

This diff disables view culling on <Text> components so that event handlers would be correctly assigned to the text fragments once rendered.

Changelog: [Internal]

Reviewed By: andrewdacenko

Differential Revision: D80631997

fbshipit-source-id: f835a249fef1b448b884999ccd75ee06041eca70
2025-08-20 17:35:00 -07:00
Sam ZhouandFacebook GitHub Bot 0ef21bf8ad Update prettier-plugin-hermes-parser in fbsource to 0.32.0 (#53380)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53380

Bump prettier-plugin-hermes-parser to 0.32.0.

Changelog: [internal]

Reviewed By: gkz

Differential Revision: D80644889

fbshipit-source-id: 2d3904db1a4d3952e34267cdb748eef021f93a7b
2025-08-20 16:37:19 -07:00
Sam ZhouandFacebook GitHub Bot b23c558a20 Kill $FlowExpectedError as a type across fbsource (#53378)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53378

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D80573556

fbshipit-source-id: 4d8fc85d563977deb83abdd278175c960f54fd13
2025-08-20 13:35:28 -07:00
Sam ZhouandFacebook GitHub Bot 89fd398342 Update hermes-parser and related packages in fbsource to 0.32.0 (#53377)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53377

Bump hermes-parser and related packages to [0.32.0](https://github.com/facebook/hermes/blob/static_h/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: gkz

Differential Revision: D80622389

fbshipit-source-id: d35ad5179eacbc83132517e6b9c9436fda972d28
2025-08-20 11:45:16 -07:00
Joe VilchesandFacebook GitHub Bot 9f2389f074 Move enableAccessibilityOrder feature flag to experimental (#53375)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53375

We have seen sufficient internal signal to be confident that we can move this to the experimental release channel. Soon I will publish some experimental documentation and let folks in OSS know about this.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D80560366

fbshipit-source-id: 6a8cce39f823dfa313c8c51090eb88c31f1f9fd3
2025-08-20 10:35:11 -07:00
nishan (o^▽^o)andFacebook GitHub Bot 6da351a5ed fix(iOS)(Fabric) inline view alignment inside of a Text with line height (#53341)
Summary:
Addresses - https://github.com/facebook/react-native/issues/53092

Fixes inline `View` frame calculation that is nested inside of a `Text` with a `lineHeight`. The calculation for inline view frame is correct on [Paper](https://github.com/facebook/react-native/blob/25104de5c47845c0edbdfb38df30f8c406da832e/packages/react-native/Libraries/Text/Text/RCTTextShadowView.mm#L338). This PR uses the same calculation as Paper (use glyph height instead of baseline from layout manager).

jest_e2e[run_all_tests]

## Changelog:

[IOS] [FIXED] - Inline `View` alignment with `lineHeight` in Text

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/53341

Test Plan:
Make sure Text render is consistent on iOS and android and the View aligns with Text baseline with the provided [repro](https://github.com/facebook/react-native/issues/53092)

<img width="400" height="766" alt="Screenshot 2025-08-19 at 4 55 01 AM" src="https://github.com/user-attachments/assets/bc4e7473-8fe9-4596-a9ea-fd1204e4b3a3" />

Rollback Plan:

Reviewed By: christophpurrer

Differential Revision: D80525760

Pulled By: cipolleschi

fbshipit-source-id: 0152c35c56d8631942c0186f5dbe33c4a20a48c4
2025-08-20 07:40:54 -07:00
Rubén NorteandFacebook GitHub Bot 2ad845ccb2 Ship DOM APIs to stable (#53360)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53360

Changelog: [General][Breaking] -  Enable DOM APIs in host component refs

This ships DOM APIs to stable now that we have a cohesive API and it's been stable at Meta for a while.

This changes the `HostInstance` type (exported from the `react-native` package and used by all host components) from being an interface to being a class (`ReactNativeElement`).

**The API is backwards compatible** but given we're changing the definition of `HostInstance` from an interface to a class, this can be considered a **breaking change for TypeScript** (not at runtime).

## Previous API

- [`measure`](https://reactnative.dev/docs/the-new-architecture/layout-measurements#measurecallback)
- [`measureInWindow`](https://reactnative.dev/docs/the-new-architecture/layout-measurements#measureinwindowcallback)
- `measureLayout`
- [`setNativeProps`](https://reactnative.dev/docs/the-new-architecture/direct-manipulation-new-architecture#setnativeprops-to-edit-textinput-value)

## New API

From [`HTMLElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement):

- Properties
  - [`offsetHeight`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight)
  - [`offsetLeft`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetLeft)
  - [`offsetParent`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent)
  - [`offsetTop`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetTop)
  - [`offsetWidth`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetWidth)
- Methods
  - [`blur`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/blur).
    - This method was also [available](/docs/next/legacy/direct-manipulation#blur) in the legacy architecture.
  - [`focus`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus).
    - This method was also [available](/docs/next/legacy/direct-manipulation#focus) in the legacy architecture.
    - The `options` parameter is not supported.

From [`Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element):

- Properties
  - [`childElementCount`](https://developer.mozilla.org/en-US/docs/Web/API/Element/childElementCount)
  - [`children`](https://developer.mozilla.org/en-US/docs/Web/API/Element/children)
  - [`clientHeight`](https://developer.mozilla.org/en-US/docs/Web/API/Element/clientHeight)
  - [`clientLeft`](https://developer.mozilla.org/en-US/docs/Web/API/Element/clientLeft)
  - [`clientTop`](https://developer.mozilla.org/en-US/docs/Web/API/Element/clientTop)
  - [`clientWidth`](https://developer.mozilla.org/en-US/docs/Web/API/Element/clientWidth)
  - [`firstElementChild`](https://developer.mozilla.org/en-US/docs/Web/API/Element/firstElementChild)
  - [`id`](https://developer.mozilla.org/en-US/docs/Web/API/Element/id)
    - Returns the value of the `id` or `nativeID` props.
  - [`lastElementChild`](https://developer.mozilla.org/en-US/docs/Web/API/Element/lastElementChild)
  - [`nextElementSibling`](https://developer.mozilla.org/en-US/docs/Web/API/Element/nextElementSibling)
  - [`nodeName`](https://developer.mozilla.org/en-US/docs/Web/API/Element/nodeName)
  - [`nodeType`](https://developer.mozilla.org/en-US/docs/Web/API/Element/nodeType)
  - [`nodeValue`](https://developer.mozilla.org/en-US/docs/Web/API/Element/nodeValue)
  - [`previousElementSibling`](https://developer.mozilla.org/en-US/docs/Web/API/Element/previousElementSibling)
  - [`scrollHeight`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight)
  - [`scrollLeft`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft)
    - For built-in components, only `ScrollView` instances can return a value other than zero.
  - [`scrollTop`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop)
    - For built-in components, only `ScrollView` instances can return a value other than zero.
  - [`scrollWidth`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollWidth)
  - [`tagName`](https://developer.mozilla.org/en-US/docs/Web/API/Element/tagName)
    - Returns a normalized native component name prefixed with `RN:`, like `RN:View`.
  - [`textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Element/textContent)
- Methods
  - [`getBoundingClientRect`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect)
  - [`hasPointerCapture`](https://developer.mozilla.org/en-US/docs/Web/API/Element/hasPointerCapture)
  - [`setPointerCapture`](https://developer.mozilla.org/en-US/docs/Web/API/Element/setPointerCapture)
  - [`releasePointerCapture`](https://developer.mozilla.org/en-US/docs/Web/API/Element/releasePointerCapture)

From [`Node`](https://developer.mozilla.org/en-US/docs/Web/API/Node):

- Properties
  - [`childNodes`](https://developer.mozilla.org/en-US/docs/Web/API/Node/childNodes)
  - [`firstChild`](https://developer.mozilla.org/en-US/docs/Web/API/Node/firstChild)
  - [`isConnected`](https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected)
  - [`lastChild`](https://developer.mozilla.org/en-US/docs/Web/API/Node/lastChild)
  - [`nextSibling`](https://developer.mozilla.org/en-US/docs/Web/API/Node/nextSibling)
  - [`nodeName`](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeName)
  - [`nodeType`](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType)
  - [`nodeValue`](https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeValue)
  - [`ownerDocument`](https://developer.mozilla.org/en-US/docs/Web/API/Node/ownerDocument)
    - Will return the [document instance](/docs/next/document-instances) where this component was rendered.
  - [`parentElement`](https://developer.mozilla.org/en-US/docs/Web/API/Node/parentElement)
  - [`parentNode`](https://developer.mozilla.org/en-US/docs/Web/API/Node/parentNode)
  - [`previousSibling`](https://developer.mozilla.org/en-US/docs/Web/API/Node/previousSibling)
  - [`textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent)
- Methods
  - [`compareDocumentPosition`](https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition)
  - [`contains`](https://developer.mozilla.org/en-US/docs/Web/API/Node/contains)
  - [`getRootNode`](https://developer.mozilla.org/en-US/docs/Web/API/Node/getRootNode)
  - [`hasChildNodes`](https://developer.mozilla.org/en-US/docs/Web/API/Node/hasChildNodes)

### Legacy API

- [`measure`](https://reactnative.dev/docs/the-new-architecture/layout-measurements#measurecallback)
- [`measureInWindow`](https://reactnative.dev/docs/the-new-architecture/layout-measurements#measureinwindowcallback)
- `measureLayout`
- [`setNativeProps`](https://reactnative.dev/docs/the-new-architecture/direct-manipulation-new-architecture#setnativeprops-to-edit-textinput-value)

### New APIs

Additionally, this exposes access to document nodes and text nodes that were not available before.

This will be properly documented on the website at part of the release of 0.82, that will contain this changes.

Reviewed By: GijsWeterings

Differential Revision: D78562721

fbshipit-source-id: 139aee6969f3ecdc65cffcd31cd1754f367d9122
2025-08-20 07:18:00 -07:00
Riccardo CipolleschiandFacebook GitHub Bot e04bbf0497 Fix E2E Tests by configuring git (#53357)
Summary:
E2E tests on iOS started failing yesterday because of some permission model that has changed in Github.

When creating a new app from the template, we initialize a git repository. The initialization started failing with the error:
```
debug Could not create an empty Git repository, error: , Error: Command failed with exit code 128: git commit -m Initial commit

Author identity unknown

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'runner@sat12-jr314_3f88162a-0f3d-4d26-80dc-58f431cca4c6-9A2607311B51.(none)')
```

This change fixes it by setting a default identity for git in the CI jobs that requires it.

## Changelog:
[Internal] -

Pull Request resolved: https://github.com/facebook/react-native/pull/53357

Test Plan: GHA

Reviewed By: cortinico

Differential Revision: D80612345

Pulled By: cipolleschi

fbshipit-source-id: 85816057d910ed3619c5f683fdad724c3df8046b
2025-08-20 06:58:36 -07:00
Rubén NorteandFacebook GitHub Bot 78f089906c Use React Native built-in definitions for Event and EventTarget in Fantom (#53362)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53362

Changelog: [internal]

This just replaces the polyfills for `Event` and `EventTarget` that we're defining inline in Fantom with the implementations that already exist in RN.

Reviewed By: javache

Differential Revision: D80612067

fbshipit-source-id: 047c8f12cbb1f4afea2d05a5a1235d9dff2e25f9
2025-08-20 06:01:22 -07:00
Nicola CortiandFacebook GitHub Bot 8480386d50 Disable running ktfmtCheck due to diverging ktfmt versions (#53359)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53359

A new version of ktfmt broke the OSS CI build for React Native.
That's due to us running still on the older version of ktfmt, as the newer version hasn't been released yet.

I'm temporarly disabling the `ktfmtCheck` jobs because we primarly check formatting from within fbsource.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D80610450

fbshipit-source-id: 846249780f979788356404205d8b8e37fc54a255
2025-08-20 05:42:32 -07:00
Rubén NorteandFacebook GitHub Bot 9910981d3a Simplify RendererImplementation (#53351)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53351

Changelog: [internal]

This refactors `RendererImplementation` to reduce boilerplate code from exporting existing methods from Fabric or Paper.

Reviewed By: lenaic

Differential Revision: D80532479

fbshipit-source-id: ae70bb50f0d2fbf7aee95efd39d9716f0c3a8a90
2025-08-20 03:53:44 -07:00
Nivaldo BondançaandFacebook GitHub Bot d1a1020a4a Codemod format for trailing commas change
Reviewed By: VladimirMakaev

Differential Revision: D80576929

fbshipit-source-id: 1310f77f5d9d489b780b14875454ebda7f7adfc9
2025-08-19 18:15:18 -07:00
David VaccaandFacebook GitHub Bot fb84932e48 Deprecate ReactInstanceManager and ReactInstanceManagerBuilder (#53150)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53150

ReactInstanceManager and ReactInstanceManagerBuilder are legacy architecture classes that will be deleted in the future, in this diff we are deprecating them

changelog: [Android][Changed] Deprecate legacy architecture classes ReactInstanceManager and ReactInstanceManagerBuilder, these classes will be deleted in a future release

Reviewed By: mlord93

Differential Revision: D79677828

fbshipit-source-id: 2d79736d94a55e44dd24056985f358e3650ddf6c
2025-08-19 16:51:43 -07:00
Alex HuntandFacebook GitHub Bot 3f848e7a54 Fix test setup for flag used early in HostTarget, restore value (#53355)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53355

Follows D80000286, where this flag was forcibly disabled to fix tests.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D80545210

fbshipit-source-id: 585122ff73e4979c398be6eb03000936d6bd5ce1
2025-08-19 11:40:24 -07:00
Alex HuntandFacebook GitHub Bot df748ba083 Implement Perf Monitor event scoring and display timeout (#53169)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53169

Improves the experimental Perf Monitor UI sufficient for the initial MVP.

- Sets minimum duration threshold to display an event to 10ms.
- Impelements [responsiveness scoring](https://web.dev/articles/inp#good-score) linked to UI colour and display timeout.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D79359131

fbshipit-source-id: f08d2b595e885342d841c3a02b9e02456502c926
2025-08-19 11:19:09 -07:00
generatedunixname89002005287564andFacebook GitHub Bot defefb19e3 Fix CQS signal modernize-use-designated-initializers in xplat/js/react-native-github/packages (#53352)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53352

Reviewed By: cipolleschi

Differential Revision: D80516836

fbshipit-source-id: 28d10e5d1b9d476924c8e73526e164ff98e12be1
2025-08-19 09:53:13 -07:00
Riccardo CipolleschiandFacebook GitHub Bot ba51aeaa90 Fix Switch layout with iOS26 (#53247)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53247

Apple changed the sizes of the UISwitchComponent and now, if you build an iOs app using the <Switch> component, the layout of the app will be broken because of wrong layout measurements.
This has been reported also by [https://github.com/facebook/react-native/issues/52823](https://github.com/facebook/react-native/issues/52823).

The `<Switch>` component was using hardcoded values for its size.
This change fixes the problem by:
- Using codegen for interface only
- Implementing a custom Sadow Node to ask the platform for the Switch measurements
- Updating the JS layout to wrap the size around the native component.

## Changelog:

[iOS][Fixed] - Fix Switch layout to work with iOS26

Pull Request resolved: https://github.com/facebook/react-native/pull/53067

Test Plan:
Tested locally with RNTester.

| iOS Version | Before | After |
| --- | --- | --- |
| < iOS 26 | https://github.com/user-attachments/assets/91d73ea3-30ba-4a5c-948e-ea5c63aa7c6d | https://github.com/user-attachments/assets/76061bc8-0f14-412a-a8fb-d1c3951772e6 |
| >= iOS 26 | https://github.com/user-attachments/assets/1abc477f-bc0a-4762-938e-98814fb2a054 | https://github.com/user-attachments/assets/77e562e1-b803-46ac-9cf6-102f062a1cd4 |

Rollback Plan:

Reviewed By: sammy-SC

Differential Revision: D79653120

Pulled By: cipolleschi

fbshipit-source-id: d99b353b7b7b5496b148779de4abe3e57dd38156
2025-08-19 06:53:44 -07:00
Rubén NorteandFacebook GitHub Bot 24657ad5c4 Optimize DOM APIs (#53332)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53332

Changelog: [internal]

This implements several optimizations to speed up DOM traversal APIs.

The main changes are:
1. Better caching of renderer methods in `RendererImplementation`.
2. Faster access to public instances from instance handles (avoids `instanceof` checks if the nodes are `ReactNativeElement`, which is the most common case).
3. Avoiding unnecessary function calls in `NativeDOM` but removing the proxy object.
4. Removal of private fields from `HTMLCollection` and `NodeList`, and reuse the object to define object properties.
5. Avoiding unnecessary array copies in `getChildNodes`.

Results:

| Property / method               | Latency before (ns) | Latency after (ns) | Difference |
| ----------------------- | ------------------------- | ------------------------ | ---------- |
| parentNode              | 3996                      | 2203                     | -44.87%   |
| parentElement           | 4347                      | 2524                     | -41.94%   |
| childNodes              | 6590                      | 3886                     | -41.03%   |
| children                | 6950                      | 4126                     | -40.63%   |
| firstChild              | 5008                      | 2975                     | -40.60%   |
| firstElementChild       | 5408                      | 3215                     | -40.55%   |
| lastChild               | 5048                      | 2974                     | -41.09%   |
| lastElementChild        | 5448                      | 3215                     | -40.99%   |
| childElementCount       | 5378                      | 3175                     | -40.96%   |
| previousSibling         | 12118                     | 6780                     | -44.05%   |
| previousElementSibling  | 12148                     | 6850                     | -43.61%   |
| nextSibling             | 12139                     | 6800                     | -43.98%   |
| nextElementSibling      | 12119                     | 6830                     | -43.64%   |
| offsetParent            | 5097                      | 3725                     | -26.92%   |
| isConnected             | 2774                      | 1733                     | -37.53%   |
| ownerDocument           | 691                       | 681                      | -1.45%    |
| getRootNode()           | 3195                      | 2154                     | -32.58%   |
| hasChildNodes()         | 4997                      | 2854                     | -42.89%   |

Reviewed By: mdvacca

Differential Revision: D80449030

fbshipit-source-id: 6b3abecbbf6aa23bc99ab65cf22ed33721dc5459
2025-08-19 06:06:52 -07:00
Rubén NorteandFacebook GitHub Bot b7b83cda0a Remove nullability from NativeDOM.setNativeProps (#53331)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53331

Changelog: [internal]

This change was shipped 3 months ago so we can assume the native method will always have this method and don't need to keep backwards compatibility.

Reviewed By: rshest

Differential Revision: D80449031

fbshipit-source-id: 4ff11b81478701ad712b4e097625e569829f6480
2025-08-19 06:06:52 -07:00
Rubén NorteandFacebook GitHub Bot 9301badec1 Remove nullability from NativePerformance module methods (#53330)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53330

Changelog: [internal]

These methods have been defined for a month, so it's safe to make then non-nullable already.

Reviewed By: GijsWeterings

Differential Revision: D80453413

fbshipit-source-id: 3fde076622dc9d510bad144300364401f2319507
2025-08-19 06:06:52 -07:00
Rubén NorteandFacebook GitHub Bot 14718b20c6 Prepare Flow types for change in HostInstance (#53318)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53318

Changelog: [internal]

This prepares the codebase for an eventual migration of `HostInstance` to `ReactNativeElement`, so the actual migration doesn't need to adjust so much existing code.

Reviewed By: rshest

Differential Revision: D80399739

fbshipit-source-id: 441d3e92ef6dff253343d1058b2027698e8ecb22
2025-08-19 06:06:35 -07:00
Andrew DatsenkoandFacebook GitHub Bot e7d89fa53a Add support for perfetto on Windows tracing (#53340)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53340

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D80471173

fbshipit-source-id: 54f24c9c6868dae2042d324c8aed87726ede05a8
2025-08-19 05:38:12 -07:00
Samuel SuslaandFacebook GitHub Bot 8197399e43 ship fix to a crash in differentiator (#53346)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53346

changelog: [internal]

ship fix for a rare crash in differentiator.

Reviewed By: rshest

Differential Revision: D80459923

fbshipit-source-id: 308f513fca4787a01250ba25d8ce73db84fa83a5
2025-08-19 04:39:04 -07:00
generatedunixname537391475639613andFacebook GitHub Bot 4a48364639 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.kt (#53348)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53348

Reviewed By: cortinico, rshest

Differential Revision: D80443954

fbshipit-source-id: 4a45508aa0249b86adc96b1ebd62f2e409b3aac2
2025-08-19 04:31:16 -07:00
Christian FalchandFacebook GitHub Bot e3adf47214 fixed copying bundles correctly (#53325)
Summary:
When copying bundle files from the platform folders in the .build output, the script had a bug where all bundles were copied - meaning that only the last one would be in the resulting xcframework output.

This caused an issue when we tried to publish an app built with precompiled binaries to AppStore where the field `CFBundleSupportedPlatforms` was wrong and caused the submission to be rejected. This was caused by the script copying the wrong bundle file into the final xcframework outputs.

This issue is described here:
https://github.com/react-native-community/discussions-and-proposals/discussions/923#discussioncomment-14089245

This commit fixes the above error by using the iOS 15 `vtool` to show the actual platform for a given framework and then making sure we don't copy bundles in the wrong way.

Testing this on my local machine for iOS/iOS-simulator/MacOS/catalyst yields the following results (before/after this fix):

**Before:**

```bash
Copying bundles to the framework...
  ../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → ios-arm64
  ../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → ios-arm64
  ../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → ios-arm64
  ../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → ios-arm64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → ios-arm64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → ios-arm64
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
```

  **After:**

```bash
  Copying bundles to the framework...
  ../.build/Build/Products/Debug/ReactNativeDependencies_glog.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug/ReactNativeDependencies_boost.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug/ReactNativeDependencies_folly.bundle → macos-arm64_x86_64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_glog.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_boost.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphoneos/ReactNativeDependencies_folly.bundle → ios-arm64
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-iphonesimulator/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-simulator
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_glog.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_boost.bundle → ios-arm64_x86_64-maccatalyst
  ../.build/Build/Products/Debug-maccatalyst/ReactNativeDependencies_folly.bundle → ios-arm64_x86_64-maccatalyst
```

## Changelog:

[IOS] [FIXED] - Fixed copying bundles correctly to xcframeworks when precompiling ReactNativeDependencies.xcframework

Pull Request resolved: https://github.com/facebook/react-native/pull/53325

Test Plan: Ensure that the info.plist files in the nightlies for the ReactNativeDepdendencies.xcframework has the correct bundles for its targets.

Reviewed By: andrewdacenko

Differential Revision: D80457335

Pulled By: cipolleschi

fbshipit-source-id: aeb4166f66218f72bdd29b6fc579fcc7b6d12844
2025-08-19 02:47:40 -07:00
Nicola CortiandFacebook GitHub Bot 59cc1738d7 Add missing headers from react_performance_cdpmetrics to prefab (#53304)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53304

The headers from `react_performance_cdpmetrics` are currently missing in the libreactnative.so prefab.

They're actually references from `Scheduler.h` and this is causing `react-native-screens` to fail compiling
with:

```
  In file included from /tmp/RNApp/node_modules/react-native-screens/android/src/main/cpp/NativeProxy.cpp:3:
  /home/runner/.gradle/caches/8.14.3/transforms/97716233b9aa00728d9cac038eecaf3d/transformed/react-android-0.82.0-nightly-20250815-41029d8e9-SNAPSHOT-debug/prefab/modules/reactnative/include/react/renderer/scheduler/Scheduler.h:13:10: fatal error: 'react/performance/cdpmetrics/CdpMetricsReporter.h' file not found
     13 | #include <react/performance/cdpmetrics/CdpMetricsReporter.h>
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  [4/6] Building CXX object CMakeFiles/rnscreens.dir/tmp/RNApp/node_modules/react-native-screens/cpp/RNSScreenRemovalListener.cpp.o
  [5/6] Building CXX object CMakeFiles/rnscreens.dir/src/main/cpp/OnLoad.cpp.o
```

See here https://github.com/react-native-community/nightly-tests/actions/runs/16991637594/job/48172255960
I saw this was added on D78904748

Here I'm exposing the headers from `react_performance_cdpmetrics` to the prefab API so users in OSS can
access those headers as well.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D80344762

fbshipit-source-id: 29b09b94370b71a16ecf12d4cca9cd571c588e5c
2025-08-19 02:34:22 -07:00
Marco WangandFacebook GitHub Bot 8351a5d186 Pre-Suppress errors for xplat/js for general strict comparison in non-generated files (#53342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53342

Commands

```
scripts/flow/tool add-comments --comment 'Error discovered during Constant Condition roll out. See https://fburl.com/workplace/4oq3zi07.' .
```
```
arc f
```

drop-conflicts

Reviewed By: SamChou19815

Differential Revision: D80487235

fbshipit-source-id: 9e7c1a2641ddc0da0400fa1aff598b112a0434d5
2025-08-19 01:09:22 -07:00
Luna WeiandFacebook GitHub Bot 25104de5c4 Return ScrollView clipping rect (#53289)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53289

Changelog: [Internal] - Support subview clipping for VirtualView

Reviewed By: yungsters

Differential Revision: D80145954

fbshipit-source-id: f7886440c4aecd8d50141e78f1050e94c2d7230a
2025-08-18 13:59:47 -07:00
Luna WeiandFacebook GitHub Bot 21008c9992 Dispatch mode changes on onSizeChanged (#53339)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53339

Changelog: [Internal] - onSizeChanged can be called independent of onLayoutChange. Right now this hasn't affeced anything because VirtualViews are visible by default.

Reviewed By: yungsters

Differential Revision: D80357397

fbshipit-source-id: 06b174791dec0d19da6bbe1a8144d35b93b8f6c1
2025-08-18 13:59:47 -07:00
Alex HuntandFacebook GitHub Bot bda85b8244 Bump Electron to 37.2.6 (#53337)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53337

Bump for security update.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D80462100

fbshipit-source-id: 4dff6b17337e031321d6549c86ca2cecec742acc
2025-08-18 13:19:47 -07:00
Devan BuggayandFacebook GitHub Bot 32d37f03ad Long press back to open DevMenu (#53189)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53189

In addition to the menu button and long pressing fast forward option, adds long pressing back as an option to open DevTools for devices like the Chromecast remote.

Changelog:
[Android][Added] - Add long-press back as an option to open the DevMenu for devices that lack menu & fast-forward.

{F1981060943}

Reviewed By: alanleedev

Differential Revision: D79923779

fbshipit-source-id: b758d591ebe3b8e601dbf704212123451e3c32e1
2025-08-18 12:18:59 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 1d4c9f96e4 Fix CQS signal readability-static-definition-in-anonymous-namespace in xplat/js/react-native-github/packages (#53327)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53327

Reviewed By: rshest

Differential Revision: D80441223

fbshipit-source-id: 0d4dc19a5e0a2c1babf20a4a46aeb88950d0d5b9
2025-08-18 11:49:03 -07:00
Devan BuggayandFacebook GitHub Bot b1642ad5b6 Scope HighContrastText to correct Settings namespace (#53219)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53219

`ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED_CONSTANT` is a `Secure` setting, not a `Global` one:

See fbandroid/java/com/facebook/fbreact/libraries/accessibilityinfosync/ReactAccessibilityInfoSync.kt

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D77977362

fbshipit-source-id: 2268e2fd8b966a02bcfac67e21b5c23cc76a3b95
2025-08-18 11:14:29 -07:00
Nivaldo BondançaandFacebook GitHub Bot 2b190f2029 Codemod format for trailing commas incoming change [300/n] (#53338)
Summary:
X-link: https://github.com/facebook/yoga/pull/1848

Pull Request resolved: https://github.com/facebook/react-native/pull/53338

Adding trailing commas to folders:
- xplat/js/react-native-github/packages/react-native
- xplat/kotlin/ast_tools/core/src
- xplat/kotlin_compiler_plugins/template/src/main
- xplat/kotlin/kotlin_multiplatform_template/src/commonMain
- xplat/libraries/bloks/bloks-debugging/src
- xplat/libraries/bloks/bloks-lispy/src
- xplat/libraries/bloks/bloks-step-debugger/src
- xplat/mdv/uifiddle-prototype/android-server/playground
- xplat/mdv/uifiddle-prototype/android-server/server
- xplat/oxygen/common/src/test
- xplat/oxygen/mpts/src/main
- xplat/oxygen/mpts/src/test
- xplat/prototypes/smartglasses/AndroidStudioProjects/MetaAccessoryTest
- xplat/prototypes/smartglasses/AndroidStudioProjects/MetaWearableSDKSampleApp
- xplat/prototypes/smartglasses/AndroidStudioProjects/MetaWearableSDK
- xplat/prototypes/smartglasses/AndroidStudioProjects/Voice
- xplat/ReactNative/react-native-cxx/react/renderer
- xplat/rtc/media/tools/audio
- xplat/security/prodsec/android/codetransparency
- xplat/security/prodsec/siggy/java
- xplat/simplesql/codegen/java/com
- xplat/sonar/android/plugins/jetpack-compose
- xplat/sonar/android/plugins/leakcanary2
- xplat/sonar/android/plugins/litho
- xplat/sonar/android/plugins/retrofit2-protobuf
- xplat/sonar/android/sample/src
- xplat/sonar/android/src/facebook

Reviewed By: dtolnay

Differential Revision: D80452590

fbshipit-source-id: 2bc79edba21e913f6121a25a269c1a4258f5f31c
2025-08-18 10:24:50 -07:00
Devan BuggayandFacebook GitHub Bot 775daf5972 Remove "bridgeless" from React Native Dev Menu (#53336)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53336

No longer needed as bridgeless is enabled everywhere.

Changelog:
[iOS][Deprecated] Remove bridge mode title and description from React Native Dev Menu title

Reviewed By: christophpurrer

Differential Revision: D80457504

fbshipit-source-id: bf21e44ed925f4777d0190313c6e4aad774abe42
2025-08-18 10:22:12 -07:00
Devan BuggayandFacebook GitHub Bot 1c838f32a9 Remove "bridgeless" from React Native Dev Menu (#53335)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53335

No longer needed as bridgeless is enabled everywhere.

Changelog:
[Android][Deprecated] Remove bridge mode string from React Native Dev Menu title

Reviewed By: christophpurrer

Differential Revision: D80457625

fbshipit-source-id: 4cf602a90f29d5495a5e8a4ccaf49abb96e85f94
2025-08-18 10:22:12 -07:00
Devan BuggayandFacebook GitHub Bot 635c707eec Wire through landingView parameter (#52947)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52947

Wires up a `landingView` parameter to be passed to rn_fusebox.html that we can use to focus an arbitrary view on launch. Used from the new perf analyze scenario to open devtools on the performance panel.

Changelog:
[Android][Added] - Adds a landing view parameter to opening RNDT, enabling arbitrary view focus on launch.

Reviewed By: hoxyq

Differential Revision: D79329081

fbshipit-source-id: b1513a803f4add803100cebd08f53e59a08e64d4
2025-08-18 10:20:43 -07:00
Sam ZhouandFacebook GitHub Bot cf664c65e2 Standardize subtyping error code into incompatible-type in react native and metro (#53312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53312

Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D80400976

fbshipit-source-id: 196af69c0b9621b2a2675b232406639773e04933
2025-08-18 09:04:31 -07:00
Rubén NorteandFacebook GitHub Bot ffac8f8ef0 Add benchmark for traversal methods in ReactNativeElement (#53329)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53329

Changelog: [internal]

This adds an initial set of benchmarks for the traversal methods in the DOM API.

Baseline:

| (index) | Task name                | Latency avg (ns) | Latency med (ns) | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | ------------------------ | ---------------- | ---------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'noop'                   | '366.76 ± 0.26%' | '351.00 ± 10.00' | '2766891 ± 0.08%'      | '2849003 ± 83548'      | 50000   |
| 1       | 'parentNode'             | '4158.1 ± 0.08%' | '4126.0 ± 50.00' | '241467 ± 0.04%'       | '242365 ± 2913'        | 50000   |
| 2       | 'parentElement'          | '4372.6 ± 0.08%' | '4336.0 ± 51.00' | '229603 ± 0.04%'       | '230627 ± 2690'        | 50000   |
| 3       | 'childNodes'             | '6698.5 ± 1.17%' | '6550.0 ± 71.00' | '151718 ± 0.04%'       | '152672 ± 1673'        | 50000   |
| 4       | 'children'               | '7134.4 ± 0.70%' | '6980.0 ± 80.00' | '141984 ± 0.05%'       | '143266 ± 1643'        | 50000   |
| 5       | 'firstChild'             | '5141.7 ± 1.29%' | '5038.0 ± 70.00' | '197249 ± 0.04%'       | '198491 ± 2720'        | 50000   |
| 6       | 'firstElementChild'      | '5508.1 ± 0.90%' | '5408.0 ± 70.00' | '183835 ± 0.04%'       | '184911 ± 2425'        | 50000   |
| 7       | 'lastChild'              | '5121.7 ± 0.93%' | '5038.0 ± 70.00' | '197432 ± 0.04%'       | '198491 ± 2720'        | 50000   |
| 8       | 'lastElementChild'       | '5519.5 ± 1.17%' | '5409.0 ± 71.00' | '183799 ± 0.04%'       | '184877 ± 2459'        | 50000   |
| 9       | 'childElementCount'      | '5492.0 ± 1.41%' | '5369.0 ± 69.00' | '185136 ± 0.04%'       | '186254 ± 2363'        | 50000   |
| 10      | 'previousSibling'        | '12558 ± 0.61%'  | '12059 ± 101.00' | '80927 ± 0.08%'        | '82926 ± 700'          | 50000   |
| 11      | 'previousElementSibling' | '12246 ± 0.74%'  | '12059 ± 101.00' | '82377 ± 0.03%'        | '82926 ± 700'          | 50000   |
| 12      | 'nextSibling'            | '12170 ± 0.44%'  | '12028 ± 91.00'  | '82707 ± 0.03%'        | '83139 ± 627'          | 50000   |
| 13      | 'nextElementSibling'     | '12213 ± 0.67%'  | '12048 ± 100.00' | '82543 ± 0.03%'        | '83001 ± 683'          | 50000   |
| 14      | 'offsetParent'           | '5197.5 ± 0.85%' | '5138.0 ± 60.00' | '193768 ± 0.04%'       | '194628 ± 2300'        | 50000   |
| 15      | 'isConnected'            | '2857.8 ± 2.84%' | '2794.0 ± 41.00' | '356463 ± 0.04%'       | '357910 ± 5198'        | 50000   |
| 16      | 'ownerDocument'          | '714.65 ± 0.15%' | '711.00 ± 20.00' | '1407540 ± 0.04%'      | '1406470 ± 40350'      | 50000   |
| 17      | 'getRootNode()'          | '3297.7 ± 2.26%' | '3235.0 ± 50.00' | '307892 ± 0.04%'       | '309119 ± 4853'        | 50000   |
| 18      | 'hasChildNodes()'        | '5005.9 ± 0.85%' | '4898.0 ± 61.00' | '202735 ± 0.05%'       | '204165 ± 2575'        | 50000   |

Reviewed By: andrewdacenko

Differential Revision: D80449032

fbshipit-source-id: c9e72a5144b0664dae776101fe18899203b9735b
2025-08-18 08:57:52 -07:00
Rubén NorteandFacebook GitHub Bot 2726c1ab7c Make benchmark for ReactFabricPublicInstance more accurate (#53319)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53319

Changelog: [internal]

We have a microbenchmark for `ReactFabricHostComponent` vs. `ReactNativeElement` but the test code itself is so fast that a big part of its duration is just calling the test function (a noop is 300-500ns, while the duration of these benchmarks is between 800 and 1400ns).

Note that this affects all tests the same way, so the absolute difference in execution time in both tests was still accurate.

This changes how we execute the benchmarks so the test function runs the code under test multiple times and we then report the average of all the runs using the new `overriddenDuration` option.

Before:

| (index) | Task name                  | Latency avg (ns) | Latency med (ns) | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | -------------------------- | ---------------- | ---------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'noop'                     | '353.83 ± 0.03%' | '350.00 ± 10.00' | '2856842 ± 0.01%'      | '2857143 ± 84034'      | 2826221 |
| 1       | 'ReactNativeElement'       | '1393.8 ± 1.15%' | '1332.0 ± 20.00' | '745853 ± 0.01%'       | '750751 ± 11444'       | 717480  |
| 2       | 'ReactFabricHostComponent' | '884.92 ± 0.59%' | '871.00 ± 21.00' | '1144283 ± 0.01%'      | '1148106 ± 27029'      | 1130046 |

After:

| (index) | Task name                  | Latency avg (ns) | Latency med (ns) | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | -------------------------- | ---------------- | ---------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'noop'                     | '400.11 ± 0.30%' | '391.00 ± 10.00' | '2532882 ± 0.07%'      | '2557545 ± 67127'      | 50000   |
| 1       | 'ReactNativeElement'       | '868.04 ± 0.04%' | '859.39 ± 4.41'  | '1153974 ± 0.03%'      | '1163616 ± 6002'       | 50000   |
| 2       | 'ReactFabricHostComponent' | '388.79 ± 0.08%' | '384.18 ± 1.91'  | '2579763 ± 0.03%'      | '2602947 ± 13006'      | 50000   |

Reviewed By: rshest

Differential Revision: D80404122

fbshipit-source-id: 7dc6ad34b2e8aa3cb6d62008f97d1c44e325ab27
2025-08-18 08:57:52 -07:00
Rubén NorteandFacebook GitHub Bot 6b4af382c2 Apply better default options in benchmarks (#53320)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53320

Changelog: [internal]

This improves the defaults the options related to minimum number of iterations and test duration in benchmarks.

If you indicate a minimum duration, we set the minimum number of iterations so the duration is honored. We do the same if what's specified is the number of iterations.

This is useful when you want to make sure all the tests in a benchmark suite use the same number of iterations without having to explicitly set the time to 0 in all of them.

It also changes the default for warmup iterations to be just 1 (that's enough to load all modules and all the code into memory).

Reviewed By: rshest

Differential Revision: D80405287

fbshipit-source-id: 41a61c4d1979db6a25dd30f0c84b5de319416885
2025-08-18 08:57:52 -07:00
Rubén NorteandFacebook GitHub Bot 219fc99e99 Rename minDuration as minTestExecutionTime for clarity (#53321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53321

Changelog: [internal]

Just a rename to make it easier to understand.

Reviewed By: rshest

Differential Revision: D80404378

fbshipit-source-id: 3d7e89797be3b92599e07b4b64d2a720756a4f3b
2025-08-18 08:57:52 -07:00
Rubén NorteandFacebook GitHub Bot 6c37b5b682 Improve typing of benchmark functions (#53322)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53322

Changelog: [internal]

This changes the types for benchmark functions to improve safety:
1. It makes the return object be an object instead of an interface, to catch when `overriddenDuration` is misspelled.
2. It makes the function always synchronous, as asynchronous tests aren't supported in Fantom (even though they are in `tinybench`).

Reviewed By: rshest

Differential Revision: D80404121

fbshipit-source-id: c0e2fb9f67174432f50e31c399f5b10cfe098ae6
2025-08-18 08:57:52 -07:00
Rubén NorteandFacebook GitHub Bot 180996683b Print information about benchmark duration (#53323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53323

Changelog: [internal]

This just makes it easier to understand when the benchmark itself has started running and how long the benchmark itself took to run.

Reviewed By: rshest

Differential Revision: D80400268

fbshipit-source-id: b447c4c389d563f7b2b1cbe82822d5d3a93272da
2025-08-18 08:57:52 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 47a9a2b44f Fix recording for Maestro E2E tests on iOS (#53333)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53333

As per title, the recordings of iOS E2E tests are broken because we are creating a file that contains the js engine in the name, but we are trying to store a file without the js engine in the name.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D80454067

fbshipit-source-id: e4eee86793eb36f9ec9643cba7b65de75e30cbe7
2025-08-18 08:18:03 -07:00
Jakub PiaseckiandFacebook GitHub Bot 686d14f1d1 Enable enableFontScaleChangesUpdatingLayout by default (#53324)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53324

Changelog: [General][Changed] - Enabled `enableFontScaleChangesUpdatingLayout` feature flag by default

Reviewed By: cipolleschi

Differential Revision: D80452649

fbshipit-source-id: da4d19068036340855569f5fd555121bf646bbca
2025-08-18 07:34:56 -07:00
SimekandFacebook GitHub Bot f9b1b2eb1d Workspace: deduplicate lock after recent bumps (#53244)
Summary:
Run `update-lock` script to use `yarn-deduplicate` tool to collocate and reduce the amount of dependencies fetched when working with a workspace.

## Changelog:

[INTERNAL] Deduplicate workspace lock after recent bumps

Pull Request resolved: https://github.com/facebook/react-native/pull/53244

Test Plan: Running `yarn build`, `yarn prettier`, `yarn lint-ci`, `yarn test-ci` and `yarn flow-check` does not yield any errors.

Reviewed By: rshest, cortinico

Differential Revision: D80170594

Pulled By: robhogan

fbshipit-source-id: 5cbbde832539e89cb3b9937eacf03215942bc237
2025-08-18 06:14:32 -07:00
Rubén NorteandFacebook GitHub Bot e5c05ccbc1 Migrate LogBox Fantom test to use new document APIs (#53269)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53269

Changelog: [internal]

Just a small refactor of the tests for LogBox to take advantage of the new `document.getElementById` API in RN.

Reviewed By: rshest

Differential Revision: D69528892

fbshipit-source-id: 807f03364e260baa9c3a94cfb1831b7eb24e0d26
2025-08-18 05:42:51 -07:00
Rubén NorteandFacebook GitHub Bot a902267563 Implement ReactNativeDocument.prototype.getElementById (#53270)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53270

Changelog: [internal]

(Marked as internal because the DOM APIs haven't been released yet).

This implements `getElementById` in the DOM document API.

Reviewed By: rshest

Differential Revision: D69307133

fbshipit-source-id: 0c1454ae42fad92cddc705877b26052e887185bd
2025-08-18 05:42:51 -07:00
Rubén NorteandFacebook GitHub Bot d55bbfedff Do not reference DOM types in public API for VirtualView (#53272)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53272

Changelog: [internal]

`VirtualView` has been exposed as an unstable API in the `react-native` package but its public API is referencing the DOM APIs, which forces their definitions to also be public (but shouldn't because they haven't been released yet).

This replaces the reference with a reference to `HostInstance`, which will be updated to reference the DOM APIs when ready.

Reviewed By: yungsters

Differential Revision: D80254442

fbshipit-source-id: 254779c97c116ba08b6cc0c185906617ffd1269f
2025-08-18 05:42:51 -07:00
Rubén NorteandFacebook GitHub Bot f9a49e5c56 Improve performance of performance.mark, performance.measure and console.timeStamp while tracing with RNDT (#53295)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53295

Changelog: [internal]

This refactors `PerformanceTracer` to use an intermediate representation for trace events instead of the format expected by Chrome, which improves performance by removing the need to create `folly::dynamic` objects when enqueueing entries (that's moved to the trace processing stage).

`performance.mark` and `performance.measure` are only slightly improved because we still need to synchronously create `folly::dynamic` objects when enqueueing entries because we need to get the data from JSI.

I made the existing benchmark for the Performance API accurately measure the performance while tracing by forcing enabling the inspector in Fantom and setting the `tracingAtomic_` value to `true`.

## Highlights

* `console.timeStamp` (defaults): 1002ns → 580ns (**-42%**)
* `console.timeStamp` (all options): 1552ns → 821ns (**-47%**)
* `performance.mark` (with custom startTime): 2203ns → 2074ns (-5.8%)
* `performance.measure` (with start and end timestamps): 2474ns → 2283ns (-7.7%)

## Full results

### When inspector not used (in "production") (**same before and after**)

| (index) | Task name                                                 | Latency avg (ns) | Latency med (ns) | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | --------------------------------------------------------- | ---------------- | ---------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'mark (default)'                                          | '1864.5 ± 7.22%' | '1773.0 ± 29.00' | '559978 ± 0.04%'       | '564016 ± 9077'        | 50000   |
| 1       | 'mark (with custom startTime)'                            | '1780.0 ± 4.31%' | '1723.0 ± 30.00' | '577496 ± 0.04%'       | '580383 ± 9932'        | 50000   |
| 2       | 'measure (default)'                                       | '1906.0 ± 3.87%' | '1852.0 ± 29.00' | '537780 ± 0.04%'       | '539957 ± 8590'        | 50000   |
| 3       | 'measure (with start and end timestamps)'                 | '1986.3 ± 3.25%' | '1933.0 ± 30.00' | '514216 ± 0.04%'       | '517331 ± 7906'        | 50000   |
| 4       | 'measure (with mark names)'                               | '2208.7 ± 4.72%' | '2103.0 ± 40.00' | '471058 ± 0.05%'       | '475511 ± 8876'        | 50000   |
| 5       | 'clearMarks'                                              | '665.41 ± 0.17%' | '651.00 ± 20.00' | '1515507 ± 0.06%'      | '1536098 ± 48688'      | 50000   |
| 6       | 'clearMeasures'                                           | '745.87 ± 0.19%' | '721.00 ± 30.00' | '1356547 ± 0.07%'      | '1386963 ± 60215'      | 50000   |
| 7       | 'mark + clearMarks'                                       | '2223.9 ± 1.84%' | '2174.0 ± 39.00' | '456311 ± 0.04%'       | '459982 ± 8106'        | 50000   |
| 8       | 'measure + clearMeasures (with start and end timestamps)' | '2461.0 ± 2.85%' | '2374.0 ± 41.00' | '418624 ± 0.04%'       | '421230 ± 7403'        | 50000   |
| 9       | 'measure + clearMeasures (with mark names)'               | '2466.5 ± 3.36%' | '2384.0 ± 50.00' | '416618 ± 0.04%'       | '419463 ± 8986'        | 50000   |
| 10      | 'console.timeStamp (defaults)'                            | '395.25 ± 0.25%' | '391.00 ± 20.00' | '2554687 ± 0.06%'      | '2557545 ± 137873'     | 50000   |
| 11      | 'console.timeStamp (all options)'                         | '426.06 ± 0.23%' | '421.00 ± 20.00' | '2369918 ± 0.06%'      | '2375297 ± 118469'     | 50000   |

### When tracing (before)

| (index) | Task name                                                 | Latency avg (ns) | Latency med (ns) | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | --------------------------------------------------------- | ---------------- | ---------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'mark (default)'                                          | '2456.2 ± 6.45%' | '2254.0 ± 41.00' | '432571 ± 0.09%'       | '443656 ± 8220'        | 50000   |
| 1       | 'mark (with custom startTime)'                            | '2354.7 ± 3.39%' | '2203.0 ± 41.00' | '443719 ± 0.09%'       | '453926 ± 8394'        | 50000   |
| 2       | 'measure (default)'                                       | '2661.5 ± 3.30%' | '2414.0 ± 50.00' | '399165 ± 0.11%'       | '414250 ± 8762'        | 50000   |
| 3       | 'measure (with start and end timestamps)'                 | '2679.1 ± 1.61%' | '2474.0 ± 41.00' | '389798 ± 0.11%'       | '404204 ± 6811'        | 50000   |
| 4       | 'measure (with mark names)'                               | '2850.0 ± 0.99%' | '2644.0 ± 60.00' | '364185 ± 0.11%'       | '378215 ± 8392'        | 50000   |
| 5       | 'clearMarks'                                              | '687.71 ± 0.43%' | '671.00 ± 20.00' | '1479109 ± 0.05%'      | '1490313 ± 43135'      | 50000   |
| 6       | 'clearMeasures'                                           | '702.69 ± 0.34%' | '691.00 ± 20.00' | '1440497 ± 0.05%'      | '1447178 ± 40708'      | 50000   |
| 7       | 'mark + clearMarks'                                       | '2865.4 ± 1.96%' | '2694.0 ± 50.00' | '363008 ± 0.09%'       | '371195 ± 7020'        | 50000   |
| 8       | 'measure + clearMeasures (with start and end timestamps)' | '3076.2 ± 1.19%' | '2855.0 ± 51.00' | '337615 ± 0.10%'       | '350263 ± 6371'        | 50000   |
| 9       | 'measure + clearMeasures (with mark names)'               | '3087.4 ± 0.88%' | '2894.0 ± 60.00' | '334838 ± 0.10%'       | '345543 ± 7316'        | 50000   |
| 10      | 'console.timeStamp (defaults)'                            | '1203.9 ± 0.60%' | '1002.0 ± 29.00' | '930592 ± 0.18%'       | '998004 ± 28072'       | 50000   |
| 11      | 'console.timeStamp (all options)'                         | '1885.7 ± 0.44%' | '1552.0 ± 50.00' | '582549 ± 0.20%'       | '644330 ± 21449'       | 50000   |

### When tracing (after)

| (index) | Task name                                                 | Latency avg (ns) | Latency med (ns) | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | --------------------------------------------------------- | ---------------- | ---------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'mark (default)'                                          | '2336.9 ± 8.49%' | '2123.0 ± 41.00' | '458093 ± 0.10%'       | '471032 ± 9045'        | 50000   |
| 1       | 'mark (with custom startTime)'                            | '2229.0 ± 3.55%' | '2074.0 ± 41.00' | '467941 ± 0.10%'       | '482160 ± 9724'        | 50000   |
| 2       | 'measure (default)'                                       | '2367.5 ± 1.85%' | '2233.0 ± 41.00' | '435994 ± 0.09%'       | '447828 ± 8168'        | 50000   |
| 3       | 'measure (with start and end timestamps)'                 | '2427.0 ± 2.38%' | '2283.0 ± 39.00' | '426361 ± 0.09%'       | '438020 ± 7542'        | 50000   |
| 4       | 'measure (with mark names)'                               | '2560.9 ± 0.18%' | '2453.0 ± 50.00' | '397989 ± 0.09%'       | '407664 ± 8309'        | 50000   |
| 5       | 'clearMarks'                                              | '677.59 ± 0.20%' | '671.00 ± 20.00' | '1488235 ± 0.05%'      | '1490313 ± 45785'      | 50000   |
| 6       | 'clearMeasures'                                           | '682.91 ± 0.19%' | '671.00 ± 20.00' | '1476825 ± 0.05%'      | '1490313 ± 43135'      | 50000   |
| 7       | 'mark + clearMarks'                                       | '2665.7 ± 1.31%' | '2524.0 ± 50.00' | '386476 ± 0.09%'       | '396197 ± 7696'        | 50000   |
| 8       | 'measure + clearMeasures (with start and end timestamps)' | '2855.4 ± 2.22%' | '2684.0 ± 41.00' | '363742 ± 0.09%'       | '372578 ± 5780'        | 50000   |
| 9       | 'measure + clearMeasures (with mark names)'               | '2808.1 ± 0.16%' | '2704.0 ± 50.00' | '361794 ± 0.08%'       | '369822 ± 6967'        | 50000   |
| 10      | 'console.timeStamp (defaults)'                            | '656.87 ± 0.64%' | '580.00 ± 20.00' | '1669646 ± 0.15%'      | '1724138 ± 60244'      | 50000   |
| 11      | 'console.timeStamp (all options)'                         | '914.16 ± 0.54%' | '821.00 ± 30.00' | '1173803 ± 0.14%'      | '1218027 ± 46196'      | 50000   |

Reviewed By: rshest

Differential Revision: D80263154

fbshipit-source-id: f9e67162a3911a939693fd872bab72a41bc2637f
2025-08-18 04:49:33 -07:00
Rubén NorteandFacebook GitHub Bot 55fa36173b Add benchmarks for console.timeStamp (#53294)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53294

Changelog: [internal]

Just adding a benchmark for `console.timeStamp`, which in normal circumstances will just measure a no-op. We can force installing the inspector and simulate that we're profiling in Fantom to force `console.timeStamp` to go through the tracing paths for the benchmark.

Reviewed By: rshest

Differential Revision: D80272873

fbshipit-source-id: 1e404525bb3390b96fae982c543478a26535a393
2025-08-18 04:49:33 -07:00
Samuel SuslaandFacebook GitHub Bot 3a3e3b884c Move C++ Animated to ReactCommon (#53278)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53278
changelog: [internal]

C++ Animated should be in ReactCommon, it is code shared across all platforms.

Reviewed By: christophpurrer, zeyap

Differential Revision: D80261447

fbshipit-source-id: 8ad5d0bb65c9b499b1d9f60fc8babef8d4d90078
2025-08-18 04:13:13 -07:00
Alex HuntandFacebook GitHub Bot 40ebcef183 Use taskEndTime to report either InteractionEntry or INP metric events (#53296)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53296

Following D79894702, update `__chromium_devtools_metrics_reporter` to correctly differentiate `InteractionEntry` and `INP` metrics, based on synchronisation with start of paint.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D79898177

fbshipit-source-id: 92e805fc15b6c8bf3342f62914cca1b377b58397
2025-08-18 03:49:31 -07:00
YangJHandFacebook GitHub Bot 6caf2dfa38 refactor(react-native): fix condition (#53311)
Summary:
Fixed a typo in Performance.js where `measureName === 'string'` should be `typeof measureName === 'string'` for proper type checking.

## Changelog:

[GENERAL] [FIXED] - Fix typo in Performance.js type checking condition

Pull Request resolved: https://github.com/facebook/react-native/pull/53311

Test Plan: The change fixes a logical error where the condition was comparing the variable value to the string 'string' instead of checking its type. This ensures proper type checking for `measureName` parameter.

Reviewed By: rshest

Differential Revision: D80403225

Pulled By: rubennorte

fbshipit-source-id: 134920b2f95e997007d41451a8f8ad5fb8592d73
2025-08-18 03:21:54 -07:00
George ZaharievandFacebook GitHub Bot c7591d9b40 Update hermes-parser and related packages in fbsource to 0.31.2 (#53313)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53313

Bump hermes-parser and related packages to [0.31.2](https://github.com/facebook/hermes/blob/static_h/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D80408745

fbshipit-source-id: 38aff450c0e44db23624f4769f1c7856440fb785
2025-08-17 21:45:53 -07:00
Marco WangandFacebook GitHub Bot 0e6b94f4ab Deploy 0.279.0 to xplat (#53308)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53308

[changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D80365942

fbshipit-source-id: 097eee50914f1d14391ada61c7e4176c4a70779e
2025-08-15 17:29:05 -07:00
Christoph PurrerandFacebook GitHub Bot 9f2fbc23e4 Fix memory leak in TestCallInvoker (#53287)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53287

Changelog: [General][Fixed] Fix memory leak in TestCallInvoker

This fixes leaks in TestCallInvoker holding onto the jsi::Runtime

Reviewed By: lenaic

Differential Revision: D80295420

fbshipit-source-id: b14368ccfa86b3bf24b1f84613ec07931bd71a43
2025-08-15 11:43:41 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot c23e84ae9f Factor out "common props" testing and add testID test for Text (#53292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53292

# Changelog:
[Internal] -

Adds a `testID` test for the Text component, by means of extracting and reusing already existing one for Image.

Reviewed By: andrewdacenko

Differential Revision: D80332473

fbshipit-source-id: 8e8bc2eae12f5f340817f3788f320aad3a6fff45
2025-08-15 09:35:44 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 63335e5913 Refactor accessibility tests and add proper Role types (#53222)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53222

# Changelog:
[Internal] -

This factors out bits of the previously existing "Text.role" prop testing into the general accessibility props tests, so those can be reused, also making sure that we use correct types for both `.role` prop (`Role` type) and `.accessibilityRole prop (`AccessibilityRole`, correspondingly).

Note that the test suite for the `role` prop is a separate one, as `role` is only defined on the native side for certain component types (including `Text`), but not all.

Also, in the existing suite we weren't really testing `role`, but instead running the same test twice for `accessibilityRole`, that is corrected as well.

Reviewed By: andrewdacenko

Differential Revision: D80084731

fbshipit-source-id: 545f01c00e9ea5ca53f664888b9bb7b24ded315e
2025-08-15 09:35:44 -07:00
Nicola CortiandFacebook GitHub Bot 0ac41fa386 Further nightlies cleanup (#53302)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53302

Those files can also go as they've been moved to
https://github.com/react-native-community/nightly-tests

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D80342950

fbshipit-source-id: 0b5cc8f424eefa00c48377fe2fbc2cca5e7ef48d
2025-08-15 08:19:32 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot e3183739bb Options to run Fantom with address and thread sanitizers enabled (#53300)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53300

# Changelog:
[Internal] -

This adds two new modes to Fantom, allowing to run the native (C++) side with enabling either:
* Address sanitizer, which would detect memory overwrites
* Thread sanitizer, which can detect potential threading issues, such  as race conditions

This are opt-in for now.

Currently, both modes already detect different errors, which have a high chance to be real issues and have to be fixed.

Reviewed By: lenaic

Differential Revision: D80339524

fbshipit-source-id: 784ddb9f0af79a04b074e107e4955724d54d5685
2025-08-15 08:12:04 -07:00
zhongwuzwandFacebook GitHub Bot f936780cd5 Expose NativeComponentRegistry API as JavaScript root export (#52999)
Summary:
Resolves https://github.com/react-native-community/discussions-and-proposals/discussions/893#discussioncomment-13449739

Expose NativeComponentRegistry as a root export on index.js.

## Changelog:

[General][Added] - Expose NativeComponentRegistry API as JavaScript root export

Pull Request resolved: https://github.com/facebook/react-native/pull/52999

Test Plan: Can import NativeComponentRegistry from root exort

Reviewed By: cortinico, cipolleschi

Differential Revision: D79721243

Pulled By: huntie

fbshipit-source-id: 77d94fb22255de020009ffe0e54d5030213519e2
2025-08-15 04:02:26 -07:00
Ash WuandFacebook GitHub Bot e89df6410f Fix typo in hermes-utils.rb (#53290)
Summary:
Fix minor typo.

## Changelog:

[Internal] [Fixed] - Fix typo in hermes-utils.rb

Pull Request resolved: https://github.com/facebook/react-native/pull/53290

Reviewed By: NoamPaz

Differential Revision: D80329212

Pulled By: rshest

fbshipit-source-id: 40963362a4336b393e716dc2f999a7f47970387c
2025-08-15 03:17:55 -07:00
Alex HuntandFacebook GitHub Bot 9a4df1cdc6 Add initial UI for Perf Monitor V2 prototype (#52971)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52971

Wires up the initial pass of the experimental V2 Perf Monitor UI.

Limitations:
- Does not yet clear last interaction.
- Only lightly tested.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D78904767

fbshipit-source-id: c51c5f51d9267ec971c17dce465775a2a3e6cb2c
2025-08-15 02:45:29 -07:00
David VaccaandFacebook GitHub Bot 41029d8e91 Align APIs ReactSurfaceImpl.view with ReactSurfaceImpl.attachView() (#53288)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53288

This diff aligns the APIs ReactSurfaceImpl.view and ReactSurfaceImpl.attachView() to make sure they receive and return the same type

changelog: [Android][Changed] Changed return type of ReactSurfaceImpl.view to ReactSurfaceView to align with parameter recived by ReactSurfaceImpl.attachView()

Reviewed By: sammy-SC

Differential Revision: D80289764

fbshipit-source-id: cfd598a42298f56b6b8871611662fbfa5599a3d3
2025-08-14 18:51:43 -07:00
Christoph PurrerandFacebook GitHub Bot ee5f229a4a Add MakeAsyncCallback utility function to TurboModuleTestFixture.h (#53284)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53284

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D80280615

fbshipit-source-id: eca82072fdfa74e70e9c327f9a1379f0ddf9a8c4
2025-08-14 18:13:28 -07:00
Sam ZhouandFacebook GitHub Bot a8bc74c009 Add annotations to fix future natural inference errors in xplat/js: 3/n (#53285)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53285

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D80279967

fbshipit-source-id: 60a32d1c8161103723d237c682ad6c8a95cf0e6b
2025-08-14 13:33:18 -07:00
Derek SargentandFacebook GitHub Bot 8702b09bcc Fix spelling of Objective-C in warning message (#53283)
Summary:
Warning logs with correct spelling and formatting improve the developer experience.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[IOS] [FIXED] - Spelling and formatting of warning log related to Objective-C methods and their signatures.

Pull Request resolved: https://github.com/facebook/react-native/pull/53283

Test Plan: Change is messaging (text) only.

Reviewed By: jorge-cab

Differential Revision: D80267373

Pulled By: rshest

fbshipit-source-id: a07a6f685f14507578ced00d45f7ef0a3c69f23d
2025-08-14 10:36:49 -07:00
Nicola CortiandFacebook GitHub Bot 7f93b664b4 Gradle to 9.0 (#53281)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53281

This is still a of bumping Gradle to the latest Major (9.0)
Full list of changes is here: https://gradle.org/whats-new/gradle-9/

I don't expect any breaking changes for React Native users.

Changelog:
[Android] [Breaking] - **deps:** Gradle to 9.0

Reviewed By: cipolleschi

Differential Revision: D79445941

fbshipit-source-id: 0af495a2cc6bb4cca1e37d5f0693b77e42010df2
2025-08-14 09:42:56 -07:00
Nicola CortiandFacebook GitHub Bot f502cae9b5 Move all the infrastructure to test nightlies out of facebook/react-native (#53280)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53280

I've moved a lot of the nightly testing infrastructure on a RNC repo here:
https://github.com/react-native-community/nightly-tests/

This allows us to iterate faster without having to wait for diffs to be
imported and test inside fbsource.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D80262856

fbshipit-source-id: dc2dfe75901ac78ec9f6e940540102276d34acdf
2025-08-14 09:41:52 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 9ca43e4095 Changelog for 0.79.6 (#53279)
Summary:
Changelog for 0.79.6

## Changelog:
[Internal] -

Pull Request resolved: https://github.com/facebook/react-native/pull/53279

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D80262341

Pulled By: cipolleschi

fbshipit-source-id: 51cc1e6faaa271f1ab1a734f7578e88c73de2042
2025-08-14 09:36:04 -07:00
riteshshukla04andFacebook GitHub Bot f6ba2dbf3b Add types for platform in React native web (#53216)
Summary:
This PR fixes https://github.com/facebook/react-native/issues/52356.

As per discussion here https://github.com/facebook/react-native/pull/52360 . We have changed the implementation in React native web in this PR https://github.com/necolas/react-native-web/pull/2791.
As discussed with cortinico , Now web returns a hardcoded string "0.0.0" for `platform.version`.
 We can safely change this to string now.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL][CHANGED] Update types for Platform.version

Pull Request resolved: https://github.com/facebook/react-native/pull/53216

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D80173301

Pulled By: necolas

fbshipit-source-id: 750aae2427a6c36a068346a9722d9734d9906b58
2025-08-14 09:02:43 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 56ad53cb14 Fix maxLength default value when null is passed (#53273)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53273

In [c5956da8c0](https://github.com/facebook/react-native/commit/c5956da8c0b735d47761af51019ed25b49001c00) we landed a change of the default value of `maxLength`.

While doing that, we missed the case where the app is explicitly passing `null` for a value for `maxLength`. When this happens, the props parsing was initializing the `maxLength` to 0, making not possible to input any value.

This change fixes the issue by ensuring that the default value set when `null` is consistent with the default value when nothing is passed.

## Changelog:
[iOS][Fixed] - Fixed TextInput behavior when `maxLength={null}` is passed

Reviewed By: GijsWeterings

Differential Revision: D80255637

fbshipit-source-id: a0d1956e1d51dbfedd27dafabf60ffa9344358d3
2025-08-14 08:43:04 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot d2df64d2fc Don't populate default Image prop values on JS side (Android only) (#53225)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53225

# Changelog:
[Internal] -

Similarly to how it was done for View and Text components ( https://github.com/facebook/react-native/pull/53059), this adds an option to only populate non-default props for Image component.

**This gives up to 50% performance improvement on the benchmark test**, so looks promising.

Reviewed By: rubennorte

Differential Revision: D80090241

fbshipit-source-id: 7dfa6573408794535555e43580e32952fb1d1990
2025-08-14 07:55:37 -07:00
generatedunixname537391475639613andFacebook GitHub Bot 1d86fb67ee xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.cpp (#53275)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53275

Reviewed By: rshest

Differential Revision: D80160594

fbshipit-source-id: bbc425e6610d1ea8f65582ea5801ddc52b19ec4b
2025-08-14 07:43:12 -07:00
Mateo GuzmánandFacebook GitHub Bot 4d5caef76b Migrate YogaConfig to Kotlin
Summary:
Migrate com.facebook.yoga.YogaConfig to Kotlin.

X-link: https://github.com/facebook/yoga/pull/1841

Reviewed By: rshest

Differential Revision: D79897694

Pulled By: cortinico

fbshipit-source-id: 0eff36f47bbb8da6a91087f2ea69bc4e40a732ac
2025-08-14 07:29:26 -07:00
Nivaldo BondançaandFacebook GitHub Bot 2ab6f22f26 Codemod format for trailing commas incoming change [5/n] (#53260)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53260

X-link: https://github.com/facebook/yoga/pull/1847

Adding trailing commas.

Reviewed By: cortinico

Differential Revision: D80174965

fbshipit-source-id: 5438fa9ebce13525b1286dd30704138ef99703cb
2025-08-14 07:24:42 -07:00
Christian FalchandFacebook GitHub Bot 8a2e7efe01 Use correct version of jsi.cpp (#53266)
Summary:
When building the xcframeworks on iOS we're including the file `jsi/jsi.cpp` in the Swift Package. This file is also included in Hermes and React Native should use the hermes version of these symbols. This is even described (but overlooked) in the React-jsi podspec file.

This causes the error seen in the bug addressed by this commit.

The fix is to exclude the `jsi/jsi.cpp` file from the jsi target in our swift package.

Fixes https://github.com/facebook/react-native/issues/53257

## Changelog:

[IOS] [FIXED] - Fixed wrong jsi symbols in use when using React.xcframework

Pull Request resolved: https://github.com/facebook/react-native/pull/53266

Test Plan: Tested using a precompiled xcframework in the reproduction repository.

Reviewed By: rshest

Differential Revision: D80252131

Pulled By: cipolleschi

fbshipit-source-id: 915e94a1d80c2f45575e58d8054239484e861285
2025-08-14 07:06:48 -07:00
Rubén NorteandFacebook GitHub Bot 38e1e0de53 Use string references in Fantom native module (#53274)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53274

Changelog: [internal]

Minor refactor

Reviewed By: rshest

Differential Revision: D80255982

fbshipit-source-id: 703f32a1edf5c225b0b07b3c519932ebe167b2c8
2025-08-14 06:19:00 -07:00
Rubén NorteandFacebook GitHub Bot 256565cb11 Add initial Fantom test for the basic global environment setup (#53268)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53268

Changelog: [internal]

Adds tests for the global environment setup in RN.

Reviewed By: rshest

Differential Revision: D78415432

fbshipit-source-id: 8fdafee93ddbdf17770f3cb2069bf4834bb43dac
2025-08-14 04:41:13 -07:00
Rubén NorteandFacebook GitHub Bot f9c2aaf3e7 Rename setUpDefaultReactNativeEnvironment to scope it better (#53267)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53267

Changelog: [internal]

Test files that verify the behavior of the global setup can only have a single test, as we can't really reset it across tests. Because of that, I'm renaming the current one to make the behavior under test more explicit.

Reviewed By: rshest

Differential Revision: D80177333

fbshipit-source-id: df9eeba15906bc6071940824dad9e576a267f499
2025-08-14 04:41:13 -07:00
Liam JonesandFacebook GitHub Bot 614231d4df Remove reference to react-native upgrade (#53265)
Summary:
This command doesn't exist anymore.

Remove reference to `react-native upgrade` as the command doesn't exist anymore.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[INTERNAL] [CHANGED] - Removed reference to removed `react native upgrade` in `Libraries/Renderer/README.md`

Pull Request resolved: https://github.com/facebook/react-native/pull/53265

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D80251577

Pulled By: cortinico

fbshipit-source-id: 9eab037af6769f0d1f78f65bc795d285dc3d8320
2025-08-14 04:06:52 -07:00
Vitali ZaidmanandFacebook GitHub Bot 856f52a6f0 Update debugger-frontend from 9215667...e87564a (#53256)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53256

Changelog: [Internal] - Update `react-native/debugger-frontend` from 9215667...e87564a

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/921566790e9e16d0ecace6e49b3cfaace205958c...e87564a24cf233c60aaebee8c418ec85724f7214).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [e87564a24](https://github.com/facebook/react-native-devtools-frontend/commit/e87564a24) | Vitali Zaidman (vzaidman@gmail.com) | 2025-08-06T12:11:08+01:00 | [prevent stack trace entries in console UI from being inline so a new line is always added between them and other printed elements (#198)](https://github.com/facebook/react-native-devtools-frontend/commit/e87564a24) |

Reviewed By: robhogan

Differential Revision: D80181542

fbshipit-source-id: 517425504251441703b9b96fdeb6956f4db7d53b
2025-08-14 01:44:22 -07:00
Devan BuggayandFacebook GitHub Bot 22a4f79224 Fix LogBox dealloc crashing Mac Catalyst (#53259)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53259

delegate.window is not supported in Mac Catalyst, causing a crash in various scenarios such as Metro refresh.

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D80189486

fbshipit-source-id: d0e8156f8f95769c114b497f53731876478fb1f4
2025-08-13 21:56:03 -07:00
Sam ZhouandFacebook GitHub Bot 94d260ee6a Unbreak RN CI (#53261)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53261

Replace type annotation with comment syntax

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D80231004

fbshipit-source-id: a863091bec8b5521bc998b57ef08d892823238e6
2025-08-13 20:53:12 -07:00
Sam ZhouandFacebook GitHub Bot 35bee1a857 Add annotations to fix future natural inference errors in xplat/js
Summary: Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D80207164

fbshipit-source-id: e9a786c83f89a97db8b383812767978c47d9536c
2025-08-13 18:15:27 -07:00
Zeya PengandFacebook GitHub Bot dd0008fee9 test all props FlatList inherited from ScrollView & are propagated to mounting layer (#53187)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53187

## Changelog:

[Internal] [Changed] - test all props FlatList inherited from ScrollView & are propagated to mounting layer

Reviewed By: rshest

Differential Revision: D79917024

fbshipit-source-id: c248f629f27b224e70a588cfb491cd17618594de
2025-08-13 17:36:06 -07:00
Zeya PengandFacebook GitHub Bot 81abd306bb test FlatList props: data, renderItem, horizontal, inverted, scrollEnabled (#53186)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53186

## Changelog:

[Internal] [Changed] - test FlatList props: data, renderItem, horizontal, inverted, scrollEnabled

uncovered one bug in `getDebugProps()`

Reviewed By: rshest

Differential Revision: D79895309

fbshipit-source-id: 0644cf9877620a7787ee085a8e934f462e5de3ef
2025-08-13 17:36:06 -07:00
Mateo GuzmánandFacebook GitHub Bot 4340dcbae8 Migrate YogaValue to Kotlin
Summary:
Migrate com.facebook.yoga.YogaValue to Kotlin.

X-link: https://github.com/facebook/yoga/pull/1838

Reviewed By: rshest

Differential Revision: D79897668

Pulled By: cortinico

fbshipit-source-id: dffe2b29087c35e4797f46dea756c51f841590d8
2025-08-13 16:45:06 -07:00
Luna WeiandFacebook GitHub Bot 3d12d81126 VirtualViewExperimental - opt out of update if no rect changes (#53255)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53255

Avoid updates to VirtualViewContainer if the rect dimensions haven't changed.

This is an attempt to simulate what ReactVirtualView does with `checkRectChange`.

Changelog:
[Internal]

Reviewed By: yungsters

Differential Revision: D80182750

fbshipit-source-id: f0f45ac508c1f93e6dbb64ea11c0b44b80d6c3b3
2025-08-13 15:45:52 -07:00
Christoph PurrerandFacebook GitHub Bot b75031f3dd Add WebSocketClient implementation for ReactCxxPlatform (#53233)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53233

Changelog: [Internal]

This is needed for RN Fantom

Reviewed By: rshest

Differential Revision: D80115098

fbshipit-source-id: 03036dda311527ac27d12656d9b92c609e0b9ee2
2025-08-13 14:43:43 -07:00
Rubén NorteandFacebook GitHub Bot d009a02c6c Add benchmark to compare rendering times for View and ViewNativeComponent (#53248)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53248

Changelog: [internal]

This adds a new benchmark that compares the rendering time (only rendering, not committing, mounting, effects, etc.) of `<View>` and `<ViewNativeComponent>`.

Baseline:

| (index) | Task name                                | Latency avg (ns)  | Latency med (ns)   | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | ---------------------------------------- | ----------------- | ------------------ | ---------------------- | ---------------------- | ------- |
| 0       | 'render 100 views (Noop)'                | '333036 ± 0.39%'  | '328452 ± 2393.0'  | '3019 ± 0.18%'         | '3045 ± 22'            | 3003    |
| 1       | 'render 100 views (ViewNativeComponent)' | '1335974 ± 3.45%' | '1228468 ± 7541.5' | '797 ± 0.71%'          | '814 ± 5'              | 1000    |
| 2       | 'render 100 views (View)'                | '2296988 ± 1.60%' | '2170821 ± 12374'  | '449 ± 0.74%'          | '461 ± 3'              | 1000    |

This shows that **`<View>` currently has an overhead of 75% in rendering time**.

I've also tested a modification of `View` such as:

```
component View(...props: ViewProps) {
  return {
    // This tag allows us to uniquely identify this as a React Element
    $$typeof: REACT_ELEMENT_TYPE,
    // Built-in properties that belong on the element
    type: ViewNativeComponent,
    key: undefined,
    // $FlowExpectedError[prop-missing]
    ref: props.ref,
    props,
  };
}
```

This makes `View` basically a no-op component, and the benchmark after this looks like:

| (index) | Task name                                | Latency avg (ns)  | Latency med (ns)  | Throughput avg (ops/s) | Throughput med (ops/s) | Samples |
| ------- | ---------------------------------------- | ----------------- | ----------------- | ---------------------- | ---------------------- | ------- |
| 0       | 'render 100 views (View)'                | '1743010 ± 2.25%' | '1630816 ± 10616' | '600 ± 0.74%'          | '613 ± 4'              | 1000    |
| 1       | 'render 100 views (ViewNativeComponent)' | '1370699 ± 4.04%' | '1242284 ± 14172' | '789 ± 0.74%'          | '805 ± 9'              | 1000    |

This shows that `View`, just for existing as a wrapper component, has an overhead of 31% in rendering time, which means that **the opportunities to reduce the overhead beyond what we already did are limited**.

Reviewed By: rshest

Differential Revision: D80169514

fbshipit-source-id: aa2a1fc3f9d0ee3a60c03dd32555802fa7265251
2025-08-13 10:14:21 -07:00
Rubén NorteandFacebook GitHub Bot e8bf982bac Support overriddenDuration in Fantom benchmarks (#53250)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53250

Changelog: [internal]

This updates the types for Fantom benchmarks to support the new `overriddenDuration` option from `tinybench`.

It also exposes a new method in the benchmark namespace to access the same timestamp used in benchmarks.

Reviewed By: rshest

Differential Revision: D80169515

fbshipit-source-id: 59af197eababbf5b8544ee9f1862b206756dc87d
2025-08-13 10:14:21 -07:00
Rubén NorteandFacebook GitHub Bot c17267ec87 Upgrade tinybench to v4.1.0 (#53249)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53249

Changelog: [internal]

This just upgrades tinybench (used in Fantom benchmarks) to v4.1.0, which contains a feature we need to customize test durations.

Reviewed By: rshest

Differential Revision: D80169516

fbshipit-source-id: 5813b3050843b52d604619a44a5e097e26f54432
2025-08-13 10:14:21 -07:00
SimekandFacebook GitHub Bot 50d5316b1b Workspace: align eslint-plugin-jest with Jest version (#53246)
Summary:
While verifying the lock deduplication changes, I have spotted that `eslint-plugin-jest` package does not match Jest version used within the workspace.

## Changelog:

[INTERNAL][CHANGED] - update `eslint-plugin-jest` package in workspace to align with Jest version used

Pull Request resolved: https://github.com/facebook/react-native/pull/53246

Test Plan: Running `yarn test`, `yarn lint-ci` and `test-typescript` checks does not yield any errors.

Reviewed By: rshest, cortinico

Differential Revision: D80170591

Pulled By: robhogan

fbshipit-source-id: f3ac58bc26cf2d3a34899f8558f872b3df85942d
2025-08-13 09:36:21 -07:00
Mateo GuzmánandFacebook GitHub Bot bc54a06fcb Migrate YogaNative to Kotlin
Summary:
Migrate com.facebook.yoga.YogaNative to Kotlin.

X-link: https://github.com/facebook/yoga/pull/1839

Reviewed By: rshest

Differential Revision: D79897725

Pulled By: cortinico

fbshipit-source-id: 6fc98565368d831b8698464fe26ad47f8fff6a74
2025-08-13 08:56:03 -07:00
riteshshukla04andFacebook GitHub Bot c5956da8c0 Fix: Setting maxLength to 0 in TextInput still allows typing on iOS (#52890)
Summary:
Trying to fix https://github.com/facebook/react-native/issues/52860
## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS][FIXED] Setting maxLength to 0 in TextInput still allows typing on iOS

Pull Request resolved: https://github.com/facebook/react-native/pull/52890

Test Plan:
https://github.com/user-attachments/assets/56549e0f-6bbf-461e-815c-794abdee2018

Tested on Android too

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D80095701

Pulled By: cipolleschi

fbshipit-source-id: 5e76f88798e32097e6a619c44ff6240b4f01fc6f
2025-08-13 07:23:30 -07:00
Samuel SuslaandFacebook GitHub Bot 568f59e5b1 use trace section in C++ Animated instead of perfetto (#53223)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53223

changelog: [internal]

remove dependency on perfetto and use TraceSection like we do elsewhere.

Reviewed By: zeyap, rubennorte

Differential Revision: D80087082

fbshipit-source-id: 08d3434985443db9a83189a4dfabc65d6eda8166
2025-08-13 06:52:16 -07:00
Mateo GuzmánandFacebook GitHub Bot 33ca53d9db Migrate YogaConfigFactory to Kotlin
Summary:
Migrate com.facebook.yoga.YogaConfigFactory to Kotlin.

X-link: https://github.com/facebook/yoga/pull/1833

Reviewed By: rshest

Differential Revision: D79897762

Pulled By: cortinico

fbshipit-source-id: 9457b307204f2066a02690f96a88fce6755f915e
2025-08-13 06:46:48 -07:00
Philip HeinserandFacebook GitHub Bot 91e69b5d4c fix crashes on non-UTF8 Info.plist files under local frameworks (#52336)
Summary:
fix: https://github.com/facebook/react-native/issues/52279

## Changelog:

[iOS] [FIXED] - non-UTF8 crashes Info.plist local frameworks

Pull Request resolved: https://github.com/facebook/react-native/pull/52336

Test Plan:
after this change pods install and are working with the new warning:
[!] Failed to read Info.plist at /Users/user/apps/test/ios/promiflash/Frameworks/YouTubeEmbeddedPlayerFramework.framework/Info.plist: invalid byte sequence in UTF-8

Reviewed By: cortinico

Differential Revision: D80096932

Pulled By: cipolleschi

fbshipit-source-id: f60cd67cb99a581d6fbab92422c1adf7b50066eb
2025-08-13 02:51:10 -07:00
Christoph PurrerandFacebook GitHub Bot 9f0d24bb05 Enforce void return type for void return type in JS C++ TM spec (#53214)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53214

Changelog: [General] [Fixed] Enforce void return type for void return type in JS C++ TM spec

Example if you have this spec
```
export interface Spec extends TurboModule {
  +foo: (bar: string) => void;
}
```
We must enforce in C++ that the return type is `void` as e.g.
```
  void foo(jsi::Runtime& rt, const std::string& bar);
```
Right now you can return any type in C++ such as `std::string` which does not make sense

Reviewed By: lenaic

Differential Revision: D79980538

fbshipit-source-id: 9b99ea6b1ac97d1e46cdb9952e83c445ec5503b7
2025-08-12 23:13:16 -07:00
Zeya PengandFacebook GitHub Bot 9f77d421bb make sure to only disable js sync & animate layout when disableFabricCommitInCXXAnimated==false (#53230)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53230

## Changelog:

[Internal] [Changed] - make sure to only disable js sync & animate layout when disableFabricCommitInCXXAnimated==false

Reviewed By: sammy-SC

Differential Revision: D80002015

fbshipit-source-id: 5e6ee4b5908fe8d2ee52b77ca3b78164debc4d59
2025-08-12 14:57:41 -07:00
Alan LeeandFacebook GitHub Bot 1c7925abb0 edit RN change log (#53232)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53232

Remove entry that was reverted for 0.81 release

Changelog: [Internal]

Reviewed By: shwanton, cortinico

Differential Revision: D80108112

fbshipit-source-id: 3176e7e26407ad8c71434b5576c722dc28021d08
2025-08-12 13:41:39 -07:00
Samuel SuslaandFacebook GitHub Bot b44e1839ca fix crash in adjustForMaintainVisibleContentPosition (#53208)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53208

changelog: [internal]

When Fabric View Culling is enabled together with immediate state update, it may lead to a crash inside of `[RCTScrollViewComponentView _adjustForMaintainVisibleContentPosition]`.
When doing immediate state update, we can avoid calling `[RCTScrollViewComponentView _adjustForMaintainVisibleContentPosition]` altogether to avoid the crash.

Reviewed By: lenaic

Differential Revision: D80000362

fbshipit-source-id: 123b70aa31edb14a99bb968648eb8b8aac84afb6
2025-08-12 13:25:16 -07:00
Rubén NorteandFacebook GitHub Bot 4ee326f52c Add documentation for JS memory profiler in Fantom (#53226)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53226

Changelog: [internal]

This adds documentation about how to take JS memory heap snapshots in Fantom.

Reviewed By: lenaic

Differential Revision: D80090283

fbshipit-source-id: 04f66a62aa756d1020b8d8ef6fc0ea7e68341710
2025-08-12 11:08:08 -07:00
Rubén NorteandFacebook GitHub Bot 90804fd088 Add documentation for JS sampling profiler in Fantom (#53227)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53227

Changelog: [internal]

This adds docs for the new JS sampling profiler in Fantom

Reviewed By: lenaic

Differential Revision: D80090284

fbshipit-source-id: 0f7fa498cf141a51ac6fda331522945d42fc494d
2025-08-12 11:08:08 -07:00
Rubén NorteandFacebook GitHub Bot e2035379b6 Add documentation for debugging in Fantom (#53228)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53228

Changelog: [internal]

This adds some documentation about how to debug Fantom tests (C++ and JS).

Reviewed By: lenaic

Differential Revision: D80090286

fbshipit-source-id: 435d2079abfe72e93de0c297347b15dc39b25a89
2025-08-12 11:08:08 -07:00
Rubén NorteandFacebook GitHub Bot 0bf7721862 Use Jest naming for test regex in Fantom docs (#53229)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53229

Changelog: [internal]

Tiny change to align with how Jest refers to this argument in its docs: https://jestjs.io/docs/cli#jest-regexfortestfiles

Reviewed By: lenaic

Differential Revision: D80090285

fbshipit-source-id: 86a4ad75078eb9b7575fca9659cc1a2e678f7a0a
2025-08-12 11:08:08 -07:00
Mateo GuzmánandFacebook GitHub Bot 35d8086881 Migrate DoNotStrip to Kotlin
Summary:
Migrate com.facebook.yoga.annotations.DoNotStrip to Kotlin.

X-link: https://github.com/facebook/yoga/pull/1840

Reviewed By: rshest

Differential Revision: D79897758

Pulled By: cortinico

fbshipit-source-id: 79585e6ab793bd72e04440581d866f7721667db3
2025-08-12 10:54:27 -07:00
Samuel SuslaandFacebook GitHub Bot 65b5a5b25d make glog android only include + declare the dependency on glog (#53224)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53224

changelog: [internal]

glog is only used on Android.

Reviewed By: christophpurrer

Differential Revision: D80085730

fbshipit-source-id: 0dbec7929551f7c16719846c1868b0509b1d519a
2025-08-12 10:30:49 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 27217e8bd6 Initialize props for RCTPullToRefreshViewComponentView (#53231)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53231

The RCTPullToRefreshViewComponentView props are not initialized when the component view is created. this could lead to undefined behaviors and crashes.

This change fixes it.

## Changelog:
[iOS][Fixed] - Properly initialize the RCTPullToRefreshViewComponentView

Reviewed By: sammy-SC

Differential Revision: D80093141

fbshipit-source-id: dac98d56c749b9f5d85338279c8da2a7e5ddb4a3
2025-08-12 10:16:19 -07:00
Mateo GuzmánandFacebook GitHub Bot 7e461003c6 Migrate YogaLayoutType to Kotlin
Summary:
Migrate com.facebook.yoga.YogaLayoutType to Kotlin.

X-link: https://github.com/facebook/yoga/pull/1837

Reviewed By: rshest

Differential Revision: D79897708

Pulled By: cortinico

fbshipit-source-id: e3c8a3cc60f806d151d2be956b26dd98963254a6
2025-08-12 09:49:31 -07:00
Samuel SuslaandFacebook GitHub Bot bd287e8e2c move some C++ Animated headers into internal folder (#52991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52991

changelog: [internal]

move internal files only to internal folder in C++ Animated

Reviewed By: rshest

Differential Revision: D79436926

fbshipit-source-id: fb8badefdbf7b54a351e57e457f2b6aaf36dc2a6
2025-08-12 09:32:43 -07:00
Mateo GuzmánandFacebook GitHub Bot db2a9c089c Migrate LayoutPassReason to Kotlin
Summary:
Migrate com.facebook.yoga.LayoutPassReason to Kotlin.

X-link: https://github.com/facebook/yoga/pull/1836

Reviewed By: rshest

Differential Revision: D79897685

Pulled By: cortinico

fbshipit-source-id: 87d2e4b95fbdbfe48d84019e9ffb50deb9286d8c
2025-08-12 09:10:30 -07:00
Mateo GuzmánandFacebook GitHub Bot 40afa75a7c Migrate YogaNodeFactory to Kotlin
Summary:
Migrate com.facebook.yoga.YogaNodeFactory to Kotlin.

X-link: https://github.com/facebook/yoga/pull/1832

Reviewed By: zielinskimz

Differential Revision: D79897733

Pulled By: cortinico

fbshipit-source-id: 3ea4f5635eb8c910719c13d3087356b96b6f0746
2025-08-12 08:57:43 -07:00
Mateo GuzmánandFacebook GitHub Bot 453508ada8 Migrate YogaMeasureOutput to Kotlin
Summary:
Migrate com.facebook.yoga.YogaMeasureOutput to Kotlin.

X-link: https://github.com/facebook/yoga/pull/1842

Reviewed By: rshest

Differential Revision: D79897681

Pulled By: cortinico

fbshipit-source-id: 63280b6aed9bbeeb1e71458a1793c9647dcf0726
2025-08-12 07:55:41 -07:00
Mateo GuzmánandFacebook GitHub Bot 05eddd354e Migrate YogaMeasureFunction to Kotlin
Summary:
Migrate com.facebook.yoga.YogaMeasureFunction to Kotlin.

X-link: https://github.com/facebook/yoga/pull/1835

Reviewed By: mdvacca

Differential Revision: D79897728

Pulled By: cortinico

fbshipit-source-id: 959ae976622838147685cf6088674dce25f5cc99
2025-08-12 07:40:31 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 641a79dc51 Improve benchmark comparison printout ("slower"->"faster") (#53221)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53221

# Changelog:
[Internal] -

This changes the benchmark test results comparison print the results slightly differently, in particular it now uses the slowest result as a baseline and prints how much faster the other ones are (as opposed to printing "slower" previously).

This arguably brings a more positive vibe when looking into the benchmark results :)

Reviewed By: andrewdacenko

Differential Revision: D80082134

fbshipit-source-id: 7dc9c7c520afe08270d4f5da9031db02261690ba
2025-08-12 06:56:14 -07:00
Nicola CortiandFacebook GitHub Bot f1d014adbb Simplify RNTester Autolinking (#53095)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53095

This change simplifies the RNTesterApplication so that it's looking closer to the template MainApplication file.
In order to do so, I had to create 2 files inside the `metainternal/` folder as those files are
generated as part of the CLI Autolinking

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D79722917

fbshipit-source-id: 06852c72ae1e1abed9952b1637515123977bc7b4
2025-08-12 05:49:49 -07:00
Vitali ZaidmanandFacebook GitHub Bot 7bfec89a97 temporary disable perf monitor to fix tests (#53209)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53209

Changelog: Internal

Reviewed By: sammy-SC

Differential Revision: D80000286

fbshipit-source-id: 899cd5e6b193957579e61af65cf8177cd1666473
2025-08-12 05:47:11 -07:00
Rubén NorteandFacebook GitHub Bot 65974e938c Add support for JS debugging in Fantom (#53215)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53215

Changelog: [internal]

This adds a new environment variable to Fantom that allows debugging the JS code in tests.

Usage:

```
FANTOM_DEBUG_JS=1 yarn fantom <test>
```

**Does NOT work in OSS yet**. We need to include a third-party library to send HTTP and WebSocket requests and implement a wrapper on top of it.

Reviewed By: christophpurrer

Differential Revision: D79883372

fbshipit-source-id: d077c373a036033344e61d58274d5cd14028bda4
2025-08-12 05:41:11 -07:00
Rubén NorteandFacebook GitHub Bot 9c201c0f8f Automatically inject debugger statements in tests in preparation for debug mode (#53205)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53205

Changelog: [internal]

This injects a custom Babel transform for Fantom tests that automatically injects `debugger` statements in the generated code. This simplifies debugging by providing a default interruption point in the test setup for the test author to decide what to debug.

This has no effect unless the debugger is opened, which isn't happening yet.

Reviewed By: rshest

Differential Revision: D79996000

fbshipit-source-id: 6153587264d293a067e359edba4f64f41898c506
2025-08-12 05:41:11 -07:00
Rubén NorteandFacebook GitHub Bot 4978385067 Allow custom factories for HTTP and WebSocket clients for DevTools (#53200)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53200

Changelog: [internal]

TSIA. This is necessary for Fantom to use real HTTP and WebSocket connections for DevTools, while still providing stubs for the runtime (the networking and websockets native modules provided to clients).

If there are no specific factories for DevTools provided, we fall back to regular ones (keeping backwards compatibility).

Reviewed By: rshest

Differential Revision: D79806934

fbshipit-source-id: 6d16fa44e11f3c8e304c3c3d31fe952d0ba5811a
2025-08-12 05:41:11 -07:00
Rubén NorteandFacebook GitHub Bot 42db2f8405 Split ReactInstanceConfig.enableDebugging into enableInspector and enableDevMode (#53201)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53201

Changelog: [internal]

This splits the `ReactHost` option `enableDebugging` into more granular options:
- `enableInspector` which enables the connection with the inspector/debugger.
- `enableDevMode` which enables the use of bundles from Metro, reloads, etc.

This allows us to enable the inspector in Fantom without consuming bundles from Metro.

This should be backwards compatible with existing apps.

In the future, we should be able to inject custom `DevSupportManager` instances into the `ReactHost` so we can customize all options with any level of granularity (the same way we do on Android, for example).

Reviewed By: rshest

Differential Revision: D79804006

fbshipit-source-id: c28e788e5006cdbeb1a373d44b4e5aec1acec702
2025-08-12 05:41:11 -07:00
Rubén NorteandFacebook GitHub Bot c2c2e6b7c2 Connect debugger before loading bundle (#53203)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53203

Changelog: [internal]

This makes ReactHost connect the inspector immediately after creating the instance, aligned with how we do it on Android, instead of doing it as part of loading a bundle.

Reviewed By: rshest

Differential Revision: D79804004

fbshipit-source-id: b165520b0feb089fdfaa323413d697939c7ac794
2025-08-12 05:41:11 -07:00
Rubén NorteandFacebook GitHub Bot e0b22e1ebf Rename global variable with Metro server for Fantom (#53202)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53202

Changelog: [internal]

Just a minor refactor to follow the convention of prefixing Fantom-related globals and environment variables.

Reviewed By: rshest

Differential Revision: D79804007

fbshipit-source-id: 0c9a57c1b08ae18ae03cd66d1a6ef9690e0dea42
2025-08-12 05:41:11 -07:00
Rubén NorteandFacebook GitHub Bot 6fb0072f01 Refactor logic to find available port for Metro in Fantom (#53204)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53204

Changelog: [internal]

This changes the logic to find an available port for Metro on Fantom to do this outside Metro. Before, we'd set `0` as the port for Metro to find an available port, but in a following change we'll need to know the port before calling into Metro. This allows that.

Reviewed By: rshest

Differential Revision: D79804005

fbshipit-source-id: 5c2e2f4acbba3a79771586799b65653d46b8fe72
2025-08-12 05:41:11 -07:00
RakaDoankandFacebook GitHub Bot 739dfd2141 Help Codegen to find library's package.json after failure of importing library's package.json due to missing of ./package.json subpath (#53220)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53220

This is fix for some React Native libraries can't be found by Codegen, and will make the libraries unusable in new architecture (Turbo Modules)

Internally in the Codegen script, it will try to import library's package.json file with the `require.resolve`, but for some React Native libraries will throw an error with `ERR_PACKAGE_PATH_NOT_EXPORTED` code due to using the `exports` field in their package.json file while not exposing the package.json file itself. As an example
```json
{
  "exports": {
    ".": {
      "import": {
        "types": "./lib/typescript/module/index.d.ts",
        "default": "./lib/module/index.js"
      },
      "require": {
        "types": "./lib/typescript/commonjs/index.d.ts",
        "default": "./lib/commonjs/index.js"
      }
    },
    "./package.json": "./package.json" <-- here some libraries missed this
  },
  "codegenConfig": {}
}
```

Personally feel weird that library author has to expose their package.json only for the sake of Codegen and i believe library author shouldn't, even the library consumer don't need it.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [FIXED] - Help Codegen find library's package.json if some libraries using `exports` field in their package.json file and the `./package.json` subpath is not explicitly defined

bypass-github-export-checks

Pull Request resolved: https://github.com/facebook/react-native/pull/53195

Test Plan:
`require.resolve('library/package.json')` [here](https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/codegen/generate-artifacts-executor/utils.js#L203) will throw an error with `ERR_PACKAGE_PATH_NOT_EXPORTED` code by Node.js. So if it does, help Codegen retry to find closest library's package.json with [`require.main.paths`](https://nodejs.org/api/modules.html#requiremain) search paths

You can init new app React Native CLI app with my sample react native library here [`ping-react-native`](https://github.com/RakaDoank/ping-react-native) v1.2.2.
Due to missing of the `package.json` subpath, before this change, it's autolinked but unusable due to missing of the spec header file. After this change, it works normally.

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D80080243

Pulled By: cipolleschi

fbshipit-source-id: d33bf9eeb385ccf0c076e4d800a0d2840bd91b68
2025-08-12 04:45:07 -07:00
Mateo GuzmánandFacebook GitHub Bot 001736000f Migrate YogaStyleInputs to Kotlin
Summary:
Migrate com.facebook.yoga.YogaStyleInputs to Kotlin.

X-link: https://github.com/facebook/yoga/pull/1830

Reviewed By: rshest

Differential Revision: D79897662

Pulled By: cortinico

fbshipit-source-id: a4063a8c0f608050162cd3707834040e35f9ebf7
2025-08-12 03:34:21 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 841866c354 Add accessibility props test to the <Text/> component (#53218)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53218

# Changelog:
[Internal] -

Uses the existing generalized accessibility props test suite, recently created by andrewdacenko, to test the corresponding props in the <Text/> component.

Reviewed By: andrewdacenko

Differential Revision: D80000693

fbshipit-source-id: ebbceef8db7b56dc5e4ba1ac7c027a5952b680a7
2025-08-12 00:11:06 -07:00
generatedunixname89002005232357andFacebook GitHub Bot 677ee671d0 Revert D79993649 (#53217)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53217
Changelog: [Internal]
Fix rn-tester jobs

This diff reverts D79993649
(The context such as a Sandcastle job, Task, SEV, etc. was not provided.)

Depends on D79993649

Reviewed By: cortinico

Differential Revision: D80030502

fbshipit-source-id: 1feee2e2ae6a1edbeb755687aecb2a25d9759a90
2025-08-11 15:39:00 -07:00
Nick LefeverandFacebook GitHub Bot cc71f9c550 Create tryDispatchMountItems runnable only when needed (#53196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53196

In the FabricUIManager, the runnable created for scheduled mounts is only used if currently running on the UI thread.

With this diff the runnable only gets created when needed.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D79969412

fbshipit-source-id: ee78890322af8580357389aad8357f7c0d18490f
2025-08-11 14:45:36 -07:00
Andrew DatsenkoandFacebook GitHub Bot 6738dbcc7e Generalize accessibility testing (#53182)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53182

Changelog: [Internal]
Move accessibility tests into reusable test suite.

Reviewed By: rshest

Differential Revision: D79897200

fbshipit-source-id: d98ebc7d16e7fd5c3c81086df4eec07dfdcb2fb0
2025-08-11 13:59:43 -07:00
Andrew DatsenkoandFacebook GitHub Bot 1feb364f72 Add accessibilityState (#53179)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53179

Changelog: [Internal]
Add accessibilityState debug prop

Reviewed By: zeyap

Differential Revision: D79894111

fbshipit-source-id: b9914965b053c239c7f954130a32240b15070b17
2025-08-11 13:59:43 -07:00
Mateo GuzmánandFacebook GitHub Bot a2eb3b299d Migrate YogaBaselineFunction to Kotlin
Summary:
Migrate com.facebook.yoga.YogaBaselineFunction to Kotlin.

X-link: https://github.com/facebook/yoga/pull/1831

Reviewed By: joevilches, mdvacca

Differential Revision: D79897676

Pulled By: cortinico

fbshipit-source-id: 2f175bf60a871c4635d1575faec1096f9c970f48
2025-08-11 10:51:55 -07:00
Vitali ZaidmanandFacebook GitHub Bot 8d998ce96c consolidated all 0.81 rcs entries in the changelog into 0.81 (#53212)
Summary:
Changelog: [Internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/53212

Reviewed By: cortinico

Differential Revision: D80005041

Pulled By: vzaidman

fbshipit-source-id: 93f570d9ddccdf8d4febc9d9f7702646ad7a6b56
2025-08-11 10:22:45 -07:00
RakaDoankandFacebook GitHub Bot 8dcb18d2b3 Help Codegen to find library's package.json after failure of importing library's package.json due to missing of ./package.json subpath (#53195)
Summary:
This is fix for some React Native libraries can't be found by Codegen, and will make the libraries unusable in new architecture (Turbo Modules)

Internally in the Codegen script, it will try to import library's package.json file with the `require.resolve`, but for some React Native libraries will throw an error with `ERR_PACKAGE_PATH_NOT_EXPORTED` code due to using the `exports` field in their package.json file while not exposing the package.json file itself. As an example
```json
{
  "exports": {
    ".": {
      "import": {
        "types": "./lib/typescript/module/index.d.ts",
        "default": "./lib/module/index.js"
      },
      "require": {
        "types": "./lib/typescript/commonjs/index.d.ts",
        "default": "./lib/commonjs/index.js"
      }
    },
    "./package.json": "./package.json" <-- here some libraries missed this
  },
  "codegenConfig": {}
}
```

Personally feel weird that library author has to expose their package.json only for the sake of Codegen and i believe library author shouldn't, even the library consumer don't need it.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [FIXED] - Help Codegen find library's package.json if some libraries using `exports` field in their package.json file and the `./package.json` subpath is not explicitly defined

bypass-github-export-checks

Pull Request resolved: https://github.com/facebook/react-native/pull/53195

Test Plan:
`require.resolve('library/package.json')` [here](https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/codegen/generate-artifacts-executor/utils.js#L203) will throw an error with `ERR_PACKAGE_PATH_NOT_EXPORTED` code by Node.js. So if it does, help Codegen retry to find closest library's package.json with [`require.main.paths`](https://nodejs.org/api/modules.html#requiremain) search paths

You can init new app React Native CLI app with my sample react native library here [`ping-react-native`](https://github.com/RakaDoank/ping-react-native) v1.2.2.
Due to missing of the `package.json` subpath, before this change, it's autolinked but unusable due to missing of the spec header file. After this change, it works normally.

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D79993649

Pulled By: cipolleschi

fbshipit-source-id: fa2bbd6178f5e5fef19a14e67f09ee8a727d01de
2025-08-11 10:10:04 -07:00
Andrew DatsenkoandFacebook GitHub Bot 4fa3c00324 Add base test for TouchableWithoutFeedback (#53178)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53178

Changelog: [Internal]
Add base integration test for TouchableWithoutFeedback

Reviewed By: zeyap

Differential Revision: D79889935

fbshipit-source-id: a72a85c647e371e6a6b330cd6eb2c3cc7c71b2f5
2025-08-11 10:03:28 -07:00
Michał PierzchałaandFacebook GitHub Bot fc6d7d4f0f Update RNC CLI in RNTester to v20.0.0 (#53206)
Summary:
Bump CLI to stable v20 for RNTester

## Changelog:

[INTERNAL] [CHANGED] - Update RNC CLI in RNTester to v20.0.0

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/53206

Reviewed By: cortinico

Differential Revision: D79997077

Pulled By: rshest

fbshipit-source-id: 7264d942967fbfbc7fa5704f1089c0e7dbd3eb4b
2025-08-11 09:37:54 -07:00
Richard BarnesandFacebook GitHub Bot 9eb90f8911 Remove unused exception parameter from hermes/unittests/API/CDPAgentTest.cpp (#53213)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53213

`-Wunused-exception-parameter` has identified an unused exception parameter. This diff removes it.

This:
```
try {
    ...
} catch (exception& e) {
    // no use of e
}
```
should instead be written as
```
} catch (exception&) {
```

If the code compiles, this is safe to land.

Reviewed By: dtolnay

Differential Revision: D79968851

fbshipit-source-id: 18f2e6861f099915b1aad6aba58217ba94eb10c8
2025-08-11 09:35:31 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 85b47afb48 Check delegate for getModuleForClass and getModuleInstanceFromClass (#53207)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53207

When restructuring the RCTReactNativeFactory, we forgot to add a couple of methods to check whether the delegate was implementing the RCTTurboModuleManager delegate methods.

This has been reported [here](https://github.com/react-native-community/discussions-and-proposals/issues/916)

This change fixes it.

## Changelog:
[iOS][Fixed] - Ask the delegate for `getModuleForClass` and `getModuleInstanceFromClass`

Reviewed By: cortinico

Differential Revision: D79998104

fbshipit-source-id: 68069a9f93182d4fa416b5799bf4eec4d107552b
2025-08-11 08:51:01 -07:00
Mateo GuzmánandFacebook GitHub Bot 9c9a39b58e Migrate YogaLogger to Kotlin
Summary:
Migrate com.facebook.yoga.YogaLogger to Kotlin.

X-link: https://github.com/facebook/yoga/pull/1834

Reviewed By: rshest

Differential Revision: D79897742

Pulled By: cortinico

fbshipit-source-id: 79b926a7abadce9038fc55ad0f608e92bc77a55a
2025-08-11 08:47:34 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 0af4a1c71f Set up Switch Fantom test (#53134)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53134

This change sets up the Fanto test for the Switch component

## Changelog:
[Internal] -

Reviewed By: rubennorte

Differential Revision: D79719683

fbshipit-source-id: d8a5d127296e3448faf5f841baa98bc34f4f43cb
2025-08-11 08:17:48 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 749dbe0840 Add test for Text.adjustsFontSizeToFit (#53210)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53210

# Changelog:
[Internal] -

As in the title.

Reviewed By: andrewdacenko

Differential Revision: D80001500

fbshipit-source-id: ab5564b0e9ab728f0825aec9da24539c9e2c5290
2025-08-11 08:14:15 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 1c33774990 Remove setup-xcode-build-cache action (#53177)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53177

This action is used only when running tests for RNTester. Now that we are using prebuilds, this is a liability, because Cocoapods and Xcode would not update the binary if a new one is provided.

With prebuild, this caching does not provide a lot of benefits, so we can remove it.

## Changelog
[Internal] -

Reviewed By: cortinico

Differential Revision: D79893870

fbshipit-source-id: 0773f910f418cf9ebd5d557d563160993084e83a
2025-08-11 08:07:43 -07:00
Peter AbbondanzoandFacebook GitHub Bot 07835d3d67 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java (#53116)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53116

Converts ReactAccessibilityDelegate to Kotlin

Changelog: [Internal]

Reviewed By: andrewdacenko

Differential Revision: D79749812

fbshipit-source-id: bdfbd61f61339d8332a4fa3f5cc4ccd4b4355323
2025-08-11 07:54:09 -07:00
Vojtech NovakandFacebook GitHub Bot 4c570b5d31 fix cp command in ReactNativeDependencies.podspec (#53136)
Summary:
When running `RCT_USE_PREBUILT_RNCORE=1 RCT_USE_RN_DEP=1 pod install` I'm getting an error: `cp: framework/packages/react-native/..: File exists`

This is not seen consistently by everyone but I've seen in reported one more time at Expo. Could be related to running MacOS 26.

Somehow, apparently, the `..` is being treated as a literal directory name and cp is trying to create a directory named `..` inside `framework/packages/react-native/` which is not what we want. Using `/.` avoids that.

 ---
What also seemed to work(around) was to change `mkdir -p framework/packages/react-native` to `mkdir -p framework/packages/` and then `cp` can create the `framework/packages/react-native/..` folder. But this is definitely more confusing.

## Changelog:

Pick one each for the category and type tags:

[IOS] [FIXED] - fix "file exists" error in `ReactNativeDependencies.podspec`

Pull Request resolved: https://github.com/facebook/react-native/pull/53136

Test Plan: tested locally, and in CI on older macOS: https://github.com/expo/expo/pull/38631 (the ios build succeeds)

Reviewed By: rshest

Differential Revision: D79990895

Pulled By: cipolleschi

fbshipit-source-id: 44ff9034800d3acd4e55ec39aabfb326382372cb
2025-08-11 06:36:15 -07:00
generatedunixname537391475639613andFacebook GitHub Bot fd600a24af xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp (#53198)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53198

Reviewed By: rshest

Differential Revision: D79874231

fbshipit-source-id: 15b2a0c2330e6237b92db68094ce97f3e708f9a6
2025-08-11 06:31:16 -07:00
Rubén NorteandFacebook GitHub Bot 6b05a59a0d Extend PerformanceEventTiming with taskEndTime (#53199)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53199

Changelog: [internal]

This adds a new `taskEndTime` field in the internal C++ representation of `PerformanceEventTiming` so we can distinguish events that waited for mount (because they triggered changes) and events that didn't, so report INP correctly.

Reviewed By: rshest

Differential Revision: D79894702

fbshipit-source-id: f7472bfaecaa69f2126719d0dc3d3b251e3a8f68
2025-08-11 05:26:56 -07:00
Phil PluckthunandFacebook GitHub Bot 94623ca8ec Fix missing path escape patterns in Xcode scripts for projects with spaces (#53194)
Summary:
When running a project in a path that contains any spaces, the scripts have several escape patterns that don't handle this path correctly. For example, `"/absolute/path/with spaces"` may be rendered as `/absolute/path/with spaces` and this shows as an output error such as `No such file or directory /absolute/path/with`

This was likely a longstanding issue, but is unexpected for some beginners that first try out React Native. While it's not recommended to create a path like this, it's certainly not hard to make this mistake.

## Changelog:

[IOS] [FIXED] - fix scripts for paths containing whitespaces

Pull Request resolved: https://github.com/facebook/react-native/pull/53194

Test Plan: tested locally; create a React Native or Expo project in a folder containing a space (e.g. `/my/path/with spaces/new-app` and build the project. With changes applied, the build should succeed. (There's related failures in `expo/expo` that need fixing too)

Reviewed By: robhogan

Differential Revision: D79993537

Pulled By: cipolleschi

fbshipit-source-id: b32697ce2405c403c410b3ceaed7e161e4a48537
2025-08-11 05:12:43 -07:00
David VaccaandFacebook GitHub Bot d3bbbd893a Deprecate com/facebook/react Legacy Architecture classes (#53104)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53104

Deprecate com/facebook/react Legacy Architecture classes

changelog: [Android][Changed] Depreacate CoreModulesPackage and NativeModuleRegistryBuilder legacy architecture classes, these classes unused in the new architecture and will be deleted in the future

Reviewed By: shwanton

Differential Revision: D79676942

fbshipit-source-id: a2c447bee251fdac79d3dc81a17851eaf5271413
2025-08-09 04:39:35 -07:00
David VaccaandFacebook GitHub Bot da74d5da2c Deprecate Legacy Architecture ViewManagers (#53107)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53107

Deprecate Legacy Architecture ViewManagers, these classes are not used as part of the new architecture and will be deleted in the future

changelog: [Android][Changed] Deprecate Legacy Architecture ViewManagers, these classes are not used as part of the new architecture and will be deleted in the future

Reviewed By: shwanton

Differential Revision: D79676585

fbshipit-source-id: 72cb6fe0bbe666cfa317cf28d6aec475f1c38c35
2025-08-09 04:39:35 -07:00
David VaccaandFacebook GitHub Bot 07091a9ae8 Deprecate custom ShadowNode classes included in React Native (#53192)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53192

In this diff I'm deprecating ShadowNode classes included in React Native library

These classes are part of the legacy architecture and will be deleted in the future

changelog: [Android][Changed] Deprecate LegacyArchitecture ShadowNode classes included in React Native

Reviewed By: mlord93

Differential Revision: D79676584

fbshipit-source-id: a39267e6e430fcf4f6a73c96cd28d02eafc88a32
2025-08-09 04:39:35 -07:00
David VaccaandFacebook GitHub Bot c1f7c5e321 Depreacte remaining LegacyArchitecture classes from the bridge package (#53191)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53191

Depreacte remaining LegacyArchitecture classes from the bridge package

changelog: [Android][Changed] Depreacte all LegacyArchitecture classes from the bridge package

Reviewed By: mlord93

Differential Revision: D79674635

fbshipit-source-id: 6a873d05157e17ef0434821e1c8a77959d7f079a
2025-08-09 04:39:35 -07:00
David VaccaandFacebook GitHub Bot b29b86f275 Deprecate LegacyArchitecture class UIManagerProvider (#53190)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53190

Deprecate LegacyArchitecture class UIManagerProvider

changelog: [Android][Changed] Deprecate LegacyArchitecture class UIManagerProvider

Reviewed By: mlord93

Differential Revision: D79674639

fbshipit-source-id: 6802a35c4bd643f138a54b4f22f3804743f89249
2025-08-09 04:39:35 -07:00
David VaccaandFacebook GitHub Bot 25c011eb4d Deprecate BridgeDevSupportManager and JSInstance (#53108)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53108

Deprecate BridgeDevSupportManager and JSInstance

changelog: [Android][Changed] Deprecate BridgeDevSupportManager and JSInstance

Reviewed By: mlord93

Differential Revision: D79674636

fbshipit-source-id: c34c4ed386ab6c130fc12e03659fe2d15b42658d
2025-08-09 04:39:35 -07:00
David VaccaandFacebook GitHub Bot 3306cdbbe9 Update deprecation message for BridgeReactContext class (#53110)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53110

Update deprecation message for BridgeReactContext class

changelog: [internal] internal

Reviewed By: mlord93

Differential Revision: D79674637

fbshipit-source-id: 0942b0c8479cd1eba8e29bd9dcfc4547790910f1
2025-08-09 04:39:35 -07:00
David VaccaandFacebook GitHub Bot 22e4c25211 Deprecate NativeModuleRegistry Legacy Architecture class (#53123)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53123

Deprecate NativeModuleRegistry Legacy Architecture class

changelog: [Android][Changed] Deprecate NativeModuleRegistry Legacy Architecture class

Reviewed By: mlord93

Differential Revision: D79674638

fbshipit-source-id: 7791ceb53545aa456e92f051ed4c1f070305b5fc
2025-08-09 04:39:35 -07:00
David VaccaandFacebook GitHub Bot 78a3ff81eb Deprecate subset of LegacyArchitecture classes in com/facebook/react/bridge (#53106)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53106

Deprecate subset of LegacyArchitecture classes in com/facebook/react/bridge

changelog: [Android][Changed] Deprecate subset of LegacyArchitecture classes in com/facebook/react/bridge

Reviewed By: mlord93

Differential Revision: D79674640

fbshipit-source-id: 58b8fde8bed739fd04272215e399cfbed7a0188a
2025-08-09 04:39:35 -07:00
David VaccaandFacebook GitHub Bot 25f466cc4d Deprecate FrescoBasedReactTextInlineImageShadowNode (#53121)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53121

Deprecate FrescoBasedReactTextInlineImageShadowNode

changelog: [Android][Changed] Deprecate LegacyArchitecture class FrescoBasedReactTextInlineImageShadowNode

Reviewed By: mlord93

Differential Revision: D79672291

fbshipit-source-id: 482939981b735e7f96d7cde874430e2895c0d10c
2025-08-09 04:39:35 -07:00
David VaccaandFacebook GitHub Bot 718126fcf0 Deprecate Legacy Architecture class CallbackImpl (#53105)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53105

Deprecate Legacy Architecture class CallbackImpl

changelog: [Android][Changed] Deprecate Legacy Architecture class CallbackImpl

Reviewed By: mlord93

Differential Revision: D79672292

fbshipit-source-id: d35ae53093f464f2bb088a8247dbbde8591572c6
2025-08-09 04:39:35 -07:00
David VaccaandFacebook GitHub Bot 19a99dd088 Deprecate JavaMethodWrapper (#53124)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53124

Deprecate LegacyArchitecture class JavaMethodWrapperchagelog:

changelog: [Android][Changed] Deprecate LegacyArchitecture class JavaMethodWrapper

Reviewed By: mlord93

Differential Revision: D79672296

fbshipit-source-id: 05432263c4452294c667226cb8e062c50f036931
2025-08-09 04:39:35 -07:00
David VaccaandFacebook GitHub Bot c4715886a9 Deprecate Legacy Architecture ShadowNode classes
Summary:
Deprecate Legacy Architecture ShadowNode classes

Changelog: [Android][Changed] Deprecate Legacy Architecture ShadowNode classes

Reviewed By: mlord93

Differential Revision: D79672295

fbshipit-source-id: e510debd3718e6bc9e42c9b61d6a63858970077d
2025-08-09 04:39:35 -07:00
David VaccaandFacebook GitHub Bot 1a85185cfc Deprecate ShadowNodes on the codegen (#53184)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53184

Deprecate ShadowNodes on the codegen

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D79911692

fbshipit-source-id: ad24488d186fd5b82c3953a75f52be03e4770cc2
2025-08-09 04:39:35 -07:00
David VaccaandFacebook GitHub Bot d2912e7997 EZ fix naming in kotlin file (#53109)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53109

EZ fix naming in kotlin file

changelog: [internal] internal

Reviewed By: cortinico, shwanton, mlord93

Differential Revision: D79735705

fbshipit-source-id: b1061a9aa0f245de29efb1b0f3d6c9ada9c43660
2025-08-08 16:43:31 -07:00
Ramanpreet NaraandFacebook GitHub Bot 7d6d0a7735 native modules: Show message in redundant rejection redbox (#53152)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53152

When a redundant reject is called, show the rejection message in the redbox. This can help us pin down the error we need to elminiate in production.

Changelog: [Internal]

Reviewed By: sanjay-io

Differential Revision: D79837541

fbshipit-source-id: 879b5dc42980867051cfab6ccb575304a4a9c4c6
2025-08-08 14:39:42 -07:00
Ramanpreet NaraandFacebook GitHub Bot dc879950d1 native modules: Guard against concurrent resolve/reject calls (#53151)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53151

If the native module calls the resolve/reject, resolve/resolve, reject/resolve, reject/reject concurrently, the turbomodule infra could run into a null pointer exception. This diff mitigates that problem.

Changelog: [iOS][Fixed] - Fix concurrent calls into resolve/reject inside native modules

Reviewed By: sanjay-io

Differential Revision: D79824319

fbshipit-source-id: 675264781f303d12fc1eb9649ecdc78601b7720b
2025-08-08 14:39:42 -07:00
Calix TangandFacebook GitHub Bot e0ea781908 Basic Fantom Tests for Pressable (#53181)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53181

Adds basic Fantom tests for the <Pressable> React Native component.

Following T233710053, adds tests for some of the listed props and refs.

Covered props:
* children
* disabled
* onPress
* style

Ref:
* Pressable is a Native Component and has the correct tag

I did not cover the rest of the listed props due to Fantom not having suitable events to trigger to test them and/or inease of implementing functionality to do so.

## Changelog:

[Internal]

Reviewed By: andrewdacenko

Differential Revision: D79745215

fbshipit-source-id: 26caaabf72ea7ffff3e652616dfd9f0cf7fc2020
2025-08-08 12:56:58 -07:00
Luna WeiandFacebook GitHub Bot b3f397f343 VirtualViewExperimental on iOS (#52852)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52852

Changelog: [Internal] - Implementation of ScrollView-managed VirtualViews for iOS

In previous diffs we've introduced a "VirtualViewExperimental" which is a clone of VirtualView. This diff updates the experimental version to move interection logic (whether something is visible, in prerender-space, etc.) to the ScrollView so there are less listeners. We now use 1 scroll listener vs. N

Reviewed By: philIip

Differential Revision: D78825701

fbshipit-source-id: d515e3cb2dae53d779b5d3f4c317a2c7a6b25857
2025-08-08 11:12:12 -07:00
Zeya PengandFacebook GitHub Bot 5517c046ab Cache result when RenderOutput::render() is called (#53112)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53112

## Changelog:

[Internal] [Changed] - Cache result when RenderOutput::render() is called

Rreviously, root.getRenderedOutput in fantom doesn't really reflect the result of direct manipulation from native animated (see the test case added here). This stack is enabling it.

* make RenderOutput an instance owned by TestMountingManager that can cache render result
  * why is this needed - native animation's direct manipulation should modify the render result (analog to directly manipulating host views on a platform) instead of props on a StubView
* here i also make sure that `RenderOutput::render()` will only re calculate the render result for a tree after StubViewTree::mutate is called

Reviewed By: andrewdacenko

Differential Revision: D79737991

fbshipit-source-id: ee2193b708e319c1519b06bc672054c4f7105da1
2025-08-08 10:54:05 -07:00
Mateo GuzmánandFacebook GitHub Bot 8ccfff9a46 Migrate ReactBaseTextShadowNode to Kotlin (#52449)
Summary:
Migrate com.facebook.react.views.text.ReactBaseTextShadowNode to Kotlin.

## Changelog:

[Android][Changed] - Migrated ReactBaseTextShadowNode to Kotlin. You might need to update your property access to use camelCase instead of Hungarian notation.

Pull Request resolved: https://github.com/facebook/react-native/pull/52449

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: mdvacca

Differential Revision: D79341403

Pulled By: cortinico

fbshipit-source-id: ff5dd7a8c3e0220812dd3a214d8d680ccd83f4d8
2025-08-08 10:36:32 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 0aeb26bdfc e2e test for Text.role (#53176)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53176

# Changelog:
[Internal] -

As in the title

Reviewed By: andrewdacenko

Differential Revision: D79891116

fbshipit-source-id: 13042a9b82373b8e0073c8421e532e6e463d60f8
2025-08-08 10:02:57 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 3d37d2d2ce Add test for Text.maxFontSizeMultiplier (#53171)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53171

# Changelog:
[Internal] -

As in the title.

Reviewed By: andrewdacenko

Differential Revision: D79888839

fbshipit-source-id: 52964ce9484c51dc5ff1065343ef9d2f829425c9
2025-08-08 10:02:57 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 5a38948034 e2e test for Text.id/nativeID (#53170)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53170

# Changelog:
[Internal] -

As in the title.

Reviewed By: andrewdacenko

Differential Revision: D79887689

fbshipit-source-id: a8a6a16a0fbf3f1481758a2d91c7813d51a4d9d1
2025-08-08 10:02:57 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 1a58fdf172 Add tests for Modal.animiated prop (#53174)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53174

Add Fantom tests for Modal.animiated prop

Notice that animated is deprecated and ignored when rendering.

## Changelog:
[Internal] -

Reviewed By: andrewdacenko

Differential Revision: D79888036

fbshipit-source-id: aa9003d376f356e9934a61a7cfc958b44d9892eb
2025-08-08 08:52:46 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 618254d8e9 Add tests for Modal.allowSwipeDismissal prop (#53173)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53173

Add Fantom tests for Modal.allowSwipeDismissal prop

## Changelog:
[Internal] -

Reviewed By: andrewdacenko

Differential Revision: D79885004

fbshipit-source-id: 9db4bc38c739223a36180d09397bad09ecc67d86
2025-08-08 08:52:46 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 01e3f8d75e Add tests for Modal.visible prop (#53172)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53172

Add Fantom tests for Modal.visible prop

## Changelog:
[Internal] -

Reviewed By: andrewdacenko

Differential Revision: D79884676

fbshipit-source-id: 7c3ca4e16596022096a634a7232b616cf15c79c4
2025-08-08 08:52:46 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 2812e20ecc Add tests for Modal.hardwareAccelerated prop (#53162)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53162

Add Fantom tests for Modal.hardwareAccelerated prop

## Changelog:
[Internal] -

Reviewed By: andrewdacenko

Differential Revision: D79881565

fbshipit-source-id: 80aaeb0659883d536c37996e86231c9d1d9eff49
2025-08-08 08:52:46 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 674fd79eaf Add tests for Modal.navigationBarTranslucent prop (#53157)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53157

Add Fantom tests for Modal.navigationBarTranslucent prop

## Changelog:
[Internal] -

Reviewed By: andrewdacenko

Differential Revision: D79881358

fbshipit-source-id: 75816bf9bb18dc2115477965953fcd88a65d5be5
2025-08-08 08:52:46 -07:00
Riccardo CipolleschiandFacebook GitHub Bot de76f3436c Add tests for Modal.statusBarTranslucent prop (#53158)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53158

Add Fantom tests for Modal.statusBarTranslucent prop

## Changelog:
[Internal] -

Reviewed By: andrewdacenko

Differential Revision: D79881104

fbshipit-source-id: 9ee9edbff67059eeb815be2a7a095eac91ec7420
2025-08-08 08:52:46 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 99ae977345 Add tests for Modal.transparent prop (#53159)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53159

Add Fantom tests for Modal.transparent prop

## Changelog:
[Internal] -

Reviewed By: andrewdacenko

Differential Revision: D79880909

fbshipit-source-id: f597decb29f578433d6c7ac594327b6130945a8e
2025-08-08 08:52:46 -07:00
Riccardo CipolleschiandFacebook GitHub Bot fee81401d7 Add tests for Modal.presentationStyle prop (#53160)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53160

Add Fantom tests for Modal.presentationStyle prop

## Changelog:
[Internal] -

Reviewed By: andrewdacenko

Differential Revision: D79880310

fbshipit-source-id: fda68a481b85e58e5f94d012c71a55cf51b9c8df
2025-08-08 08:52:46 -07:00
Nicola CortiandFacebook GitHub Bot ec9f62865c Update firebase DB url. (#53166)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53166

Our DB doesn't have that suffix, so I'm removing it.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D79883740

fbshipit-source-id: a52ab275129807cbb6e066baefccd71a8ac7398d
2025-08-08 08:05:54 -07:00
Nicola CortiandFacebook GitHub Bot e16def43c9 Reland: Add tests for DisplayMetricsHolder (#53165)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53165

This is a re-land of D78981753
Those tests were OOM-ing because we were using a old version of robolectric.
I've bumped it and this should fix it.

Changelog:
[Internal] [Changed] -

Reviewed By: lenaic

Differential Revision: D79883742

fbshipit-source-id: 4c2c640d6b601ec07d0a4a12cd7b86a879740a41
2025-08-08 07:09:32 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot afb6294335 Add Fantom test for Text.selectable (#53168)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53168

# Changelog:
[Internal]-
Adds Fantom test for `Text.selectable` prop.

Reviewed By: andrewdacenko

Differential Revision: D79885301

fbshipit-source-id: d66895397ee0bbcfedc3f744ae8138d2741b2b1e
2025-08-08 06:49:05 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 5b9063ed70 E2E test for numberOfLines prop in Text (#53167)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53167

# Changelog
[Internal] -

As in the title.

Reviewed By: andrewdacenko

Differential Revision: D79884649

fbshipit-source-id: fa2d0be9d455449d5a806b06c0480dcefdaaae3e
2025-08-08 06:49:05 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 404c975ff2 Prop test for Text.allowFontScaling
Summary:
# Changelog:
[Internal] -

Adds Fantom test for `Text.allowFontScaling`.

Reviewed By: andrewdacenko

Differential Revision: D79882955

fbshipit-source-id: b1426c1e7f2667c2db017d749710320ec1e6aadd
2025-08-08 06:49:05 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 91f9ff042d Create e2e test for Text.ellipsizeMode prop (#53163)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53163

# Changelog:
[Internal] -

Adds a Fantom test that tests the `Text.ellipsizeMode` prop.

It also adds a test for the `<Text/>` component without any props

Reviewed By: andrewdacenko

Differential Revision: D79882336

fbshipit-source-id: f938c85092325374f562d610432781e2d412b88e
2025-08-08 06:49:05 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 20c91f2bd4 Add tests for Modal.animationStyle prop (#53141)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53141

Add Fantom tests for Modal.animationStyle prop

## Changelog:
[Internal] -

Reviewed By: andrewdacenko, rubennorte

Differential Revision: D79808162

fbshipit-source-id: 36ba61bf741dc7cfa7a736fd83a824285304d5b2
2025-08-08 06:47:23 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 7035391b04 Add basic test for Modal (#53140)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53140

As per title, this change adds the boilerplate code for a Fantom test on Modal

## Changelog:
[Internal] -

Reviewed By: andrewdacenko

Differential Revision: D79805808

fbshipit-source-id: c8c77e576a09b346cf29b290d68c75e540d5f146
2025-08-08 06:47:23 -07:00
Riccardo CipolleschiandFacebook GitHub Bot e547f466ee Improve codegen to add getDebugProps to components (#53135)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53135

Our Codegenerated components are not generating code for `getDebugProps`. This change modifies Codegen to add those functions for all the codegen components.

## Changelog:
[General][Added] - Added getDebugProps to codegen

## Facebook:
`getDebugProps` are required by Fantom to write tests. However, we can't generate these function for third party components, because codegen can generate arbitrary structs and we don't have a generic `toString()` method that can be used or automatically generated by C++.

By generating this function only for Core Components, we can ensure that we can write Fantom tests without breaking all the users of React Native.

Reviewed By: rubennorte

Differential Revision: D79805145

fbshipit-source-id: 0e41c65fc30eaa886a05557ca233fb0a9cb18a71
2025-08-08 06:47:23 -07:00
Andrew DatsenkoandFacebook GitHub Bot 8363a4c515 Add static methods tests (#53087)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53087

Changelog: [Internal]
As title

Reviewed By: lenaic

Differential Revision: D79665922

fbshipit-source-id: 024c10960a59e1332aacf2411a68ca85c17142db
2025-08-08 06:00:58 -07:00
generatedunixname89002005287564andFacebook GitHub Bot ec3d9c60f1 Fix CQS signal readability-container-size-empty in xplat/js/react-native-github/packages (#53155)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53155

Reviewed By: rshest

Differential Revision: D79788547

fbshipit-source-id: a18465d5c16ab1822c4e9f6302767505fe6f5ee5
2025-08-08 04:24:03 -07:00
Rubén NorteandFacebook GitHub Bot 2f33eece41 Fix retry logic in Fantom when requesting bundles from Metro (#53161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53161

Changelog: [internal]

This fixes a bug in the retry logic in Fantom when requesting bundles from Metro, where we cache the error from a previous attempt and use it to determine we didn't succeed after the attemps.

Reviewed By: rshest

Differential Revision: D79881488

fbshipit-source-id: 566b2d700db2f9653b9ea9acd577d7eb03770b76
2025-08-08 04:22:16 -07:00
generatedunixname1395667395051502andFacebook GitHub Bot 81fdb9dd93 Update React Native DevTools binaries
Summary:
Automated update of React Native DevTools binaries
bypass-github-export-checks
Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D79836825

fbshipit-source-id: 82484ab99d7813b79bfb75a6c3ad3bd9863f8856
2025-08-08 04:11:28 -07:00
Andrew DatsenkoandFacebook GitHub Bot d4ea32493e Revert resizeMode to Stretch as unset (#53144)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53144

Changelog: [Internal]
This is a fix to "unset" prop value for Image.
In my previous diff D79600137 I have changed this behaviour to have Cover as a default, but it is not "default" value, but rather "unset" value.

Reviewed By: rshest

Differential Revision: D79813759

fbshipit-source-id: cc6d43742e51fb2087d6023bd0ff50a3d54eed49
2025-08-08 03:43:06 -07:00
Nicola CortiandFacebook GitHub Bot ba518bbb30 RNGP - Make sure the newArchEnabled is set to true for all the libs (#53138)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53138

Without this patch, library could break if the user removes the `newArchEnabled=`
property from the `gradle.properties` file.

With this patch instead we hardcode the property to true, so all the libraries can consume
it if they wish.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D79805857

fbshipit-source-id: 88dda707a0d80ac79e96c955ded2ef0823f3d3ff
2025-08-08 03:42:35 -07:00
David VaccaandFacebook GitHub Bot 85610c8b43 Deprecate Legacy Architecture UIManagerModules class (#53122)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53122

Deprecate LegacyArchitecture UIManagerModules class

changelog: [Android][Changed] Deprecate LegacyArchitecture UIManagerModules class

Reviewed By: mlord93

Differential Revision: D79672294

fbshipit-source-id: 8a22df4a4341a2ab501fc003ee213fb0047847fc
2025-08-08 02:52:36 -07:00
David VaccaandFacebook GitHub Bot 7f5b2b8f84 Deprecate Legacy Architecture classes belonging to com/facebook/react/uimanager (#53102)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53102

Deprecate large subset of Legacy Architecture classes belonging to com/facebook/react/uimanager

changelog: [Android][Changed] Deprecate LegacyArchitecture classes from com/facebook/react/uimanager

Reviewed By: mlord93

Differential Revision: D79672293

fbshipit-source-id: 2d32eb885af3ec2928510608330740229abf93db
2025-08-08 02:52:36 -07:00
David VaccaandFacebook GitHub Bot 39d24bade3 Deprecate LegacyArchitecture classes from package com.facebook.react.uimanager (#53120)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53120

Deprecate com.facebook.react.uimanager classes

changelog: [Android][Changed] Deprecate LegacyArchitecture classes from package com.facebook.react.uimanager

Reviewed By: mlord93

Differential Revision: D79660036

fbshipit-source-id: 981f7938e54e40f810caec72fa485cc4a00029f6
2025-08-08 02:52:36 -07:00
David VaccaandFacebook GitHub Bot 9831b03860 Rename BridgeSoLoader -> ReactNativeJNISoLoader (#53153)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53153

In this diff I'm renaming BridgeSoLoader -> ReactNativeJNISoLoader and removing LegacyArchitecture becuase this class loads jni classes that are required in new architecture

changelog: [internal] internal

Reviewed By: RSNara

Differential Revision: D79827295

fbshipit-source-id: 2d02fa1de49b2e4ee838f14e976ae3ab2ca98aef
2025-08-08 01:20:42 -07:00
Alan LeeandFacebook GitHub Bot f21a89078c Revert D79571226: replace getWindowDisplayMetrics with getScreenDisplayMetrics
Differential Revision:
D79571226

Original commit changeset: d90fca36c119

Original Phabricator Diff: D79571226

fbshipit-source-id: 670ae66f9db758d29673134adbac44780569771b
2025-08-08 00:48:14 -07:00
Alan LeeandFacebook GitHub Bot 352e440459 Back out "Fix Dimensions window values on Android < 15" (#53149)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53149

Reverting PR https://github.com/facebook/react-native/pull/52738

Changelog: [Internal]
reverting D78738516

Original commit changeset: fdb22f3cc76b

Original Phabricator Diff: D78738516

Reviewed By: mdvacca, lenaic, Abbondanzo

Differential Revision: D79835424

fbshipit-source-id: 44b5ee34b4df6752e5a6f959a54e104eef20ffca
2025-08-08 00:40:42 -07:00
David VaccaandFacebook GitHub Bot aaf471278c Back out "Add tests for DisplayMetricsHolder" (#53148)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53148

Reverting D78981753 because it's causing tests to OOM
https://github.com/facebook/react-native/commit/384677f58ea0af498f548a043be86e6876af58b1

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D79828375

fbshipit-source-id: 3de01dca3d9a9fc4530c84855049eb4ec132a485
2025-08-07 14:33:33 -07:00
Nicola CortiandFacebook GitHub Bot 384677f58e Add tests for DisplayMetricsHolder (#52946)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52946

This just add a set of unit tests for `DisplayMetricsHolder` as I'm working on this class recently.

Changelog:
[Internal] [Changed] -

Reviewed By: rshest, mdvacca

Differential Revision: D78981753

fbshipit-source-id: 5800d44d3131a58770a0049eb2d08306874b7183
2025-08-07 11:01:37 -07:00
Nicola CortiandFacebook GitHub Bot 2e76fc8e8e Correctly create the first modal state (#52835)
Summary:
There is currently a bug with Modals with New Architecture where the first frame is rendered incorrectly, specifically not accounting for all the vertical insets (only the status bar). This fixes it.

Specifically:
1. I've removed the caching of the statusbar height from `ReactModalHostView` as that was not working correctly. Sometimes the value returned `0` meaning that it was not yet computed when Fabric was asking for it. In the updated implementation we now query `FabricUIManager` given the `surfaceId` of the modal.
2. I've modified the logic to account for all the vertical insets, not just the status bar.

## Changelog:

[ANDROID] [FIXED] - Correctly account for insets on first render of Modals on New Arch

Pull Request resolved: https://github.com/facebook/react-native/pull/52835

Test Plan:
Tested on Marketplace Location Picker and the picker is still working correctly:

 https://pxl.cl/7NjtJ

Reviewed By: mdvacca

Differential Revision: D78975126

Pulled By: cortinico

fbshipit-source-id: d7afb4fa5d2f43a7e33da3860432fa6dfe0dc8d7
2025-08-07 11:01:37 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 5fc23d7c62 Add type-safe API for passing around benchmark results (#53143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53143

# Changelog:
[Internal] -

This refactors the way Fantom benchmark test results are passed to the top level, making it type safe and more maintainable.

Reviewed By: andrewdacenko

Differential Revision: D79812707

fbshipit-source-id: d8bfef7e1b0c11b277a08f5e4c810f8c1efd7f89
2025-08-07 10:46:26 -07:00
Nicola CortiandFacebook GitHub Bot e92da16a9b Migrate ClipboardModuleTest to use BridgelessReactContext (#53131)
Summary:
This test was still using the old `BridgeReactContext`, I'm migrating it to `BridgelessReactContext`.

## Changelog:

[INTERNAL] -

Pull Request resolved: https://github.com/facebook/react-native/pull/53131

Test Plan: CI

Reviewed By: mdvacca

Differential Revision: D79801564

Pulled By: cortinico

fbshipit-source-id: 9bb96185505703a773597aeadfeeaeeb194532de
2025-08-07 10:42:26 -07:00
Ruslan LesiutinandFacebook GitHub Bot ae5df7ee35 Bump Electron to 37.2.4 (#53145)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53145

# Changelog: [Internal]

See attached tasks.

Reviewed By: motiz88

Differential Revision: D79563948

fbshipit-source-id: a95b4e63d3a7d0d456c89ec7361e58fea0f5fb66
2025-08-07 10:40:57 -07:00
Sharif MahmoudandFacebook GitHub Bot dacd8f26fd Fix HEADER_SEARCH_PATHS for RuntimeExecutor when USE_FRAMEWORKS is enabled (#53099)
Summary:
`#include <ReactCommon/RuntimeExecutor.h>` stopped working in react-native 0.81 when using frameworks because it is not part of ReactCommon anymore when the split happened for iOS.

to fix this I am including RuntimeExecutor in search headers same way we include ReactCommon.

## Changelog:

[IOS] [FIXED] - Fix import RuntimeExecutor.h with USE_FRAMEWORKS

Pull Request resolved: https://github.com/facebook/react-native/pull/53099

Test Plan:
You can enable USE_FRAMEWORKS and do `#include <react/renderer/uimanager/UIManager.h>` (which react-native-reanimated is doing).
Build will fail complaining that it can't find ReactCommon/RuntimeExecutor.h which is included in UIManager.h
Add my patch, it will work and build successfully

Reviewed By: cortinico

Differential Revision: D79796637

Pulled By: cipolleschi

fbshipit-source-id: f8bb669cfb9f4414653655ed98d2cc6bb431a3e5
2025-08-07 10:12:51 -07:00
Nicola CortiandFacebook GitHub Bot ede037ade7 Cleanup heightOfTallestInlineImage field (#52978)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52978

This field is never written anywhere (neither in the internal codebase, nor in OSS).
I'm cleaning this us and simplifying the logic:
- Deprecating `effectiveLineHeight`
- Replacing all the usage of `effectiveLineHeight` with just `lineHeight`

Changelog:
[Android] [Changed] - Deprecate the field `TextAttributeProps.effectiveLineHeight`. This field was public but never used in OSS.

Reviewed By: mdvacca

Differential Revision: D79442393

fbshipit-source-id: c424a6def0257264cd160a2d7be48c2d0f47135e
2025-08-07 09:49:46 -07:00
Mateo GuzmánandFacebook GitHub Bot fa921b3c7b Migrate TextAttributeProps to Kotlin (#52452)
Summary:
Migrate com.facebook.react.views.text.TextAttributeProps to Kotlin.

## Changelog:

[Android][Changed] - Migrated TextAttributeProps to Kotlin. You might need to update your property access to use camelCase instead of Hungarian notation.

Pull Request resolved: https://github.com/facebook/react-native/pull/52452

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D79341238

Pulled By: cortinico

fbshipit-source-id: 455c7b48f47a0cf240aaf330e1fa3674798e7237
2025-08-07 09:49:46 -07:00
generatedunixname499836121andFacebook GitHub Bot bf13ecba7f Apply fixup patch to fbsource
Summary:
This is an automatically generated fixup patch to bring fbsource back into sync with
facebook/react on GitHub. Please land this patch as soon as possible, as the difference
reflected on here is already on GitHub and future changes may depend on these
changes!

<< DO NOT EDIT BELOW THIS LINE >>
diff-train-skip-merge
diff-train-source-id: 7da6014535999d256d2846aadbb7fc1373d76253

Generated by: https://www.internalfb.com/intern/sandcastle/job/18014400563434324/

GitHub Repo: facebook/react

Changelog: [Internal]

Reviewed By: jackpope

Differential Revision: D79754431

fbshipit-source-id: 027428142f36683b07cb66112335f75ecfb5dd12
2025-08-07 09:27:23 -07:00
Andrew DatsenkoandFacebook GitHub Bot 5f8807acc2 Add public API test (#53096)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53096

Changelog: [Internal]
As title

Reviewed By: rshest

Differential Revision: D79726634

fbshipit-source-id: 1474cbfb635250e06f4f898338ef0874bc488ed1
2025-08-07 09:04:25 -07:00
Nicola CortiandFacebook GitHub Bot 026e22bb8d Deprecate the DefaultDevSupportManagerFactory.create() method used for Old Arch (#53137)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53137

One of those 2 methods can be deprecated as it was used only for old architecture.
We'll be removing it at some point in the future.

Changelog:
[Android] [Deprecated] - DefaultDevSupportManagerFactory.create() method used for Old Arch

Reviewed By: rshest

Differential Revision: D79806116

fbshipit-source-id: ad2d5515f93bb85e3b7c495b369078f4c66d143b
2025-08-07 08:56:26 -07:00
Mateo GuzmánandFacebook GitHub Bot f1894393ca Initial Kotlin setup and migrate YogaConstants (#53133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53133

# Changelog:
[Internal] -

As part of the ongoing effort to migrate the React Native codebase to Kotlin, this PR introduces the initial setup required for Kotlin support in Yoga.

- Added initial basic Kotlin configuration to the project.
- Migrated `YogaConstants` as an initial file to try out the first migration steps.

X-link: https://github.com/facebook/yoga/pull/1829

Test Plan:
- Tested the migrated class directly against facebook/react-native, see the PR [here](https://github.com/facebook/react-native/pull/52998).
- Run: `./gradlew :yoga:assembleDebug` & `./gradlew :yoga:compileDebugSources`

I am not able to run the Java tests in this repo (even before the initial Kotlin setup) – not sure if I am missing something there but any pointers are welcome – it seems like there is some missing configuration. Currently trying with `./gradlew :yoga:test`

Reviewed By: cortinico

Differential Revision: D79545992

Pulled By: rshest

fbshipit-source-id: 8257ff53e6b6f2436980be98b6c94e1ac526b207
2025-08-07 08:17:56 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 77ee24ddce Print benchmark comparison results in a tabular format (#53097)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53097

# Changelog:
[Internal] -

This makes the benchmark results comparison printout, added in https://github.com/facebook/react-native/pull/52925, be done in a tabular form, so it's easier to read and copy/paste around.

Reviewed By: lenaic

Differential Revision: D79728695

fbshipit-source-id: 4dfc999ad4a9a8c2d67efdfce11aff75383cf645
2025-08-07 08:11:32 -07:00
Eliot FallonandFacebook GitHub Bot 327057fad5 fix: fix a typo in the react_native_pods.rb file (#53129)
Summary:
- Switches fmt_config to fast_float_config so it matches what is used in the method

When trying to use a forked version of the Pod it is not possible to set a new repo for Fast Float. This was caused by a typo in the method used to update the configuration of where to find the Pod.

## Changelog:

[IOS] [FIXED] - Fixed variable naming error in set_fast_float_config method in react_native_pods.rb

Pull Request resolved: https://github.com/facebook/react-native/pull/53129

Test Plan: Add the line `set_fast_float_config({:git => 'some-git-repo'})` to an application's Podfile

Reviewed By: cortinico

Differential Revision: D79805939

Pulled By: cipolleschi

fbshipit-source-id: 9705e1f63e21b788362ca94b74e32bce0177a729
2025-08-07 07:48:07 -07:00
Nicola CortiandFacebook GitHub Bot cd71c9620c Do not die on collect-results after printing to Discord. (#53132)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53132

This will prevent the Firebase script from running at all. I'm removing it.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D79801691

fbshipit-source-id: 2705dff93fc9dbbcfaf97a1ba29b69d4d0a8143c
2025-08-07 07:07:10 -07:00
generatedunixname537391475639613andFacebook GitHub Bot 9bb53c02dd xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchShadowNode.cpp (#53126)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53126

Reviewed By: rshest

Differential Revision: D79710434

fbshipit-source-id: da72999b76c0eff73eb62ef47dcf5ec0ed6c9e09
2025-08-07 05:47:35 -07:00
David VaccaandFacebook GitHub Bot f67078df07 Deprecate all LegacyArchitecture classes on LayoutAnimation package (#53101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53101

Deprecate all LegacyArchitecture classes on LayoutAnimation package

changelog: [Android][Changed] Deprecate LegacyArchitecture classes from LayoutAnimation package

Reviewed By: alanleedev

Differential Revision: D79658935

fbshipit-source-id: 34ab2f674868dbee459f2018e82a7d50d0d7333a
2025-08-07 05:11:31 -07:00
Mathieu ActhernoeneandFacebook GitHub Bot 3b185e4bce Fix Dimensions window values on Android < 15 (#52738)
Summary:
This PR (initially created for edge-to-edge opt-in support, rebased multiple times) fixes the `Dimensions` API `window` values on Android < 15, when edge-to-edge is enabled.

Currently the window height doesn't include the status and navigation bar heights (but it does on Android >= 15):

<img width="300" alt="Screenshot 2025-06-27 at 16 23 02" src="https://github.com/user-attachments/assets/c7d11334-9298-4f7f-a75c-590df8cc2d8a" />

Using `WindowMetricsCalculator` from AndroidX:

<img width="300" alt="Screenshot 2025-06-27 at 16 34 01" src="https://github.com/user-attachments/assets/7a4e3dc7-a83b-421b-8f6d-fd1344f5fe81" />

Fixes https://github.com/facebook/react-native/issues/47080

## Changelog:

[Android] [Fixed] Fix `Dimensions` `window` values on Android < 15 when edge-to-edge is enabled

Pull Request resolved: https://github.com/facebook/react-native/pull/52738

Test Plan:
Run the example app on an Android < 15 device.

Rollback Plan:

Reviewed By: cipolleschi, Abbondanzo

Differential Revision: D78738516

Pulled By: alanleedev

fbshipit-source-id: fdb22f3cc76b0bda987db426cb015124bcacdc84
2025-08-07 02:17:14 -07:00
Alan LeeandFacebook GitHub Bot 8b2e309479 replace getWindowDisplayMetrics with getScreenDisplayMetrics (#53041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53041

update `DisplayMetricsHolder.getWindowDisplayMetrics()` to `getScreenDisplayMetrics()`.

Where window width and height is not needed, prefer to use `screenDisplayMetrics` as with upcoming diff `windowDisplayMetrics` initialization only happen using UiContext and have potential to cause more issues if used unnecessarily.

Changelog: [Internal] Update `DisplayMetricsHolder.getWindowDisplayMetrics()` to use `.getScreenDisplayMetrics()`

Reviewed By: mlord93

Differential Revision: D79571226

fbshipit-source-id: d90fca36c119318e7a2dfa6953fc2148b35e83d4
2025-08-07 02:17:14 -07:00
David VaccaandFacebook GitHub Bot d4bf644e47 Update deprecation message for ReactNativeHost class (#53118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53118

Update deprecation message for ReactNativeHost class

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D79677829

fbshipit-source-id: 5013e0988a1ffbfea49a261fd23ac71af76c3313
2025-08-06 23:58:34 -07:00
Devan BuggayandFacebook GitHub Bot 2697e8aaab Remove mode from metro client-log data (#53117)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53117

Sending the mode is no longer needed as you can't opt out of legacy arch any longer, and was only used for printing a (NOBRIDGE) prefix.

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D79762592

fbshipit-source-id: 845aabf2a8365c88808990ea481503b23597a8a0
2025-08-06 23:56:45 -07:00
Tim YungandFacebook GitHub Bot c861804325 VirtualView: Simplify Window Focus Detection
Summary:
Refactors the window focus detection feature flag logic in `VirtualView` (Android) to eliminate one instance property and instead utilize the existence of the focus listener to determine whether window focus detection is enabled.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D79743782

fbshipit-source-id: d12e70d8e52b72d546ff097c3b1bcfbd29fb9129
2025-08-06 20:49:05 -07:00
Alex HuntandFacebook GitHub Bot 2768c84445 Implement local connection for perf metrics in HostTarget (#52838)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52838

**Context**

Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.

**This diff**

Wires up a client/subscriber for the `"__chromium_devtools_metrics_reporter"` runtime binding (to which we emit live metrics events since D78904748). This will be used to unpack these performance updates to send to the host platform.

- Creates a new `HostRuntimeBinding` helper, which establishes a local/private CDP session.
- Conditionally installs our perf metrics runtime binding in `HostTarget` when `perfMonitorV2Enabled` is set.
- Wires up a new `onPerfMonitorUpdate` event on `HostTargetDelegate` (unimplemented until the next diff).

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D78904766

fbshipit-source-id: 991f17a4cc69f574917750053a5da31bbc6dc0d5
2025-08-06 16:05:28 -07:00
Zeya PengandFacebook GitHub Bot be6f3c6f77 Add NativeAnimated jest test to verify node creation behavior at update (#53115)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53115

## Changelog:

[Internal] [Added] - Add NativeAnimated jest test to verify node creation behavior at update

Reviewed By: yungsters

Differential Revision: D79729178

fbshipit-source-id: 1c24c6a19ee994ee4ea7a916c47f227e151d65b4
2025-08-06 15:17:33 -07:00
David VaccaandFacebook GitHub Bot 54770cecc4 Mark JSInstance as InteropLegacyArchitecture (#53100)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53100

Mark JSInstance as InteropLegacyArchitecture

changelog: [internal] internal

Reviewed By: mlord93, cortinico

Differential Revision: D79732414

fbshipit-source-id: fc66d6cfef34b4ac66af724bf4336f4f4c38f447
2025-08-06 14:13:32 -07:00
Andrew DatsenkoandFacebook GitHub Bot 457190cc4b Add test for width, style, testID and tintColor (#53088)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53088

Changelog: [Internal]
As title

Reviewed By: rshest

Differential Revision: D79642765

fbshipit-source-id: 92862934fc72cfca2ce35c365fa7369d878d58d9
2025-08-06 09:38:29 -07:00
Maciej JastrzębskiandFacebook GitHub Bot 6965d57e75 fix(a11y): TextInput aria-label handling (#53051)
Summary:
The `aria-label` prop was ignored on `TextInput` component. Which resulted in screen reader not able to read it.

This PR forwards `aria-label` to `accessibilityLabel` in a manner similar to e.g. `View` and `Text`

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [FIXED] - a11y: fix `aria-label` on `TextInput`

Pull Request resolved: https://github.com/facebook/react-native/pull/53051

Test Plan:
Run RNTester => TextInput => Accessibility section under Accessibility Inspector or screen reader.

iOS fixed:
https://github.com/user-attachments/assets/68c3a2ef-7dfe-479c-97fc-cbe72108c45c

iOS baseline:
https://github.com/user-attachments/assets/2e8372ba-10dc-47d2-b6b1-9f664000de7d

Reviewed By: andrewdacenko

Differential Revision: D79635413

Pulled By: rshest

fbshipit-source-id: dd2f583d67c6c6c6393e02c5fe534308e1e2f921
2025-08-06 09:36:35 -07:00
Tommy NguyenandFacebook GitHub Bot bf2c3af93b fix(codegen): fix missing dependencies (#52884)
Summary:
`react-native/codegen` uses `babel/parser` and `babel/core` but does not declare dependency on them. Depending on how packages are hoisted (and especially in pnpm setups), this causes crashes during codegen.

Resolves https://github.com/facebook/react-native/issues/52883

## Changelog:

[GENERAL] [FIXED] - Add missing Babel dependencies

Pull Request resolved: https://github.com/facebook/react-native/pull/52884

Test Plan: See https://github.com/facebook/react-native/issues/52883

Reviewed By: cortinico, christophpurrer

Differential Revision: D79103092

Pulled By: robhogan

fbshipit-source-id: ecaf690f994393a652ea7f0d4f30bbabeb23a434
2025-08-06 08:19:47 -07:00
generatedunixname537391475639613andFacebook GitHub Bot a4b958099c xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp (#53093)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53093

Reviewed By: rshest

Differential Revision: D79709943

fbshipit-source-id: b8d75b6e3b790c94dd3250654459afd782315d9f
2025-08-06 08:18:43 -07:00
Alex HuntandFacebook GitHub Bot b4164cd97c Move JInspectorNetworkReporter, add missing SoLoader call (#53055)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53055

Moves the C++ part of `InspectorNetworkReporter.kt` into the `react_devsupportjni` JNI library, and adds missing `SoLoader.loadLibrary` call.

Replaces D79568759 / https://github.com/facebook/react-native/pull/53036.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D79638331

fbshipit-source-id: 5df450ad80e4532d6ada1e4dab51a1de6418a4e0
2025-08-06 08:14:31 -07:00
Andrew DatsenkoandFacebook GitHub Bot f526e91fda Add tests for src and srcSet (#53062)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53062

Changelog: [Internal]
As title

Reviewed By: rshest

Differential Revision: D79642287

fbshipit-source-id: 59d7dbf7f2562ca550ac48eb9067469e6128e7c6
2025-08-06 08:08:44 -07:00
Andrew DatsenkoandFacebook GitHub Bot bb5d0df0e3 Add source tests (#53074)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53074

Changelog: [Internal]
Add tests for source prop of Image.

Reviewed By: rshest

Differential Revision: D79605165

fbshipit-source-id: 400cb37f59966634a2ced3c95425be4dcb1fd1a3
2025-08-06 08:08:44 -07:00
Andrew DatsenkoandFacebook GitHub Bot a6ef65e06b Add resizeMode tests (#53061)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53061

Changelog: [Internal]
Add tests for resizeMode prop

Reviewed By: rshest

Differential Revision: D79600137

fbshipit-source-id: d802fb375f2f57f38a51d918d2045763dd79c440
2025-08-06 08:08:44 -07:00
Andrew DatsenkoandFacebook GitHub Bot 93694e3f5d Add referrerPolicy tests (#53073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53073

Changelog: [Internal]
Add referrerPolicty for cross origin requests.

Reviewed By: rshest

Differential Revision: D79598735

fbshipit-source-id: 96a5b092a278993ac728a9413c1a9376bfe7a69a
2025-08-06 08:08:44 -07:00
Andrew DatsenkoandFacebook GitHub Bot 96ebf5e969 Add on<Event> props (#53060)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53060

Changelog: [Internal]
Add tests for Image props that notify of image loading progress.

Reviewed By: rshest

Differential Revision: D79596580

fbshipit-source-id: 124ee1b4ac70710c4efa9b6e11a168b61fe29aed
2025-08-06 08:08:44 -07:00
Andrew DatsenkoandFacebook GitHub Bot 7bd1254eda Add tests for defaultSource and height (#53058)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53058

Changelog: [Internal]
As title

Reviewed By: rshest

Differential Revision: D79566292

fbshipit-source-id: cd0d39d914d4e17ee6472be766ba18b0c3866d95
2025-08-06 08:08:44 -07:00
Sophie LandFacebook GitHub Bot 4b8dbe7642 fix: turn off build IDs for reproducibility (#53089)
Summary:
these cause issues for apps that want to be "reproducible" (i.e. the same code leads to the same output, which can be helpful for detemining if there's been any tampering or similar). see also https://gitlab.com/IzzyOnDroid/repo/-/wikis/Reproducible-Builds/RB-Hints-for-Developers#no-funny-build-time-generated-ids

I'm not exactly sure why this was set. it seems to have been introduced in https://github.com/facebook/react-native/commit/e3830ddffd9260fe071e0c9f9df40b379d54cf26 without any (public) explanation as to why it was needed?

## Changelog:

[ANDROID] [FIXED] - Turned off build IDs for native libraries, fixing issues with reproducibility

Pull Request resolved: https://github.com/facebook/react-native/pull/53089

Test Plan: I've successfully used similar patches in my own app for a while.

Reviewed By: cipolleschi

Differential Revision: D79718924

Pulled By: cortinico

fbshipit-source-id: 7c609fa0b5b305cb759586fb1c7f332589ca9cc7
2025-08-06 08:07:14 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 99f1c30409 Don't populate props with default values for Text component (#53059)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53059

# Changelog:
[Internal] -

This is a re-submit of the partially reverted https://github.com/facebook/react-native/pull/52905, which should work fine now on top of the changes stack that support the RN feature flags being safely used on the modules' top level.

Reviewed By: rubennorte

Differential Revision: D79640965

fbshipit-source-id: d8bda0dba662930d1343ea9d5155791a686b653b
2025-08-06 07:54:26 -07:00
Samuel SuslaandFacebook GitHub Bot 288f6d9f48 Back out "Make sure props default value is restored when disconnected from animated" (#53084)
Summary:
changelog: [internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/53084

This is causing glitches

Reviewed By: rozele

Differential Revision: D79705318

fbshipit-source-id: 0e25909837f0db9812af7835ea88f60390c6ae70
2025-08-06 06:13:14 -07:00
Ruslan LesiutinandFacebook GitHub Bot 421a0c7077 fix: reset maxDuration only after recording TracingStartedInPage event (#53080)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53080

# Changelog: [Internal]

We were accidentally resetting this before calculating the timestampf for the TracingStartedInPage event, which is the left boundary for the timeline window.

Reviewed By: sbuggay

Differential Revision: D79670865

fbshipit-source-id: c6b5f869e185d6d3c80cb7153891c72283c82418
2025-08-06 05:48:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot 593bdc6762 Keep tracingMode on TraceRecordingState (#53077)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53077

# Changelog: [Internal]

Stores the tracing::Mode on a TraceRecordingState and updates the logic for:
- InstanceTracingAgent to enable PerformanceTracer with a specified window size
- RuntimeTracingAgent to only enable sampling profiler for CDP-initiated sessions

Reviewed By: sbuggay

Differential Revision: D79670864

fbshipit-source-id: 2c4eacb29666b59acbc508848a0a3d859f21a403
2025-08-06 05:48:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot b358404f44 Override background Trace Recording if user initiated a new one (#53039)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53039

# Changelog: [Internal]

We can now distinguish these 2 different modes.

Reviewed By: sbuggay

Differential Revision: D79565934

fbshipit-source-id: 780678d1f50d4c1d73d55ebc95da0ea328fa2cb3
2025-08-06 05:48:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot f66ef53962 Create TracingMode (#53035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53035

# Changelog: [Internal]

This adds an ability to distinguish different trace recordings, based on mode

Reviewed By: sbuggay

Differential Revision: D79557790

fbshipit-source-id: cbb216df86fa1a4692e1b82c8a14a6049b5c45ec
2025-08-06 05:48:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot 989579c533 Stop potentially running trace recording if CDP session is destroyed (#52960)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52960

# Changelog: [Internal]

We never call `stopTracing()` on a HostTarget, if the Agent was destroyed.

This could only happen if the session was destroyed. There could me multiple sessions, so we have to keep the source of truth for recording status in a session state.

Reviewed By: sbuggay

Differential Revision: D79435494

fbshipit-source-id: db72ffdf6856974e980afa78d59dec4bf45df289
2025-08-06 05:48:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot 8e97de473e Cleanup legacy tracing endpoints from Agents (#52965)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52965

# Changelog: [Internal]

Reviewed By: sbuggay

Differential Revision: D79434656

fbshipit-source-id: 8c6b690ac6c22df8376651d14b940f74cf23dca3
2025-08-06 05:48:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot f618ca4872 Use new endpoints in CDP TracingAgent (#52961)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52961

# Changelog: [Internal]

Now that we've implemented all required serializers and TraceRecordedState has everything needed, we can migrate TracingAgent to use this new infra.

Reviewed By: sbuggay

Differential Revision: D79433497

fbshipit-source-id: 8c63f0faa50844786b7af8860c22fc006dd38414
2025-08-06 05:48:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot b764966c9a Expose start and stop tracing endpoints for HostTargetController (#52962)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52962

# Changelog: [Internal]

CDP Agents should interact with Targets by using Controllers:
https://www.internalfb.com/code/fbsource/[0b20b752c43f]/xplat/js/react-native-github/packages/react-native/ReactCommon/jsinspector-modern/HostTarget.h?lines=300-303

This diff adds public endpoinst for controlling the trace recording on a `HostTargetController` that will be used by `TracingAgent` later.

Reviewed By: sbuggay

Differential Revision: D79433500

fbshipit-source-id: 8ff45b1e2380206f0b72f8ba8b879543cf6b9933
2025-08-06 05:48:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot b954fbf8b7 Implement serializer for TraceRecordingState (#52964)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52964

# Changelog: [Internal]

Now TraceRecordingState should capture everything we need in order to display a trace on a timeline.

We just need to serialize it properly into collection of serialized Trace Events that would be sent via `Tracing.dataCollected` CDP events.

This is what this serializer is doing.

Reviewed By: sbuggay

Differential Revision: D79434655

fbshipit-source-id: 6b6858db23077eb7305781b9b0d98af8dedd68ca
2025-08-06 05:48:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot c8f260658d Record startTime on TraceRecordingState (#52967)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52967

# Changelog: [Internal]

We would need this to correctly serialize Runtime Sampling Profiles.

In case of recording the trace in the background, this might not be the value we would want to use, we would probably add another field or calculate it dynamically, depending on the tracing mode.

This is not the case for now, will be solved separately on top of the stack.

Reviewed By: sbuggay

Differential Revision: D79433502

fbshipit-source-id: 172ff19985d325585590794fb2523a24a6860221
2025-08-06 05:48:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot fa9b195661 Record processId on TraceRecordingState (#52969)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52969

# Changelog: [Internal]

We would need this to correctly serialize Runtime Sampling Profiles.

Reviewed By: sbuggay

Differential Revision: D79433501

fbshipit-source-id: 43d10037351669a87623ffccf2b6da60961c0157
2025-08-06 05:48:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot 3c637b09e6 Record InstanceTracing profile on TraceRecordingState (#52963)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52963

# Changelog: [Internal]

We are deprecating previous `InstanceTarcingProfile` struct, but not removing yet, since this is still used and we will migrate in one of the diffs at the top of the stack.

The `InstanceTracingProfile` will consist only of Trace Events that were captured by PerformanceTracer, and will not store Runtime Sampling Profiles.

There are multiple reasons for this:
1. As of right now, Runtime Sampling Profiles are completely independant from Instance Profiles and do not require anythings from Instance as a Target to be represented on a timeline.
2. Although PerformanceTracer is a singleton, it should be this way. It captures events for something that can only be dispatched if there is an allocated React Instance, so in the future PerformanceTracer could become a data-member of InstanceTarget.

Reviewed By: sbuggay

Differential Revision: D79433498

fbshipit-source-id: 0fdf09517488bc5c6c8eb604aee66535cdc19ffb
2025-08-06 05:48:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot 5144062937 Record RuntimeSamplingProfile on TraceRecordingState (#52968)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52968

# Changelog: [Internal]

Now that we've defined all actors and relationship between Agents, we can start recording profiles and store them on a recording state.

Reviewed By: sbuggay

Differential Revision: D79415396

fbshipit-source-id: 9639e59d619268d970b895da2e19dfd92c963a32
2025-08-06 05:48:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot a9da64fbf7 Create a local session for Tracing (#52966)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52966

# Changelog: [Internal]

The current design for Tracing is flawed. Right now the logic is mostly scattered around CDP Agents, lifetime of which is tied to CDP session.

This diff introduces a new approach:
- The HostTarget will be the only Target that has public entrypoints to startTracing as part of the jsinspector backend.
- It will create and own TraceRecording that acts as a local session. We won't use wording session here, because it is already reserved for CDP case.
- Every Target will implement TracingAgent, lifetime of which will be limited by lifetime of either Target or TraceRecording.
- All these TracingAgent will have a reference to TraceRecordingState, which they can mutate

This approach unblocks:
- Recording traces without active CDP sessions, for example in a background.
- Recording full instance reloads and multiple profiles for Instances and Runtimes.

{F1980838032}

Reviewed By: sbuggay

Differential Revision: D79371359

fbshipit-source-id: 034e984fd7e977457bd41a980e5feb049db3339d
2025-08-06 05:48:35 -07:00
generatedunixname537391475639613andFacebook GitHub Bot fce9f68f29 xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/safeareaview/SafeAreaViewShadowNode.cpp (#53090)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53090

Reviewed By: rshest

Differential Revision: D79627030

fbshipit-source-id: fe36f901b2573689821ec3eacecc1f364d3c9183
2025-08-06 05:44:42 -07:00
Rubén NorteandFacebook GitHub Bot 0090333296 Add test to ensure baseline memory usage (#53072)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53072

Changelog: [internal]

This creates a test to make sure there are no changes in React Native dramatically increasing memory usage in simple scenarios.

Reviewed By: rshest

Differential Revision: D79646758

fbshipit-source-id: d7a863468adabb75de7ceb123d96131564bd0959
2025-08-06 05:40:02 -07:00
Rubén NorteandFacebook GitHub Bot 789fc57254 Improve API to take JS heap snapshots in Fantom (#53071)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53071

Changelog: [internal]

The current API to take JS heap snapshots has some problems:
1. Ergonomics: it requires you to input the filepath where you want to store the snapshot. This isn't aligned with the behavior we have for JS traces where the output path is provided to you.
2. It doesn't work in optimized builds, as it requires a specific option in Hermes.

For 1), this replaces `Fantom.saveJSMemoryHeapSnapshot(filePath)` with `Fantom.takeJSMemoryHeapSnapshot()` that outputs the snapshot in a predefined path and prints it to the console.

For 2), this adds a new environment variable to force building Hermes with memory instrumentation (`FANTOM_ENABLE_JS_MEMORY_INSTRUMENTATION`). This is exposed as an option and not set by default because it has a performance overhead at runtime that we don't want to pay (especially in benchmarks).

This option only works when using Buck in development, because we want to generate this new binary type on demand when necessary, instead of making it part of the prebuilts we do before running tests in OSS and CI.

Reviewed By: lenaic

Differential Revision: D79642314

fbshipit-source-id: a2980616a495bd6dca29c0709a9581db6fb3f2cc
2025-08-06 05:40:02 -07:00
Rubén NorteandFacebook GitHub Bot 2187f653f6 Improve filenames of JS sampling profiler traces (#53069)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53069

Changelog: [internal]

This changes the names of the JS traces from Fantom from using a unix timestamp in the file name to using the ISO date:

- From: `View-itest.js-1754406329686.cpuprofile`
- To: `View-itest.js-2025-08-05T15:05:29.686Z.cpuprofile`

Reviewed By: rshest

Differential Revision: D79646760

fbshipit-source-id: d8a654724c1abc2d3e285ee658c2d390d3241d82
2025-08-06 05:40:02 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 743db63570 Fix logspam when there is no benchmarking results (#53091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53091

# Changelog:
[Internal] -
This fixes some excessive printing from the benchmarking results, which happened even if there was no benchmarks ran.

Reviewed By: rubennorte

Differential Revision: D79719026

fbshipit-source-id: 0e75d97ae9c762cab25007bfab5ca8a6dc43e148
2025-08-06 05:32:11 -07:00
Vitali ZaidmanandFacebook GitHub Bot 93a052c611 Changelog for 0.81.0-rc.5 (#53086)
Summary:
Add changelog entry for 0.81.0-rc.5

## Changelog:

[INTERNAL] Changelog for 0.81.0-rc.5

Pull Request resolved: https://github.com/facebook/react-native/pull/53086

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D79717506

Pulled By: vzaidman

fbshipit-source-id: 6086894bc5609e5e250939bcc2008a01350c2afe
2025-08-06 05:13:03 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 7d0bef2f25 Add warning if RCT_NEW_ARCH_ENABLED is set to 0 (#53070)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53070

As per title, this change adds a warning if you call `pod install` with `RCT_NEW_ARCH_ENABLED` set to 0.

## Changelog:
[iOS][Added] -  Add warning if RCT_NEW_ARCH_ENABLED is set to 0

Reviewed By: mdvacca

Differential Revision: D79655716

fbshipit-source-id: 516cc02f9b2dbddaae99c2d74bba249970641d1d
2025-08-06 04:56:19 -07:00
Ruslan LesiutinandFacebook GitHub Bot aa25ad22a2 Update debugger-frontend from 7dcbddd...9215667 (#53082)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53082

Changelog: [Internal] - Update `react-native/debugger-frontend` from 7dcbddd...9215667

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/7dcbddd636137a9604d69a99cc69221216cd4be6...921566790e9e16d0ecace6e49b3cfaace205958c).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [921566790](https://github.com/facebook/react-native-devtools-frontend/commit/921566790) | Ruslan Lesiutin (28902667+hoxyq@users.noreply.github.com) | 2025-08-05T18:09:32+01:00 | [feat: add React Native-only event for pre-enabling multiple layers of Tracing (#199)](https://github.com/facebook/react-native-devtools-frontend/commit/921566790) |

Reviewed By: sbuggay

Differential Revision: D79661411

fbshipit-source-id: 63c13de4c6f24bd669aed6397e6d08f00510237c
2025-08-06 03:41:09 -07:00
Nicola CortiandFacebook GitHub Bot 00175bd096 Compare nightly results up to 7 days in the back (#53065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53065

Instead of checking results from the previous day, allow to go back up to 7
days in the past to check for previous runs.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D79568067

fbshipit-source-id: 5d6fac6a06b4e26e52de6fbf6187ec8f8e44e10e
2025-08-06 03:04:02 -07:00
Nicola CortiandFacebook GitHub Bot f806851875 Store nightly outcome and compute daily broken/recovered from Firebase (#53066)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53066

This diff introduces the mechanism for us to store the result of nightly 3p
library integration on Firebase.
Having the result store, we can now query the result from the previous day and
report if the build is newly broken or recovered overnight.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D79565536

fbshipit-source-id: ba839b2950462a7ca6186a163f93f062719304fb
2025-08-06 03:04:02 -07:00
Riccardo CipolleschiandFacebook GitHub Bot aa4555eaf1 Fix dynamic framework build (#53075)
Summary:
Pure cocoapods build with dyn frameworks was broken due to some missing dependencies with the new performance metrics of cdp

## Changelog:
[iOS][Fixed] - Fix pure cocoapods dynamic framework build

Pull Request resolved: https://github.com/facebook/react-native/pull/53075

Test Plan:
Tested locally in RNTester with
```
USE_FRAMEWORKS=dynamic bundle exec pod install
```
and then building from Xcode

Reviewed By: cortinico

Differential Revision: D79676186

Pulled By: cipolleschi

fbshipit-source-id: ae6b81138fcae66c67bedadb1e1ad9cd6c4b6c35
2025-08-06 03:02:22 -07:00
nishan (o^▽^o)andFacebook GitHub Bot 138d0eb01d Add filter to native animated allowlist (#52920)
Summary:
Add filter to native animated allowlist.

## Changelog:

[GENERAL] [ADDED] - Allow filter usage with native animated driver.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/52920

Test Plan: Tested on RNTester

Reviewed By: joevilches

Differential Revision: D79473929

Pulled By: lunaleaps

fbshipit-source-id: de6fcc0f18a1d656688dce513d2cf48a3c9d4f09
2025-08-05 20:27:16 -07:00
Peter AbbondanzoandFacebook GitHub Bot 4503068117 Make ReactAccessibilityDelegate nullsafe (#53068)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53068

Adds some assertion annotations and small null checks to `ReactAccessibilityDelegate` to comply with FB's Nullsafe annotation

Changelog: [Internal]

Reviewed By: arushikesarwani94

Differential Revision: D79645332

fbshipit-source-id: 707e4e6d4a5f09232af168c2f7c57c2fdbb1f08d
2025-08-05 16:11:34 -07:00
Sam ZhouandFacebook GitHub Bot af1bcb6d44 Mass replace $FlowIgnore with $FlowFixMe in react-native (#53076)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53076

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D79672242

fbshipit-source-id: 560f057d8658ed602cf7241e584bade70d8f3a99
2025-08-05 15:44:41 -07:00
Rubén NorteandFacebook GitHub Bot 5936f29d6a Add test to ensure setUpDefaultReactNativeEnvironment does not access feature flags (#53057)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53057

Changelog: [internal]

This adds a Fantom test to ensure that `setUpDefaultReactNativeEnvironment` doesn't read any feature flags. This prevents catching this as a runtime issue when the feature flag system complains that feature flags were accessed before being overridden, which always would happen if this module read any flags (as it runs before any product code that sets overrides).

Reviewed By: rshest

Differential Revision: D79639890

fbshipit-source-id: 6997609b7bf84947a6da53b58e68f9edd5654912
2025-08-05 13:58:32 -07:00
Rubén NorteandFacebook GitHub Bot 527e308a90 Add private function in feature flags to reset internal JS state for testing (#53056)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53056

Changelog: [internal]

This exposes a utility method in `ReactNativeFeatureFlagsBase` to reset its internal state for testing purposes.

This is intentionally not exposed through `ReactNativeFeatureFlags` to avoid it being used at runtime.

Reviewed By: rshest

Differential Revision: D79639889

fbshipit-source-id: adfb6125d991994c9706d5952d309915fec8f815
2025-08-05 13:58:32 -07:00
Zeya PengandFacebook GitHub Bot 1f9667effa Make sure props default value is restored when disconnected from animated (#53043)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53043

## Changelog:

[Internal] [Changed] - Make sure props default value is restored when disconnected from animated

Reviewed By: sammy-SC

Differential Revision: D79566216

fbshipit-source-id: b23b10101dfac5027cd6d0f0926f6e41b39715ba
2025-08-05 13:28:17 -07:00
Andrew DatsenkoandFacebook GitHub Bot a0f93ea879 Add tests for crossOrigin (#53045)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53045

Changelog: [Internal]
Add tests for cross origin headers.

Reviewed By: rubennorte

Differential Revision: D79562333

fbshipit-source-id: ff8705b4e59c89bc48be29767bbdefbba9328534
2025-08-05 12:06:14 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 83e6eaf693 Prevent users from opting-out of the New Architecture (#53026)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53026

This change prevents users from opting out of the New Architecure.

The change is non breaking with respect to building an app: all the functions are still there, even if they are unreachable, in case users will still call them explicitly.
We hardcoded all the values to enable the New Architecture, so there is no way to disable it.

This is a behavioral breaking change, though.

## Changelog:
[iOS][Removed] - Removed the opt-out from the New Architecture.

Reviewed By: cortinico

Differential Revision: D79090048

fbshipit-source-id: 9779bfedf50748d7adbef5f7ef038f469e30efc2
2025-08-05 11:37:24 -07:00
Sam ZhouandFacebook GitHub Bot 01d5eebdb7 Remove random variants of suppress_types that have been fully cleaned up
Summary: Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D79652708

fbshipit-source-id: 8027082b0566cca5700d40860272b7683082b275
2025-08-05 11:02:53 -07:00
Alex HuntandFacebook GitHub Bot 141c95697a Validate max requestable IO.read size (#53063)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53063

Update `IO.read` CDP method handler to validate the received `size` parameter.

This now accepts a max value of 10MB — adding a layer of safety in front of our current Android implementation, which fails at around ~15MB due to OkHttp limits.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D79646155

fbshipit-source-id: c777802105dc31cdcc7e9e960c880e689540fddd
2025-08-05 10:09:19 -07:00
Peter AbbondanzoandFacebook GitHub Bot 0f0a3cfce2 Provide ReactContext to experimental JSTouchDispatcher method (#53003)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53003

The new `onChildStartedNativeGesture` method accepts a nullable `ReactContext` value for the purpose of flushing active touch events. This change updates all callsites of that method to pass a `ReactContext`

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D79258727

fbshipit-source-id: 7b2950f514295dbe26822442c98079b8121cb3bf
2025-08-05 09:42:36 -07:00
Devan BuggayandFacebook GitHub Bot 551af31871 Update debugger-frontend from a7e4f59...7dcbddd (#53047)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53047

Changelog: [Internal] - Update `react-native/debugger-frontend` from a7e4f59...7dcbddd

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/a7e4f59675edbda995b0cb0d40f277a59a3baebf...7dcbddd636137a9604d69a99cc69221216cd4be6).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [7dcbddd63](https://github.com/facebook/react-native-devtools-frontend/commit/7dcbddd63) | sbuggay (sbuggay@gmail.com) | 2025-08-04T13:54:27-07:00 | [Add landingView query param enabling view focus on launch (#197)](https://github.com/facebook/react-native-devtools-frontend/commit/7dcbddd63) |

Reviewed By: huntie

Differential Revision: D79590789

fbshipit-source-id: 1868506dd401361a9843f24e67ffce9c6a5ffb64
2025-08-05 08:36:40 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 8ef39b491c Implement benchmark comparison of different feture flag configurations (#52925)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52925

# Changelog:
[Internal] -

This adds an extra "ranking" report when running Fantom benchmark vs different React Feature flag configurations.

It can be very useful when implementing some particular optimization, to streamline the before/after comparison wit this optimization enabled/disabled.

Reviewed By: andrewdacenko

Differential Revision: D79269601

fbshipit-source-id: f29e761e313d6857e5b3ac65faf2a387a84be9df
2025-08-05 08:34:35 -07:00
Rubén NorteandFacebook GitHub Bot 664f7c0dcf Add test to verify that components like View and Text are not loaded as a side-effect of environment initialization (#53053)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53053

Changelog: [internal]

This adds a Fantom test to ensure that setting up the RN environment doesn't trigger the initialization for React components like View and Text, which should be lazy loaded when necessary.

Reviewed By: rshest

Differential Revision: D79636160

fbshipit-source-id: ef1fbd6cd531eb7082dce000ba74a5eed451e259
2025-08-05 07:06:24 -07:00
Rubén NorteandFacebook GitHub Bot 14c869cee6 Reduce side-effects of AppRegistry (#53054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53054

Changelog: [internal]

We eagerly require `AppRegistry` from environment initialization (`InitializeCore`) because it has some side-effects that are necessary for error reporting (see https://github.com/facebook/react-native/issues/34649 and https://github.com/facebook/react-native/pull/34650), but this change makes a lot of modules to be eagerly initialized.

This reduces that to avoid loading modules that not necessary for environment setup, which allows us to do things like setting up feature flags before modules like `View` and `Text` have been initialized.

Reviewed By: rshest

Differential Revision: D79636159

fbshipit-source-id: a3f1e0db3dd69112ceef3ea339167694e2457454
2025-08-05 07:06:24 -07:00
Andrew DatsenkoandFacebook GitHub Bot dc322d91d2 Add ImageSource debug convertions (#53042)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53042

Changelog: [Internal]
Add debug convertions for ImageSource.

Reviewed By: rubennorte

Differential Revision: D79561513

fbshipit-source-id: f48d640d78b34a6e72d120f41f1f32ab963d1069
2025-08-05 07:05:54 -07:00
Andrew DatsenkoandFacebook GitHub Bot e9fdb23ed2 Test blurRadius (#53037)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53037

Changelog: [Internal]
Add `blurRadius` test.

Reviewed By: rshest

Differential Revision: D79552155

fbshipit-source-id: 710b2f328857a32ecb0db00c36f3eedabe74a249
2025-08-05 07:05:54 -07:00
Andrew DatsenkoandFacebook GitHub Bot d58601b59f Add base public API tests (#53040)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53040

Changelog: [Internal]

Add base public API integration tests for Image component.

Reviewed By: rubennorte

Differential Revision: D79551685

fbshipit-source-id: 467d3573102675f4ad1e3757894795b0ad9a8413
2025-08-05 07:05:54 -07:00
Rubén NorteandFacebook GitHub Bot b903ed7940 Add support for JS sampling profiler (#52827)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52827

Changelog: [internal]

This adds **support for creating Hermes/JS sampling profiler traces in Fantom**, which is especially useful when running benchmarks.

Usage:
```
FANTOM_PROFILE_JS=1 yarn fantom Animated-benchmark
```

Output:

 {F1980642216}

After this, the trace is fully symbolicated.

Can be opened directly in Google Chrome:
{F1980642229}

Or in the built-in viewer in VSCode:

 {F1980642242} {F1980642240} {F1980642241}

When collapsing frames in the Flame Chart viewer in VSCode, we can quickly identify opportunities for optimizations.

This also supports multi-config environments. In that case, trace file names are created using a short representation of the configuration.

User guide for benchmarks in Fantom, including how to use this, will be done in a future diff.

NOTE: This still doesn't work in OSS because we don't support optimized mode there. In dev mode, there's a segmentation fault coming from this line: `hermesRuntime->sampledTraceToStreamInDevToolsFormat(fileStream)`

Reviewed By: sammy-SC

Differential Revision: D78905646

fbshipit-source-id: 382ddd5034db601309bd118cedde2fe0d57fde98
2025-08-05 05:36:26 -07:00
Rubén NorteandFacebook GitHub Bot 064750daa8 Improve type safety of constants passed from runner to runtime (#53034)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53034

Changelog: [internal]

This is just a refactor to make sure that the constants we pass from the Fantom runner to its runtime are correct by using Flow to typecheck it.

Reviewed By: andrewdacenko

Differential Revision: D79565574

fbshipit-source-id: cbbab9cdec5ef5b3c82b929b8939c76c0ef41823
2025-08-05 05:36:26 -07:00
Nicola CortiandFacebook GitHub Bot 36bdd7b9cb Remove unused ReactSafeAreaViewShadowNode (#52985)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52985

This class is essentially a wrapper of LayoutShadowNode with no extra logic added.
Let's remove it.

Changelog:
[Internal] [Changed] -

Reviewed By: alanleedev

Differential Revision: D79450688

fbshipit-source-id: 943e10e602cb9a5b77fca81e11d2333828b27813
2025-08-05 05:16:57 -07:00
Nicola CortiandFacebook GitHub Bot d5d21d0614 Remove possibility to newArchEnabled=false in 0.82 (#53025)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53025

It's now time to say goodbye to the Legacy Architecture :')

This change hardcodes the `newArchEnabled` property to true, and warns the users
if they're attempting to set it to false.

Changelog:
[Android] [Breaking] - Remove possibility to newArchEnabled=false in 0.82

Reviewed By: cipolleschi

Differential Revision: D78560296

fbshipit-source-id: ccfc45d2f7f21cc20e063cb901d76be3d41458d6
2025-08-05 05:11:12 -07:00
Rubén NorteandFacebook GitHub Bot de5093c887 Add test for MemoryInfo (#53052)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53052

Changelog: [internal]

Adds a test for `performance.memory`.

Reviewed By: hoxyq

Differential Revision: D79633246

fbshipit-source-id: 8f9df0219de6c04c8be75af4c9d03576a8164ea9
2025-08-05 03:46:35 -07:00
Sam ZhouandFacebook GitHub Bot 6b354155ed Replace $FlowFixMe(Props|State|Empty) with just $FlowFixMe (#53002)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53002

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D79524515

fbshipit-source-id: 18b96538a62c7ae5912b1e89d2b50c1420c7eaf5
2025-08-04 11:43:00 -07:00
Rubén NorteandFacebook GitHub Bot 21bccda26c Remove PerformanceEntryReporter::getCurrentTimeStamp (#53030)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53030

Changelog: [internal]

Removes `PerformanceEntryReporter::getCurrentTimeStamp` in favor of `HighResTimeStamp::now`, to make the source of truth more explicit.

Reviewed By: hoxyq

Differential Revision: D79560370

fbshipit-source-id: 0ccf2bf511781d3c47c6ddb4dd7f2061aab152b5
2025-08-04 11:21:03 -07:00
Rubén NorteandFacebook GitHub Bot 7c1c833ee9 Remove redundant methods to mock timers from PerformanceEntryReporter and NativePerformance (#53028)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53028

Changelog: [internal]

Now that we have mocking at a more fundamental level (`HighResTimeStamp` API) we can replace other timing mocks with that one.

This does it for `PerformanceEntryReporter` and the `NativePerformance` module.

Reviewed By: hoxyq

Differential Revision: D79557640

fbshipit-source-id: 86579b8bb586190ab7cc8721f30e60b3ef789798
2025-08-04 11:21:03 -07:00
Rubén NorteandFacebook GitHub Bot 2658e21a62 Make test for LongTasks API deterministic and re-enable on Github (#53018)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53018

Changelog: [internal]

This makes the test for LongTasks API use the new API for mocking timers in Fantom to make it deterministic, and re-enables it on Github.

Reviewed By: rshest

Differential Revision: D79554724

fbshipit-source-id: 984c66ecd7c20eb972ba1e6b19944532acb82246
2025-08-04 11:21:03 -07:00
Rubén NorteandFacebook GitHub Bot f2e72c3859 Implement HighResTimeStamp mocking in Fantom (#53019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53019

Changelog: [internal]

This adds support for mocking `HighResTimeStamp` values in Fantom tests via a new `Fantom.installHighResTimeStampMock` function.

See new tests for more details on how it works.

Reviewed By: rshest

Differential Revision: D79554723

fbshipit-source-id: 8b0fb292948be118c7616fde1a8a84014af82de8
2025-08-04 11:21:03 -07:00
Rubén NorteandFacebook GitHub Bot f1cf4894ff Allow mocking HighResTimeStamp in debug builds (#53020)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53020

Changelog: [internal]

This adds a new feature to `HighResTimeStamp` to set a custom timestamp provider for "now" that can be useful for testing, only in debug builds to avoid potentially regressing performance.

Reviewed By: hoxyq, rshest

Differential Revision: D79554725

fbshipit-source-id: c325d05999b9e2d69f769b61f15c763446777a0a
2025-08-04 11:21:03 -07:00
Rubén NorteandFacebook GitHub Bot 8dc162a56a Small refactor of HighResTimeStamp (#53021)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53021

Changelog: [internal]

Moving the logic to set the default value for `HighResTimeStamp` to a shared function, to simplify further changes.

Reviewed By: rshest

Differential Revision: D79554726

fbshipit-source-id: cd0d4567ef63d386d28e0325203169323e97b207
2025-08-04 11:21:03 -07:00
Fabrizio CucciandFacebook GitHub Bot 893730633c Use buttonState to distinguish ACTION_DOWN and ACTION_HOVER_EXIT (#53033)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53033

This diff replaces the logic introduced in D72078450 to prevent `onPointerEnter`/`onPointerLeave` from firing when a button is pressed. The new approach trades off some complexity for reliability: instead of deferring `ACTION_HOVER_EXIT` handling to the next frame, we now suppress it immediately if any button is pressed (`buttonState != 0`). This simpler logic appears to work reliably on Quest devices, though it may behave differently on the Android emulator (something we’ll monitor).

The main reason for this change is that deferring ACTION_HOVER_EXIT introduces problems in newer Spatial React use cases, particularly when a single component hierarchy spans multiple roots. For example, when hovering between ReactSurfaceRoot and another root like VolumetricWindow, deferring ACTION_HOVER_EXIT can lead to incorrect enter/exit ordering:

* Cursor starts hovering over `ReactSurfaceRoot`
* Cursor moves to `VolumetricWindow`
* `ACTION_HOVER_EXIT` (`ReactSurfaceRoot`) — deferred
* `ACTION_HOVER_ENTER` (`VolumetricWindow`) — processed
* `ACTION_HOVER_EXIT` (`ReactSurfaceRoot`) — processed (too late)

This results in inconsistent hover state updates across roots, which this diff resolves by handling `ACTION_HOVER_EXIT` immediately when appropriate.

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D79504775

fbshipit-source-id: ea97bff48ddf4d3d09caf56ca29057c202b12409
2025-08-04 11:10:10 -07:00
Mateo GuzmánandFacebook GitHub Bot d547d9e56e Kotlin: redundant unit return type [1/2] (#52993)
Summary:
Fixing some warnings from static code analysis regarding [redundant unit return type](https://www.jetbrains.com/help/inspectopedia/RedundantUnitReturnType.html).

## Changelog:

[INTERNAL] - Kotlin: redundant unit return type [1/2]

Pull Request resolved: https://github.com/facebook/react-native/pull/52993

Test Plan:
```sh
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D79546007

Pulled By: rshest

fbshipit-source-id: 017cb3b70333fe652ecb1bdca751fa4f56f737fd
2025-08-04 11:04:51 -07:00
Alex HuntandFacebook GitHub Bot e39fd8f79c Fix mimeType parsing for CDP responses (#53027)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53027

Tweaks MIME type parsing in CDP Network messages, now matching Chrome.

This fixes response preview behaviour by the frontend for text response previews that are `base64Encoded` 🙌🏻 (we were observing these for JSON `fetch` calls on iOS).

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D79559495

fbshipit-source-id: 2565af7587fc6fbdd3ef6fcbb10c558341ddfbdc
2025-08-04 10:29:37 -07:00
Alex HuntandFacebook GitHub Bot fa66e314b2 Implement Network.loadingFailed (#53023)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53023

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D79555222

fbshipit-source-id: bfbe36edc867b1fc7a44d8e998489ef1d8896331
2025-08-04 10:04:02 -07:00
Alex HuntandFacebook GitHub Bot ea50245e1e Update InspectorNetworkReporter to avoid overhead for CDP-only methods (#53022)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53022

Following D77799617, D77927896, updates `InspectorNetworkReporter.kt` to check `isDebuggingEnabled` internally and avoid work/communication over the JNI layer — to minimise impact on the Android Network stack.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D78004462

fbshipit-source-id: 2bea2ee0592d68d1cb330ac82e8b3b227b54a675
2025-08-04 10:04:02 -07:00
Nolan O'BrienandFacebook GitHub Bot 323fe3a5d4 Fix exhaustive switches (#53032)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53032

## Changelog:

[General][Fixed] - Add default cases to switch statements in headers

Differential Revision: D79148595

fbshipit-source-id: e7260b5e9356b60b238b9f75ab1809fbbbbbeaf4
2025-08-04 09:42:15 -07:00
Samuel SuslaandFacebook GitHub Bot 0f912f8312 make ivars in NativeAnimatedNodesManager const (#53015)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53015

changelog: [internal]

marking a few fields as const to prevent accidental change.

Reviewed By: rshest

Differential Revision: D79443448

fbshipit-source-id: 32a44f7f0c43c240879c77058ef6672885488191
2025-08-04 08:57:06 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot d03151f561 Mitigate "Feature flags were accessed before being overridden" error (#53031)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53031

# Changelog:
[Internal] -

This partially reverts https://github.com/facebook/react-native/pull/52905, as in some configurations we don't appear to be able to use RN feature flags on the module level.

The usage is removed for now to unbreak the builds, with a follow up to resolve it in an adequate manner.

Reviewed By: hoxyq

Differential Revision: D79562056

fbshipit-source-id: 45bd896d572ff926a4c2dfa98334bf998718d86b
2025-08-04 08:47:18 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 75e04b8c41 Add documentation for updating the issue triage oncall
Summary:
This Diff simply adds some docs on how the secret must be formatted, and removes a print that would expose the triager IDs is anyone would look at the logs (not a big deal given that the ids are public on Discord, though).

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D79556988

fbshipit-source-id: 23d6e72141dff4e91242cc1d9f5b95ebaf5ca858
2025-08-04 08:28:48 -07:00
Peter AbbondanzoandFacebook GitHub Bot 1828c53f85 Emit scroll end events when fling animator completes (#52989)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52989

Adds a call to `NativeAnimatedModule`'s `userDrivenScrollEnded` method whenever a scroll event completes a smooth scroll animation. This is necessary in cases where Animated events control any layout properties of children and we need to force the shadow tree to resync with the native tree. For example, if a scroll view's child transforms its scale based on the scrollX or scrollY properties and the user triggers a `scrollToOffset` or `scrollToIndex` call, we don't update the layout of that child until the next state change.

Changelog: [Android][Fixed] - Fixed an issue where shadow tree and native tree layouts mismatch at the end of a scroll event

Reviewed By: sammy-SC

Differential Revision: D79464176

fbshipit-source-id: fee5f1c522714dbcddf8836de291c05d10e6e90e
2025-08-04 08:19:16 -07:00
Nicola CortiandFacebook GitHub Bot ea1aff455a Make ReactCxxErrorHandler internal (#53024)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53024

This class is Legacy Arch and is not used in OSS. Let's make it internal.

Changelog:
[Internal] [Changed] -

Reviewed By: RSNara

Differential Revision: D79556615

fbshipit-source-id: d157fe8f04784038d64657c6d240b0c51e41d82d
2025-08-04 07:51:30 -07:00
Ruslan LesiutinandFacebook GitHub Bot dd7ab0f833 forward fix tests after changes to PerformanceTracer (#53016)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53016

# Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D79554532

fbshipit-source-id: 83e68f714974083238f97e2ef1affa6dee3b116f
2025-08-04 06:34:45 -07:00
Ruslan LesiutinandFacebook GitHub Bot bfd6c6d8fc fix: removed constexpr from now() (#53014)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53014

# Changelog: [Internal]

This doesn't make sense, I've probably overlooked it while applying this to other methods.

Reviewed By: rubennorte

Differential Revision: D79552990

fbshipit-source-id: a7dc428dfcc86a08a9e52655f9878795b8e58c1c
2025-08-04 06:03:41 -07:00
Rubén NorteandFacebook GitHub Bot 2016118aeb Centralize path definitions for Fantom builds and move to .out (#52829)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52829

Changelog: [internal]

Just a small refactor to move the definitions of output paths to a specific module. We'll add more to this in a latter diff.

Reviewed By: sammy-SC

Differential Revision: D78905645

fbshipit-source-id: 011e6cec13396301dad8e76400b6f2b9e13568f0
2025-08-04 05:56:51 -07:00
Rubén NorteandFacebook GitHub Bot 6760383470 Create source maps for Fantom lazily (#52786)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52786

Changelog: [internal]

It takes around 300ms to generate each source map file, and we really only need them if tests throw errors. Requesting source maps also increases contention to access the Metro server from each test worker.

This refactors the code so we only generate them in that case, which could save up to 20s in test execution time.

Reviewed By: rshest

Differential Revision: D78807672

fbshipit-source-id: af9f0f0377ddcf05014b5aca0b28db938dfb4ce2
2025-08-04 05:56:51 -07:00
Rubén NorteandFacebook GitHub Bot 5c2b9eda69 Refactor runner to use a single instance of Metro for each run (#52777)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52777

Changelog: [internal]

This significantly speeds up test execution in Fantom (around 2x in OSS and 6x at Meta) by starting a Metro server before all tests runs and reusing it across all tests to build test bundles, instead of spinning up a new Metro instance every time we run each test.

The architecture change (also considering the previous change in buck prebuilds) looks like this:
{F1980689532}

This is how is impacts execution times (compared to the baseline):
* OSS
  * Before: 62s {F1980564286}
  * After: 30s (**2x faster**) {F1980564265}

Reviewed By: andrewdacenko

Differential Revision: D78741903

fbshipit-source-id: b209f88925e49cc2a2067e8df9b7fa9a29b4c8d2
2025-08-04 05:56:51 -07:00
Rubén NorteandFacebook GitHub Bot 3ecd48fa91 Refactor Fantom runner to decouple compilation from execution to speed up test execution (#52758)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52758

Changelog: [internal]

This is a change to how Fantom tests run in Meta infra via Buck.

After this, the biggest opportunity will be optimizing how we generate bundles with Metro.

Reviewed By: christophpurrer

Differential Revision: D78672863

fbshipit-source-id: 1152907f3ba60e7d2e48bcc588f3c07aef7bb393
2025-08-04 05:56:51 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot f047c9b42b Remove props that set by default for Text component on JS side (#52905)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52905

Similarly to [this PR](https://github.com/facebook/react-native/pull/51225), we do it for the Text component now: we don't set any non-default value props (most prominently, the accessibility ones) before passing this to native.

This saves bandwidth and potentially improves the prop parsing time, which existing Fantom benchmarks do confirm.

This is implemented behind a feature flag, which is false by default (will use it to run an experiment before rolling out).

**NOTE:** This implementation forks the whole text component, as suggested by rubennorte, in order to isolate the changes and with the ultimate goal of removing the old version once the experiment is concluded.

## Changelog:
[Internal] - Text no longer sets any default accessibility props, which should not result in visible changes in behaviour but may affect snapshot tests.

Reviewed By: rubennorte

Differential Revision: D79177652

fbshipit-source-id: a39430464fd5edec953b4c91be7ef9620ebd75ac
2025-08-04 05:29:19 -07:00
Nicola CortiandFacebook GitHub Bot c37f3ed8c6 Remove unnecessary ReactNoCrashBridgeNotAllowedSoftException (#52987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52987

This class is unnecessary. Is also public for no real reason.
Instead we should use `ReactNoCrashSoftException` directly.

I'm not marking this as breaking as users hsould not be catching this class.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D79451567

fbshipit-source-id: 4d6f45b3006c79969fcf141002d34a72bf88901a
2025-08-04 04:50:59 -07:00
lukmccallandFacebook GitHub Bot 2f46a49b8d Fix ReactHostImpl.nativeModules always returning an empty list (#52986)
Summary:
During the Expo QA process, we discovered that `ReactContext.reactApplicationContext.nativeModules` always returns an empty list (https://github.com/expo/expo/blob/4e2bbb23edda74d0e24756fd1735b8763e38f7a7/packages/expo-modules-core/android/src/main/java/expo/modules/kotlin/ReactExtensions.kt#L12). This happens because, during object creation, the `reactInstance` is always null.

## Changelog:

[ANDROID] [FIXED] - Fix `ReactHostImpl.nativeModules` always returning an empty list

Pull Request resolved: https://github.com/facebook/react-native/pull/52986

Test Plan: - RN tester compiles 

Reviewed By: mdvacca

Differential Revision: D79451613

Pulled By: cortinico

fbshipit-source-id: d5341bcc1193eb948db4e99f16ba32a63073a6db
2025-08-04 04:46:56 -07:00
Mateo GuzmánandFacebook GitHub Bot f273c63d37 Kotlin: obvious explicit type (#52990)
Summary:
Fixing some warnings from static code analysis regarding [obvious explicit type](https://www.jetbrains.com/help/inspectopedia/RedundantExplicitType.html#locating-this-inspection).

## Changelog:

[INTERNAL] - Kotlin: obvious explicit type

Pull Request resolved: https://github.com/facebook/react-native/pull/52990

Test Plan:
```sh
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D79546014

Pulled By: rshest

fbshipit-source-id: 1b66edde3185911b137e2c77673779cc613fae74
2025-08-04 04:28:50 -07:00
Rubén NorteandFacebook GitHub Bot b708d2da61 Disable LongTasksAPI on Github CI (#53009)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53009

Changelog: [internal]

This disables the test for LongTasks API on Github CI as the execution speed there is unreliable and makes the current tests flaky.

This happens because the test is timing dependent, but the alternative would be to mock some core behaviors that I think might be even worse.

Reviewed By: cortinico

Differential Revision: D79510480

fbshipit-source-id: 277e42e36aa6dfebf4745d094541a667f58a0996
2025-08-04 03:54:58 -07:00
Rubén NorteandFacebook GitHub Bot 4289cff268 Add isOSS to Fantom constants (#53010)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53010

Changelog: [internal]

Exposing this value so we can disable some tests in some scenarios in a following this.

Reviewed By: cipolleschi

Differential Revision: D79510481

fbshipit-source-id: 632d9a008943ed40c24878b5561065b6ede1d689
2025-08-04 03:54:58 -07:00
Nicola CortiandFacebook GitHub Bot 691d4744b3 Mark NotThreadSafeBridgeIdleDebugListener as LegacyArchitecture (#52988)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52988

This class should be marked as `LegacyArchitecture` while it was not.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D79451041

fbshipit-source-id: 62c5d35821e354ea851eaccac909bf6bd9157f09
2025-08-04 03:51:08 -07:00
Alex HuntandFacebook GitHub Bot bbcafbbffe Pin Node.js version in GitHub Actions to 24.4.1 (#53013)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53013

Quick fix to restore CI on `main`. `actions/setup-node` is now pulling Node.js `24.5.0`, which introduces a bug affecting `packages/dev-middleware/src/__tests__/` Jest tests.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D79551277

fbshipit-source-id: 51951ad8ffe376a478da268b50aa54ac2d9bba03
2025-08-04 03:33:14 -07:00
Rubén NorteandFacebook GitHub Bot c535e7c1c9 Make TextInput test follow convention and add tests for all methods (#53011)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53011

Changelog: [internal]

This restructures the test for `TextInput` to follow the convention:

```
describe('<TextInput>', () => {
  describe('props', () => {
    /* ... */
  });

  describe('ref', () => {
    /* ... */
  });
});
```

It also adds tests for all methods.

Reviewed By: sammy-SC

Differential Revision: D79511032

fbshipit-source-id: 118198bdb1a86c2a9e0f41ff0b81bcd62b535d9f
2025-08-04 03:17:11 -07:00
Nicola CortiandFacebook GitHub Bot 742ef3d661 AGP to 8.12.0 (#52973)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52973

This bumps AGP to the latest stable version.

Changelog:
[Android] [Changed] - AGP to 8.12.0

Reviewed By: rshest

Differential Revision: D79436778

fbshipit-source-id: 3071c0108af064573c087aaf7b92d0b10c1adc6a
2025-08-04 02:55:55 -07:00
Nicola CortiandFacebook GitHub Bot d42335007b Update debugger_bug_report.yml (#52981)
Summary:
This label was renamed at some point and it broke the issue template. This fixes it.

## Changelog:

[INTERNAL] -

Pull Request resolved: https://github.com/facebook/react-native/pull/52981

Test Plan: N/A

Reviewed By: mdvacca

Differential Revision: D79448155

Pulled By: cortinico

fbshipit-source-id: 2312fc5a0a82a65ca908af58dc74348141c16ca2
2025-08-04 02:30:24 -07:00
Peter AbbondanzoandFacebook GitHub Bot 87749470cc Ensure active touches are swept before accepting a child native gesture (#52995)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52995

Fabric retains views by ID when `JSTouchDispatcher` receives a touch event, but does not sweep these same views if a child native gesture is started between the `ACTION_DOWN` and `ACTION_UP` actions of the touch. As a result, we never end up calling into that view's manager's `onDropViewInstance` method and can't perform reliable teardown of the view since it's stuck in this "touched" state.

This is change adds a new condition to check if `JSTouchDispatcher` should sweep active touches when a child native gesture is started, and only applies the check to `ReactSurfaceView` to start. The check is also only enabled if the `sweepActiveTouchOnChildNativeGesturesAndroid` flag is set.

Changelog: [Internal]

Reviewed By: jehartzog

Differential Revision: D79230277

fbshipit-source-id: c15b888ec932319f1bda05b8ef5eec39e5d08710
2025-08-03 18:04:43 -07:00
Peter AbbondanzoandFacebook GitHub Bot f2964e17cd Add feature flag to perform gesture sweep in JSTouchDispatcher (#52972)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52972

Fabric retains views by ID when `JSTouchDispatcher` receives a touch event, but does not sweep these same views if a child native gesture is started between the `ACTION_DOWN` and `ACTION_UP` actions of the touch. As a result, we never end up calling into that view's manager's `onDropViewInstance` method and can't perform reliable teardown of the view since it's stuck in this "touched" state.

This is the first of a few changes to add a new feature flag `sweepActiveTouchOnChildNativeGesturesAndroid` to allow the `JSTouchDispatcher` to sweep active touches when a child native gesture is started. Running experiments internally to confirm that there are no unintended side effects from flushing the active touch.

Changelog: [Internal]

Reviewed By: jehartzog

Differential Revision: D79257465

fbshipit-source-id: 1ca79e77b21d8086c4df6753b16b1d8d922cd8d5
2025-08-03 18:04:43 -07:00
Sam ZhouandFacebook GitHub Bot 1b62d55ffb Unbreak react-native CI (#52997)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52997

Quick followup of D79481936

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D79495826

fbshipit-source-id: e133cf31800455eb4f4968d6995525fa8a843a77
2025-08-01 22:31:37 -07:00
Sam ZhouandFacebook GitHub Bot 16fa3d5da4 Update prettier-plugin-hermes-parser in fbsource to 0.31.1 (#52996)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52996

Bump prettier-plugin-hermes-parser to 0.31.1.

Changelog: [internal]

Reviewed By: pieterv

Differential Revision: D79481936

fbshipit-source-id: 4decd5c92722f935a6a03b6d2205bc31b864fb5d
2025-08-01 20:18:36 -07:00
Pieter VanderwerffandFacebook GitHub Bot 4c7d7a903e Deploy 0.278.0 to xplat (#52994)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52994

[changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D79463433

fbshipit-source-id: c6f24199c7899dd618e807b2cd65b0b3673c92ce
2025-08-01 16:51:38 -07:00
Samuel SuslaandFacebook GitHub Bot 597fe66a75 avoid excessive logs in C++ Animated (#52992)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52992

changelog: [internal]

do not log on every frame to make logs more readable. The callbacks are only set during construction and there is no value in logging on every commit props.

Reviewed By: rshest

Differential Revision: D79436988

fbshipit-source-id: 26c6cbadd5ae0efa8575c7f85e4c0d90e2ef6215
2025-08-01 16:07:33 -07:00
Ramanpreet NaraandFacebook GitHub Bot 9c8a4c2297 core: Remove legacy components (#52118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52118

This diff aims to remove all legacy components from react native core.

Reviewed By: mdvacca

Differential Revision: D72733503

fbshipit-source-id: 3ed28c252c79b5a1ead794d758d1cf5bc265f265
2025-08-01 15:43:55 -07:00
Rubén NorteandFacebook GitHub Bot c5fb371061 Add test for View refs (#52982)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52982

Changelog: [internal]

Just adding a few tests for `View` refs, to show as an example of what a test for a public component should have.

Reviewed By: rshest

Differential Revision: D79447449

fbshipit-source-id: 75b9dbb45824d927bcf63472da25c7c5a52c7eb6
2025-08-01 10:33:01 -07:00
Rubén NorteandFacebook GitHub Bot 68e5a24ef7 Restructure Fantom test for View to follow convention (#52983)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52983

Changelog: [internal]

Just moving some tests that were defined under `<View>` that were related to styles, to under `<View> > props > style`.

Reviewed By: rshest

Differential Revision: D79447450

fbshipit-source-id: e97cc4e058ffc8170b7fa74176cc8dc27e26cfde
2025-08-01 10:33:01 -07:00
Rubén NorteandFacebook GitHub Bot c28a601d80 Add tests for refs in Text (#52980)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52980

Changelog: [internal]

Adds Fantom tests for the behavior of `refs` in `Text` components.

Reviewed By: rshest

Differential Revision: D79436148

fbshipit-source-id: 6d357740303f4868d176af7b4559891af77b79f8
2025-08-01 10:33:01 -07:00
Artem KholodnyiandFacebook GitHub Bot e8c6a5397b Fix react-native build
Summary:
bypass-github-export-checks

Changelog: [internal]

Reviewed By: Abbondanzo

Differential Revision: D79441010

fbshipit-source-id: 249912a6cf3350b98af6cf910151fc5a95edce2d
2025-08-01 10:17:47 -07:00
Samuel SuslaandFacebook GitHub Bot 310bd4e5bb Back out "move C++ Animated to ReactCommon" (#52984)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52984

changelog: [internal]

breaks Github CI, let's back it out for now.

Original commit changeset: 141f0ce7b993

Original Phabricator Diff: D79184118

Reviewed By: rubennorte

Differential Revision: D79444246

fbshipit-source-id: 8aa35ed450804c77389601a4ea820b1dd552ad98
2025-08-01 10:10:10 -07:00
Rubén NorteandFacebook GitHub Bot f497259901 Remove flakiness in LongTasksAPI test (#52974)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52974

Changelog: [internal]

The test for LongTasks is flaky on Github and I made a change to figure out why (D79366370 / https://github.com/facebook/react-native/pull/52948). It seems that the long task happens before the artificial task we're using for testing, so we can update the test to filter those out.

Reviewed By: cortinico

Differential Revision: D79441987

fbshipit-source-id: 99296d704cfec2e61ca29d06878df171231f4e78
2025-08-01 07:54:28 -07:00
Sam ZhouandFacebook GitHub Bot c43a39925f Replace $FlowIssue with $FlowFixMe (#52976)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52976

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D79400163

fbshipit-source-id: b0c4f10b18b99550bdf95be620187f011b62f2f7
2025-08-01 07:50:00 -07:00
generatedunixname537391475639613andFacebook GitHub Bot e1f6a19d38 xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp (#52956)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52956

Reviewed By: rshest

Differential Revision: D79335606

fbshipit-source-id: c6aca07f135aab62e0dbda352d4bdc4e81bdc59e
2025-08-01 06:13:34 -07:00
Artem KholodnyiandFacebook GitHub Bot f70c39d836 Fix obfuscated scale type names (#52958)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52958

Changelog: [Internal]

Reviewed By: kartavya-ramnani, oprisnik, rshest

Differential Revision: D79354202

fbshipit-source-id: d4e84749324ff75a283c940631ac1199694bc92e
2025-08-01 06:07:14 -07:00
Samuel SuslaandFacebook GitHub Bot 8c305a0b64 move C++ Animated to ReactCommon (#52944)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52944

changelog: [internal]

this should be in ReactCommon, not in cxx platform as it is not platform specific.

Reviewed By: rubennorte, christophpurrer

Differential Revision: D79184118

fbshipit-source-id: 141f0ce7b993d229c5d832d22c54471d32681173
2025-08-01 04:56:48 -07:00
Mateo GuzmánandFacebook GitHub Bot 77be1a3dc4 Kotlin: accessor call can be replaced with property access syntax (#52950)
Summary:
Fixing a few warnings from static code analysis regarding the [accessor call can be replaced with property access](https://www.jetbrains.com/help/inspectopedia/UsePropertyAccessSyntax.html) rule

## Changelog:

[INTERNAL] - Kotlin: accessor call can be replaced with property access syntax

Pull Request resolved: https://github.com/facebook/react-native/pull/52950

Test Plan:
```sh
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D79431292

Pulled By: rshest

fbshipit-source-id: 09ad40c09512def9ab33eaeb70da057f742ae4a1
2025-08-01 04:33:29 -07:00
Zeya PengandFacebook GitHub Bot 504cf3e933 cleanup TODOs in fantom tests around cxxNativeAnimatedRemoveJsSync (#52949)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52949

## Changelog:

[Internal] [Changed] - cleanup TODOs in fantom tests around cxxNativeAnimatedRemoveJsSync

Previous attempt to remove js sync so far is working expectedly since https://github.com/facebook/react-native/pull/52904 / D79080739

Reviewed By: sammy-SC

Differential Revision: D79373130

fbshipit-source-id: e310b9250ba5da2e55435468f46b75977e46f111
2025-07-31 15:20:54 -07:00
Rubén NorteandFacebook GitHub Bot 707a8631ca Implement maxDuration option for PerformanceTracer (#52935)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52935

Changelog: [internal]

This implements a new option for `PerformanceTracer::startTracing` to specify a maximum duration for the recording, keeping only the last record events.

This will allow us to implement an "always-on" profiling mode for RN with a low overhead. In the future, we can extend this with a `maxBufferSize` option.

See the comment in `PerformanceTracer.cpp` for implementation details.

Reviewed By: hoxyq

Differential Revision: D79340014

fbshipit-source-id: 3260724a775a574fe5e52d47358a3a5abd0d2ee7
2025-07-31 14:29:24 -07:00
Rubén NorteandFacebook GitHub Bot 30e2b35d2d Extract logic to enqueue trace event to its own method (#52938)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52938

Changelog: [internal]

Minor refactor to simplify changing the logic for how events are buffered.

Reviewed By: hoxyq

Differential Revision: D79340013

fbshipit-source-id: efd295b1583929580fbe7441ec7eb06e828ca514
2025-07-31 14:29:24 -07:00
Rubén NorteandFacebook GitHub Bot 00debea508 Log synthetic events for trace start/end when the trace finishes (#52937)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52937

Changelog: [internal]

Minor refactor to log the synthetic events for trace start when the trace finishes. This is to simplify future work to implement a sliding window for trace events.

Reviewed By: hoxyq

Differential Revision: D79271692

fbshipit-source-id: 9e923ac36fff850a3aeede7304fb2d721bb9f16c
2025-07-31 14:29:24 -07:00
Rubén NorteandFacebook GitHub Bot 9f6440d8c8 Simplify PerformanceTracer API and move processing to TracingAgent (#52934)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52934

Changelog: [internal]

Right now, the `PerformanceTracer` API has a method to stop the trace and a separate one to collect serialized events. This refactors the API to return the collected events when calling `stopTracing` instead.

The caller (in this case `TracingAgent`) is responsible for serializing and sending the events in chunks through CDP.

Reviewed By: hoxyq

Differential Revision: D79271690

fbshipit-source-id: bdb48c80be4fd07d96e381e6bb4d099cae91f8de
2025-07-31 14:29:24 -07:00
Rubén NorteandFacebook GitHub Bot f7185715df Remove unnecessary collectEvents method from PerformanceTracer (#52936)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52936

Changelog: [internal]

This method is unused and we're no longer planning to use it.

Reviewed By: hoxyq

Differential Revision: D79271691

fbshipit-source-id: 1a0be464928a199cfe4a57cb5c44255b127264c2
2025-07-31 14:29:24 -07:00
Rubén NorteandFacebook GitHub Bot 384fc5447d Make observer go through Fanton.runTask in LongTasksAPI test (#52948)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52948

Changelog: [internal]

Not sure why this test is flaky, but this tries to add some more assertions to see where the problem comes from.

Reviewed By: hoxyq

Differential Revision: D79366370

fbshipit-source-id: d66b30e502dbc80d3e972ed93a91bb7f703de9c4
2025-07-31 11:28:57 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 9d6d8a6e65 Add Text benchmark clause for elements without props (#52942)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52942

# Changelog:
[Internal] -

Adds another test clause to the Text benchmark test, to test the case when the component doesn't have any props altogether, which can be useful to establish a baseline.

Reviewed By: rubennorte

Differential Revision: D79352849

fbshipit-source-id: fbfeb53d3ede59631548eb2fe76a4debd5927900
2025-07-31 10:50:31 -07:00
Wandji Emmanuel juniorandFacebook GitHub Bot 626568f9a3 fix(android): Stabilize custom accessibility action IDs for TalkBack (#52724)
Summary:
This pull request resolves a critical accessibility bug on Android where custom `accessibilityActions` fail to execute when activated via TalkBack's swipe gestures.

**The Problem:**
- When a user focuses a component with custom `accessibilityActions` (like a `TouchableOpacity`), TalkBack correctly announces the action labels as the user swipes up or down.
- However, when the user double-taps to activate the selected action, TalkBack reports an "incompatible action," and the `onAccessibilityAction` event is never triggered.

**The Root Cause:**
The investigation revealed that the `ReactAccessibilityDelegate` was generating **new, unstable IDs** for custom actions on every UI update. This instability prevents the Android accessibility service from reliably tracking and invoking the selected action.

**The Solution:**
This change introduces a static, thread-safe cache (`ConcurrentHashMap`) within `ReactAccessibilityDelegate`. This ensures that each unique action name is mapped to a single, stable ID for the entire lifecycle of the application. This provides the consistency required by TalkBack to function correctly.

This addresses the issue described in https://github.com/facebook/react-native/issues/47268.

 ---

## Changelog:

[Android] [Fixed] - Stabilize custom accessibility action IDs to prevent "incompatible action" errors in TalkBack.
 ---

Pull Request resolved: https://github.com/facebook/react-native/pull/52724

Test Plan:
The fix was validated extensively using the RNTester app on a physical Android device and an Android emulator.

### Steps to Reproduce (Before Fix)

1.  Enable TalkBack on an Android device.
2.  Navigate to a `TouchableOpacity` component with several custom `accessibilityActions`.
3.  Swipe up or down to cycle through the actions. TalkBack correctly announces them (e.g., "add to cart").
4.  Double-tap to execute the selected action.
5.  **Result (Bug):** TalkBack announces *"incompatible action"*, and the `onAccessibilityAction` event is not triggered.

### Validation Steps (After Fix)

1.  Follow the same steps as above on the patched version.
2.  **Result (Fixed):** After double-tapping, the `onAccessibilityAction` event is **correctly triggered** with the appropriate action name. The "incompatible action" issue is fully resolved.

*A screen recording demonstrating the successful fix can be provided if needed.*

Uploading fixed bugs view problems (1).mp4…

Fixes https://github.com/facebook/react-native/issues/47268

Reviewed By: jorge-cab

Differential Revision: D78737471

Pulled By: cipolleschi

fbshipit-source-id: 877b196597472ac6a4f6df81a05a43956fb34629
2025-07-31 10:28:28 -07:00
Ruslan LesiutinandFacebook GitHub Bot 2c540ac35a Add a method for transfering an ownership of captured TraceEvents (#52940)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52940

# Changelog: [Internal]

This is required for storing these Trace Events somewhere outside of PerformanceTracer, in case these events will be dispatched later.

Reviewed By: rubennorte

Differential Revision: D78741192

fbshipit-source-id: 3cc2eacd922855231fafb93c32d326b150b3c19b
2025-07-31 07:43:31 -07:00
Ruslan LesiutinandFacebook GitHub Bot b58c2ffd72 refactor RuntimeSamplingProfile serializer (#52916)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52916

# Changelog: [Internal]

Align with other serializers in `jsinspector-modern` to have just static public method.

Reviewed By: rubennorte

Differential Revision: D79131985

fbshipit-source-id: 3f1f08641bb96a9fbd067992b8ce294af9d27688
2025-07-31 07:43:31 -07:00
Ruslan LesiutinandFacebook GitHub Bot a8f6c96bc2 Static generators for Profile Trace Events (#52915)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52915

# Changelog: [Internal]

This removes the use of `PerformanceTracer` instance in a serialization logic.

Reviewed By: rubennorte

Differential Revision: D78919220

fbshipit-source-id: 5c663ea77eb36eb7664623c1595308a9450f7825
2025-07-31 07:43:31 -07:00
Ruslan LesiutinandFacebook GitHub Bot 3ed6def874 Create aliases for ProcessId, ThreadId, RuntimeProfileId (#52917)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52917

# Changelog: [Internal]

Just an aliases for referencing these ids, instead of raw uint64_t.

Reviewed By: rubennorte

Differential Revision: D78741191

fbshipit-source-id: 1ee403ff19ed95361366c76c1fb52e70ec67f16e
2025-07-31 07:43:31 -07:00
Ruslan LesiutinandFacebook GitHub Bot f1e5c84ea7 Remove methods for capturing Processes and Threads (#52914)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52914

# Changelog: [Internal]

We can't rely on RuntimeExecutor to actually tell us what JavaScript thread number is. Although this would work correct in most of the cases, this is not the solution we should go with.

Instead, we should fetch a map <id, name> of threads from the Host. This is what we will lazily call at the start of the Trace. I will add later on top of the stack.

Reviewed By: rubennorte

Differential Revision: D78990872

fbshipit-source-id: e41ebd35273c6741ebbc3fe3b851018c9f3275dc
2025-07-31 07:43:31 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 5f3eccb04f Fix CQS signal readability-redundant-control-flow in xplat/js/react-native-github/packages (#52931)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52931

Reviewed By: dtolnay

Differential Revision: D79327593

fbshipit-source-id: 39e2b3e54f156199fc12b9633ffafeeef8343caa
2025-07-31 05:29:11 -07:00
Devan BuggayandFacebook GitHub Bot 15373218ec Add granular control with pragma modes (#52894)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52894

Adds the following boolean pragma modes for more granular control:

```
fantom_native_opt true|false
fantom_js_opt true|false
fantom_js_bytecode true|false
```

Previously these were all set together with `fantom_mode`. These modes are mutually exclusive with `fantom_mode`.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D79151687

fbshipit-source-id: 59c3f20bccb570c0293ffd037609946a1a9bbb8f
2025-07-30 14:22:22 -07:00
Devan BuggayandFacebook GitHub Bot 6d51bce9ed Refactor native/js modes (#52822)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52822

Refactors underlying modes by adding `isNativeOpt`, `isJsOpt`, and `isJsBytecode` to allow for more granular control in a future diff.

### View ###

| (index) | Task name                                                 | Latency average (ns)   | Latency median (ns)       | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | ---------------------- | ------------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'render 100 uncollapsable views'                          | '23005778.16 ± 0.53%'  | '22877194.50 ± 11607.50'  | '43 ± 0.50%'               | '44'                      | 64      |
| 1       | 'render 1000 uncollapsable views'                         | '271276451.70 ± 0.61%' | '268378201.00 ± 9925.00'  | '4 ± 0.59%'                | '4'                       | 64      |
| 2       | 'render 100 views with large amount of props and styles'  | '47580650.91 ± 1.21%'  | '47212012.00 ± 2979.00'   | '21 ± 0.89%'               | '21'                      | 64      |
| 3       | 'render 1000 views with large amount of props and styles' | '521237370.22 ± 1.09%' | '516142815.00 ± 41682.00' | '2 ± 0.84%'                | '2'                       | 64      |
| 4       | 'render 1500 views with large amount of props and styles' | '828143691.48 ± 0.94%' | '824723257.50 ± 11331.50' | '1 ± 0.73%'                | '1'                       | 64      |

### View (mode 🚀, jsMode 🚀, bytecode) ###

| (index) | Task name                                                 | Latency average (ns)   | Latency median (ns)        | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | ---------------------- | -------------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'render 100 uncollapsable views'                          | '4051033.45 ± 2.01%'   | '3876618.00'               | '251 ± 1.29%'              | '258'                     | 247     |
| 1       | 'render 1000 uncollapsable views'                         | '86134420.23 ± 1.38%'  | '85815369.50 ± 281477.50'  | '12 ± 1.38%'               | '12'                      | 64      |
| 2       | 'render 100 views with large amount of props and styles'  | '13921817.92 ± 2.57%'  | '13474963.50 ± 4977.50'    | '72 ± 1.62%'               | '74'                      | 72      |
| 3       | 'render 1000 views with large amount of props and styles' | '182664526.31 ± 0.74%' | '181872565.00 ± 10281.00'  | '5 ± 0.73%'                | '5'                       | 64      |
| 4       | 'render 1500 views with large amount of props and styles' | '313110386.45 ± 1.13%' | '307934163.50 ± 156920.50' | '3 ± 1.07%'                | '3'                       | 64      |

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D78912257

fbshipit-source-id: 16fd0301af98159dbb9818cb8092bd4416ef2559
2025-07-30 14:22:22 -07:00
Devan BuggayandFacebook GitHub Bot 807f0b6882 Isolate NativeDevSettings load (#52821)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52821

Hardens RN to running in mismatched opt/dev modes.

While adding an opt native/dev js mode to fantom, LogBox was trying to load NativeDevSettings when it didn't exist because of mode mismatch.

This is the only location it's happening, so this just moves the NativeDevSettings load into the one function that needs it.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D78952284

fbshipit-source-id: e68667cb28fae7cb6f985305e8885f271ef5d3af
2025-07-30 14:22:22 -07:00
Alex HuntandFacebook GitHub Bot 364e71b159 Fix CMake dependency error (#52923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52923

Follow-up to D78904748, where CI was broken on `main` for the `run_fantom_tests` job. It turns out this Android build uniquely included the new `react_performance_cdpmetrics` dependency, and this had an incorrect dep.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D79263124

fbshipit-source-id: 3e38e0cebe53520ea50e6d11a571e01c52e34874
2025-07-30 10:30:08 -07:00
Zeya PengandFacebook GitHub Bot 5b38bb4745 Avoid unnecessary copy of view props map in UIManager::updateShadowTree (#52908)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52908

## Changelog:

[General] [Changed] - Avoid unnecessary copy of view props map in UIManager::updateShadowTree

Reviewed By: christophpurrer

Differential Revision: D79193215

fbshipit-source-id: 6a55dc2bf3bcf95eebeeddf2d747fe11ae56bf78
2025-07-30 08:58:11 -07:00
Alex HuntandFacebook GitHub Bot 2dd72f956b Align InteractionEntry payload to match Chrome (#52840)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52840

**Context**

Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.

**This diff**

Completes populating a full `InteractionEntry` Live Event payload by implementing remaining fields sufficient to be rendered by Chrome DevTools.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D78904747

fbshipit-source-id: 7473602f6f1efe3ac71e07a2b88e6ad7020dcbbf
2025-07-30 07:13:58 -07:00
Alex HuntandFacebook GitHub Bot a3bf989450 Implement reporting InteractionEntry live metrics to runtime (#52839)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52839

**Context**

Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.

**This diff**

Adds and configures a `CdpMetricsReporter` class to report `InteractionEntry` live metrics over CDP via the `"__chromium_devtools_metrics_reporter"` runtime binding.

**Notes**

- Introduces a new `react/performance/cdpmetrics` package, and a listener API on `PerformanceEntryReporter` (both to avoid a `jni` dependency in `react/performance/timeline`).

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D78904748

fbshipit-source-id: c75971aba43d9929912b3d1dba7576c2a2342214
2025-07-30 07:13:58 -07:00
Samuel SuslaandFacebook GitHub Bot f711d1776c Micro-optimise JavaScript part of Animated (#52906)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52906

changelog: [internal]

Micro-optimise JavaScript part of Animated by avoiding JS syntax for private variable/method - #foo. Instead, use double underscores. Benchmarks indicate ~10% improvement.

# Before
### Animated (mode 🚀) ###

| (index) | Task name                                                                    | Latency average (ns)  | Latency median (ns)      | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | ---------------------------------------------------------------------------- | --------------------- | ------------------------ | -------------------------- | ------------------------- | ------- |
| 0       | 'render 1 views'                                                             | '84990.06 ± 1.49%'    | '80691.00'               | '12164 ± 0.14%'            | '12393'                   | 11767   |
| 1       | 'render 10 views'                                                            | '373372.50 ± 1.00%'   | '363786.00'              | '2727 ± 0.26%'             | '2749'                    | 2679    |
| 2       | 'render 100 views'                                                           | '3099588.37 ± 0.92%'  | '3017559.00'             | '324 ± 0.74%'              | '331'                     | 323     |
| 3       | 'render 1 animated views (without animations set up)'                        | '174636.87 ± 0.67%'   | '168783.00'              | '5808 ± 0.17%'             | '5925'                    | 5727    |
| 4       | 'render 10 animated views (without animations set up)'                       | '1054481.51 ± 0.61%'  | '1036686.00'             | '953 ± 0.37%'              | '965'                     | 949     |
| 5       | 'render 100 animated views (without animations set up)'                      | '9176283.60 ± 1.12%'  | '8932316.00'             | '109 ± 0.95%'              | '112'                     | 109     |
| 6       | 'render 1 animated views (with a single animation set up - JS driven)'       | '204383.77 ± 0.52%'   | '199109.00'              | '4943 ± 0.17%'             | '5022'                    | 4893    |
| 7       | 'render 10 animated views (with a single animation set up - JS driven)'      | '1315894.97 ± 0.36%'  | '1300562.00 ± 40.00'     | '762 ± 0.30%'              | '769'                     | 760     |
| 8       | 'render 100 animated views (with a single animation set up - JS driven)'     | '11924031.45 ± 1.36%' | '11753334.50 ± 30040.50' | '84 ± 1.18%'               | '85'                      | 84      |
| 9       | 'render 1 animated views (with a single animation set up - native driven)'   | '318103.70 ± 0.37%'   | '311657.50 ± 0.50'       | '3162 ± 0.20%'             | '3209'                    | 3144    |
| 10      | 'render 10 animated views (with a single animation set up - native driven)'  | '2230305.96 ± 0.51%'  | '2191890.00'             | '449 ± 0.41%'              | '456'                     | 449     |
| 11      | 'render 100 animated views (with a single animation set up - native driven)' | '21983695.16 ± 0.75%' | '21945687.00 ± 17186.00' | '46 ± 0.74%'               | '46'                      | 64      |

# After

### Animated (mode 🚀) ###

| (index) | Task name                                                                    | Latency average (ns)  | Latency median (ns)     | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | ---------------------------------------------------------------------------- | --------------------- | ----------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'render 1 views'                                                             | '82684.75 ± 1.11%'    | '80231.00'              | '12331 ± 0.08%'            | '12464'                   | 12095   |
| 1       | 'render 10 views'                                                            | '378798.65 ± 1.16%'   | '365378.50 ± 9.50'      | '2703 ± 0.31%'             | '2737'                    | 2640    |
| 2       | 'render 100 views'                                                           | '3124253.51 ± 0.95%'  | '3039842.00'            | '322 ± 0.76%'              | '329'                     | 321     |
| 3       | 'render 1 animated views (without animations set up)'                        | '165580.70 ± 0.73%'   | '161562.00'             | '6131 ± 0.14%'             | '6190'                    | 6040    |
| 4       | 'render 10 animated views (without animations set up)'                       | '979127.10 ± 0.60%'   | '962509.50 ± 5.50'      | '1027 ± 0.36%'             | '1039'                    | 1022    |
| 5       | 'render 100 animated views (without animations set up)'                      | '8487740.98 ± 1.32%'  | '8235139.50 ± 3244.50'  | '118 ± 1.05%'              | '121'                     | 118     |
| 6       | 'render 1 animated views (with a single animation set up - JS driven)'       | '185333.93 ± 0.52%'   | '181582.00'             | '5451 ± 0.15%'             | '5507'                    | 5396    |
| 7       | 'render 10 animated views (with a single animation set up - JS driven)'      | '1145679.81 ± 0.37%'  | '1131668.00'            | '875 ± 0.29%'              | '884'                     | 873     |
| 8       | 'render 100 animated views (with a single animation set up - JS driven)'     | '10451056.69 ± 1.60%' | '10064069.50 ± 826.50'  | '96 ± 1.39%'               | '99'                      | 96      |
| 9       | 'render 1 animated views (with a single animation set up - native driven)'   | '292243.89 ± 0.40%'   | '286740.00'             | '3447 ± 0.21%'             | '3487'                    | 3422    |
| 10      | 'render 10 animated views (with a single animation set up - native driven)'  | '1993053.78 ± 0.47%'  | '1958960.00 ± 20.00'    | '503 ± 0.39%'              | '510'                     | 502     |
| 11      | 'render 100 animated views (with a single animation set up - native driven)' | '19528221.48 ± 0.95%' | '19383511.00 ± 7431.00' | '51 ± 0.92%'               | '52'                      | 64      |

Reviewed By: rubennorte

Differential Revision: D79179369

fbshipit-source-id: e641be0e8ec313b58bcae8330f127e707cd4fffc
2025-07-30 02:49:37 -07:00
David VaccaandFacebook GitHub Bot 0d3791ca0a Throw Exception if ReactApplication.reactNativeHost is not overriden (#52912)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52912

This diff throws an Exception if ReactApplication.reactNativeHost is not overriden. This field is deprecated and it will be deleted in the near future.
The goal of this diff is to be able to remove usages of reactNativeHost for classes that implement ReactApplication

changelog: [Android][Breaking] Throw Exception if ReactApplication.reactNativeHost is not overriden

Reviewed By: mlord93

Differential Revision: D79186336

fbshipit-source-id: 9f8f34739c0f04056ff3d795bda45bc0dbca7624
2025-07-29 18:22:53 -07:00
Samuel SuslaandFacebook GitHub Bot 4614a0bc17 move fabric sync in C++ Animated to JS thread (#52904)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52904

changelog: [internal]

There is a race condition in `FabricUIManagerBinding::schedulerDidFinishTransaction`. Until it is addressed properly, let's do synchronisation Fabric commits through JavaScript thread.

It can have pretty serious consequences: a crash in better case and undefined behaviour in worse case.

The race is between acquiring two mutexes:
1. One inside of `MountingCoordinator::pullTransaction`
2. Second one inside of `FabricMountingManager::executeMount`

The logic inside of `FabricUIManagerBinding::schedulerDidFinishTransaction` depends on the fact that whichever thread acquires mutex number 1, will acquire mutex number 2 without interruption. But that is not always the case as threads may be interrupted.

Reviewed By: zeyap

Differential Revision: D79080739

fbshipit-source-id: c86885aba25825030dc44b60144beb3e3ba18306
2025-07-29 14:26:09 -07:00
React Native BotandFacebook GitHub Bot 170ed501f0 Add changelog for v0.81.0-rc.3 (#52907)
Summary:
Add Changelog for 0.81.0-rc.3

## Changelog:
[Internal] - Add Changelog for 0.81.0-rc.3

Pull Request resolved: https://github.com/facebook/react-native/pull/52907

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D79186289

Pulled By: lunaleaps

fbshipit-source-id: eae000134c294b47be906f5803c618fb997e1011
2025-07-29 13:10:31 -07:00
Samuel SuslaandFacebook GitHub Bot 7afb8ab305 disable subview clipping traversal when view culling is enabled (#52903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52903

changelog: [internal]

disable subview clipping traversal when view culling is enabled.
Subview clipping is already disabled by preventing prop from being set to true: https://fburl.com/code/bynvtwfs but we found a crash where the traversal leads to memory corruption with view culling enabled.

Reviewed By: lenaic

Differential Revision: D79168116

fbshipit-source-id: 9dcb624ca12bc2d94b265681795604ee0ac3fe00
2025-07-29 09:43:44 -07:00
Samuel SuslaandFacebook GitHub Bot 4b07edd6ea make instance variables const in RCTComponentViewDescriptor (#52902)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52902

changelog: [internal]

These values must not change during view's life cycle.

Reviewed By: rshest

Differential Revision: D79165823

fbshipit-source-id: dff85d369e4f79ba88740b0f3a23b71af5ec0c5e
2025-07-29 09:19:16 -07:00
Nicola CortiandFacebook GitHub Bot 04ae15d99b Remove the com.facebook.react.bridge.JSONArguments class (#52901)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52901

I'm removing this class as we should not expose it publicly.
It's not used at all inside react-native and can potentally be moved internally.

The only usage I've found in OSS is patched with this PR:
- https://github.com/fabOnReact/react-native-wear-connectivity/pull/46

Changelog:
[Android] [Removed] - Remove the `com.facebook.react.bridge.JSONArguments` class

Reviewed By: javache, mdvacca

Differential Revision: D78265165

fbshipit-source-id: 704575e7b9cfd6d40980511d6064d39991b3eb48
2025-07-29 08:54:10 -07:00
Riccardo CipolleschiandFacebook GitHub Bot ec5a98b1f5 Sync React 19.1.1 into React Native (#52887)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52887

Syncs Reac 19.1.1 into React Native.

This commit should contains the fix for:
- React owner stack in React Native
- An issue with React holding shadow node for longer than it needed
- An issue that made `startTransition` not working with React Native.

## Changelog:
[General][Changed] - Bumped React to 19.1.1

bypass-github-export-checks

Reviewed By: cortinico

Differential Revision: D79096406

fbshipit-source-id: cbb2f846b1f08ba5ff482cfed5aaddc16df075cc
2025-07-29 08:05:38 -07:00
Rubén NorteandFacebook GitHub Bot 3bff471738 Reduce flakiness of LongTasksAPI Fantom test (#52898)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52898

Changelog: [internal]

This test is flaky on Github and I haven't been able to reproduce it locally to debug exactly why, but I think it might be because there might be cross-tests pollution.

This tries to reduce that making sure we clean up everything between tests.

Reviewed By: cortinico

Differential Revision: D79163809

fbshipit-source-id: fe59315373ab74ccedd7e031816a84f0566b4aa0
2025-07-29 03:50:32 -07:00
Nicola CortiandFacebook GitHub Bot dde4d34a02 Add more tests for MatrixMathHelper (#52885)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52885

Since we recently touched the `MatrixMathHelper` class, as we're looking into moving more matrix operations from Kotlin to C++,
I'm going to add more tests to make sure that those matrix math function are behaving correctly.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D79094323

fbshipit-source-id: 34967b42dc92338724dd20fb7f70a68734f6db28
2025-07-29 02:35:27 -07:00
x-duneandFacebook GitHub Bot 6337cbfd77 docs: fix changelog links and remove versions without corresponding changelogs (#52849)
Summary:
- The  changelog docs has broken links for the pre v0.80 markdowns due to missing extension
- There are links without corresponding changelogs

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[INTERNAL] [FIXED] - fix changelog links and remove versions without corresponding changelogs

Pull Request resolved: https://github.com/facebook/react-native/pull/52849

Test Plan: Click on each link to see if it opens the corresponding page at the specific section

Reviewed By: christophpurrer, cortinico

Differential Revision: D79097825

Pulled By: cipolleschi

fbshipit-source-id: a92e709ccbb45a042175bd198326132bfbf37c65
2025-07-29 02:34:18 -07:00
Riccardo CipolleschiandFacebook GitHub Bot dd00c9055a Fix react-native vulnerabilities in package.json (#52876)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52876

Our tooling detected a couple of vulnerabilities in our package.json.
- undici
- on-headers

This change fixes these vulnerabilities.
For the on-headers vulnerabilitiy specifically, it comes from the following dependency chain:
- rn-tester > react-native-community/cli > compression > on-headers.

To fix it, we have to force the resolution to both on-headers and compression.

## Changelog:
[General][Fixed] - Fixed vulnerability on undici and on-headers

Reviewed By: cortinico

Differential Revision: D79086335

fbshipit-source-id: 44f14403196165f5f823030304102dbd0facd0ce
2025-07-29 00:45:24 -07:00
Danny SuandFacebook GitHub Bot fb0e4ee6d1 Enable regenerator for Hermes dev mode transform profile (#52651)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52651

Changelog: [Internal]

Last year the `hermes-canary` profile was used to enable certain apps to use Static Hermes by enabling regenerator because debugger support for generator wasn't finished yet. However, we actually could have just keyed off of `options.dev` and still kept using `hermes-stable`.

The `hermes-canary` profile is actually meant to be used to run experiments. We should free up this profile to return it to the original intended purpose.

This diff makes all hermes profiles' dev mode use regenerator. Existing SH apps using `hermes-canary` should be unaffected. And apps using Hermes will change to use regenerator in dev mode, but that should be ok.

Reviewed By: robhogan

Differential Revision: D78450695

fbshipit-source-id: eb6a87fbc1f0e08d490fd0d1baa3611248f95764
2025-07-28 21:44:45 -07:00
Joe VilchesandFacebook GitHub Bot e17e3e3f38 Decouple ReactAndroidHWInputDeviceHelper from ReactRootView (#52891)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52891

Right now these are tightly coupled for no reason. The device helper just asks the root view to send the event out, which it uses ReactContext for. We can just have that be passed in and accomplish the same task.

Changelog: [Internal]

Reviewed By: Abbondanzo, rozele

Differential Revision: D79007328

fbshipit-source-id: ef0a5ac4ec0acb52fc7c2a26010811767e3c1e67
2025-07-28 19:31:02 -07:00
Aakash PatelandFacebook GitHub Bot b4a10f01fb Use == instead of EXPECT_EQ in testlib
Summary:
The `EXPECT_EQ` was leading to potentially ambiguous use of `<<` when
gtest tries to print information.

Changelog: [Internal]

Reviewed By: tsaichien

Differential Revision: D78823354

fbshipit-source-id: d26de07f02eb8bb53a4dec34b5fb302681bfbef8
2025-07-28 19:14:54 -07:00
David VaccaandFacebook GitHub Bot 8c1d191f1a EZ cleanup of unnecessary variable (#52892)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52892

 EZ cleanup of unnecessary variable

changelog: [internal] internal

Reviewed By: mlord93

Differential Revision: D79119092

fbshipit-source-id: 10b8675763dd203a832648ef3c99520dcdaa08da
2025-07-28 18:16:05 -07:00
Christoph PurrerandFacebook GitHub Bot daeb6e99ab Bring back ContextContainer::Shared (#52889)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52889

This brings back ContextContainer::Shared (but marks it as deprecated which was removed in https://github.com/facebook/react-native/pull/52750

Changelog: [General][Fixed] Bring back ContextContainer::Shared = std::shared_ptr<const ContextContainer> alias

Reviewed By: lenaic

Differential Revision: D79112609

fbshipit-source-id: 1cb9114b98d745b846d5ddc56a01786527049e50
2025-07-28 17:21:34 -07:00
Nicola CortiandFacebook GitHub Bot 48bf59c85e Use by lazy(LazyThreadSafetyMode.NONE) for RNTester (#52886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52886

RNTester was using just a plain `by lazy{}` which gets flagged by our internal linter over and over.
This fixes it.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D79094496

fbshipit-source-id: 856864bf8b5e4ec1254d1793dba9e97377696408
2025-07-28 15:11:35 -07:00
Christoph PurrerandFacebook GitHub Bot 4718b35259 Bring back SharedImageManager = std::shared_ptr<ImageManager> alias to allow gradual API migration (#52888)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52888

This brings back the type erased in  https://github.com/facebook/react-native/pull/52747 to fix build breaks in consuming libraries as: `react-native-svg`

https://github.com/facebook/react-native/actions/runs/16560124464/job/46828273956?fbclid=IwY2xjawL0f1dleHRuA2FlbQIxMQBicmlkETFXVnFJUkhXMDNkSlJhY1c1AR6vMc_wUFxgfUN-JsCFMzl4L2V2JaSfX37gKIoUu8U9WGGmb0JBG1LNl0Ogjg_aem_aM4XSISUjhqE7S8_QA2KfA

Changelog: [General][Fixed] Bring back SharedImageManager = std::shared_ptr<ImageManager> alias

Reviewed By: cipolleschi

Differential Revision: D79097253

fbshipit-source-id: afec0b4dd706fac91ba296d2bf2a50fb27200597
2025-07-28 11:42:19 -07:00
Artur KalachandFacebook GitHub Bot eb08f54594 Update RCTTextInputComponentView to recycle and properly clean the inputAccessoryView dependency. (#52825)
Summary:
Update `RCTTextInputComponentView` to recycle and properly clean its `inputAccessoryView` dependency. Currently, `RCTTextInputComponentView` does not clean up this dependency during recycling, which can result in the `inputAccessoryView` being incorrectly applied to `TextInput` components that do not use an accessory view."

Related issue: https://github.com/facebook/react-native/issues/52824
Snack of the issue: https://snack.expo.dev/arturkalach/privileged-blue-soda

https://github.com/user-attachments/assets/46a1f172-a75c-4e88-beee-059d4d2e1d0c

## Changelog:
[IOS][FIXED] Update recycling logic to clean up the `inputAccessoryView` dependency.
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/52825

Test Plan:
```
1. Render more than eight TextInput components on the screen, each with an AccessoryView.
2. Unmount the TextInput components using conditional rendering.
3. Open a Modal that contains a KeyboardAvoidingView and a TextInput.
4. Focus on the TextInput inside the Modal.
```

https://github.com/user-attachments/assets/8be1fdef-e8ab-4030-a2c5-e952c22ef743

Reviewed By: christophpurrer

Differential Revision: D78966221

Pulled By: cipolleschi

fbshipit-source-id: 35b6748cc44c41056051b2eecd626d61c4641cdf
2025-07-28 10:33:48 -07:00
Riccardo CipolleschiandFacebook GitHub Bot cda32c3119 Fix vulnerabilities in HelloWorld's Gemfile (#52873)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52873

Our tooling detected a vulnerability in HelloWorld's Gemfile. This change fixes them.

bypass-github-export-checks

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D79084217

fbshipit-source-id: 7a0c85a0b2e79792c43226f43a19f27414cfee2a
2025-07-28 10:32:44 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 9d4f6cd6b5 Fix path to react-native for Metro (#52877)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52877

We moved the HelloWorld package from `packages`to `private` but we didn't update the path to React Native that is consumed by metro.

This change fixes this.

## Changelog:
[Internal] -

Reviewed By: huntie

Differential Revision: D78493478

fbshipit-source-id: 8795c2963dec036693a73a16c18be381f19e11c4
2025-07-28 10:32:44 -07:00
Rubén NorteandFacebook GitHub Bot d2fa1cd900 Create basic benchmark for Animated (#52874)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52874

Changelog: [internal]

This creates a basic benchmark for the Animated API, which shows that **using Animated**, even without setting up animations, **makes rendering 3x slower** (similar when setting up a JS driven animation), but **6x slower when it sets up a native animation.**

Baseline:
### Animated (mode 🚀) ###

| (index) | Task name                                                                    | Latency average (ns)  | Latency median (ns)     | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | ---------------------------------------------------------------------------- | --------------------- | ----------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'render 1 views'                                                             | '85320.76 ± 1.27%'    | '82484.00'              | '11994 ± 0.09%'            | '12124'                   | 11721   |
| 1       | 'render 10 views'                                                            | '399462.22 ± 1.03%'   | '387702.00'             | '2552 ± 0.29%'             | '2579'                    | 2505    |
| 2       | 'render 100 views'                                                           | '3317795.78 ± 0.90%'  | '3232351.00 ± 70.00'    | '303 ± 0.74%'              | '309'                     | 302     |
| 3       | 'render 1 animated views (without no animations set up)'                     | '172534.31 ± 0.67%'   | '168423.00'             | '5874 ± 0.14%'             | '5937'                    | 5796    |
| 4       | 'render 10 animated views (without no animations set up)'                    | '1050582.87 ± 0.63%'  | '1031899.00 ± 20.00'    | '957 ± 0.37%'              | '969'                     | 952     |
| 5       | 'render 100 animated views (without no animations set up)'                   | '9255133.10 ± 1.06%'  | '8990333.00'            | '108 ± 0.94%'              | '111'                     | 109     |
| 6       | 'render 1 animated views (with a single animation set up - JS driven)'       | '203422.03 ± 0.50%'   | '198478.00'             | '4966 ± 0.17%'             | '5038'                    | 4916    |
| 7       | 'render 10 animated views (with a single animation set up - JS driven)'      | '1305600.39 ± 0.37%'  | '1288088.00 ± 15.00'    | '768 ± 0.30%'              | '776'                     | 766     |
| 8       | 'render 100 animated views (with a single animation set up - JS driven)'     | '12084658.14 ± 1.51%' | '11854181.00 ± 8493.00' | '83 ± 1.27%'               | '84'                      | 84      |
| 9       | 'render 1 animated views (with a single animation set up - native driven)'   | '313494.69 ± 0.32%'   | '308673.00'             | '3206 ± 0.19%'             | '3240'                    | 3190    |
| 10      | 'render 10 animated views (with a single animation set up - native driven)'  | '2223507.22 ± 0.50%'  | '2184839.00 ± 70.00'    | '451 ± 0.41%'              | '458'                     | 450     |
| 11      | 'render 100 animated views (with a single animation set up - native driven)' | '21352575.02 ± 0.71%' | '21239136.00 ± 2824.00' | '47 ± 0.69%'               | '47'                      | 64      |

Reviewed By: christophpurrer

Differential Revision: D79085920

fbshipit-source-id: 1dc13208da49cc325995f3455eaf86c4eb1e4d47
2025-07-28 10:02:25 -07:00
Rubén NorteandFacebook GitHub Bot 797d14da9e Expose types for benchmark options (#52875)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52875

Changelog: [internal]

This simplifies typing tests.

Reviewed By: christophpurrer

Differential Revision: D79086359

fbshipit-source-id: 683a713e0182f18c9b26e515921d17cf7873aa06
2025-07-28 10:02:25 -07:00
Zeya PengandFacebook GitHub Bot 6e4d23ded2 Allow setting blockNativeResponder on Pressable (#52819)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52819

## Changelog:

[General] [Added] - Allow setting blockNativeResponder on Pressable

To expose the same prop on Pressability https://github.com/facebook/react-native/blob/b2d9f5f28045fd89bba2dca41274c7cd7abe2ecc/packages/react-native/Libraries/Pressability/Pressability.js#L137

Reviewed By: christophpurrer

Differential Revision: D78896178

fbshipit-source-id: 36637842ac15c54de325975d416efce1448e8ab7
2025-07-28 08:34:04 -07:00
Sam ZhouandFacebook GitHub Bot 209e124340 Apply fix of https://github.com/facebook/react-native/pull/52787 to an inner prettier config (#52881)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52881

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D79089990

fbshipit-source-id: 12d5a7defabf877c62113e72099c965351896cf7
2025-07-28 07:28:05 -07:00
Ruslan LesiutinandFacebook GitHub Bot 253249611c Extract serializers for ProfileChunk (#52870)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52870

# Changelog: [Internal]

Defines a set of static serializers for parts of the "Profile" and "ProfileChunk" Trace Events.

Mainly for 2 reasons:
1. To follow the same pattern of static serializers for Tracing.
2. To save on string copying, since ProfileChunk could contain hundreds of unique frames, all of them could have unique function names. The previous approach would copy the strings and populate a new `folly::dynamic` object.

Reviewed By: huntie

Differential Revision: D78919218

fbshipit-source-id: 303a4fc259d6b1720ce982e144037ee56cd47e9b
2025-07-28 07:12:17 -07:00
Ruslan LesiutinandFacebook GitHub Bot 7488097872 Extract TraceEvent serialization logic (#52869)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52869

# Changelog: [Internal]

We are exctracting a logic for serialization of TraceEvent into a dedicated serializer class.

Conceptually:
- PerformanceTracer would be a local TraceEvent engine that is responsible for constructing and buffering TraceEvents.
- TraceEventSerializer will have a single responsibility: transforming from local structs to serialized json objects that are ready to be dispatched over CDP Tracing domain.

This would help avoid scenarios, where we are passing around `folly:dynamic` between internal subsystems: serialization should only happen right before emtting a CDP message.

Reviewed By: huntie

Differential Revision: D78738370

fbshipit-source-id: a8e33e857192a02dc048d504abe072679ef8ce82
2025-07-28 07:12:17 -07:00
Ruslan LesiutinandFacebook GitHub Bot 75d6cb1138 Avoid copies when dispatching TraceEvent chunks (#52868)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52868

# Changelog: [Internal]

Mainly, 2 changes:
- Callback that emits `Tracing.dataCollected` events will receive chunks as rvalues refs (`&&`), instead of `const &`.
- The RuntimeSamplingProfile will be passed to the serializer as rvalue ref.

Reviewed By: huntie

Differential Revision: D78919223

fbshipit-source-id: 7f65e0627c8839d507e6b2d088fdb0b560906b6a
2025-07-28 07:12:17 -07:00
Ruslan LesiutinandFacebook GitHub Bot 3cf11a3113 Flatten struct (#52867)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52867

# Changelog: [Internal]

There are currently no reasons for these struct not to be plain, plus this would allow us avoiding potentially expensive copying, when returning `const &`.

Reviewed By: huntie

Differential Revision: D78919222

fbshipit-source-id: 7b39d754c05b25915f07202d7e4839b10a08a47c
2025-07-28 07:12:17 -07:00
Ruslan LesiutinandFacebook GitHub Bot 4023800b39 Flatten Sample and Profile structs (#52866)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52866

# Changelog: [Internal]

There are currently no reasons for these struct not to be plain, plus this would allow us avoiding potentially expensive copying, when returning `const &`.

Reviewed By: huntie

Differential Revision: D78919221

fbshipit-source-id: 7d3628bb213fdecadbdafa9b2b5c42472ebd77be
2025-07-28 07:12:17 -07:00
Ruslan LesiutinandFacebook GitHub Bot 7d17a3f61f Flatten SampleCallStackFrame and use designated serializers (#52865)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52865

# Changelog: [Internal]

These doesn't have any custom internal logic, so can be flattened for simplicity.

Reviewed By: huntie

Differential Revision: D76986727

fbshipit-source-id: cf23adf43eefda92674a46217a7269399cf81f0a
2025-07-28 07:12:17 -07:00
Nicola CortiandFacebook GitHub Bot fd12f77018 Also test node 20.19.4 in the test_js matrix (#52878)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52878

Now that Metro is bumped to also support node >= 20.19.4
we should be able to run test_js on `main` against 20.19.4

Changelog:
[Internal] [Changed] -

Reviewed By: robhogan, motiz88

Differential Revision: D79087608

fbshipit-source-id: 2161a893ab2fd88dc7eb1b35aa385704962018e8
2025-07-28 07:11:12 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 0c06ccc78f Add benchmark Fantom test for Image component (#52871)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52871

## Changelog:
[Internal] -

As in the title, this adds a basic Fantom benchmark test for the Image component.

Reviewed By: rubennorte

Differential Revision: D79085957

fbshipit-source-id: 4098415353c8a04992c39e39d9a1dd20270f20d7
2025-07-28 06:49:32 -07:00
Rubén NorteandFacebook GitHub Bot 082db1e0a7 Remove static_hermes_staging variant for Fantom tests (#52861)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52861

Changelog: [internal]

We added this mode recently to support all local Hermes variants, but this doubles the number of build type combinations which regresses test execution time and give us little benefit, so we're removing it.

Reviewed By: rshest

Differential Revision: D79080370

fbshipit-source-id: e1b536427acb98ec01edfd44829e2fef9be9b18d
2025-07-28 06:35:49 -07:00
Rubén NorteandFacebook GitHub Bot 20fc2618d0 Force every output to have a different filename in the same run (#52863)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52863

Changelog: [internal]

We're seeing some issues in stress runs for Fantom tests in optimized mode, failing when compiling the bytecode with Hermes. The specific error in the Hermes compiler isn't clear, but this started failing when we changed the folders for output. It's possible that it's due to race conditions in stress runs, where multiple workers are attempting to compile in the same locations.

This forces every output in every runner to be in a different file to prevent these possible collisions.

Reviewed By: rshest

Differential Revision: D79084242

fbshipit-source-id: b4540e2e6c5378c7fc8630ac2fea674e0ef78a14
2025-07-28 06:35:49 -07:00
Sam ZhouandFacebook GitHub Bot 869a976a5d Bump to prettier v3 across xplat (#52844)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52844

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D78787920

fbshipit-source-id: fc2582001ee6775f53b452dd3659e37521ea6387
2025-07-27 18:50:47 -07:00
Nick LefeverandFacebook GitHub Bot 7fe3b2c902 Add dataDetectorType paragraph prop (#52848)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52848

This diff declares the `DataDetectorType` enum and defined the `dataDetectorType` property on the Android Paragraph props.

The conversions.h file holding the state conversion to MapBuffer was renamed to stateConversions.h so that it wouldn't clash with the Android conversions.h file.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D79025294

fbshipit-source-id: 52dc519ea51191f28745d91fe31e36eaba29a731
2025-07-27 17:20:44 -07:00
Nick LefeverandFacebook GitHub Bot 94d2e0a39b Add selectionColor paragraph prop (#52847)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52847

Adding the missing Android Text selectionColor prop to the `ParagraphProps` to correctly support the prop with Props 2.0

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D79023868

fbshipit-source-id: 10e04d438d9d118e6b80e8d8854e0bbb76b430ee
2025-07-27 17:20:44 -07:00
Nick LefeverandFacebook GitHub Bot 5e80759994 Add disabled paragraph prop (#52846)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52846

Adding the Paragraph `disabled` property for RN Android.

This diff also adds a new Text example to RNTester for disabled text.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D78990840

fbshipit-source-id: dd25b890597bc9f728f929b38c2f680631b7f476
2025-07-27 17:20:44 -07:00
Nick LefeverandFacebook GitHub Bot d390f3b847 Use host platform specific text props (#52845)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52845

With Android having its own props for the Paragraph component, we need to create a Host Platform specific version for the `ParagraphProps` to hold those platform specific properties.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D78990838

fbshipit-source-id: 722777a338f960fcc54846d8e8f106f51cac162c
2025-07-27 17:20:44 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot df3f0967ba Always avoid setting default props on View component (remove reduceDefaultPropsInView feature flag) (#52837)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52837

# Changelog
[Internal] -

This feature has been enabled by default for a while, and has been proven to both not cause correctness issues, and also provide tangible performance improvements.

We can remove the corresponding feature flag to improve code maintainability.

Reviewed By: rubennorte

Differential Revision: D78978302

fbshipit-source-id: 45cb865321f6e0eb449427845772fc522221514a
2025-07-26 12:49:40 -07:00
Sam ZhouandFacebook GitHub Bot 01eaa6db97 Mock prettier import through actual require to prepare for prettier v3 (#52843)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52843

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D78993226

fbshipit-source-id: 03f43c61fe9e6edaf38f895daf4f0c146df931b8
2025-07-25 13:52:59 -07:00
Andrew DatsenkoandFacebook GitHub Bot 627136ee76 Add basic steps in CI (#52225)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52225

## Changelog:
[Internal] - Fantom in RN CLI
This diff prepares the RN CI to build and run Fantom Tests

Reviewed By: cortinico

Differential Revision: D70097944

fbshipit-source-id: 163cb3f5204f7e5491f94f2fbebe11b514919cdf
2025-07-25 13:46:35 -07:00
Marco WangandFacebook GitHub Bot d041e8b7e0 Pre-suppression errors for functionT in xplat js (#52820)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52820

Reviewed By: SamChou19815

Differential Revision: D78941100

fbshipit-source-id: 66d462670471212d23e8682bd5bf1ebd79ef4582
2025-07-25 13:46:08 -07:00
Zeya PengandFacebook GitHub Bot 8e2b33f979 keep track of last direct manipulation props (#52842)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52842

## Changelog:

[Internal] [Fixed] - keep track of last direct manipulation props

* so that at next time there's a ShadowTree commit (regardless of which thread), they're merged into the update mutation
* the props will stay until the view is disconnected from props node via Animated API or the view is removed/deleted. This should be expected behavior, because in RN we expect that once Animated changes a prop, subsequent react commits should not change the value.

Reviewed By: sammy-SC

Differential Revision: D78702843

fbshipit-source-id: b5e6e01a7a4f6caeea4cc1eeafaef9c3c7e51691
2025-07-25 13:03:59 -07:00
Sam ZhouandFacebook GitHub Bot f47da61e51 Bump hermes-parser related packages across fbsource (#52841)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52841

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D78949440

fbshipit-source-id: 5c5015f602b9fe591aa68f179163bd37dfb0dcff
2025-07-25 10:46:51 -07:00
Alex HuntandFacebook GitHub Bot a3e99264a2 Introduce V2 Perf Monitor feature flags (#52809)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52809

**Context**

Experimental V2 Performance Monitor prototype, beginning by bringing the [Interaction to Next Paint (INP)](https://web.dev/articles/inp) metric to React Native.

**This diff**

Add two new feature flags:

- `fuseboxInteractionMetricsEnabled` — Will configure sending of interaction live metrics to CDP clients, independent of an active performance profiling session.
- `perfMonitorV2Enabled` — Will enable the backend + UI for the V2 Perf Monitor.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D78894857

fbshipit-source-id: 7605357b3cc9255d76f66bde605f9e520dda9750
2025-07-25 10:29:13 -07:00
Christoph PurrerandFacebook GitHub Bot c7c8ce0cad Update TurboModuleTestFixture to handle Promise types (#52801)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52801

Changelog: [Internal]

This adds utility functions and sample test cases to verify AsyncPromises in GTests

Reviewed By: lenaic

Differential Revision: D78871865

fbshipit-source-id: 41a7bebee94f40ec2d1d84b3ceae561dc503b421
2025-07-25 09:56:37 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 6d52cf5662 Create Fantom benchmark test for Text component (#52836)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52836

# Changelog
[Internal] -

This adds a basic benchmarking test for `Text` component creation, similarly to the one we already have for the e.g. `View`.

Reviewed By: rubennorte

Differential Revision: D78975332

fbshipit-source-id: e1b54e59a54e8c7f8f19738f2ffeaa02ca5c09ee
2025-07-25 08:53:45 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 012b78c0a5 Make View benchmark test use 'testWithArg' API (#52832)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52832

# Changelog
[Internal] -

Make use of `Fantom.unstable_benchmark.testArg` API added in D78970312 for the existing View benchmark test - this makes it more succinct/maintainable.

Reviewed By: rubennorte

Differential Revision: D78970311

fbshipit-source-id: 2db35cb2edfa366311d62c4b1d141c3813a31e53
2025-07-25 08:53:45 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot c5bb31c46e Add 'testWithArg' to Fantom benchmarking API (#52831)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52831

# Changelog
[Internal] -

The corresponding `testWithArg` API is similar to the existing `test` one for the Fantom benchmarks, except it would allow to run the same test several times in a parametrized manner, with the set of parameters specified as an array (for now, of numbers).

This allows to easily implement testing patterns such as we have in a View benchmark test, whereas we have a mostly duplicated test body doing a similar thing with 100, 1000, 1500 view component instances etc.

Reviewed By: rubennorte

Differential Revision: D78970312

fbshipit-source-id: 504b7aada648c7213ce698f088ac71d9fde8884b
2025-07-25 08:53:45 -07:00
Moti ZilbermanandFacebook GitHub Bot 3271e57c75 Handle Runtime.addBinding and Runtime.removeBinding before a RuntimeAgent is present (#52813)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52813

Changelog: [General][Changed] CDP backend now accepts addBinding and removeBinding methods earlier, before a Runtime exists.

Allows managing CDP binding subscriptions at any point in time, including at the very beginning of a session when a `RuntimeAgent` doesn't yet exist (due to `registerRuntime` not having been called yet).

"Adding" a binding with the `Runtime.addBinding` method is actually two actions in one:

1. Subscribing the current session to events from a particular binding name, from one or more Runtime(s) that may exist now or in the future (optionally targetable by execution context ID/name).
2. Installing a JSI function with the given `name` on the global object of the targeted Runtime(s), if they exist at the time of the method call.

NOTE: "Removing" a binding only involves managing the subscription and never causes the corresponding JSI function to be uninstalled - presumably because it may have been captured by user code anyway.

We currently do both (1) and (2) in `RuntimeAgent`, but this means subscriptions can't be managed before a `RuntimeTarget` has been created, which can cause problems if we want to set up certain bindings programmatically during React Native's initialisation. As this is an unnecessary restriction, here we move (1) to `HostAgent` and keep only (2) in `RuntimeAgent`.

Reviewed By: huntie

Differential Revision: D78739067

fbshipit-source-id: 9a39f4503d1b5e7c7a6e4c80dfbaabdd2549fb8d
2025-07-25 07:45:57 -07:00
Samuel SuslaandFacebook GitHub Bot dbdf39a8fe fix crash when view with event driven animation is unmounted (#52807)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52807

changelog: [internal]

Fixes a crash that occurs when event driven animation is attached to a view that is unmounted.

Reviewed By: zeyap

Differential Revision: D78889689

fbshipit-source-id: 6bc534c3d80a7ed2fc5e0ac378e58343fef45430
2025-07-25 07:37:16 -07:00
Samuel SuslaandFacebook GitHub Bot 0d13474161 provide option to fabric commits in C++ Animated (#52834)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52834

changelog: [internal]

we have seen some problems with the fabric commit and believe there is a race condition in the implementation.

Here, we introduce an option to disable it.

Reviewed By: rozele

Differential Revision: D78972655

fbshipit-source-id: 99005c77dbe4dde3816b9e6a692f170cf287f7cd
2025-07-25 07:27:39 -07:00
Rubén NorteandFacebook GitHub Bot 54d5b74bbb Improve stack traces in benchmarks (#52828)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52828

Changelog: [internal]

Just a small quality of life improvement. It forces the test functions in benchmarks to have the name of the test case if it's an anonymous function, so it shows better in stack traces.

Reviewed By: sammy-SC

Differential Revision: D78924769

fbshipit-source-id: 9b44a49feaae93ccfa90cc726274f0ea013654b1
2025-07-25 05:47:35 -07:00
Rubén NorteandFacebook GitHub Bot bfe31bad1f Small refactor of how Fantom configs are formatted (#52826)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52826

Changelog: [internal]

This is just an intermediate change to simplify how we format Fantom configs, so we can extend it to use other formatting formats (e.g.: short format to use in file names).

Reviewed By: lenaic

Differential Revision: D78924771

fbshipit-source-id: 4886a800a6836dc6a66539b1df079adb6c9c52e1
2025-07-25 05:47:35 -07:00
Rubén NorteandFacebook GitHub Bot 0f7ba79166 Avoid creating too many unnecessary build directories for Fantom bundles (#52788)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52788

Changelog: [internal]

Minor change to just create a single output directory for generated JS code in Fantom per Jest run.

Reviewed By: lenaic

Differential Revision: D78808564

fbshipit-source-id: 70e1a60dfcdcc3fc6ee5f08ced1e9c8f8cab2782
2025-07-25 05:47:35 -07:00
Christoph PurrerandFacebook GitHub Bot 2c683c5787 Apply clang-tidy setting; RN Android (#52774)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52774

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D78634966

fbshipit-source-id: daee3ed21b6f2229049e6a09e2b9c48dfb7e0264
2025-07-24 17:50:27 -07:00
Alexey MedvedevandFacebook GitHub Bot 8ed2cee80e Make yoga/Yoga.h an umbrell header (#52817)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52817

X-link: https://github.com/facebook/yoga/pull/1828

X-link: https://github.com/facebook/litho/pull/1070

This diff makes the Yoga/Yoga.h header an umbrella header, which means that it includes all of Yoga's public headers. The code changes in each file include adding the IWYU pragma export to each header file, which is a way to tell the compiler to export the header file's symbols to other files that include it. This is necessary for the header file to be used as an umbrella header.

Changelog:
[General][Added] - Code quality fixes

Reviewed By: corporateshark

Differential Revision: D78692457

fbshipit-source-id: 7fcd53d2a6f268fa4377dbd5bd6ba6eebc94b5f8
2025-07-24 16:51:13 -07:00
Christoph PurrerandFacebook GitHub Bot 546e27684e Apply clang-tidy setting: jsinspectormodern (#52741)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52741

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D78634934

fbshipit-source-id: 03c4c8f5287452fb19fdce69e93686a04525eba5
2025-07-24 16:33:32 -07:00
Sam ZhouandFacebook GitHub Bot 70f7a50e2f Deploy 0.277.1 to xplat
Summary:
[changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D78923286

fbshipit-source-id: fd0b20090a7cd5c5ff64c1dd976e6a8f5e2b59d7
2025-07-24 16:24:20 -07:00
Christoph PurrerandFacebook GitHub Bot 2d220624c7 Apply clang-tidy setting: react/nativemodule (#52740)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52740

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D78634926

fbshipit-source-id: f2218a3ac9b60550e0b71b8533a1fd5062f1d610
2025-07-24 14:50:54 -07:00
filip131311andFacebook GitHub Bot 5ef41068ed fix: View component does not have a displayName (#52688)
Summary:
Hello, I work on [Radon IDE](ide.swmansion.com) I encountered an issue while adding support for react native 81, this PR solves it:
In https://github.com/facebook/react-native/issues/51023 EvanBacon removed `displayName` filed from `View` component adding the following comment:
>Remove displayName in favor of component name. I'm not 100% sure this is a full fallback but it is valid according to react/display-name eslint rule—https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/display-name.md

Unfortunately the Fabric renderer uses the `displayName` property to generate the name of the component for the inspector functionality and in absence of it generates a name that might be confusing to the end user:

<img width="351" height="283" alt="Screenshot 2025-07-17 at 21 27 37" src="https://github.com/user-attachments/assets/852246aa-6586-4684-b80e-5d70b9678c6e" />

Problem is not specific to Radon and happens in chrome devtools as well:

<img width="501" height="130" alt="Screenshot 2025-07-17 at 22 16 52" src="https://github.com/user-attachments/assets/3514dd02-59f7-473a-87b1-6ed325d2034c" />

This PR brings back the `displayName` property to fix that.

## Changelog:

[INTERNAL] [FIXED] - Bring back the displayName property to the View component

Pull Request resolved: https://github.com/facebook/react-native/pull/52688

Test Plan:
- Run the application
- open chrome devtools and navigate to "components" tab
- before changes the View components would show up as `View_withRef` after they are named `View`

Rollback Plan:

Reviewed By: lunaleaps, cortinico

Differential Revision: D78512254

Pulled By: alanleedev

fbshipit-source-id: 46e4a224b09fe3fb938c055a675f687c86d7ddcb
2025-07-24 14:30:52 -07:00
Moti ZilbermanandFacebook GitHub Bot 3a833d3f2f Move all Tracing method handling to TracingAgent (#52814)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52814

Changelog: [Internal]

The handling of `Tracing.start` was needlessly split between `HostAgent` and `TracingAgent` because `TracingAgent` did not have a reference to the session state (which, being an Agent, it's allowed to have). This diff cleans that up.

Reviewed By: huntie

Differential Revision: D78799899

fbshipit-source-id: b05e6dae2e9b287b8708debe756b19f81d5dae06
2025-07-24 13:24:12 -07:00
Rob HoganandFacebook GitHub Bot 840fd6c83f Bump Metro to ^0.83.1, lower minimum Node.js version to 20.19
Summary:
Metro release notes: https://github.com/facebook/metro/releases/tag/v0.83.1

The only public-facing change is a lowering of the minimum Node.js version from 22.14 to 20.19.

This will need picking to RN `0.81-stable`

Changelog: [General][Changed] Metro to ^0.83.1

Reviewed By: huntie

Differential Revision: D78895160

fbshipit-source-id: b9ccffe972249b73897f51c14873861e57a97161
2025-07-24 12:10:18 -07:00
Moti ZilbermanandFacebook GitHub Bot 25293d82e7 Refactor HostAgent control flow (#52815)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52815

Changelog: [Internal]

Refactors `HostAgent::handleRequest` to make the control flow more explicit and the state (`isFinishedHandlingRequest`, `shouldSendOKResponse`) immutable.

Reviewed By: huntie

Differential Revision: D78799898

fbshipit-source-id: 0bcf6c364466a91ad3075b67e4f2ac9a4e7a69a7
2025-07-24 11:58:11 -07:00
Moti ZilbermanandFacebook GitHub Bot 81f3be15b4 Fix test build failures and ASAN violation (#52812)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52812

1. Fix forward from D76486572 (cc christophpurrer) - `#include <format>` is, for whatever reason, not available in fbcode (?) but `fmt` is an adequate, working substitute that is also used elsewhere RN (specifically in ReactCxxPlatform). Also removed the `folly/Format` include that had erroneously been left in, and the `fbobjc_ios_propagated_target_sdk_version` setting that was added purely to support `<format>`.
2. Fixes a dangling reference to an immediately-destroyed `MockHostTargetDelegate` in `ReactInstanceIntegrationTest`, caught by ASAN.
3. Adds a missing `#include <stdexcept>` to `Utf8.h`.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D78756286

fbshipit-source-id: d9428c54fc512f5ab33d31300aba9bf5c3e619b2
2025-07-24 11:58:11 -07:00
React Native BotandFacebook GitHub Bot d90c5c0fa1 Add changelog for v0.80.2 (#52816)
Summary:
Add Changelog for 0.80.2

## Changelog:
[Internal] - Add Changelog for 0.80.2

Pull Request resolved: https://github.com/facebook/react-native/pull/52816

Test Plan:
N/A

Rollback Plan:

Reviewed By: christophpurrer

Differential Revision: D78900279

Pulled By: cipolleschi

fbshipit-source-id: 3063758759c7bcafe3a8b0cdff718288de879689
2025-07-24 10:39:31 -07:00
Andrew DatsenkoandFacebook GitHub Bot b2d9f5f280 Move some tests into fb verse (#52794)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52794

Changelog: [Internal]
Failing oss tests due to different React

Reviewed By: rubennorte

Differential Revision: D78755895

fbshipit-source-id: 6a1c2f5baf8ecc0c9116dc739a8f767ba60fff8a
2025-07-24 07:23:28 -07:00
Andrew DatsenkoandFacebook GitHub Bot 273c2d842d skip bytecode support for hermes (#52767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52767

Changelog: [Internal]
Currently tests that depend on hermes dev bytecode will fail because in OSS this case was not handled. We need to skip them for now before we integrate hermes compiler properly.

Reviewed By: christophpurrer, rubennorte

Differential Revision: D78750791

fbshipit-source-id: 5b55bc9acbd6ee5aad874ad57607325cb1373c2e
2025-07-24 07:23:28 -07:00
Nicola CortiandFacebook GitHub Bot 9013a9e666 RNGP - Fix a race condition with codegen libraries missing sources (#52803)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52803

I've just realized that our build suffer from a race condition. Specifically
libraries codegen needs to be executed before the app starts the evaluating CMake files.
Otherwise this could lead to a lot of missing files or folders.

Changelog:
[Android] [Fixed] - **rngp:** Fix a race condition with codegen libraries missing sources

Reviewed By: huntie

Differential Revision: D78886347

fbshipit-source-id: f59c201d2eab651bc4a08cf5a795acd379d18186
2025-07-24 05:23:38 -07:00
Rob HoganandFacebook GitHub Bot 15ee3ed2b8 Changelog for 0.77.3 (#52733)
Summary:
Add changelog entry for the 0.77.3 release

## Changelog:

[INTERNAL] Changelog for 0.77.3

Pull Request resolved: https://github.com/facebook/react-native/pull/52733

Test Plan: N/A

Reviewed By: fabriziocucci

Differential Revision: D78659427

Pulled By: robhogan

fbshipit-source-id: 8c62c706a831ed51e362b17840e5a297d378d424
2025-07-24 01:24:17 -07:00
Luna WeiandFacebook GitHub Bot f41f52cf93 Move out enums VirtualViewMode and VirtualViewRenderState (#52798)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52798

Changelog: [Internal] - Move out VirtualViewMode and VirtualViewRenderState into separate files for experimental VirtualView

Reviewed By: mdvacca

Differential Revision: D78825700

fbshipit-source-id: ec21867688b69c4dc88be94a2f3454e07fe4c1bc
2025-07-23 20:23:31 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot e1ae619fce Implement accessibilityOrder by building the accessibilityTree through addChildrenForAccessibility (#52743)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52743

We can build an accessibility tree for Talkback by overriding addChildrenForAccessibility of ViewGroup.

With this we just manually build a tree that contains the elements we care about in the order we want.

We also try to keep most of the tree intact so that coopting works properly
Changelog: [Internal]

EDITS: After backout, fixed the issue where we were incorrectly setting the `accessibility_order_parent` tag the ReactAxOrderHelper class instead of the actual view. Also, made the cast safe to prevent any unexpected issues.

Also refactored the ReactAxOrderHelper functions to not have the block scoped `traverse` functions in favor of just looping through the children of a view when calling them

Reviewed By: joevilches

Differential Revision: D78669715

fbshipit-source-id: e714367c28e722ce42895531cf18e6f2dc926556
2025-07-23 18:08:29 -07:00
Rubén NorteandFacebook GitHub Bot 2de4984970 Implement solution for ShadowTree commmit exhaustion using recursive locks (behind a flag) (#52795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52795

Changelog: [internal]

This is another attempt to fix https://github.com/facebook/react-native/issues/51870, inspired by https://github.com/facebook/react-native/pull/52314 but gated behind a feature flag until we've tested it carefully.

Reviewed By: sammy-SC

Differential Revision: D78817100

fbshipit-source-id: 45e6cae019b212528f2b2e74b9f52fe43d07f537
2025-07-23 15:06:12 -07:00
Rubén NorteandFacebook GitHub Bot c6c7c3720f Clean up feature flag preventShadowTreeCommitExhaustionWithLocking (#52791)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52791

Changelog: [internal]

This cleans up this feature flag as it doesn't work as intended. We'll try another approach with a different flag instead.

Reviewed By: sammy-SC

Differential Revision: D78815892

fbshipit-source-id: 4c651a3a225de9cfb54d00346343c7f2e3bea1d5
2025-07-23 15:06:12 -07:00
Nick LefeverandFacebook GitHub Bot e57ae6b964 Remove recycled view from parent by default (#52792)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52792

With view recyling enabled only on a subset of the components, a recyclabe view could still be attached to its parent if that parent is not recyclable. This diff removes any recycled view from its parent. This will allow the view to be attached to a new parent on mount.

This diff removes the assert checking for parents still set on views pushed on the recycle stack.

Changelog: [Internal]

Reviewed By: mdvacca, sammy-SC

Differential Revision: D78814943

fbshipit-source-id: bb754ce5f526acbf263f23646335228447278562
2025-07-23 12:16:28 -07:00
Ramanpreet NaraandFacebook GitHub Bot 729e61bfe1 Make ui manager proxy not depend on ui manager logic (#52763)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52763

The ui manager proxy shouldn't depend on the legacy ui manager.

We plan to compile out the legacy ui manager soon. But, the ui manager proxy is supposed to linger around for longer.

Changelog: [internal]

Reviewed By: cipolleschi

Differential Revision: D78697148

fbshipit-source-id: 249c63aae63daf653627e3e449b442b5ddaa5afe
2025-07-23 11:58:51 -07:00
Riccardo CipolleschiandFacebook GitHub Bot c71c68121a Properly setup headers for FBReactNativeSpec in prebuilds (#52783)
Summary:
bypass-github-export-checks
Pull Request resolved: https://github.com/facebook/react-native/pull/52783

This change reverts D78158734 which was a patch to make the dynamic frameworks work properly because we were not exporting the FBReactNativeSpec headers in prebuilds correctly.

This change fixes this, by exposritng those headers correctly.

## Changelog:
[Internal] -

bypass-github-export-checks

Reviewed By: cortinico

Differential Revision: D78803425

fbshipit-source-id: 5613ed0c790455ea86668eeb436f7b78a0c80918
2025-07-23 10:44:21 -07:00
Vitali ZaidmanandFacebook GitHub Bot 9d93fb5e0a Update debugger-frontend from 8dc0d5b...a7e4f59 (#52793)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52793

Changelog: [Internal] - Update `react-native/debugger-frontend` from 8dc0d5b...a7e4f59

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/8dc0d5b365e6b4600b78e5a7381aa861d8c1c81e...a7e4f59675edbda995b0cb0d40f277a59a3baebf).

### Changelog

[General][Fixed] fixed stack trace parsing failure for certain frames that are special to Hermes that do not exist in V8.

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [a7e4f5967](https://github.com/facebook/react-native-devtools-frontend/commit/a7e4f5967) | Vitali Zaidman (vzaidman@gmail.com) | 2025-07-23T17:04:33+01:00 | [allow parsing special hermes eval stack trace frames (#196)](https://github.com/facebook/react-native-devtools-frontend/commit/a7e4f5967) |
| [12ae91ad4](https://github.com/facebook/react-native-devtools-frontend/commit/12ae91ad4) | Vitali Zaidman (vzaidman@gmail.com) | 2025-07-23T16:37:55+01:00 | [allow parsing stack traces that end with "skipping x frames" (#195)](https://github.com/facebook/react-native-devtools-frontend/commit/12ae91ad4) |
| [875a31a90](https://github.com/facebook/react-native-devtools-frontend/commit/875a31a90) | Vitali Zaidman (vzaidman@gmail.com) | 2025-07-15T13:45:16+01:00 | [fixed general contribution guide and added meta contribution guide in pr template (#194)](https://github.com/facebook/react-native-devtools-frontend/commit/875a31a90) |

Reviewed By: huntie

Differential Revision: D78817268

fbshipit-source-id: 7e266041b3df7ecbcded6e57cb51bd4647dc835d
2025-07-23 10:24:43 -07:00
Nicola CortiandFacebook GitHub Bot 971997c445 Rollout useNativeTransformHelperAndroid and useNativeEqualsInNativeReadableArrayAndroid as experimental (#52789)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52789

I'm adding those 2 feature flags as enabled for the experimental channel of React Native so that partners
can report back to us and let us know if there are significant regressions.

Changelog:
[Internal] [Changed] -

Reviewed By: rshest

Differential Revision: D78810737

fbshipit-source-id: dc51106e2167aa92d4a275be78abb2c6984b7ffb
2025-07-23 09:37:46 -07:00
Christoph PurrerandFacebook GitHub Bot 39ded5eb2a Apply clang-tidy setting: cxxreact (#52730)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52730

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D78459248

fbshipit-source-id: 1dcd15c5d0cf56f323cc15248c684c9940abdd19
2025-07-23 09:31:44 -07:00
Christoph PurrerandFacebook GitHub Bot 0f25a354ba Simply use a std::shared_ptr in TestCallInvoker (#52771)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52771

Changelog: [Internal]

It seems we can simply use a std::shared_ptr here

(This was some initial over-engineering which isn't needed as it turns out)

Reviewed By: cipolleschi

Differential Revision: D78771904

fbshipit-source-id: 2925c424d2061ca727636c683ec783ed56e3f0c9
2025-07-23 08:52:41 -07:00
Alex HuntandFacebook GitHub Bot ec5638abd0 Expose ReactNativeVersion API (#52784)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52784

Resolves https://github.com/react-native-community/discussions-and-proposals/discussions/893#discussioncomment-13860767.

**Changes**

- Formalises the design of `ReactNativeVersion` as a single object and adds a `getVersionString` accessor.
- Expose `ReactNativeVersion` as a root export on `index.js`.
- Update deep imports use in `NewAppScreen`.

**Notes**

- Subtly, we also have `Platform.constants.reactNativeVersion` in our public API already. **However**, this is the per-platform ***native-reported*** RN version, distinct from the JS version (this diff). See [`ReactNativeVersionCheck.js`](https://github.com/facebook/react-native/blob/54d733311d87e9ab4e18f947edf3f5c85f9a6275/packages/react-native/Libraries/Core/ReactNativeVersionCheck.js#L24).

Changelog:
[General][Added] - Expose `ReactNativeVersion` API as JavaScript root export

Reviewed By: cortinico

Differential Revision: D78806347

fbshipit-source-id: 974251fdaa9ab18fac8a584644fea894e4f6e083
2025-07-23 08:28:32 -07:00
Sam ZhouandFacebook GitHub Bot 99edc42242 Fork internal vs external prettier plugin resolution (#52787)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52787

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D78808694

fbshipit-source-id: 15f6b390bd2674303334dc0615ddb63e96872d4c
2025-07-23 06:51:56 -07:00
generatedunixname537391475639613andFacebook GitHub Bot c7c11f6671 xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/root/RootShadowNode.cpp (#52781)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52781

Reviewed By: rshest

Differential Revision: D78797400

fbshipit-source-id: ec6670fa4b80c3ad19f25e6908c71eef12f5f059
2025-07-23 05:54:44 -07:00
Rubén NorteandFacebook GitHub Bot 54d733311d Add validation for environment variables for Fantom (#52779)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52779

Changelog: [internal]

Adds validation for Fantom environment variables at runtime, to catch typos or variables that no longer have an effect.

Reviewed By: rshest

Differential Revision: D78803045

fbshipit-source-id: efb28a4f3fd6a4be35fb525d91fb093a1e88f7e4
2025-07-23 04:41:42 -07:00
Rubén NorteandFacebook GitHub Bot 3c087fc81c Small refactor of Fantom global setup (#52766)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52766

Changelog: [internal]

Just a minor refactor so adding more logic that should work both at Meta and in OSS is easier in the next diff

Reviewed By: christophpurrer

Differential Revision: D78741904

fbshipit-source-id: 3abda5d5b7be157bf381e26dad2fd4b064a0f556
2025-07-23 04:41:42 -07:00
Rubén NorteandFacebook GitHub Bot fec6a0adf1 Set displayName for Fantom configuration (#52778)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52778

Changelog: [internal]

Jest has an option to select a specific project when running tests:

```
jest --selectProjects fantom
```

But for this to work, a `displayName` option needs to be set in the project configuration. This adds that for Fantom tests (using `fantom`).

Reviewed By: rshest

Differential Revision: D78802516

fbshipit-source-id: 483e7c1450b1f97961e4e43c963fac3ce82cee58
2025-07-23 04:41:42 -07:00
Rubén NorteandFacebook GitHub Bot 130b46c117 Add new environment variables to force CI and debug C++ (#52776)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52776

Changelog: [internal]

`FANTOM_FORCE_CI_MODE` is just an explicit way to indicate that we're on CI, so we'd run benchmarks in test mode, for example.

`FANTOM_DEBUG_CPP` is just an alias for `FANTOM_ENABLE_CPP_DEBUGGING` which is unnecessarily long.

Reviewed By: rshest

Differential Revision: D78801918

fbshipit-source-id: 8e60bdd911067c6b0b92be7e90553fd5209c9ca9
2025-07-23 04:41:42 -07:00
Rubén NorteandFacebook GitHub Bot 342b88d0d3 Create new environment variable to force running benchmarks in test mode (#52759)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52759

Changelog: [internal]

This introduces a new environment variable for Fantom to disable benchmarks (`FANTOM_FORCE_TEST_MODE`), without having to run in CI mode.

Reviewed By: rshest

Differential Revision: D78672864

fbshipit-source-id: ef445bd8b36703594658529da2436c75d5b87179
2025-07-23 04:41:42 -07:00
Rubén NorteandFacebook GitHub Bot af670c8319 Honor ignored frames in errors reported by Fantom (#52765)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52765

Changelog: [internal]

Reported locations for errors in Fantom is wrong, because it seems it's not ignoring "infra" frames.

This was caused by the `stack` property in `ErrorWithCustomBlame` being set on the error objects and shadowing the getter that removes the necessary frames. This fixes that by forcing that property to be deleted.

Reviewed By: christophpurrer

Differential Revision: D78747119

fbshipit-source-id: 81d6ce74041382d7582e2066409e839d28d91052
2025-07-23 04:41:42 -07:00
generatedunixname537391475639613andFacebook GitHub Bot c97741da39 xplat/js/react-native-github/packages/react-native/ReactCommon/react/performance/timeline/tests/PerformanceEntryReporterTest.cpp (#52780)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52780

Reviewed By: rshest

Differential Revision: D78798597

fbshipit-source-id: 28cdd8b2fdd4c5d5889f527ee7574f87e18215a7
2025-07-23 04:31:56 -07:00
Dawid MałeckiandFacebook GitHub Bot fb4587780e Move ReactNativeFeatureFlags to src/private (#52610)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52610

This diff removes `ReactNativeFeatureFlags` from `react-native/Libraries/ReactNative` and migrates
`shouldPressibilityUseW3CPointerEventsForHover` to common `ReactNativeFeatureFlags` in `src/private/featureflags`. The `shouldEmitW3CPointerEvents is removed as it is used in `rn-tester` to hide some examples.

Changelog:
[General][Breaking] - Migrate `shouldPressibilityUseW3CPointerEventsForHover` to common private feature flags and remove `shouldEmitW3CPointerEvents` flag.

Reviewed By: robhogan

Differential Revision: D75448698

fbshipit-source-id: 03942c9504b855f2054c9a5948c0521ce17365b5
2025-07-23 01:43:05 -07:00
Christoph PurrerandFacebook GitHub Bot 730a0d5aef Apply clang-tidy setting: react/renderer|perflogger (#52739)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52739

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D78634924

fbshipit-source-id: c0ad2c6162e1d5929b2b097b884f5989d040d576
2025-07-22 22:06:34 -07:00
Christoph PurrerandFacebook GitHub Bot 14986a8dbf Unify ImageManager API (#52749)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52749

Changelog: [Internal]

The overloaded

```
  virtual ImageRequest requestImage(
      const ImageSource& imageSource,
      SurfaceId surfaceId) const;

  virtual ImageRequest requestImage(
      const ImageSource& imageSource,
      SurfaceId surfaceId,
      const ImageRequestParams& imageRequestParams,
      Tag tag) const;
```
can be expressed with default args in the header file
```
 virtual ImageRequest requestImage(
      const ImageSource& imageSource,
      SurfaceId surfaceId,
      const ImageRequestParams& imageRequestParams = {},
      Tag tag = {}) const;
```

Reviewed By: lenaic

Differential Revision: D78702755

fbshipit-source-id: b482a26136cd512232b86e4b86607d44ca49460e
2025-07-22 19:45:27 -07:00
Sam ZhouandFacebook GitHub Bot 174ea179cd Switch to prettier v3 in fbsource (#52773)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52773

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D78580177

fbshipit-source-id: ef0d4619c10fce62f17351b7691099ba6491ed63
2025-07-22 18:50:50 -07:00
David VaccaandFacebook GitHub Bot 52f2cbab41 Delete ReactYogaConfigProvider (#52772)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52772

ReactYogaConfigProvider is an internal legacy unused class, I'm just deleting it

There are no usages of this class

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D78516728

fbshipit-source-id: f694e9cd66ebe6cf97b343ce971b61fbd42f956f
2025-07-22 16:54:30 -07:00
David VaccaandFacebook GitHub Bot 65671108f6 Deprecate ReactPackageLogger (#52716)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52716

ReactPackageLogger is not supported in the new architecture

changelog: [Android][Changed] ReactPackageLogger is not supported in the new architecture and being deprecated

Differential Revision: D78501563

fbshipit-source-id: 3fef9dc80b8fce4d5a2067cfe171abb8ea6e1aca
2025-07-22 16:54:30 -07:00
Sam ZhouandFacebook GitHub Bot f697b5ad5c Make functions async and add await to prepare for prettier v3 upgrade: 6/n (#52770)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52770

Prettier v3 has an async API. This diff adds in async and await ahead of the upgrade to prepare for the API change.

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D78752906

fbshipit-source-id: 2deeecfc283be30fd0840b2a089604f4e6804af5
2025-07-22 16:18:26 -07:00
Sam ZhouandFacebook GitHub Bot 6c8bcad054 Make functions async and add await to prepare for prettier v3 upgrade: 1/n (#52768)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52768

Prettier v3 has an async API. This diff adds in await ahead of the upgrade to prepare for the API change.

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D78752354

fbshipit-source-id: c0d27a6c863747b71852e72a22687d1fe1d9f76f
2025-07-22 13:28:03 -07:00
Christoph PurrerandFacebook GitHub Bot 7b5307d181 Replace ContextContainer::Shared with std::shared_ptr<const ContextContainer> 2/2 (#52750)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52750

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D78704833

fbshipit-source-id: 4df0029f6de860c93864e12c479e387f3981f7b5
2025-07-22 12:40:27 -07:00
Christoph PurrerandFacebook GitHub Bot 5e1798ad7a Add Android image prefetching feature flag (#52748)
Summary:
Changelog: [Internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/52748

Reviewed By: rshest

Differential Revision: D78701936

fbshipit-source-id: 878eed13b39ff71487ca47fe7e4ea46459b85ba3
2025-07-22 12:30:57 -07:00
Christoph PurrerandFacebook GitHub Bot ae4ce02752 Replace SharedImageManager with std::shared_ptr<ImageManager> (#52747)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52747

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D78698231

fbshipit-source-id: 5da5c57237d1cc16dc3d120c7b58c44da6914d36
2025-07-22 09:36:32 -07:00
Christoph PurrerandFacebook GitHub Bot 52d8660964 Use default namespace in RNAndroid / imagemanager / conversion (#52751)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52751

The only method use externally is
```
inline MapBuffer serializeImageRequest(
    const ImageSource& imageSource,
    const ImageRequestParams& imageRequestParams) {
```
all others can move to a private/anonymous namespace

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D78709009

fbshipit-source-id: 10c444c34641deddcfc3d2d4e95274f24fd38a4e
2025-07-22 09:29:50 -07:00
Riccardo CipolleschiandFacebook GitHub Bot bfc10ba90f Use prebuilds for nightlies (#52762)
Summary:
Use prebuilds for nightly checks. This should save a lot of time in CI.
An example job which used to take 18 min took less than 4 min.

## Changelog:
[Internal] -

Pull Request resolved: https://github.com/facebook/react-native/pull/52762

Test Plan:
GHA
Sample job, 3' 23'': https://github.com/facebook/react-native/actions/runs/16447578916/job/46483698898?pr=52762
(Same job last night, 18' 27'': https://github.com/facebook/react-native/actions/runs/16434647827/job/46442342235)

Reviewed By: cortinico

Differential Revision: D78741195

Pulled By: cipolleschi

fbshipit-source-id: 6b9dad215af19c17ed4b2bcd8a835214e33d0267
2025-07-22 08:48:40 -07:00
Ruslan LesiutinandFacebook GitHub Bot 3da74f0799 Add method for collecting all events in a single container (#52734)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52734

# Changelog: [Internal]

We are going to need it at the top of the stack, once we will capture the Trace Events as part of the Tracing Profile for the whole Host.

This is also would be used for always-on tracing.

Reviewed By: sbuggay

Differential Revision: D78660071

fbshipit-source-id: 4f876bed992b8a794e561940ad12405fef88cb62
2025-07-22 04:34:50 -07:00
Hanno J. GödeckeandFacebook GitHub Bot bbc0c0b6ef fix: remove redundant if checks in traceMark (#52756)
Summary:
There are some duplicated function calls in `PerformanceEntryReporter::reportMark()` . I know this is a micro optimization but I feel this way the code is cleaner.

This is called through `performance.mark` so there is potentially a tiny little performance improvement here?

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[INTERNAL] [FIXED] - Removed redundant checks in `PerformanceEntryReporter::reportMark()`

Pull Request resolved: https://github.com/facebook/react-native/pull/52756

Test Plan: The existing testing infrastructure should cover these callsites i believe

Reviewed By: rubennorte

Differential Revision: D78731441

Pulled By: cortinico

fbshipit-source-id: e0de12c3c6f55e12eb454ea4b7081f3d6003126c
2025-07-22 04:14:48 -07:00
Maciej SynowskiandFacebook GitHub Bot f84514a88b Do not override (xc)framework's Info.plist files with RCTNewArchEnabled (#52520)
Summary:
`new_architecture.rb` script looks for `Info.plist` files in IOS directory, and adds RCTNewArchEnabled field to each one, except for those explicitly excluded. Framework files should remain unchanged, so I've extended the excluded_info_plist dict.

Modifying framework's Info.plist can break pod installation with errors like:

```
[!] An error occurred while processing the post-install hook of the Podfile.

invalid byte sequence in UTF-8
```

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[IOS] [FIXED] Fix overriding (xc)framework Info.plist files with RCTNewArchEnabled field

Pull Request resolved: https://github.com/facebook/react-native/pull/52520

Test Plan: Add any .framework or .xcframework to the iOS directory, install pods. If *.(xc)framework/Info.plist remains unchanged it works as intended.

Reviewed By: cortinico

Differential Revision: D78731439

Pulled By: cipolleschi

fbshipit-source-id: a04dfc0e282294e3e16d8292281f2c3369008551
2025-07-22 03:55:13 -07:00
Nicola CortiandFacebook GitHub Bot 59101d6809 Remove unnecessary OSSLibraryExample (#52705)
Summary:
This module is currently unused, so we can clean it up.

## Changelog:

[INTERNAL] -

Pull Request resolved: https://github.com/facebook/react-native/pull/52705

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D78555763

Pulled By: cortinico

fbshipit-source-id: 0a6152ab3d357cac0c6d7669f292680af7b87074
2025-07-22 03:16:48 -07:00
React Native BotandFacebook GitHub Bot c102f24522 Add changelog for v0.81.0-rc.2 (#52744)
Summary:
Add Changelog for 0.81.0-rc.2

## Changelog:
[Internal] - Add Changelog for 0.81.0-rc.2

Pull Request resolved: https://github.com/facebook/react-native/pull/52744

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D78727514

Pulled By: rshest

fbshipit-source-id: 7bee2ec44705c7844c6fe03781f6031472d7b341
2025-07-22 02:54:17 -07:00
Christoph PurrerandFacebook GitHub Bot c0eeebbd9d Apply clang-tidy setting: fantorm/rntester (#52731)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52731

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D78634903

fbshipit-source-id: f4ad862061630a098e80a125e25ae3af17b9eb60
2025-07-22 00:48:40 -07:00
Sam ZhouandFacebook GitHub Bot 2c3a00b7b1 Use the prettier config at the root for react-native-codegen (#52746)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52746

The config is needed for build, so I renamed it. In this way, the formatting of js code in react-native repo will be consistently controlled by the prettier config in the root. This change will make prettier v3 upgrade easier.

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D78700564

fbshipit-source-id: 392ed490bf814870f285c8372ff68b454e228802
2025-07-21 19:45:34 -07:00
Sam ZhouandFacebook GitHub Bot 7970ee9998 Prepare react-native for prettier v3: 2/n (#52745)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52745

Prettier v3 no longer loads plugin implicitly. This diff first configures the hermes-parser plugin explicitly to prepare for v3 rollout. D78590158 missed this config.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D78673890

fbshipit-source-id: 1931718ef2b3f011621bf4d64c8936a698506374
2025-07-21 15:22:17 -07:00
Sam ZhouandFacebook GitHub Bot 976055e52b Add annotations or make things readonly to prepare for array literal soundness fix
Summary: Changelog: [Internal]

Reviewed By: abhinayrathore, marcoww6

Differential Revision: D78689934

fbshipit-source-id: f749c4a0a6c34c80f09e4aaa05200ff282151838
2025-07-21 15:13:17 -07:00
Mateo GuzmánandFacebook GitHub Bot 2372c1c56a Fix ktfmt symbolic links issues (#52721)
Summary:
There are symbolic link issues with ktfmt after building the rn-tester. Putting back this patch to address that issue.

## Changelog:

[INTERNAL] - Fix ktfmt symbolic links issues

Pull Request resolved: https://github.com/facebook/react-native/pull/52721

Test Plan:
1. Build the rn-tester:

```sh
yarn android
```

2. Unformat a file manually and then:

```sh
yarn lint-kotlin-check
yarn lint-kotlin
```

Reviewed By: cipolleschi

Differential Revision: D78647797

Pulled By: cortinico

fbshipit-source-id: b2f230741466be0a95c21a9b98f3d15b865c2b83
2025-07-21 09:11:29 -07:00
Nicola CortiandFacebook GitHub Bot 3ea2f62531 Bump ccache cache key on GHA (#52711)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52711

The ccache cache is not really working. That's because we don't have a way to
properly compute the cache.

I'm adding has `hashFiles` to collect all the C++ and CMake files that are used
by ccache to fix this.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D78560946

fbshipit-source-id: 8d521d01386b62d3cfbd485f8e6fcf5f66eba71b
2025-07-21 09:02:04 -07:00
Nicola CortiandFacebook GitHub Bot a7a51275b5 Do not setup-node twice in test_js (#52737)
Summary:
I've noticed that test_js (20) and test_js (24) are actually running on Node 22.
That's because the `yarn-install` action is invoking setup-node again with the default value (22).

This changes it. Also I'm cleaning up the workflows so that every `yarn-install` invocation is happening just after the `setup-node` invocation.

## Changelog:

[INTERNAL] -

Pull Request resolved: https://github.com/facebook/react-native/pull/52737

Test Plan: CI which will most likely be red for test_js (20) so will need a follow-up

Reviewed By: cipolleschi

Differential Revision: D78664671

Pulled By: cortinico

fbshipit-source-id: c73390930d1511d1bf0f2d4ea92e83f50b10247f
2025-07-21 08:51:05 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 5c869fd0a5 Run E2E tests on each PR (#52197)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52197

This Diff enables E2E tests to run on every PR.
We estimated that, now that we removed JSC and the legacy arch, the cost of running E2E tests on each PR should not be that high.

## Changelog:
[Internal] - Run E2E tests on each PR

Reviewed By: cortinico

Differential Revision: D77148473

fbshipit-source-id: 68191ff81c197d4c4ff9d6e71a41b7253971ddfb
2025-07-21 08:42:23 -07:00
Alex HuntandFacebook GitHub Bot 0068b9ee90 Restore flow dir in react-native package files (#52735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52735

Changelog: [Internal] (Follow up to keep #50784 non-breaking)

Reviewed By: cortinico

Differential Revision: D78662770

fbshipit-source-id: 03d931c904c0092481dbd03e8420244639305610
2025-07-21 08:35:59 -07:00
Riccardo CipolleschiandFacebook GitHub Bot aa27cdba9b Revert "Fix Dimensions window values on Android < 15 (#52481)" (#52732)
Summary:
Commit 86994a6e22 breaks Android for API level 24. Since it has landed last week, we had CI red. reverting this change while we found a valid fix forward.

## Changelog:
[Android][Changed] - Reverted fix `Dimensions` `window` values on Android < 15 when edge-to-edge is enabled

Pull Request resolved: https://github.com/facebook/react-native/pull/52732

Test Plan:
GHA is green.:
https://github.com/facebook/react-native/actions/runs/16414048087/job/46377878366?pr=52732
https://github.com/facebook/react-native/actions/runs/16414048087/job/46377878383?pr=52732

Reviewed By: cortinico, rshest

Differential Revision: D78657920

Pulled By: cipolleschi

fbshipit-source-id: 396a48c9aa7bde3109e25200fe2decc9977efda4
2025-07-21 05:31:43 -07:00
Mateo GuzmánandFacebook GitHub Bot 57b5d7bf6f Make UIManagerModuleListener internal (#52727)
Summary:
This class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.uimanager.UIManagerModuleListener).

## Changelog:

[INTERNAL] - Make com.facebook.react.uimanager.UIManagerModuleListener internal

Pull Request resolved: https://github.com/facebook/react-native/pull/52727

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D78656919

Pulled By: rshest

fbshipit-source-id: cc9756bdd1c9e702f26cd87493c6f291792b7526
2025-07-21 05:12:22 -07:00
Nick LefeverandFacebook GitHub Bot 1f6eb884bf Fix modal crash on create with initial props (#52729)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52729

The Modal view creation contains initial properties when using Props 2.0. This diff adds support for Modal view creations having initial properties by allowing the `updateProperties` fast path only if the dialog is already initialized.

Without the change, the fast path gets called before the dialog could be initialized which leads to throwing an exception when the dialog is being checked to see if it is initialized.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D78638902

fbshipit-source-id: 61ad007b82867fa8b35648e3d8c930ee0e86c80d
2025-07-21 05:02:18 -07:00
Christoph PurrerandFacebook GitHub Bot a0a77f7476 Make it explicit to specify HttpClientFactoryKey and WebSocketClientFactoryKey values (#52715)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52715

Changelog: [Internal]

Right now we rely on compile / link time magic to detect the implementation of
```
WebSocketClientFactory getWebSocketClientFactory();
HttpClientFactory getHttpClientFactory();
```
this actually works until it does not work anymore, see .e.g.:
```
ld.lld: error: undefined symbol: facebook::react::getHttpClientFactory()
>>> referenced by ReactHost.cpp:111 (xplat/js/react-native-github/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp:111)
>>>               xplat/js/react-native-github/packages/react-native/ReactCxxPlatform/react/runtime/__runtimeAndroid__/__objects__/ReactHost.cpp.pic.o:(facebook::react::ReactHost::ReactHost(facebook::react::ReactInstanceConfig, std::__ndk1::shared_ptr<facebook::react::IMountingManager>, std::__ndk1::shared_ptr<facebook::react::RunLoopObserverManager>, std::__ndk1::shared_ptr<facebook::react::ContextContainer const>, std::__ndk1::function<void (facebook::jsi::Runtime&, facebook::react::JsErrorHandler::ProcessedError const&)>, std::__ndk1::function<void (std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&, unsigned int)>, std::__ndk1::shared_ptr<facebook::react::IDevUIDelegate>, std::__ndk1::vector<std::__ndk1::function<std::__ndk1::shared_ptr<facebook::react::TurboModule> (std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&, std::__ndk1::shared_ptr<facebook::react::CallInvoker> const&)>, std::__ndk1::allocator<std::__ndk1::function<std::__ndk1::shared_ptr<facebook::react::TurboModule> (std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&, std::__ndk1::shared_ptr<facebook::react::CallInvoker> const&)>>>, std::__ndk1::shared_ptr<facebook::react::SurfaceDelegate>, std::__ndk1::shared_ptr<facebook::react::NativeAnimatedNodesManagerProvider>, std::__ndk1::function<void (facebook::jsi::Runtime&)>))

ld.lld: error: undefined symbol: facebook::react::getWebSocketClientFactory()
>>> referenced by ReactHost.cpp:117 (xplat/js/react-native-github/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp:117)
>>>               xplat/js/react-native-github/packages/react-native/ReactCxxPlatform/react/runtime/__runtimeAndroid__/__objects__/ReactHost.cpp.pic.o:(facebook::react::ReactHost::ReactHost(facebook::react::ReactInstanceConfig, std::__ndk1::shared_ptr<facebook::react::IMountingManager>, std::__ndk1::shared_ptr<facebook::react::RunLoopObserverManager>, std::__ndk1::shared_ptr<facebook::react::ContextContainer const>, std::__ndk1::function<void (facebook::jsi::Runtime&, facebook::react::JsErrorHandler::ProcessedError const&)>, std::__ndk1::function<void (std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&, unsigned int)>, std::__ndk1::shared_ptr<facebook::react::IDevUIDelegate>, std::__ndk1::vector<std::__ndk1::function<std::__ndk1::shared_ptr<facebook::react::TurboModule> (std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&, std::__ndk1::shared_ptr<facebook::react::CallInvoker> const&)>, std::__ndk1::allocator<std::__ndk1::function<std::__ndk1::shared_ptr<facebook::react::TurboModule> (std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&, std::__ndk1::shared_ptr<facebook::react::CallInvoker> const&)>>>, std::__ndk1::shared_ptr<facebook::react::SurfaceDelegate>, std::__ndk1::shared_ptr<facebook::react::NativeAnimatedNodesManagerProvider>, std::__ndk1::function<void (facebook::jsi::Runtime&)>))
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
The change here makes it explicit and mandatory to set the specific implementations of these interfaces

Reviewed By: lenaic

Differential Revision: D78529932

fbshipit-source-id: f26876683433a58e078d6720f169702c563ed92b
2025-07-20 23:08:03 -07:00
Vitali ZaidmanandFacebook GitHub Bot 794df48ad6 re-write console stack trace frame urls to be relative to debugger (#52704)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52704

Stack traces for console calls are passed to the debugger when they are relative to device. (e.g. 10.0.2.2 for Android emulator)

Changelog: [android][fixed] fix stack trace linkifying failing when using Android emulator and other situations where the device and debugger have different bundle urls

Reviewed By: motiz88

Differential Revision: D78553183

fbshipit-source-id: 91d7e7ccc99d12ec7d06f4201237ecf557a46c4f
2025-07-20 22:39:52 -07:00
Alex HuntandFacebook GitHub Bot 6d4ea946f8 Address lint warnings (#52702)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52702

Quick pass over some of the main files in `jsinspector-modern` now that C++ lint warnings have become more prevalent / auto-fixable.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D78490415

fbshipit-source-id: 32debcf5f217e847d326498709d50f695902bb5c
2025-07-20 06:12:31 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 8488eaecea Fix CQS signal modernize-use-using in xplat/js/react-native-github/packages [A] [B] [A] (#52718)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52718

Reviewed By: dtolnay

Differential Revision: D78562730

fbshipit-source-id: 24576557eb7a6ba8e655a92f1e7cfe027f99dac0
2025-07-19 12:46:58 -07:00
Marco WangandFacebook GitHub Bot 690cb00353 Deploy 0.276.0 to xplat (#52720)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52720

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D78605229

fbshipit-source-id: 59ae4a2f316cee8415f6ef2984ca74f906ae0377
2025-07-19 11:08:41 -07:00
Mateo GuzmánandFacebook GitHub Bot 2534aeaddb Migrate Arguments to Kotlin (#52457)
Summary:
Migrate com.facebook.react.bridge.Arguments to Kotlin.

## Changelog:

[Android][Changed] - Migrated com.facebook.react.bridge.Arguments to Kotlin.

Pull Request resolved: https://github.com/facebook/react-native/pull/52457

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D78353290

Pulled By: cortinico

fbshipit-source-id: 3d42b44c00a60d34264cb1093991315f5e3c444e
2025-07-19 06:22:25 -07:00
Christoph PurrerandFacebook GitHub Bot ff85e2f6dd Add NativeCxxModuleExampleTests (#52653)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52653

Changelog: [Internal]

This adds an example of Unit Testing a C++ Turbo Module with Google GTest and also adds necessary and useful utility classes for testings

This is GTEST / C++ version of the same tests added in  https://github.com/facebook/react-native/pull/52477

Reviewed By: alanleedev

Differential Revision: D78250302

fbshipit-source-id: 278655779dd17550be9c579d84cc1f7b6e45230d
2025-07-18 22:46:21 -07:00
Christoph PurrerandFacebook GitHub Bot cb94e71845 Delete old location of CallbackWrapper / LongLivedObject (#52649)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52649

Changelog: [Internal]

RN-Windows has been updated > https://github.com/microsoft/react-native-windows/pull/14839

Reviewed By: rshest

Differential Revision: D78312252

fbshipit-source-id: 8e5bd561c4624064cef72395c1179cbe28c247f6
2025-07-18 22:01:44 -07:00
Christoph PurrerandFacebook GitHub Bot 087da29604 Add a TestCallInvoker (#52652)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52652

Changelog: [Internal]

This adds a TestCallInvoker, suitable for unit testing

Reviewed By: alanleedev

Differential Revision: D78453676

fbshipit-source-id: d35e604fedc8656a0430956a811b4a7a07c8ee16
2025-07-18 22:01:36 -07:00
Nicola CortiandFacebook GitHub Bot 34fb932f97 Use allVariants() when publishing ReactAndroid (#52719)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52719

This is really a nit. We don't need to list all the variants here,
we can instead use `allVariants()` which we also use for hermes-engine,
to publish every buildVariant from React Android.

Changelog:
[Internal] [Changed] -

Reviewed By: alanleedev

Differential Revision: D78561729

fbshipit-source-id: 35989051ce966ea07caf26a218eb43c1a2bcac2d
2025-07-18 20:09:48 -07:00
Sam ZhouandFacebook GitHub Bot 1ceba3b470 Prepare react-native for prettier v3 (#52717)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52717

Prettier v3 no longer loads plugin implicitly. This diff first configures the hermes-parser plugin explicitly to prepare for v3 rollout.

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D78590158

fbshipit-source-id: dba06f5a823488b72a30ae5b58e37e172f4e736f
2025-07-18 17:51:14 -07:00
Nick GerlemanandFacebook GitHub Bot b3d1d2a0a5 Disable Measure Cache When Also Using Prepared Text Layout (#52714)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52714

If we also have prepared text layout enabled, this cache will fill up with the last 1000 TextInput AttributedString, which isn't very useful. Let's assume we want to get rid of this cache, when we have the prepared layout cache as well.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D78534088

fbshipit-source-id: e9020ebfb7e1210f19e0b31f7423e7a9a90a89d1
2025-07-18 15:19:58 -07:00
Nick GerlemanandFacebook GitHub Bot ea394f6229 Fix incorrect hit testing on text when layout reused (#52692)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52692

D77341994 added a global cache for Facsimile layouts, where we will reuse an existing `android.text.Layout`, and `Spannable`, if one already existed for a same AttributedString, under same layout constraints. An error here, is that we consider a layout reusable, even when shadow views are different, which means there may be different react tags in the underlying AttributedString.

This leaks into the layout itself, and means that if a layout is reused, we can hit test against a stale/incorrect react tag.

The solution to allow reuse here, is to avoid embedding react tag directly into the `android.text.Layout` structure. Instead, we replace references to react tags, with a fragment index, and embed the list of fragment indices in each PreparedLayout. We can hide this "cleverness" within the boundary of `TextLayoutManager`, such that an invalid `PreparedLayout` is never allowed to escape.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D78516079

fbshipit-source-id: 2d9fe9d80f60e6d7e7e40080a0817a08b51c3153
2025-07-18 15:19:58 -07:00
Luna WeiandFacebook GitHub Bot 7ea0ef7a90 Implement windowFocus on ReactVirtualViewExperiment (#52690)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52690

Changelog: [Internal] - Add the window focus experiment to ReactVirtualViewExperimental

Reviewed By: yungsters

Differential Revision: D78502991

fbshipit-source-id: 3e72561835925040e5b240e71734a088908957ed
2025-07-18 14:16:22 -07:00
Luna WeiandFacebook GitHub Bot 36fed563c4 Use experimental VirtualView in FlatListVirtualColumn (#52689)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52689

Changelog: [Internal] - Add support for experimental VirtualView in polyfill

Reviewed By: mdvacca

Differential Revision: D78450011

fbshipit-source-id: cc30394eb1a008cc8c023db2aaf0a6a6ffcd16df
2025-07-18 14:16:22 -07:00
Nicola CortiandFacebook GitHub Bot 391a6b87a0 Rollout preventShadowTreeCommitExhaustionWithLocking in experimental (#52709)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52709

We want to make user for folks in OSS to try
`preventShadowTreeCommitExhaustionWithLocking`. Therefore I'm updating the OSS
release channel for this flag to experimental.

Changelog:
[Internal] [Changed] - Rollout `preventShadowTreeCommitExhaustionWithLocking` in experimental

Reviewed By: rubennorte

Differential Revision: D78558655

fbshipit-source-id: 02a9d216c7b2f8f7bdc1340213f82b70c5692dc7
2025-07-18 10:20:19 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 81c2e798d7 Fix CQS signal readability-braces-around-statements in xplat/js/react-native-github/packages (#52700)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52700

Pull Request resolved: https://github.com/facebook/react-native/pull/52699

Reviewed By: cipolleschi

Differential Revision: D78549834

fbshipit-source-id: a15a9faed579a1e650eabb6e028a48f9307ad22b
2025-07-18 09:30:15 -07:00
Nicola CortiandFacebook GitHub Bot 9f0903780b Bump monorepo packages to 0.82.0-main (#52706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52706

This just prepares the repo for the next branch cut.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D78558445

fbshipit-source-id: 2132d560dad447b3685874438387a519587f8554
2025-07-18 09:23:10 -07:00
generatedunixname89002005287564andFacebook GitHub Bot ae3b793de6 Fix CQS signal modernize-use-using in xplat/js/react-native-github/packages [A] [A] (#52708)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52708

Reviewed By: rshest

Differential Revision: D78538428

fbshipit-source-id: 6195ead0fa36e5fc4632e9a57362508f55969380
2025-07-18 09:01:22 -07:00
generatedunixname1395667395051502andFacebook GitHub Bot 37a0517b3f Update React Native DevTools binaries
Summary:
Automated update of React Native DevTools binaries
bypass-github-export-checks
Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D78413554

fbshipit-source-id: 5b0d64f886db4cf121f4a6761e6a3e7fe1ccceec
2025-07-18 08:54:36 -07:00
generatedunixname89002005287564andFacebook GitHub Bot e186f1bf17 Fix CQS signal modernize-use-using in xplat/js/react-native-github/packages [B] (#52693)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52693

Reviewed By: dtolnay

Differential Revision: D78494711

fbshipit-source-id: 870e300b29e41aec488926cdf416f246de96514d
2025-07-18 08:28:34 -07:00
Nicola CortiandFacebook GitHub Bot eb2461c7c9 Create a debugOptimized buildType for Android (#52648)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52648

This creates a `debugOptimized` build type for React Native Android, meaning that we can run C++ optimization on the debug build, while still having the debugger enabled. This is aimed at improving the developer experience for folks developing on low-end devices or emulators.

Users that intend to debug can still use the `debug` variant where the full debug symbols are shipped.

Changelog:

[ANDROID] [ADDED] - Create a debugOptimized buildType for Android

Reviewed By: cipolleschi

Differential Revision: D78425138

fbshipit-source-id: c1e9ea3608e7df10fb871a5584352f0747cf560b
2025-07-18 08:07:54 -07:00
Nicola CortiandFacebook GitHub Bot d89acc1596 Migrate helloworld to use {usesCleartextTraffic} manifest placeholder (#52647)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52647

This removes the need to specify 2 Manifests for apps and we can just use the `main` manifes to toggle if `usesCleartextTraffic` should be enabled or not.

This will have to be replicated in the template repository.

Changelog:
[Android] [Added] - Add support to specify a single Manifest rather than 2 (main/debug) by using the `usesCleartextTraffic` manifest placeholder which is autoconfigured by RNGP.

Reviewed By: cipolleschi

Differential Revision: D78425139

fbshipit-source-id: 9173a014b387d5aed5f7087fa69b7bd49c220f2c
2025-07-18 08:07:54 -07:00
Nicola CortiandFacebook GitHub Bot 5e3edafec6 Migrate RNTester to use {usesCleartextTraffic} Manifest Placeholder (#52620)
Summary:
This creates a `debugOptimized` build type for React Native Android, meaning that we can run C++ optimization on the debug build, while still having the debugger enabled. This is aimed at improving the developer experience for folks developing on low-end devices or emulators.

Users that intend to debug can still use the `debug` variant where the full debug symbols are shipped.

## Changelog:

[ANDROID] [ADDED] - Create a debugOptimized buildType for Android

Pull Request resolved: https://github.com/facebook/react-native/pull/52620

Test Plan:
Tested locally with RNTester by doing:

```
./gradlew installDebugOptimized
```

This is the output of the 3 generated .aar. The size difference is a proof that we're correctly stripping out the C++ debug symbols:

<img width="193" height="54" alt="Screenshot 2025-07-15 at 17 49 50" src="https://github.com/user-attachments/assets/584a0e8d-2d17-40d4-ac29-da09049d6554" />
<img width="235" height="51" alt="Screenshot 2025-07-15 at 17 49 39" src="https://github.com/user-attachments/assets/eda8f9e7-3509-4334-8c16-990e55caa04d" />
<img width="184" height="52" alt="Screenshot 2025-07-15 at 17 49 32" src="https://github.com/user-attachments/assets/a5c94385-bc00-4484-b43e-088ee039827f" />

Rollback Plan:

Reviewed By: cipolleschi

Differential Revision: D78351347

Pulled By: cortinico

fbshipit-source-id: 568a484ba8d2ee6e089cabc95451938e853fbc54
2025-07-18 08:07:54 -07:00
Jakub PiaseckiandFacebook GitHub Bot 5cda3065ce Update font scale on Android when recreating RootView (#52595)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52595

Changelog: [ANDROID][FIXED] Update font scale when recreating `RootView`

At the moment `enableFontScaleChangesUpdatingLayout` flag only works when the activity is configured to handle font scale changes by itself (`configChanges="fontScale"` in the manifest).

When that configuration is missing, the OS handles the font scale changes by recreating the activity, but in this case the path responsible for updating internally kept font size isn't executed.

This diff updates the RootView, so that the display metrics are also updated when it's created. Alternative approach would be to do that on the Activity, but that assumes usage of `ReactActivity`.

Reviewed By: NickGerleman

Differential Revision: D78323174

fbshipit-source-id: e48583091767497b5dfd4f2d938329530de4068d
2025-07-18 06:50:29 -07:00
Rubén NorteandFacebook GitHub Bot 532b415960 Throw an error when using an unrecognized @fantom_ prefixed pragma (#52701)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52701

Changelog: [internal]

This adds validation for Fantom test file pragmas to avoid ignoring configurations accidentally when introducing typos.

Reviewed By: rshest

Differential Revision: D78550866

fbshipit-source-id: 7123bfb39573adbb1adf417c232cf7d4cae4cd25
2025-07-18 04:19:28 -07:00
Rubén NorteandFacebook GitHub Bot adef486333 Assume NativePerformance will be available if the Performance module is loaded (#52671)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52671

Changelog: [internal]

When setting up the global `performance` value, we check if the native module exists to decide what version to setup: the legacy "barebones" version or the modern version that's mostly spec compliant.

As we do that check and we shouldn't be requiring the module from anywhere else, it should be safe to always assume the module will be defined if we load the `Performance` class, so we can avoid checks in all methods.

NOTE: I've kept some checks for a few methods that are still not fully propagated (new methods like `reportMark`, `reportMeasure` and `getMarkTime`).

This improves performance slightly for `performance` methods:

* Before

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '1803.32 ± 0.71%'    | '1763.00'           | '563849 ± 0.01%'           | '567215'                  | 554908  |
| 1       | 'mark (with custom startTime)'                            | '1762.39 ± 1.67%'    | '1692.00'           | '587832 ± 0.01%'           | '591017'                  | 567414  |
| 2       | 'measure (default)'                                       | '1879.47 ± 1.44%'    | '1813.00'           | '548962 ± 0.01%'           | '551572'                  | 532064  |
| 3       | 'measure (with start and end timestamps)'                 | '1916.65 ± 0.84%'    | '1873.00'           | '531258 ± 0.01%'           | '533903'                  | 521743  |
| 4       | 'measure (with mark names)'                               | '2049.84 ± 0.44%'    | '2013.00'           | '492799 ± 0.01%'           | '496771'                  | 487844  |
| 5       | 'clearMarks'                                              | '719.87 ± 0.04%'     | '711.00'            | '1403602 ± 0.01%'          | '1406470'                 | 1389136 |
| 6       | 'clearMeasures'                                           | '710.04 ± 0.04%'     | '701.00'            | '1421610 ± 0.01%'          | '1426534'                 | 1408373 |
| 7       | 'mark + clearMarks'                                       | '2256.56 ± 1.10%'    | '2143.00'           | '460721 ± 0.02%'           | '466636'                  | 443152  |
| 8       | 'measure + clearMeasures (with start and end timestamps)' | '2345.44 ± 1.11%'    | '2244.00'           | '442395 ± 0.02%'           | '445633'                  | 426360  |
| 9       | 'measure + clearMeasures (with mark names)'               | '2349.55 ± 0.61%'    | '2283.00'           | '434370 ± 0.02%'           | '438020'                  | 425613  |

* After

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '1791.47 ± 1.08%'    | '1732.00'           | '573787 ± 0.01%'           | '577367'                  | 558202  |
| 1       | 'mark (with custom startTime)'                            | '1699.41 ± 1.27%'    | '1642.00'           | '605188 ± 0.01%'           | '609013'                  | 588441  |
| 2       | 'measure (default)'                                       | '1820.92 ± 1.39%'    | '1763.00'           | '563437 ± 0.01%'           | '567215'                  | 549173  |
| 3       | 'measure (with start and end timestamps)'                 | '1923.57 ± 1.65%'    | '1852.00'           | '537112 ± 0.01%'           | '539957'                  | 519867  |
| 4       | 'measure (with mark names)'                               | '2036.09 ± 1.05%'    | '1983.00'           | '500406 ± 0.01%'           | '504286'                  | 491139  |
| 5       | 'clearMarks'                                              | '657.49 ± 0.07%'     | '641.00'            | '1543793 ± 0.01%'          | '1560062'                 | 1520939 |
| 6       | 'clearMeasures'                                           | '669.02 ± 0.09%'     | '651.00'            | '1520386 ± 0.01%'          | '1536098'                 | 1494730 |
| 7       | 'mark + clearMarks'                                       | '2213.09 ± 1.53%'    | '2103.00'           | '470008 ± 0.02%'           | '475511'                  | 451858  |
| 8       | 'measure + clearMeasures (with start and end timestamps)' | '2353.15 ± 1.27%'    | '2214.00'           | '448563 ± 0.02%'           | '451671'                  | 424962  |
| 9       | 'measure + clearMeasures (with mark names)'               | '2298.28 ± 0.62%'    | '2243.00'           | '441703 ± 0.02%'           | '445831'                  | 435108  |

Reviewed By: hoxyq

Differential Revision: D78412931

fbshipit-source-id: 07390722bb00a51847cb5625b2adb4e26f89e5d2
2025-07-18 03:44:21 -07:00
Rubén NorteandFacebook GitHub Bot c9367a8d86 Remove optionality for stable methods of the NativePerformance module (#52668)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52668

Changelog: [internal]

These methods have been available for months so no need to consider backwards compatibility with older binaries.

Reviewed By: huntie

Differential Revision: D78412932

fbshipit-source-id: 0f1d541c36c98a4cc8c847d1ee7a08a9d0f4b849
2025-07-18 03:44:21 -07:00
Alex HuntandFacebook GitHub Bot e247be793c Lower minimum Node.js version to 20.19.4 (#52678)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52678

From partner feedback, there's still appetite to support Node 20.x for the next <1y of life. Lower min version to `20.19.4` (Jul 2025) and widen test matrix in CI.

Changelog:
[General][Breaking] - Our new minimum Node version is Node.js 20 (Overrides #51840)

Reviewed By: cortinico

Differential Revision: D78494491

fbshipit-source-id: c8d9dc6250cb11f8a12ca7e761b65f4a8dae9265
2025-07-18 03:32:13 -07:00
Nick GerlemanandFacebook GitHub Bot 3f9b19eb89 Fix build_android GHA Job (#52694)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52694

build_android job is always failing, with this assertion. Seems like find/replace in D78484060 gone wrong?

Changelog: [Internal]

Reviewed By: sbuggay

Differential Revision: D78534334

fbshipit-source-id: 291bdd01b41fa6efea00ed63a0dee8bdb14cbc3a
2025-07-17 20:42:02 -07:00
Ramanpreet NaraandFacebook GitHub Bot 862e8c7049 IntersectionObserver: Clean up legacy observe/unobserve methods
Summary:
In this diff, we migrated IntersectionObserver to tokens: D74262804.

So that we wouldn't have to store shadow nodes on the javascript side.

Storing shadow nodes lead to a memory leak in the past.

Changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D78494075

fbshipit-source-id: 38923ca4b265de6ff81ea20e5649e0bd2e39afc9
2025-07-17 17:35:22 -07:00
Sam ZhouandFacebook GitHub Bot 23c8787fe2 Add annotations to fix future errors after fix for unsound array types (#52691)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52691

Unannotated array literals are unsound in Flow right now. This diff adds in annotations and makes a few things readonly, to reduce future errors.

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D78519638

fbshipit-source-id: d98a7668ecf97bcc87dcb3fad25ade736d885d9a
2025-07-17 17:30:43 -07:00
Tim YungandFacebook GitHub Bot d78c242e4d RN: Enable enableVirtualViewRenderState by Default (#52686)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52686

Enables the `enableVirtualViewRenderState` feature flag by default.

Also, fixed classification for this and the `enableVirtualViewWindowFocusDetection` feature flags. (They were incorrect.)

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D78500846

fbshipit-source-id: 099adaa4ed0026c8bb7438df869564d76a999007
2025-07-17 12:59:13 -07:00
Tim YungandFacebook GitHub Bot 5d4d1ce84b RN: Cleanup scheduleAnimatedCleanupInMicrotask Flag (#52685)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52685

Cleans up the `scheduleAnimatedCleanupInMicrotask ` feature flag and deletes code paths that are now unreachable.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D78498600

fbshipit-source-id: 307562030373742e64968ae4c92d6bfbb48ddc71
2025-07-17 12:59:13 -07:00
Tim YungandFacebook GitHub Bot 5c7fdb252e RN: Cleanup disableInteractionManager Flag (#52684)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52684

Cleans up the `disableInteractionManager` feature flag and deletes code paths that are now unreachable.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D78498348

fbshipit-source-id: a3128c1e5ca9c5879080df54b7683a3c916cec13
2025-07-17 12:59:13 -07:00
Tim YungandFacebook GitHub Bot 1814418f12 RN: Cleanup avoidStateUpdateInAnimatedPropsMemo Flag (#52683)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52683

Cleans up the `avoidStateUpdateInAnimatedPropsMemo` feature flag and deletes code paths that are now unreachable.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D78497862

fbshipit-source-id: 26406e713ca5b7b194159638a20dcfca877ba380
2025-07-17 12:59:13 -07:00
Tim YungandFacebook GitHub Bot 0a3808d07c RN: Cleanup alwaysFlattenAnimatedStyles Flag (#52682)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52682

Cleans up the `alwaysFlattenAnimatedStyles` feature flag.

This was already unused starting with {D77314904}.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D78497554

fbshipit-source-id: 8bfbe6485812a675cdf3e78612347457f45ada90
2025-07-17 12:59:13 -07:00
Tim YungandFacebook GitHub Bot 0508eddfe6 RN: Default Hermes Parser to reactRuntimeTarget: "19" (#52625)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52625

Changes `react-native/babel-preset` so that by default, `hermes-parser` is configured with `reactRuntimeTarget: "19"`. This changes the compiled output of Component Syntax to not use `forwardRef` when a `ref` prop is present.

Additionally, this adds a new preset option property, `hermesParserOptions`. This object allows users of `react-native/babel-preset` to supply overrides for any `hermes-parser` options.

Changelog:
[General][Changed] - Configures `react-native/babel-preset` to target React 19 by default, meaning Component Syntax will not compile to `forwardRef` calls when a `ref` prop is present.
[General][Added] - Added support to `react-native/babel-preset` for a `hermesParserOptions` option, that expects an object that enables overriding `hermes-parser` options.

Reviewed By: SamChou19815

Differential Revision: D78383269

fbshipit-source-id: 1e6b66b9bfbeaf8a06fdc39031cb6de7e921765f
2025-07-17 12:53:36 -07:00
Rubén NorteandFacebook GitHub Bot 25c61123fb Fix incorrect locking and attempts check in ShadowTree experiment (#52681)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52681

Changelog: [internal]

In the original change I made in D78418504 / https://github.com/facebook/react-native/pull/52645 I made 2 mistakes:
1. Used a lock that would try to re-lock on itself without it being recursive (which would cause a deadlock). I didn't see that because when testing I didn't hit the case where we'd exhaust the options.
2. The `attemps` variable wasn't incremented, so we never left the loop in case of exhaustion.

This propagates a flag to `tryCommit` to indicate we've already locked on the commitMutex_ so we don't need to lock again in that case and increases the counter, fixing the issue.

Reviewed By: cortinico

Differential Revision: D78497509

fbshipit-source-id: 546ccd0c84aed5416ce1aef47d79419b4fe06f66
2025-07-17 12:18:52 -07:00
Rubén NorteandFacebook GitHub Bot 9b30fe0c45 Back out "Add missing attempts++ in ShadowNode with MAX_COMMIT_ATTEMPTS_BEFORE_LOCKING" (#52680)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52680

Changelog: [internal]

Reverting to make the fix easier to pick. Will land again on top.

Original commit changeset: 91d7f5d88a90

Original Phabricator Diff: D78487202

Reviewed By: cortinico

Differential Revision: D78497511

fbshipit-source-id: 58379787786cadcbcbe354feb97bc400a24f9d58
2025-07-17 12:18:52 -07:00
Rubén NorteandFacebook GitHub Bot fef6e0f584 Back out "Fix incorrect locking in ShadowTree experiment" (#52679)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52679

Changelog: [internal]

Reverting to make the fix easier to pick. Will land again on top.

Original commit changeset: c18e967488de

Original Phabricator Diff: D78480136

Reviewed By: cortinico

Differential Revision: D78497510

fbshipit-source-id: 8037276cb70d27ff695c76cd9575b525568c4489
2025-07-17 12:18:52 -07:00
Luna WeiandFacebook GitHub Bot 4c9591c0ea Use experimental VirtualView (#52592)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52592

Changelog: [Internal] - Expose VirtualViewExperimental in JS, use in a test surface

Reviewed By: yungsters

Differential Revision: D78027899

fbshipit-source-id: d3d9808b8ba8e36c5fdb0c831c0855ed318d0a30
2025-07-17 12:15:57 -07:00
Luna WeiandFacebook GitHub Bot 937eac64e8 Move off of ReactScrollViewHelper.ScrollListener (#52591)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52591

Changelog: [Internal] Stop using ReactScrollViewHelper.ScrollListener for layout, scroll events from ScrollView

Reviewed By: yungsters

Differential Revision: D78287689

fbshipit-source-id: 3fe944d90e0165d10953a603e5694ac7bbaeb9b8
2025-07-17 12:15:57 -07:00
Luna WeiandFacebook GitHub Bot 510bfd4101 Fix VirtualViewExperimental (#52590)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52590

Changelog: [Internal] - Fix a couple of bugs with VirtualViewExperimental

1. `also` side-effect bug where we were accessing `scrollView` before it was assigned
2. Handling empty `rect`. Now, we don't add the virtualView until it has a non-empty rect layout

Reviewed By: yungsters

Differential Revision: D78287690

fbshipit-source-id: 1806b748a0117e51c7a201191396d79db3a8d205
2025-07-17 12:15:57 -07:00
Nicola CortiandFacebook GitHub Bot 847721dc9b Add missing attempts++ in ShadowNode with MAX_COMMIT_ATTEMPTS_BEFORE_LOCKING (#52673)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52673

We should be incrementing the `attempts` variable as otherwise this loop with never stop.

Created from CodeHub with https://fburl.com/edit-in-codehub

Changelog:
[Internal] -

Reviewed By: rubennorte

Differential Revision: D78487202

fbshipit-source-id: 91d7f5d88a90bdfa806195fd35897f2f51c1deb9
2025-07-17 09:02:19 -07:00
Rubén NorteandFacebook GitHub Bot 2a01eadcb8 Remove unnecessary $FlowFixMe after correct typing for console.timeStamp (#52633)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52633

Changelog: [internal]

Now that we have the correct type definition for `console.timeStamp` we can remove the unnecessary `$FlowFixMe` annotations we had to add to use the new arguments.

Reviewed By: hoxyq

Differential Revision: D78405312

fbshipit-source-id: 29378ee6fa5986e22d0dfdfb85b7e25375361dc9
2025-07-17 08:35:36 -07:00
Rubén NorteandFacebook GitHub Bot c247554342 Add correct typing for console (including console.timeStamp) (#52632)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52632

Changelog: [internal]

This improves the type definitions for methods in the global `console` object, most importantly:
- Removes use of `any`.
- Defines correct typing for `console.timeStamp`, including new parameters for the Chrome Extensibility API.

Reviewed By: hoxyq

Differential Revision: D78405314

fbshipit-source-id: 6f31cc3005ff708ef6aa155bcd150d53a845e66c
2025-07-17 08:35:36 -07:00
Rubén NorteandFacebook GitHub Bot 10ddec7aeb Add stubs for missing console methods (#52643)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52643

Changelog: [internal]

Defines stubs for the following `console` methods:
* `time`
* `timeEnd`
* `count`
* `countReset`

Reviewed By: huntie

Differential Revision: D78418212

fbshipit-source-id: 8063f240f1e3fcfb3e36a2b43e61ca0e8cdf94db
2025-07-17 08:35:36 -07:00
Rubén NorteandFacebook GitHub Bot b9e1e37c87 Define typing for performance extensibility API (#52631)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52631

Changelog: [internal]

Just a small improvement in the type definitions to serve as documentation for the expected arguments for custom tracks in RNDT.

Reviewed By: hoxyq

Differential Revision: D78405313

fbshipit-source-id: 75d250ea27f2e55e172aaf6e72399b85cecd43f4
2025-07-17 08:35:36 -07:00
Krystof WoldrichandFacebook GitHub Bot c4082c9ce2 surface uncaught promise rejections with ExceptionsManager.handleException instead of swallowing them (#51594)
Summary:
This PR fixes logging of rejections, which stopped working with the transition from using `LogBox` for warnings to directing users to use React Native Debugger, where warnings can be viewed in the `Console` tab.

Rejected promises before this PR used `LogBox.addLog` with the `level: warn` directly without `console.warn`, which notified users to open debugger to view a warning (after rejected promise) without actually printing any warnings to the console.

This PR uses `ExceptionsManager.handleException(error, false /* isFatal */);` for promise rejections that correctly raising an error to the console if needed.

### Rejected Promise in Chrome
Displaying the error as long as it's uncaught in the form:
`Uncaught (in promise) Error`
and if there's a message in that error:
`Uncaught (in promise) Error: ${message}`
once the error is handled, this error disappears:
{F1978806409}
This is done with `Runtime.exceptionThrown`, and  `Runtime.exceptionRevoked`:
{F1979815326}

## Changelog:
[General][Breaking] unhandled promises are now handled by ExceptionsManager.handleException, instead of being swallowed as Logbox Warnings.
----
This is a breaking change because we changed the wording for these errors and because some systems (like Sentry) might start monitoring a new set of errors when this code is adopted.

Pull Request resolved: https://github.com/facebook/react-native/pull/51594

Test Plan:
Use `Promise.reject` and observe that the rejection is now shown symbolicated in LogBox and also printed in React Native Debugger Console.

```
<Button
  title="Uncaught Promise Rejection"
  onPress={() => {
    const err = new Error('test error');
    err.cause = new Error('cause');
    const promise = Promise.resolve().then(() => {
      throw err;
      // also test with throwing a string / object:
      // throw 'aa';
      // throw {test: 'object'};
      // return Promise.reject();
    });

    setTimeout(() => {
      promise.catch(e => {
        console.log('promise error caught', e);
      });
    }, 4000);
  }}
/>
```

### Before
There's no indication whatsoever there's an uncaught promise.

### After
An error is logged:
Error-
{F1979749366}
Text-
{F1979749350}
Object-
{F1979749351}
Promise.reject() or undefined-
 {F1979749826}

Reviewed By: hoxyq

Differential Revision: D75442651

Pulled By: vzaidman

fbshipit-source-id: bf6c56e643f03997f5a604b85c543aad62648a29
2025-07-17 07:55:50 -07:00
Christian FalchandFacebook GitHub Bot 4ee2b60a1e resolve xcframework paths from conf switch script (#52664)
Summary:
When switching between debug/release we run a small script to make sure to copy the correct version of the RNDeps xcframework.

This script was missing a resolve function that fixed up some path issues that we do when installing in the podspec.

## Changelog:

[IOS] [FIXED] - Fixed issue with RNDeps release/debug switch failing

Pull Request resolved: https://github.com/facebook/react-native/pull/52664

Test Plan:
- Create new RN App
- Install pod with prebuilt deps
- Build (success)
- Switch to release
- Build (success)

Reviewed By: cortinico

Differential Revision: D78481590

Pulled By: cipolleschi

fbshipit-source-id: 2d02b0bc55e8aef6f3fafb4f7aa193c4cf00414e
2025-07-17 06:46:00 -07:00
Rubén NorteandFacebook GitHub Bot 2d4c43c267 Fix incorrect locking in ShadowTree experiment (#52662)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52662

Changelog: [internal]

In the original change I made in D78418504 / https://github.com/facebook/react-native/pull/52645 I made a mistake and used a lock that would try to re-lock on itself without it being recursive (which would cause a deadlock). I didn't see that because when testing I didn't hit the case where we'd exhaust the options.

This propagates a flag to `tryCommit` to indicate we've already locked on the `commitMutex_` so we don't need to lock again in that case, fixing the issue.

Reviewed By: sammy-SC

Differential Revision: D78480136

fbshipit-source-id: c18e967488de14e73e6abf6f6e82c16bc42a12c6
2025-07-17 05:37:07 -07:00
Christian FalchandFacebook GitHub Bot 2e55241a90 added missing script in package.json (#52663)
Summary:
When switching between release/debug we're running a script to copy the correct xcframework. This script for the React-Core prebuilts was not part of the package.json file.

This caused the build to fail after trying to switch from debug -> release.

## Changelog:
[IOS] [FIXED] - Fixed missing script for resolving prebuilt xcframework when switching between release/debug

Pull Request resolved: https://github.com/facebook/react-native/pull/52663

Test Plan:
- Create new RN App
- Install pod with prebuilt deps and core
- Build (success)
- Switch to release
- Build (success)

Reviewed By: cortinico

Differential Revision: D78481302

Pulled By: cipolleschi

fbshipit-source-id: 1c7181e63219098ae140d77ff1cb2c0c9b9642e5
2025-07-17 05:26:07 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 2c752af535 Fix Windows CI (#52666)
Summary:
As per [this issue](https://github.com/actions/runner-images/issues/12416), Windows machine doesn't have access to D: drive anymore

## Changelog:
[Internal] -

Pull Request resolved: https://github.com/facebook/react-native/pull/52666

Test Plan: GHA

Reviewed By: huntie

Differential Revision: D78484060

Pulled By: cipolleschi

fbshipit-source-id: 36d844f9d7d69f1d74a154b019307cc1e269ad66
2025-07-17 05:15:04 -07:00
Pieter De BaetsandFacebook GitHub Bot b6f4142bb2 Reduce legacy arch warning for OnLayoutEvent (#52665)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52665

This API is being used by react-native-svg (https://github.com/software-mansion/react-native-svg/blob/main/android/src/main/java/com/horcrux/svg/VirtualView.java#L606) which is causing issues when enabling legacy arch minification.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D78478751

fbshipit-source-id: 7f48368c11ec855bbeb5e904628b082a5bc741ff
2025-07-17 04:39:41 -07:00
Nicola CortiandFacebook GitHub Bot 2f553ec7f6 Unbreak build_android due to missing dependency on rrc_view (#52661)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52661

The CI is currently red on main due to a missing dependency on `rrc_view`
from the recent TransformHelper.cpp addition.
This fixes it.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D78479785

fbshipit-source-id: 3d2b698d9ce46cf22c15ad43005f621526590145
2025-07-17 04:09:25 -07:00
Nicola CortiandFacebook GitHub Bot 7ef57163cb Make accessors inside HeadlessJsTaskService open again (#52660)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52660

The documentation for those methods mention that users should override them to
provide their own implementation.

However those vals are not `open` so users cannot really override them.
This fixes it.

See more context on https://github.com/facebook/react-native/pull/48800#issuecomment-3082665024

So this was practically a breaking change, that I'm attempting to mitigate.

Changelog:
[Android] [Fixed] - Make accessors inside HeadlessJsTaskService open again

Reviewed By: cipolleschi

Differential Revision: D78479162

fbshipit-source-id: eefc7332e2004198cd6bd64b60a66215f137ad4a
2025-07-17 04:05:47 -07:00
Moti ZilbermanandFacebook GitHub Bot bbda71f2c8 Fix argv handling for packaged mode (#52641)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52641

Changelog: [Internal]

TSIA, missed this in D77591742

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D78413090

fbshipit-source-id: a02d604def172b531a89021496208171373ddd8c
2025-07-17 03:13:26 -07:00
Moti ZilbermanandFacebook GitHub Bot 60efc757d9 Implement --version flag
Summary:
Changelog: [Internal]

Adds a basic `--version` command line flag to the RNDT shell. This will be used in code paths (including tests) that need to verify that the shell is executable, but do not need to actually display a window or hand over control to the main shell instance.

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D78351936

fbshipit-source-id: e8982cfea6435da0ac9ea5f50d57c7642a8e2edb
2025-07-17 03:13:26 -07:00
Moti ZilbermanandFacebook GitHub Bot 4a1884e5e5 Exclude unimportant files from Electron build
Summary:
TSIA

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D78351935

fbshipit-source-id: 7f71f3df3ecf8ce92891109b8d9f8e0a74361f21
2025-07-17 03:13:26 -07:00
David VaccaandFacebook GitHub Bot 20baf2a992 Delete ReactNativeNewArchitectureFeatureFlags.isNewArchitectureStrictModeEnabled() (#52650)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52650

ReactNativeNewArchitectureFeatureFlags.isNewArchitectureStrictModeEnabled() is unused, let's delete it

changelog: [internal] internal

Reviewed By: arushikesarwani94

Differential Revision: D78438409

fbshipit-source-id: 8208ae0d3f59e6a3197643e4a7610db3116eb1c6
2025-07-16 18:06:29 -07:00
Rubén NorteandFacebook GitHub Bot 21cd09d4c0 Implement mechanism to prevent ShadowTree commit exhaustion (#52645)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52645

Changelog: [internal]

This add a new feature flag to test a fix for https://github.com/facebook/react-native/issues/51870

Reviewed By: cortinico, sammy-SC

Differential Revision: D78418504

fbshipit-source-id: 2792026b6936393d196fd1e3162f8b2c61a38ed6
2025-07-16 12:02:07 -07:00
Joe VilchesandFacebook GitHub Bot d00de31aef Use setter for accessibilityElements (#52644)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52644

There have been some hard to find crashes with iOS outlined in https://fb.workplace.com/groups/3615245781855602/permalink/23898365966450285/. Talking with lenaic this may be due to us not using the setter to set this property. Let's try that

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D78413954

fbshipit-source-id: a68b90a2276805283082ceaf1020e13bd8ef8eb6
2025-07-16 10:56:28 -07:00
generatedunixname89002005287564andFacebook GitHub Bot de67d6ec67 Fix CQS signal modernize-use-using in xplat/js/react-native-github/packages (#52629)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52629

Reviewed By: javache

Differential Revision: D78404030

fbshipit-source-id: 553a9f26327c4b3439b773981c25b5e1d469d8f1
2025-07-16 10:23:13 -07:00
Nicola CortiandFacebook GitHub Bot 88bafeddab Add TransformHelper.cpp to reactnativejni_common (#52640)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52640

Not having `TransformHelper.cpp` included in CMake is causing the C++ code to fail compiling.
This diff fixes it.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi, javache

Differential Revision: D78414015

fbshipit-source-id: 4900427a86eb38bfec10e5e385296d89c73e9051
2025-07-16 09:52:04 -07:00
Mathieu ActhernoeneandFacebook GitHub Bot 86994a6e22 Fix Dimensions window values on Android < 15 (#52481)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52481

This PR (initially created for edge-to-edge opt-in support, rebased multiple times) fixes the `Dimensions` API `window` values on Android < 15, when edge-to-edge is enabled.

Currently the window height doesn't include the status and navigation bar heights (but it does on Android >= 15):

<img width="300" alt="Screenshot 2025-06-27 at 16 23 02" src="https://github.com/user-attachments/assets/c7d11334-9298-4f7f-a75c-590df8cc2d8a" />

Using `WindowMetricsCalculator` from AndroidX:

<img width="300" alt="Screenshot 2025-06-27 at 16 34 01" src="https://github.com/user-attachments/assets/7a4e3dc7-a83b-421b-8f6d-fd1344f5fe81" />

Fixes https://github.com/facebook/react-native/issues/47080

## Changelog:

[Android] [Fixed] Fix `Dimensions` `window` values on Android < 15 when edge-to-edge is enabled

Pull Request resolved: https://github.com/facebook/react-native/pull/47554

Test Plan:
Run the example app on an Android < 15 device.

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D77906644

Pulled By: alanleedev

fbshipit-source-id: 121cd6bc4133973f06b28eb9e79c9387ac7070a1
2025-07-16 09:15:43 -07:00
Fabrizio CucciandFacebook GitHub Bot b795d61592 Add skipActivityIdentityAssertionOnHostPause feature flag (#52639)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52639

Add feature flag in the attempt to address the pile of tasks reporting the following error in panelapps:

> Error: android_crash:java.lang.AssertionError:com.facebook.react.runtime.ReactHostImpl.onHostPause

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D78339196

fbshipit-source-id: 9ef748e7ea85f179d8f8c418a978bd5c99f70601
2025-07-16 08:42:41 -07:00
Samuel SuslaandFacebook GitHub Bot 0fd060f558 disable view culling when accessibility API is detected (#52612)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52612

changelog: [internal]

View Culling is purely performance optimisation but it must work correctly with accessibility features like VoiceOver and Switch Control.
In this diff, View Culling is lazily disabled whenever use of an accessibility feature is detected to make sure all views are present in the view hierarchy.

Reviewed By: NickGerleman, philIip

Differential Revision: D78336010

fbshipit-source-id: 7a201afc8e2ffd8b586d75ed4de2c03d7966750c
2025-07-16 08:16:49 -07:00
Samuel SuslaandFacebook GitHub Bot 9967908e89 introduce UpdateMode::unstable_Immediate (#52604)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52604

changelog: [internal]

For Fabric View Culling to work correctly, content offset changes must be applied synchronously to avoid UI flicker.

The flicker happens because content offset update happens asynchronously and the OS paints scroll position update before React Native has a chance to adjust view hierarchy for the new scroll position.

Reviewed By: lenaic

Differential Revision: D78334322

fbshipit-source-id: dc1f1b3f9db9f9547e5a588dc184fcf21cca2727
2025-07-16 08:16:49 -07:00
Pieter De BaetsandFacebook GitHub Bot a9ece0c302 Use native helpers to accelerate transform processing (#52603)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52603

Processing transforms is expensive in Java, as it requires bridging the entire ReadableNativeArray/Map. Instead, we can use the existing parser logic `resolveTransform` logic to perform this operation in C++.

Ideally, we actually re-use the existing parsed transform from Props, that could be something we revisit after Props 2.0.

As a follow-up, we should consider also moving the matrix decomposition logic from MatrixMathHelper here, and make that the only information we send back to Java.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D78298588

fbshipit-source-id: a698ac8587ccfb2be04665747082398ccdde9294
2025-07-16 06:29:10 -07:00
Pieter De BaetsandFacebook GitHub Bot 5d3d23b32e Use native implementation of equals in ReadableNativeArray (#52611)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52611

We compare the current transform (represented as a ReadableArray) with the incoming one to know whether to invalidate. This can be expensive as it requires to materialize the entire transform data structure over JNI. Instead, we can delegate this comparison to native code, which can compare the underlying folly::dynamic directly.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D78340288

fbshipit-source-id: f44a054e234694c316fb080fe2dbc2017780123a
2025-07-16 06:29:10 -07:00
Rubén NorteandFacebook GitHub Bot bd198324d8 Add support for details field and custom tracks in performance.mark and performance.measure for DevTools (#52613)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52613

Changelog: [internal]

This adds first-class support for the `detail` field in `performance.mark` and `performance.measure`.

Now that we have access the JS entry in native, we can access the `detail` field to propagate it to DevTools (and use it to extract track names for Perfetto).

In order to avoid the performance overhead of always having to extract the `detail` field from the entry, this is done lazily only if we're actively profiling with DevTools or Perfetto.

Reviewed By: sbuggay

Differential Revision: D78340911

fbshipit-source-id: 383dd1cb6fcc8a04be9e65038503986f196e23c9
2025-07-16 05:55:03 -07:00
Rubén NorteandFacebook GitHub Bot 2f67285545 Remove support for specifying track names for Perfetto and RNDT using the "Track:" prefix (#52614)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52614

Changelog: [internal]

We're adding first-class support for custom tracks, so we can remove the legacy mechanism to specify tracks with the "Tracks:" prefix in the event names.

Reviewed By: sbuggay

Differential Revision: D78340910

fbshipit-source-id: cbbadd519baf7bb50072cb97d8cd1ccc87a8a35c
2025-07-16 05:55:03 -07:00
Rubén NorteandFacebook GitHub Bot 4edc33e4e1 Refactor implementation of performance.mark and performance.measure (#52586)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52586

Changelog: [internal]

This fixes a "bug" (or spec-compliance issue) in the `performance.measure` method where `end` and `duration` couldn't be used together (only `start` and `duration`, and `start` and `end` could be used).

This also refactors the API to be "JS-first", preparing the native module methods to support passing instances of entries to fix other issues.

Verified performance impact: `mark` is slightly regressed (~7% slower) due to an additional JSI call to get the default start time and `measure` is significantly optimized (25/30% faster) due to simplified parameter handling in JSI calls.

* Before

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '1621.03 ± 1.17%'    | '1562.00'           | '636986 ± 0.01%'           | '640205'                  | 616890  |
| 1       | 'mark (with custom startTime)'                            | '1756.88 ± 1.15%'    | '1693.00'           | '586826 ± 0.01%'           | '590667'                  | 569190  |
| 2       | 'measure (default)'                                       | '2424.66 ± 1.35%'    | '2333.00'           | '426122 ± 0.02%'           | '428633'                  | 412429  |
| 3       | 'measure (with start and end timestamps)'                 | '2679.96 ± 1.23%'    | '2574.00'           | '385266 ± 0.02%'           | '388500'                  | 373140  |
| 4       | 'measure (with mark names)'                               | '2713.49 ± 0.50%'    | '2644.00'           | '375383 ± 0.02%'           | '378215'                  | 368530  |
| 5       | 'clearMarks'                                              | '691.13 ± 0.07%'     | '681.00'            | '1467016 ± 0.01%'          | '1468429'                 | 1446900 |
| 6       | 'clearMeasures'                                           | '706.00 ± 0.05%'     | '691.00'            | '1431489 ± 0.01%'          | '1447178'                 | 1416435 |
| 7       | 'mark + clearMarks'                                       | '2083.21 ± 1.14%'    | '2003.00'           | '497974 ± 0.01%'           | '499251'                  | 480028  |
| 8       | 'measure + clearMeasures (with start and end timestamps)' | '3085.14 ± 0.88%'    | '2974.00'           | '334337 ± 0.02%'           | '336247'                  | 324135  |
| 9       | 'measure + clearMeasures (with mark names)'               | '2949.45 ± 0.62%'    | '2884.00'           | '345335 ± 0.02%'           | '346741'                  | 339046  |

* After

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '1740.06 ± 1.01%'    | '1692.00'           | '587400 ± 0.01%'           | '591017'                  | 574695  |
| 1       | 'mark (with custom startTime)'                            | '1661.64 ± 1.16%'    | '1612.00'           | '617453 ± 0.01%'           | '620347'                  | 601815  |
| 2       | 'measure (default)'                                       | '1808.71 ± 1.28%'    | '1753.00'           | '566516 ± 0.01%'           | '570451'                  | 552882  |
| 3       | 'measure (with start and end timestamps)'                 | '1869.21 ± 1.00%'    | '1823.00'           | '546571 ± 0.01%'           | '548546'                  | 534987  |
| 4       | 'measure (with mark names)'                               | '2016.40 ± 0.74%'    | '1983.00'           | '502987 ± 0.01%'           | '504286'                  | 496075  |
| 5       | 'clearMarks'                                              | '682.18 ± 0.03%'     | '671.00'            | '1476364 ± 0.01%'          | '1490313'                 | 1465899 |
| 6       | 'clearMeasures'                                           | '686.78 ± 0.03%'     | '681.00'            | '1467264 ± 0.01%'          | '1468429'                 | 1456081 |
| 7       | 'mark + clearMarks'                                       | '2148.90 ± 1.28%'    | '2073.00'           | '480925 ± 0.01%'           | '482393'                  | 465356  |
| 8       | 'measure + clearMeasures (with start and end timestamps)' | '2277.26 ± 1.10%'    | '2204.00'           | '451016 ± 0.01%'           | '453721'                  | 439125  |
| 9       | 'measure + clearMeasures (with mark names)'               | '2277.82 ± 0.51%'    | '2243.00'           | '443853 ± 0.01%'           | '445831'                  | 439016  |

Reviewed By: hoxyq

Differential Revision: D78193072

fbshipit-source-id: 03b52927a1999f19a2baf0d02335a959525d7add
2025-07-16 02:48:43 -07:00
Rubén NorteandFacebook GitHub Bot 1b7c9ea523 Add 2 tests demonstrating broken behavior in performance.measure (#52588)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52588

Changelog: [internal]

This adds tests to show how `performance.measure` isn't spec compliant when `end` and `duration` are used. This will be fixed in the following diff.

Reviewed By: javache

Differential Revision: D78193069

fbshipit-source-id: 30ba4874c4d2b4adb20608fc8d5ed61bfd6d92d8
2025-07-16 02:48:43 -07:00
Rubén NorteandFacebook GitHub Bot cb59eb2b57 Reorganize tests for PerformanceObserver and User Timing API (#52587)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52587

Changelog: [internal]

This just re-organizes the tests for the `Performance` API and `PerformanceObserver` as the previous organization didn't make much sense. Now it's a test for `PerformanceObserver` and another for the User Timing API.

Reviewed By: huntie

Differential Revision: D78193070

fbshipit-source-id: f15524bf07d2dc9edc155214279ce3af705cde67
2025-07-16 02:48:43 -07:00
Tim YungandFacebook GitHub Bot 5050d0a89e VirtualView: Fix Window Focus Detection Cleanup (#52621)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52621

In D77261958, I made a typo when implementing the cleanup of window focus detection in `onDetachedFromWindow`. This fixes it.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D78366506

fbshipit-source-id: 2a377cd7e8ec08f0c899dbd9cb3757bec580d30f
2025-07-15 20:03:17 -07:00
Andrew DatsenkoandFacebook GitHub Bot 46f3e32019 Add support for meta only code & oss only code (#52583)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52583
Changelog: [Internal]
OSS build is broken atm as there is rn-tester dep in Fantom, needed for Meta only purposes.
Platformizing code to allow for Meta only implementation here and also for OSS only. Using this approach over ifdef.

Reviewed By: christophpurrer

Differential Revision: D78275698

fbshipit-source-id: c3234bb61b4591c0a5045fdb84aa0316f6382ecc
2025-07-15 14:16:06 -07:00
Samuel SuslaandFacebook GitHub Bot 10bb2241fc delete feature flag enableSynchronousStateUpdates (#52607)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52607

changelog: [internal]

The current design of enableSynchronousStateUpdates is not correct and breaks <Modal /> on Android. let's delete it.

Reviewed By: philIip

Differential Revision: D78332201

fbshipit-source-id: 109909ebc706168372c565e8ff6e0c95d7565b10
2025-07-15 14:09:07 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 6b550a279e Fix E2E test script when the ci flag is not specified (#52617)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52617

The `test-release-local` script was failing to execute the npx rreact-native run-ios command for some issues with cocoapods.
That command tries to reinstall the pods so there might be some issues when testing.

As an alternative, we can avoid duplicated work by dropping the npx react-native command and, instead, build the app with xcodebuild and install it in the simulator with xcrun.

This is a backport of [this PR](https://github.com/facebook/react-native/pull/52609)

## Changelog:
[Internal] -

Reviewed By: vzaidman

Differential Revision: D78344397

fbshipit-source-id: cf2d9c032966a9be05670259e9532789829349f2
2025-07-15 12:04:20 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 339dc4979c Update atrifact names to the new ones (#52618)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52618

In 0.81 we dropped the JSC configuration in CI. That means that the artifacts we generate in CI have a slightly different name. The current e2e script failed to run with the ci flag because it was still using the old artifacts name and it was not finding them.

This change adress the problem by:

- using the right artifact names
- removing the --hermes parameter which controlled the Hermes vs JSC scenario.

It is also a port to main of [this PR](https://github.com/facebook/react-native/pull/52606)

## Changelog:
[Internal] -

Reviewed By: cortinico, vzaidman

Differential Revision: D78344244

fbshipit-source-id: a658ba161b867bbad773fe093df9679ea92579b3
2025-07-15 12:04:20 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 21b93d8d7d Fix RefreshControl recycling (#52584)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52584

The method `_initializeUIRefreshControl` creates a new instance of `UIRefreshControl` which has the default values for things like tint color.
However the props that we are keeping in the component are the `_props` before recycling. The actual state of the newly created UIRefreshControl is out of sync w.r.t the props the component thinks to have.

By introducing a `_recycled` state variable, we can force the first `updateProp` call to apply all the props to the newly created component.

## Changelog:
[iOS][Fixed] - Make sure that the recycled refresh control have the right props setup.

Reviewed By: sammy-SC

Differential Revision: D78278207

fbshipit-source-id: 4be20aa43f96eb87828b44a4deedd33a23d1d17f
2025-07-15 10:47:34 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 09daad27ea fix RefreshControl not refreshing on initial mount (#52615)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52615

The refresh control has some issues that this change addresses.

- Issue with zIndex not propagating to RefreshControl.
- Issue when RefreshControl being mounted as refreshing.
- Issue with color props not applied

## Changelog:
[iOS][Fixed] - Correctly propagate props to RefreshControl

Reviewed By: sammy-SC

Differential Revision: D76668478

fbshipit-source-id: c3a5ff04b1b2654d25c9053973c5cff0002a804a
2025-07-15 10:47:34 -07:00
Nicola CortiandFacebook GitHub Bot b4a57dd85f Polish the .editorconfig file
Summary:
We should use indent size 2 everywhere. While we were using 4 for some old reasons. This is causing editing of .kts files and BUCK files inside OSS Android Studio quite painful.

Changelog:
[Internal] -

Reviewed By: cipolleschi

Differential Revision: D78348532

fbshipit-source-id: 97e0e1f54fdc76c8a9cdc44e1f67684c9e97a08f
2025-07-15 10:10:35 -07:00
React Native BotandFacebook GitHub Bot f68e2b47fb Add changelog for v0.81.0-rc.1 (#52605)
Summary:
Add Changelog for 0.81.0-rc.1

## Changelog:
[Internal] - Add Changelog for 0.81.0-rc.1

Pull Request resolved: https://github.com/facebook/react-native/pull/52605

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D78339154

Pulled By: motiz88

fbshipit-source-id: 9977e9dd6bed0fc62a91f469b28bdc1a41b65282
2025-07-15 09:34:31 -07:00
Nicola CortiandFacebook GitHub Bot 188caa04e7 Clarify the deprecation message for react-native-safe-area-context (#52589)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52589

The correct url for react-native-safe-area-context is:
https://github.com/AppAndFlow/react-native-safe-area-context
the former would still work through a redirect but let's be explicit here.

Changelog:
[Internal] [Changed] -

Reviewed By: huntie

Differential Revision: D78272667

fbshipit-source-id: dd8c2d6bf7e8c97e18f260e669e305734d657a51
2025-07-15 08:56:06 -07:00
Nick LefeverandFacebook GitHub Bot eca6c1b965 Fix typo in NullValueStrategy doc comment (#52608)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52608

See title

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D78339009

fbshipit-source-id: 70d0e73a38826c2c6bc3425f0a863699b3ed50d3
2025-07-15 08:31:21 -07:00
Mateo GuzmánandFacebook GitHub Bot 42b8921d91 Kotlin: Set up ktfmt in OSS (#52064)
Summary:
This PR adds the basic `ktfmt` setup in OSS to lint Kotlin files before they're imported into the Meta codebase, making collaboration with external contributors smoother for Android related PRs.

I tried to put together certain rules that mimic the current code style and it seems to work well as I get no errors for properly formatted files but this still might need some input to have the correct configuration.

Added two scripts to the main package.json:
- To check the files format you can run: `yarn lint-kotlin-check`
- To apply formatting fixes, run: `yarn lint-kotlin`

## Changelog:

[INTERNAL] - Kotlin: Set up ktfmt in OSS

Pull Request resolved: https://github.com/facebook/react-native/pull/52064

Test Plan:
Unformat any random Kotlin file inside ReactAndroid and then run:
```sh
yarn lint-kotlin-check
yarn lint-kotlin
```

Reviewed By: cipolleschi

Differential Revision: D78272876

Pulled By: cortinico

fbshipit-source-id: 0cf6b976968dfc5c6c478e88d17eb21c18961a34
2025-07-15 08:31:00 -07:00
Samuel SuslaandFacebook GitHub Bot f3b6eeb96e fix view culling in RTL languages (#52602)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52602

changelog: [internal]

fixes RTL issue in View Culling where scroll view offset was not correctly adjusted for RTL. The example failing case is described in a test.

Reviewed By: lenaic

Differential Revision: D78322759

fbshipit-source-id: d60d98aa45d4d9b576b133990f64ef941e6618e8
2025-07-15 06:34:39 -07:00
Abhijeet JhaandFacebook GitHub Bot f004cd39bc Text: Fix isSelectable prop macro conversion (#52599)
Summary:
for IOS and React native windows we can observe that the macro conversion is incorrect in ParagraphProps particularly for selectable prop.

current conversion
```
case ([]() constexpr -> RawPropsPropNameHash {   return facebook::react::fnv1a("isSelectable");  }()): fromRawValue(context, value, isSelectable, defaults.isSelectable); return;
```
issue is that isSelectable is not the raw prop therefore JS to native flow for the prop is not correct .
(Note : this works for Android as ReactProp(name = "selectable"):  https://github.com/facebook/react-native/blob/bbc1e121c71d14803d29a931f642bf8ea6ee2023/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.kt#L97-L100 )

fix
```
RAW_SET_PROP_SWITCH_CASE(isSelectable, selectable)
```

Current implementation selectable prop is not working for IOS and React native windows as the macro conversion is incorrect in ParagraphProps particularly for selectable prop.

## Changelog:
Updated ParagraphProps macro conversion for isSelectable , keeping it backward compatible.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:
[IOS] [FIXED] - Fix selectable prop not working correctly
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/52599

Test Plan:
Tested on react native windows playground

Sample code

```
export default class Bootstrap extends React.Component {
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.header}>Selectable vs Non-Selectable Text</Text>

        <Text selectable={true} style={styles.text}>
           This text is selectable. You can long-press and copy it.
        </Text>

        <Text selectable={false} style={styles.text}>
           This text is not selectable. You cannot copy it.
        </Text>
      </View>
    );
  }
}

```
before fix debug output  , native unaware of selectable prop values from JS
```
ReactNative ['Samples\text'] (info): ''[Text.js] NativeText _selectable:', true'
ReactNative ['Samples\text'] (info): ''[Text.js] NativeText _selectable:', false'
[ParagraphComponentView] updateProps - old isSelectable: 0, new isSelectable: 0
[ParagraphComponentView] DrawText - isSelectable: 0
[ParagraphComponentView] DrawText - selection logic would be DISABLED here.
[ParagraphComponentView] updateProps - old isSelectable: 0, new isSelectable: 0
[ParagraphComponentView] DrawText - isSelectable: 0
[ParagraphComponentView] DrawText - selection logic would be DISABLED here.
[ParagraphComponentView] updateProps - old isSelectable: 0, new isSelectable: 0
[ParagraphComponentView] DrawText - isSelectable: 0
[ParagraphComponentView] DrawText - selection logic would be DISABLED here.

```

after fix debug output , native picks up selectable prop values from JS correctly
```
ReactNative ['Samples\text'] (info): ''[Text.js] NativeText _selectable:', true'
ReactNative ['Samples\text'] (info): ''[Text.js] NativeText _selectable:', false'
[ParagraphComponentView] updateProps - old selectable: 0, new selectable: 0
[ParagraphComponentView] DrawText - selectable: 0
[ParagraphComponentView] DrawText - selection logic would be DISABLED here.
[ParagraphComponentView] updateProps - old selectable: 0, new selectable: 1
[ParagraphComponentView] DrawText - selectable: 1
[ParagraphComponentView] DrawText - selection logic would be enabled here.
[ParagraphComponentView] updateProps - old selectable: 0, new selectable: 0
[ParagraphComponentView] DrawText - selectable: 0
[ParagraphComponentView] DrawText - selection logic would be DISABLED here.
```

Reviewed By: rozele

Differential Revision: D78333906

Pulled By: javache

fbshipit-source-id: 4d2f9ea591e991b1aed126e9fed72fdfe1a49ce9
2025-07-15 04:41:55 -07:00
Pieter De BaetsandFacebook GitHub Bot 0d2e0abc45 Do not define default transformOrigin (#52598)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52598

Defining this as {50%, 50%} mean we do unnecessary work as part of every transform. Instead set it to undefined, which means we'll ignore it when determining the final transform.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D78298587

fbshipit-source-id: 9d3b7375fc3bd9ea04f0a6d7e314fbba0fba6949
2025-07-15 04:13:15 -07:00
Rubén NorteandFacebook GitHub Bot 7dc84491e9 Fix reporting of errors without stack traces (#52601)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52601

Changelog: [internal]

Fixes a bug in Fantom when throwing a value that's not an instance of `Error` in a test.

Reviewed By: javache

Differential Revision: D78332756

fbshipit-source-id: 350479dcb7bcea399070c6851aca76a1d1cc2629
2025-07-15 03:45:28 -07:00
Rob HoganandFacebook GitHub Bot 2a93767651 Add flow types for memfs (#52597)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52597

Add a Flow lib def for `memfs`, for use in internal and subsequently Metro tests, now that `metro-memory-fs` is deprecated.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D78268713

fbshipit-source-id: f714000f2071f4bf45b4436cbd63fc6d74939f98
2025-07-15 02:46:44 -07:00
David VaccaandFacebook GitHub Bot c2f39cfdd8 Revert Refactor ViewManagerInterfaces codegen to generate kotlin classes (#52593)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52593

Revert Refactor ViewManagerInterfaces codegen to generate kotlin classes since commands are not respecting nullability

changelog: [internal] internal

Reviewed By: bvanderhoof

Differential Revision: D78308183

fbshipit-source-id: f3d8017d4bc6473deef0fd49c000543913905cd9
2025-07-14 21:22:21 -07:00
Nick GerlemanandFacebook GitHub Bot 7f224941bb Disable Android Workarounds for Attachment Metrics (#52446)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52446

The logic for retrieving metrics from a placeholder character is kind of insane, and has been around since inline views were added built into TextView in Paper.

One of the workarounds, for old versions of Android on Samsung phones (no more info to bound the versions) causes incorrect behavior, at least in the case where we have RTL text in LTR layout.

Another, explicitly mentions `singleLine` with RTL para, a deprecated TextView prop, that doesn't apply to us here (and also could never apply to BoringLayout, since RTL chars are not boring).

We don't have these workarounds anywhere else (though we have some other workarounds for bidi crash in old Android), including other frameworks I could find.

Let's bias to cleaning this old code up.

Changelog:
[Android][Fixed] - Fix incorrect positioning of inline view at the end of string when RTL text in LTR container

Reviewed By: javache

Differential Revision: D77703906

fbshipit-source-id: f25a5e2f05100f0288f3889132b658cdabf26f22
2025-07-14 19:43:12 -07:00
Nick GerlemanandFacebook GitHub Bot 7cd0b42ca0 Add text examples combining textAlign, attachments, script direction, and layout direction (#52445)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52445

This shows some broken stuff (TM), but also asserts current behaviors

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D77702743

fbshipit-source-id: a20d5b09e84d86a16e2443726ac82416b13796a8
2025-07-14 19:43:12 -07:00
Vitali ZaidmanandFacebook GitHub Bot fc535ef542 Update debugger-frontend from 844f225...8dc0d5b (#52585)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52585

Changelog: [Internal] - Update `react-native/debugger-frontend` from 844f225...8dc0d5b

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/844f225009e6445d088ed0e431d1fc430325ed95...8dc0d5b365e6b4600b78e5a7381aa861d8c1c81e).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [8dc0d5b36](https://github.com/facebook/react-native-devtools-frontend/commit/8dc0d5b36) | Vitali Zaidman (vzaidman@gmail.com) | 2025-07-14T18:03:52+01:00 | [improve current session id message selectivity (#192)](https://github.com/facebook/react-native-devtools-frontend/commit/8dc0d5b36) |
| [0a50c353c](https://github.com/facebook/react-native-devtools-frontend/commit/0a50c353c) | Vitali Zaidman (vzaidman@gmail.com) | 2025-07-14T16:33:55+01:00 | [Track Stack Trace Frames Succeed / Fail to Resolve URL (#191)](https://github.com/facebook/react-native-devtools-frontend/commit/0a50c353c) |
| [fc0a2e77e](https://github.com/facebook/react-native-devtools-frontend/commit/fc0a2e77e) | Alex Hunt (hello@alexhunt.dev) | 2025-07-14T12:41:58+01:00 | [Tweak wording for Network dogfooding banner (#193)](https://github.com/facebook/react-native-devtools-frontend/commit/fc0a2e77e) |
| [efa49bd7a](https://github.com/facebook/react-native-devtools-frontend/commit/efa49bd7a) | sbuggay (sbuggay@gmail.com) | 2025-07-11T06:17:05-07:00 | [Update README.md (#190)](https://github.com/facebook/react-native-devtools-frontend/commit/efa49bd7a) |

Reviewed By: huntie

Differential Revision: D78281338

fbshipit-source-id: 2cbc15e0e53919f7164fca009c0dcad93d333c72
2025-07-14 11:03:04 -07:00
Christoph PurrerandFacebook GitHub Bot 04b6735fa5 Apply clang-tidy settings (#52575)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52575

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D78223453

fbshipit-source-id: 1f472106324bbd7eb77609f5bc96a0a286eafe89
2025-07-14 09:29:54 -07:00
Christoph PurrerandFacebook GitHub Bot e93afbd407 Mark ReactHost functions noexcept (#52574)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52574

Changelog: [Internal]

The main change here is to catch *all* exceptions in:
- loadScriptFromDevServer
- loadScriptFromBundlePath

so that we can make the `loadScript(...` method `noexcept`

Other methods which only call into `noexcept` methods have been marked with `noexcept` as well

Reviewed By: lenaic

Differential Revision: D78222989

fbshipit-source-id: 174ac2420e88c913662f857c875fef996959c564
2025-07-14 09:22:36 -07:00
Alex HuntandFacebook GitHub Bot a5d61564a8 Support CDP response previews for chunked data (#52582)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52582

Continues integration of `NetworkReporter` (jsinspector-modern) on Android, to enable the Network panel in React Native DevTools.

NOTE: As with iOS, all changes are gated behind the `enableNetworkEventReporting` and `fuseboxNetworkInspectionEnabled` feature flags.

**This diff**

Updates the Android inputs to `NetworkReporter` to support incremental string data HTTP responses (`Transfer-Encoding: chunked`).

Implemented:

- Incremental response case for `Network.getResponseBody` (fetch response previews).
- `Network.dataReceived` (incremental response update event).

This means that incremental responses, such as Metro bundle requests, can be displayed as previews in React Native DevTools.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77927896

fbshipit-source-id: 6eff2e7b94d3f784bbc33b1fecdc20242f98b39f
2025-07-14 09:07:10 -07:00
Alex HuntandFacebook GitHub Bot 011425358a Support CDP response previews (#52487)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52487

Continues integration of `NetworkReporter` (jsinspector-modern) on Android, to enable the Network panel in React Native DevTools.

NOTE: As with iOS, all changes are gated behind the `enableNetworkEventReporting` and `fuseboxNetworkInspectionEnabled` feature flags.

**This diff**

Integrates `Network.storeRequestBody` on Android (CDP: [`Network.getResponseBody`](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getResponseBody) CDP event) to populate the "Preview" and "Response" tabs in the React Native DevTools Network panel.

This is integrated with `NetworkingModule.kt` to support synchronously received `text` or `blob` data types, with incremental response support added next in D77927896.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77799617

fbshipit-source-id: 495baebbb3b447d1ea86705c1680578eed796d78
2025-07-14 09:07:10 -07:00
Pieter De BaetsandFacebook GitHub Bot 2321ae17ea Cleanup react-native-codegen DEFS [reland] (#52506)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52506

* Re-enable tests
* Simplify logic to avoid bypasses for arc focus

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D78000411

fbshipit-source-id: e2960a9848ce27385da00214018e7996d7c27561
2025-07-14 07:42:12 -07:00
generatedunixname89002005287564andFacebook GitHub Bot bb0c370ab7 Fix CQS signal performance-faster-string-find in xplat/js/react-native-github/packages (#52579)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52579

Reviewed By: javache

Differential Revision: D78252727

fbshipit-source-id: 97c746e6d57901f4995dd733c51e2b33e1f44a17
2025-07-14 07:22:53 -07:00
Nicola CortiandFacebook GitHub Bot 8524c13b5b Bump nexus-publish to 2.0.0 (#52566)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52566

This bumps the plugin we use to publish to Maven Central from 1.3.0 to 2.0.0
as it has better support for the latest Gradle feature.

We're not affected by the breaking changes so we should be good to go (nightlies will tell).

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D78161579

fbshipit-source-id: de5178b2cc17885636f17eabdb0eea4e5b1515dd
2025-07-14 02:55:51 -07:00
Jakub PiaseckiandFacebook GitHub Bot 1d452b17bf Release cached images when image component gets recycled on iOS (#51493)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51493

Changelog: [IOS][FIXED] Don't retain cached images in state after `RCTImageComponentView` gets recycled

Fixes https://github.com/facebook/react-native/issues/51198

Crosspost from the task comment:
From what I've been able to figure out, it seems like the image shadow nodes (keeping the loaded image in state) are being kept in memory by shadow node reference wrappers. It doesn't seem strictly like a memory leak - manually triggering garbage collection causes those nodes to be deallocated, but since Hermes isn't aware of the memory they are retaining, I think, it doesn't trigger it automatically.

This diff releases the image data when the observers are notified and adds a new (`Consumed`) status to signify that.

Reviewed By: sammy-SC

Differential Revision: D75137263

fbshipit-source-id: 97eda7e6d1ef5cd633c4a5a4c37babc5e08968fb
2025-07-14 01:11:54 -07:00
Jakub PiaseckiandFacebook GitHub Bot 6747f2b118 Add releaseImageDataWhenConsumed feature flag (#52527)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52527

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D78085001

fbshipit-source-id: 0786d5e6dcd4e41e23eef2dac1a6fec6fb800aef
2025-07-14 01:11:54 -07:00
David VaccaandFacebook GitHub Bot 79ca9036d3 Refactor ViewManagerInterfaces codegen to generate kotlin classes (#52545)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52545

Pull Request resolved: https://github.com/facebook/react-native/pull/51735

This diff refactors the ViewManagerInterfaces codegen to generate kotlin classes,

As a consequence of this change, there are some ViewManagerInterfaces that have changed their APIs

## Changelog: [Android][Breaking] - Migrate ViewManagerInterfaces to kotlin. Some types in code generated ViewManagerInterfaces might differ. e.g. this will start enforcing nullability in parameters of viewManagerInterface methods (e.g. String commands parameters are not nullable, view params are not nullable in any method, etc)

Reviewed By: cortinico

Differential Revision: D78118738

fbshipit-source-id: cdd9e660e55397bd0936efce1c5aaf90c2946b7a
2025-07-13 19:18:26 -07:00
David VaccaandFacebook GitHub Bot e7d9e0d197 Fix names of view manager methods arguments (#52571)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52571

This diff fixes the following warning:

```
The corresponding parameter in the supertype 'XYZViewManager' is named 'value'. This may cause problems when calling this function with named arguments.
```

changelog: [Android][Changed] Changed method arguments names for Core ViewManagers to match the names of ViewManagerInterfaces

Reviewed By: cortinico

Differential Revision: D78170316

fbshipit-source-id: 29a2611eabb4e260bd6126aeca95516912ea4b4d
2025-07-13 19:18:26 -07:00
Alex HuntandFacebook GitHub Bot b18cd587dc Implement core Network CDP events on Android (#52485)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52485

Begins integrating `NetworkReporter` (jsinspector-modern) on Android, to enable the Network panel in React Native DevTools.

Since the larger lift of initial setup and the C++ subsystem has been done for iOS, this will be a lighter stack of changes solely setting up necessary integration points in the Android Networking stack.

NOTE: As with iOS, all changes are gated behind the `enableNetworkEventReporting` and `fuseboxNetworkInspectionEnabled` feature flags.

**This diff**

Initially integrates the `NetworkReporter` methods corresponding to the `Network.requestWillBeSent`, `Network.requestWillBeSentExtraInfo`, `Network.responseReceived`, `Network.loadingFinished` CDP events, which are sufficient for populating a minimally rendered Network request list.

- Create JNI `InspectorNetworkReporter` helper class (may also become the later public API for 3P reporting into the `Network` domain).
- Renames `ResponseUtil.kt` as `NetworkEventUtil.kt`.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D71897099

fbshipit-source-id: 90972a5bfa34a095252b7e745e5f4afeb53b0ebe
2025-07-13 16:43:49 -07:00
Rob HoganandFacebook GitHub Bot cf45aa9dbc Bump Metro to 0.83.0 (#52576)
Summary:
Bump Metro to 0.83.0.

This release contains some breaking changes for integrators, and a minimum Node.js version of 22.14.

Full release notes: https://github.com/facebook/metro/releases/tag/v0.83.0

Changelog: [General][Changed] Bump Metro to ^0.83.0

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

Rollback Plan:

Differential Revision: D78171925

Pulled By: robhogan

fbshipit-source-id: 7ea5e04d285632a14dd71ba00da872d60f283840
2025-07-13 15:39:46 -07:00
Rob HoganandFacebook GitHub Bot 60b1b7a301 Replace metro-memory-fs dependency in tests with OSS memfs (#52572)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52572

We'd like to stop supporting `metro-memory-fs` - there are better alternatives out there.

This replaces the one usage of `metro-memory-fs` in `react-native` with `memfs`, and swaps the dependency.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D78161921

fbshipit-source-id: 139233adac413a4f47a0d56d9e08ec841abaf47c
2025-07-12 00:32:14 -07:00
Ramanpreet NaraandFacebook GitHub Bot 42ea4bc594 feature-flags: Prefix "eager" to "main queue modules" flag (#52543)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52543

Prefixing "eager" to the name makes it less confusing.  React native already has main queue modules: they're just lazy.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D78109287

fbshipit-source-id: 5fa6095d2dd8fcf74fdda64e05483eb487bc8f56
2025-07-11 22:47:07 -07:00
Ramanpreet NaraandFacebook GitHub Bot 24777bba07 Cleanup "disable main queue sync dispatch ios" infra (#52544)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52544

Let's remove these runtime errors for now. We can re-introduce this later, if needed.

Main queue coordinator will make "unsafe execute on main queue sync" not deadlock.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D78109286

fbshipit-source-id: 7c3acc2e560e341889d8ede4665bc70fefc2f058
2025-07-11 22:47:07 -07:00
Pieter De BaetsandFacebook GitHub Bot 8083cb4ab1 Remove LegacyArchitecture deprecation from JSONArguments (#52570)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52570

JSONArguments is a set of utility methods that are not part of the legacy architecture, removing the annotation.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D78168536

fbshipit-source-id: 25fcc41441df6c71f9a96ec0ba82c42e8f6af80c
2025-07-11 15:05:23 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 77db9343b1 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon (#52569)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52569

Reviewed By: dtolnay

Differential Revision: D78146649

fbshipit-source-id: 0878130feeda20c746d7fd53a00b376cde61a502
2025-07-11 11:06:18 -07:00
Rob HoganandFacebook GitHub Bot ec5bde62b6 Breaking: Use named exports in metro-babel-register (#52564)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52564

Currently, `metro-babel-register` has a function as its default export, to which we've tagged on various properties.

This tidies that up to a more idiomatic object of named exports, with `register` as a new one of them.

This also serves to make it more compatible with automatic TypeScript generation.

This is semver breaking, but `metro-babel-register` has very little usage outside Meta projects so isn't expected to be disruptive.

Changelog: [Internal]

Metro changelog:
```
 - **[Breaking]**: Move metro-babel-register's main function to a named export `register`
```

Reviewed By: huntie

Differential Revision: D78157559

fbshipit-source-id: c59c9820e9895007345561fed9ccec2273b925c8
2025-07-11 11:03:29 -07:00
Rob HoganandFacebook GitHub Bot bb3ef784e3 Remove HTTP keepAliveTimeout workaround not needed since Node.js 12 (#52561)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52561

The removed code comment is pretty clear that this workaround is in place for a specific bug, which was closed in a Node.js 8.x minor: https://github.com/nodejs/node/issues/13391

A related issue descibed a problem that still existed in Node 10:
https://github.com/nodejs/node/issues/27363

Subsequent comments reporting problems with newer Node.js versions all seem to relate to mismatched configuration with load balancers, not directly relevant to Metro.

Reproducers for the original bugs no longer repro on new Node.js (tested with 22.14), so I think it's safe to conclude this is fixed.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D78158427

fbshipit-source-id: 0be5dbc4334ac7b0bbccde44a840caac43deb4df
2025-07-11 11:03:29 -07:00
generatedunixname89002005287564andFacebook GitHub Bot b8550251d8 Fix CQS signal performance-faster-string-find in xplat/js/react-native-github/packages/react-native/ReactCommon/react/runtime (#52568)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52568

Reviewed By: dtolnay

Differential Revision: D78146248

fbshipit-source-id: 8b93b09d46832d6e67c1ded075eb99b9bdd1f0e2
2025-07-11 10:41:33 -07:00
Christoph PurrerandFacebook GitHub Bot 5dc3e18671 Fix loop iteration in Transform::Interpolate(... (#52548)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52548

Changelog: [Internal]

While this does not cause real crashes as the code is already gated via
```
bool haveRHS = j < rhs.operations.size();
```
it still represents a bug in the logic

Reviewed By: rshest

Differential Revision: D78133364

fbshipit-source-id: 80efc97b5174e3d0d7efe33604255a96bc856e87
2025-07-11 09:28:23 -07:00
Riccardo CipolleschiandFacebook GitHub Bot e79808fa4b Update caching keys for prebuild-core (#52565)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52565

When we implemented caching in prebuilds for RN core for iOS, we were naïve in choosing the cache key. The current cache key does not consider the source code that is built and this can be problematic.
Imagine a contributor that changes a file in a React folder in their PR, but CI reuses a binary created from `main` and so everything will work well in CI even if the change contains an error.

This change globs over the header and implementation files in the React, ReactCommon and Libraries folder to ensure that we rebuild the code when iOS code changes.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D78161427

fbshipit-source-id: e612b76232308835eb88c3776122bebd1316f751
2025-07-11 09:14:43 -07:00
Rubén NorteandFacebook GitHub Bot 9747c955ac Migrate network profiling to console.timeStamp (#52560)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52560

Changelog: [internal]

This migrates the profiling logic for `XMLHttpRequest` from `performance.measure` to `console.timeStamp` with built-in support for tracks.

Reviewed By: hoxyq

Differential Revision: D78157407

fbshipit-source-id: 0ef060557a00e7973ef7f0478b26b81471d38226
2025-07-11 08:41:01 -07:00
Rubén NorteandFacebook GitHub Bot 6f6945e64f Propagate console.timeStamp entries to Perfetto (#52542)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52542

Changelog: [internal]

This adds support to propagate performance entries logged to `console.timeStamp` to Perfetto, if enabled. It also modifies the Perfetto integration to support track groups, in addition to track names.

Reviewed By: hoxyq

Differential Revision: D78092596

fbshipit-source-id: 76b0fe2738d856fd75ee941de223d6a6a73d8e1c
2025-07-11 08:41:01 -07:00
Nicola CortiandFacebook GitHub Bot 0021dafc51 Remove deprecated constructors for TextInput *Event classes (#52535)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52535

Those constructors are no longer necessary. They're deprecated + the class is internal so they're not breaking changes.
I'm just cleaning them up as they're not needed anymore.

Changelog:
[Internal] [Changed] - Remove deprecated constructors for TextInput *Event classes

Reviewed By: javache

Differential Revision: D78095748

fbshipit-source-id: 2dc6c750f8470a88918d8a69b68364f38251d79e
2025-07-11 08:15:42 -07:00
Riccardo CipolleschiandFacebook GitHub Bot e69777d258 Connect prebuilds with CI (#52562)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52562

This change use the prebuilds we build in CI i other iOS jobs to speed-up the iOS CI

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D78159367

fbshipit-source-id: 64486c99fdbc54487dbcff786209cacac304b9b7
2025-07-11 07:15:35 -07:00
Riccardo CipolleschiandFacebook GitHub Bot dc5110a8f2 Unify test_ios_rntester_dynamic_frameworks with test_ios_rntester (#52563)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52563

The test_ios_rntester_dynamic_frameworks is identical to the test_ios_rntester but for the framework parameter.

This change unifies the two, using a matrix to test all the configurations:
- Debug / Static Libraries
- Release / Static Libraries
- Debug / Dynamic Frameworks
- Release / Dynamic Frameworks

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D78159366

fbshipit-source-id: b321f295477fe3ae6e43c7518d47afb0714bddb8
2025-07-11 07:15:35 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 3de1dc0fd1 Fix RCTPushNotification podspec to work with prebuilds (#52531)
Summary:
This change tries to use the prebuilds we build in CI i other iOS jobs to speed-up the iOS CI

bypass-github-export-checks

## Changelog:
[Internal] -

Pull Request resolved: https://github.com/facebook/react-native/pull/52531

Test Plan:
Build rntester using prebuilds:

```
# after downloading the prebuilds from CI and unzipping them
export HERMES_ENGINE_TARBALL_PATH=~/Downloads/hermes-ios-Debug.tar.gz
export RCT_USE_LOCAL_RN_DEP=~/Downloads/reactnative-dependencies-debug.tar.gz
export RCT_TESTONLY_RNCORE_TARBALL_PATH=~/Downloads/React.xcframework.tar.gz

USE_FRAMEWORKS=dynamic bundle exec pod install
open RNTesterPods.xcworkspace
```
And then build from Xcode.

Reviewed By: rshest

Differential Revision: D78158734

Pulled By: cipolleschi

fbshipit-source-id: 43cbb66bd44fa621292b69de0dadde5ed20c4574
2025-07-11 07:15:35 -07:00
Christoph PurrerandFacebook GitHub Bot 88cb7832ea Remove unused Color/Transform #includes and use enum class for TransformOperationType (#52549)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52549

Changelog: [Internal]

- The #includes are not used
- `enum class` is C++, (enum is C)

Reviewed By: rshest

Differential Revision: D78135339

fbshipit-source-id: 1a35301ea063ce17c195be7dc373132d342f111a
2025-07-11 06:51:49 -07:00
Zeya PengandFacebook GitHub Bot aa2a5a682f Animated.sequence (#52547)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52547

## Changelog:

[Internal] [Added] - add fantom test for Animated.sequence

Reviewed By: christophpurrer

Differential Revision: D78107756

fbshipit-source-id: c3a7bc2d487cc0ae7316a26dc10b01dcf54dbd37
2025-07-11 06:40:03 -07:00
Zeya PengandFacebook GitHub Bot a0543b773c AnimatedValue.interpolate (#52546)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52546

## Changelog:

[Internal] [Added] - add fantom test for AnimatedValue.interpolate

Reviewed By: christophpurrer

Differential Revision: D78032554

fbshipit-source-id: 0100a510cb0ad5c8e1886c309fab91ee9e017769
2025-07-11 06:40:03 -07:00
Rubén NorteandFacebook GitHub Bot f5abce0932 Micro-optimize performance methods (#52555)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52555

Changelog: [internal]

Applied several micro-optimizations to methods in the `performance` object:
- Cached property access
- Avoided unnecessary function calls
- Avoided unnecessary object allocations
- Use strict comparisons with `undefined` instead of loose comparisons with `null` whenever possible.

This yields wins from 5 to 15% depending on the method and args.

## Before

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '1728.19 ± 0.81%'    | '1682.00'           | '592249 ± 0.01%'           | '594530'                  | 578640  |
| 1       | 'mark (with custom startTime)'                            | '2008.33 ± 1.32%'    | '1933.00'           | '514326 ± 0.01%'           | '517331'                  | 497927  |
| 2       | 'measure (default)'                                       | '2568.90 ± 1.48%'    | '2484.00'           | '400362 ± 0.02%'           | '402576'                  | 389272  |
| 3       | 'measure (with start and end timestamps)'                 | '2806.21 ± 0.69%'    | '2744.00'           | '362439 ± 0.02%'           | '364431'                  | 356353  |
| 4       | 'measure (with mark names)'                               | '2860.82 ± 0.23%'    | '2824.00'           | '352145 ± 0.02%'           | '354108'                  | 349551  |
| 5       | 'clearMarks'                                              | '763.05 ± 0.03%'     | '751.00'            | '1320377 ± 0.01%'          | '1331558'                 | 1310524 |
| 6       | 'clearMeasures'                                           | '788.10 ± 0.05%'     | '781.00'            | '1281839 ± 0.01%'          | '1280410'                 | 1268875 |
| 7       | 'mark + clearMarks'                                       | '2129.03 ± 1.04%'    | '2053.00'           | '484778 ± 0.01%'           | '487092'                  | 469698  |
| 8       | 'measure + clearMeasures (with start and end timestamps)' | '3176.38 ± 0.67%'    | '3105.00'           | '320111 ± 0.02%'           | '322061'                  | 314825  |
| 9       | 'measure + clearMeasures (with mark names)'               | '3229.33 ± 0.60%'    | '3145.00'           | '316463 ± 0.02%'           | '317965'                  | 309662  |

## After

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '1598.54 ± 0.93%'    | '1553.00'           | '639076 ± 0.01%'           | '643915'                  | 625572  |
| 1       | 'mark (with custom startTime)'                            | '1772.07 ± 1.24%'    | '1713.00'           | '579523 ± 0.01%'           | '583771'                  | 564314  |
| 2       | 'measure (default)'                                       | '2349.32 ± 0.81%'    | '2284.00'           | '434149 ± 0.01%'           | '437828'                  | 425656  |
| 3       | 'measure (with start and end timestamps)'                 | '2609.11 ± 1.06%'    | '2534.00'           | '391950 ± 0.02%'           | '394633'                  | 383273  |
| 4       | 'measure (with mark names)'                               | '2656.46 ± 0.42%'    | '2614.00'           | '380128 ± 0.01%'           | '382555'                  | 376442  |
| 5       | 'clearMarks'                                              | '666.38 ± 0.03%'     | '661.00'            | '1511649 ± 0.01%'          | '1512859'                 | 1500641 |
| 6       | 'clearMeasures'                                           | '718.62 ± 0.03%'     | '711.00'            | '1401526 ± 0.01%'          | '1406470'                 | 1391563 |
| 7       | 'mark + clearMarks'                                       | '2027.47 ± 1.29%'    | '1953.00'           | '509105 ± 0.01%'           | '512033'                  | 493227  |
| 8       | 'measure + clearMeasures (with start and end timestamps)' | '3030.83 ± 0.98%'    | '2915.00'           | '340624 ± 0.02%'           | '343053'                  | 329943  |
| 9       | 'measure + clearMeasures (with mark names)'               | '2915.76 ± 0.59%'    | '2844.00'           | '349120 ± 0.02%'           | '351617'                  | 342964  |

Reviewed By: hoxyq

Differential Revision: D78013565

fbshipit-source-id: ddd02d887b228debd58805406c1395b9179dd804
2025-07-11 05:37:31 -07:00
Rubén NorteandFacebook GitHub Bot 38cf247c63 Add more benchmarks for performance.measure (#52556)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52556

Changelog: [internal]

This adds a new benchmark for `performance.measure` to measure the performance of calling it without arguments.

Reviewed By: hoxyq

Differential Revision: D78013563

fbshipit-source-id: 84e2151d9d91cfc2e85d310f42010483e7304648
2025-07-11 05:37:31 -07:00
Rubén NorteandFacebook GitHub Bot 1fc168f005 Handle nullability of detail correctly in performance.mark and performance.measure (#52557)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52557

Changelog: [internal]

`PerformanceEntry.detail` should be `null` if not defined, not undefined as it is currently. This fixes that.

Reviewed By: hoxyq

Differential Revision: D78013568

fbshipit-source-id: b22dfdd8d582594fc1e5199264e8af92c26bb0ea
2025-07-11 05:37:31 -07:00
Rubén NorteandFacebook GitHub Bot 5e0eb0a17c Small refactor of performance API (#52558)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52558

Changelog: [internal]

Small refactors for `$ReadOnly`, move `getCurrentTimeStamp` to utils so it can be reused, etc.

Reviewed By: hoxyq

Differential Revision: D78013570

fbshipit-source-id: f73d119f22dd4dc9aaa5efef76a1156821ecd8de
2025-07-11 05:37:31 -07:00
Rubén NorteandFacebook GitHub Bot acd07c7e1c Handle casting to string in performance.mark and performance.measure correctly (#52559)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52559

Changelog: [internal]

Making `performance.mark` and `performance.measure` slightly more spec-compliant.

Reviewed By: hoxyq

Differential Revision: D78013571

fbshipit-source-id: 4881b674f7cded5045b9f464ca7442a186c39048
2025-07-11 05:37:31 -07:00
Harini MalothuandFacebook GitHub Bot ff38d59cff # Fixed Type Conversion Error in DynamicEventPayload (#52525)
Summary:
Resolves https://github.com/microsoft/react-native-windows/issues/14797
We were facing a type conversion error in the DynamicEventPayload::extractValue() method. The function signature declares a return type of std::optional<double>, but when handling INT64 values, but when handling `INT64` values, the code was directly returning `dynamic.asInt()` without proper type conversion
We faced the issue while integrating https://github.com/microsoft/react-native-windows/pull/14791
## Changelog:
[General][Fixed]

Pull Request resolved: https://github.com/facebook/react-native/pull/52525

Test Plan:
The fix involved wrapping the dynamic.asInt() call with static_cast<double>(), creating the corrected line: return static_cast<double>(dynamic.asInt())

Tested E2E in RNW

Reviewed By: andrewdacenko

Differential Revision: D78083842

Pulled By: rshest

fbshipit-source-id: 8dbedd67fa7c21e89b863d8b1bc7b9e0d7978b9f
2025-07-11 03:13:30 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 7bbb13c9be Fix ENTERPRISE_REPOSITORY usage (#52553)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52553

This change fixes the usage of `ENTERPRISE_REPOSITORY` in Ruby

## Changelog
[Internal] -

Reviewed By: cortinico

Differential Revision: D78152641

fbshipit-source-id: e4ace014f1b7cbeb1ec5a0dea955d1fc2bae5b67
2025-07-11 03:01:30 -07:00
Jakub PiaseckiandFacebook GitHub Bot d4b36b0300 Fix display: contents nodes not being cloned with the wrong owner (#52530)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52530

This PR fixes two issues with `display: contents` implementation:
1. When a node with `display: contents` set is a leaf, it won't be cloned after the initial tree is built. The added test case covers this scenario.
2. It was possible for the subtree of `display: contents` nodes not to be cloned during layout. I don't have a minimal reproduction for this one, unfortunately. It was discovered in the Expensify app: https://github.com/Expensify/App/issues/65268, along with a consistent reproduction. In that specific case, it seems to be heavily tied to `react-native-onyx`, which is a state management library.

Changelog: [GENERAL][FIXED] - Fixed nodes with `display: contents` set being cloned with the wrong owner

X-link: https://github.com/facebook/yoga/pull/1826

Reviewed By: adityasharat, NickGerleman

Differential Revision: D78084270

Pulled By: j-piasecki

fbshipit-source-id: eb81f6d7dcd1665974d07261ba693e2abea239bb
2025-07-11 02:16:35 -07:00
Vitali ZaidmanandFacebook GitHub Bot 84a2765c2a renamed release testing scripts (#52541)
Summary:
Use a more suitable name for the [scripts used in the release process](https://github.com/reactwg/react-native-releases/blob/main/docs/guide-release-testing.md) to generate a testing project to test a new React Native release against.
```diff
- test-e2e-local
+ test-release-local
```
## Changelog:
[INTERNAL]

Pull Request resolved: https://github.com/facebook/react-native/pull/52541

Test Plan:
`yarn test-release-local-clean` works the same way:
<img width="1177" height="161" alt="Screenshot 2025-07-10 at 17 54 50" src="https://github.com/user-attachments/assets/5efe30c6-a738-476e-a670-696959e9a0fc" />

`yarn test-release-local` works the same way:
<img width="1077" height="395" alt="Screenshot 2025-07-10 at 17 59 29" src="https://github.com/user-attachments/assets/fe6c6443-9316-4ed0-b6dc-51de5ffb109c" />

Reviewed By: cipolleschi

Differential Revision: D78150648

Pulled By: vzaidman

fbshipit-source-id: 471715da271d03bc2a35afbda02074bf71f62734
2025-07-11 01:57:14 -07:00
Nick LefeverandFacebook GitHub Bot 6b8bc5a1d0 Move toDynamic conversion for FilterFunction (#52537)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52537

See title

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D78088447

fbshipit-source-id: 3f3a1e82e527cfe83de7a798b8b9ea2996dc8de1
2025-07-10 12:35:18 -07:00
Nick LefeverandFacebook GitHub Bot 0144798e25 Move toDynamic conversion for BoxShadow (#52536)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52536

See title

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D78005880

fbshipit-source-id: 5a4b7ff3c4d9c6ece17759926ee80aec80d3cde0
2025-07-10 12:35:18 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 263ccad3c5 Fix CQS signal modernize-use-using in xplat/js/react-native-github/packages/react-native/React/CoreModules [B] (#52539)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52539

Reviewed By: dtolnay

Differential Revision: D78062538

fbshipit-source-id: 610505b5bfd78798b09970194f3b95aaefb08920
2025-07-10 12:16:40 -07:00
Devan BuggayandFacebook GitHub Bot c2a3e4420e HWInput: Add Channel Up/Down Support (#52540)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52540

Adds Channel Up/Down events to HWInput.

Changelog:
[Android][Added] - Channel up/down hardware events.

Reviewed By: Abbondanzo

Differential Revision: D78099245

fbshipit-source-id: 133d5c835f3862feba641354cb1164eefeafed9f
2025-07-10 12:04:00 -07:00
Rob HoganandFacebook GitHub Bot 5d4c22b4a7 Update @typescript-eslint (#52532)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52532

Since we updated TypeScript in https://github.com/facebook/react-native/pull/51831, ESLint has printed a warning that `typescript/eslint` doesn't support our TS version.

This updates it to fix the warning.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D77833826

fbshipit-source-id: 29a5179c4f223a8cc0ab2c8071f0a5efa09e5edc
2025-07-10 10:10:09 -07:00
Nicola CortiandFacebook GitHub Bot b0606ba041 Correctly mark as deprecated the ReactActivityDelegate.getReactInstanceManager (#52533)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52533

This method is deprecated in the JavaDoc but not correctly annotated as Deprecated, let's fix it.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D78092468

fbshipit-source-id: 31e4cb958a51b20f5105a4bec3366d67402e5419
2025-07-10 10:00:32 -07:00
Nicola CortiandFacebook GitHub Bot 4d1f1a4e29 Back out "Remove ShadowNodeTraits::Trait::DirtyYogaNode" (#52528)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52528

This was a breaking change that is currently breaking `react-native-safe-area-context` so we can't ship it as it is, especially because all the apps in OSS will be affected by this.

Changelog:
[General] [Changed] - Revert breaking change due to the removal of `ShadowNodeTraits::Trait::DirtyYogaNode`

Original commit changeset: 869e81f0ae00

Original Phabricator Diff: D75324251

Reviewed By: huntie

Differential Revision: D78085848

fbshipit-source-id: f7fcc5e33d59cc966a4ee88dfdbedca4f4c580e0
2025-07-10 09:36:54 -07:00
Christoph PurrerandFacebook GitHub Bot a98ee9147a Add noexcept specifications to Transform and Color methods (#52497)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52497

Changelog: [Internal]

Is a good practice (and can reduce binary size):
https://cpp-core-guidelines-docs.vercel.app/errors#Re-noexcept

Reviewed By: philIip

Differential Revision: D77988686

fbshipit-source-id: 575c18aa0c8f593f363f4450e9e06d41c97a3d1a
2025-07-10 09:17:08 -07:00
Tomasz ZawadzkiandFacebook GitHub Bot d1730ff960 Expose react_renderer_bridging headers via prefab (#52529)
Summary:
This PR fixes the following build error while trying to build `react-native@0.81.0-rc.0` app with `react-native-screens@4.10.0` installed using react-native prebuilds (AAR) due to a missing `react/renderer/bridging/bridging.h` file in `prefab/modules/` inside `react-android-0.81.0-rc.0-debug.aar`.

```
In file included from /Users/tomekzaw/RNOS/react-native-reanimated/node_modules/react-native-screens/android/src/main/cpp/NativeProxy.cpp:2:
  In file included from /Users/tomekzaw/.gradle/caches/8.14.1/transforms/75e7f8f7b5ef763e687a16737daf01b6/transformed/react-android-0.81.0-rc.0-debug/prefab/modules/reactnative/include/react/fabric/Binding.h:12:
  In file included from /Users/tomekzaw/.gradle/caches/8.14.1/transforms/75e7f8f7b5ef763e687a16737daf01b6/transformed/react-android-0.81.0-rc.0-debug/prefab/modules/reactnative/include/react/fabric/FabricUIManagerBinding.h:22:
  /Users/tomekzaw/.gradle/caches/8.14.1/transforms/75e7f8f7b5ef763e687a16737daf01b6/transformed/react-android-0.81.0-rc.0-debug/prefab/modules/reactnative/include/react/renderer/uimanager/primitives.h:14:10: fatal error: 'react/renderer/bridging/bridging.h' file not found
     14 | #include <react/renderer/bridging/bridging.h>
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  ninja: build stopped: subcommand failed.
```

## Changelog:

[ANDROID] [CHANGED] - Expose `react_renderer_bridging` headers via prefab

Pull Request resolved: https://github.com/facebook/react-native/pull/52529

Reviewed By: cipolleschi

Differential Revision: D78092428

Pulled By: cortinico

fbshipit-source-id: de8208ae7545201f600c277a0c8907575c310c58
2025-07-10 08:25:50 -07:00
Vitali ZaidmanandFacebook GitHub Bot e0efd3eb5b add 0.81.0-rc.0 release to the changelog file (#52517)
Summary:
Changelog: [INTERNAL] - Update the changelog to include `0.81.0-rc.0`

Pull Request resolved: https://github.com/facebook/react-native/pull/52517

Reviewed By: cortinico

Differential Revision: D78021431

Pulled By: vzaidman

fbshipit-source-id: 3053aed68a947bf808ae29d4827599112175f531
2025-07-10 03:34:10 -07:00
Christian FalchandFacebook GitHub Bot 42d1a7934c add release/debug switch script (#52498)
Summary:
Fixes #T228219721

This commit adds the debug/release switch script like we have for rn deps and hermes for react-core prebuilt:

- Added script: replace-rncore-version-js
- Inserted script into React-Core-prebuilt podspec
- Updated rncore.rb with correct filenames

bypass-github-export-checks

## Changelog:

[IOS] [ADDED] - add release/debug switch script for React-Core-prebuilt

Pull Request resolved: https://github.com/facebook/react-native/pull/52498

Test Plan: Run in RNTester and switch between release/debug

Reviewed By: rshest

Differential Revision: D78012917

Pulled By: cipolleschi

fbshipit-source-id: 71cad23cd41484a8253fc89d5dce8653649657a0
2025-07-10 03:04:07 -07:00
Christian FalchandFacebook GitHub Bot f2b064c2d4 fix wrong use of return in header file generation loop (#52490)
Summary:
Instead of returning when creating the list of header files from our podspecs, we now call `continue`. This is a bug that causes all subsequent globs in the header file list to be omitted after the first omitted glob.

bypass-github-export-checks

## Changelog:

[IOS] [FIXED] - Fixed premature return in header file generation from podspec globs

Pull Request resolved: https://github.com/facebook/react-native/pull/52490

Test Plan: Run prebuild scripts and verify that React-Fabric podspec headers are included in the resulting xcframework.

Reviewed By: mdvacca

Differential Revision: D78012399

Pulled By: cipolleschi

fbshipit-source-id: 2d334f4f7ff966ea4c778786a7056e13a255a708
2025-07-10 03:04:07 -07:00
Christian FalchandFacebook GitHub Bot 40e45f5366 add support for USE_FRAMEWORKS when using prebuilt React Native Core (#52489)
Summary:
When using prebuilts the USE_FRAMEWORKS setting is not really relevant for the React Native code, since there will not be any source code to build frameworks for - and because we already have a framework for the code in React.XCFramework.

This commit adds a new command to the React Native podspecs like we did with the ReactNativeDependencies framework. The method is called `add_rncore_dependency` and it does nothing when building from source - but when linking with the React.XCFramework it explicitly adds linking with the framework.

In addition there are a few places in the ruby code where we check for the USE_FRAMEWORK value and changes some settings - where needed this commit will add a separate check to ensure we're building from source when making these changes.

bypass-github-export-checks

## Changelog:

[IOS] [ADDED] - Added support for using USE_FRAMEWORKS with prebuilt React Native Core

Pull Request resolved: https://github.com/facebook/react-native/pull/52489

Test Plan:
RNTester:

- Builds without USE_FRAMEWORKS as before with/without prebuilt
- Builds with USE_FRAMEWORKS=dynamic as before with source - and now also with prebuilt code.
- Same goes for the static variant.

Reviewed By: mdvacca

Differential Revision: D78012332

Pulled By: cipolleschi

fbshipit-source-id: ea942738ae52b9dceae48fb78a5026f04b7545b8
2025-07-10 03:04:07 -07:00
Fabrizio CucciandFacebook GitHub Bot 5ec4e74bc7 Add changelog entry for 0.78.3 (#52518)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52518

As per title.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D78024356

fbshipit-source-id: e006edd4d86839c7d8635de7c68d333530d0a91d
2025-07-10 01:35:25 -07:00
Luna WeiandFacebook GitHub Bot e40c10b9f6 Introduce experimental VirtualView (#52519)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52519

Changelog: [Internal] - Experiment with intersection logic for VirtualViews in scrollView. Currently only on Android

### Changes in detail
`VirtualViewContainer` is held by the ScrollView and is lazily instantiated once a VirtualView tries to access.

Upon initial layout, a VirtualView will add itself to the container and report its updated `rect`. `VirtualViewContainer` holds a sorted list of VirtualViews and iterates through them to update mode

Reviewed By: yungsters

Differential Revision: D77313890

fbshipit-source-id: 30843143bf1828dcac9091479964e83934bf330c
2025-07-09 21:12:45 -07:00
generatedunixname89002005287564andFacebook GitHub Bot aa5b8551ce Fix CQS signal modernize-use-using in xplat/js/react-native-github/packages/react-native/React/Fabric (#52523)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52523

Reviewed By: dtolnay

Differential Revision: D77993027

fbshipit-source-id: 2cf11338360613206a91a9acbeabbfa45934b98f
2025-07-09 20:43:05 -07:00
Eric RozellandFacebook GitHub Bot 57c5eee51f Delete animatedShouldSignalBatch feature flag (#52521)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52521

Progress is moving quickly on the cxxNativeAnimatedEnabled flag, which this animatedShouldSignalBatch was intended to de-risk. We no longer need this flag to de-risk issues with animated batch flushing.

## Changelog

[Internal]

Reviewed By: christophpurrer

Differential Revision: D78005971

fbshipit-source-id: 719f1dfb0594fbe90dd6f08dea21ad20665832df
2025-07-09 20:15:57 -07:00
Vineeth KandFacebook GitHub Bot 586f5ba89c Added fix to use accessibility source props (#52397)
Summary:
accessibilityRole is not getting the default value from sourceProps.

This change will fix https://github.com/facebook/react-native/issues/52396

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Fixed accessibilityRole parsing.
Pick one each for the category and type tags:

[GENERAL] [FIXED] - Added fix for setting the default value for accessibility props

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/52397

Test Plan: After this change accessibilityRole will get the default value from sourceProps.

Reviewed By: joevilches

Differential Revision: D77879025

Pulled By: NickGerleman

fbshipit-source-id: c2fd10dd34462e2cd01488b720ba91e4f1998000
2025-07-09 18:33:59 -07:00
Joe VilchesandFacebook GitHub Bot 384bd214ff Back out "Implement accessibilityOrder by building the accessibilityTree through addChildrenForAccessibility" (#52516)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52516

Original commit changeset: 767ebc880a2e

Original Phabricator Diff: D77258926

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D78016839

fbshipit-source-id: 4f71764d5885c227b92840fc9191d0f3b86f6278
2025-07-09 18:10:56 -07:00
Jack PopeandFacebook GitHub Bot d18f1f7ca3 Enable Fragment Refs for intersection observers on Fabric (#52474)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52474

1. Enables the feature flags for fragment refs on fbsource
2. Adds a test with Fantom for usage of `FragmentInstance#observeUsing` and `FragmentInstance#unobserveUsing`.
3. Exposes the `ReactFragmentInstance` type with the common methods that are used on native. We can override the DOM only methods in www libdefs.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D74326262

fbshipit-source-id: e35ee45b23179ad3ba5527763567c9b04c127eff
2025-07-09 16:03:25 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 23f3bf9239 Add the ENTERPRISE_REPOSITORY env var to let user consume artifacts from their personal maven mirror (#52514)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52514

As per title, this change add the `ENTERPRISE_REPOSITORY` env variable so that users can use their owm maven mirror to consume artifacts rather than the official url.

This is helpful as:
- we can reduce the traffic toward maven central
- companies can speed up their builds by relying on local/closer replicas

## Changelog:
[iOS][Added] - Add the `ENTERPRISE_REPOSITORY` env variable to cocopaods infra

Reviewed By: cortinico

Differential Revision: D78011424

fbshipit-source-id: 24b83b4866095d7fe3318362afc5075b99b146e7
2025-07-09 10:14:41 -07:00
Ruslan LesiutinandFacebook GitHub Bot dfce5c7180 console.timeStamp: support warning color (#52511)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52511

# Changelog: [Internal]

This is actually used in React for logging triggers, like Mount / Unmount / Reconnect / Disconnect.

Reviewed By: huntie

Differential Revision: D78008351

fbshipit-source-id: 9d39d45da499ce78172531c00cc7465b985c2646
2025-07-09 09:26:47 -07:00
Christoph PurrerandFacebook GitHub Bot 52815c2724 Improve NativeDOM Turbo Module typing (#52494)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52494

Changelog: [Internal]

- Use C++ private namespace instead of C static methods
- Strongly type C++ TM functions via AsyncCallback

Reviewed By: javache

Differential Revision: D77978354

fbshipit-source-id: 2274b95cfc5b65392fc3c808bbdf54ec4ab3a37e
2025-07-09 08:40:25 -07:00
Alex HuntandFacebook GitHub Bot 732bd12dc2 Add optional safeAreaInsets prop to NewAppScreen (replacing SafeAreaView) (#52507)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52507

Resolves https://github.com/reactwg/react-native-releases/issues/1011.

Changelog:
[General][Changed] - `NewAppScreen` no longer internally handles device safe area, use optional `safeAreaInsets` prop (aligned in 0.81 template)

Reviewed By: cortinico

Differential Revision: D78006238

fbshipit-source-id: 01fb16d6754b69a722ea11838d558bebd4748026
2025-07-09 08:26:19 -07:00
Riccardo CipolleschiandFacebook GitHub Bot bfc841d71d Change polling to try and download the pom manifest (#52512)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52512

The way Maven works is that the artifacts are uploaded and available way before the browsing UI will allow us to browse them.

By trying to download the `.pom` file instead of checking for the browsing website to be visible, we can shave some minutes during the release

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D78008635

fbshipit-source-id: 96516163628d6d25db385d996a11b4af78db764a
2025-07-09 08:12:58 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 6ed0279700 Fix bump-podfile-lock job by using Xcode 16.2 (#52513)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52513

We bumped the requirement for cocoapods to use Xcode 16.1 or greater.
This job was not update and therefore it failed when releasing 0.81.0-rc.0.

This change should fix it and it should be cherry picked in the release branch too.
By default, the macos executor in github actions are using Xcode 15.2

## Changelog
[Internal] -

Reviewed By: cortinico, fabriziocucci

Differential Revision: D78008316

fbshipit-source-id: 4d05233ca3b936cf128400030328124c453963ea
2025-07-09 08:12:58 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 5e214f0dc8 Read the React Native version from the react-native's package.json (#52509)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52509

When building the CI Workflow to build React Native prebuilds, we were reading the react-native's version from the root package.json. This package.json is not updated by the release script, so the version is always 1000.
This makes the build process fail for stable releases.

With this change, we read the version from the right package.json file

## Changelog:
[Internal] - Read React Native version from the right package.json file

Reviewed By: cortinico

Differential Revision: D78007906

fbshipit-source-id: 35f868a1c203245fdcf518ee81957352e3ab1de7
2025-07-09 08:12:58 -07:00
Riccardo CipolleschiandFacebook GitHub Bot f37e983255 Back out "Add more logging around computeNightlyTarballURL" (#52510)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52510

We reverted this change in the 0.81 release branch

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D78007905

fbshipit-source-id: fec3df04423300571f629da19bf95cd82c952f12
2025-07-09 08:12:58 -07:00
Samuel SuslaandFacebook GitHub Bot daf6ebd7b5 fix race condition in C++ Animated (#52505)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52505

changelog: [internal]

there is a race condition where `startRenderCallbackIfNeeded` may be called from JS thread and the main thread at the same time, leading to a crash. To address this, this diff adds uses a boolean to make sure `startOnRenderCallback_` is only called once and `stopOnRenderCallback_` is only called after start was called.

Reviewed By: javache

Differential Revision: D77871230

fbshipit-source-id: 6d7fba596e7146adaff6f8dbe1f436ddd59950c6
2025-07-09 07:19:30 -07:00
Rubén NorteandFacebook GitHub Bot f578038cb2 Add test to show Fabric bug with intermediate states in JS and sync updates in UI (#52502)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52502

Changelog: [internal]

This is just a test to show the bug reported in https://github.com/facebook/react-native/issues/52373

Reviewed By: javache

Differential Revision: D78000010

fbshipit-source-id: 5f53a02eb875255f5e384a748057997491518adc
2025-07-09 05:59:27 -07:00
Anupriya VermaandFacebook GitHub Bot 2ca88a0069 'return': conversion from 'int' to 'uint8_t', possible loss of data in CSSHexColor (#52496)
Summary:
Resolves https://github.com/microsoft/react-native-windows/issues/14666
We faced this issue while integrating [0.79.0-nightly-20250220-41b597c73](https://github.com/microsoft/react-native-windows/pull/14662/files#top)

This warning is treated as error and should be fixed here as well.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[GENERAL] [FIXED] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/52496

Test Plan:
Fixed error:
##[error]node_modules\react-native\ReactCommon\react\renderer\css\CSSHexColor.h(39,12): Error C4244: 'return': conversion from 'int' to 'uint8_t', possible loss of data
2>D:\a_work\1\s\node_modules\react-native\ReactCommon\react\renderer\css\CSSHexColor.h(39,12): error C4244: 'return': conversion from 'int' to 'uint8_t', possible loss of data [D:\a_work\1\s\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]
(compiling source file '../../node_modules/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.cpp')

Tested E2E in RNW

Reviewed By: javache

Differential Revision: D78000818

Pulled By: rshest

fbshipit-source-id: 5caafc5e92540f722b009480f030276e526355af
2025-07-09 05:05:52 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 47957f9adc 60 (#52493)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52493

Reviewed By: dtolnay

Differential Revision: D77920274

fbshipit-source-id: 42a68d5666f43f606ebcbbe4d207bb9b299760e7
2025-07-09 04:56:35 -07:00
Nicola CortiandFacebook GitHub Bot 9c172fbba3 Add more logging around computeNightlyTarballURL
Summary:
This is a backport of a fix we applied to the 0.81 branch.

Changelog:
[Internal] [Changed] -

bypass-github-export-checks

Reviewed By: vzaidman

Differential Revision: D78000573

fbshipit-source-id: 64a4e90632158c1f52c45f9fbc3452e848271e94
2025-07-09 04:50:29 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 7725a0aee3 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/rn-tester/android/app/src/main/jni (#52501)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52501

Reviewed By: javache, cortinico

Differential Revision: D77990137

fbshipit-source-id: 1fe4b7a0a821cf9bff5b21d38b6e78a3b164211d
2025-07-09 03:03:48 -07:00
Christoph PurrerandFacebook GitHub Bot b5329ecd6d NativeCxxModuleExample test for testing C++ TM E2E (#52477)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52477

Changelog: [Internal]

This adds a Fantom test for

https://github.com/facebook/react-native/blob/main/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.js

to test a C++ Turbo Module End 2 End (loading the C++ implementation in native code, accessing in JavaScript via Hermes VM and verifying the results of the API calls)

Reviewed By: rshest

Differential Revision: D77848654

fbshipit-source-id: 48a4ab88a330e9282ae8dab589743eaace62d124
2025-07-08 21:10:36 -07:00
Nicola CortiandFacebook GitHub Bot 6892dde363 Gradle to 8.14.3 (#52466)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52466

Just another patch bump of Gradle 8.14

Changelog:
[Android] [Changed] - Gradle to 8.14.3

Reviewed By: NickGerleman

Differential Revision: D77865220

fbshipit-source-id: 450d175242f046909ab1984654d24e92a2536d5d
2025-07-08 16:33:18 -07:00
Adan MorenoandFacebook GitHub Bot eb61e6f783 Revert D77143018: Cleanup react-native-codegen DEFS
Differential Revision:
D77143018

Original commit changeset: 06ec43ce5149

Original Phabricator Diff: D77143018

fbshipit-source-id: cec53068f88548c4494da315914763beb6730573
2025-07-08 16:29:45 -07:00
Marco WangandFacebook GitHub Bot df6ba3f155 Pre-suppress errors for boolean literals for xplat js (#52482)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52482

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D77915593

fbshipit-source-id: 9238b89e92410cea350c6057044167727de3601a
2025-07-08 12:50:53 -07:00
Fabrizio CucciandFacebook GitHub Bot 5baf1e6d00 Fix all workflows to use node 22.14.0 (#52491)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52491

We hit this error when trying to release 0.81.0 (see [action run](https://github.com/facebook/react-native/actions/runs/16147471618/job/45570030039)):

> error react-native/metro-babel-transformer@0.81.0-main: The engine "node" is incompatible with this module. Expected version ">= 22.14.0". Got "20.19.2"

This should fix the issue.

Changelog: [Internal]

Reviewed By: motiz88, cortinico

Differential Revision: D77938906

fbshipit-source-id: 48ca412f05d99459c4386499330584d9e560408b
2025-07-08 09:24:15 -07:00
Alex HuntandFacebook GitHub Bot fc5e33b582 Reorganise shared script utils (#52473)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52473

Shared utils that were located in the root of `scripts/` are now colocated closer to their dependencies or moved to `scripts/shared/` — simplifying the root directory layout.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D77873875

fbshipit-source-id: e04dba41a1ef811d32793931033fdfa93afad0cd
2025-07-08 06:10:36 -07:00
Pieter De BaetsandFacebook GitHub Bot 6dfe59e1df Fix missing bundle errors not correctly reported on Android (#52441)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52441

When an error is thrown using `handleHostException` from within the (immediate) execution of a `Task`, the `Task` will capture the error. If those errors are never consumed, the error is just silently swallowed. Instead we should make sure that this is raised outside of the context of a `Task` so the error correctly bubbles up and crashes the app (in release).

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D77798248

fbshipit-source-id: 41803aba0cace0e364a235501cf34bb946e7ff51
2025-07-08 05:58:56 -07:00
Moti ZilbermanandFacebook GitHub Bot db65cb70de Fix typo in new app screen
Summary:
TSIA

bypass-github-export-checks

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D77928389

fbshipit-source-id: 038d11bed3fbbb96c97b7e2c5727e91973de9078
2025-07-08 05:48:00 -07:00
Mateo GuzmánandFacebook GitHub Bot a0e11904d6 Clean up unnecessary test setup for Android tests (#52471)
Summary:
This came out of https://github.com/facebook/react-native/issues/52457 as I had to fix some tests and realised there is a lot of setup that could be shadow and other things that are not needed at all.

## Changelog:

[INTERNAL] - Clean up unnecessary test setup for Android tests

Pull Request resolved: https://github.com/facebook/react-native/pull/52471

Test Plan:
```sh
yarn test-android
```

Reviewed By: cortinico

Differential Revision: D77926887

Pulled By: javache

fbshipit-source-id: ff493d87633fcb4c4194b50cd374ad2e8acda974
2025-07-08 05:31:11 -07:00
Pieter De BaetsandFacebook GitHub Bot 120a417320 Cleanup react-native-codegen DEFS (#52468)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52468

* Re-enable tests
* Simplify logic to avoid bypasses for arc focus

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D77143018

fbshipit-source-id: 06ec43ce5149a139db78d38630191b01bc520461
2025-07-08 04:53:51 -07:00
Rubén NorteandFacebook GitHub Bot 5a79ece192 Use structuredClone to copy detail field in performance.mark and performance.measure (#52483)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52483

Changelog: [internal]

This is a small refinement for `performance.mark` and `performance.measure` to use `structuredClone` to copy the value of the `detail` field, instead of assigning it by reference.

This still doesn't completely fix the semantics of `performance.mark` and `performance.measure`, as the entries returned by those methods aren't referentially equal to the entries reported by `PerformanceObserver` (and the latter don't have the `detail` field yet).

Reviewed By: huntie

Differential Revision: D77863037

fbshipit-source-id: 54d959612ecd560250e49bb0887bb12112a0142f
2025-07-08 04:40:49 -07:00
Ruslan LesiutinandFacebook GitHub Bot f000116197 Fix Timestamps conversion for Custom Tracks (#52479)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52479

# Changelog: [Internal]

The previous cast is incorrect.

Reviewed By: javache

Differential Revision: D77894512

fbshipit-source-id: 67e6b9a4ed43020a343a2a9b5d702509c34ae41a
2025-07-08 04:34:14 -07:00
Vitali ZaidmanandFacebook GitHub Bot 5cf4d0899f Update debugger-frontend from 51a91a2...844f225 (#52486)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52486

Changelog: [Internal] - Update `react-native/debugger-frontend` from 51a91a2...844f225

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/51a91a2ad62e7f585912ed314a350a72de84d6ed...844f225009e6445d088ed0e431d1fc430325ed95).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [844f22500](https://github.com/facebook/react-native-devtools-frontend/commit/844f22500) | Vitali Zaidman (vzaidman@gmail.com) | 2025-07-08T10:16:09+01:00 | [Track when the stack trace symbolication succeeds (#187)](https://github.com/facebook/react-native-devtools-frontend/commit/844f22500) |
| [ffa6bb6af](https://github.com/facebook/react-native-devtools-frontend/commit/ffa6bb6af) | Vitali Zaidman (vzaidman@gmail.com) | 2025-07-07T16:21:55+01:00 | [parse "empty url" and "address at" frames as non-hyperlinked text (#188)](https://github.com/facebook/react-native-devtools-frontend/commit/ffa6bb6af) |

Reviewed By: robhogan

Differential Revision: D77926362

fbshipit-source-id: cbcf8b17cd175400d3d027ce2e8ebefa497f5d79
2025-07-08 04:15:32 -07:00
Marco WangandFacebook GitHub Bot 68650badd2 Pre-suppress errors for null_void for xplat js (#52480)
Summary:
Changelog: [Internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/52480

Reviewed By: SamChou19815

Differential Revision: D77890434

fbshipit-source-id: cc0571e0ff1c7cec3fff8614f688d46e46970cc4
2025-07-07 20:35:08 -07:00
Luna WeiandFacebook GitHub Bot 5ec8e60581 Refactor VirtualView target structure on Android (#52476)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52476

Changelog: [Internal] - Refactor package structure on Android to prepare for experimental VirtualView so that non-view related objects go under `virtual` and the native view goes under `view`.
This breaks dependency circles for experimental VirtualView in upcoming change.

Reviewed By: yungsters

Differential Revision: D77335426

fbshipit-source-id: 3b978e9cc5ad376c71aebc039cfc74d2515d2cfa
2025-07-07 16:00:13 -07:00
Alex HuntandFacebook GitHub Bot 918f02dcc3 Consolidate JS API scripts under scripts/js-api/, update docs (#52469)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52469

Organise `scripts/build-types/` and `scripts/diff-api-snapshot/` into a single grouping `scripts/js-api/` parent dir — matching the newly relocated `scripts/cxx-api/`.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D77865488

fbshipit-source-id: 33754d9275e65c3bda686294f18d855221ec7bff
2025-07-07 15:04:37 -07:00
Alex HuntandFacebook GitHub Bot 5fe782a800 Move cxx-api scripts under scripts/, add README (#52467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52467

Moves the WIP `cxx-public-api` project under `scripts/cxx-api/`, add minimal README docs.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D77865490

fbshipit-source-id: ce49845386c468ee7422b864c49f2a8c9eed5a70
2025-07-07 15:04:37 -07:00
Christoph PurrerandFacebook GitHub Bot abfb9cbd40 Update outdated ReactNativeCPP.api (#52475)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52475

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D77887914

fbshipit-source-id: 1431205eff716bac86610750103df729553d22b9
2025-07-07 14:50:58 -07:00
Pieter De BaetsandFacebook GitHub Bot 3bf5cb3d0e Deprecate MessageQueueThreadPerfStats (#52470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52470

These metrics are not actively consumed and are highly noisy.

Changelog: [Android][Removed] Deprecated MessageQueueThreadPerfStats API and replaced with stub.

Reviewed By: cortinico

Differential Revision: D77867087

fbshipit-source-id: 8bf7423ad60cb3bb21a5dbe94771d5a71832633d
2025-07-07 11:29:01 -07:00
Christoph PurrerandFacebook GitHub Bot ead669ade3 Remove unused ReactCommon/TurboModuleUtils functions #deepCopyJSIObject and #deepCopyJSIArray (#52443)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52443

Changelog: [General][Breaking] Remove unused ReactCommon/TurboModuleUtils functions #deepCopyJSIObject and #deepCopyJSIArray

Those are not used anymore

Reviewed By: cortinico

Differential Revision: D77771186

fbshipit-source-id: e1f5e34238567241b4204d58ff85fd9067e321df
2025-07-07 11:04:01 -07:00
Nicola CortiandFacebook GitHub Bot 625f69f284 @DeprecatedInNewArchitecture -> @Deprecated (#52399)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52399

I'm raising the deprecation warnings for those methods that are using legacy arch.
Previously the `DeprecatedInNewArchitecture` was not generating warnings for user in their builds, while now the Kotlin's/Java's `DeprecatedInNewArchitecture` it will.

Changelog:
[Android] [Changed] - Introduce more deprecation warnings for Legacy Arch classes

Reviewed By: mdvacca

Differential Revision: D77736713

fbshipit-source-id: bc21729ed8253d3ec6b6a40577bcd76622c3f8a6
2025-07-07 10:20:43 -07:00
Christoph PurrerandFacebook GitHub Bot 06034554e4 Remove SampleTurboCxxModule example (#52442)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52442

Changelog: [Internal]

The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore.

Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps:

https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules

It is not included in any RNTester app at this time

Reviewed By: cortinico

Differential Revision: D77771111

fbshipit-source-id: a4fe1d13fd0224babc46f54b921a036f7b237a48
2025-07-07 09:37:37 -07:00
Samuel SuslaandFacebook GitHub Bot 298ec6ca5d Deprecate ShadowNode::ListOfWeak and replace with std::vector<std::weak_ptr<const ShadowNode>> (#52401)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52401

changelog: [internal]

- Mark ShadowNode::ListOfWeak as deprecated with appropriate deprecation message
- Replace all usages of ShadowNode::ListOfWeak with std::vector<std::weak_ptr<const ShadowNode>>
- Updated primitives.h and ReactNativeCPP.api to use the explicit type instead of the alias

This change continues the effort to remove type aliases in favor of explicit standard library types for better code clarity and maintainability.

Reviewed By: christophpurrer

Differential Revision: D77652083

fbshipit-source-id: 79cad019e039c19f661346604ff49a44a4af7a79
2025-07-07 09:29:57 -07:00
Christoph PurrerandFacebook GitHub Bot c1200718a0 Move RuntimeExecutor after copying it into BufferedRuntimeExecutor (#52404)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52404

Changelog: [Internal]

https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h#L23

is a copy-able type (it will be copied when passed into the BufferedRuntimeExecutor constructor).

Hence we can `std::move` it in the `BufferedRuntimeExecutor` constructor

Reviewed By: javache

Differential Revision: D77758211

fbshipit-source-id: 634b1cd0e1ed4d27a013ad8927b2123dc6977ad8
2025-07-07 08:59:56 -07:00
Rubén NorteandFacebook GitHub Bot a3933e6878 Remove legacy tests for Performance API (#52465)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52465

Changelog: [internal]

Now that we have enough coverage for the Performance API in Fantom, Jest tests where most of the API is mocked are redundant and useless, so this removes them (and the mock).

Reviewed By: huntie

Differential Revision: D77860888

fbshipit-source-id: 7dbd1a8a43b056a3b34e4e37d578be9ccb521824
2025-07-07 06:42:23 -07:00
Rubén NorteandFacebook GitHub Bot 9f8179afa7 Add tests for durationThreshold option for PerformanceObserver (#52464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52464

Changelog: [internal]

This adds tests for the `durationThreshold` option for `PerformanceObserver.prototype.observe`.

Reviewed By: huntie

Differential Revision: D77860882

fbshipit-source-id: 1e56391166523d2c4f837f758bc367b58fe8e82e
2025-07-07 06:42:23 -07:00
Rubén NorteandFacebook GitHub Bot e6bff3f1fe Add tests for performance.eventCounts (#52463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52463

Changelog: [internal]

This adds Fantom tests for `performance.eventCounts`.

Reviewed By: huntie

Differential Revision: D77860881

fbshipit-source-id: 26b9ef56b9c610cbad7011bc0adde27251fda909
2025-07-07 06:42:23 -07:00
Rubén NorteandFacebook GitHub Bot feeef97554 Expand tests for the performance API (#52462)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52462

Changelog: [internal]

This adds a few more tests for `performance.getEntries`, `performance.getEntriesByName` and `performance.getEntriesByType`.

Reviewed By: huntie

Differential Revision: D77801746

fbshipit-source-id: 42f80c4e2b787c455b149ee38d071511181532b0
2025-07-07 06:42:23 -07:00
Rubén NorteandFacebook GitHub Bot 9005d93e32 Optimize performance.mark and performance.measure (#52429)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52429

Changelog: [internal]

This implements a significant optimization for `performance.mark` and `performance.measure`. After these changes, they take 1/3 of the time they took before.

We've seen these methods show up too often in traces (in the Hermes sampling profiler) so this should significantly reduce their overhead.

I found out that most of the time spent in `performance.mark` and `performance.measure` was creating the `PerformanceMark` and `PerformanceMeasure` instances returned by those methods. I applied the same playbook I did for `ReactNativeElement` (avoiding private fields and `super()` calls, which yielded these wins.

* Before

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '5579.80 ± 0.32%'    | '5479.00'           | '181368 ± 0.02%'           | '182515'                  | 179218  |
| 1       | 'mark (with custom startTime)'                            | '5759.72 ± 0.99%'    | '5648.00'           | '176162 ± 0.02%'           | '177054'                  | 173620  |
| 2       | 'measure (with start and end timestamps)'                 | '6506.38 ± 0.34%'    | '6390.00'           | '155503 ± 0.02%'           | '156495'                  | 153696  |
| 3       | 'measure (with mark names)'                               | '6770.94 ± 0.72%'    | '6620.00'           | '149833 ± 0.03%'           | '151057'                  | 147691  |
| 4       | 'clearMarks'                                              | '785.89 ± 0.07%'     | '771.00'            | '1291356 ± 0.01%'          | '1297017'                 | 1272442 |
| 5       | 'clearMeasures'                                           | '777.98 ± 0.06%'     | '761.00'            | '1303362 ± 0.01%'          | '1314060'                 | 1285383 |
| 6       | 'mark + clearMarks'                                       | '5995.34 ± 1.37%'    | '5779.00'           | '171874 ± 0.03%'           | '173040'                  | 166797  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '7040.28 ± 0.57%'    | '6830.00'           | '145289 ± 0.03%'           | '146413'                  | 142040  |
| 8       | 'measure + clearMeasures (with mark names)'               | '7184.43 ± 0.40%'    | '6990.00'           | '141809 ± 0.03%'           | '143062'                  | 139190  |

* After

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '1678.19 ± 0.73%'    | '1633.00'           | '607139 ± 0.01%'           | '612370'                  | 595882  |
| 1       | 'mark (with custom startTime)'                            | '1920.23 ± 1.30%'    | '1843.00'           | '538217 ± 0.01%'           | '542594'                  | 520772  |
| 2       | 'measure (with start and end timestamps)'                 | '2651.72 ± 0.94%'    | '2554.00'           | '388312 ± 0.02%'           | '391543'                  | 377114  |
| 3       | 'measure (with mark names)'                               | '2815.84 ± 0.75%'    | '2744.00'           | '362303 ± 0.02%'           | '364431'                  | 355134  |
| 4       | 'clearMarks'                                              | '743.82 ± 0.06%'     | '731.00'            | '1363190 ± 0.01%'          | '1367989'                 | 1344417 |
| 5       | 'clearMeasures'                                           | '776.69 ± 0.07%'     | '761.00'            | '1306563 ± 0.01%'          | '1314060'                 | 1287512 |
| 6       | 'mark + clearMarks'                                       | '2043.97 ± 1.26%'    | '1973.00'           | '504750 ± 0.01%'           | '506842'                  | 489801  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '3048.39 ± 0.87%'    | '2965.00'           | '335285 ± 0.02%'           | '337268'                  | 328042  |
| 8       | 'measure + clearMeasures (with mark names)'               | '3132.75 ± 0.80%'    | '3065.00'           | '324365 ± 0.02%'           | '326264'                  | 319209  |

Reviewed By: huntie

Differential Revision: D77790874

fbshipit-source-id: baf7aca07d281fef4373956d125c63f006fab592
2025-07-07 06:42:23 -07:00
Rubén NorteandFacebook GitHub Bot 74c03b67e3 Fix bugs in performance.mark and performance.measure (#52430)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52430

Changelog: [internal]

(This is marked as internal because this API hasn't been marked as stable yet).

This fixes multiple bugs and missing features in `performance.mark` and `performance.measure`. See re-enabled tests to see the specific behaviors.

Validated that performance isn't regressed by this change using the existing benchmark for `Performance` (`Performance-benchmark-itest`):

* Before

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '5557.96 ± 0.34%'    | '5459.00'           | '182114 ± 0.02%'           | '183184'                  | 179922  |
| 1       | 'mark (with custom startTime)'                            | '5664.54 ± 1.71%'    | '5518.00'           | '180296 ± 0.02%'           | '181225'                  | 176537  |
| 2       | 'measure (with start and end timestamps)'                 | '6653.62 ± 0.94%'    | '6530.00'           | '152296 ± 0.02%'           | '153139'                  | 150295  |
| 3       | 'measure (with mark names)'                               | '6903.37 ± 0.42%'    | '6790.00'           | '146429 ± 0.02%'           | '147275'                  | 144857  |
| 4       | 'clearMarks'                                              | '782.98 ± 0.04%'     | '771.00'            | '1287735 ± 0.01%'          | '1297017'                 | 1277173 |
| 5       | 'clearMeasures'                                           | '792.24 ± 0.03%'     | '781.00'            | '1270847 ± 0.01%'          | '1280410'                 | 1262238 |
| 6       | 'mark + clearMarks'                                       | '5883.69 ± 0.52%'    | '5759.00'           | '172863 ± 0.02%'           | '173641'                  | 169962  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '7222.22 ± 0.68%'    | '7021.00'           | '141204 ± 0.02%'           | '142430'                  | 138462  |
| 8       | 'measure + clearMeasures (with mark names)'               | '7234.53 ± 0.34%'    | '7121.00'           | '139600 ± 0.02%'           | '140430'                  | 138227  |

* After

| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '5579.80 ± 0.32%'    | '5479.00'           | '181368 ± 0.02%'           | '182515'                  | 179218  |
| 1       | 'mark (with custom startTime)'                            | '5759.72 ± 0.99%'    | '5648.00'           | '176162 ± 0.02%'           | '177054'                  | 173620  |
| 2       | 'measure (with start and end timestamps)'                 | '6506.38 ± 0.34%'    | '6390.00'           | '155503 ± 0.02%'           | '156495'                  | 153696  |
| 3       | 'measure (with mark names)'                               | '6770.94 ± 0.72%'    | '6620.00'           | '149833 ± 0.03%'           | '151057'                  | 147691  |
| 4       | 'clearMarks'                                              | '785.89 ± 0.07%'     | '771.00'            | '1291356 ± 0.01%'          | '1297017'                 | 1272442 |
| 5       | 'clearMeasures'                                           | '777.98 ± 0.06%'     | '761.00'            | '1303362 ± 0.01%'          | '1314060'                 | 1285383 |
| 6       | 'mark + clearMarks'                                       | '5995.34 ± 1.37%'    | '5779.00'           | '171874 ± 0.03%'           | '173040'                  | 166797  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '7040.28 ± 0.57%'    | '6830.00'           | '145289 ± 0.03%'           | '146413'                  | 142040  |
| 8       | 'measure + clearMeasures (with mark names)'               | '7184.43 ± 0.40%'    | '6990.00'           | '141809 ± 0.03%'           | '143062'                  | 139190  |

Reviewed By: huntie

Differential Revision: D77795990

fbshipit-source-id: 97895065ca63f87f1f66710cf7bce97e1255a142
2025-07-07 06:42:23 -07:00
Rubén NorteandFacebook GitHub Bot 34201d8387 Fix Flow types for performance.measure (#52431)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52431

Changelog: [internal]

`performance.measure` supports passing mark names as `start` and `end` options, so this fixes the Flow type before fixing the actual implementation.

It also makes it so you can't specify both `end` and `duration`, enforced by the type system.

Reviewed By: huntie

Differential Revision: D77795991

fbshipit-source-id: e89f509c7efc2fa49d17d79bc19bc1d14e007871
2025-07-07 06:42:23 -07:00
Rubén NorteandFacebook GitHub Bot 2edda6d967 Add basic Fantom tests for performance.mark and performance.measure (#52432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52432

Changelog: [internal]

This creates a battery of tests for `performance.mark` and `performance.measure`. For this, it was necessary to add a new method in the native module to mock the current time.

Many of the tests are currently failing, as the API doesn't support all the options or behaviors defined in the spec. They're skipped here and will be re-enabled and fixed in a following diff.

Reviewed By: huntie

Differential Revision: D77795989

fbshipit-source-id: 3ebf18c8ac336df1fb43003a55a4678b52e8982d
2025-07-07 06:42:23 -07:00
Samuel SuslaandFacebook GitHub Bot 1c51d6684b Deprecate ShadowNode::ListOfShared and migrate to std::vector<std::shared_ptr<const ShadowNode>> (#52402)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52402

changelog: [internal]

Mark ShadowNode::ListOfShared as deprecated and replace most usages throughout the React Native renderer codebase with the explicit std::vector<std::shared_ptr<const ShadowNode>> type. This improves code clarity by making the container type explicit rather than relying on a type alias.

Reviewed By: christophpurrer

Differential Revision: D77651676

fbshipit-source-id: 8c4bd9b8cbbe467384b947ef9e7a4524f2053e36
2025-07-07 06:15:29 -07:00
szymonrybczakandFacebook GitHub Bot 9d63098520 chore: bump @react-native-community/cli* devDependencies to 20.0.0-alpha (#52460)
Summary:
Upgrade `react-native-community/cli` to version 20.

## Changelog:

[INTERNAL] [CHANGED] - Upgrade react-native-community/cli to v20

Pull Request resolved: https://github.com/facebook/react-native/pull/52460

Test Plan: n/a

Reviewed By: huntie

Differential Revision: D77860027

Pulled By: cortinico

fbshipit-source-id: 3eb3942b38091b4216628b94cdf1449838daa8d3
2025-07-07 05:17:07 -07:00
Alex HuntandFacebook GitHub Bot 9d4d8dcb02 Move BugReporting module out of open source repo (#52425)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52425

Changelog:
[General][Breaking] - All `react-native/Libraries/BugReporting` APIs have been removed

Reviewed By: javache

Differential Revision: D77014767

fbshipit-source-id: a074fb952948a58259be66033e1f85e04bacf2de
2025-07-07 05:08:57 -07:00
Alex HuntandFacebook GitHub Bot caff37df5a Remove internal calls to BugReporting (#52374)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52374

Precursor to removing `BugReporting` from React Native's internals.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77014724

fbshipit-source-id: 91cd38fe6c39656573fecdeff18162073df2fb42
2025-07-07 05:08:57 -07:00
Christoph PurrerandFacebook GitHub Bot 7998914471 Remove outdated SampleTurboCxxModuleLegacyImpl (#52412)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52412

Changelog: [Internal]

The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore.

Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps:

https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules

It is not included in any RNTester app at this time

Reviewed By: cortinico

Differential Revision: D77770455

fbshipit-source-id: 987c9f2b9ab4145a2f6a724aad12d8473957dbe8
2025-07-06 22:35:20 -07:00
Christoph PurrerandFacebook GitHub Bot 94aca598c7 Remove unused #include <ReactCommon/TurboModuleUtils.h> (#52411)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52411

Changelog: [Internal]

Reviewed By: javache, cortinico

Differential Revision: D77770244

fbshipit-source-id: a300e377f8c6e52256ae04813c1372799cf5af59
2025-07-06 21:21:48 -07:00
Christoph PurrerandFacebook GitHub Bot 5e650d0105 Remove more unused #includes (#52389)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52389

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D77706943

fbshipit-source-id: b8662737699ec0857845cfded49302ee9e93b78e
2025-07-06 20:56:16 -07:00
Christoph PurrerandFacebook GitHub Bot 9d5033afb0 Delete non C++ Turbo Module SampleCxxModule (#52407)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52407

Changelog: [Internal]

The sample is from an outdated approach of enabling C++ Modules in RN which is not recommended anymore.

Prefer C++ Turbo Modules if you need to expose / access C or C++ APIs in RN apps:

https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules

Reviewed By: javache

Differential Revision: D77765443

fbshipit-source-id: 112fef4c1a7e1c567f3c1d471728a1dfc926adc6
2025-07-06 19:54:06 -07:00
Christoph PurrerandFacebook GitHub Bot e8709355dc C++ Turbo Module > Allow Promise<void> types (#52388)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52388

Changelog: [Internal]

Similar to `AsyncCallback<>` (the foundation of `AsyncPromise`) we should allow `void` Promise types in C++ such as `AsyncPromise<>`

Reviewed By: rbergerjr

Differential Revision: D77712020

fbshipit-source-id: d7360df5cc1b77f1e03e5fb73b0b468f6e3a415b
2025-07-06 19:53:51 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 255977a7b9 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/react/utils (#52444)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52444

Reviewed By: dtolnay

Differential Revision: D77782134

fbshipit-source-id: 99989d45926a0eabcc6e19e12dce396a473e14ce
2025-07-06 13:33:29 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 8531015941 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon [A] (#52437)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52437

Reviewed By: cortinico

Differential Revision: D77790078

fbshipit-source-id: 3188cce596ffa382ca3a9bd27cd0aba8580bbb76
2025-07-06 13:30:04 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 4e62558e43 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon [B] (#52434)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52434

Reviewed By: cortinico

Differential Revision: D77790202

fbshipit-source-id: 35b5bb46e8056cddf874b05bf511754878f0e1fc
2025-07-06 12:32:42 -07:00
Rob HoganandFacebook GitHub Bot 5cdea3c295 Remove last use of Metro deep imports (#52456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52456

Remove the last use of a Metro deep import in preparation for making all deep imports semver-private.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77450110

fbshipit-source-id: de7aa9c1f6b0d281fe8a6c3bd95e721c5bb58c63
2025-07-06 05:33:25 -07:00
Rob HoganandFacebook GitHub Bot 083644647e Update to Metro ^0.82.5 (#52454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52454

Bump Metro minimum from 0.82.4 to 0.82.5

Release notes: https://github.com/facebook/metro/releases/tag/v0.82.5

Changelog: [General][Changed] Bump Metro to ^0.82.5

Reviewed By: huntie

Differential Revision: D77450102

fbshipit-source-id: 7b0fdcbeb63d8021996ca82f98773145179c8a50
2025-07-06 04:30:38 -07:00
Alex HuntandFacebook GitHub Bot 987e3f8c00 Make NetworkingModule handlers internal (#52438)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52438

Motivation: After some investigation, these make sense as private APIs, and we intend to modify `UriHandler` slightly in order to report blob response body payloads via CDP for Network debugging.

Changelog:
[Android][Removed] - Internalize `NetworkingModule`'s `UriHandler`, `RequestBodyHandler`, and `ResponseHandler` APIs

Reviewed By: cortinico

Differential Revision: D77799144

fbshipit-source-id: 20c36f52a900830091a253ab9917832c30b31d31
2025-07-05 09:07:22 -07:00
Nick LefeverandFacebook GitHub Bot 27723c70b7 Clean up prop diffing gen (#52436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52436

Reordered the different property types in the switch/case to group similar outputs together.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D77799101

fbshipit-source-id: 5b7c6d188e9ffa0f1e41f44f82f438afeda04d74
2025-07-05 06:19:23 -07:00
generatedunixname89002005287564andFacebook GitHub Bot dcd430721f Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/reactperflogger/reactperflogger [A] (#52433)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52433

Reviewed By: cortinico

Differential Revision: D77789924

fbshipit-source-id: 017ab5456bf25f40cd4b283d0405498f6e1e2e00
2025-07-04 16:20:30 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 22ccf8a6f5 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/reactperflogger/reactperflogger [B] (#52435)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52435

Reviewed By: cortinico

Differential Revision: D77789998

fbshipit-source-id: 9ac93f890c9df245a105b71369dc91501deb78a4
2025-07-04 15:38:07 -07:00
Ruslan LesiutinandFacebook GitHub Bot c302902b1d upgrade[react-devtools]: 6.1.5 (#52440)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52440

# Changelog:
[General] [Changed] - Bumped React DevTools to 6.1.5

Reviewed By: huntie

Differential Revision: D77799615

fbshipit-source-id: aa010176f6378f6306e8a2a45fad7afe002a609c
2025-07-04 14:26:08 -07:00
Sam ZhouandFacebook GitHub Bot 0666885f6a Deploy 0.275.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D77800436

fbshipit-source-id: ff5a6a629c950959678d6a6311cda053f6b5dd4c
2025-07-04 11:55:28 -07:00
Nicola CortiandFacebook GitHub Bot efdf73983c Deprecate the DefaultNewArchitectureEntryPoint.load(Boolean, Boolean, Boolean) (#52439)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52439

Users should not be passing true/false values for the 3 params in the `load()` method. The app template already uses the no param overload.
I'm deprecating it so it can go in 0.81.

Changelog:
[Android] [Changed] - Deprecate the DefaultNewArchitectureEntryPoint.load(Boolean, Boolean, Boolean)

Reviewed By: rubennorte

Differential Revision: D77739268

fbshipit-source-id: c901d1ed2e9623b0fa39f4e2d79f25404c284b8d
2025-07-04 10:33:18 -07:00
Ruslan LesiutinandFacebook GitHub Bot 377baa2ef6 Update debugger-frontend from 35c4630...51a91a2
Summary:
Changelog: [Internal] - Update `react-native/debugger-frontend` from 35c4630...51a91a2

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/35c4630bd58bbcbc6f4c54c084b4e52994dc4940...51a91a2ad62e7f585912ed314a350a72de84d6ed).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [51a91a2ad](https://github.com/facebook/react-native-devtools-frontend/commit/51a91a2ad) | Ruslan Lesiutin (28902667+hoxyq@users.noreply.github.com) | 2025-07-04T14:04:02+01:00 | [bump: react-devtools@6.1.4 (#189)](https://github.com/facebook/react-native-devtools-frontend/commit/51a91a2ad) |
| [761b96907](https://github.com/facebook/react-native-devtools-frontend/commit/761b96907) | Vitali Zaidman (vzaidman@gmail.com) | 2025-07-04T12:55:39+01:00 | [fixed missing new line before string error causes (#186)](https://github.com/facebook/react-native-devtools-frontend/commit/761b96907) |
| [7774c38db](https://github.com/facebook/react-native-devtools-frontend/commit/7774c38db) | Alex Hunt (hello@alexhunt.dev) | 2025-06-30T13:20:49+01:00 | [Disable request initiator panel in NetworkItemView (#185)](https://github.com/facebook/react-native-devtools-frontend/commit/7774c38db) |

Reviewed By: huntie

Differential Revision: D77795834

fbshipit-source-id: 3c30f8e87593687415538902734b09b3144b70a4
2025-07-04 08:09:12 -07:00
Ruslan LesiutinandFacebook GitHub Bot c9e44fbcf2 upgrade[react-devtools]: 6.1.4 (#52426)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52426

# Changelog:
[General] [Changed] - Bumped React DevTools to 6.1.4

Reviewed By: huntie

Differential Revision: D77794756

fbshipit-source-id: 4b8a795a809f5e72e8753d65435c97212e38dd8a
2025-07-04 08:09:12 -07:00
Alex HuntandFacebook GitHub Bot f753158da4 Add JS implementation for PerformanceResourceTiming (#52427)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52427

Adds and wires up a minimal implementation of `PerformanceResourceTiming` on the JS side. This materialises D74245441 in user space.

When all feature flags are enabled, network requests can now be observed from JS via `PerformanceObserver`.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D75062713

fbshipit-source-id: 06523e70f57feaaa53432ef21fa92676d1e90360
2025-07-04 07:07:20 -07:00
Ian ChildsandFacebook GitHub Bot d2b55ad1ba Use build instead of targets in check-api.sh (#52424)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52424

This makes sure the output is actually materialized.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D77793365

fbshipit-source-id: 5505abd0f4c2994f4ced1c27a506d9199f9454ca
2025-07-04 06:17:14 -07:00
Alex HuntandFacebook GitHub Bot 962a7dda44 Expose unstable_TextAncestorContext API (#52368)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52368

Motivated by https://github.com/react-native-community/discussions-and-proposals/discussions/893#discussioncomment-13497461.

Also align naming for internal usages.

Changelog:
[General][Added] - Expose `unstable_TextAncestorContext` API

Reviewed By: NickGerleman

Differential Revision: D77141176

fbshipit-source-id: d9a57d923994188f5ce7e0608ea28fdca98db860
2025-07-04 06:09:38 -07:00
Samuel SuslaandFacebook GitHub Bot bc4bce61df remove uses of ShadowNode::Shared from ShadowNode.cpp (#52422)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52422

changelog: [internal]

In https://github.com/facebook/react-native/pull/52393 not all uses of ShadowNode::Shared were removed. Github CI fails if a deprecated API is used. Let's remove the last uses.

Reviewed By: cortinico

Differential Revision: D77790411

fbshipit-source-id: 6fbbbffaa784de1f0939d1032dc7ea6586f2ce7d
2025-07-04 04:49:12 -07:00
Mohamed SalamaandFacebook GitHub Bot b4dcc9831e Revert D77547628: Fix Dimensions window values on Android < 15
Differential Revision:
D77547628

Original commit changeset: 9d841f642d5b

Original Phabricator Diff: D77547628

fbshipit-source-id: 80ee528740eb4b39816e7873939d74e29d64caec
2025-07-04 04:19:27 -07:00
Nicola CortiandFacebook GitHub Bot 2d0aa1a747 Revert Refactor ViewManagerInterfaces codegen to generate kotlin classes
Summary:
reverting Refactor ViewManagerInterfaces codegen to generate kotlin classes because of warning in OSS, we will reland after 0.81 cut

Changelog: [Android][Breaking] - Revert of Migrate ViewManagerInterfaces to kotlin. Some types in code generated ViewManagerInterfaces might differ. e.g. this will start enforcing nullability in parameters of viewManagerInterface methods (e.g. String commands parameters are not nullable, view params are not nullable in any method, etc)

Reviewed By: lenaic, mlord93

Differential Revision: D77759777

fbshipit-source-id: c24b216b231cdc53296d8c9fca8d789d80daa596
2025-07-04 02:48:42 -07:00
Samuel SuslaandFacebook GitHub Bot 0e175ce5b6 Mark ShadowNode::Shared as deprecated and replace all usages (#52393)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52393

## Changelog:
[General][Deprecated] - ShadowNode::Shared is now deprecated. Use `std::shared_ptr<const ShadowNode>` instead.

- Mark ShadowNode::Shared as deprecated in ShadowNode.h
- Replace all uses of ShadowNode::Shared with std::shared_ptr<const ShadowNode>.

This continues the systematic effort to remove ShadowNode type aliases in favor of explicit standard library types for improved code clarity and maintainability.

Reviewed By: christophpurrer

Differential Revision: D77650696

fbshipit-source-id: b4769e2a1e39f49d14d5927be105487ecf69fa3f
2025-07-04 00:29:54 -07:00
Christoph PurrerandFacebook GitHub Bot 2ce7eab5f9 Remove unused RAIICallbackWrapperDestroyer (#52390)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52390

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77710424

fbshipit-source-id: 7c1d7e3181450394311a001af117c6fbdcaeba31
2025-07-03 16:44:16 -07:00
Nicola CortiandFacebook GitHub Bot ccb9edc717 Remove deprecated isStartSamplingProfilerOnInit from DeveloperSettings (#52405)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52405

This field has been deprecated since RN 0.77, we can safely remove it ahead of the branch cut.

Changelog:
[Android] [Removed] - Remove deprecated `isStartSamplingProfilerOnInit` from `DeveloperSettings`

Reviewed By: mdvacca, javache

Differential Revision: D77734913

fbshipit-source-id: 231ecb360921d48ec941a3a214e73b4b89446c13
2025-07-03 15:28:06 -07:00
Nicola CortiandFacebook GitHub Bot f2ecb7e42c Make loadWithFeatureFlags correctly internal (#52395)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52395

This method was exposed as `public` but there is no need for us to expose it in OSS.
So I'm marking it as internal.

Changelog:
[Internal] [Changed] - Make loadWithFeatureFlags correctly internal

Reviewed By: mlord93, mdvacca, javache

Differential Revision: D77734270

fbshipit-source-id: 34e1d7aaa4a5bf3563c78aad570e2310592bcc77
2025-07-03 15:17:38 -07:00
Christoph PurrerandFacebook GitHub Bot 47fe09f505 Make virtual destructors default implemented - instead of empty one (#52382)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52382

Changelog: [Internal]

In C++, both `virtual ~CallInvoker() {}` and `virtual ~CallInvoker() = default` can be used to define a virtual destructor. However, they have slightly different implications:

1. `virtual ~CallInvoker() {}`:
    * This is the traditional way of defining a virtual destructor.
    * It provides an empty implementation for the destructor, which does nothing.
    * The compiler will not generate a default implementation, as you've provided one explicitly.
2. `virtual ~CallInvoker() = default`:
    * This is a more modern way of defining a virtual destructor (introduced in C++11).
    * It tells the compiler to generate a default implementation for the destructor.
    * The default implementation will perform the necessary cleanup operations, such as calling the destructors of base classes and member variables.

In general, `= default` is considered better because it:
* Avoids unnecessary code duplication: By letting the compiler generate the default implementation, you avoid duplicating code that's already generated by the compiler.
* Improves maintainability: If the class has member variables or base classes with non-trivial destructors, using `= default` ensures that the correct cleanup operations are performed without requiring manual updates.
* Conveys intent: Using `= default` clearly indicates that the destructor should perform its default behavior, making the code easier to understand.

So, unless you have a specific reason to provide a custom implementation, `virtual ~CallInvoker() = default` is generally the better choice.

Reviewed By: rshest

Differential Revision: D77685932

fbshipit-source-id: 78c81f8e400069ad38d8d7405dafeb0b6db8e67b
2025-07-03 13:32:28 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot c9f1778faf Implement accessibilityOrder by building the accessibilityTree through addChildrenForAccessibility (#52347)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52347

We can build an accessibility tree for Talkback by overriding addChildrenForAccessibility of ViewGroup.

With this we just manually build a tree that contains the elements we care about in the order we want.

We also try to keep most of the tree intact so that coopting works properly
Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D77258926

fbshipit-source-id: 767ebc880a2efbf7934b9e7dee3013dd7822e5ad
2025-07-03 12:56:35 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 5b245767d6 Remove Virtual View accessibilityOrder implementation (#52297)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52297

Doing virtual views is the only way of making it possible to add the host view into the order. This however is too complex for very little gain, we are opting to go for a cleaner solution with the trade off of not being able to add the host view.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D77278752

fbshipit-source-id: 709b995f51a9a03f6d07f2e24f8aea21d62d95c4
2025-07-03 12:56:35 -07:00
David VaccaandFacebook GitHub Bot 76ff1aa5c6 Refactor ViewManagerInterfaces codegen to generate kotlin classes (#51735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51735

This diff refactors the ViewManagerInterfaces codegen to generate kotlin classes,

As a consequence of this change, there are some ViewManagerInterfaces that have changed their APIs

## Changelog: [Android][Breaking] - Migrate ViewManagerInterfaces to kotlin. Some types in code generated ViewManagerInterfaces might differ. e.g. this will start enforcing nullability in parameters of viewManagerInterface methods (e.g. String commands parameters are not nullable, view params are not nullable in any method, etc)

Reviewed By: javache

Differential Revision: D75719542

fbshipit-source-id: 7e9aa7ccc24e827bd7b6df72b3302e852932e731
2025-07-03 12:19:42 -07:00
Christoph PurrerandFacebook GitHub Bot 253606239b CallInvoker > Remove unused includes (#52381)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52381

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D77685836

fbshipit-source-id: a01aedf51463d228ca14d37dc4a0869e6e9208c9
2025-07-03 11:56:03 -07:00
Ruslan LesiutinandFacebook GitHub Bot 3561791ff8 fix: rename bottom stack frame (#33680) (#52400)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52400

`react-stack-bottom-frame` -> `react_stack_bottom_frame`.

This survives `babel/plugin-transform-function-name`, but now frames
will be displayed as `at Object.react_stack_bottom_frame (...)` in V8.
Checks that were relying on exact function name match were updated to
use either `.indexOf()` or `.includes()`

For backwards compatibility, both React DevTools and Flight Client will
look for both options. I am not so sure about the latter and if React
version is locked.

DiffTrain build for [91d097b2c588a0977a7a10ed12512dc8a34e3a5b](https://github.com/facebook/react/commit/91d097b2c588a0977a7a10ed12512dc8a34e3a5b)

Reviewed By: jackpope

Differential Revision: D77601866

fbshipit-source-id: 24ed8713af4bebbaeb7a612333cd79c51b696565
2025-07-03 11:38:05 -07:00
Mathieu ActhernoeneandFacebook GitHub Bot 85d10ed904 Fix Dimensions window values on Android < 15 (#47554)
Summary:
This PR (initially created for edge-to-edge opt-in support, rebased multiple times) fixes the `Dimensions` API `window` values on Android < 15, when edge-to-edge is enabled.

Currently the window height doesn't include the status and navigation bar heights (but it does on Android >= 15):

<img width="300" alt="Screenshot 2025-06-27 at 16 23 02" src="https://github.com/user-attachments/assets/c7d11334-9298-4f7f-a75c-590df8cc2d8a" />

Using `WindowMetricsCalculator` from AndroidX:

<img width="300" alt="Screenshot 2025-06-27 at 16 34 01" src="https://github.com/user-attachments/assets/7a4e3dc7-a83b-421b-8f6d-fd1344f5fe81" />

Fixes https://github.com/facebook/react-native/issues/47080

## Changelog:

[Android] [Fixed] Fix `Dimensions` `window` values on Android < 15 when edge-to-edge is enabled

Pull Request resolved: https://github.com/facebook/react-native/pull/47554

Test Plan:
Run the example app on an Android < 15 device.

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D77547628

Pulled By: alanleedev

fbshipit-source-id: 9d841f642d5b7ef3294dfbf3868137087a672ad6
2025-07-03 11:37:55 -07:00
Ruslan LesiutinandFacebook GitHub Bot facdc2f6f4 Support rename of React stack bottom frame (#52398)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52398

# Changelog: [Internal]

Adaptation for https://github.com/facebook/react/pull/33680.

Reviewed By: jackpope

Differential Revision: D77737710

fbshipit-source-id: 6c6893935e8da8175c0cd9ceab21cc05e2092e7a
2025-07-03 09:34:58 -07:00
Enrique López MañasandFacebook GitHub Bot 477d8df312 Updated targetSdk to 36 (#52355)
Summary:
We need to upgrade the targetSdk to 36, which requires ensuring compatibility with the latest Android APIs and addressing any deprecations or behavior changes introduced in this version.

## Changelog:

[Android] [Changed] - Updated targetSdk to 36 in Android.

Pull Request resolved: https://github.com/facebook/react-native/pull/52355

Test Plan:
- Verified that the app builds and runs successfully with targetSdkVersion 36.

- Ran the full suite of unit and instrumentation tests: all tests passed.

- Manually tested key user flows (login, navigation, data sync) on devices running Android 14 (API 34) and emulator with API 36

- Confirmed that there are no runtime crashes or warnings related to `targetSDK` upgrade.

Behavioral guide for migration: https://developer.android.com/about/versions/16/behavior-changes-16

Reviewed By: fabriziocucci

Differential Revision: D77728391

Pulled By: cortinico

fbshipit-source-id: 3f714f900bbeecc56c0cf46c54b4e42c532c8384
2025-07-03 08:01:47 -07:00
Nicola CortiandFacebook GitHub Bot 2e724e4743 Add changelog for 0.80.1 (#52392)
Summary:
Just the changelog for 0.80.1

## Changelog:

[INTERNAL] - Add changelog for 0.80.1

Pull Request resolved: https://github.com/facebook/react-native/pull/52392

Test Plan: N/A

Reviewed By: fabriziocucci

Differential Revision: D77725130

Pulled By: cortinico

fbshipit-source-id: 2eddb56e8893e0d8e71a6509b1303b3b9cab8769
2025-07-03 06:57:20 -07:00
Alex HuntandFacebook GitHub Bot f4a9aa3525 Implement connectionTiming and dataReceived NetworkReporter methods (#52335)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52335

Adds support for `Network.requestWillBeSentExtraInfo` and `Network.dataReceived` CDP events in jsinspector-modern and wires up for iOS.

In particular, `Network.requestWillBeSentExtraInfo` is necessary to populate request headers in the UI.

**End of base Network implementation for iOS**

After this diff, we are spec-complete on all CDP Network methods for our V1, on iOS.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D77489476

fbshipit-source-id: 84aa4da9d9fcbdc61eff236fc6bd2136496910a5
2025-07-03 05:01:57 -07:00
Alex HuntandFacebook GitHub Bot ebb831a0c9 Implement Network.loadingFailed (#52334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52334

Adds support for `Network.loadingFailed` in jsinspector-modern and wires up for iOS.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D77489477

fbshipit-source-id: dc8156979fe49583819019fa4b88b6eb99dea734
2025-07-03 05:01:57 -07:00
Alex HuntandFacebook GitHub Bot 68342a4d12 Support CDP response previews for chunked data (#52331)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52331

Updates the iOS inputs to `NetworkReporter` to support incremental string data HTTP responses (`Transfer-Encoding: chunked`).

This means that incremental responses, such as Metro bundle requests, can be displayed as previews in React Native DevTools.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D77457109

fbshipit-source-id: 00a622dbac97c38e07c67b5ee3661c8d586f6fe1
2025-07-03 05:01:57 -07:00
Alex HuntandFacebook GitHub Bot 94c97db4da Implement Network.getResponseBody (#52332)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52332

Adds support for the [`Network.getResponseBody`](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getResponseBody) CDP event in `jsinspector-modern` and configures this for iOS. This enables us to populate the "Preview" and "Response" tabs in the React Native DevTools Network panel.

This is integrated with `RCTNetworking.mm` to support synchronously received `text` or `blob` data types, with incremental response support added next in D77457109.

**Implementation notes**

- Adds a new `BoundedRequestBuffer` construct to safely buffer response previews at a max memory size.
- `RCTNetworking` will always call `maybeStoreResponseBody` (when feature flag enabled), but is unaware whether there is an active CDP debugging session with network support or not.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D74319394

fbshipit-source-id: c9dbb44551c15d1b1a7cce56b35bf829f8a99dc7
2025-07-03 05:01:57 -07:00
Eric RozellandFacebook GitHub Bot 9253fc3b42 Defer focus cell render mask updates (#52380)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52380

Apps that rely support focus in FlatList rendered items are missing out on a FlatList optimization that defers rendering for offscreen content updates.

For example, on Android, if you focus and smooth scroll an item into view, the onScroll event will fire first. For most sufficiently large virtualization windows, the next render will be delayed by the render batch timeout as most materialization of virtualized views is not treated as a high pri render.

However, this batch / timeout mechanism isn't being used for cell render updates that occur as a result of a focus change.

This change adds the same timeout mechanism used for scroll events. In most cases, the view that is focused is in the viewport, and the extra rendering needed is already scheduled (or executed with high priority if needed) when the onScroll event is processed.

In cases where the focus change occurs outside the viewport, most platforms will want to do some kind of "bring into view" anyway, and the same applies - onScroll will take care of scheduling the cell rendering priority.

## Changelog

[Internal]

Reviewed By: NickGerleman

Differential Revision: D77681274

fbshipit-source-id: 1ade377e513eca21338a380ff9299dd410606aec
2025-07-03 04:15:41 -07:00
Nicola CortiandFacebook GitHub Bot 45fd7feb9f Convert UIManagerModuleConstantsHelper to Kotlin (#52358)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52358

Another class going from Java to Kotlin.
This is quite involved due to the amount of Raw generics we were using so I'd appreaciate a couple of further eyes here.

Changelog:
[Android] [Changed] - Convert UIManagerModuleConstantsHelper to Kotlin

Reviewed By: mdvacca, javache

Differential Revision: D77589975

fbshipit-source-id: 477c1e2a8dfd31db60047fd1252f6d47c177f5c7
2025-07-03 02:52:01 -07:00
Nicola CortiandFacebook GitHub Bot 6cb8dc37c7 RNGP - Add support for exclusiveEnterpriseRepository (#52378)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52378

This adds a Gradle property called `exclusiveEnterpriseRepository`
that users can set in their `android/gradle.properties` as such:

```diff
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true

+exclusiveEnterpriseRepository=https://my.internal.proxy.net/
```

This will remove all the existing Maven repositories and only use the internal mirror they have.

Changelog:
[Android] [Added] - RNGP - Add support for `exclusiveEnterpriseRepository` to specify an internal Maven mirror.

Reviewed By: mdvacca

Differential Revision: D77667573

fbshipit-source-id: 835004d2ae7aa4e250b6f7a88a41918b573f5bd5
2025-07-03 02:27:08 -07:00
Joe VilchesandFacebook GitHub Bot cec0de8f99 Change Scroller getter to protected (#52387)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52387

I would like to grab this in a subclass but unfortunately can't. It is kinda jank since this is a val obtained via reflection, but I figure this is better than copy and paste. I think that I could also expose a function that uses this scroller the way I want it to. Let me know if there are strong objections here

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D77684599

fbshipit-source-id: 6f02c1da5135c1cf34fa1483542e06bf8f0be75e
2025-07-02 22:13:16 -07:00
nishan (o^▽^o)andFacebook GitHub Bot 097d482446 fix(ios): Correct gradient interpolation for when transitioning to transparent color (#52249)
Summary:
This change fixes an issue on iOS where gradients that fade to a transparent color-stop appear dark or "muddy." The fix ensures that the color's hue is preserved during the transition, matching the behavior on Android and web.

### The Problem
When creating a gradient on iOS (e.g., linear-gradient(red, transparent)), the transparent keyword is treated as transparent black (rgba(0,0,0,0)). The `CAGradientLayer` on iOS then interpolates all color channels linearly, causing the red, green, and blue components of the start color to fade to 0. This transition through black results in an undesirable dark or "muddy" appearance in the middle of the gradient.

## Changelog:
[IOS][FIXED] - Gradient interpolation for transparent colors
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/52249

Test Plan:
Checkout `LinearGradient` example in RNTester, checkout the newly added transparent color transition example, it should render same on android and iOS.

| Before | After |
| --- | --- |
| <img src="https://github.com/user-attachments/assets/c0bb54ad-ed0e-4a80-b37f-0458af0f1f77" width="300"> | <img src="https://github.com/user-attachments/assets/02da921a-bd0e-45c1-881c-cf6460d5ed43" width="300"> |
| `linear-gradient(to right, red, transparent)` transitions to black on iOS, creating a dark effect. | The gradient correctly fades the red color's alpha channel to zero |

Reviewed By: javache

Differential Revision: D77312194

Pulled By: NickGerleman

fbshipit-source-id: 053df8e44f52cd22a3f28fd01f583f7d03c66af5
2025-07-02 17:55:45 -07:00
Nick GerlemanandFacebook GitHub Bot 508b1526d9 Avoid array copies on every MapBuffer read (#52386)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52386

Enum `values()` function makes a copy of an underlying array on each call. This happens in a hot path, and seems to show up during profiling. Let's cache it.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D77623705

fbshipit-source-id: 5a33425822f477f63fe104ca9e5ed474385a2022
2025-07-02 17:26:48 -07:00
Nick GerlemanandFacebook GitHub Bot 0d455f3272 buildSpannableFromFragmentsOptimized (#52385)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52385

This replaces `buildSpannableFromFragmentsOptimized()` with a more optimized version. There are a couple main changes.

1. We don't need a complicated structure around ordering, and span priority, that made its way from the Java ShadowNode logic. AttributedString already ensures there are no overlapping attributes per fragment.
2. `SpannableStringBuilder` is a complicated text-editor style data structure, optimized to allow text content to be modified, and spans re-applied. We can use a much lighter `SpannableString`, on top of the ahead-of-time known text content, which is faster, and saves around 500 bytes per string (and prepared layout). If we assign this to an `EditText`, which later gets edited, Android will copy it to a `SpannableStringBuilder`.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D77622848

fbshipit-source-id: 69bbac86e1f0fd4a15dab6bc279cca305f2a53ae
2025-07-02 17:26:48 -07:00
Nick GerlemanandFacebook GitHub Bot a4b0d64395 ReactNativeFeatureFlags.enableAndroidTextMeasurementOptimizations() (#52384)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52384

Adds the feature flag, controlling multiple optimizations up the stack.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D77622983

fbshipit-source-id: 16500e8557d36db627c62faa511eeb4c73dc7484
2025-07-02 17:26:48 -07:00
Nolan O'BrienandFacebook GitHub Bot 22b8b53c77 Fix exhaustive switches (#52383)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52383

Changelog: [General][Fixed] - Add `default:` case to avoid warnings/errors for targets that compile with `-Wswitch-enum` and `-Wswitch-default` enabled

Reviewed By: aary

Differential Revision: D77051150

fbshipit-source-id: a4f18bb7e47f027fd64cc42bacd7246263ef2454
2025-07-02 16:56:07 -07:00
Nolan O'BrienandFacebook GitHub Bot 9079b53c6f Fix exhaustive switches (#52379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52379

Changelog: [General][Fixed] - Add `default:` case to avoid warnings/errors for targets that compile with `-Wswitch-enum` and `-Wswitch-default` enabled

Reviewed By: aary, yungsters, astreet

Differential Revision: D77051152

fbshipit-source-id: 100b10f97cb3a5d73f1e3dcaf1b284baf6a43982
2025-07-02 14:21:18 -07:00
Nick LefeverandFacebook GitHub Bot da23346c7e Fix UNDEFINED YGValue serialization (#52376)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52376

Correct the expected serialization based on the YogaValue parse implementation:
https://www.internalfb.com/code/fbsource/[ecdf90fe69d0]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaValue.java?lines=66-68

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77663413

fbshipit-source-id: e8b6091a5d57c6d0301411371c290a867c9b5224
2025-07-02 10:07:01 -07:00
Christoph PurrerandFacebook GitHub Bot ceb5f1dedb Remove unused SharedAttributedString alias (#52362)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52362

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77630091

fbshipit-source-id: df297bc5150416b6ddf719addc3ae926e3b39f48
2025-07-02 08:34:21 -07:00
Fabrizio CucciandFacebook GitHub Bot faa8c7b8a1 Keep changelog references for previous versions in CHANGELOG (#52372)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52372

This is just a follow-up on top D77025333 to make sure that the links in the blog posts and the GitHub releases keep working.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77654056

fbshipit-source-id: a1c6df44ebee058dd5b59e5b6a60c7c1e060e52c
2025-07-02 06:34:06 -07:00
Nicola CortiandFacebook GitHub Bot e20bb56f3b Bump Gradle to 8.14.2 (#52370)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52370

This is just a patch bump of Gradle ahead of the 0.81 branch cut.

Changelog:
[Android] [Changed] - Bump Gradle to 8.14.2

Reviewed By: fabriziocucci

Differential Revision: D77601121

fbshipit-source-id: b2fdc8b022f2ab43997f412c77e0c924c01f1a5d
2025-07-02 04:36:22 -07:00
Alex HuntandFacebook GitHub Bot 4274d6f7c7 Tweak RNTester status bar on Android (#52369)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52369

Tiny fix where the system status bar elements were no longer visible under Android edge-to-edge.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77653633

fbshipit-source-id: 1275a0de6665a6ef4599166fb205865cd581bb41
2025-07-02 04:34:10 -07:00
Nicola CortiandFacebook GitHub Bot b578a70bd5 Bump packages for next release (#52359)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52359

This is needed ahead of the 81 branch cut.

Changelog:
[Internal] - Bump all packages to 0.81.0-main

Reviewed By: huntie

Differential Revision: D77602196

fbshipit-source-id: 1b52a7d1577783d72aba8d20f98032f29ffcc7df
2025-07-02 03:53:34 -07:00
Moti ZilbermanandFacebook GitHub Bot bf51035e04 Scaffolding for custom RNDT shell binary (#52357)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52357

Changelog: [Internal]

Adds a hyper-minimal build script using `electron/packager` that produces custom binaries for the experimental React Native DevTools standalone shell. The main user-facing benefit of this is replacing the Electron name and icon with our own branding.

NOTE: `electron/packager` is designed to include the application code in the resulting binary. This is arguably overkill for us - the current launch model of `electron src/electron/index.js` is actually wholly sufficient for what we need - but I decided to go with the grain of the available tooling for simplicity.

Icon design courtesy of huntie. 🙏

Reviewed By: huntie

Differential Revision: D77591742

fbshipit-source-id: a968465df4f54fba54c874b6300788e151600ed7
2025-07-02 03:48:51 -07:00
Moti ZilbermanandFacebook GitHub Bot 2d68a733f8 Fix run-ci-javascript-tests script (#52364)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52364

Changelog: [Internal]

D76512374 broke error reporting in `run-ci-javascript-tests.js`. This is partly because the file was untyped and we missed that the `.code` check on the result of `execSync` was always going to be falsy. Also, `execSync`'s default error handling mechanism is not human-friendly - it throws an `Error` with `Buffer`s for stdout and stderr (see [example](https://github.com/facebook/react-native/actions/runs/16003656383/job/45144825919?pr=52357&fbclid=IwY2xjawLRyfpleHRuA2FlbQIxMQBicmlkETFZSG1xeWhTWWczR1paS0lKAR4pF46Z-J2CbSk7YdHZJ-N3F9eQJ7hR4EowfLV6mUtzMLg8j-EWdZiGY1la6A_aem_1Zbvn6fD5NS9YO-B7QJssg)).

Here, I'm adding types, removing dead code and preserving stdout and stderr from all child processes in a human-readable format.

Reviewed By: huntie

Differential Revision: D77648312

fbshipit-source-id: c6d98e668d6edf15729fa02fecb3408b9dd6debc
2025-07-02 03:09:18 -07:00
Fabrizio CucciandFacebook GitHub Bot 326467c856 Add changelog entry for 0.79.5 (#52367)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52367

As per title.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77652098

fbshipit-source-id: c9ab8c7549e1f50b2e3ca7a1c7de6ec321926ee6
2025-07-02 02:52:12 -07:00
Dawid MałeckiandFacebook GitHub Bot c1168cf919 Fix deep react native imports eslint rule (#52365)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52365

Adds type imports autofix support and pass `fb_internal` paths in react native deep imports eslint rule. The rule fixes imports with all matched types with static API mapping to prevent splits.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D77445445

fbshipit-source-id: cd5b75b4b3b53792117b8297352dddc4d63dbf70
2025-07-02 02:13:31 -07:00
Samuel SuslaandFacebook GitHub Bot 2a6b55f0b1 put optimisation for VirtualView on iOS behind a flag (#52345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52345

changelog: [internal]

I would like to measure impact of D76597973 to get a better understanding of UIKit's rendering.

Reviewed By: yungsters

Differential Revision: D77542666

fbshipit-source-id: 4c2de4f36d2b374d83df934dd3a98d01b24f487f
2025-07-02 01:46:25 -07:00
Dawid MałeckiandFacebook GitHub Bot b41b924b2d Add diff-api-snapshot action to danger (#52045)
Summary:
This PR connects breaking change detection with a danger bot. The action takes snapshot from main branch and from the PR as inputs to`diff-api-snapshot` (saved in runner temp directory).

## Changelog:
[Internal]

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/52045

Reviewed By: huntie

Differential Revision: D76735630

Pulled By: coado

fbshipit-source-id: 9208117340c1e0bf10d58b67892727717d22e62f
2025-07-01 08:58:15 -07:00
Dawid MałeckiandFacebook GitHub Bot 71f2f05f03 Align breaking change detection with new snapshot format (#52353)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52353

This diff aligns breaking change detection script with new snapshot format. It compares hashes to determine if the API changed for each specifier.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D77377762

fbshipit-source-id: e1c69692ace389fb08ae9470b9f9631e53834206
2025-07-01 08:58:15 -07:00
Dawid MałeckiandFacebook GitHub Bot 1c7b04db4a Delete public-api-test (#52342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52342

This diff deletes `public-api-test` for detecting changes in public API. It is replaced with public API snapshot validation (in D76340729) for better detection and understanding of changes that influence external interfaces.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D77531763

fbshipit-source-id: a8ef2b6f52fa6efb5b312598ea3e4746fc51e4ec
2025-07-01 08:58:15 -07:00
Dawid MałeckiandFacebook GitHub Bot 128f5eb9ac Validate RN JS API snapshot on CI (#52352)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52352

This diff adds excution of `yarn build-types --validate` to run RN JS API snapshot validation on CI.

### Motivation

Detect react-native public API changes before they land.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76340729

fbshipit-source-id: 10c465418e0ba4eb05cf557a16119f9756843d9e
2025-07-01 08:58:15 -07:00
Dawid MałeckiandFacebook GitHub Bot 8f9bca5f74 Initial commit of ReactNativeApi.d.ts (#52343)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52343

This diff commits our V2 JavaScript API snapshot for React Native.

This is a new format and workflow that replaces the previous `public-api-test` Jest test.

Please look at the file header for up-to-date instructions on updating the API snapshot.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77532617

fbshipit-source-id: d5faae815aa5071b0f472fcb02318b73772b11cf
2025-07-01 08:58:15 -07:00
David VaccaandFacebook GitHub Bot dcbbf275cb Reintroduce CppPropsIteratorSetter for Yoga Styles (#52351)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52351

Reintroduce CppPropsIteratorSetter for Yoga Styles

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D77563504

fbshipit-source-id: 969c78e267db3e97ea567ad948489b5991c88678
2025-07-01 07:16:19 -07:00
Tim YungandFacebook GitHub Bot da520848c9 RN: Always Flatten Animated Styles (#52268)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52268

Ships the feature flag introduced in https://github.com/facebook/react-native/pull/51719 to fix crahes that result from shadowed animated style values.

Changelog:
[General][Changed] - Animated now always flattens `props.style`, which fixes an error that results from `props.style` objects in which `AnimatedNode` instances are shadowed (i.e. flattened to not exist in the resulting `props.style` object).

Reviewed By: javache

Differential Revision: D77314904

fbshipit-source-id: b442d0256aee7a8925e28c7e87aee5e0a3f39425
2025-07-01 07:07:33 -07:00
Pieter De BaetsandFacebook GitHub Bot ce306aca34 Remove redundant check for NativeReactNativeFeatureFlags (#52354)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52354

These should no longer be needed as `ReactNativeFeatureFlags` handles the missing native module gracefully.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D77365271

fbshipit-source-id: 92c6789b2175f24c79838118f681107a43c9ff0a
2025-07-01 03:49:58 -07:00
Nick GerlemanandFacebook GitHub Bot 5cc4d0a086 Reland Fix possible invalid measurements when width or height is zero pixels (#52348)
Summary:
X-link: https://github.com/facebook/yoga/pull/1823

Pull Request resolved: https://github.com/facebook/react-native/pull/52348

Fixes https://github.com/facebook/yoga/issues/1819

Yoga has a fast path when measuring a node, if it thinks it knows its dimensions ahead of time.

This path has some eroneous logic, to set both axis to owner size, if *either* will evaluate to zero, while having an `YGMeasureModeAtMost`/`FitContent` constraint. This means that if a node is given a zero width, and Yoga later measures with with `FitContent`, its height will become the maximum allowable height, even if it shouldn't be that large.

We can fix this, by only allowing if both axis are this fixed case, instead of just one.

This bug has existed for about a decade (going back to at least D3312496).

Changelog:
[General][Fixed] - Fix possible invalid measurements with width or height is zero pixels

Reviewed By: yungsters

Differential Revision: D76851589

fbshipit-source-id: 6f5a0e6beccc51f591726c9e83e9b90f3350ed0f
2025-06-30 20:46:39 -07:00
Jack PopeandFacebook GitHub Bot 3eeda07a69 Align AttributeConfiguration type in ReactNativeTypes (#33671)
Summary: DiffTrain build for [1e0d12b6f273d7345e32c16cd937475ed7c512ad](https://github.com/facebook/react/commit/1e0d12b6f273d7345e32c16cd937475ed7c512ad)

Reviewed By: kassens

Differential Revision: D77541776

fbshipit-source-id: ef9a99bfc7f16feee1d27685de62a970305f8e5a
2025-06-30 17:19:32 -07:00
Mateo GuzmánandFacebook GitHub Bot 7d01060a8b Kotlin: fix static code analysis weak warnings (6/n) (#52338)
Summary:
Static code analysis reports several weak warnings, many of which seem to be leftovers after Kotlin migration. This PR addresses quite a few:

- [Accessor call that can be replaced with property access syntax](https://www.jetbrains.com/help/inspectopedia/UsePropertyAccessSyntax.html)

## Changelog:

[INTERNAL] - Kotlin: fix static code analysis weak warnings (6/n)

Pull Request resolved: https://github.com/facebook/react-native/pull/52338

Test Plan:
```sh
yarn android
yarn test-android
```

Reviewed By: NickGerleman

Differential Revision: D77504913

Pulled By: cortinico

fbshipit-source-id: 62661ba6adafb7893ce27811357020966d5ea4c1
2025-06-30 15:54:57 -07:00
Pieter De BaetsandFacebook GitHub Bot 69e4252ccb Fix access to observers outside lock in ImageResponseObserverCoordinator (#52346)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52346

This is bypassing the mutex, and potentially not thread-safe.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D77541041

fbshipit-source-id: f97415d066786864806836768dbce2d5e68487ef
2025-06-30 13:22:36 -07:00
Ruslan LesiutinandFacebook GitHub Bot 69a55d7b76 Console: prioritize original console.timeStamp implementation (#52319)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52319

# Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D77315831

fbshipit-source-id: b4d7fd9c816dcb4b76cc7d026f509a6a24da58f8
2025-06-30 12:55:28 -07:00
Ruslan LesiutinandFacebook GitHub Bot 5340a00ac0 Define isProfiling option when Fusebox is used in Production mode (#52320)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52320

# Changelog [Internal]

We are gating `__RCTProfileIsProfiling` global definition under this `isProfiling` option - [1].

Reviewed By: vzaidman

Differential Revision: D77315833

fbshipit-source-id: f71175a573aa6d77c16a657475c59820f9830aa6
2025-06-30 12:55:28 -07:00
generatedunixname89002005287564andFacebook GitHub Bot b8b79a3fc1 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon (#52344)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52344

Reviewed By: javache

Differential Revision: D77526780

fbshipit-source-id: 6ec8cac95cd0cf9bfc29c57b7ad85fb5e9ab65cb
2025-06-30 12:22:37 -07:00
Nicola CortiandFacebook GitHub Bot c4325c335b Fix broken Modal OSS E2E test due to createNewDialog setter (#52341)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52341

The setter for `createNewDialog` is now wrong (after D76834213).
If the `createNewDialog` has been set to `true` by any other field, we should respect it and not set it to true/false regardless
(only considering the `isEdgeToEdgeFeatureFlagOn`) property.

This fixes it.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D77539533

fbshipit-source-id: a1deaf1f1b856895304e8b73fa5d0c0367e677af
2025-06-30 10:16:55 -07:00
Mateo GuzmánandFacebook GitHub Bot 73e513280d Kotlin: fix static code analysis weak warnings (5/n) (#52337)
Summary:
Static code analysis reports several weak warnings, many of which seem to be leftovers after Kotlin migration. This PR addresses quite a few:

- [Unnecessary type argument](https://www.jetbrains.com/help/inspectopedia/RemoveExplicitTypeArguments.html)
- [Variable declaration could be moved inside 'when'](https://www.jetbrains.com/help/inspectopedia/MoveVariableDeclarationIntoWhen.html)
- [Assignment can be replaced with operator assignment](https://www.jetbrains.com/help/inspectopedia/AssignmentReplaceableWithOperatorAssignment.html)
- [Negated call can be simplified](https://www.jetbrains.com/help/inspectopedia/SimplifyNegatedBinaryExpression.html)

## Changelog:

[INTERNAL] - Kotlin: fix static code analysis weak warnings (5/n)

Pull Request resolved: https://github.com/facebook/react-native/pull/52337

Test Plan:
```sh
yarn android
yarn test-android
```

Reviewed By: cortinico

Differential Revision: D77525702

Pulled By: rshest

fbshipit-source-id: b0bd2e7616340c22b22e7f58387c53c51cbf073e
2025-06-30 03:38:26 -07:00
George ZaharievandFacebook GitHub Bot 9a2c422b80 Deploy 0.274.2 to xplat (#52329)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52329

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D77485965

fbshipit-source-id: 6a0b1a85696335a796133e665f41034e00d47ea3
2025-06-28 12:23:25 -07:00
George ZaharievandFacebook GitHub Bot 2e6cf96e47 Update hermes-parser and related packages in xplat/arvr/socialvr to 0.29.1 (#52316)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52316

Bump hermes-parser and related packages to [0.29.1](https://github.com/facebook/hermes/blob/static_h/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: rshest

Differential Revision: D77431991

fbshipit-source-id: d0ab4d7a338fdb68a529ed8151c7e1924600a809
2025-06-27 21:48:28 -07:00
Joe VilchesandFacebook GitHub Bot 132c2cdf12 Fix keyboard navigation if snapToAlignment is set
Summary:
There is an issue with keyboard navigation if some scroll view sets `snapToAlignment`. In this case, we are unable to find potential focus candidates if clipping is enabled since this prop will make it so that certain views in the hierarchy under the scroll view form a native view without any traits being set. The fix we have in place currently relies on `FormsStackingContext` to be set to discover potential candidates so it will break in this case. To fix this, we just return the entire ancestor list, since native will know how to deal with the cases that are not actual views, and in general has the official knowledge of what can be in the hierarchy or not.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D77467933

fbshipit-source-id: 35daaba06347c738cf7a85eef86adb7944a9cb26
2025-06-27 18:02:06 -07:00
Nick GerlemanandFacebook GitHub Bot 2d1db71bc0 Add global cache for Facsimile Layouts (#52308)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52308

Experimentation shows, that we very heavily rely on the global text cache for performance (not sure how much of this is invalidation, vs repeated text, or revisiting previous surfaces).

This adds a global LRU cache, of prepared layouts, given a specific AttributedString and constraints. This is similar to the existing cache, with the caveat, that we need to have separate entries for any display states, instead of just those that effect metrics.

I sized it at 200 elements for now, since an Android `Layout` is much heavier than a `Size` (in practice, each seem to weight 1-3KB (though this will be significantly reduced with future change to move from `SpannableStringBuilder` to `SpannableString` and also contributes to the global JNI ref table, but set this up to be customizable via flag, so we can experiment, on perf impact, vs memory.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D77341994

fbshipit-source-id: b453250dc475f6a281a3260b876bf80f301dd5dd
2025-06-27 14:37:33 -07:00
Soe LynnandFacebook GitHub Bot d96bbcdf0c Back out "Back out "Adding shouldForwardToReactInstance check in ReactDelegate for Bridgeless"" (#52323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52323

Original commit changeset: b144ca6db6f7

Original Phabricator Diff: D77388413

Reverting the revert since it did not fix our javascript crash problem for v270 https://fburl.com/scuba/errorreporting_system_vros_javascripterrors/mtexik9e

Original diff stack: D76908041
Revert diff stack: D77388940

Changelog[Internal]:
Puting back the Kotlin Migration for ReactDelegate file

Reviewed By: cortinico

Differential Revision: D77448293

fbshipit-source-id: ed40836c3ecb4ca551b23cb64de2c34cfda0dea1
2025-06-27 11:55:44 -07:00
Soe LynnandFacebook GitHub Bot faef2b1252 Back out "Back out "[react-native][PR] Migrate ReactDelegate to Kotlin"" (#52322)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52322

Original commit changeset: 4a366205ea9c

Original Phabricator Diff: D77388940

Reverting the revert since it did not fix our javascript crash problem for v270 https://fburl.com/scuba/errorreporting_system_vros_javascripterrors/mtexik9e

Original diff stack: D76908041
Revert diff stack: D77388940

Changelog[Internal]:
Puting back the Kotlin Migration for ReactDelegate file

Reviewed By: cortinico

Differential Revision: D77448238

fbshipit-source-id: f41faa19f6761b7ed644e804019f5ec4738326a7
2025-06-27 11:55:44 -07:00
Andrew DatsenkoandFacebook GitHub Bot ee02152fee Fix non standard hermes config internally (#52321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52321

Changelog: [Internal]
Allow non standard hermes internally.

Reviewed By: lenaic, rubennorte

Differential Revision: D77446774

fbshipit-source-id: 09919c8216932e15b2938d3e99b3df5d53e11c92
2025-06-27 09:47:34 -07:00
Vitali ZaidmanandFacebook GitHub Bot d5cd6ed152 Update debugger-frontend from d95ac13...35c4630 (#52317)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52317

Changelog: [Internal] - Update `react-native/debugger-frontend` from d95ac13...35c4630

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/d95ac13bf0ab64a5e6c2eb18eb138587063b9c34...35c4630bd58bbcbc6f4c54c084b4e52994dc4940).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [35c4630bd](https://github.com/facebook/react-native-devtools-frontend/commit/35c4630bd) | Vitali Zaidman (vzaidman@gmail.com) | 2025-06-26T09:47:45+01:00 | [track stack trace symbolication failures (#183)](https://github.com/facebook/react-native-devtools-frontend/commit/35c4630bd) |
| [e4487ef2e](https://github.com/facebook/react-native-devtools-frontend/commit/e4487ef2e) | Vitali Zaidman (vzaidman@gmail.com) | 2025-06-24T14:29:35+01:00 | [support symbolication with native frames (#181)](https://github.com/facebook/react-native-devtools-frontend/commit/e4487ef2e) |

Reviewed By: huntie

Differential Revision: D77437936

fbshipit-source-id: 5b64195064aa5e157ae1adad01a3f2dc94045f98
2025-06-27 07:57:58 -07:00
Jakub PiaseckiandFacebook GitHub Bot 55d8581584 Cover versionExportedApis transform with tests (#52311)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52311

Changelog: [Internal]

Adds test coverage for `versionExportedApis` transform

Reviewed By: huntie

Differential Revision: D77427733

fbshipit-source-id: 7bc6279602ce6a4194930fdaf0eb790c88425cd5
2025-06-27 07:00:39 -07:00
Jakub PiaseckiandFacebook GitHub Bot 5723de58b8 Explicitly cover more node types in versionExportedApis (#52310)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52310

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77427734

fbshipit-source-id: d9b8caee508166b2d47d5a160b0e326c4cd7783e
2025-06-27 07:00:39 -07:00
Mathieu ActhernoeneandFacebook GitHub Bot 09ef774ff6 Add edge-to-edge opt-in support (#52088)
Summary:
This follows https://github.com/facebook/react-native/pull/47554

Compared to the initial proposal, I had to remove the `edgeToEdgeEnabled` property from the root `gradle.properties` and put it in the app `gradle.properties` instead (explaining the `AgpConfiguratorUtils.kt` / `GenerateEntryPointTask.kt` / `ProjectUtils.kt` / `PropertyUtils.kt` changes)

This PR:
- Enable edge-to-edge for `MainActivity` (when `edgeToEdgeEnabled` is set to `true`)
- Disable `StatusBar` `backgroundColor` and `translucent` (when `edgeToEdgeEnabled` is set to `true`)
- Enforce `statusBarTranslucent` and `navigationBarTranslucent` on `Modal` when edge-to-edge is enabled
- Add an `isEdgeToEdge` constant to `DeviceInfoModule` for [`react-native-is-edge-to-edge`](https://github.com/zoontek/react-native-edge-to-edge/tree/main/react-native-is-edge-to-edge) detection

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

- [Android] [Added] - Add edge-to-edge opt-in support

Pull Request resolved: https://github.com/facebook/react-native/pull/52088

Test Plan:
- Update `enableEdgeToEdge` value in `packages/rn-tester/android/app/gradle.properties`
- Recompile

https://github.com/user-attachments/assets/4c6beb98-fa88-427c-b62d-a42ffe5330f0

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76834213

Pulled By: alanleedev

fbshipit-source-id: c39b2cff1a5e94e31306e3b35651aa2de83d2fe6
2025-06-27 06:16:23 -07:00
Nicola CortiandFacebook GitHub Bot 78c9671c24 Migrate ThemedReactContext to Kotlin (#52309)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52309

This is another class going from Java to Kotlin.
Thish should have no breaking changes, but I'll keep an eye to see if this is disruptive for users in the ecosystem.

I also haven't removed any of the Deprecated method, which can be cleaned up afterwards.

Changelog:
[Android] [Changed] - Migrate ThemedReactContext to Kotlin

Reviewed By: javache

Differential Revision: D77374236

fbshipit-source-id: d1787b21897b01c45bbf841fdda00972e0be58db
2025-06-27 05:00:05 -07:00
Alex HuntandFacebook GitHub Bot d4bf1b7af0 Remove experimental notice from V2 API snapshot and build by default (#52301)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52301

Readying for imminent productionisation.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77386064

fbshipit-source-id: 2769545eace4e6c09da0b2f0f34cf74b2fdcb730
2025-06-27 04:49:28 -07:00
generatedunixname89002005287564andFacebook GitHub Bot a0d4e18020 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/jni/react/hermes/instrumentation (#52285)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52285

Reviewed By: cortinico

Differential Revision: D77359122

fbshipit-source-id: ad425cdfecf57210ae79a8bad25fde4896b476c1
2025-06-27 01:20:27 -07:00
Soe LynnandFacebook GitHub Bot fbd8281ab2 Back out "Migrate ReactDelegate to Kotlin" (#52304)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52304

Investigating javascript crash regression between Store APK v269 and v270 T228736366 with mid https://www.internalfb.com/logview/system_vros_javascripterrors/4a0131b8b79e3994b639c7ca212db717?ds=%7B%22start%22%3A%221750796919%22%2C%22constraints%22%3A[]%2C%22end%22%3A%22now%22%7D&ds_nux_type=task

We suspect that this diff stack may be causing the issue could be caused by this Kotlin migration diff stack D76908041

Changelog: [Internal]
Reverting Kotlin migration for `ReactDelegate`

Reviewed By: gorodscy, mullender

Differential Revision: D77388940

fbshipit-source-id: 4a366205ea9c515a1561a4624b8d29e81ab9bae9
2025-06-26 14:44:36 -07:00
Soe LynnandFacebook GitHub Bot c360251b4a Back out "Adding shouldForwardToReactInstance check in ReactDelegate for Bridgeless" (#52303)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52303

Investigating javascript crash regression between Store APK v269 and v270 T228736366 with mid https://www.internalfb.com/logview/system_vros_javascripterrors/4a0131b8b79e3994b639c7ca212db717?ds=%7B%22start%22%3A%221750796919%22%2C%22constraints%22%3A[]%2C%22end%22%3A%22now%22%7D&ds_nux_type=task

We suspect that this diff stack may be causing the issue could be caused by this Kotlin migration diff stack D76908041

Changelog: [Internal]
Reverting Kotlin migration for ReactDelegate

Reviewed By: mullender

Differential Revision: D77388413

fbshipit-source-id: b144ca6db6f75614c7988e474ef89f19714a4a09
2025-06-26 14:44:36 -07:00
Zeya PengandFacebook GitHub Bot 793023a4e2 Fewer calls to direct manipulation callback (#52296)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52296

## Changelog:

[Internal] [Changed] - Fewer calls to direct manipulation callback

`NativeAnimatedNodesManager::onRender` is supposed to run each frame for c++ animation, from the callstack sample trace, the vast majority of time is spent on `updateNodes` (run update on all AnimatedNodes) and `commitProps` (where either Fabric ShadowTree commit or direct manipulation is called). Change in this PR is supposed to reduce time spent in `commitProps`

{F1979788964}

Reviewed By: sammy-SC

Differential Revision: D77380842

fbshipit-source-id: 2f25ca1fba4171a7b3e485298738379d0daff3ad
2025-06-26 14:17:27 -07:00
Riccardo CipolleschiandFacebook GitHub Bot ffd6e5537d Remove RCTPushNotificationManager from umbrella header (#52306)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52306

The RCTPushNotificationManager is deprecated and not part of the prebuilds as it is optional.
We mistakenly added it to the umbrella header and nightlies do not work with prebuilds.

This change removes the header ad should fix the build.

## Changelog:
[Internal] -

Reviewed By: philIip

Differential Revision: D77395754

fbshipit-source-id: 66371650dc56f5be16a00319d9e4a1078a7b68bd
2025-06-26 14:15:45 -07:00
Sam ZhouandFacebook GitHub Bot 505588b9aa Add annotations or make things readonly to prepare for object literal soundness fix in react-native (#52305)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52305

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D77386425

fbshipit-source-id: d69184abb1c8f7c516229aafe24dd418b5dd887e
2025-06-26 13:24:24 -07:00
Nick GerlemanandFacebook GitHub Bot a6a2884d63 Fix onTextLayout metrics not incorporating ReactTextViewManagerCallback (#52276)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52276

The line metrics reported do not process the Spannable, meaning their layout results may disagree with those used for measurement and display.

Changelog:
[Android][Fixed] - Fix onTextLayout metrics not incorporating ReactTextViewManagerCallback

Reviewed By: lenaic

Differential Revision: D77261839

fbshipit-source-id: 87bdc86ce16a2ae9fa69532c5721c19567a53595
2025-06-26 12:09:54 -07:00
George ZaharievandFacebook GitHub Bot 56ccc87e63 Enable experimental.pattern_matching=true [DO NOT SHIP] (#52302)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52302

Enable experimental.pattern_matching=true

Changelog: [internal]

Reviewed By: pieterv

Differential Revision: D77367102

fbshipit-source-id: a71352a58470c30fa7e466a67cb1909d80f0363e
2025-06-26 11:48:02 -07:00
Soe LynnandFacebook GitHub Bot ed756edd92 Back out "Revert D76757706: [iOS][RN] Fix LegacyViewManagerInteropComponentDescriptor" (#52269)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52269

Relanding the reverted PR.

Differential Revision: D77282452

fbshipit-source-id: 1480d8ab067bbbb1b41a9cd03315748c1311f910
2025-06-26 11:21:43 -07:00
Andrew DatsenkoandFacebook GitHub Bot d0770ce425 Introduce isOSS (#52222)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52222

Changelog: [Internal]
Introduce environment option to force usage of OSS fantom test runner.
If env is not set - check for BUCK file in tester which is checked in for FB but not for OSS.

Reviewed By: rubennorte

Differential Revision: D77160761

fbshipit-source-id: 1701ff140ff2be1bbeacfb4305e9f89089cacb42
2025-06-26 11:03:20 -07:00
Samuel SuslaandFacebook GitHub Bot e3f029fd17 make VirtualView hidden when it is not visible on screen (#52294)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52294

changelog: [internal]

Views that are hidden provide couple perf benefits:
- The layer is skipped during hit-testing, so the view no longer receives touches.
- Compositing work for the layer is skipped, so nothing is uploaded to the GPU for that view.

Note, VirtualView still occupies space in memory and because this is infinite list and its numbers will grow unbounded.

In this diff, hidden = YES is only set when VirtualView does not participate in accessibility features.

Reviewed By: yungsters

Differential Revision: D76597973

fbshipit-source-id: 10eb36fccabba9e37cc6322ed5969b8502193a5f
2025-06-26 10:51:32 -07:00
Riccardo CipolleschiandFacebook GitHub Bot afb2afec26 Fix React-Fabric podspec to only use the sources for iOS (#52295)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52295

The current setup for several of our podspecs abuses the `**` globbing mechanism, forcing us to specify some excluded folders.
By excplicitly mention the folders that we want to use on iOS, we can avoid the usage of the `exclude_files` property.

This should make the setup more reliable and it will also avoid to leak to OSS the presence of some folders we only use internally like `platform/macos` and `platform/windows`

## Changelog:
[Internal] -

Reviewed By: huntie

Differential Revision: D77381512

fbshipit-source-id: 4cb9118bf9f0ecd253d7d871341f733564d84c83
2025-06-26 10:46:39 -07:00
Alex HuntandFacebook GitHub Bot 895f9b444a Improve stable hash input for local type names (#52300)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52300

Targeted improvement to `versionExportedApis` (D77303917) to reduce noise.

This eliminates the false positive from a rename to a local (unexported) type, that does not structurally change the shape of exported types.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D77314292

fbshipit-source-id: 4de90f5b5f1b622225762b2a73e386538000d54a
2025-06-26 10:46:23 -07:00
Alex HuntandFacebook GitHub Bot e50133a43d Support namespaced references in snapshot type versioning (#52299)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52299

Correctness improvement to the `versionExportedApis` transform (D77303917). Now handles namespaced references (e.g. `Animated.Value`) by redirecting to the locally defined type name.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D77314293

fbshipit-source-id: 6442d3ab0a3c8bebf6593455b1c2fb74266e657f
2025-06-26 10:46:23 -07:00
Alex HuntandFacebook GitHub Bot 050fb25c14 Add debug flag to show versionExportedApis graph in output (#52298)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52298

Exposes the ability to output inline debug annotations for the `versionExportedApis` transform (D77303917) as a formalised `--debug-version-annotations` CLI flag.

This is helpful for debugging and future maintenance, and will be used to show the effect of the next diffs.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D77373723

fbshipit-source-id: 91c91abcb657ab88ee2f8209efccb4024602acc7
2025-06-26 10:46:23 -07:00
Alex HuntandFacebook GitHub Bot 94987205de Add versionExportedApis transform to JS API snapshot (#52292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52292

Adds a new transform that annotates all exported symbols in our V2 JS API snapshot with a version hash based on the shape of all input types.

This intends to be a reliable mechanism to indicate how changes to local types will ultimately affect exported types.

**Advantages** (over our alternative type inlining prototype)

- More intuitive to developers — in that source type changes are preserved closer to their original source code shapes.
- Enables useful Git blaming of individual exported APIs — hash for each export line will change every time a type is affected, and relevant commits can be looked up based on this.
- Handles recursive types.
- Can be **best-effort** with minimal structural effect over time. We are okay with false positives that over-match input type changes (these are refined later in the stack).
- Similar to this, is **lower risk** in terms of requiring future updates that may pollute the diff of the body of the API snapshot structurally.

**Example change**

Example type change with multiple references: D77378010

{F1979784798}

 8 char hash based on input type shapes printed next to each root-exported identifier
 For a source change to the `AccessibilityProps` type, 33 dependent exported types are updated with a new hash

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D77303917

fbshipit-source-id: 9d43a617697418218eb4951e8e9858d125e222b3
2025-06-26 10:46:23 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot ffa6630243 Add API to get image loader instance from rncxx IMountingManager interface (#52293)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52293

# Changelog:
[Internal] -

Adds a helper method to the `IMountingManager` API in order to get the platform specific image loader implementation, if available.

Reviewed By: christophpurrer

Differential Revision: D77379053

fbshipit-source-id: b7595d78c83e9270ec1818daf2d0f1d342661e52
2025-06-26 10:34:38 -07:00
Christian FalchandFacebook GitHub Bot 47b2fe4140 Refactored how we create umbrella, modulemap and header files (#52286)
Summary:
To make sure we are exposing the same public API to swift as without prebuilt, this commit changes the follow:

- ModuleMap / Umbrella file is generated from template, not dynamically to align with non-prebuilt (cocoapods). This is temporary, we are already working toward a solution to generate them dynamically.
- Headers are extracted by reading from podspec files and expanding their globs. This is now easy since we can use the podspec_sources function to look for file globs.

## Changelog:
[Internal] -  refactored header/umbrella/modulemap generation for prebuild

Pull Request resolved: https://github.com/facebook/react-native/pull/52286

Test Plan:
- Run RN-tester with/without prebuilts
- Create new RN app based on nightly, build with/without prebuiltsTo make sure we expose all the swift features that we should, we expose and declare a variable from React_RCTAppDelegate

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D77368255

Pulled By: cipolleschi

fbshipit-source-id: 88e2c9d1622753895c8667a9b5aeae4a0d332cc4
2025-06-26 10:25:35 -07:00
Ruslan LesiutinandFacebook GitHub Bot ff97ca3134 Re-land Implement console.timeStamp
Summary:
# Changelog: [Internal]

Adds support for experimental non-standardized `console.timeStamp` API for capturing performance entries on a timeline. The main idea of the API is to be highly performant. More details in the corresponding RCP [1].

NOTE: Because of the `jsinspector-modern` stack gating logic, this won't be installed in production builds. `console.timeStamp` will be polyfilled with a stub - D76987507.

Reviewed By: rubennorte

Differential Revision: D77374707

fbshipit-source-id: cb66b9fda06168f4b13af764afe95a63a0a8d5a0
2025-06-26 09:57:32 -07:00
pchalupaandFacebook GitHub Bot 0386b9bd51 Rename arguments of onContentSizeChange callback (#52291)
Summary:
The argument names in the `onContentSizeChange` callback's type definition differ from the [documentation](https://reactnative.dev/docs/scrollview#oncontentsizechange).

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [FIXED] - Renamed argument names in the `onContentSizeChange` callback's type definition

Pull Request resolved: https://github.com/facebook/react-native/pull/52291

Test Plan:
The IDE reflects updated argument names.
![Screenshot 2025-06-26 at 14 59 40](https://github.com/user-attachments/assets/1579998a-d9a8-4b98-a664-e5106ffb42f5)

Reviewed By: fabriziocucci

Differential Revision: D77373877

Pulled By: rshest

fbshipit-source-id: 2a171e1bc16103320f5ec31efab896f6b840fb96
2025-06-26 08:00:31 -07:00
Moti ZilbermanandFacebook GitHub Bot 49b7fff2a0 Support IPv6 dev server URLs in legacy standalone RDT connection
Summary:
Changelog: [Internal]

A minimal tweak to a legacy code path for React DevTools in React Native (**NOT** Fusebox!) that enables it to work / not crash when encountering an IPv6 dev server address. See doc comment for more.

Reviewed By: hoxyq

Differential Revision: D77150288

fbshipit-source-id: c11c742aad7b83861a1242dd13c5ed2753fbdf29
2025-06-26 07:59:16 -07:00
Zeya PengandFacebook GitHub Bot 63d8d978f5 Reduce call to folly::dynamic::object insert and remove unnecessary AnimatedNode::update calls (#52270)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52270

## Changelog:

[Internal] [Changed] - Reduce call to `folly::dynamic::object` insert and remove unnecessary AnimatedNode::update calls

Reviewed By: christophpurrer

Differential Revision: D77315659

fbshipit-source-id: 656d7bcc957126ee8fa5a7463223273a93d31369
2025-06-26 06:52:05 -07:00
Jim Jetsada MachomandFacebook GitHub Bot 556957d458 Revert D76284119: Implement console.timeStamp
Differential Revision:
D76284119

Original commit changeset: c87c6645fe32

Original Phabricator Diff: D76284119

fbshipit-source-id: 186b09de34c3bb3a80eb62d5c14b47d04ca5a8e0
2025-06-26 06:09:05 -07:00
George ZaharievandFacebook GitHub Bot 7d84158700 Deploy 0.274.1 to xplat (#52287)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52287

 Deploy 0.274.1 to xplat

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D77349884

fbshipit-source-id: 44ebd2c111a6077dbf2e7beb60369283b2256feb
2025-06-26 05:45:51 -07:00
Ruslan LesiutinandFacebook GitHub Bot df0a2c847b Implement console.timeStamp (#52091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52091

# Changelog: [Internal]

Adds support for experimental non-standardized `console.timeStamp` API for capturing performance entries on a timeline. The main idea of the API is to be highly performant. More details in the corresponding RCP [1].

NOTE: Because of the `jsinspector-modern` stack gating logic, this won't be installed in production builds. `console.timeStamp` will be polyfilled with a stub - D76987507.

Reviewed By: rubennorte

Differential Revision: D76284119

fbshipit-source-id: c87c6645fe32f56d84f5915ff57865cfd9723a47
2025-06-26 05:25:09 -07:00
Ruslan LesiutinandFacebook GitHub Bot 53d7e0f43b Move up forwardToOriginalConsole declaration (#52193)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52193

# Changelog: [Internal]

Will be re-used for `console.timeStamp` installation.

Reviewed By: motiz88

Differential Revision: D77027561

fbshipit-source-id: ef251541d67011acd21fe9b2be87f9ac1a85a01e
2025-06-26 05:25:09 -07:00
Ruslan LesiutinandFacebook GitHub Bot c612ae424a @react-native/js-polyfills: polyfill console.timeStamp (#52168)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52168

# Changelog: [Internal]

The main reason for the stub is to make sure this method is always installed. The actual implementation will be part of the `jsinspector-modern` stack, which is fully initialized in production builds.

Once there is a gurantee that RuntimeTarget globals are always installed in any environments, we can remove polyfills altogether.

Reviewed By: rubennorte, GijsWeterings

Differential Revision: D76987507

fbshipit-source-id: 2602af28f9e4359cf58dfafdf84802c0bf92372d
2025-06-26 05:25:09 -07:00
Ruslan LesiutinandFacebook GitHub Bot 3ed1af8a3c Fix incorrect rebase, apply lost changes (#52288)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52288

# Changelog: [Internal]

Reviewed By: motiz88, rubennorte

Differential Revision: D77368159

fbshipit-source-id: 3beefb01d8e25596269c1212ce90864f39fd9f0c
2025-06-26 04:50:40 -07:00
Alex HuntandFacebook GitHub Bot fe0dc19131 Align devtoolsFrontendUrl within /json/list (#52289)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52289

The old `devtools://devtools/...` URL is **unsupported** with our modern debugger backend.

This reference was something we'd been intentionally leaving in place to preserve the old experience in Flipper — we can now remove.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D77368319

fbshipit-source-id: 400183e9bc477a887d66d79b412277971cf425e5
2025-06-26 04:20:04 -07:00
Jakub PiaseckiandFacebook GitHub Bot 322142aab3 Further reduce naming collisions in the API snapshot (#52281)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52281

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77355160

fbshipit-source-id: b1a59b3817b88bf6de953816fc272633b14b3a54
2025-06-26 03:37:05 -07:00
Moti ZilbermanandFacebook GitHub Bot 74ae2ae8b6 Upgrade Electron to 36.3.0 (#52261)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52261

TSIA

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77244751

fbshipit-source-id: 97c45286d18d3b266e1acd33408ea6067504f790
2025-06-26 03:22:17 -07:00
Jakub PiaseckiandFacebook GitHub Bot df5cd55cdb Flatten built-in utility types in the API snapshot (#52280)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52280

Changelog: [Internal]

Adds a type-simplifyng transform for the API snapshot, with the goal of resolving some built-in TS types during build time. Most notably, it's able to simplify `Omit` structures emitted by the `flow-api-translator` when translating Flow's type spread operator.

It builds upon a simplified type inlining transform from the previous approach. The type inlining transform is able to handle inlining type references and resolution of built-in TS types on literal types:
- `Omit`
- `Readonly`
- `Partial`
- `keyof`

Reference inlining is performed top-down and built-in type resolution is performed bottom-up, which makes it possible for the second step to assume working on type literals.

Type simplifying transform uses the type inlining to reduce type references encountered inside `Omits` to their literal shapes, which makes possible to determine whether `Omit` is neccessary case-by-case. If `Omit` is redundant, it can be safely removed. If it's not, the omitted keys can be reduced to represent a subset of keys existing in the target type.

It also keeps the ability to resolve `Partial` and `Readonly` types on type literals, simplifying the snapshot further.

An example diff the transform can handle:
Before:
```
export declare type AccessibilityProps = Readonly<
  Omit<
    AccessibilityPropsAndroid,
    | keyof {
        accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
        accessibilityHint?: string
        accessibilityLabel?: string
        accessibilityRole?: AccessibilityRole
        accessibilityState?: AccessibilityState
        accessibilityValue?: AccessibilityValue
        accessible?: boolean
        "aria-busy"?: boolean
        "aria-checked"?: "mixed" | (boolean | undefined)
        "aria-disabled"?: boolean
        "aria-expanded"?: boolean
        "aria-hidden"?: boolean
        "aria-label"?: string
        "aria-selected"?: boolean
        "aria-valuemax"?: AccessibilityValue["max"]
        "aria-valuemin"?: AccessibilityValue["min"]
        "aria-valuenow"?: AccessibilityValue["now"]
        "aria-valuetext"?: AccessibilityValue["text"]
        role?: Role
      }
    | keyof AccessibilityPropsIOS
  > &
    Omit<
      AccessibilityPropsIOS,
      keyof {
        accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
        accessibilityHint?: string
        accessibilityLabel?: string
        accessibilityRole?: AccessibilityRole
        accessibilityState?: AccessibilityState
        accessibilityValue?: AccessibilityValue
        accessible?: boolean
        "aria-busy"?: boolean
        "aria-checked"?: "mixed" | (boolean | undefined)
        "aria-disabled"?: boolean
        "aria-expanded"?: boolean
        "aria-hidden"?: boolean
        "aria-label"?: string
        "aria-selected"?: boolean
        "aria-valuemax"?: AccessibilityValue["max"]
        "aria-valuemin"?: AccessibilityValue["min"]
        "aria-valuenow"?: AccessibilityValue["now"]
        "aria-valuetext"?: AccessibilityValue["text"]
        role?: Role
      }
    > & {
      accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
      accessibilityHint?: string
      accessibilityLabel?: string
      accessibilityRole?: AccessibilityRole
      accessibilityState?: AccessibilityState
      accessibilityValue?: AccessibilityValue
      accessible?: boolean
      "aria-busy"?: boolean
      "aria-checked"?: "mixed" | (boolean | undefined)
      "aria-disabled"?: boolean
      "aria-expanded"?: boolean
      "aria-hidden"?: boolean
      "aria-label"?: string
      "aria-selected"?: boolean
      "aria-valuemax"?: AccessibilityValue["max"]
      "aria-valuemin"?: AccessibilityValue["min"]
      "aria-valuenow"?: AccessibilityValue["now"]
      "aria-valuetext"?: AccessibilityValue["text"]
      role?: Role
    }
>
```

After:
```
export declare type AccessibilityProps = Readonly<
  AccessibilityPropsAndroid &
    AccessibilityPropsIOS & {
      accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>
      accessibilityHint?: string
      accessibilityLabel?: string
      accessibilityRole?: AccessibilityRole
      accessibilityState?: AccessibilityState
      accessibilityValue?: AccessibilityValue
      accessible?: boolean
      "aria-busy"?: boolean
      "aria-checked"?: "mixed" | (boolean | undefined)
      "aria-disabled"?: boolean
      "aria-expanded"?: boolean
      "aria-hidden"?: boolean
      "aria-label"?: string
      "aria-selected"?: boolean
      "aria-valuemax"?: AccessibilityValue["max"]
      "aria-valuemin"?: AccessibilityValue["min"]
      "aria-valuenow"?: AccessibilityValue["now"]
      "aria-valuetext"?: AccessibilityValue["text"]
      role?: Role
    }
>
```

Reviewed By: huntie

Differential Revision: D77295302

fbshipit-source-id: 213aef46035bde4f9783353b5344a6986a418399
2025-06-26 03:05:27 -07:00
Nick LefeverandFacebook GitHub Bot c6608685cb Mark prop diffing availability for codegen props (#52246)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52246

This diff adds the required override to codegen props to make the `FabricMountingManager` aware of the availability of a prop diffing implementation for native components using codegen props.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234066

fbshipit-source-id: 8e95628348f491c5ee08609bc7d7b3d30bc7151b
2025-06-25 18:28:22 -07:00
Nick LefeverandFacebook GitHub Bot 53ce247dbd Add codegen for MixedType diffing (#52266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52266

Native components may use `MixedType` properties in rare cases to hold untyped data. This diff adds support for serializing and prop diffing these types of props so that all of the props and object fields would be included in prop diffing results.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77307169

fbshipit-source-id: ae6b00207ef857c9cfa4bdf9c235972915410a29
2025-06-25 18:28:22 -07:00
Nick LefeverandFacebook GitHub Bot e441954c82 Add codegen for ArrayType diffing (#52244)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52244

The ArrayType props converts to std::vector. This prompted the need for `toDynamic(const T&)` conversion functions as this breaks to potential reliance on all type instances having a `toDynamic()` function available. This includes:
- array of arrays types
- array of objects types
- object with arrays

The ArrayType conversion uses the availability of the `toDynamic` conversion methods for all supported types to convert the values stored by the `std::vector` to `folly::dynamic` values to be stored on a `folly::dynamic::array`.

The diff removes unnecessary conversion methods implemented previously for the core components prop diffing. These are now handled by the generic `toDynamic(const std::vector<T>&)` conversion method.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234065

fbshipit-source-id: 97a3b175ff07fe4a6de3adb14ee6cb42db1a2cfe
2025-06-25 18:28:22 -07:00
Nick LefeverandFacebook GitHub Bot b50ad49a4d Add codegen for ObjectType diffing (#52243)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52243

Building on the availability of `toDynamic` conversion methods for all supported property types, this diff adds support for diffing of `ObjectType` props.

The template adds the generation of a default comparator for the generated C++ struct. The struct also gains a `toDynamic` conversion method that will convert each property of the object type to a `folly::dynamic` value.

Primitive types make use of the implicit conversion supported by `folly::dynamic`, all other types are converted using `toDynamic`.

The `toDynamic` logic is implemented as a method defined on the struct to avoid increased binary size when required multiple times by the prop diffing implementation.

The external `toDynamic` conversion function calls the struct method directly. This enables support for converting object types using object types within their props.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234064

fbshipit-source-id: 21deb3104303aa374fb65b969af57a6aca6db38c
2025-06-25 18:28:22 -07:00
Nick LefeverandFacebook GitHub Bot 8c806ec31b Add codegen for DimensionType diffing (#52242)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52242

Codegen supports `DimensionType` props which represents a YGValue. This diff adds a conversion to `folly::dynamic` supporting all the existing value types `YGValue` can represent.

This completes codegen support for all allowed `ReservedPropTypeAnnotation` prop types.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234061

fbshipit-source-id: 6c3aef5e3ab0459d8a68ebd8efaccfecb83b0b08
2025-06-25 18:28:22 -07:00
Nick LefeverandFacebook GitHub Bot a164874b1a Add codegen for EnumType diffing (#52241)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52241

Add support for converting string and int32 enum types to `folly::dynamic` and generating the correct property diffing for it conditionally adding the prop value to the prop diff result.

This diff updates the template to convert the enum back to the original string representation provided from the JS side based on the current generated C++ enum value.

The string enum re-uses the existing `toString` conversion. The number enum generates the switch-case mapping required to map back the C++ enum value to the original value assigned to it.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234070

fbshipit-source-id: 8c669d5b2e21bd6022c6ba36149465495e4d4bf3
2025-06-25 18:28:22 -07:00
Moti ZilbermanandFacebook GitHub Bot 0031377ae6 Correctly synchronise access to WebSocketDelegate
Summary:
Changelog: [Internal]

Fixes a thread safety bug in the C++ platform's `InspectorPackagerConnectionDelegate::WebSocket` implementation. Since D60520747 `IWebSocketDelegate` event calls have been required to be made on the inspector thread, but the C++ platform was making them on the platform's WebSocket thread instead.

Reviewed By: christophpurrer

Differential Revision: D77150289

fbshipit-source-id: f57de05eaccbbe9db674076fc9e60f8d0dd243c5
2025-06-25 13:49:00 -07:00
Sam ZhouandFacebook GitHub Bot 6b85c54ef4 Add annotations to array and object literal declarations to fix future natural inference errors (#52267)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52267

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D77308192

fbshipit-source-id: 21fa2f6d3df632941327b9b2d7910b035f16b7d2
2025-06-25 13:44:09 -07:00
Joe VilchesandFacebook GitHub Bot 7e8eadc041 Fix accessibility order example (#52271)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52271

In my haste I messed up a few of these. Either type in the text, or giving them props they should not have.

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D77310876

fbshipit-source-id: 9c5a28285d4bb3673fe99630fa7ed97033b17904
2025-06-25 13:06:08 -07:00
Moti ZilbermanandFacebook GitHub Bot bc7a9d9c4e Add dev server host/port settings to ReactInstanceConfig (#52263)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52263

Changelog: [Internal]

Adds a bare-bones API to set the dev server host and port at the time of creating a `ReactInstance` in the C++ platform.

Reviewed By: rshest

Differential Revision: D77050457

fbshipit-source-id: 642dc96d3cb486a2e7faa177adcbf8a15b8fb668
2025-06-25 12:02:22 -07:00
Pieter De BaetsandFacebook GitHub Bot 167ec92f86 Consume ReactNativeAttributePayloadFabric from ReactNativePrivateInterface (#33616) (#52256)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52256

## Summary

ReactNativeAttributePayloadFabric was synced to react-native in
https://github.com/facebook/react-native/commit/0e42d33cbcfadcf5d787108da785d56a83d07a9f.
We should now consume these methods from the
ReactNativePrivateInterface.

Moving these methods to the React Native repo gives us more flexibility
to experiment with new techniques for bridging and diffing props
payloads.

I did have to leave some stub implementations for existing unit tests,
but moved all detailed tests to the React Native repo.

## How did you test this change?

* `yarn prettier`
* `yarn test ReactFabric-test`

DiffTrain build for [7a3ffef70339c10f8d65a27b88cd73bfbe13eb8a](https://github.com/facebook/react/commit/7a3ffef70339c10f8d65a27b88cd73bfbe13eb8a)

Reviewed By: rubennorte

Differential Revision: D77296286

fbshipit-source-id: a26aa0fe0f7f1c8a42407d759351734a4c85f970
2025-06-25 09:30:08 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 1348d7ee78 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/jsc (#52250)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52250

Reviewed By: javache

Differential Revision: D77290996

fbshipit-source-id: 582a090ea0b0ab6171f625b7a2147607abef1cab
2025-06-25 08:23:43 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 2ae154f650 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/jni/first-party/fbgloginit/fb (#52251)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52251

Reviewed By: javache

Differential Revision: D77289931

fbshipit-source-id: ff61aa3a92a96492027c111ea2db25d5b86a777e
2025-06-25 08:08:12 -07:00
Vitali ZaidmanandFacebook GitHub Bot 5ba0e1f97a Improve how throws from components are reported to the console (#52050)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52050

Uncaught errors are currently raising a custom error to `console.error`:
* With somewhat unclear messaging.
* Only the **component stack** is reported.
* The top-most stack leads to the component where the throw occurred and not to the actual error being thrown.
* The actual error being thrown is never logged

After this change:
* We print the actual error thrown
* The *Owner stack* is attached

(see test plan for examples)

## Changelog:
[General][Breaking] Improve messaging and add error stack trace in console errors generated on throws from components.

----

This is a breaking change because someone might be monkey-patching console.errors, or just listens to them.

Reviewed By: rickhanlonii

Differential Revision: D75080385

fbshipit-source-id: 824f30a804a3bb836ea1be7257784e56c00077c1
2025-06-25 07:54:55 -07:00
Jakub PiaseckiandFacebook GitHub Bot 482f737ee1 Move stripping unstable identifiers earlier in the API Snapshot pipeline (#52260)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52260

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77304456

fbshipit-source-id: 2c623fa6d5b6c75e985dc8aa79872019582c50d5
2025-06-25 07:47:38 -07:00
Christian FalchandFacebook GitHub Bot 02203f8608 revert changes in ReactCodegen template (#52257)
Summary:
After switching to the new backwards compatible cocoapods structure with prebuilts, we no longer need any change in the ReactCodegen template.

This commit fixes this.

## Changelog:

[IOS] [FIXED] - revert changes in ReactCodegen template

Pull Request resolved: https://github.com/facebook/react-native/pull/52257

Test Plan: Build RN-tester with prebuilt

Reviewed By: cortinico

Differential Revision: D77303429

Pulled By: cipolleschi

fbshipit-source-id: d251d7d67b1c902082891ba705db5158c558e842
2025-06-25 07:36:56 -07:00
Mateo GuzmánandFacebook GitHub Bot d6efe9a56f Migrate ReactContextBaseJavaModule to Kotlin (#52210)
Summary:
Migrate com.facebook.react.bridge.ReactContextBaseJavaModule to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.bridge.ReactContextBaseJavaModule to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/52210

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D77290330

Pulled By: cortinico

fbshipit-source-id: 1218af30c8a94ed11cc4db557ba34c7bfff2fc0c
2025-06-25 07:21:27 -07:00
Andrew DatsenkoandFacebook GitHub Bot 0b4429a33e Use RegExp instead of micromatch (#52234)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52234

Changelog: [Internal]

Use raw regex instead of micromatch as it depends on node imports.

Reviewed By: christophpurrer

Differential Revision: D77241819

fbshipit-source-id: c579b42f064f67c2e44e15e40ab6262f45a90797
2025-06-25 06:20:10 -07:00
Ruslan LesiutinandFacebook GitHub Bot ca647c13c2 Avoid copying strings when serializing TraceEvent / lock only on buffer operations (#52220)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52220

# Changelog: [Internal]

Mainly, 2 changes:
1. `PerformanceTracer::serializeTraceEvent(const TraceEvent& event)` -> `PerformanceTracer::serializeTraceEvent(TraceEvent&& event)` for less copies, actually move strings from the `TraceEvent` into the serialized `folly:object`.
2. When collecting events from the buffer, only lock when accessing buffer, not when serializing.

Reviewed By: rubennorte

Differential Revision: D77164969

fbshipit-source-id: c7dd84dd3c94dae22b89ffd4b229974e6d8084de
2025-06-25 05:38:31 -07:00
Ruslan LesiutinandFacebook GitHub Bot 448fe573e0 Avoid potential copies of TraceEvent before serialization (#52196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52196

# Changelog: [Internal]

Probably been overlooked for quite some time, but shouldn't be a bottleneck.

Reviewed By: motiz88

Differential Revision: D77148271

fbshipit-source-id: e8eb32137086d6c280aab2ec5903be03f96175ad
2025-06-25 05:38:31 -07:00
Ruslan LesiutinandFacebook GitHub Bot 823414e691 Avoid potential copies of TraceEvent when buffering (#52188)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52188

# Changelog: [Internal]

`buffer_.push_back` -> `buffer_.emplace_back`

I didn't measure if there were any runtime wins from this, because I don't expect there would be. Let's avoid potential copies, if possible.

Reviewed By: rubennorte

Differential Revision: D77053032

fbshipit-source-id: 80a0d3759bf95b1945ebe560806712bfa6a4f924
2025-06-25 05:38:31 -07:00
Ruslan LesiutinandFacebook GitHub Bot e5049091c5 refactor: well-defined behaviour (#52187)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52187

# Changelog: [Internal]

- `bool tracing_` -> `std::atomic<bool> tracingAtomic_`.
- More doc-comments to explain the usage of mutex and atomics.
- `PerformanceTracer::isTracing()` -> `inline PerformanceTracer::isTracing()`.
- `uint64_t processId_` -> `const uint64_t processId_`.

The main change is that the boolean flag that controls "if we are tracing" is now atomic, which should eliminate potential data races. To avoid "logic" races, we are still going to lock mutex, and then check again. The use of `std::atomic` allows us to perform cheaper check first to avoid potentially unnecessary serializations from other systems that report events into `PerformanceTracer`.

Reviewed By: rubennorte

Differential Revision: D77053030

fbshipit-source-id: 82966055db0d75f828e7b95ad4c6cd7f18902265
2025-06-25 05:38:31 -07:00
Samuel SuslaandFacebook GitHub Bot 818e62e977 fix crash in view culling when culling context is incorrectly compared (#52254)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52254

changelog: [internal]

View culling would generate incorrect mounting instructions because view culling context is checked before it is changed by a view.

Reviewed By: javache

Differential Revision: D77298889

fbshipit-source-id: 2f98dc4de90f34673ff6f627b597942d80fda865
2025-06-25 05:33:49 -07:00
Nick LefeverandFacebook GitHub Bot 3d97bac5f2 Add codegen for EdgeInset type diffing (#52239)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52239

Add `toDynamic` conversion function for `EdgeInset` which allowed for removing the custom conversion implemented for the `ViewProps`.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234069

fbshipit-source-id: 3aecad8a6d78468f0056167fa1523ccdfb68f369
2025-06-25 04:33:12 -07:00
Nick LefeverandFacebook GitHub Bot 9b82e706fb Add codegen for PointPrimitive prop type diffing (#52238)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52238

Add prop diffing codegen for `PointPrimitive` prop type by adding a `toDynamic` conversion for the struct and the prop diffing conditional result update.

The addition of the `toDynamic` function will allow for converting the type when used in array and object types.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234062

fbshipit-source-id: d0f52e8fd78ac7712925ea2a47cdd0fe3392d5b0
2025-06-25 04:33:12 -07:00
Nick LefeverandFacebook GitHub Bot da0938edfd Add toDynamic conversion function for ImageSource (#52237)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52237

For array props conversion following later in this stack, each type should have a toDynamic conversion available that can be called upon to convert all supported types to a `folly::dynamic` result.

This diff adds the toDynamic conversion function for `ImageSource`

 Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D77234063

fbshipit-source-id: 392cbaf172595936f7f66faa824900dadd58bdcf
2025-06-25 04:33:12 -07:00
Jakub PiaseckiandFacebook GitHub Bot dca83bc158 Move remaining transform to the typescript dir (#52247)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52247

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77284561

fbshipit-source-id: 46a5a9d00223283423b791456db3613abfc063aa
2025-06-25 04:17:28 -07:00
Nicola CortiandFacebook GitHub Bot 04858ecbab Bump AGP to 8.11.0 (#52248)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52248

Just keep the AGP version update.

Changelog:
[Android] [Changed] - Bump AGP to 8.11.0

Reviewed By: rshest

Differential Revision: D77292284

fbshipit-source-id: 2d0bfe1b50e613690bc3cc6b81ae352136543fd4
2025-06-25 03:49:48 -07:00
Christian FalchandFacebook GitHub Bot d8e00f0bb1 Added backwards compatible use of prebuild through cocoapods (#52252)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52252

Instead of declaring two different sets of Pods for prebuilt and build from source, this commit now keeps the pod structure the same for both modes so that consuming libraries can expect to have the same pods and header files available - without this, libraries would have to be updated to take advantage of the prebuilds.

This PR does:
- Added React-Core-prebuilt as a pod in React-Core if prebuilt is enabled
- Simplified react_native_pods to keep pods structure and add React-Core-prebuilt pod if prebuilts are enabled
- Added function for selecting source sets based on prebuilt/build from source

To be able to function both in prebuilt and in regular build from source mode, all podspecs are now using the switch function podspec_sources so that they only include header files if we are in prebuild mode.

Also added React-Core-prebuilt as dependency on React-Core if we are in prebuilt mode so that we install the React.XCFramework.

## Changelog:

[IOS] [FIXED] - Added backwards compatible use of prebuild through cocoapods

Pull Request resolved: https://github.com/facebook/react-native/pull/52223

Test Plan:
Tested in RN-Tester both with and without prebuild.

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D77296047

Pulled By: cipolleschi

fbshipit-source-id: f3eb4d56b2a78bfc8e10ad852746be1ceaf828b2
2025-06-25 03:44:03 -07:00
Christian FalchandFacebook GitHub Bot 07f6f70aef Add missing RCTVibration target in SwiftPM (#52223)
Summary:
`Package.swift` was missing the `RCTVibration` target. This commit adds this target.

## Changelog:

[Internal] - Added RCTVibration to SwiftPM

Pull Request resolved: https://github.com/facebook/react-native/pull/52223

Test Plan: Tested in RN-Tester both with and without prebuild.

Reviewed By: cortinico

Differential Revision: D77257066

Pulled By: cipolleschi

fbshipit-source-id: 13c918387a2ed4a8e3941ddce8b7ba11c24eaab5
2025-06-25 03:44:03 -07:00
Alex HuntandFacebook GitHub Bot ece8ca82cd Update JS API snapshot to group exports in single block (#52235)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52235

Adds `organizeDeclarations` transform, replacing `sortTypeDefinitions`.

All `export declare ...` statements are now collected and represented at the end of the snapshot in a single `export {}` block — significantly improving readability and diffing.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77150017

fbshipit-source-id: 1bd451c0e2a18fd6fc0504970b10a5d2502ac872
2025-06-25 02:55:42 -07:00
Tim YungandFacebook GitHub Bot 08a59c59e0 VirtualView: Minimize Events w/ Render State (#52245)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52245

Changes `VirtualView` to avoid dispatching redundant mode change events by reading the last committed `renderState` to determine whether the desired render state is already in effect.

This enables `VirtualView` to avoid dispatching synchronous `Visible` mode change events when a previous `Prerender` mode change event has already been committed.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D77271865

fbshipit-source-id: 75418aec1416995737f308a1beff407f2cedb940
2025-06-25 02:18:52 -07:00
Jakub PiaseckiandFacebook GitHub Bot fbd44ade3a Change Animated methods' local names to avoid symbol collisions in the API snapshot (#52219)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52219

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77221690

fbshipit-source-id: 149711ee8c9d89c50178bf3d41de8b44fbc1d464
2025-06-25 00:16:24 -07:00
Jakub PiaseckiandFacebook GitHub Bot 4f94028ca6 Reduce symbol collisions in the API snapshot (#52213)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52213

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D77207979

fbshipit-source-id: 10d8b9c8f24ddb52423197f5aa300402b1e45ebe
2025-06-25 00:16:24 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 0a567a63cd Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/jni/first-party/fbgloginit (#52217)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52217

Reviewed By: javache

Differential Revision: D77211475

fbshipit-source-id: 22a89c5211ffc5f9f09ad27dc5e2597c6ceefd99
2025-06-24 22:55:27 -07:00
Tim YungandFacebook GitHub Bot 19ebd4c188 VirtualView: Prerender w/o Window Focus (#52240)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52240

Changes `VirtualView` to detect when its window is not in a focused window (e.g. scroll position or layout changes when it is blurred) and to instead dispatch an async `Prerender` event instead of a sync `Visible` event.

This minimizes unnecessary main thread synchronous work that is needed for a view that is not important to the user experience.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D77261958

fbshipit-source-id: 32acef9bc938005a0d73c5166f1741aebadf23bb
2025-06-24 22:33:07 -07:00
George ZaharievandFacebook GitHub Bot a2a72e239d Enable experimental Flow 'match' syntax for react-native-github/packages/react-native/src/private/components/virtualview/ (#52236)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52236

Enable experimental Flow 'match' syntax for `react-native-github/packages/react-native/src/private/components/virtualview/` and adopt in one case to see if there are any issues.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D77250963

fbshipit-source-id: 0b2a5817a05f3332031f0c0590fe956eaa74ddd3
2025-06-24 17:55:57 -07:00
Cao DoanandFacebook GitHub Bot fedceecc37 Correct some cpp imports (#52212)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52212

Correcting some C++ imports that show up when build with Xcode 26:
- Missing `<string>` imports.
- `<tgmath.h>` is a deprecated C++ header file, which in this case can be substituted with `<cmath>`.

## Changelog: [Internal]

[iOS][Fixed] - Fix deprecated C++ imports

Reviewed By: zhenma

Differential Revision: D77192276

fbshipit-source-id: 30c836947cb3eb54f6e7ac42b87fd2493334a4f4
2025-06-24 15:38:23 -07:00
Sam ZhouandFacebook GitHub Bot e3047db0dc Deploy 0.274.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D77246379

fbshipit-source-id: 4a86da380109e85b5e1d53f5723f6ea07e6ea429
2025-06-24 12:58:53 -07:00
Andrew DatsenkoandFacebook GitHub Bot 1e212f91bc Add remaining dependencies (#52202)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52202

Changelog: [Internal]

Build fantom_tester for OSS

Reviewed By: mdvacca

Differential Revision: D76928253

fbshipit-source-id: a95e8751326f45a25cd512b7a5d05260b37a0305
2025-06-24 12:33:59 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 4f1f72ea34 Fix downloading nightly prebuilds (#52233)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52233

When working on [c1bf39bfdf](https://github.com/facebook/react-native/commit/c1bf39bfdfaa0381be3a20d0d89ce159e482afe1) I forgot to add a `.body` to extract the body from the response.

As a result, we can't install prebuilds in a nightly.

This change fixes this.

## Changelog:
[Internal] -

Reviewed By: realsoelynn

Differential Revision: D77241914

fbshipit-source-id: 013ed927e1a3cd6476a551995577ade80c477dd7
2025-06-24 12:05:51 -07:00
Sam ZhouandFacebook GitHub Bot fe1aacae6d Pre-suppress errors in fbsource ahead of 0.274.0 release (#52232)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52232

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D77230727

fbshipit-source-id: 890b819ffa3ea9996fa11d254215ea1304ba02b4
2025-06-24 11:04:37 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot a82b5acf3d Fix jumping talkback triggering scroll when reaching a view with accessibilityOrder (#52231)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52231

Not calling `super.onInitializeAccessibilityNodeInfo` on the host view with accessibilityOrder prevents setting proper dimensions for the node that backs the view which leads TalkBack to trigger scrolling when under a ScrollVIew.

We still need the host's node to not be accessible so we still set it to not be focusable and not have a content description since this should be handled by the virtual views

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D77180494

fbshipit-source-id: fe8794cf421cdc9548cf3e18a62d4bb3e8c26b09
2025-06-24 09:37:36 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 8cc2874d3f Fix View Coopting View edge case on Android (#52066)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52066

Before, to disable views that were excluded from the order we were setting them to be not important for accessibility. This however breaks coopting behavior of parent views, because parent views will not announce content descriptions of children that are not important for accessibility.

Instead of disabling by setting `important for accessibility = no` now we just set `isFocusable = false` which disables focusing but still allows parent views to coopt

We also add functionality to restore view focusability when enabling disabling screen readers since `isFocusable` changes keyboard focusability and when screen readers are disabled we don't want to change it.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D76745057

fbshipit-source-id: cc237c5f8a4b894a7caa3e34207080777de440ac
2025-06-24 09:37:36 -07:00
Alex HuntandFacebook GitHub Bot d012b2c19b Fix stripUnstableApis to match type alias declarations (#52229)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52229

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77148443

fbshipit-source-id: 423da38dfe5ca42e639e274461868a51e9987384
2025-06-24 09:15:53 -07:00
Alex HuntandFacebook GitHub Bot cfc6960bc4 Update all transforms to apply sequentially (#52228)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52228

To avoid unexpected behaviour, apply all Babel transforms within `build-types` sequentially, so that each transform plugin has an accurate starting AST.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77148444

fbshipit-source-id: f86beac12b7a08ef800e28db1ff88755970cf64e
2025-06-24 09:15:53 -07:00
Alex HuntandFacebook GitHub Bot ef742dbc68 Subfolder build-types transforms by language (#52230)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52230

Reorganisation/refactoring.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D77148446

fbshipit-source-id: fd29c6d47347efd5ad3da933b2112e864064dba7
2025-06-24 09:15:53 -07:00
Alex HuntandFacebook GitHub Bot 11a1ad7a98 Expose *AnimationConfig types (#52227)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52227

Changelog:
[General][Added] - Expose additional `*AnimationConfig` types on the `Animated` namespace

Differential Revision: D77222030

fbshipit-source-id: 8fd01d820c3c8d6e952a4115578ecc83ae7a0d0f
2025-06-24 08:55:21 -07:00
Alex HuntandFacebook GitHub Bot b01a5f91fe Expose Animated.InterpolationConfig type (#52224)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52224

Changelog:
[General][Added] - `InterpolationConfig` is now exposed on the `Animated` namespace

Differential Revision: D77222031

fbshipit-source-id: c64c2f348bc899c598ee86c637300037a5a8de6f
2025-06-24 08:55:21 -07:00
Mateo GuzmánandFacebook GitHub Bot 65ae3dafcd Migrate UIManagerHelper to Kotlin (#52209)
Summary:
Migrate com.facebook.react.uimanager.UIManagerHelper to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.uimanager.UIManagerHelper to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/52209

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D77210140

Pulled By: cortinico

fbshipit-source-id: 7a6669a6d92d33241d3f42edbabf20170a5a6ddf
2025-06-24 08:06:13 -07:00
Mateo GuzmánandFacebook GitHub Bot d3495fd162 Migrate ReactApplicationContext to Kotlin (#52208)
Summary:
Migrate com.facebook.react.bridge.ReactApplicationContext to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.bridge.ReactApplicationContext to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/52208

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D77209812

Pulled By: cortinico

fbshipit-source-id: 2dae094d363e60efe05b4f2b3d55f0f84d921495
2025-06-24 08:03:22 -07:00
Andrew DatsenkoandFacebook GitHub Bot 252e1345bf Move fantom into OSS (#52201)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52201

Changelog: [Internal]

Moving fantom tester into OSS.

Reviewed By: rubennorte

Differential Revision: D76928252

fbshipit-source-id: 3faf4a236eacba17896e0a440bac7a5032d063f9
2025-06-24 07:24:41 -07:00
Andrew DatsenkoandFacebook GitHub Bot dd1b795abe Introduce react_native_android_dep (#52194)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52194

Changelog: [Internal]

Introducing a way to include sources and deps via function that react_native_android_dep.

This will help with Fantom OSS build.

Reviewed By: cortinico

Differential Revision: D77146189

fbshipit-source-id: 06b09d433741506bc1f58fbf1f9e6add9a9cff91
2025-06-24 07:24:41 -07:00
Mateo GuzmánandFacebook GitHub Bot c125f306c2 Kotlin: fix static code analysis weak warnings (4/n) (#52207)
Summary:
Static code analysis reports several weak warnings, many of which seem to be leftovers after Kotlin migration. This PR addresses quite a few:

- [Redundant curly braces in string template](https://www.jetbrains.com/help/inspectopedia/RemoveCurlyBracesFromTemplate.html)
- [Redundant call to toString() in string template](https://www.jetbrains.com/help/inspectopedia/RemoveToStringInStringTemplate.html)

## Changelog:

[INTERNAL] - Kotlin: fix static code analysis weak warnings (4/n)

Pull Request resolved: https://github.com/facebook/react-native/pull/52207

Test Plan:
```sh
yarn android
yarn test-android
```

Reviewed By: javache

Differential Revision: D77209873

Pulled By: cortinico

fbshipit-source-id: 2bf5fcf7dcbf02632e721aab0688f73d15f220b9
2025-06-24 06:36:11 -07:00
Alex HuntandFacebook GitHub Bot 03ab6a3098 Add nocommit to V2 JS API snapshot (#52200)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52200

Remains in an experimental format. Add `\nocommit` to prevent accidental inclusion in the repo right now.

Also disable ESLint rule `redundant-undefined/redundant-undefined`.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77150743

fbshipit-source-id: 645e7db5af2c2a648eef7c8f7e324bc1264b8065
2025-06-24 06:31:04 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 46b562b9b3 Ship the new React-Core-prebuilt.podspec in the package.json (#52221)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52221

It is currently not possible to use prebuilds, because we are missing the `React-Core-prebuilt.podspec` from the npm package we publish.

This change should fix it.

## Changelog:
[iOS][Added] - Ship the `React-Core-prebuilt.podspec` in the package.json

Reviewed By: cortinico

Differential Revision: D77223271

fbshipit-source-id: ab068e1711fdd86f3f0069dc9aa3c0a591fcd26b
2025-06-24 06:01:36 -07:00
Riccardo CipolleschiandFacebook GitHub Bot c1bf39bfdf Fix download of nightlies with SwiftPM (#52215)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52215

We were not handling the download of the XML properly. Using `Net::HTTP.get` will directly return the body and that won't let us check on the status code of the response.

## Changelog:
[Internal] - use get_response instead of get when downloading the maven metadata

Reviewed By: cortinico

Differential Revision: D77216121

fbshipit-source-id: 4da0abff1624c687977a7b77db8a15f19e6b887d
2025-06-24 06:01:36 -07:00
nishan (o^▽^o)andFacebook GitHub Bot f238b74658 - Use CAGradientLayer for radial gradient (#52117)
Summary:
This PR replaces Core Graphics implementation with Core Animation for radial gradients. I found that `endPoints` for radial gradient type works differently than linear gradient type. The `endPoint.x` accounts for horizontal length and `endPoint.y` accounts for vertical. This makes it possible to draw ellipse gradients. So we don't need the core graphics API anymore.

## Changelog:

[IOS] [CHANGED] - Optimised Radial Gradients.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/52117

Test Plan: Non breaking change. Test Radial gradient example from RNTester. Compare results with web, android and iOS. Each platform should render the gradients identically.

Reviewed By: rshest

Differential Revision: D77140709

Pulled By: javache

fbshipit-source-id: 6e3ad9fcf8e819d340ccf5f5946beb140e616cb0
2025-06-24 05:10:30 -07:00
Mateo GuzmánandFacebook GitHub Bot 76e2ab4ac8 Kotlin: fix static code analysis weak warnings (3/n) (#52206)
Summary:
Static code analysis reports several weak warnings, many of which seem to be leftovers after Kotlin migration. This PR addresses quite a few:

- [Return or assignment can be lifted out](https://www.jetbrains.com/help/inspectopedia/LiftReturnOrAssignment.html)
- [Verbose nullability and emptiness check](https://www.jetbrains.com/help/inspectopedia/VerboseNullabilityAndEmptiness.html)
- [Size check can be replaced with 'isNotEmpty()'](https://www.jetbrains.com/help/inspectopedia/ReplaceSizeCheckWithIsNotEmpty.html)

## Changelog:

[INTERNAL] - Kotlin: fix static code analysis weak warnings (3/n)

Pull Request resolved: https://github.com/facebook/react-native/pull/52206

Test Plan:
```sh
yarn android
yarn test-android
```

Reviewed By: javache

Differential Revision: D77209766

Pulled By: cortinico

fbshipit-source-id: c154ec6578125c16ad37c9dd15295a2edcacee4a
2025-06-24 04:55:33 -07:00
Mo JavadandFacebook GitHub Bot 35dba09724 Add explicit Build Tools Version to RN Tester Android App Benchmark (#52216)
Summary:
After bumping to SDK version 36, the build process for Android was still pulling in SDK v35 unnecessarily. This PR fixes that issue.

## Changelog:

[ANDROID] [FIXED] - Added explicit build tool version to RN Tester build.gradle to avoid automatic installation of Android SDK Build Tools.

Pull Request resolved: https://github.com/facebook/react-native/pull/52216

Test Plan:
Tested in fork pipeline to ensure it's working correctly.

This is the logs from the pipeline before:
![image](https://github.com/user-attachments/assets/9dc7f158-8dea-437e-836e-e5f500b3d5ff)

And this is after the fix:
![image](https://github.com/user-attachments/assets/c6cc1c0a-5823-41cb-ba32-027b69d6eaa6)

Reviewed By: rshest

Differential Revision: D77219569

Pulled By: cortinico

fbshipit-source-id: 7a0ca462d00bfc4b015a30807aaef999ff60c719
2025-06-24 04:34:46 -07:00
Mateo GuzmánandFacebook GitHub Bot 9e96acbd0f Kotlin: fix static code analysis weak warnings (2/n) (#52205)
Summary:
Static code analysis reports several weak warnings, many of which seem to be leftovers after Kotlin migration. This PR addresses:

- [Kotlin Java methods should be replaced with Kotlin analog](https://www.jetbrains.com/help/inspectopedia/ReplaceJavaStaticMethodWithKotlinAnalog.html)

## Changelog:

[INTERNAL] - Kotlin: fix static code analysis weak warnings (2/n)

Pull Request resolved: https://github.com/facebook/react-native/pull/52205

Test Plan:
```sh
yarn android
yarn test-android
```

Reviewed By: javache

Differential Revision: D77209667

Pulled By: cortinico

fbshipit-source-id: 09b01a170abf43248b8fdb6a08498d278b9d03bd
2025-06-24 03:40:58 -07:00
Alex HuntandFacebook GitHub Bot 40b8f4ad22 Adjust source types for better output (#52199)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52199

Minor fixes to naming and generic type compatibility (→ TypeScript).

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77148914

fbshipit-source-id: 2d3e65170f261b97ea8cf705d1a40a6f7bc5bcc7
2025-06-24 02:57:34 -07:00
George ZaharievandFacebook GitHub Bot 3306691d64 Update hermes-parser and related packages in xplat and socialvr to 0.29.0 (#52211)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52211

Update hermes-parser and related packages in xplat and socialvr to 0.29.0

Changelog: [Internal]

Blocked on: https://fb.workplace.com/groups/relay.support/posts/28766057099682865

Reviewed By: SamChou19815

Differential Revision: D77004095

fbshipit-source-id: 5400ac07c0cbf1f9709d374929d842af9dd15d08
2025-06-23 19:19:50 -07:00
Antonio PiresandFacebook GitHub Bot f184b591cf adding scrollTo, and imperative handle exports for ScrollView (#52204)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52204

Changelog:
[General][Added] - Expose `ScrollViewImperativeMethods` and `ScrollViewScrollToOptions` types to public API

Reviewed By: huntie

Differential Revision: D76920770

fbshipit-source-id: 01b0a2788f7b8a3bad0b57e24b04a7380233ac34
2025-06-23 12:13:02 -07:00
Joe VilchesandFacebook GitHub Bot 62d8d30652 Revamp the accessibility order example in RNTester (#52122)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52122

Would love to have a place with all the edge cases we can come back to when we try and tweak things.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D76942595

fbshipit-source-id: ce6e293e2c068383e54404af71a29a0586dbc04e
2025-06-23 11:07:52 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 60967fdffb Fix CQS signal modernize-use-nullptr in xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput (#52145)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52145

Reviewed By: javache

Differential Revision: D77010402

fbshipit-source-id: db2823f888b1fca279ff13f8a323e074fcdf61f0
2025-06-23 09:55:44 -07:00
Zane BaumanandFacebook GitHub Bot 4b91b63094 fix: add missing getNativeScrollRef type for ScrollView (#52203)
Summary:
### The Problem

When trying to measure the location of a `View` within a `ScrollView` (ie. for scrolling to the view), the current recommended method is to use `measureLayout` on the nested view to determine its location inside the containing scroll view:

```tsx
const MyComponent = () => {
  const scrollViewRef = useRef<ScrollView>(null);
  const nestedViewRef = useRef<View>(null);

  const scrollToNestedView = () => {
    if (!scrollViewRef.current || !nestedViewRef.current) {
      return;
    }

    nestedViewRef.current.measureLayout(
      scrollViewRef.current.getInnerViewNode(),
      (x, y) => { scrollViewRef.current.scrollTo({ y, animated: true }); },
    );
  }

  return (
    <ScrollView ref={scrollViewRef}>
      <View ref={nestedViewRef}>
        { /* content */ }
      </View>
    </ScrollView>
  );
}
```

This is valid in the Typescript types layer. However, the only two methods on `ScrollView` to use in this scenario that are [available in the type definitions](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/ScrollView/ScrollView.d.ts#L830) are `getScrollableNode` and `getInnerViewNode` – both of these methods [return a `number`](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/ScrollView/ScrollView.js#L139-L140). The issue is that a `number` not a valid value to use with `measureLayout` because [its source returns early for that type](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js#L91-L102).

(Note, you can also use `findNodeHandle` with the scroll view ref, but this also returns a `number`.)

### The Solution

The long-term solution would be to update the types for both `measureLayout` and `ScrollView`. However, that would constitute a breaking change and require some fairly expansive updates. Instead, I am proposing an additive solution.

`ScrollView` has [a public method called `getNativeScrollRef`](https://github.com/facebook/react-native/blob/e69f0726cd2616fb112d2e4fabfeaafc8cada5d7/packages/react-native/Libraries/Components/ScrollView/ScrollView.js#L142) which returns the underlying `HostInstance`. This method correctly works in the runtime layer, but is not supported in the types layer. This PR exposes the public method in the type definition so that we can properly access the underlying instance without using `ts-ignore`.

## Changelog:[GENERAL] [FIXED] - Expose `ScrollView.getNativeScrollRef` on the type definition to allow accessing the underlying `HostInstance`.

Pull Request resolved: https://github.com/facebook/react-native/pull/52203

Test Plan: None needed. This is only a type update exposing existing functionality.

Reviewed By: cortinico

Differential Revision: D77153959

Pulled By: rshest

fbshipit-source-id: 5880695da85406ed9fe49a1b736b5754db0e6382
2025-06-23 09:55:32 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 7f7655d711 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/cxxreact (#52146)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52146

Reviewed By: javache

Differential Revision: D77014011

fbshipit-source-id: 35afa03482c9a4d1fe11325421615a7214337e2a
2025-06-23 09:52:30 -07:00
Dawid MałeckiandFacebook GitHub Bot 76e04fac82 Replace shelljs in run-ci-javascript-tests.js (#52095)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52095

This diff removes `shelljs` from `run-ci-javascript-tests.js` and replaces `echo, exec, and exit` methods.

### Motivation

Decrease number of references to `shelljs` across the react-native-github.

Changelog:
[Internal]

Reviewed By: NickGerleman

Differential Revision: D76512374

fbshipit-source-id: 6e02901b570cf9a36bd13a075106a7066a85a2d9
2025-06-23 09:39:44 -07:00
Rubén NorteandFacebook GitHub Bot 18f4db44ef Clean up dead logic in RuntimeScheduler_Modern and simplify logic (#52192)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52192

Changelog: [internal]

When we shipped the event loop we removed the need to run only expired tasks in `RuntimeScheduler_Modern`, but we never cleaned up the code properly. This does it.

Reviewed By: javache

Differential Revision: D77142978

fbshipit-source-id: f808edf80a134f487723fa36ab7a3593e4efe2d3
2025-06-23 08:34:50 -07:00
Rubén NorteandFacebook GitHub Bot 251eb3fd4c Log task ID when scheduling and executing tasks in RuntimeScheduler (#52191)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52191

Changelog: [internal]

Some time ago we added logging for the timer ID in Systrace/Perfetto so we could see where timers were scheduled vs. executed.

This diff adds support for the same functionality for tasks in the runtime scheduler.

Reviewed By: javache

Differential Revision: D77039038

fbshipit-source-id: 792d2fe29b44fb209f9129f46f9d661dad7ebdff
2025-06-23 08:34:50 -07:00
Rubén NorteandFacebook GitHub Bot 3782fe865d Improve tracing metadata for IntersectionObserverManager (#52190)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52190

Changelog: [internal]

This adds some tracing metadata to IntersectionObserver to contextualize the performance of certain operations (logging how many observers it's processing).

Reviewed By: javache

Differential Revision: D77039037

fbshipit-source-id: 9cee79ac0509f57e4658a16142f3fe2d10d71fdf
2025-06-23 08:34:50 -07:00
Rubén NorteandFacebook GitHub Bot 5742227dd8 Add Fantom benchmark for RuntimeScheduler (#52189)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52189

Changelog: [internal]

This creates a benchmark to measure the changes in performance in RuntimeScheduler.

Reviewed By: javache

Differential Revision: D77142979

fbshipit-source-id: 1a6e6824f4c6fdb8d2c5cbad77fb4b8ba406ef29
2025-06-23 08:34:50 -07:00
Christian FalchandFacebook GitHub Bot 90654e4ba2 Integrate React Core prebuilds with apps (#52138)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52138

Integrate React Core prebuilds with apps

## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.

- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js

## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.

I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.

## Changelog:

[IOS] [ADDED] - Added support for using prebuilt RNCore with Cocoapods

Pull Request resolved: https://github.com/facebook/react-native/pull/52109

Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76980286

Pulled By: cipolleschi

fbshipit-source-id: 0ef34599cf7a60e54f799708bce93bcf6fb9d950
2025-06-23 08:13:56 -07:00
Christian FalchandFacebook GitHub Bot 60c01b4715 Update RNDependencies podspec to fail fast if framework is missing (#52134)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52134

Update RNDependencies podspec to fail fast if framework is missing

## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.

- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js

## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.

I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.

## Changelog:

[IOS] [CHANGED] - Fail fast when pod install i f using prebuild if frameworks are not present in the disk.

Pull Request resolved: https://github.com/facebook/react-native/pull/52109

Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76980282

Pulled By: cipolleschi

fbshipit-source-id: 6ab029d0cb06e2f0a3d99ea9fc7b375865e7a966
2025-06-23 08:13:56 -07:00
Christian FalchandFacebook GitHub Bot 69e028da45 Update the xcframework.js script to support swift (#52135)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52135

Update the xcframework.js script to support Swift

## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.

- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js

## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.

I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.

## Changelog:

[INTERNAL] - Update the xcframework.js script to support Swift

Pull Request resolved: https://github.com/facebook/react-native/pull/52109

Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76980285

Pulled By: cipolleschi

fbshipit-source-id: 4e5486b79c406ba4b375e2ada24cbe5450e2346f
2025-06-23 08:13:56 -07:00
Christian FalchandFacebook GitHub Bot 152cb538f6 Update ReactCodegen to support Core prebuilds (#52137)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52137

Update ReactCodegen to support Core prebuilds

## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.

- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js

## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.

I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.

## Changelog:

[IOS] [CHANGED] - Update ReactCodegen to support Core prebuilds

Pull Request resolved: https://github.com/facebook/react-native/pull/52109

Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76980283

Pulled By: cipolleschi

fbshipit-source-id: 4b120203e9e1628a63580b0b3b2e882837c0b818
2025-06-23 08:13:56 -07:00
Christian FalchandFacebook GitHub Bot 2ec6e3d901 Update rndependencies.rb to use the same logic of rncore.rb (#52136)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52136

Update rndependencies.rb to use the same logic of rncore.rb

## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.

- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js

## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.

I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.

## Changelog:

[INTERNAL] - Update rndependencies.rb to use the same logic of rncore.rb

Pull Request resolved: https://github.com/facebook/react-native/pull/52109

Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76980284

Pulled By: cipolleschi

fbshipit-source-id: a7f09d931c66e2fdf468a09da4be1d40847f472b
2025-06-23 08:13:56 -07:00
Christian FalchandFacebook GitHub Bot 1a86ee17fb Add React-Core-prebuild.podspec to integrate React native core prebuilds using cocoapods (#52133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52133

Add React-Core-prebuild.podspec to integrate React native core prebuilds using cocoapods

## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.

- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js

## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.

I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.

## Changelog:

[IOS] [ADDED] - Add `React-Core-prebuild.podspec` to integrate React native core prebuilds using cocoapods

Pull Request resolved: https://github.com/facebook/react-native/pull/52109

Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76980281

Pulled By: cipolleschi

fbshipit-source-id: ce102837d6df6ab0fa2e55862cc0c954125bd362
2025-06-23 08:13:56 -07:00
Christian FalchandFacebook GitHub Bot 8888cf9a2d Introduce rncore.rb to manage the core prebuilds (#52109)
Summary:
Introduce rncore.rb to manage the prebuilds of RNCore.

## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.

- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js

## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.

I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.

bypass-github-export-checks

## Changelog:

[INTERNAL] - Added script to handle React Core prebuilds

Pull Request resolved: https://github.com/facebook/react-native/pull/52109

Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)

Rollback Plan:

Reviewed By: cortinico, rshest

Differential Revision: D76979549

Pulled By: cipolleschi

fbshipit-source-id: 7a2b1809bf58b600293cc33ca2dcff0060f3fab0
2025-06-23 08:13:56 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 27c97ac942 Minimal implementation for ImageLoaderModule in ReactCxxPlatform (#52198)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52198

# Changelog:
[Internal] -

This provides an implementation of what was the RnCxx ImageLoaderModule stub inside ReactCxxPlatform, allowing the clients use dependency injection to provide the actual platform specific image loading functionality.

Reviewed By: javache

Differential Revision: D77015269

fbshipit-source-id: 7355dd75692c1f564de8c3daffd6c8a79182dc09
2025-06-23 07:44:36 -07:00
Nicola CortiandFacebook GitHub Bot e69f0726cd Make EventDispatcherImpl internal (#52154)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52154

I wasn't able to find any meaningful usage of `EventDispatcherImpl` in OSS, therefore I'm making this class internal.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D77024759

fbshipit-source-id: e1ff3329cedf96a8c75edb9b9ccc1ce21adfab11
2025-06-23 07:35:06 -07:00
Nicola CortiandFacebook GitHub Bot 1ced97fbe6 Convert EventDispatcherImpl to Kotlin (#52150)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52150

This is another class moving from Java to Kotlin.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D77021952

fbshipit-source-id: 0b04a10bcbe65b7dc14ddd2821f80d90a43f8610
2025-06-23 07:35:06 -07:00
Nicola CortiandFacebook GitHub Bot ff7e24f19a @DoNotStrip ReactModalHostView to prevent instacrash on release (#52195)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52195

RNTester is currently instacrashing on release due to use minifying the `ReactModalHostView`.
In that class there is a static method that is accessed by JNI so we should annotated this class
as `DoNotStrip` as otherwise we won't be able to access it.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D77148010

fbshipit-source-id: c5b2758fa2919bc1f5885433202a45b4c3f8ff99
2025-06-23 07:24:47 -07:00
Nicola CortiandFacebook GitHub Bot d9ec57a3b9 Add further logging to help investigate T228303477 (#52185)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52185

It seems like one of the activity on the stack is not properly implementing `DefaultHardwareBackBtnHandler`.
This will make the crash more clear as it will be clear which activity is the one responsible for the crash.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D77142320

fbshipit-source-id: 1913976d1ad5d3ceafcfc0569f3b74dad9e919ae
2025-06-23 06:07:50 -07:00
Nicola CortiandFacebook GitHub Bot 33fed54a16 Truncate the changelog pre-80 to a separate file.
Summary:
Splitting the CHANGELOG as it's getting too big to handle.

Changelog:
[Internal] [Changed] -

bypass-github-export-checks

Reviewed By: cipolleschi

Differential Revision: D77025333

fbshipit-source-id: cf2d54f2096f9c8c6a3fadb354d0c3065370440d
2025-06-23 06:00:07 -07:00
Andrew DatsenkoandFacebook GitHub Bot 7b7b538d6b fix cmake empty spaces and naming (#52186)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52186

Changelog: [Internal]
Minor fixes to spacing in cmake files and naming inconsistency

Reviewed By: cortinico

Differential Revision: D77141854

fbshipit-source-id: d1e12e571dbc0f7630d9d38faad7b22d0833dd2f
2025-06-23 04:25:59 -07:00
Pieter De BaetsandFacebook GitHub Bot 9612d2e225 NativeAnimated Kotlin nits (#52148)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52148

Address some Android Studio lint suggestions

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D77017839

fbshipit-source-id: c0e025ee7eaae74560cfc8ff6ecc45a893e0dda1
2025-06-23 04:24:58 -07:00
Pieter De BaetsandFacebook GitHub Bot ee8b66e278 View clipping Kotlin nits (#52147)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52147

Simplify some of the nullability / checkNotNull behaviour

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D76334294

fbshipit-source-id: 32c2d0ab50713789ddf6af5e40083bae2161c91f
2025-06-23 04:24:58 -07:00
Susmita HorrowandFacebook GitHub Bot f214a52a9a Revert D76814453: Reduce symbol collisions in the API snapshot
Differential Revision:
D76814453

Original commit changeset: fffbf585d63e

Original Phabricator Diff: D76814453

fbshipit-source-id: 418ae90fb49c8c05f077bca7e434c039ad49c7ba
2025-06-23 01:43:20 -07:00
Jakub PiaseckiandFacebook GitHub Bot f338db9c17 Reduce symbol collisions in the API snapshot (#52085)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52085

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D76814453

fbshipit-source-id: fffbf585d63e282443830c08397ae5e4d745785a
2025-06-23 00:34:05 -07:00
Jakub PiaseckiandFacebook GitHub Bot fe4047fe3a Replace ElementConfig with directly imported props (#51971)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51971

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D76502294

fbshipit-source-id: ed98c5e6d9ef5fd6a4d1adbd6a88ce8cda52b969
2025-06-22 23:58:45 -07:00
Andrew DatsenkoandFacebook GitHub Bot 9f479ff8d6 Add react_cxx_platform_react_utils cmake (#52177)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52177

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_utils

Reviewed By: christophpurrer

Differential Revision: D77038580

fbshipit-source-id: 7cdd8defd57629342095587bd3e1819e04af50bd
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot dda8ab69d4 Add react_cxx_platform_react_threading cmake (#52176)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52176

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_threading

Reviewed By: christophpurrer

Differential Revision: D77038544

fbshipit-source-id: 950e28af49c5de3870e11e03d5123f22a0f04a6b
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot f04d1f1ef7 Add react_cxx_platform_react_runtime cmake (#52178)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52178

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_runtime

Reviewed By: christophpurrer

Differential Revision: D77038450

fbshipit-source-id: 54515f1aff84632c8a86abd8970107a1bd8ca043
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 54a1e41694 Add react_cxx_platform_react_renderer_uimanager cmake (#52175)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52175

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_renderer_uimanager

Reviewed By: christophpurrer

Differential Revision: D77038183

fbshipit-source-id: 736651e170884f69313711f744c40194f259bfa1
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 269cf58140 Add react_cxx_platform_react_renderer_scheduler cmake (#52174)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52174

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_renderer_scheduler

Reviewed By: christophpurrer

Differential Revision: D77038129

fbshipit-source-id: f843c719d08f42f379042484542f4f4e5b94a2c6
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 941853974b Add react_cxx_platform_react_renderer_animated cmake (#52173)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52173

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_renderer_animated

Reviewed By: christophpurrer

Differential Revision: D77038030

fbshipit-source-id: 6ca45f0251c74dc49b5c1d72c42575b80248eb2a
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 36c0826f56 Add react_cxx_platform_react_profiling cmake (#52172)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52172

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_profiling

Reviewed By: christophpurrer

Differential Revision: D77037934

fbshipit-source-id: 555a00cc59d48fd167810ba29075fb4cb3e53d62
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 7970f79078 Add react_cxx_platform_react_nativemodule cmake (#52171)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52171

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_nativemodule

Reviewed By: christophpurrer

Differential Revision: D77037835

fbshipit-source-id: 09346824c5e39ca9c41edeb22462d65408d95f18
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 37e863e866 Add react_cxx_platform_react_logging cmake (#52170)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52170

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_logging

Reviewed By: christophpurrer

Differential Revision: D77037715

fbshipit-source-id: ea21160473d876c0014dcfc2d17323b2e0c4c0b2
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 5961edd825 Add react_cxx_platform_react_io cmake (#52169)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52169

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_io

Reviewed By: christophpurrer

Differential Revision: D77037593

fbshipit-source-id: 849c2b0b0de14b9a583b997f3137763df59b4af1
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 71d6d86ed6 Add react_cxx_platform_react_http cmake (#52167)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52167

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_http

Reviewed By: christophpurrer

Differential Revision: D77037486

fbshipit-source-id: 7e90ed26cefa407a1e64ebdad8ac5835803c2c49
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 0a7e1342cd Add react_cxx_platform_react_devsupport cmake (#52166)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52166

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_devsupport

Reviewed By: christophpurrer

Differential Revision: D77037372

fbshipit-source-id: e6ed42492f29abfb93fe22b0c01a5d3a2ca7cf53
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 891656d055 Add react_cxx_platform_react_coremodules cmake (#52165)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52165

Changelog: [Internal]
Add cmake lib react_cxx_platform_react_coremodules

Reviewed By: christophpurrer

Differential Revision: D77036283

fbshipit-source-id: 54141d32f61d1025ae40c60335a6831ec038217e
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot abbef4a0b8 Add react_renderer_observers_mutation cmake (#52164)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52164

Changelog: [Internal]
Add cmake library react_renderer_observers_mutation

Reviewed By: christophpurrer

Differential Revision: D77036195

fbshipit-source-id: 6661b6aecab83b1fd254dd7f7fca1c906538aee5
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot e888329e9a Add react_renderer_observers_intersection cmake (#52163)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52163

Changelog: [Internal]
Add cmake library react_renderer_observers_intersection

Reviewed By: christophpurrer

Differential Revision: D77036086

fbshipit-source-id: 9f7c2c9574c09f7775362a6155433fa194111f0b
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 1f8374e1dd Add react_nativemodule_webperformance cmake (#52162)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52162

Changelog: [Internal]
Add cmake library react_nativemodule_webperformance

Reviewed By: christophpurrer

Differential Revision: D77035999

fbshipit-source-id: da267ddf10d9a9de315038142f7764d81190131a
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot a10ee5808b Add react_nativemodule_mutationobserver cmake (#52161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52161

Changelog: [Internal]
Add missing lib react_nativemodule_mutationobserver

Reviewed By: christophpurrer

Differential Revision: D77035742

fbshipit-source-id: f900024f0ad4f4e4596c4fa5730463277ee17242
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot ab2ce4f2d8 add react_nativemodule_intersectionobserver cmake (#52160)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52160

Changelog: [Internal]
Add missing cmake lib for react_nativemodule_intersectionobserver

Reviewed By: christophpurrer

Differential Revision: D77035609

fbshipit-source-id: d6c372d48a2c60b403b33d1477e6085347fe8633
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot ee256d11ae Add react_nativemodule_fantomspecificmethods cmake (#52159)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52159

Changelog: [Internal]
Add missing cmake target for react_nativemodule_fantomspecificmethods

Reviewed By: christophpurrer

Differential Revision: D77035521

fbshipit-source-id: caedff8d4479c1bff3d03ec149b15a8cd5458092
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 1f53d51e64 RN] Add missing link libraries for react_nativemodule_defaults (#52158)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52158

Changelog: [Internal]
As title

Reviewed By: christophpurrer

Differential Revision: D77035424

fbshipit-source-id: 745cecd5e6d16a8cea6b2a883992fec75b565d31
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 4f71a9434d Create react/nativemodule/cputime/CMakeLists.txt (#52157)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52157

Changelog: [Internal]

Add CMakeLists for `react/nativemodule/cputime`

Reviewed By: christophpurrer

Differential Revision: D77035337

fbshipit-source-id: c18289ed0558f8be7ba62f71bd74978a7c768e11
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot ed9969b3d0 Fix cmake build for devtoolsruntimesettings (#52156)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52156

Changelog: [Internal]

Fix devtoolsruntimesettings lib as it needs to be OBJECT library as it has source code included.

Reviewed By: christophpurrer

Differential Revision: D77035122

fbshipit-source-id: 27ad7fe637512afc79f3dcc6b0846dcfd4f22504
2025-06-22 23:48:38 -07:00
Andrew DatsenkoandFacebook GitHub Bot 04da4800da Gate RN_SERIALIZABLE_STATE behind ANDROID flag (#52155)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52155

Changelog: [Internal]

Gating RN_SERIALIZABLE_STATE behind ANDROID flag so we can build ReactCommon with cmake when targeting different platforms.
This will help build reac-native-fantom for OSS.

Reviewed By: christophpurrer

Differential Revision: D77034689

fbshipit-source-id: 15f9192c90693f4743f31fcf72f593802b622c47
2025-06-22 23:48:38 -07:00
Jakub PiaseckiandFacebook GitHub Bot bc093b8fa9 Remove undefined from optional type members in the API snapshot (#52009)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52009

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D76596252

fbshipit-source-id: 3d6c0ee10cbbb71435933e2ad74f1acc962f14b4
2025-06-22 23:29:29 -07:00
buschcoandFacebook GitHub Bot fbbd20dd63 publish index.js.flow instead of index.flow.js (#52179)
Summary:
I think in https://github.com/facebook/react-native/commit/50667eceb1be4771375d6a3cc2f4e42d4d8aad3a the file name was mixed up. Instead of `index.flow.js` it should be `index.js.flow` (see https://github.com/facebook/react-native/blob/main/packages/react-native/index.js.flow)

Should fix https://github.com/facebook/react-native/issues/51885

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

[General][Added] Publish top-level Flow types for `react-native`

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/52179

Test Plan:
Steps to reproduce

1. Setup a react-native project with flow (or clone https://github.com/buschco/react-native-flow + `cd ReproducerApp && npm i`)
2. `import {Alert} from 'react-native'` -> `Alert` has type `any`
3. add `index.js.flow` File (https://github.com/facebook/react-native/blob/v0.79.3/packages/react-native/index.js.flow) to `node_modules/react-native/index.js.flow` -> `Alert` no longer `any`

Reviewed By: christophpurrer

Differential Revision: D77052871

Pulled By: robhogan

fbshipit-source-id: 32b0052a9d96486aff66a1f6e4577ff62cbcd97e
2025-06-21 01:06:03 -07:00
Zeya PengandFacebook GitHub Bot 710e08cd54 Add Fantom test for layout props & fix an issue in c++ animated (#52110)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52110

## Changelog:

[General] [Internal] - Add Fantom test for layout props

With this test it turns out `layoutStyleUpdated_` on PropsAnimatedNode actually can change after animation update, because its connected StyleAnimatedNodes might be changing. This bug was introduced since D74602321

Reviewed By: rshest

Differential Revision: D76753864

fbshipit-source-id: 5bebb11340086390df20c89adf80abaa63cadc90
2025-06-20 16:04:48 -07:00
Zeya PengandFacebook GitHub Bot cc442eb8c8 Add Fantom.getFabricUpdateProps (#52108)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52108

## Changelog:

[General] [Added] - Add Fantom.getFabricUpdateProps

For reading fabric update props scheduled via `UIManager::updateShadowTree`

Reviewed By: rshest

Differential Revision: D76857429

fbshipit-source-id: d19312d0b1c6460258a7949054e66313f05afdbf
2025-06-20 16:04:48 -07:00
Mateo GuzmánandFacebook GitHub Bot aaad7e083d Kotlin: fix static code analysis weak warnings (1/n) (#52153)
Summary:
Static code analysis reports several weak warnings, many of which seem to be leftovers after Kotlin migration. This PR addresses quite a few:

- [Convert to primary constructor](https://www.jetbrains.com/help/inspectopedia/ConvertSecondaryConstructorToPrimary.html)
- [If-Then foldable to '?.'](https://www.jetbrains.com/help/inspectopedia/IfThenToSafeAccess.html)
- [Non-canonical modifier order](https://www.jetbrains.com/help/inspectopedia/SortModifiers.html)

## Changelog:

[INTERNAL] - Kotlin: fix static code analysis weak warnings (1/n)

Pull Request resolved: https://github.com/facebook/react-native/pull/52153

Test Plan:
```sh
yarn android
yarn test-android
```

Reviewed By: christophpurrer

Differential Revision: D77042260

Pulled By: arushikesarwani94

fbshipit-source-id: ea210976ccbcecbe4843ff5205238a83fc75d43b
2025-06-20 16:03:34 -07:00
Nicola CortiandFacebook GitHub Bot 999f437b02 Add categories for 0.80 changelog
Summary:
I've added categories for all the entries + sorted them alphabetically.

Changelog:
[Internal] [Changed] -

bypass-github-export-checks

Reviewed By: fabriziocucci

Differential Revision: D77025334

fbshipit-source-id: 4c29bf3fa299078689473d7cf3c7cf8a79f4c097
2025-06-20 10:21:52 -07:00
Pieter De BaetsandFacebook GitHub Bot ffb37373ba Schedule OnViewAttachMountItems in GuardedRunnable (#52143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52143

Noticed that some of the `IndexOutOfBoundsException` crashes we've been tracking we're not being reported as soft errors because they were not running wrapped by the RN ExceptionHandler

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D77017423

fbshipit-source-id: 760297a0c5ee3d58577931829a31d312dacffdf1
2025-06-20 08:42:32 -07:00
Alex HuntandFacebook GitHub Bot e297fe1582 Improve CLI output for build-types (#52151)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52151

Update `yarn build-types` with incremental progress output in the terminal. Minor refactoring.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D77022957

fbshipit-source-id: d4a000a85c779fbdcda317164413b29674474178
2025-06-20 08:21:29 -07:00
Andrew DatsenkoandFacebook GitHub Bot 386a930afb HermesInstance::createJSRuntime integration (#52111)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52111

Changelog: [Internal]

JSRuntime integration with executor on messagequeue.

Inching closer to full integration with the rest of RN.

Reviewed By: rshest

Differential Revision: D76752667

fbshipit-source-id: 0ef8fe0c615dc1eb45355f7502e01663772ebf13
2025-06-20 07:08:28 -07:00
Nicola CortiandFacebook GitHub Bot 281f48daf4 Bump compileSdk to 36 (#52141)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52141

This is to make sure we're using buildTools 36 (Android 16) to compile everything.

Changelog:
[Internal] [Changed] -

Reviewed By: rshest

Differential Revision: D77014531

fbshipit-source-id: 65b16abce7f88c4a4c0b8b1b77e632cff2e64197
2025-06-20 06:09:47 -07:00
Mateo GuzmánandFacebook GitHub Bot a44098ea27 Kotlin: clean up redundant visibility modifiers (2/2) (#52139)
Summary:
Follow up from https://github.com/facebook/react-native/issues/51960, this PR cleans up the remaining warnings for redundant visibility modifiers detected by static code analysis.

## Changelog:

[INTERNAL] - Kotlin: clean up redundant visibility modifiers (2/2)

Pull Request resolved: https://github.com/facebook/react-native/pull/52139

Test Plan:
```sh
yarn android
yarn test-android
```

Reviewed By: cortinico

Differential Revision: D76997415

Pulled By: sbuggay

fbshipit-source-id: 77244dc83f8ecbf90cf3ade0f299930871ab3ae9
2025-06-20 00:00:28 -07:00
Arushi KesarwaniandFacebook GitHub Bot 0f7bf66bba Adding shouldForwardToReactInstance check in ReactDelegate for Bridgeless (#52112)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52112

Adding `shouldForwardToReactInstance` check in Bridgeless since it was missed in https://github.com/facebook/react-native/pull/43351

**Changelog:**
[ANDROID][FIXED] - Adding `shouldForwardToReactInstance` check in ReactDelegate for Bridgeless

Reviewed By: cortinico, javache

Differential Revision: D76908041

fbshipit-source-id: 20b8fce248d8e560ab862cf325b6f8b15be870e3
2025-06-19 18:37:50 -07:00
Sophie LandFacebook GitHub Bot 14a213229a fix: improve the grammar/clarity of the stale bot comments (#52124)
Summary:
this PR makes the stale bot messages a bit clearer and fixes a grammatical issue.

# Changelog:

[INTERNAL] [FIXED] Tweak stale bot messages

Pull Request resolved: https://github.com/facebook/react-native/pull/52124

Test Plan: N/A

Reviewed By: andrewdacenko

Differential Revision: D76969503

Pulled By: cortinico

fbshipit-source-id: d030a0488b44521f61447e252bae5ded10826dbb
2025-06-19 10:42:05 -07:00
Nicola CortiandFacebook GitHub Bot 4223285a23 Fix broken LayoutableShadowNodeTest after Modal fix. (#52130)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52130

After D73948178, Modals now need to access JNI to get the dimension of the
screen to properly position the modal on first rendering.

Before my change, the Modal was positioned in 0,0 (which is the default
behavior for CXX).
I'm suppressing this test for Android, as it will keep on running with the
previous behavior for CXX.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D76979787

fbshipit-source-id: 78675712f97baee29036f943b2a8bcd23047e4ed
2025-06-19 10:31:53 -07:00
Nicola CortiandFacebook GitHub Bot 55b87a5293 Make PointerEvent internal (#52131)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52131

This class is not used in OSS and can be made internal.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D76979122

fbshipit-source-id: 2d81e3605e6c51336b3bdb2671dd9faf8f25639b
2025-06-19 09:59:27 -07:00
Nicola CortiandFacebook GitHub Bot 0cf2985d27 Convert PointerEvent to Kotlin (#52132)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52132

This is yet another class that is getting converted from Java to Kotlin.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D76979123

fbshipit-source-id: d1fc54e61d64b78a56cf0198ae5fe588702a8698
2025-06-19 09:59:27 -07:00
nishan (o^▽^o)andFacebook GitHub Bot 2f3b104224 - Use CAGradientLayer for linear gradient (#52096)
Summary:
This PR replaces Core Graphics implementation with Core Animation for linear gradients. I came across a great [solution](https://stackoverflow.com/questions/38821631/cagradientlayer-diagonal-gradient/43176174#43176174) that makes the `CAGradientLayer`'s start and end point behaviour CSS spec compliant. This will make gradients much more performant.

## Changelog:

[IOS] [CHANGED] - Optimised Linear Gradients.
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/52096

Test Plan:
Non breaking change. Test Linear gradient example from RNTester. Compare results with web, android and iOS. Each platform should render the gradients identically.

## Note:

I will be doing a PR to use `CAGradientLayer` for radial gradients as well. The next properties that I have locally working are `background-size`, `background-position` and `background-repeat`. These will be addressed in small PRs.

Reviewed By: NickGerleman

Differential Revision: D76905215

Pulled By: javache

fbshipit-source-id: 0094bdf70869d619272d491dd496983316b0dbf0
2025-06-19 09:50:45 -07:00
Pieter De BaetsandFacebook GitHub Bot 6a3116a8a9 Add screenshot tests for LinearGradient (#52128)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52128

Changelog: [Internal]

Reviewed By: andrewdacenko

Differential Revision: D76972006

fbshipit-source-id: 657b78a842578df46f81d2416726665f49655a4f
2025-06-19 09:50:45 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 432ad09c41 Remove usage of SafeAreaView from RNTester (#52129)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52129

This remove all the usages of SafeAreaView from RNTester.
The problem is that we introduced a warning that SafEAreaView is deprecated and, therefore, we had a warning in debug mode.

This was causing a yellow bubble to appear and the OSS E2E test started failing.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76978227

fbshipit-source-id: c45a31bae1602bc307e4fbbd71e7987a8ed78858
2025-06-19 09:29:40 -07:00
Nicola CortiandFacebook GitHub Bot b950fa2afb Fix Modal first frame being rendered on top-left corner (#51048)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51048

Fixes https://github.com/facebook/react-native/issues/50442
Closes https://github.com/facebook/react-native/pull/50704

Users reported that Modals on Android are first renderer anchored in 0,0.
That results in them being on the top left corner of the screen for some seconds.

This is happening because the native state of the Modal on Android as width/height set at 0,0 - which we then update in a subsequent callback.

I'm fixing this by making sure we render the Modal the first time with the right screen size - the status bar size

Changelog:
[Android] [Fixed] - Fix Modal first frame being rendered on top-left corner

Reviewed By: javache

Differential Revision: D73948178

fbshipit-source-id: 055c12aa62d70acc1e4c5a2a5c4ea0c5608e22c7
2025-06-19 06:21:16 -07:00
Ruslan LesiutinandFacebook GitHub Bot 52df5dee91 Update debugger-frontend from 68cfd0a...d95ac13 (#52119)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52119

Changelog: [Internal] - Update `react-native/debugger-frontend` from 68cfd0a...d95ac13

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/68cfd0ae84acb0ed8e47b421afd64ae3b0b5b727...d95ac13bf0ab64a5e6c2eb18eb138587063b9c34).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [d95ac13bf](https://github.com/facebook/react-native-devtools-frontend/commit/d95ac13bf) | Ruslan Lesiutin (rdlesyutin@gmail.com) | 2025-06-18T12:35:02+01:00 | [fix: hide workplace suggest on Sources placeholder element (#180)](https://github.com/facebook/react-native-devtools-frontend/commit/d95ac13bf) |

Reviewed By: huntie

Differential Revision: D76919604

fbshipit-source-id: 55aa28f9fc9288df71019e8ca9001b35863395b1
2025-06-19 05:08:55 -07:00
Mateo GuzmánandFacebook GitHub Bot 50ea5b4380 Migrate ReactDelegate to Kotlin (#52024)
Summary:
Migrate com.facebook.react.ReactDelegate to Kotlin.

## Changelog:

[ANDROID][BREAKING] - Migrate com.facebook.react.ReactDelegate to Kotlin. Some users implementing this class in Kotlin could have breakages.

Pull Request resolved: https://github.com/facebook/react-native/pull/52024

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D76740335

Pulled By: cortinico

fbshipit-source-id: d9ad948a71438070500685042c067f621fd3ea26
2025-06-19 04:33:53 -07:00
Nicola CortiandFacebook GitHub Bot 184664d47b Fix support for react.internal.useHermesNightly (#52127)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52127

Currently using `react.internal.useHermesNightly` is broken locally because we try to search for versions such as 0.0.0.+ while the nightlies version are of the form 0.81.0-...

This fixes it.

Changelog:
[Internal] [Changed] -

Reviewed By: NickGerleman

Differential Revision: D76901197

fbshipit-source-id: 51f7b2e7ec936aace67d4d62a8019554800347fc
2025-06-19 03:51:52 -07:00
Mateo GuzmánandFacebook GitHub Bot 2b75479fa2 Migrate to Kotlin and internalize MountItemDispatcher (#52121)
Summary:
Migrate to Kotlin and internalize com.facebook.react.fabric.mounting.MountItemDispatcher.

This class has [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.fabric.mounting.MountItemDispatcher) so it can be internalized as well as it exposes some other internal classes and we don't want to make those public again.

## Changelog:

[ANDROID][CHANGED] - Migrate to Kotlin and internalize com.facebook.react.fabric.mounting.MountItemDispatcher

Pull Request resolved: https://github.com/facebook/react-native/pull/52121

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico, rshest

Differential Revision: D76967018

Pulled By: javache

fbshipit-source-id: def4be448db15705fc11e50e3fe8f9e532d973bb
2025-06-19 03:48:27 -07:00
Rubén NorteandFacebook GitHub Bot 2a52ee8ddb Clean up feature flag enableIntersectionObserverEventLoopIntegration (#52102)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52102

Changelog: [internal]

This ships the variant of IntersectionObserver that integrates directly with the Event Loop, avoiding dispatching notifications during observation and waiting for the end of the Event Loop tick instead. Also cleans up all the associated feature flags.

Reviewed By: lenaic

Differential Revision: D76892649

fbshipit-source-id: 9364b43a4d60b75c25b9a2d6ced7937b03376b04
2025-06-19 02:48:39 -07:00
Mateo GuzmánandFacebook GitHub Bot 1d945629bf Clean up incorrect @VisibleForTesting annotation usages (#52025)
Summary:
Static code analysis reports 18 warnings for incorrect usages of the `VisibleForTesting` annotation as some of the classes/functions/properties that are annotated are not used only in tests but also in other non-test files across the codebase. This PR cleans that up to fix those warnings.

## Changelog:

[INTERNAL] - Clean up incorrect VisibleForTesting annotation usages

Pull Request resolved: https://github.com/facebook/react-native/pull/52025

Test Plan:
```sh
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D76745241

Pulled By: sbuggay

fbshipit-source-id: 4702a7258002916cc95c178dc8931c8bb471f7bc
2025-06-18 22:25:09 -07:00
Mateo GuzmánandFacebook GitHub Bot 7885508f9b Migrate ReactTextShadowNode to Kotlin (#52116)
Summary:
Migrate com.facebook.react.views.text.ReactTextShadowNode to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.views.text.ReactTextShadowNode to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/52116

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: NickGerleman

Differential Revision: D76930707

Pulled By: sbuggay

fbshipit-source-id: 8e5c2c1b96ccaa2185d5c7f606e204470c401cbd
2025-06-18 20:59:02 -07:00
Joe VilchesandFacebook GitHub Bot 5e331304cb Comma separate co-opted accessibility labels (#52120)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52120

It is pretty jarring for semantically different labels to be read all at once, let's comma separate them - which VoiceOver will pause at. Android does this by default with its coopting implementation

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D76921000

fbshipit-source-id: afe1f93e38babde918137576d0693c1579101ef7
2025-06-18 15:20:56 -07:00
Luna WeiandFacebook GitHub Bot f00b449498 Export unstable_VirtualView with iOS, Android implementations (#51980)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51980

Changelog: [Internal] - Export unstable_VirtualView. This is currently experimental

Reviewed By: mdvacca

Differential Revision: D76471250

fbshipit-source-id: 107b82c9ac93b31d7e30ea3473e341788176cdde
2025-06-18 14:11:39 -07:00
Peter AbbondanzoandFacebook GitHub Bot 94cbf206d6 Remove focus change listener and restore original when dropping view instance (#52093)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52093

This change updates the `BaseViewManager` implementation to drop and restore the original focus listener when a view instance has its `onDropViewInstance` method called. This is necessary to support view recycling, since the `addEventEmitters` method is called each time a recycled view is popped out of the stack. This would result in N+1 `onFocus`/`onBlur` calls for each time the view is recycled.

Changelog: [Android][Fixed] - Remove focus change listener when dropping/recycling view instances

Reviewed By: NickGerleman

Differential Revision: D76852137

fbshipit-source-id: 9e980e7a1850a952baf04724bc251ff32186c6fa
2025-06-18 11:21:32 -07:00
Rubén NorteandFacebook GitHub Bot 6bfc1187a8 Improve formatting for benchmark output (#52106)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52106

Changelog: [internal]

This slightly improves the formatting of the output produced by benchmarks, so we can just copy&paste the result to share it as valid Markdown.

Reviewed By: christophpurrer

Differential Revision: D76898244

fbshipit-source-id: dc1040ee3787c7f0dcb747c9fba8eb14086a0087
2025-06-18 09:36:36 -07:00
Rubén NorteandFacebook GitHub Bot 29704b1f02 Add support for Static Hermes staging in Fantom (#52105)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52105

Changelog: [internal]

I just learnt there's a Hermes variant that we don't support (staging) so this adds support for it.

Reviewed By: christophpurrer

Differential Revision: D76897715

fbshipit-source-id: 3113edde3c785d71ad4a57dd435f16e13ab46976
2025-06-18 09:36:36 -07:00
Mateo GuzmánandFacebook GitHub Bot ccc8ce0d01 Remove lint-java (#52092)
Summary:
Following up from https://github.com/facebook/react-native/pull/52064#discussion_r2151906096, this PR removes lint-java and its related files.

The codebase is moving entirely to Kotlin and a Kotlin linter is being setup as well, the usage of the Java linter will become unnecessary.

## Changelog:

[INTERNAL] - Remove lint-java

Pull Request resolved: https://github.com/facebook/react-native/pull/52092

Test Plan: Relying on CI here to be green.

Reviewed By: cortinico

Differential Revision: D76880712

Pulled By: sbuggay

fbshipit-source-id: 2736772e7347f435b17d007e0322e1afc2fb2d7b
2025-06-18 08:22:04 -07:00
Krzysztof PiaskowyandFacebook GitHub Bot 1cc12ce7fd Fix the serialization of the alpha channel in the rgba() color string format (#52087)
Summary:
The alpha channel in the `rgba()` color string format should be a value between [0, 1] instead of [0, 255], as stated in the [React Native Documentation](https://reactnative.dev/docs/colors#red-green-blue-rgb).

## Changelog:

[GENERAL] [FIXED] - Fix the serialization of the alpha channel in the `rgba()` color string format.

Pull Request resolved: https://github.com/facebook/react-native/pull/52087

Test Plan: I didn't find any usage of that function in React Native, but it is part of the public API, and I just wanted to use it in Reanimated.

Reviewed By: fabriziocucci

Differential Revision: D76822560

Pulled By: javache

fbshipit-source-id: 370d9729881c1eda794c1b9fe54d258242fde814
2025-06-18 07:28:34 -07:00
Oskar KwaśniewskiandFacebook GitHub Bot 28986a7599 fix(iOS): allow to interactively swipe down the modal (#51483)
Summary:
This PR allows to interactively close the modal using the swipe down gesture.

It fixes 5 year old issue: https://github.com/facebook/react-native/issues/29319

In short it removes `modalInPresentation` which according to the documentation causes: "UIKit ignores events outside the view controller’s bounds and **prevents the interactive dismissal of the view controller while it is onscreen.**".

It also adds another delegate event to call onRequestClose whenever modal is closed by gesture.

https://github.com/user-attachments/assets/8849ecba-f762-47ec-a28b-b41c1991a882

## Changelog:

[IOS] [ADDED] - Allow to interactively swipe down the modal.
Add allowSwipeDismissal prop.

Pull Request resolved: https://github.com/facebook/react-native/pull/51483

Test Plan: Test if swiping down the modal calls onRequestClose

Reviewed By: rshest

Differential Revision: D75125438

Pulled By: javache

fbshipit-source-id: d4f2c8b59447680f405b725d0809573a937f97cf
2025-06-18 07:18:40 -07:00
Zeya PengandFacebook GitHub Bot ce75271d47 Gate logic to remove js sync at end of native animation loop (#52068)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52068

## Changelog:

[Internal] [Changed] - Gate logic to remove js sync at end of native animation loop

because https://github.com/facebook/react-native/pull/51264 is causing regression in some cases, and was recently reverted again in https://github.com/facebook/react-native/pull/51933 . Using an extra feature flag to gate this potential optimization

Reviewed By: lenaic

Differential Revision: D76759441

fbshipit-source-id: 6950ab746b02af6e0b710ded0ddb6993673e5212
2025-06-18 06:54:09 -07:00
Zeya PengandFacebook GitHub Bot 99c60bfe0a Create feature flag cxxNativeAnimatedRemoveJsSync (#52067)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52067

## Changelog:

[Internal] [Changed] - Create feature flag cxxNativeAnimatedRemoveJsSync for optimization in cxx animated

Reviewed By: christophpurrer

Differential Revision: D76763197

fbshipit-source-id: 503d7cea53b6a5c3ed769b0d77a9d64730029433
2025-06-18 06:54:09 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot a477ee6ced Update ReactNativeCPP.api file (#52103)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52103

## Changelog:
[Internal] -

This got out of sync again, causing the corresponding signal to fail.

Reviewed By: lenaic

Differential Revision: D76893994

fbshipit-source-id: e0e78cd41633972be53aa883c6015588b547b9c2
2025-06-18 06:38:35 -07:00
Rubén NorteandFacebook GitHub Bot a17a7003b1 Remove unnecessary feature flags from fantom tests (#52101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52101

Changelog: [internal]

`enableAccessToHostTreeInFabric` is enabled by default in tests, so doesn't need to be explicitly set.

Reviewed By: lenaic

Differential Revision: D76894319

fbshipit-source-id: 437a763bd9c557ecbafa53e31410da1120151b86
2025-06-18 06:03:12 -07:00
Vincent WongandFacebook GitHub Bot f70c01cc30 Revert D76757706: Fix LegacyViewManagerInteropComponentDescriptor
Differential Revision:
D76757706

Original commit changeset: 6fc6127b6ff4

Original Phabricator Diff: D76757706

fbshipit-source-id: 88a72c06dd799c322320870c69906cb843a6021d
2025-06-18 04:54:32 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot bc6b4f0525 Specify missing default destructor and assignment operator declarations in ImageRequest (#52099)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52099

# Changelog:
[Internal] -

Fixes a linter warning for the `ImageRequest` class declaration (AKA "C++ rule of 5").

Reviewed By: javache

Differential Revision: D76888523

fbshipit-source-id: aa080a582942bd083030d6b6ecd82294566b507c
2025-06-18 04:43:28 -07:00
Enrique López MañasandFacebook GitHub Bot 73133a31d5 Deprecating SafeAreaView (#51896)
Summary:
`SafeAreaView` has been marked for deprecation some time ago. The [following discussion](https://github.com/react-native-community/discussions-and-proposals/discussions/827) summarizes some of the arguments for it, but in a nutshell: it is iOS-only, limited in functionality, and incompatible with Android 15's enforced edge-to-edge rendering.

~~The Android/Kotlin classes have also been deprecated.~~ Not anymore, they are internal and might stay as they are.

## Changelog:

[General] [Deprecated] - Deprecate SafeAreaView due to its iOS-only support and incompatibility with Android 15 edge-to-edge behavior; recommend using react-native-safe-area-context instead.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/51896

Test Plan: Access `SafeAreaView` in your code and check that the deprecation warning logs exactly once in the console.

Reviewed By: rshest

Differential Revision: D76816160

Pulled By: cortinico

fbshipit-source-id: 60f539f9425f8ed8e19578a4530cb1f7d9b54488
2025-06-18 04:15:05 -07:00
Nicola CortiandFacebook GitHub Bot 9258e90c92 Publish, Close and Release the Maven repository during build_npm_package
Summary:
Due to us moving to central.sonatype.com for publishing, we cannot publish and release the Maven repository in 2 distinct invocations.
This consolidates all the publishing job to happen during build_npm_package

Changelog:
[Internal] [Changed] -

Reviewed By: fabriziocucci

Differential Revision: D76888543

fbshipit-source-id: 3cb0db6176ed2221a12b4f3f1f575232aa006a6c
2025-06-18 04:02:28 -07:00
Fabrizio CucciandFacebook GitHub Bot f783d30beb Add changelog for 0.79.4 (#52100)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52100

As pet title.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D76889179

fbshipit-source-id: 7551ade832a88ff8d6501945228e50d2572006bb
2025-06-18 03:16:48 -07:00
Samuel SuslaandFacebook GitHub Bot 2915902763 introduce gesture driven animations sync mechanism for C++ Animated (#52081)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52081

changelog: [internal]

# The problem in Java and Obj-C Native Animated
--------------------

Event based animations in Native Animated have one big problem: detecting when the gesture is completed. This has led to number of bugs over the years that manifest as Pressable's onPress not triggering. The root cause of the problem is disconnect between where a piece of UI is on the screen and where Fabric thinks it is. Fabric is used for hit testing, and other things like intersection observing, and if Fabric does not have up to date values, weird things start happening.

This diff implements completion detection for event based animations. Unlike previous solutions, it does not depend on sequence of events nor it uses React setState to update shadow tree.

# Completion Detection
--------------------

The key mechanism for marking event animations as completed is in the `onRender` method:

- After processing animations, if `onAnimationFrame` returns false - indicating no UI changes, the system assumes all event-driven animations have completed.
- it then:
    *   Collects all animated value nodes connected to event drivers.
    *   Updates all nodes connected to these "finished" animations.
    *   isEventAnimationInProgress_ to false.
    *   Commits final property values to the UI.

The benefits over the previous solution:
- It works across all platforms without the need to emit "completion events".
- It uses a UI frame that wouldn't animate anything to do syncing work. Using main thread IDLE time towards bookkeeping.
- No need to call into JavaScript for synchronisation.

Reviewed By: zeyap

Differential Revision: D76743467

fbshipit-source-id: b21ab5ef9c71ff93fd0250e6af6b22ded395be8d
2025-06-18 02:38:43 -07:00
Soe LynnandFacebook GitHub Bot c31ff55b92 Fix LegacyViewManagerInteropComponentDescriptor (#52094)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52094

Changelog [Internal]:
- LegacyViewManagerInteropComponentDescriptor was initiaizing Module just to get the `Class` for `componentName`. This can cause deadlock issue when we have module that needs mainQueue to initialize.

Reviewed By: RSNara

Differential Revision: D76757706

fbshipit-source-id: 6fc6127b6ff472fda509364f0c3daa13b6a6df1e
2025-06-17 22:16:43 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot d405e306e3 Make experimental_accessibilityOrder a View prop only (#52056)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52056

This prop should only be used on Views using it in Text is not very intuitive and also would require some unnecessary edge case handling on Android which we now also remove

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D76744972

fbshipit-source-id: 23113789747295ea1a306727f1e29e3ddc078ac4
2025-06-17 18:07:58 -07:00
Ramanpreet NaraandFacebook GitHub Bot ad88309843 Compile out the legacy runtime
Summary:
Compile out the legacy c++ core from android.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D72991984

fbshipit-source-id: 56bb6ca1c4797adb9235e982121712b11e85e109
2025-06-17 16:02:03 -07:00
FBLite Revert BotandFacebook GitHub Bot fd29d68c16 Revert D76793705: Fix possible invalid measurements when width or height is zero pixels
Differential Revision:
D76793705

Original commit changeset: ea4c00e68891

Original Phabricator Diff: D76793705

fbshipit-source-id: 95d6b66ab08e073da9fb07fd4094a7e30e2f453b
2025-06-17 14:33:32 -07:00
Nick GerlemanandFacebook GitHub Bot 5348f9ff1e Fix possible invalid measurements when width or height is zero pixels (#52073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52073

X-link: https://github.com/facebook/yoga/pull/1820

Fixes https://github.com/facebook/yoga/issues/1819

Yoga has a fast path when measuring a node, if it thinks it knows its dimensions ahead of time.

This path has some eroneous logic, to set both axis to owner size, if *either* will evaluate to zero, while having an `YGMeasureModeAtMost`/`FitContent` constraint. This means that if a node is given a zero width, and Yoga later measures with with `FitContent`, its height will become the maximum allowable height, even if it shouldn't be that large.

We can fix this, by only allowing if both axis are this fixed case, instead of just one.

This bug has existed for about a decade (going back to at least D3312496).

Changelog:
[General][Fixed] - Fix possible invalid measurements with width or height is zero pixels

Reviewed By: yungsters

Differential Revision: D76793705

fbshipit-source-id: ea4c00e688912a58c08801e4a14ddf1b293a5d86
2025-06-17 12:15:55 -07:00
Nick GerlemanandFacebook GitHub Bot e08e27a6fa Support Facsimile Views in Jest E2E Text Selectors (#52070)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52070

Changelog: [Internal]

Reviewed By: joevilches, rshest

Differential Revision: D76783111

fbshipit-source-id: 5f4c3a9cf6d59eff15a071761ef83425bd4c6d23
2025-06-17 12:13:27 -07:00
Nick GerlemanandFacebook GitHub Bot ded4ae1f78 Fix antialiasing for Facsimile on Android < 10 (#52069)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52069

Noticed an E2E tests against old emulator version showed aliased Text against Facsimile. This is because non-scratch-paint path does not explicitly enable anti-aliasing (like TextView does), older versions of Android don't enable by default, and `updateTextPaint()` no longer sets, after call to `paint.reset()` was removed.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D76780749

fbshipit-source-id: 26f0de6d6558649fe08339f1ac91390bbd4cce3c
2025-06-17 10:51:23 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 331fab0683 Remove JSC related files from the repo (#51945)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51945

Remove code from jsc folder from React Native

## Changelog:
[iOS][Removed] - Remove code from jsc folder from React Native

Reviewed By: rshest

Differential Revision: D76419587

fbshipit-source-id: 6d5079c8f2843872172620601629e9643c7debdc
2025-06-17 09:38:21 -07:00
Nicola CortiandFacebook GitHub Bot 33aa7b9161 Remove unreferenced CMakeLists.txt for ReactCommon/jsc (#52078)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52078

This Cmake file is not imported anymore and can be removed now.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D76808417

fbshipit-source-id: 81824c7c46080bc16c891b5c11c3a8946f16c1b9
2025-06-17 06:26:18 -07:00
Christian FalchandFacebook GitHub Bot 560ac23001 Added missing define to target .reactRuntime (#52082)
Summary:
The target needs the HERMES_ENABLE_DEBUGGER flag in debug just like .reactHermes does.

This commit fixes this by adding the define to the reactRuntime target.

## Changelog:

[IOS] [FIXED] - Added HERMES_ENABLE_DEBUGGER to debug configuration for the reactRuntime target.

Pull Request resolved: https://github.com/facebook/react-native/pull/52082

Test Plan: Prebuild React Core

Reviewed By: robhogan

Differential Revision: D76813200

Pulled By: cipolleschi

fbshipit-source-id: cb81a40fb9c5a91ca40c3a27ae4ccdf043186bac
2025-06-17 06:21:19 -07:00
Pieter De BaetsandFacebook GitHub Bot 87cd1c0a0a Add rncore stub headers for backwards-compat (#52083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52083

These headers were removed in D55037569 but we may have some targets still depending on them. Add redirection headers with warnings to help users migrate without this being a breaking change.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D76810433

fbshipit-source-id: 43cddcc69eefbcff0c0140e165fb893bee493c79
2025-06-17 06:18:49 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 3ea4f156c9 Change imports from jsireact to reacthermes (#52011)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52011

This change aligns the import path of `jsireact/HermesExecutorFactory` to the OSS one: `reacthermes/HermesExecutorFactory`

## Changelog:
[Internal] -

Reviewed By: javache

Differential Revision: D76600638

fbshipit-source-id: d9ae35dec000196e4a51668c482fc27f3e6018b4
2025-06-17 05:51:02 -07:00
Nicola CortiandFacebook GitHub Bot 5e1768746a Unblock RNTester which is currently instacrashing. (#52077)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52077

RNTester is currently crashing on release due to a stripped `mHybridData` field.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D76808165

fbshipit-source-id: 049cca49f683c5dc92aa1f9a37dd7b4371dcbfd6
2025-06-17 04:54:47 -07:00
Samuel SuslaandFacebook GitHub Bot e259961e8b return object with string keys from getDirectManipulationProps
Summary:
changelog: [internal]

make API getDirectManipulationProps slightly nicer by returning `[string]: mixed` instead of mixed.

Reviewed By: rubennorte

Differential Revision: D76763893

fbshipit-source-id: 56c56578251b991f5fb3e68d44e834da17fc4a3b
2025-06-17 04:49:44 -07:00
Andrew DatsenkoandFacebook GitHub Bot aeaae4294f Add hermes and jsi (#52060)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52060

Changelog: [Internal]

Add hermes and jsi so we can evaluate JS.

Reviewed By: christophpurrer

Differential Revision: D76746362

fbshipit-source-id: a5fbb90d06a8608154b6ae80242b969e7cb03cea
2025-06-17 04:18:08 -07:00
Andrew DatsenkoandFacebook GitHub Bot 74b6acb1f0 Add gflags (#52015)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52015

Changelog: [Internal]
Add gflags to fantom_tester so we can pass in data like featureFlags

Reviewed By: cortinico

Differential Revision: D76618409

fbshipit-source-id: a18e642a02c405eef972a7418a606a5980253b6a
2025-06-17 04:18:08 -07:00
Fabrizio CucciandFacebook GitHub Bot a91e598e6a Minor renaming in ViewManagerRegistry (#52079)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52079

After the conversion to Kotlin (D74571782), there seems to be a synchronization issue when iterating on `viewManagers` (see T226095884).

There could a shadowing problem kicking in in a few places due to the fact that we are declaring a `viewManagers` local variable when there is already a `viewManagers` instance variable within `ViewManagerRegistry`.

To remove any ambiguity, here we are renaming the instance variable `viewManagers` as `viewManagersMap` (which also makes more sense).

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D76807070

fbshipit-source-id: 4f598700e04251409ee19b60515639e90699cc9e
2025-06-17 04:12:54 -07:00
Rubén NorteandFacebook GitHub Bot 10cabcc0a7 Refactor surface creation in Fantom (#52076)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52076

Changelog: [internal]

This refactors the implementation of surface creation in Fantom to make the surface ID handled in native, and treated as an opaque type the same way we do at runtime in RN.

Reviewed By: andrewdacenko

Differential Revision: D76744096

fbshipit-source-id: 1b49a1cbdf0a8d6804de3b87ede727207bc662d9
2025-06-17 03:52:09 -07:00
zhongwuzwandFacebook GitHub Bot 3bfbaa8455 Fabric: Only add selection of textinput payload when event is selectionChange (#51051)
Summary:
Fixes https://github.com/facebook/react-native/issues/51020: TextInputChangeEventData does not contain selection (see [here](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts#L515-L518)). Additionally, Android does not have selection either (see [here](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextChangedEvent.kt#L33-L37)) (iOS old arch also not contains it). We can consolidate these to prevent any misleading information.

## Changelog:

[IOS] [FIXED] -  Fabric: Only add selection of textinput payload when event is selectionChange

Pull Request resolved: https://github.com/facebook/react-native/pull/51051

Test Plan: TextInput `onChange`'s event should not contains `selection`.

Reviewed By: javache

Differential Revision: D76253999

Pulled By: cipolleschi

fbshipit-source-id: 8a889cce4998be0e31f4aa33961759e7d228e06f
2025-06-17 03:23:48 -07:00
Tim YungandFacebook GitHub Bot 742ffa39fb RN: Update Fantom Path in EXCLUDED_FIRST_PARTY_PATHS (#52051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52051

In {D76368959}, I moved `react-native-fantom` from `packages/` to `private/` and missed this reference.

Changelog:
[Internal]

Reviewed By: rubennorte

Differential Revision: D76743071

fbshipit-source-id: f99d3f2ac5e14fd23f7cf208ca030541844dddc6
2025-06-17 02:59:42 -07:00
Dawid MałeckiandFacebook GitHub Bot 6b40f35032 Add diff-api-snapshot for public API breaking change detection (#51972)
Summary:
This diff adds snapshot `diff-api-snapshot` script for public JS API breaking change detection.

### Motivation
Detecting if there are any breaking changes introduced in the commit. It is achieved by comparing `ReactNativeApi.d.ts` rollup from the current and previous revision.

This is a naive implementation with a three possible outcomes:
- BREAKING
- POTENTIALLY_NOT_BREAKING,
- NOT_BREAKING

The algorithm analyses exported top-level statements (after inlining) in both rollups and tries to create a mapping between them by name.

The **BREAKING** outcome happens whenever the statement is:
- removed
- renamed
- changed
- not exported anymore (private)

The **POTENTIALLY_NOT_BREAKING** outcome  happens if it's not BREAKING and the new statement is added.

The **NOT_BREAKING** outcome happens if public API snapshot doesn't change.

Changelog:
[General][Added] - Add public JS API breaking change detection under `yarn diff-api-snapshot` script.

Pull Request resolved: https://github.com/facebook/react-native/pull/51972

Test Plan:
Signals, added tests.

In `react-native-github` run:
`yarn test scripts/diff-api-snapshot/__tests__/diffApiSnapshot-test.js`

Rollback Plan:

Reviewed By: j-piasecki

Differential Revision: D76430965

Pulled By: coado

fbshipit-source-id: 095a196aa4f643501db0af9262556ddefff5d30d
2025-06-17 02:27:53 -07:00
Rubén NorteandFacebook GitHub Bot 4556bdf4fc Make OpaqueNativeObserverHandle really opaque (#52054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52054

Changelog: [internal]

This makes `OpaqueNativeObserverHandle` really opaque and fixes the problems in the observer implementation caused by it.

Reviewed By: yungsters

Differential Revision: D76744094

fbshipit-source-id: a8b6fa43ee8a5ee9d15f0171a83fe0badd46d9c3
2025-06-17 02:24:22 -07:00
Rubén NorteandFacebook GitHub Bot 98fdc965b9 Make IdleCallbackID opaque in NativeIdleCallbacks implementation (#52055)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52055

Changelog: [internal]

This migrates NativeIdleCallbacks to use opaque types now that they're supported in the codegen

Reviewed By: yungsters

Differential Revision: D76744095

fbshipit-source-id: d9d1beea8df7f5635fc531a2cef001ea0aed38b4
2025-06-17 02:24:22 -07:00
Rubén NorteandFacebook GitHub Bot e8cdb99baa Make NativeIntersectionObserverToken opaque in NativeIntersectionObserver implementation (#52053)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52053

Changelog: [internal]

The codegen allows us to do this already! :D

Reviewed By: yungsters

Differential Revision: D76741113

fbshipit-source-id: d460685bc6ad6ba11f7132136e8603bd57488014
2025-06-17 02:24:22 -07:00
Rubén NorteandFacebook GitHub Bot a15fc102e6 Add support for opaque types in Flow codegen for native modules (#52052)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52052

Changelog: [General][Added] - Add support for Flow opaque types in codegen for native modules

This allows us to codegen native modules that expose opaque types, but the implementation sees the type the same way they're visible in the JS spec.

Reviewed By: yungsters

Differential Revision: D76741112

fbshipit-source-id: 100ca9aa7f93d35120c52153f756436c9c380b07
2025-06-17 02:24:22 -07:00
Samuel SuslaandFacebook GitHub Bot 6ddfa708b0 small adjustments to when value listener is fired (#52063)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52063

changelog: [internal]

`addListener` API shouldn't fire when offset for node changes. Check https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/NativeAnimation/Nodes/RCTValueAnimatedNode.mm for reference.

Reviewed By: mdvacca

Differential Revision: D76740873

fbshipit-source-id: 04fb59ee9b630402803c4741f501d9d10591fa71
2025-06-17 02:16:32 -07:00
Samuel SuslaandFacebook GitHub Bot 1456d06c86 add comment explaining why addListener and removeListeners are not needed (#52062)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52062

changelog: [internal]

- update comments to be more descriptive.
- use `#pragma mark -` to better group methods in `NativeAnimatedNodesManager`. It is nicely formatted in VSCode.

{F1979345410}

Reviewed By: mdvacca

Differential Revision: D76737257

fbshipit-source-id: c4b22ca45cd5dec2c72e7931bfec4466cda3070c
2025-06-17 02:16:32 -07:00
Jakub PiaseckiandFacebook GitHub Bot 7bfadb429c Update prettier config for the API Snapshot (#52031)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52031

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D76710754

fbshipit-source-id: 36a07a2797b1270681420471aa66987163269a11
2025-06-17 00:06:13 -07:00
Jakub PiaseckiandFacebook GitHub Bot faaec467b9 Strip unstable/experimental identifiers from the API snapshot (#52008)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52008

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D73102445

fbshipit-source-id: fe2ce04b32c9d839fec8b33eda9c67e551918ba3
2025-06-17 00:06:13 -07:00
Nick GerlemanandFacebook GitHub Bot 64ce7695f5 Fix Facsimile Hit Testing Bugs (#52065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52065

1. We can crash when tapping at the boundary between two spans. Previous ReactTextView had some custom heuristic for overlapping ReactTags, assuming they could be nested, which never happens (We only have a single tag per AttributedString fragment), but spans may overlap at a single character, where one is meant to be exclusive, and the other inclusive. We add logic for that.
2. We don't incorporate the offset of the text layout within the view for hit testing, needed for padding or `textAlignVertical`.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D76764051

fbshipit-source-id: 308756c45d8ff574420dfc1c88678bae7e03e767
2025-06-16 20:51:23 -07:00
Gabriel DonadelandFacebook GitHub Bot 3ae9328571 Bump @types/react to 19.1 (#52059)
Summary:
While testing I notice that `types/react` was not updated in some peer depencies

## Changelog:

[GENERAL] [CHANGED] - Bump types/react to 19.1

Pull Request resolved: https://github.com/facebook/react-native/pull/52059

Test Plan: CI should be green

Reviewed By: christophpurrer

Differential Revision: D76763084

Pulled By: sbuggay

fbshipit-source-id: c078c03aa57ca04040c64986dd7957da8a6f2c2d
2025-06-16 17:45:11 -07:00
Christoph PurrerandFacebook GitHub Bot 89401b78cd Update outdated ReactNativeCPP.api (#52061)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52061

changelog: [internal] Update outdated ReactNativeCPP.api

Reviewed By: sammy-SC

Differential Revision: D76763455

fbshipit-source-id: bb9b72742594c19d70d930fa3827b450922428bb
2025-06-16 15:13:01 -07:00
Christoph PurrerandFacebook GitHub Bot 089fb10740 Remove folly::EvictingCacheMap (#52019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52019

Replace folly::EvictionMap with pure std implementation

changelog: [internal][Breaking] Remove unused set() method of SimpleThreadSafeCache

Reviewed By: javache, sammy-SC

Differential Revision: D76631579

fbshipit-source-id: 15dfa8a8c0d2809440c214a72e48def6e1dba2f0
2025-06-16 15:06:17 -07:00
Samuel SuslaandFacebook GitHub Bot 2528e48e93 implement Value.extractOffset in C++ Animated (#52049)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52049

changelog: [internal]

As title says, add implementation of [Value.extractOffset](https://reactnative.dev/docs/animatedvalue#extractoffset)

Reviewed By: zeyap

Differential Revision: D76735003

fbshipit-source-id: db09e2ed1c8b540d911970d2268fcd0374717e96
2025-06-16 14:30:19 -07:00
Samuel SuslaandFacebook GitHub Bot cb24596c33 add Value.flattenOffset to C++ Animated (#52047)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52047

changelog: [internal]

implement AnimatedValue.[flattenOffset](https://reactnative.dev/docs/animatedvalue#flattenoffset) in C++ Animated.

Reviewed By: javache

Differential Revision: D76733524

fbshipit-source-id: df969cf8be421dd6fa22c4100ccd2c33aa7c91d8
2025-06-16 14:30:19 -07:00
Peter AbbondanzoandFacebook GitHub Bot cfb6c968dd Mark hasTVPreferredFocus as deprecated (#52043)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52043

The `hasTVPreferredFocus` prop is functionally similar to the `focusable` prop. On iOS, the props are identical. The primary difference appears on Android, where the prop attempts to request focus when set to true. Attempting to invoke imperative API calls through declarative means has been [a source of confusion](https://github.com/react-native-tvos/react-native-tvos/issues/237) and we should instead recommend requesting focus through imperative means, like calling `focus()` on a specific view's ref instead. Workarounds presented rely on lifecycle methods to request focus natively.

This change only marks these methods as deprecated on JS. In the following version, they will be removed from the public API.

Changelog: [General][Deprecated] - Deprecate `hasTVPreferredFocus`

Reviewed By: andrewdacenko

Differential Revision: D76732539

fbshipit-source-id: 64912b4dacb76cd40e79148c1082d8ed8f573879
2025-06-16 12:05:47 -07:00
Mathieu ActhernoeneandFacebook GitHub Bot 3c17e101ee Add UiModeUtils.isDarkMode helper (#51925)
Summary:
This PR is part of the [edge-to-edge core implementation effort](https://github.com/facebook/react-native/pull/47554). It adds a helper to `ContextUtils`, called `isDarkMode` in order to be reused accross the Android codebase.

## Changelog:

- [Internal] [Added] - Add `UiModeUtils.isDarkMode` helper

Pull Request resolved: https://github.com/facebook/react-native/pull/51925

Test Plan:
<img width="300" alt="Screenshot 2025-06-10 at 17 50 19" src="https://github.com/user-attachments/assets/48795406-e852-486a-bae8-54507ad769ee" />

<img width="300" alt="Screenshot 2025-06-10 at 17 50 42" src="https://github.com/user-attachments/assets/0dbdece9-04f7-487b-ace8-4786c8da381d" />

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76352849

Pulled By: alanleedev

fbshipit-source-id: fbbc772d1dfa3e30e62a71a711de11b85cdec446
2025-06-16 10:35:35 -07:00
Nicola CortiandFacebook GitHub Bot 8174d02811 Cleanup all the JSC 1st party code. (#51949)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51949

This code is no longer necessary now that JSC support is offered via
https://github.com/react-native-community/javascriptcore

Instructions for users on how to continue using JSC are available in the README of such library.

Changelog:
[Android] [Removed] - Remove 1st party JSC support

Reviewed By: javache

Differential Revision: D76420382

fbshipit-source-id: f8e61556bb02fe4d5b34f89b40f8e5e38ac1c8d6
2025-06-16 10:30:39 -07:00
Janic DuplessisandFacebook GitHub Bot 7e2f17ffe2 Only generate recursive accessibility label for accessible elements (#51988)
Summary:
When trying to implement e2e tests using maestro in a large app I ran into major performance issues. I tracked it down to the generation of recursive accessibility labels.

The maestro iOS driver uses [XCUIElement snapshot dictionaryRepresentation](https://developer.apple.com/documentation/xctest/xcuielementsnapshot/dictionaryrepresentation) [here](https://github.com/mobile-dev-inc/Maestro/blob/96e8c9a2be3430be991c13d033486d52d2001334/maestro-ios-xctest-runner/maestro-driver-iosUITests/Routes/Handlers/ViewHierarchyHandler.swift#L234) to get a representation of the view hierarchy. The problem is that will query the accessibilityLabel for every single view, starting from the root of the app. It goes without saying that this is extremely slow since it traverses the view hierarchy, executing a recursive function on each one.

I think the only way to fix this is to avoid generating these recursive labels when not needed. From my understanding these should only be needed for accessible views.

## Changelog:

[IOS] [CHANGED] - Only generate recursive accessibility label for accessible elements

Pull Request resolved: https://github.com/facebook/react-native/pull/51988

Test Plan:
- Tested using VoiceOver in RN tester to make sure it works exactly the same.
- Tested in an app using Maestro to make sure this fixes the performance issue.
- Tested in RNTester running Maestro e2e test by creating a larger view hierarchy to make the problem more apparent, and simulate a real app. Using [this code](https://gist.github.com/janicduplessis/9f6b302d92b4e22ff5e8462a8a84e237) in RNTesterAppShared.js

Before:

```
❯ yarn e2e-test-ios
yarn run v1.22.22
$ ./scripts/maestro-test-ios.sh

Waiting for flows to complete...
[Passed] flatlist (14s)
[Passed] text (28s)
[Passed] modal (16s)
[Passed] image (8s)
[Passed] button (10s)
[Passed] legacy-native-module (32s)
[Passed] pressable (32s)
[Passed] new-arch-examples (35s)

8/8 Flows Passed in 2m 55s

  Done in 180.26s.
```

After:

```
❯ yarn e2e-test-ios
yarn run v1.22.22
$ ./scripts/maestro-test-ios.sh

Waiting for flows to complete...
[Passed] flatlist (7s)
[Passed] text (15s)
[Passed] modal (10s)
[Passed] image (4s)
[Passed] button (6s)
[Passed] legacy-native-module (16s)
[Passed] pressable (16s)
[Passed] new-arch-examples (17s)

8/8 Flows Passed in 1m 31s

  Done in 97.53s.
```

Reviewed By: christophpurrer, joevilches

Differential Revision: D76581949

Pulled By: cipolleschi

fbshipit-source-id: 0689c7d43a0c865572c4ee5ea32ee9b2dcb33ad5
2025-06-16 10:30:33 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot e13ee7a3d0 Fix accessibilityRespondsToUserInteraction not setting on first render (#51986)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51986

"{}" defaults to false on C++ but the prop is not initialized which means that if accessibilityEnablesUserInteraction is set to false it will not be applied on first render. setting the default to true fixes that issue

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D76532158

fbshipit-source-id: 51cba8b89eb239e01db985d412dd2b19e482f068
2025-06-16 10:22:05 -07:00
Alan LeeandFacebook GitHub Bot 9613d377de Fix Type comparison (v2) in TurboModuleInteropUtils.kt (2/2) (#51979)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51979

Fix type checking that was left out from the last diff; D73224138

We should unify the type checking so remove uses of `java.lang.Boolean` and just use Kotlin version of `Boolean`.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D76523674

fbshipit-source-id: 293ae5998c78c98a20c7d6cf962ab7b19087fd9c
2025-06-16 09:48:44 -07:00
David VaccaandFacebook GitHub Bot 3a0a7b0701 Export RNCodegen types (#52048)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52048

This diff exports types defined in RNCodegen to be used by other codegens

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D76472492

fbshipit-source-id: fa236a254a9a4211d2e00ace436f55978a262a76
2025-06-16 09:46:31 -07:00
Riccardo CipolleschiandFacebook GitHub Bot c777ad0b84 Fix nightlies artefacts download (#52041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52041

After changing the publishing logic on Maven, the download logic for the artefacts published in a Snapshot was broken, because Maven does not support the redirect anymore.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76725418

fbshipit-source-id: 8bad88915d9bad96355a048486972a55f232d109
2025-06-16 09:26:41 -07:00
Mateo GuzmánandFacebook GitHub Bot 3412215e3a Kotlin: clean up some unused symbols (#52029)
Summary:
Static code analysis reports numerous unused symbols across the codebase, which accounts for several static code analysis warnings. I've cleaned up some of them (not all of them because many of them are false positives from testing files)

The cleaned-up symbols are mostly private and from internal classes, so this should not impact users (unless they are used internally at Meta – in that case, let me know so I can revert accordingly)

## Changelog:

[INTERNAL] - Kotlin: clean up some unused symbols

Pull Request resolved: https://github.com/facebook/react-native/pull/52029

Test Plan:
```sh
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D76722313

Pulled By: cortinico

fbshipit-source-id: 8c7dfe204fa7c457b7484a7edd120ae45e1d604d
2025-06-16 09:04:51 -07:00
Nicola CortiandFacebook GitHub Bot 19fd1536a4 Clarify JS documentation for StatusBar on Android 15+ (#52044)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52044

This clarifies that some props on `StatusBar` are not working on Android 15+
See https://github.com/facebook/react-native/issues/51928

Changelog:
[Internal] [Changed] -

Reviewed By: yungsters

Differential Revision: D76734324

fbshipit-source-id: 88b6f30f63ca0e269d5115e69a8a2b0ca222c2f4
2025-06-16 08:56:27 -07:00
Nicola CortiandFacebook GitHub Bot f6b7bd93d8 Fix crash on ReactInstance due to null returned for getViewManagerNames (#52035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52035

Fixes https://github.com/facebook/react-native/issues/52014

Some OSS library is still returning null for `getViewManagerNames` especially if they're
implementing the `ViewManagerOnDemandReactPackage` in Java.
I'm adding a try-catch here so that we prevent the NPE for those scenarios.

Changelog:
[Android] [Fixed] - Fix crash on ReactInstance due to null returned for getViewManagerNames

Reviewed By: javache

Differential Revision: D76723826

fbshipit-source-id: cc159dee389257c6877b03a67840a45ee5bec165
2025-06-16 07:49:11 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 2ade12d747 Fix OSS CI (#52042)
Summary:
The OSS CI for iOS is broken because of a couple of commit that landed:
- Commit 05a61e8161 : dynamic frameworks are broken
- Commit abc8fe1c92 : pod donwload is broken

This change fixes both of them

## Changelog:
[Internal] - Fix OSS CI

Pull Request resolved: https://github.com/facebook/react-native/pull/52042

Test Plan:
Tested locally by building RNTester with Dynamic frameworks

```
USE_FRAMEWORKS=dynamic bundle exec pod install
```

Reviewed By: rshest, lenaic, GijsWeterings

Differential Revision: D76730331

Pulled By: cipolleschi

fbshipit-source-id: 71cca1f50763d24773dedcd8267130df261b01dc
2025-06-16 07:29:00 -07:00
Tim YungandFacebook GitHub Bot f53f6137e6 RN: Migrate View to Component Syntax (#52018)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52018

Migrates `View` to use Flow's [Component Syntax](https://flow.org/en/docs/react/component-syntax/).

Component Syntax offers more concise syntax for expressing component definitions and eliminates the need for `View` to be cast as a component type. Component types improve type safety by more accurately modeling `ref` as props and enabling the use of modern type utilities such as `React.PropsOf<Component>` and `React.RefOf<Component>`.

This represents the first introduction of Component Syntax in the open source React Native repository, which is lowered to standard JavaScript through the use of [`hermes-parser`](https://www.npmjs.com/package/hermes-parser) and the following supporting packages:

- [`babel-plugin-syntax-hermes-parser`](https://www.npmjs.com/package/babel-plugin-syntax-hermes-parser)
- [`hermes-eslint`](https://www.npmjs.com/package/hermes-eslint)
- [`prettier-plugin-hermes-parser`](https://www.npmjs.com/package/prettier-plugin-hermes-parser)

By default, [`react-native/babel-preset`](https://www.npmjs.com/package/react-native/babel-preset) already provides configuration for `babel-plugin-syntax-hermes-parser`.

Although this is the first usage of Component Syntax, there are already Flow syntax features used in React Native that have required `hermes-parser` (e.g. [type casting expressions](https://flow.org/en/docs/types/casting/), [type guards](https://flow.org/en/docs/types/type-guards/), [const expressions](https://flow.org/en/docs/types/const-expression/)). As such, we do not anticipate this to introduce new build configuration problems for developers.

Changelog:
[Internal]

Reviewed By: javache, NickGerleman

Differential Revision: D76632879

fbshipit-source-id: e0a83dfc2e2014933000083de1825a311faad707
2025-06-16 06:52:07 -07:00
Samuel SuslaandFacebook GitHub Bot ffe928ce50 pass config in C++ Animated with std::move (#52039)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52039

changelog: [internal]

config can be passed with std::move to avoid copy.

Reviewed By: rshest, javache

Differential Revision: D76628921

fbshipit-source-id: 82a90ce604d2a82a388eb4fa63f22deda6ec92ed
2025-06-16 04:50:47 -07:00
Samuel SuslaandFacebook GitHub Bot d20b9cfdf0 Fix value passed to animation's endCallback (#52038)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52038

changelog: [internal]

The changes in this diff include:
- pass endCallback with std::move to avoid copy.
- call endCallback with rawValue instead of rawValue + offset.
- remove unused method AnimationDriver::endCallback.

Reviewed By: javache

Differential Revision: D76627693

fbshipit-source-id: 8653ed3ec59b3629ad3956323b73f02a1bbd9c48
2025-06-16 04:50:47 -07:00
Samuel SuslaandFacebook GitHub Bot b6e1938959 make style.transform testable in Fantom (#52037)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52037

changelog: [internal]

Reviewed By: javache

Differential Revision: D76606386

fbshipit-source-id: 87321f75803d9e6080d5345021aca9c56b6d2ecf
2025-06-16 04:50:47 -07:00
Samuel SuslaandFacebook GitHub Bot ddafd94124 implement setOffset (#52034)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52034

changelog: [internal]

implement `setAnimatedNodeOffset`.

Reviewed By: christophpurrer

Differential Revision: D76604263

fbshipit-source-id: 36b86aada836098f502f8d24af07e2a98adf0446
2025-06-16 04:50:47 -07:00
Samuel SuslaandFacebook GitHub Bot eecd07c58b Set final value via direct manipulation to fix animation glitches (#52012)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52012

changelog: [internal]

On iOS, once a prop on a view is controlled by animated, the control is never released to Fabric or React. That's why it is important to use direct manipulation to commit even final value.

Reviewed By: lenaic

Differential Revision: D76601913

fbshipit-source-id: ea02219e158f28977018b34ac7152b899723b35a
2025-06-16 04:50:47 -07:00
Pieter De BaetsandFacebook GitHub Bot 0e42d33cbc Sync ReactNativeAttributePayload with upstream (#51998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51998

Sync with https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactNativeAttributePayloadFabric.js

Next step is to remove the copy in React upstream and consume it from ReactNativePrivateInterface, so I've copied over the tests as well.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D75943237

fbshipit-source-id: c89c8711b55882f7069c54f6c1ce389f46760089
2025-06-16 04:35:17 -07:00
Riccardo CipolleschiandFacebook GitHub Bot abc8fe1c92 Fix nightly download of Hermes and react-native-dependencies (#52033)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52033

This change fixes the download of the artefacts for the nightlies of Hermes and React Native Dependencies after we changed the publishing logic for Maven

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76723289

fbshipit-source-id: 6b0ea6a6c35125e6fb03cecc6be893bd02abdad8
2025-06-16 03:32:46 -07:00
Riccardo CipolleschiandFacebook GitHub Bot a6ea626255 Remove the option to use JSC from core (#51946)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51946

This change simplified the setp disallowing to use JSC from core.
As a side effect, it simplified the setup by always falling back to hermes if the users decides not to use the third party JSC

## Changelog:
[iOS][Removed] - remove the option to use JSC from core

Reviewed By: cortinico

Differential Revision: D76342625

fbshipit-source-id: c925ab4fab1e171e289a1c5f75890c92da1b3f08
2025-06-16 02:36:45 -07:00
Janic DuplessisandFacebook GitHub Bot 1da608f6f1 Fix RNTester hermesc build issue on iOS (#51989)
Summary:
I am not sure exactly why, but I've been getting this error when running RNTester on iOS, when it tries to build hermesc from source. We're clearing the env using `env -i` which seems to cause the issue. If I add PATH to the env we set then it builds fine.

```
++ hermesc_dir_path=/Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/hermes-engine/build_host_hermesc
++ shift
++ jsi_path=/Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/../../react-native/ReactCommon/jsi
+++ xcode-select -p
++ SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
++ env -i SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk /opt/homebrew/bin/cmake -S /Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/hermes-engine -B /Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/hermes-engine/build_host_hermesc -DJSI_DIR=/Users/janicduplessis/Developer/react-native/packages/rn-tester/Pods/../../react-native/ReactCommon/jsi
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Command PhaseScriptExecution failed with a nonzero exit code
```

## Changelog:

[INTERNAL] [FIXED] - Fix RNTester hermesc build issue on iOS

Pull Request resolved: https://github.com/facebook/react-native/pull/51989

Test Plan: Build RN tester locally

Reviewed By: cortinico

Differential Revision: D76606335

Pulled By: cipolleschi

fbshipit-source-id: f442b77aefb3afacd6d9fb1f3d515b8d63c526ba
2025-06-16 02:05:30 -07:00
Tim YungandFacebook GitHub Bot 98f5a4e118 Fantom: Enable hermesParser in Metro Transform (#52021)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52021

Enables the `hermesParser` option in Fantom tests.

Notably, this configures parsing with `hermes-parser` to use `reactRuntimeTarget: '19'`.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D76641340

fbshipit-source-id: a2dcdbe8cab838481dd37c251d03d1e6fffdf346
2025-06-14 06:41:00 -07:00
Tim YungandFacebook GitHub Bot 92af97591b RN: Align ReportFullyDrawnView Type Exports (#52020)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52020

Aligns the type exports of `ReportFullyDrawnView` across platforms, so that they are resilient to any changes made to `View` itself.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D76638685

fbshipit-source-id: 612b2bcd76e70751aec691a24f31beca453cea35
2025-06-13 19:26:26 -07:00
Tim YungandFacebook GitHub Bot 30d8a153e6 RN: Upgrade to eslint-plugin-react-hooks@6.1.0-canary (#52016)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52016

Upgrade the React Native monorep to use `eslint-plugin-react-hooks@6.1.0-canary`, which includes support for Flow's Component Syntax.

This does not affect production users of `eslint-config-react-native`.

Changelog:
[Internal]

Reviewed By: NickGerleman

Differential Revision: D76627448

fbshipit-source-id: 19e95e5d7f1bcd4fb6bead4e94d268d0c36a4817
2025-06-13 19:26:26 -07:00
Ramanpreet NaraandFacebook GitHub Bot 05a61e8161 Introduce main queue coordinator (#51425)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51425

# Problem

React native's new architecture will allow components to do sync render/events. That means they'll makes synchronous dispatches from main thread to the js thread, to capture the runtime so that they can execute js on the main thread.

But, the js thread already as a bunch of synchronous calls to the main thread. So, if any of those js -> ui sync calls happen concurrently with a synchronous render, the application will deadlock.

This diff is an attempt to mitigate all those deadlocks.

## Context
How js execution from the main thread works:

* Main thread puts a block on the js thread, to capture the js runtime. Main thread is put to sleep.
* Js thread executes "runtime capture block". The runtime is captured for the main thread. The js thread is put to sleep.
* Main thread wakes up, noticing that the runtime is captured. It executes its js code with the captured runtime. Then, it releases the runtime, which wakes up the js thread. Both the main and js thread move on to other tasks.

How synchronous js -> main thread calls work:
* Js thread puts a ui block on the main queue.
* Js thread goes to sleep until that ui block executes on the main thread.

## Deadlock #1
**Main thread**: execute js now:
  * Main thread puts a block on the js queue, to capture the runtime.
 * Main thread then then goes to sleep, waiting for runtime to be captured

**JS thread**: execute ui code synchronously:
* Js thread schedules a block on the ui thread
* Js thread then goes to sleep, waiting for that block to execute.

**Result:** The application deadlocks

| {F1978009555} |  {F1978009612} |

![image](https://github.com/user-attachments/assets/325a62f4-d5b7-492d-a114-efb738556239)

## Deadlock #2
**JS thread**: execute ui code synchronously:
* Js thread schedules a block on the ui thread
* Js thread then goes to sleep waiting for that block to execute.

**Main thread**: execute js now:
* Main thread puts a block on the js queue, to capture the runtime.
* Main thread then then goes to sleep, waiting for runtime to be captured

**Result:** The application deadlocks

|  {F1978009690}  | {F1978009701} |

![image](https://github.com/user-attachments/assets/13a6ea17-a55d-453d-9291-d1c8007ecffa)

# Changes
This diff attempts to fix those deadlocks. How:
* In "execute ui code synchronously" (js thread):
   * Before going to sleep, the js thread schedules the ui work on the main queue, **and** it  posts the ui work to "execute js now".
* In "execute js now" (main thread):
   * This diff makes "execute js now" stateful: it keeps a "pending ui block."
   * Before capturing the runtime, the "execute js now" executes "pending ui work", if it exists.
   * While sleeping waiting for runtime capture, "execute js now" can wake up, and execute "pending ui work." It goes back to sleep afterwards, waiting for runtime capture.

## Mitigation: Deadlock #1
**Main thread**: execute js now:
* Main thread puts a block on the js queue, to capture the runtime.
* Main thread then then goes to sleep, waiting for runtime capture

**JS Thread**: execute ui code synchronously:
* Js thread puts its ui block on the ui queue.
* ***New***: Js thread also posts that ui block to "execute js now". Main thread was sleeping waiting for runtime to be captured. It now wakes up.
* Js thread goes to sleep.

The main thread wakes up in "execute js now":
* Main thread sees that a "pending ui block" is posted. It executes the "pending ui block." The block, also scheduled on the main thread, noops henceforth.
* Main thread goes back to sleep, waiting for runtime capture.
* The js thread wakes up, moves on to the next task.

**Result:** The runtime is captured by the main thread.

| {F1978010383} | {F1978010363} |  {F1978010371} |  {F1978010379} |

![image](https://github.com/user-attachments/assets/f53cb10c-7801-46be-934a-96af7d5f5fab)

## Mitigation: Deadlock #2
**JS Thread**: execute ui code synchronously:
* Js thread puts its ui block on the ui queue.
* ***New***: Js thread also posts that ui block to "execute js now". Main thread was sleeping waiting for runtime to be captured. It now wakes up.
* Js thread goes to sleep.

**Main thread**: execute js now
* Main thread sees that a "pending ui block" is posted. It executes the "pending ui block" immediately. The block, also scheduled on the main thread, noops henceforth.
* Js thread wakes up and moves onto the next task.

**Result:** Main thread captures the runtime.

|  {F1978010525}  |  {F1978010533} |  {F1978010542} |

![image](https://github.com/user-attachments/assets/9e0ca5ef-fab6-4a26-bcca-d79d36624d5d)

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D74769326

fbshipit-source-id: 854b83ce4e482a4030dc711834ea6c5613091537
2025-06-13 16:32:03 -07:00
Nicola CortiandFacebook GitHub Bot feec8d0148 Hide JS FPS on performance overlay as not accurate (#52000)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52000

Fixes https://github.com/facebook/react-native/issues/50338

The current JS FPS value is incorrect because the frame skipping logic hasn't been reimplemented in Fabric.
As we're looking into moving this into the performance panel, I've discussed with huntie
and agreed we'll just remove the value for now to don't show inaccurate informations.

Changelog:
[Android] [Changed] - Hide JS FPS on performance overlay as not accurate

Reviewed By: huntie

Differential Revision: D76590909

fbshipit-source-id: 90b0d9c84f9aefa9197243ebb57f4e86107d6c01
2025-06-13 14:08:01 -07:00
Andrew DatsenkoandFacebook GitHub Bot 05521adbc8 Add react/featureflags (#52003)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52003

Changelog: [Internal]
This is a react common dep check that we can build and run tester.

Reviewed By: christophpurrer

Differential Revision: D76531041

fbshipit-source-id: 0a43fdb91aa61f7e6461ff8a94ea6e2732b55dbb
2025-06-13 13:36:39 -07:00
Nicola CortiandFacebook GitHub Bot cf6569bc18 Cleanup and internalize FpsDebugFrameCallback (#51982)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51982

This class should not be accessed externally. I'm making it internal.
On top of this, it was not fully reimplemented on NewArch so is not working consistently.

This is gonna break one library which is unmaintained and not properly udpated to work with NewArch
https://github.com/hannojg/react-native-performance-stats

Changelog:
[Android] [Breaking] - Cleanup and internalize FpsDebugFrameCallback

Reviewed By: huntie

Differential Revision: D76531175

fbshipit-source-id: 25598eb7c1ecf476b69bb6a2f2f8088a57b9fbc2
2025-06-13 12:23:05 -07:00
Mateo GuzmánandFacebook GitHub Bot c64f698e5f Migrate JavaMethodWrapper to Kotlin (#51930)
Summary:
Migrate com.facebook.react.bridge.JavaMethodWrapper to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.bridge.JavaMethodWrapper to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/51930

Test Plan:
```bash
yarn test-android
yarn android
```

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76377903

Pulled By: alanleedev

fbshipit-source-id: 4df257639992304a6ff3ed9abf499d8ed0b6aac7
2025-06-13 11:40:56 -07:00
Mathieu ActhernoeneandFacebook GitHub Bot b5be57cb76 Fix RNTester system bars background when edge-to-edge is enforced (#51929)
Summary:
This PR fixes RNTester system bars background color to match the app one (not solid black).

## Changelog:

- [Internal] [Changed] - Fix RNTester app system bars color when edge-to-edge is enforced

Pull Request resolved: https://github.com/facebook/react-native/pull/51929

Test Plan:
https://github.com/user-attachments/assets/8be0b721-6514-408f-81cd-2106ae7a17c4

Rollback Plan:

Reviewed By: javache

Differential Revision: D76352950

Pulled By: alanleedev

fbshipit-source-id: 474a81564570764a597aa995a0677617263338be
2025-06-13 11:05:35 -07:00
Mateo GuzmánandFacebook GitHub Bot b0530f0abf Migrate ModuleHolder to Kotlin (#51997)
Summary:
Migrate com.facebook.react.bridge.ModuleHolder to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.bridge.ModuleHolder to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/51997

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D76591704

Pulled By: cortinico

fbshipit-source-id: adbf1375ae9999881ce75b7d73d8e0bb3a8a73f8
2025-06-13 10:46:44 -07:00
Arushi KesarwaniandFacebook GitHub Bot b417b0c2d5 Extract out FBReactNativeSpec's core components including Unimplemented from auto-generated registry (#51941)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51941

Changelog:
[Android][Fixed] - Extract out FBReactNativeSpec's core components including Unimplemented from auto-generated registry

Extracting out `FBReactNativeSpec`'s core components including `UnimplementedNativeView` from auto-generated registry. Using this `libraryName` to skip merging those modules

Reviewed By: RSNara

Differential Revision: D76371796

fbshipit-source-id: 4cfee0fe80a661f159a5f17e0d4abc60f601ea74
2025-06-13 10:18:50 -07:00
Nicola CortiandFacebook GitHub Bot 7ec2839955 Update Nightly URL for newly published versions on central.sonatype.com (#52004)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52004

This is necessary because the snapshots are now going to be published on a different repository:
central.sonatype.com.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D76596802

fbshipit-source-id: 424fb1134e41502d53b76209fba325c895c79ba8
2025-06-13 10:09:47 -07:00
Mateo GuzmánandFacebook GitHub Bot f880bfd1ab Kotlin: clean up redundant visibility modifiers (1/2) (#51960)
Summary:
Static code analysis shows that there are several redundant visibility modifiers across the codebase. These are most likely remnants after making different classes internal.

## Changelog:

[INTERNAL] - Kotlin: clean up redundant visibility modifiers

Pull Request resolved: https://github.com/facebook/react-native/pull/51960

Test Plan:
```sh
yarn android
yarn test-android
```

Reviewed By: javache

Differential Revision: D76503015

Pulled By: cortinico

fbshipit-source-id: e60e7aa141fc35ca2fd76335fbee791c86589e4e
2025-06-13 08:42:42 -07:00
Christoph PurrerandFacebook GitHub Bot fed27e71f8 Use std::format (#51992)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51992

changelog: [internal]

Reviewed By: javache

Differential Revision: D76486572

fbshipit-source-id: e0577c067d350c993cffbcb6efd5a240faeca5f6
2025-06-13 08:25:50 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 0fb0bd1ae7 Add headers to XCFramework (#52010)
Summary:
We found out that the XCFramework that is generated in CI is missing the headers.
This is happening because we run the setup script, the responsible to prepare the folder structure with the heaeders in the right place, only in the job that builds the slices. However, the headers are copied by the job that composes the XCFramework.

This change stores the header folder as an artifact in the build job and retrieves it in the compose job, so that the files are available to the XCFramework

## Changelog:
[Internal] -

Pull Request resolved: https://github.com/facebook/react-native/pull/52010

Test Plan:
Check the generated artefact in CI
<img width="292" alt="Screenshot 2025-06-13 at 15 32 02" src="https://github.com/user-attachments/assets/437333da-5848-4657-a9b3-e87fc79c69b2" />

Reviewed By: cortinico

Differential Revision: D76599834

Pulled By: cipolleschi

fbshipit-source-id: 44d74b5f8df545a825ecfe3df2e1898effe41261
2025-06-13 08:12:30 -07:00
Nicola CortiandFacebook GitHub Bot 6b9d931a88 Move React Native publishing URLs to Central Portal (#51693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51693

This moves React Native to use the Central Portal URLs rather than the legacy OSSRH ones.
See https://github.com/gradle-nexus/publish-plugin for more context.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D75673984

fbshipit-source-id: 1de6746809eed72f232eac0c3fb4d809c2046620
2025-06-13 03:30:14 -07:00
David VaccaandFacebook GitHub Bot e61daa831d Introduce parameter to customize libraryGenerators used in the codegen (#51991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51991

This diff introduces a new parameter to customize libraryGenerators used in the codegen, since I'm adding a default object, this diff shoulnd't change any behavior

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D76472495

fbshipit-source-id: 50b9095c7c554e368f65e4c0b5539be0cca51a51
2025-06-12 22:22:20 -07:00
David VaccaandFacebook GitHub Bot a8386aa878 Prevent exporting internal objects of codegen (#51990)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51990

In this diff I'm limiting visibility of internal objects of codegen, these objects are being exported but they are unused, let's avoid exporting them

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D76470809

fbshipit-source-id: 0e168558d2d3211ab5a3a3de05e2495d7c1ae4f5
2025-06-12 22:22:20 -07:00
David VaccaandFacebook GitHub Bot e8b55a4456 Add flowTypes for codegen LIBRARY_GENERATORS (#51987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51987

In this diff I'm adding flowTypes for codegen LIBRARY_GENERATORS

changelog: [internal] internal

Reviewed By: huntie

Differential Revision: D76470808

fbshipit-source-id: 8e2bddeda1f9175fd25fee04f8fdd3cb7c7faa49
2025-06-12 22:22:20 -07:00
Alexander KlotzandFacebook GitHub Bot 70962ef3ed Added support for multiple widths with dashed and dotted borders on iOS (#51770)
Summary:
This change allows for dashed and dotted borders to have different widths for each of the sides on iOS. This issue was described in https://github.com/facebook/react-native/issues/51658. This allows for better dashed lines and moves the implementation of borders closer to how it is handled on web/android.
Resolves https://github.com/facebook/react-native/issues/51658
(related https://github.com/facebook/react-native/issues/39088)

## Changelog:

[IOS] [ADDED] - Add support for different borderWidths

Pull Request resolved: https://github.com/facebook/react-native/pull/51770

Test Plan:
- yarn test
- yarn lint

Reviewed By: NickGerleman

Differential Revision: D76145887

Pulled By: jorge-cab

fbshipit-source-id: 3716e84799b44d2ff0994cc673a2172ee85bd9e6
2025-06-12 15:31:46 -07:00
generatedunixname89002005287564andFacebook GitHub Bot 46eab9c509 Fix CQS signal modernize-concat-nested-namespaces in xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics (#51983)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51983

Reviewed By: dtolnay

Differential Revision: D76494516

fbshipit-source-id: 399311ad4e1eadf6741926a19ce1919e73a1bdaa
2025-06-12 15:06:56 -07:00
Aswin AndroandFacebook GitHub Bot 50667eceb1 Publish top-level Flow types for react-native (#51908)
Summary:
FIXED Add index.js.flow to npm package files for Flow support

Currently, the distributed npm package for react-native does not include the index.js.flow file, which causes all exports to be typed as any when using Flow. This commit adds index.js.flow to the "files" array in package.json, ensuring Flow users receive proper type definitions out of the box. This addresses issues where type checking with Flow fails in React Native projects.

## Changelog:

[General][Added] Publish top-level Flow types for `react-native`

Pull Request resolved: https://github.com/facebook/react-native/pull/51908

Reviewed By: huntie, necolas

Differential Revision: D76292301

Pulled By: robhogan

fbshipit-source-id: e56360d3f35af30ef160470181349aac1812e7c1
2025-06-12 14:28:14 -07:00
Nick GerlemanandFacebook GitHub Bot e82a677c79 Convert TextLayoutManager to Kotlin and Make Internal (#51966)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51966

This starts off mechanically, but needed a couple changes:

1. Some null handling changes to `TextTransform` internals
2. We type MapBuffer keys as `Int` instead of `Short`, because Kotlin does not allow the implicit widening cast that Java does. I also made these internal
3. Some shifts around casting
4. Mark TextLayoutManager internal, and remove usages of `UnstableReactNativeAPI`

I verified that there were no usages of the Java side of TextLayoutManager throughout `react-native-libraries`, so marking TextLayoutManager internal is unlikely to break 3p libraries.

Changelog:
[Android][Breaking] - Make Java Side TextLayoutManager Internal

Reviewed By: javache

Differential Revision: D76444163

fbshipit-source-id: aabb1c498c731598559f0df5c12e0ecdc266339f
2025-06-12 13:50:13 -07:00
Oskar KwaśniewskiandFacebook GitHub Bot 42ca46b95c fix: add ImageSource type to TypeScript (#51969)
Summary:
This PR adds ImageSource type to ImageSource.d.ts which is defined in Flow:

https://github.com/facebook/react-native/blob/d6f29c8afd14b2cc835649db3c59ed2f0e685331/packages/react-native/Libraries/Image/ImageSource.js#L87-L90

But not in the TypeScript file.

## Changelog:

[GENERAL] [FIXED] - add ImageSource type to TypeScript

Pull Request resolved: https://github.com/facebook/react-native/pull/51969

Test Plan: CI Green

Reviewed By: fabriziocucci

Differential Revision: D76532377

Pulled By: Abbondanzo

fbshipit-source-id: f1bbcd3b3fc07bb0f7e82f81ebaffedf9bc06148
2025-06-12 13:39:45 -07:00
Ramanpreet NaraandFacebook GitHub Bot fb1a4d7aa2 Add macros to remove old runtime
Summary:
This diff adds macros around the legacy architecture core.

To compile out the legacy architecture, simply set: -DRCT_FIT_RM_OLD_RUNTIME=1.

* RCTBridge: interface kept around
* RCTRootView: interface kept around
* RCTSurface: interface kept around
* RCTModuleData: interface kept around (used by RCTProfile)
* RCTProfile: Kept around (doesn't work in bridgeless...)
* RCTCxxBridge: interface kept around
* c++ bridge: removed
* legacy components in core: kept around (for now)

## Details
I added comments to each of the #else, and #endif directives. That way, we can more easily codemod this code in the future.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D72582307

fbshipit-source-id: 018d11cc488e97e60040bebf647f24f2437a57ce
2025-06-12 12:43:36 -07:00
Nicola CortiandFacebook GitHub Bot a6c310c588 Make ReactDelegate nullsafe (#51977)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51977

This will help the Kotlin migration of ReactDelegate.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D76518840

fbshipit-source-id: 8a24c20705aa6b04af693a6229235b11f30e0bc8
2025-06-12 12:32:33 -07:00
Mateo GuzmánandFacebook GitHub Bot ca1ecefc51 Kotlin: fix up several KDoc annotations (#51961)
Summary:
Static code analysis shows that there are a lot of unresolved KDoc references. Also, there are a lot of functions incorrectly linked in the comments that were using `[.yourFunction]` instead of `[yourFunction]` – this diff addresses many of them.

## Changelog:

[INTERNAL] - Kotlin: fix up several KDoc annotations

Pull Request resolved: https://github.com/facebook/react-native/pull/51961

Test Plan:
```sh
yarn android
yarn test-android
```

Reviewed By: fabriziocucci

Differential Revision: D76481171

Pulled By: Abbondanzo

fbshipit-source-id: dd55e8fc3abfeaefc9c3762632a05fb7baf63530
2025-06-12 11:13:21 -07:00
Nicola CortiandFacebook GitHub Bot d33c2d1435 Polish the changelog for 0.80
Summary:
I've done a pass and cleaned up the changelog for 0.80 ahead of the release

Changelog:
[Internal] -

bypass-github-export-checks

Reviewed By: fabriziocucci, cipolleschi

Differential Revision: D76511997

fbshipit-source-id: 3872f9adbf16767c466e4dbb72d70fdaf2defde3
2025-06-12 08:17:24 -07:00
Jorge (Hezi) CohenandFacebook GitHub Bot 84cbb09cef merge changelogs for 0.80 (#51892)
Summary:
Cleaned CHANGELOG for release 0.80

Pull Request resolved: https://github.com/facebook/react-native/pull/51892

Reviewed By: fabriziocucci

Differential Revision: D76510935

Pulled By: cortinico

fbshipit-source-id: 9e1b47e0de9b11def300e471ebfbfe9ec6f7df0e
2025-06-12 08:17:24 -07:00
Nicola CortiandFacebook GitHub Bot 7a471c7c0d Fix broken tests due to nullable parameter on ReactInstanceManagerBuilder
Summary:
This parameter can be null and is causing failures on some tests. This fixes
it.

Changelog:
[Internal] [Changed] -

bypass-github-export-checks

Reviewed By: lenaic

Differential Revision: D76505211

fbshipit-source-id: a23fca21daf5292bc7375e7d025d1202cc591b86
2025-06-12 06:54:44 -07:00
Kacper KafaraandFacebook GitHub Bot 1d80586730 Enable Defines Module option for RCTImage pod (#51974)
Summary:
This is to enable consuming RCTImage pod in mixed ObjC/Swift codebase. W/o this option set I get following error when building the library:

```
Installing RNScreens 4.11.1
[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `RNScreens` depends upon `React-RCTImage`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
```

I've noticed that there is also a precedent in the form of https://github.com/facebook/react-native/commit/c8fcac2765e0f79f0e7bb3a422a65698aec62536, which handled very simlar case but for `React-jsc` pod.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[IOS] [FIXED] - Allow for consuming RCTImage in Swift codebase by enabling "Defines Module" option

Pull Request resolved: https://github.com/facebook/react-native/pull/51974

Test Plan: RNTester should build & run correctly

Reviewed By: cortinico

Differential Revision: D76505478

Pulled By: cipolleschi

fbshipit-source-id: bcce93ffc7e1c917da7f07db83a710575c659f45
2025-06-12 05:33:21 -07:00
Tim YungandFacebook GitHub Bot d6f29c8afd RN: Move {packages => private}/react-native-fantom (#51938)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51938

Moves `packages/react-native-fantom` to `private/react-native-fantom`.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76368959

fbshipit-source-id: 8d62f792229c10cd108dc849e8629d3174dc72c1
2025-06-11 23:49:51 -07:00
Pieter VanderwerffandFacebook GitHub Bot c79e55f79d Deploy 0.273.1 to xplat (#51968)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51968

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D76477358

fbshipit-source-id: a26827e7e3dcd265549d681bc9e3991c0ef2ad52
2025-06-11 20:05:55 -07:00
Tim YungandFacebook GitHub Bot 1b0851515e RN: Move {packages => private}/react-native-codegen-typescript-test (#51936)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51936

Moves `packages/react-native-codegen-typescript-test` to `private/react-native-codegen-typescript-test`.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76357099

fbshipit-source-id: c00d19d1393aa9bc8059e30f837a045169776b50
2025-06-11 17:39:26 -07:00
Tim YungandFacebook GitHub Bot f0f71ea914 RN: Move {packages => private}/helloworld (#51934)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51934

Moves `packages/helloworld` to `private/helloworld`.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76356557

fbshipit-source-id: 92b20d75a8f2badb3c685d4918fe692623d9c04d
2025-06-11 17:39:26 -07:00
Tim YungandFacebook GitHub Bot 85f0dec400 RN: Preserve Stack Traces in CLI Scripts (#51965)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51965

Changes the error handling in `cli.js` scripts for `rn-tester` and `helloworld` so that the original error stack traces are preserved.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76458284

fbshipit-source-id: 491b2bacc4becb8676a2ed4f1181192632bd808f
2025-06-11 17:39:26 -07:00
Luna WeiandFacebook GitHub Bot 9d3fa88f7b Cleanup async flag and use feature flag for debugging (#51962)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51962

Changelog: [Internal] - Migrate debug feature flag to be accessed in both native and JS

Reviewed By: yungsters, mdvacca

Differential Revision: D76381273

fbshipit-source-id: d4071abeb9769821e236c444f89044165cf83d92
2025-06-11 17:36:22 -07:00
Nick GerlemanandFacebook GitHub Bot 4b76129ccb Cleanup Text Feature Flags (#51944)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51944

Ahead of more refactoring, this cleans up a couple feature flags, already on by default, the newest of which added on 5/1, since these should all be validated by significant production usage at this point, so it is unlikely we would want to turn off.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D76412970

fbshipit-source-id: a2612583c060ed3f6fc559864e481d5b5a33fef2
2025-06-11 16:44:52 -07:00
Ruslan LesiutinandFacebook GitHub Bot 0dd3f803d8 Update debugger-frontend from 41bf86b...68cfd0a (#51963)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51963

Changelog: [Internal] - Update `react-native/debugger-frontend` from 41bf86b...68cfd0a

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/41bf86bdbb3e59e7711f11527efac67c050bca75...68cfd0ae84acb0ed8e47b421afd64ae3b0b5b727).

### Changelog

| Commit | Author | Date/Time | Subject |
| ------ | ------ | --------- | ------- |
| [68cfd0ae8](https://github.com/facebook/react-native-devtools-frontend/commit/68cfd0ae8) | Ruslan Lesiutin (rdlesyutin@gmail.com) | 2025-06-11T19:20:10+01:00 | [feat: restore Performance landing page (#179)](https://github.com/facebook/react-native-devtools-frontend/commit/68cfd0ae8) |
| [bc3bd7f55](https://github.com/facebook/react-native-devtools-frontend/commit/bc3bd7f55) | Ruslan Lesiutin (rdlesyutin@gmail.com) | 2025-06-11T12:19:18+01:00 | [chore: hide unsupported Detached elements memory profiling option (#178)](https://github.com/facebook/react-native-devtools-frontend/commit/bc3bd7f55) |
| [1f9eb6528](https://github.com/facebook/react-native-devtools-frontend/commit/1f9eb6528) | Ruslan Lesiutin (rdlesyutin@gmail.com) | 2025-06-11T10:05:12+01:00 | [ci: minor naming and formatting fixes (#177)](https://github.com/facebook/react-native-devtools-frontend/commit/1f9eb6528) |
| [42526665c](https://github.com/facebook/react-native-devtools-frontend/commit/42526665c) | Ruslan Lesiutin (rdlesyutin@gmail.com) | 2025-06-11T10:02:00+01:00 | [ci: split build workflow (#176)](https://github.com/facebook/react-native-devtools-frontend/commit/42526665c) |
| [7307e9532](https://github.com/facebook/react-native-devtools-frontend/commit/7307e9532) | Ruslan Lesiutin (rdlesyutin@gmail.com) | 2025-06-10T19:43:08+01:00 | [chore: added lint GitHub workflow (#174)](https://github.com/facebook/react-native-devtools-frontend/commit/7307e9532) |
| [8d613dd1c](https://github.com/facebook/react-native-devtools-frontend/commit/8d613dd1c) | Ruslan Lesiutin (rdlesyutin@gmail.com) | 2025-06-10T19:42:53+01:00 | [chore: more instructions on repository syncing (#173)](https://github.com/facebook/react-native-devtools-frontend/commit/8d613dd1c) |
| [d449be9e2](https://github.com/facebook/react-native-devtools-frontend/commit/d449be9e2) | Ruslan Lesiutin (rdlesyutin@gmail.com) | 2025-06-10T18:48:14+01:00 | [Merge pull request #172 from facebook/repo-sync-7103](https://github.com/facebook/react-native-devtools-frontend/commit/d449be9e2) |

Reviewed By: huntie

Differential Revision: D76455694

fbshipit-source-id: e44a016afe25ae62d72cf4b02e620ba166a9eeb9
2025-06-11 14:39:50 -07:00
Mateo GuzmánandFacebook GitHub Bot d292f1392f Migrate ReactInstanceManagerBuilder to Kotlin (#51884)
Summary:
Migrate com.facebook.react.ReactInstanceManagerBuilder to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.ReactInstanceManagerBuilder to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/51884

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache, mdvacca

Differential Revision: D76418525

Pulled By: cortinico

fbshipit-source-id: 672095719ff20526de2a8eecf82f9aabe43ac129
2025-06-11 14:05:04 -07:00
Eric RozellandFacebook GitHub Bot 8bcf134071 Re-use assigned root tag if possible (#51939)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51939

ReactRootView already reliably assigns itself a fresh root tag from its constructor. Assuming this `FabricUIManager.startSurface` method is called with a valid `ReactRoot` instance, we can just re-use the existing tag without minting a new one. This makes some native initialization that depends on root tag assumptions easier to setup.

## Changelog

[Internal]

Reviewed By: javache

Differential Revision: D76370069

fbshipit-source-id: ad9bb91eee374c911f65ebcdd395716c77881e96
2025-06-11 12:30:36 -07:00
Nicola CortiandFacebook GitHub Bot d1ef8f1fa3 Make com.facebook.react.views.common.ContextUtils internal (#51959)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51959

This class is public while it should not. It's just internal utilities which we don't really want to expose to 3p users.

I've noticed only one unmaintained libraries (3 year old) that will be affected by this change: https://github.com/phanithken/react-native-pk-image-picker/blob/3c21d0e8e3a797d73806883041500fd546e427d6/android/src/main/java/com/pkimagepicker/PkImagePickerViewHost.kt#L63
So I'm marking this as not breaking.

Changelog:
[Android] [Changed] - Make com.facebook.react.views.common.ContextUtils internal

Reviewed By: alanleedev

Differential Revision: D76429746

fbshipit-source-id: 1677a4b7ae7f2cc2c6c941e7e5fe89a5b332fa20
2025-06-11 12:04:00 -07:00
Riccardo CipolleschiandFacebook GitHub Bot d8fe9155eb Fix multiple artifacts with the identical extension and classifier. (#51958)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51958

There is a copy and paste mistake, from dependencies to core, when uploading artefacts to maven.

This change fixes it.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76435336

fbshipit-source-id: a829b90ba3d4cbfc5528fc9f21dcee7be6a358ff
2025-06-11 10:00:03 -07:00
Dawid MałeckiandFacebook GitHub Bot f529fd6ba5 Add snapshot validation to build-types (#51893)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51893

This diff adds `--validate` flag that runs snapshot validation to determine if the `ReactNativeApi.d.ts` rollup has been changed (if JS public API has been touched). There was also an issue with `sortProperties` that reordered some properties (ex. in ImagePropsBase) after removing one of them (ex. accessible) which had negative impact on the displayed result.

### Motivation
Compare previous snapshot with the one built on the current revision to determine the impact of made changes on the public API surface. Display differences in human readable format using `diff` method from the `jest-diff` library.

For now `--validate` flag is not useful on its own. It should be used with `--withSnapshot` flag (which will be removed shortly and generating snapshot will be a default mechanism).

Changelog:
[General][Added] - Add `--validate` flag to `build-types` script for JS API snapshot validation.

Reviewed By: huntie

Differential Revision: D76135158

fbshipit-source-id: 53f5b142c66e3e3931961f741c3f2fab8ccdc228
2025-06-11 09:06:39 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 788c980c7c Rename ReactDebug and ReactRelease to ReactCoreXXX (#51957)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51957

We need to rename the artifacts correctly for Sonatype to pick them up.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76428060

fbshipit-source-id: 83f1da75fbbdd4317ec791a6e782bbaa5c05fa5c
2025-06-11 08:09:08 -07:00
Riccardo CipolleschiandFacebook GitHub Bot b215bde57c Make sure that build_npm_package waits for react-native-core prebuilds (#51956)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51956

While working on landing the prebuild for React Native core in CI, I forgot to add a strong dependency between the build_npm_package job and the prebuild_react_native_core job in the workflow.

It was still technically working, because there are other jobs that are slower than building react_native_core that will delay built_npm_package for enough time, but this fix will make it more robust.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76423766

fbshipit-source-id: 76d91901d63e95add62f26bbff4de0278e8609e3
2025-06-11 08:09:08 -07:00
Tim YungandFacebook GitHub Bot a293925280 RN: Remove "js engine" Suffix from Error Stacks (#51913)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51913

Removes the non-standard "js engine" suffix from `Error` stack traces.

Changelog:
[General][Changed] - Errors will no longer have the "js engine" suffix.

Reviewed By: robhogan

Differential Revision: D76319439

fbshipit-source-id: e0d8e4f451df7010f48e3076bc244981bf590402
2025-06-11 07:16:10 -07:00
Samuel SuslaandFacebook GitHub Bot cbc327ce53 Disable view culling in ScrollView with overflow visible (#51947)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51947

changelog: [internal]

disable view culling if ScrollView has overflow set to visible

Reviewed By: rubennorte

Differential Revision: D76419519

fbshipit-source-id: 002bde2ab4dda0fc635ae04cb4e34390a0e13d80
2025-06-11 06:35:28 -07:00
Michal KielanandFacebook GitHub Bot dac60204f3 Fix data race in updateRendering (#51948)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51948

TSAN is showing a data race in RuntimeScheduler_Modern::updateRendering.

# Changelog:
[Internal] -  Use atomic to unblock broken tests. eventTimingDelegate_ is only set once during startup, so the real fix here would be to delay runEventLoop until setEventTimingDelegate has been set.

Reviewed By: javache

Differential Revision: D76415742

fbshipit-source-id: 995d2a68d671c555f990b4f8d85ac9419ae2734c
2025-06-11 06:27:22 -07:00
Riccardo CipolleschiandFacebook GitHub Bot be1db20c1e Publish ReactCore prebuilds to Maven central (#51923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51923

This diff publishes the Reactcore prebuilds to Maven central so that apps can use it when integrating with React Native

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76338793

fbshipit-source-id: 777c91805573b90ef15209e196cd66801908a5ce
2025-06-11 04:48:54 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 2cf1495379 Prebuild React Native core in CI (#51921)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51921

Implemented the CI jobs that builds React Native core in CI and uploads the artifacts for the Debug and Release XCFrameworks and dSYMs

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76338031

fbshipit-source-id: 713fd82f3823c992c3b0fa5cf24952b793834c68
2025-06-11 04:48:54 -07:00
Riccardo CipolleschiandFacebook GitHub Bot ecec7f324e Implement signing for React Native core (#51919)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51919

Implement signing for the React Native core XCFramework

The implementation follows the same approach we used for the ReactNativedependencies archive

## Changelog
[Internal] -

Reviewed By: cortinico

Differential Revision: D76337972

fbshipit-source-id: 74f61c087b31e4087752cd60bea59db15f00321b
2025-06-11 04:48:54 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 3ac8c0d218 Create dSYMs for React Native core (#51918)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51918

Create dSYMs for React Native core while building

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76338032

fbshipit-source-id: 5ac920f85ff97d028772b68c787145f87c379158
2025-06-11 04:48:54 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 32b2f98814 Use capital letters for Debug and Release (#51920)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51920

Introduce the BuildFlavor typeand refactor the build scripts to use 'Debug' and 'Release'.

For iOS we always use capitalized Debug and Release and it will make it easier to work with CI too.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76338034

fbshipit-source-id: ae1acc740b47692ec5eee94c897b49a0e1673b93
2025-06-11 04:48:54 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 7f157d2ab3 rename build-ios to build-ios-dependencies (#51480)
Summary:
This change renames the build-ios workflow to build-ios-dependencies to prepare for build-ios-core

## Changelog:
[Internal] - Rename build-ios to build-ios-dependencies

Pull Request resolved: https://github.com/facebook/react-native/pull/51480

Test Plan: GHA

Reviewed By: cortinico, rshest

Differential Revision: D75133854

Pulled By: cipolleschi

fbshipit-source-id: 05282a9c1088917c86e43b4d63a790482c0cf2e6
2025-06-11 04:48:54 -07:00
Nicola CortiandFacebook GitHub Bot 0954c1db45 Remove and cleanup JSEngineResolutionAlgorithm (#51931)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51931

This cleans up the whole `JSEngineResolutionAlgorithm` and all the API related to it.
As now we offer support only for Hermes and JSC is provided via a community package.

This is breaking as it affects Expo, but I'll reach out to Kudo to make sure this is integrated properly.
No other breakages other than this.

Changelog:
[Android] [Removed] - Remove and cleanup JSEngineResolutionAlgorithm

Reviewed By: mdvacca

Differential Revision: D76337620

fbshipit-source-id: e43d5d1164f368f5fa395971bca9c05821492dfe
2025-06-11 03:09:32 -07:00
Joe VilchesandFacebook GitHub Bot 0e1a94a339 Cache accessibilityElements (#51940)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51940

We are seeing some reports of badf00d fads (stalls), meaning we are likely doing too much work here. `accessibilityElements` gets called a lot, and is often cached so lets add that in.

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D76371136

fbshipit-source-id: f9e3423e8135a47a24291b04150c4dc54afbda82
2025-06-10 17:17:55 -07:00
Tim YungandFacebook GitHub Bot 683054c512 RN: Move {packages => private}/react-native-bots (#51932)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51932

Moves `packages/react-native-bots` to `private/react-native-bots`.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76354266

fbshipit-source-id: 6ca714c8b0c881b073d84a2f033f78d366ed3f24
2025-06-10 16:37:49 -07:00
Tim YungandFacebook GitHub Bot df52bbe649 RN: Update set-versions for private/ Packages (#51937)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51937

Updates the `set-versions` script to also update workspace packages in `private/*`. Unlike with packages in `packages/*`, this does not change their `"version"` fields, though. It only updates their dependencies.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76358273

fbshipit-source-id: d0e0557d17c355828020a218083b98dd177a6732
2025-06-10 16:37:49 -07:00
Chang Liu (RL)andFacebook GitHub Bot c3bd624944 Back out "(Redo PR #51264) Remove native animation fabric sync in JS and infinite animation loop workaround" (#51933)
Summary:
## Changelog:
[General] [Changed] - Revert a previous change that caused UI regression

Pull Request resolved: https://github.com/facebook/react-native/pull/51933

Reverting for the same reason as D75108344.

Original commit changeset: 966e2b187f43

Original Phabricator Diff: D75789100

Reviewed By: zijunl

Differential Revision: D76352826

fbshipit-source-id: bfae95e2fe66b19b9d615eb5290c0ca5964088e3
2025-06-10 15:09:21 -07:00
Christoph PurrerandFacebook GitHub Bot c3957800ab Add runtime target to ReactCxxPlatform (#51903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51903

changelog: [internal]

Reviewed By: andrewdacenko

Differential Revision: D76240684

fbshipit-source-id: ecf6492fcdd73795ce62a935ffa5d9bfad55b832
2025-06-10 12:19:42 -07:00
Samuel SuslaandFacebook GitHub Bot 2079cb295f Fix AnimationDriverTests and align with android on rounding (#51922)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51922

changelog: [internal]

fix existing C++ Animated tests and align with Android on how to go from current time to applied frame.

On iOS [floor](https://fburl.com/code/7zy5e5ul) is used to decide which frame to apply. On Android, [round](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/FrameBasedAnimationDriver.kt#L65) is used.

In D75813200 I chose to use `std::ceil` as I wanted to have a predictable behaviour in tests. This is not wrong but it is better to align at least with one of the existing implementations. Let's go with Android as it strikes the balance of what we want to see in tests (an animation that is running for 1000ms should finish after 1000ms, not 1000ms + one frame) and C++ Animated is closer to at least one of the existing implementations.

Reviewed By: christophpurrer

Differential Revision: D76337384

fbshipit-source-id: 444c94d88c2fa60bb4f0649f57e0e42f5cd27626
2025-06-10 08:03:44 -07:00
David VaccaandFacebook GitHub Bot 79354eb0b5 Update documentation for codegen options interfaceOnly (#51924)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51924

In this diff I'm updating the documentation for codegen options `interfaceOnly`

changelog: [internal] internal

Reviewed By: arushikesarwani94, cortinico

Differential Revision: D76293414

fbshipit-source-id: 9a8fd752302d4167c8764ce76c0038cd5cc47d7f
2025-06-10 08:03:23 -07:00
Mateo GuzmánandFacebook GitHub Bot 0448898213 Migrate ReactFragment to Kotlin (#51756)
Summary:
Migrate com.facebook.react.ReactFragment to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.ReactFragment to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/51756

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D76255248

Pulled By: cortinico

fbshipit-source-id: 67d289f27f317da10cc68df568cfbf183978c0b4
2025-06-10 07:46:51 -07:00
Dawid MałeckiandFacebook GitHub Bot beb3d49a1b Fix sorting string literals in React Native API snapshot (#51916)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51916

String literals were not sorted in React Native API Snapshot. This diff fixes the issue by retrieving the value from the string literal.

Before:

```ts
type A = {
  a: string;
  b: string;
  \"ba\": string;
  \"ab\": string;
  aFn: () => void;
  bFn: () => void;
  aMethod(): void;
  bMethod(): void;
};
```

After:

```ts
type A = {
  a: string;
  \"ab\": string;
  b: string;
  \"ba\": string;
  aFn: () => void;
  bFn: () => void;
  aMethod(): void;
  bMethod(): void;
};
```

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D76329242

fbshipit-source-id: 9645b82cbd22e2d3acef1376a9ffefa3646457d9
2025-06-10 05:46:40 -07:00
Nicola CortiandFacebook GitHub Bot ff3cfff264 Remove JSC build logic from helloworld (#51895)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51895

Cleaning up helloworld from all the JSC infrastructure.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D76265678

fbshipit-source-id: 81fd363bf484b4c22bd278199646c7b18c59c7ff
2025-06-10 05:42:18 -07:00
Nicola CortiandFacebook GitHub Bot 10aef584d9 Cleanup JSC infrastructure inside test-e2e-local.js (#51894)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51894

This code is no longer needed so let's clean it up.

Changelog:
[Internal] [Changed] -

Reviewed By: yungsters

Differential Revision: D76264885

fbshipit-source-id: f28e7aba5da0a4f0981a642d9824af71004593f1
2025-06-10 05:42:18 -07:00
Christoph PurrerandFacebook GitHub Bot 0e0cd39b00 Add devsupport target to ReactCxxPlatform (#51902)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51902

changelog: [internal]

Reviewed By: andrewdacenko

Differential Revision: D76240769

fbshipit-source-id: 83d13c0446f86caf66addf82e1a06c5dd81388be
2025-06-09 23:15:52 -07:00
Jakub PiaseckiandFacebook GitHub Bot daff0c99d5 Disallow usage of "NativeProps" symbol in internal components (#51889)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51889

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D76244543

fbshipit-source-id: 0ccbc29f99e3fac992b8f0040e16a73f72350969
2025-06-09 23:14:38 -07:00
Jakub PiaseckiandFacebook GitHub Bot b649791920 Remove internal PlatformType type alias (#51888)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51888

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D76247655

fbshipit-source-id: e57aa0bed0cc4a7246dbce227e8023e859dfd60d
2025-06-09 23:11:42 -07:00
Jakub PiaseckiandFacebook GitHub Bot 6fff197006 Update the transform not to rename member expression fragments (#51891)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51891

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D76258179

fbshipit-source-id: e45545ded17d95422625ce5ca6c232a6e78ab9d2
2025-06-09 22:50:20 -07:00
Christoph PurrerandFacebook GitHub Bot 56e58291c3 Add io target to ReactCxxPlatform (#51900)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51900

changelog: [internal]

Reviewed By: andrewdacenko

Differential Revision: D76240623

fbshipit-source-id: 4756ff73f9cc7ee42c31fba60918380400c14410
2025-06-09 22:03:25 -07:00
Tim YungandFacebook GitHub Bot 0fad032fbb RN: Move `{tools => private/monorepo-tests}/__tests__ (#51862)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51862

Moves the dependency tests in `tools/__tests__` to `private/monorepo-tests/__tests__`, allowing us to delete the now-vacant `tools/` directory.

Changelog:
[Internal]

Reviewed By: cortinico

Differential Revision: D76098157

fbshipit-source-id: 8bf96069689c2e1788cd889c624768bcb174d46e
2025-06-09 20:30:32 -07:00
Tim YungandFacebook GitHub Bot 2a7e37e51e RN: Move tools/api to private/cxx-public-api (#51859)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51859

Moves `tools/apis` to `private/cxx-public-api` and cleans up a few things:

- Clean up the `BUCK` file a bit.
- Deduplicate relative paths in scripts.
- Prefix the private package name with `react-native/`.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76091765

fbshipit-source-id: 6fac7423f9d205085b0b21465f65075a850b61e2
2025-06-09 20:30:32 -07:00
Tim YungandFacebook GitHub Bot bcffd4ef9b RN: Standardize ESLint Severity Levels (#51863)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51863

Standardizes lint severity in `.eslintrc.js` to use the string format.

Changelog:
[Internal]

Reviewed By: cortinico

Differential Revision: D76098593

fbshipit-source-id: bd45897e6c996c4993dc1fe09b67cf0f944ebf3f
2025-06-09 20:30:32 -07:00
Tim YungandFacebook GitHub Bot d17f7d0a29 RN: Private Package for Monorepo ESLint Rules (#51858)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51858

Creates a new private package for the ESLint rules that are defined in the `facebook/react-native` repository for linting the monorepo itself: `react-native/eslint-plugin-monorepo`

It resides in a new `private/` directory that will be used for all private packages. I plan to move private packages over from `packages/` and `tools/`.

This also eliminates the need for the `eslint-plugin-lint` dependency in open source.

Changelog:
[Internal]

Reviewed By: cortinico

Differential Revision: D76088698

fbshipit-source-id: 697d5d91421cda4ef3f96d0497a96954cd047296
2025-06-09 20:30:32 -07:00
Tim YungandFacebook GitHub Bot fb7a45a934 sort-imports: ESLint Suppression Comments (#51881)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51881

Switches the suppression of ESLint for the generated `sort-imports` lint rule definition to using in-file comments instead of `.eslintignore`.

This makes the suppression more portable. If the path to the lint rule definition changes, we don't have to remember to update `.eslintignore`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D76152973

fbshipit-source-id: 7cc41282931788c9e347712e7ce8bf7fefb53858
2025-06-09 20:30:32 -07:00
Tim YungandFacebook GitHub Bot ad652cf99c sort-imports: Update Rule Definition (#51880)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51880

Updates the `sort-imports` lint rule.

The main change is that it enforces newlines after the last import statement.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D76149902

fbshipit-source-id: 928871655c5de0613b18334d6fc0d71b3a971a18
2025-06-09 20:30:32 -07:00
Christoph PurrerandFacebook GitHub Bot c5bfd5be8c Add http target to ReactCxxPlatform (#51899)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51899

changelog: [internal]

Reviewed By: andrewdacenko

Differential Revision: D76240550

fbshipit-source-id: 5817b80d8683d951ac686390ad74b0927a2d6d2a
2025-06-09 20:30:06 -07:00
Christoph PurrerandFacebook GitHub Bot 43ba9df55f Add jni target to ReactCxxPlatform (#51898)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51898

changelog: [internal]

Reviewed By: andrewdacenko

Differential Revision: D76240376

fbshipit-source-id: bbae620dde69261e6d26d088471601e7d7e9a074
2025-06-09 19:15:47 -07:00
Alex HuntandFacebook GitHub Bot 89cb7ea600 Replace remaining uses of chalk (#51906)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51906

Replaces `chalk` with Node's `util.styleText` in all remaining files, removing this dependency from our repo.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D76273414

fbshipit-source-id: 401f338e55c6f7abb38ee72d45b921f686440663
2025-06-09 18:21:18 -07:00
Alex HuntandFacebook GitHub Bot 62bf92c896 Replace chalk in packages (#51905)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51905

Replaces `chalk` with Node's `util.styleText` in `packages/`.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D76273412

fbshipit-source-id: edaea5896751be1252056e0858daae46e97acc46
2025-06-09 18:21:18 -07:00
Alex HuntandFacebook GitHub Bot 26c042724c Replace chalk in build scripts (#51904)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51904

Replaces `chalk` with Node's `util.styleText` in `scripts/build/` and `scripts/build-types/`.

Will follow up with replacing across the entire repo at a later point.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D76037191

fbshipit-source-id: c28352853f22d455a709f4b752f566626e6fb3fe
2025-06-09 18:21:18 -07:00
Sam ZhouandFacebook GitHub Bot e4619a41d1 Add annotations or make things readonly to prepare for object literal soundness fix in xplat/js: 1/n (#51912)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51912

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D76292113

fbshipit-source-id: facaf3e503b69ba41df7842b0e92b7094c271874
2025-06-09 17:01:49 -07:00
Arushi KesarwaniandFacebook GitHub Bot 6104ccdc6e Correct the excludePlatforms logic in combining schema step of Codegen (#51910)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51910

**Changelog:**
[Android] [Fixed] - Fix combining schema in Codegen process to exclude platforms correctly

Discovered an issue with how we are excluding platforms in processing codegen schema.

`excludedPlatforms` is a field on `OptionsShape` part of `ComponentShape` not Module

https://www.internalfb.com/code/fbsource/[153d78d4cd5d0fa652e5a0919bcdb26f32d0945e]/xplat/js/react-native-github/packages/react-native-codegen/src/CodegenSchema.js?lines=112

Hence for components modifying the script to iterate over component and for then exclude accordingly based on `platform`.

Reviewed By: cipolleschi

Differential Revision: D76158851

fbshipit-source-id: 791ec12d068794e36f34da7419082887483ce6c5
2025-06-09 16:13:46 -07:00
Samuel SuslaandFacebook GitHub Bot 84f9e48331 Fix a crash in View Culling coming from unflattening/flattening algorith (#51907)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51907

changelog: [internal]

fixes a crash that is described by the two tests. The two tests cover both changes made to Differentiator.cpp. If you revert either of the change, a test will crash.

Reviewed By: christophpurrer

Differential Revision: D76231984

fbshipit-source-id: c32ab1851844121095f1dec953befb2e77c83fd4
2025-06-09 14:26:42 -07:00
David VaccaandFacebook GitHub Bot 38a4b62211 Raise loglevel for assertion of LegacyArchitecture classes (#51875)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51875

This diff raises the logLevel of assertion LegacyArchitecture classes when minimizing of legacy architecture is enabled

Reviewed By: rshest

Differential Revision: D76080325

fbshipit-source-id: 75c92ba7fc54cfbc76bbc2fa3c3dc6a72a376c8f
2025-06-09 12:21:36 -07:00
David VaccaandFacebook GitHub Bot 0d1cde7f36 Raise logLevel of LegacyArchitecture classes when minimizing of legacy architecture is enabled (#51876)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51876

This diff raises the logLevel of LegacyArchitecture classes when minimizing of legacy architecture is enabled

Reviewed By: cortinico

Differential Revision: D76080324

fbshipit-source-id: 3764c0657b912db81e0dc46b6eb57cbb02b335ba
2025-06-09 12:21:36 -07:00
Andrew DatsenkoandFacebook GitHub Bot 6da3b18487 Add third-party deps (#51897)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51897

Changelog: [Internal]
Add third-party deps for fantom_tester build.

Reviewed By: christophpurrer

Differential Revision: D76259630

fbshipit-source-id: 600c05887d4a1055a676ec6a379efe33b65171e2
2025-06-09 10:19:02 -07:00
Ritesh ShuklaandFacebook GitHub Bot a889e1d083 Fix Nightly Builds (#51901)
Summary:
I noticed on discord that the nightlies build are failing. I saw that it is due to node mismatch.
https://github.com/facebook/react-native/actions/runs/15526730404/job/43707812613
## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL][FIXED] Add Setup node on Nightly pipelines

Pull Request resolved: https://github.com/facebook/react-native/pull/51901

Test Plan:
I would rely on CI here. Tested on my fork .
Without my change:- https://github.com/riteshshukla04/react-native/actions/runs/15538071698/job/43741907499
With My change :- https://github.com/riteshshukla04/react-native/actions/runs/15538160788/job/43742194561

Reviewed By: cipolleschi

Differential Revision: D76270096

Pulled By: cortinico

fbshipit-source-id: 666c2cc22e243927eb61b77cfe802222835718b3
2025-06-09 09:43:39 -07:00
Mateo GuzmánandFacebook GitHub Bot 8d76670cd5 Migrate ReactPackageTurboModuleManagerDelegate to Kotlin (#51855)
Summary:
Migrate com.facebook.react.ReactPackageTurboModuleManagerDelegate to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.ReactPackageTurboModuleManagerDelegate to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/51855

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: fabriziocucci

Differential Revision: D76116517

Pulled By: cortinico

fbshipit-source-id: 76dc4f7e16736a54be2bbfc1e2fa2e64b1433739
2025-06-09 09:13:20 -07:00
Nicola CortiandFacebook GitHub Bot f33fdca876 Convert and internalize MountingManager (#51872)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51872

This converts to Kotlin and internaline MountingManager.

The only usage in OSS is react-natve-live-markdown:
https://github.com/Expensify/react-native-live-markdown/issues/693
They're using reflection to access Mounting Manager, which they shouldn't.

Other than them, I wasn't able to find meaningful usages of `MountingManager`

Changelog:
[Android] [Breaking] - Convert to Kotlin and internalize MountingManager

Reviewed By: rshest

Differential Revision: D76126338

fbshipit-source-id: 5ab491f86d697a82b8e5b02b031877020dfa3e9e
2025-06-09 08:44:02 -07:00
Christoph PurrerandFacebook GitHub Bot a67d2c5e44 Remove unused LegacyModuleProviderDelegate from TurboModuleManager.h (#51882)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51882

changelog: [internal]

Reviewed By: javache

Differential Revision: D76159770

fbshipit-source-id: dd64a7bb7c1fa3ded0e293985f5c087ba7d78dff
2025-06-09 08:30:20 -07:00
Rob HoganandFacebook GitHub Bot fe2bcbf4ba Community CLI: Don't clobber user config of Metro resolver/serializer, expose CLI config to user as defaults (#51836)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51836

Currently, `community-cli-plugin` loads the user config and then overrides parts of it - specifically `resolver.resolveRequest` and `serializer.getModulesRunBeforeMainModule`, making it impossible for a user to modify this config.

Instead, treat the CLI's resolver and serializer customisations as "Framework defaults", layered on top of `react-native/metro-config` defaults but beneath a user's `metro.config.js`.

This allows the user to obtain (via `react-native/metro-config`'s `getDefaultConfig`) and extend or override them, if they need to.

This is technically breaking because users who currently have a custom `resolveRequest` or `getModulesRunBeforeMainModule` in their `metro.config.js` will have that config respected from this change, whereas currently they won't have any effect.

Changelog:
[General][Breaking] Community CLI users: user-defined `resolver.resolveRequest` and `serializer.getModulesRunBeforeMainModule` Metro config now takes precedence over CLI defaults

Reviewed By: huntie

Differential Revision: D74811395

fbshipit-source-id: c250caf798fdaedb0822bea3d6e65c0c3ae4d691
2025-06-09 07:44:02 -07:00
Pieter De BaetsandFacebook GitHub Bot 85498ad46f Remove unnecessary receiveCommand overrides (#51844)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51844

These just redefine the existing `receiveCommand` from the ViewManagerDelegate which already has this codegen'ed

Changelog: [Internal]

Reviewed By: cortinico, rshest

Differential Revision: D75869325

fbshipit-source-id: c8ba482075c2586caf33f46a871b5b5e16fda213
2025-06-09 05:49:45 -07:00
Samuel SuslaandFacebook GitHub Bot 5d76fe662a preventing future build failures (#51890)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51890

changelog: [internal]

Fixing possible build failures when targets are built in different context:
- Adding includes to used std functions.
- Using explicit jsi namespace.
- Declaring dependency.

Reviewed By: javache

Differential Revision: D74878821

fbshipit-source-id: 9dfd7ba94651280331be6c9fe6948fce50955589
2025-06-09 03:43:13 -07:00
Pratyush KongallaandFacebook GitHub Bot 90b64a4d50 Updated description of Maestro E2E Android (#51887)
Summary:
Minor Typo correction.

## Changelog:
[INTERNAL][FIXED] updated description of Maestro E2E Android.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/51887

Test Plan: NA

Reviewed By: cipolleschi

Differential Revision: D76253803

Pulled By: cortinico

fbshipit-source-id: 16e8b793de4f7bb4eba03f20e09c3cf3d05115b9
2025-06-09 03:32:53 -07:00
Kacper KafaraandFacebook GitHub Bot 65aa819811 Fix new codegen API disabling behaviour of the old one (#51867)
Summary:
Hey, I'm bumping `react-native-screens` to 0.80.0-rc.4 right now & noticed that codegen does not work as expected. It crawls whole library, file by file (when working on a library it also includes nodemodules etc), despite `componentProvider` field being defined in `codegenConfig` in `package.json`.

Namely https://github.com/facebook/react-native/issues/49941 introduced a regression for libraries that stick to the old codegen config format due to compatibility reasons. Take a look at [this code](https://github.com/facebook/react-native/blob/78caa07ff867255724e4b0ce3557ff5793b6ce1b/packages/react-native/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js#L60-L103). We first do a pass for "old API", [removing libraries with `componentProvider` in their codegen config from `librariesToCrawl`](https://github.com/facebook/react-native/blob/78caa07ff867255724e4b0ce3557ff5793b6ce1b/packages/react-native/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js#L66-L75), just to later [add **ALL** libraries](https://github.com/facebook/react-native/blob/78caa07ff867255724e4b0ce3557ff5793b6ce1b/packages/react-native/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js#L86-L89) that do not support new codegen config format back again to `librariesToCrawl`.

This PR improves the filtering condition, to parse codegen annotations only for libraries that have defined any of the fields from the new config format (opted in for new system).

I want to emphasise that this is a significant regression, because it ruins experience of library maintenance, vastly increasing pods installation time.

## Changelog:

[IOS] [FIXED] - Fix codegen crawling all library code with `componentProvider` defined in config

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/51867

Test Plan:
1. Setup an application with any third party library, that uses "old" codegen config format, e.g. `react-native-screens@4.11.1`
2. `cd ios && bundle exec pod install`
3. Observe the codegen logs - it crawles the library instead of using provided information.

Reviewed By: cortinico

Differential Revision: D76126649

Pulled By: cipolleschi

fbshipit-source-id: 6f9c9dffcdca7204a78b4b55db10249240146141
2025-06-09 02:36:06 -07:00
Pieter De BaetsandFacebook GitHub Bot 198c6fc81c Make receiveCommand args non-nullable (#51806)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51806

Correct the type of args, which is always non-null. This is backwards-compatible as subclasses can override this method with a more permissive nullable type and still be substitutable.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D75869317

fbshipit-source-id: 8f6c9119140794447eca55be24483a35450d7bb6
2025-06-06 22:07:09 -07:00
Christoph PurrerandFacebook GitHub Bot 2c32bfa758 ReactCxxPlatform > apply clang tidy settings (#51828)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51828

changelog: [internal]

Reviewed By: rshest

Differential Revision: D75990891

fbshipit-source-id: ea86ebd90c7b44d26d2d0287eeca8b27aec0aff5
2025-06-06 20:13:08 -07:00
Samuel SuslaandFacebook GitHub Bot c7cc125563 fix props merging for Android (#51877)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51877

changelog: [internal]

handle rawProps manually until props 2.0 is finished.

Reviewed By: rubennorte, zeyap

Differential Revision: D76127899

fbshipit-source-id: 42b18bb7eec401ca1289ed042c06839fd09c184d
2025-06-06 13:17:43 -07:00
generatedunixname89002005287564andFacebook GitHub Bot a8db9c2f2e Fix CQS signal modernize-use-nullptr in xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager (#51879)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51879

Reviewed By: dtolnay

Differential Revision: D76127542

fbshipit-source-id: 332c936dcd26c1659762069f503ec2e835073ea5
2025-06-06 13:14:12 -07:00
Alex HuntandFacebook GitHub Bot ae40886a0d Fix misaligned Node versions in CI (#51874)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51874

Follows D76037015 (and replaces D76129390, accidentally in the Metro repo 😅). Unfortunately, didn't seem to be caught in PR signals.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D76133641

fbshipit-source-id: c5e6204dc6ea8d317dc94395430c6b07cf660a0b
2025-06-06 10:39:27 -07:00
Luna WeiandFacebook GitHub Bot c5b6716311 Reland IntersectionObserver root with fixes (#51818)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51818

Changelog: [General][Added] - Reland IntersectionObserver support for `root` with fixes for viewport offsets

Reviewed By: rubennorte, mdvacca

Differential Revision: D75641008

fbshipit-source-id: 9f4b2576a443fddfec976835627e4228f82d1935
2025-06-06 09:58:30 -07:00
Luna WeiandFacebook GitHub Bot b5c62f52d1 Support root offsets for Fantom and getBoundingClientRect (#51817)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51817

Changelog:
[General][Fixed] - Support viewport offsets for Fantom root and fix `getBoundingClientRect` to respect viewport offsets

Reviewed By: rubennorte

Differential Revision: D75632540

fbshipit-source-id: a3989f1470156dd6be83ad7b03de8cb4de1a56ac
2025-06-06 09:58:30 -07:00
Riccardo CipolleschiandFacebook GitHub Bot ac8d677cb4 Fix E2E tests for Android (both ci and release testing) (#51873)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51873

After [51865](https://github.com/facebook/react-native/pull/51865), the path were the apk are generated changed. That broke the e2E tests in ci and the local script to test E2E, because the artefacts were not uploaded to CI properly.

This change should fix it

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76133191

fbshipit-source-id: 70d8567dee8dc2a8bcc656cca7e94ad19101fe28
2025-06-06 08:55:11 -07:00
Nicola CortiandFacebook GitHub Bot 829b719526 Back out "Override updateRuntimeShadowNodeReferencesOnCommit for OSS" (#51839)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51839

Original commit changeset: 4394a2370d9e

Original Phabricator Diff: D73771648

Changelog:
[Internal] -

Reviewed By: lenaic, sammy-SC

Differential Revision: D76038710

fbshipit-source-id: b4d61bef476e8b903432511939cce65e881689c5
2025-06-06 06:58:11 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 08f16eef67 Integrate the cli script with the compose-xcframework task (#51850)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51850

This change refactors the last compose-xcframework step to intgrate with the cli.js script to coordinate the build process.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76046443

fbshipit-source-id: 4740bb0869c688611a03d5085771aa6222132e7e
2025-06-06 06:43:33 -07:00
Riccardo CipolleschiandFacebook GitHub Bot bd2855b056 Integrate the cli script with the build script (#51845)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51845

This change refactors the build step of SwiftPM to use the cli.js script to coordinate it.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76046444

fbshipit-source-id: 7aa4ba55e46c2e4502687f035ba1e7bf772b3079
2025-06-06 06:43:33 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 6435dec161 Extract setup in a separate file (#51848)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51848

This change refactors the script by moving the step to setup the repo properly in a separate `setup.js` file.

This allows to simplify the main script by using the cli task.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76046441

fbshipit-source-id: 1da6f8dabf75640e455fcb2f543164c6a242abe0
2025-06-06 06:43:33 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 818c3d1b58 Improve logging for reactNativeDependencies (#51849)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51849

This simple change refactors the code of reactNativeDependencies to have more accurate logging when the step fails in CI

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76046440

fbshipit-source-id: 2a1105285b0b1d5208a99c30d6ec2859bb8a0187
2025-06-06 06:43:33 -07:00
Riccardo CipolleschiandFacebook GitHub Bot b2ec9b2056 Add cli script to properly hande input params to build with SPM (#51846)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51846

This change introduces a cli script to simplify handling of tasks when building React Native with Swift PM

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76045574

fbshipit-source-id: 334d0502e781710f3744d9a3585ccfe7f2fa0038
2025-06-06 06:43:33 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 6b287c0f2f Add Types to simplify the SPM build process (#51847)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51847

This change introduces a types.js to add some useful flow types to build React Native with Swift PM.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D76045454

fbshipit-source-id: 352e9f1a2845106c49461c3ac66188f49b520eb3
2025-06-06 06:43:33 -07:00
Christian FalchandFacebook GitHub Bot 55534f518a build xcframeworks from prebuild script (#51596)
Summary:
This commit adds support for building XCFrameworks from the prebuild-script

- Added build script to help build xcframeworks
- Added full header file structure
- Added calling the build script from the main prebuild script

TODO: We need to add resources / privacy bundles

## Changelog:

[IOS] [ADDED] - Added building XCFframework from the prebuild script

Pull Request resolved: https://github.com/facebook/react-native/pull/51596

Test Plan: Run prebuild script and verify that XCFrameworks are successfully built.

Reviewed By: cortinico

Differential Revision: D75869879

Pulled By: cipolleschi

fbshipit-source-id: 7da1dfe2bea34966b88bdb0c31bf7c6ada420c57
2025-06-06 06:43:33 -07:00
Christian FalchandFacebook GitHub Bot 3c01b1b6f0 build swift package from prebuild script (#51595)
Summary:
This commit adds building the swift package from the prebuild script:

- Added swiftpackage.js for building the swift package
- Added calling building from the main script
- Added configurable build type from the main script.
- Removed params in jsdoc from the link method

## Changelog:

[IOS] [ADDED] - Added building swift package from the prebuild script

Pull Request resolved: https://github.com/facebook/react-native/pull/51595

Test Plan:
Run prebuild script and verify that the Swift package is successfully built.

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D75865275

Pulled By: cipolleschi

fbshipit-source-id: d4d9f26c817eb15c16f6be52ffa4b9f060e789da
2025-06-06 06:43:33 -07:00
Alex HuntandFacebook GitHub Bot df39eadc03 Bump minimum Node.js version to 22.14.0 (#51840)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51840

Bumps the minimum version of Node.js in React Native to the current active LTS release (22.x, upgraded from 18.x which is now out of support).

- CI configurations are reduced from `[22, 20, 18]` to `[24, 22]`.

{F1978909878}

See https://nodejs.org/en/about/previous-releases.

Changelog:
[General][Breaking] - Our new minimum Node version is Node.js 22

Reviewed By: yungsters, cortinico

Differential Revision: D76037015

fbshipit-source-id: b6e4b3ee279a9a93d716a13297420bba73f45250
2025-06-06 05:21:39 -07:00
Nicola CortiandFacebook GitHub Bot 0d4c326dd3 Remove reactnative_unittest target and setup (#51866)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51866

We're not really running those tests in OSS. They would require an emulator in OSS CI which
is costly and flaky. I'd rather remove the build logic for them and rely on Fantom for those kind
of tests in the future.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D76050039

fbshipit-source-id: 29789a9c7db5c7108c4536db620d83640819874f
2025-06-06 05:10:04 -07:00
Nicola CortiandFacebook GitHub Bot be113b4406 Stop building JSC inside RN-Tester (#51865)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51865

As in 0.81 we're stopping 1st party support for JSC, we can now cleanup the RNTester
flavor for JSC and simplify the setup here.

Changelog:
[Internal] [Changed] -

Reviewed By: rshest

Differential Revision: D76051319

fbshipit-source-id: 79b01cc64af2466a0be47ceaa0cd211cb6b02f53
2025-06-06 04:54:44 -07:00
Nicola CortiandFacebook GitHub Bot 4f9090bc57 Bump AGP to 8.10.x (#51854)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51854

AGP 8.10.x comes with a source breaking change:
https://issuetracker.google.com/issues/416890061

This shoudl fix it and unblock us for the 0.81 release.

Changelog:
[Android] [Changed] - Bump AGP to 8.10.x

Reviewed By: huntie

Differential Revision: D76053989

fbshipit-source-id: b0fe19544c79d65002127176f2722cdfd85f0a3c
2025-06-06 04:48:02 -07:00
Jakub PiaseckiandFacebook GitHub Bot 17466a07a5 Rename local symbols exported by default before generating the snapshot (#51864)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51864

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D76109534

fbshipit-source-id: d1b5d6016d16dab36c1872e85e8a1efcb2c89c7c
2025-06-06 03:54:43 -07:00
Leevi AattolaandFacebook GitHub Bot 7681036537 fix: exclusion of selectively disabled libraries from codegen generation (#51838)
Summary:
PR https://github.com/facebook/react-native/issues/51078 Implemented finding disabled libraries but the code (below) didn't actually filter any libraries out because destructured name is `undefined`. This pr adds the name to codegenEnabledLibraries so filtering would work.

```js
const libraries = codegenEnabledLibraries.filter(
  ({name}) => !disabledLibraries.includes(name),
);
```

## Changelog:

[IOS] [FIXED] - Skip codegen for selectively disabled libraries in react-native.config.js

Pull Request resolved: https://github.com/facebook/react-native/pull/51838

Test Plan:
1. Install a library that has the componentProvider field set in the codegen config (for example: react-native-safe-area-context and react-native-screens or see [reproducer](https://github.com/aattola/rn-codegen-exclude))
2. Exclude library with react-native.config.js
3. install pods / run codegen
4. Check that codegen actually excluded the specified dependencies from: `ios/build/generated/ios/RCTThirdPartyComponentsProvider.mm`

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76044622

Pulled By: cipolleschi

fbshipit-source-id: 9e70c2a263c750edb1ea95305c9e5e178e2ce8d8
2025-06-06 03:32:19 -07:00
Douglas LowderandFacebook GitHub Bot 1ab8117bcb build (Android): allow for additional sdkmanager paths (#51829)
Summary:
When building Android in cloud environments, it turns out that in some of the environments, `sdkmanager` is not in any of the paths checked in `packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts`, so the build fails.

I have added the path for the Linux cloud build environments I have been using (EAS).

I have also added the ability to insert a custom value for the path, in case this problem occurs again in future.

## Changelog:

[Internal][Fixed] - Allow more sdkmanager paths in hermes-engine Android build.

Pull Request resolved: https://github.com/facebook/react-native/pull/51829

Test Plan: Tested the changes in CI builds in EAS.

Reviewed By: rshest

Differential Revision: D76117000

Pulled By: cortinico

fbshipit-source-id: 2c8aff1ba4f03dbe77935992a774ed71f85264a3
2025-06-06 03:24:06 -07:00
Jakub PiaseckiandFacebook GitHub Bot 4dcf76afe6 Update how native specs are reexported (#51799)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51799

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D75945486

fbshipit-source-id: 9477898fa4a31bfcf2f022e73cfaed9d55b4b090
2025-06-06 03:19:30 -07:00
Jakub RomanczykandFacebook GitHub Bot a9007ea586 feat: process HMR registerBundle calls from same origin only (#51821)
Summary:
Part of https://github.com/facebook/metro/issues/1480

This PR adds a check in `HMRClient.js` that prevents processing `registerBundle` calls coming from different origin than the one declared in HMR `setup()`.

This is useful in a Module Federation setup, where we have multiple HMRClients present in runtime - when Host loads external remote, the requestURL will have different origin, but it will be processed by the HMRClient from the Host which in turn causes a runtime error.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [ADDED] - Process HMR registerBundle calls from the same origin only

Pull Request resolved: https://github.com/facebook/react-native/pull/51821

Test Plan: TBD

Reviewed By: christophpurrer

Differential Revision: D76044353

Pulled By: huntie

fbshipit-source-id: 3928347b1e9a90355d02b87b07fde812479bcb67
2025-06-06 02:54:04 -07:00
Alex HuntandFacebook GitHub Bot e17eab4947 Add docs for build-types (#51852)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51852

- Add README for `yarn build-types`.
- Populate command `--help` output.

Changelog: [Internal]

Reviewed By: coado

Differential Revision: D72168391

fbshipit-source-id: d822333d6013bd2ada244e45589f6424191a69d5
2025-06-06 01:14:43 -07:00
Alex HuntandFacebook GitHub Bot 9616a83c8b Rename --validate arg on yarn build (#51834)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51834

Aligning with incoming flag on `yarn build-types`.

Changelog: [Internal]

Reviewed By: coado

Differential Revision: D76034414

fbshipit-source-id: 726858145811227efe23bc2f8344dceeb69944b2
2025-06-06 01:14:43 -07:00
Jakub PiaseckiandFacebook GitHub Bot 78caa07ff8 WIP [RN][JS Stable API] Verify built types in Github CI (#51808)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51808

Pull Request resolved: https://github.com/facebook/react-native/pull/50292

## This diff
Generates types via `yarn build-types` and verifies them on the basis of react-native/types/__typetests.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D71902007

fbshipit-source-id: 43cb2321e9feea11b0caa4362140c86b1847db85
2025-06-06 00:29:36 -07:00
Jakub PiaseckiandFacebook GitHub Bot 8d1bcd8aeb Update Typescript version (#51831)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51831

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D76018604

fbshipit-source-id: b16be849d155d608306a8778cea540f0096a66b0
2025-06-06 00:29:36 -07:00
Tim YungandFacebook GitHub Bot 79d2e2a365 RN: Fix Lint for FocusEventsExample.android.js (#51857)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51857

Fixes lint warnings for `FocusEventsExample.android.js`.

Changelog:
[Internal]

Reviewed By: NickGerleman

Differential Revision: D76074712

fbshipit-source-id: 10af22f75f03462af35a4fe5e592f8bc8bdc0ca8
2025-06-05 16:18:35 -07:00
Tim YungandFacebook GitHub Bot 0411c43b3a RN: Patch enableEagerAlternateStateNodeCleanup into Renderers (OSS) (#51856)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51856

Enables the `enableEagerAlternateStateNodeCleanup` feature flag in the open source React Native renderers that are currently targeting React 19.1, by manually patching them in the React Native repository.

This feature flag has been found to significantly improve memory management of parent alternate fibers in persistent modes (i.e. Fabric), and we want this to be available to open source users of React Native before the next scheduled public version release of React.

For more details about the fix, see: https://github.com/facebook/react/pull/33161

Changelog:
[General][Changed] - Reduces memory usage, by improving memory management of parent alternate fibers. (Previously, a parent fiber might retain memory associated with shadow nodes from a previous commit.)

Reviewed By: rickhanlonii

Differential Revision: D76073900

fbshipit-source-id: 6779ea0862d4a1e25354b12ef3d1363dc12d26cc
2025-06-05 15:19:06 -07:00
Rick HanlonandFacebook GitHub Bot e0797d0e03 Remove console.error patch (#48783)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48783

## Overview
This is the final boss of the new owner stacks feature. With owner stacks, we don't need to parse message strings to find the component stack for logbox. Instead, we can access the component stack directly with `captureOwnerStack`.

This means we don't need to install the LogBox console.error patch and can greatly simplify the process of handling errors and make it more reliable.

To do this, we rely only on adding LogBox to the ExceptionManager:
- `reactConsoleErrorHandler` -> `LogBox.addConsoleLog`
- `reportException` -> `LogBox.addException`

Changelog:
[General][Fixed] - Remove LogBox patch, de-duplicating errors

## Benefits
As a side effect, this removes a lot of duplicate errors. For example, currently if a component throws, you get 2 errors:

 {F1974436906}

After this, there's just the one you expect:

 {F1974436908}

## Followups
After this lands and doesn't need reverted for some reason, we can delete a ton of code from logbox for finding and detecting stacks from errors.

Reviewed By: javache

Differential Revision: D68380668

fbshipit-source-id: 68112f1e3992fada4d6aaffdf9bd618ce1834f7b
2025-06-05 14:30:30 -07:00
Nick LefeverandFacebook GitHub Bot e51a5f0ab8 Enable RSNRU only for React commits (#51843)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51843

Changelog: [Internal]

To avoid corrupting the React fiber tree when committing from multiple threads this diff only updates shadow node references within the fiber tree for commits originating from React.

This guarantees that during the update of the references no React render will start or is running, making the update of the shadow node reference safe to execute.

S527994

Reviewed By: sammy-SC

Differential Revision: D76043845

fbshipit-source-id: bfcbeaae7fc8b976a1c2db6682330cef9ca25ab8
2025-06-05 14:09:52 -07:00
Peter AbbondanzoandFacebook GitHub Bot fe66694faf Add example for focus events on Android (#51725)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51725

This change builds upon the focus/blur portion showcased in ViewExample but showcases several more components all in one spot. This can be shared with additional platforms or expanded to include more component examples like Image, but the goal is to target Android and not distract from the primary use cases.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D75747410

fbshipit-source-id: 7d53366d9f32192ca6b3da45dd127836fb6efdf6
2025-06-05 13:48:50 -07:00
Peter AbbondanzoandFacebook GitHub Bot e960a28af7 Add focus and blur dispatching logic to BaseViewManager (#51724)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51724

Moves focus change listener logic from `ReactViewManager` to `BaseViewManager` so all view managers that extend the class can get focus/blur event dispatching for free. This does so by applying event listeners where `addEventEmitters` is called, so any extending classes must try to call `super.addEventEmitters` or implement it themselves. In the case of TextInput, this logic is re-implemented because the component emits an additional event when the text input is blurred and I wanted to avoid duplicate calls to get the event emitter for the view instance.

In addition, I've added logic and a test case to ensure that any preexisting focus change listeners set on the view instance are called. There can only ever be one focus change listener tied to a view instance, so this ensures that ones created during view instantiation are retained. However, this does not guarantee that events are emitted for downstream users who overwrite the focus change listener later in the view's lifecycle (i.e. in response to a prop change or an extending view manager that doesn't call `super.addEventEmitters`). There is no clean way to enforce that the `BaseViewManager` focus change listener is always set without changing the generics and introducing a significant breaking change.

Changelog: [Android][Added] - Adds support for onFocus/onBlur event dispatching logic to all native views that implement `BaseViewManager`

Reviewed By: NickGerleman

Differential Revision: D75579321

fbshipit-source-id: 02e1e6d0e78e9d05e4ec5bb59789f3097b73b3f8
2025-06-05 13:48:50 -07:00
Nick LefeverandFacebook GitHub Bot cd5d74518b Fix image loading on props change without layout invalidation (#51791)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51791

On iOS the <Image> shadow node was expecting a layout call for every clone. With `passChildrenWhenCloningPersistedNodes` <Image> components may have the image source updated without layout being called on it due to the re-use of the previous layout data thanks to the improved handling of layout invalidation.

This diff triggers the image request as soon as possible if the cloned shadow node has a clean layout. The request will be made as soon as the image manager is set on the shadow node.

Changelog: [iOS][Fixed] - Fix RCTImageComponentView image loading after source props change with no layout invalidation

Reviewed By: NickGerleman, sammy-SC

Differential Revision: D75919671

fbshipit-source-id: 8b92a9c63b6ff4a62c7eb7b0dbe18dd2be989b81
2025-06-05 11:43:03 -07:00
Nick GerlemanandFacebook GitHub Bot 0581e88efe Avoid scratch TextPaint for Facsimile Layouts (#51827)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51827

TextLayoutManager has an optimization today, where it reuses a scratch TextPaint throughout layouts.

This is not safe in Facsimile, since the paint is included as part of `Layout`, and the `Layout` escapes the TextLayoutManager, to later be drawn. I.e. every `PreparedLayoutTextView` right now is sharing this same scratch Paint.

This change makes it so that we only ever use a scratch paint for the purpose of measurements, where the layout is short-lived.

A simpler approach could be to just abandon the scratch TextPaint, since they do not seem wildly expensive at a glance (though not trivial).

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D75987605

fbshipit-source-id: 3fe3519c6164828a25cb4e2b0ee6eded73695a95
2025-06-05 11:23:18 -07:00
David VaccaandFacebook GitHub Bot 7f8cf06bf9 Update codegen to use StateData (#51823)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51823

Refactor C++ codegen to use StateData for simple codegenerated components

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D75889787

fbshipit-source-id: 47edf5a2a7b7d0efa1f98d392b8c7457af5747c9
2025-06-05 11:04:13 -07:00
Tim YungandFacebook GitHub Bot 0df71eac81 RN: Prohibit ESLint Warnings (#51825)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51825

Configures `yarn lint` to fail if there are any ESLint warnings.

Changelog:
[Internal]

Reviewed By: kassens, NickGerleman

Differential Revision: D75988059

fbshipit-source-id: 20f94492803d8b000f8424ef9ff8a19276f35fd9
2025-06-05 10:14:06 -07:00
Tim YungandFacebook GitHub Bot cf9d28a097 RN: Improve lint-ci Script (#51853)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51853

While testing D75988059 with D76047973, I noticed a few opportunities to improve the script used by `yarn lint-ci`:

- The exit code does not currently propagate, meaning `lint-ci` will succeed when it shouldn't.
- The shell script uses some non-idiomatic practices, so this improves it.

Changelog:
[Internal]

Reviewed By: kassens, cipolleschi

Differential Revision: D76049502

fbshipit-source-id: ebefddf0909edc89cd97de756b93bfaaa3d7cdef
2025-06-05 10:14:06 -07:00
Peter AbbondanzoandFacebook GitHub Bot 8db12225a2 Forward onBlur/onFocus events to Pressability config (#51670)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51670

As the title suggests, forwards `onBlur`/`onFocus` props into the Pressability config that the component creates

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D75238328

fbshipit-source-id: ebc955ab603012362b6fd021333ab61c54ef3f72
2025-06-05 08:26:45 -07:00
Samuel SuslaandFacebook GitHub Bot b4cf61901f add fantom tests for pointerevents (#51842)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51842

changelog: [internal]

add tests for pointerevents props.

Reviewed By: rshest

Differential Revision: D75991670

fbshipit-source-id: 16ed5f11bf3d3ec015141587171fe4ff0e914810
2025-06-05 08:22:28 -07:00
Tomasz ŻelawskiandFacebook GitHub Bot c783128f6e fix: ignore build/ and DerivedData/ dirs in when reading infoPlistFiles (#51833)
Summary:
https://github.com/facebook/react-native/pull/49927 introduced a regression where a Ruby script would read compilation artifacts and fail, when the user has relative build directories set in XCode.

After successful compilation `build/` dir and `DerivedData/` dir have `.plist` files that aren't in UTF-8 encoding and shouldn't be read by the script. If the user tries to reinstall pods at this point, he gets the following error:

![image](https://github.com/user-attachments/assets/6bd31907-66af-4ea5-b2a6-2847e0ee18e1)

This is how you enable relative build directories in XCode.

![Screenshot 2025-06-05 at 11 08 31](https://github.com/user-attachments/assets/22a555b4-a468-481d-8492-02c3b36bfa25)

## Changelog:

[IOS] [FIXED] - Ignore `build/` and `DerivedData/` directories when reading `.plist` files.

Pull Request resolved: https://github.com/facebook/react-native/pull/51833

Test Plan: After applying this patch the problem doesn't occur anymore on my machine.

Reviewed By: cortinico

Differential Revision: D76030133

Pulled By: cipolleschi

fbshipit-source-id: 7ae8c2d0ce28b6925245a9172154e3dcafee126f
2025-06-05 03:21:10 -07:00
Samuel SuslaandFacebook GitHub Bot 5661fe9e1f Add test for onScroll events (#51826)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51826

changelog: [internal]

To make this possible, we "fake" a UI tick whenever `flushMessageQueue` is called. This was, after every JavaScript task a UI tick happens.
Result:
- Animations are setup right after mounting automatically.
- Animation happens after Fantom.scrollTo is called.

Reviewed By: lenaic

Differential Revision: D75899915

fbshipit-source-id: 1ccb86df6741ff9124f16073c6d61ba716d7cfe6
2025-06-05 03:14:39 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 2c3fadd2a1 Add changelog for 0.79.3 (#51816)
Summary:
## Changelog:
[Internal] - Add Changelog for 0.79.3

Pull Request resolved: https://github.com/facebook/react-native/pull/51816

Test Plan: N/A

Reviewed By: robhogan

Differential Revision: D75969644

Pulled By: cipolleschi

fbshipit-source-id: 8ff63e96235d4ccb63a033ef107f343d1df8b369
2025-06-05 03:08:12 -07:00
Mateo GuzmánandFacebook GitHub Bot d631ec9a6c Migrate ReactTextViewManager to Kotlin (#51721)
Summary:
Migrate com.facebook.react.views.text.ReactTextViewManager to Kotlin.

In this diff, `ReactTextAnchorViewManager` is made public again as it's extended by `ReactTextViewManager`.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.views.text.ReactTextViewManager to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/51721

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: mdvacca

Differential Revision: D75829457

Pulled By: NickGerleman

fbshipit-source-id: 425e9ec14f17de5470677b73d68873647bf28675
2025-06-04 21:24:00 -07:00
Tim YungandFacebook GitHub Bot 1a335b3f25 RN: Require @flow Annotations (#51824)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51824

Configures ESLint to require `flow` (or `noflow`) annotations for JavaScript files in the React Native repository. This ensures that we uphold a high bar for type safety and correctness, or intentionally deviate when it makes sense.

Changelog:
[Internal]

Reviewed By: NickGerleman

Differential Revision: D75985490

fbshipit-source-id: 56f9fe7666a02c796ceb9cf076677e81b164b65e
2025-06-04 19:33:54 -07:00
Tim YungandFacebook GitHub Bot e8e51ac1fb RN: Flowify Remaining Files (#51822)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51822

Adds `flow` to the remaining files without it, in React Native.

After this, every `*.{flow,js}` file in React Native will have either `flow` or `noflow`.

Changelog:
[Internal]

Reviewed By: NickGerleman

Differential Revision: D75980238

fbshipit-source-id: 84cd88e4eb0b0b1dc69df247de79a75c2119bf96
2025-06-04 19:33:54 -07:00
Nick GerlemanandFacebook GitHub Bot 48216b244a FabricUIManager.prepareLayout() -> FabricUIManager.prepareTextLayout() (#51787)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51787

Feedback left on D75826792

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D75896711

fbshipit-source-id: bc55e1e6b4beefbe7071fe3186caeeb49f74a9cd
2025-06-04 19:33:30 -07:00
Nick GerlemanandFacebook GitHub Bot add1113a02 Support ReactTextViewManagerCallback in Facsimile (#51759)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51759

Builds upon the changes in the last diff, to let Facsimile support `ReactTextViewManagerCallback`. We use the same new mechanism, of using `RCTTextViewManager` as the callback, if present, instead of relying on view manager measure function.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D75830964

fbshipit-source-id: 435798e6be08f579579eb0f2d30a67d4b1fcaf10
2025-06-04 19:33:30 -07:00
Nick GerlemanandFacebook GitHub Bot 2ba86caf18 Clean up measurements path and ReactTextViewManagerCallback injection (#51758)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51758

ViewManager’s may implement a measure function (using MapBuffer, or ReadableMap). This isn’t used automatically, but may instead be used, by calling into FabricUIManager via JNI, and passing the component name of the view manager to use.

This is only ever called manually, through specific C++ ShadowNodes. Confusingly, for some cases, like `TextInput`, we use the measure function on `RCTText` instead, because this call to FabricUIManager is hidden behind `TextLayoutManager`. This ends up really breaking Facsimile, since we want to measure these in a different way, while still measuring `TextInput` without preparing a layout.

This mechanism is also used to inject `ReactTextViewManager` from the Text View Manager, into the measurement process, for both Text, and TextInput.

I think we would ideally remove and replace the current View Manager measurement mechanism entirely. The interface doesn’t do what it claims to, and requires calling private Java methods via JNI, which we shouldn’t be encouraging external libraries to do. Only a single 3p librar (react-native-picker) uses this, but we have a lot of internal usages, and the current facility is valuable, for translating surface ID into a context. Ie we could not deprecate it without a well thought out replacement.

Instead, this change:
1. Removes the "generalized" version of this for MapBuffer, only ever used by Text
2. Given ourselves a `measureText` function, that will use a spannable processor provided, but go through TextLayoutManager, instead of trying to use this generalized path
3. Documents some of the weirdness of the current setup, without yet deprecating it

This will let the Facsimile View Manager:
1. Provide a ReactTextViewManagerCallback, like the previous version allowed, that influences measurement of both Text, and TextInput (which is... strange, but... not trying to boil the ocean here)
2. TextInput can now measure text, even if Facsimile View Manager doesn't implement this traditional measure interface

Changelog:
[Android][Breaking] - Remove FabricUIManager.measureMapBuffer() and MapBuffer measure functions on ViewManager. Please use ReadableMap variant.
[Android][Breaking] - Remove FabricUIManager.measure overload which accepts attachment positions

Reviewed By: javache

Differential Revision: D75826792

fbshipit-source-id: 6739b1e2e214351b9b95ba782d73cf4278211ab8
2025-06-04 19:33:30 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 997b7c99f6 Rewrite accessibilityOrder with virtual view hierarchy (#51692)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51692

The original algorithm for accessibilityOrder on Android had unexpected bugs. For some reason `.traversalAfter()` and `traversalBefore()` have unexpected behaviors when dealing with ancestor/descendant relationships getting more and more unexpected the further apart they are.

So we are ditching that approach entirely.

Now we have the view with accessibilityOrder create a virtual view hierarchy. We create a virtual node for each child that is in the order, and set the virtual node's position to be the same as the View it is trying to represent.

We then also populate that node with the same stuff we populate regular ax nodes with the `populateAccessibilityNodeInfo()` function and the content description of the view it is backing so we get matching descriptions with what would otherwise be the normal announcement.

**We have no way to exhaustively check every accessibility use case so we'll have to fine tune this as bugs come up, I'm expecting there to not be many issues since we populate the node the exact same way we populate every other node but anything that happens before React Native handles the node might miss some things**

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D74766296

fbshipit-source-id: 5e77c17bed1644bc5fbf5c1e19c3c6908cc1e3e9
2025-06-04 14:31:21 -07:00
Nick GerlemanandFacebook GitHub Bot c27a8804a6 Bump min Xcode to 16.1 (#51762)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51762

Apple requires Xcode 16 or later to submit to the app store. Let's bump the minimum checked for in build logic as well. https://developer.apple.com/news/upcoming-requirements/?id=02212025

GHA is already only testing against 16.2.0 as of D73924819

Changelog:
[iOS][Breaking] - Bump min Xcode to 16.1

Reviewed By: cipolleschi

Differential Revision: D75835304

fbshipit-source-id: a7ce22f958be3a5448a279439e27b615e9b20a2f
2025-06-04 14:15:45 -07:00
Tim YungandFacebook GitHub Bot 5ce99e7eb2 RN: Flowify packages/react-native Mocks & Tests (#51794)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51794

Adds `flow` to the remaining mocks and tests that are lacking it in the `packages/react-native` directory.

This required adding numerous type annotations and suppressions.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D75930095

fbshipit-source-id: ebb1280adc656680e00fd579701e31521826b55c
2025-06-04 12:03:52 -07:00
Tim YungandFacebook GitHub Bot f2ff8c9012 RN: Flowify packages/react-native/Libraries/Alert (#51792)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51792

Adds `flow` to the remaining files that are lacking it in the `packages/react-native/Libraries/Alert` directory.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75921478

fbshipit-source-id: e277cf8241b136da1409af2592fda6ec1f7e9502
2025-06-04 12:03:52 -07:00
Tim YungandFacebook GitHub Bot d77057741d RN: Flowify Non-Library Files (#51790)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51790

Adds `flow` or `noflow` to the remaining files that are outside of `packages/react-native/{Library,src}`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75904614

fbshipit-source-id: cb2c0969065cf443c3a6e74da0fa3708fda67d18
2025-06-04 12:03:52 -07:00
Tim YungandFacebook GitHub Bot 13e0965ed5 RN: Flowify packages/helloworld (#51789)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51789

Adds `flow` or `noflow` to the remaining files that are lacking it in the `packages/helloworld` directory.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75899853

fbshipit-source-id: 43990adb0827f35a8ca8c49c1787140ff47b8abb
2025-06-04 12:03:52 -07:00
Tim YungandFacebook GitHub Bot 3e6423fe65 RN: Flowify packages/rn-tester (#51788)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51788

Adds `flow` to the remaining files that are lacking it in the `packages/rn-tester` directory.

This also adds any necessary type annotations and fixes lint warnings.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75899307

fbshipit-source-id: 27a74ed0007b3b754446a45931c2c148312d5e3a
2025-06-04 12:03:52 -07:00
Tim YungandFacebook GitHub Bot 71bf0712e3 RN: Flowify packages/virtualized-lists (#51785)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51785

Adds `flow` to the remaining files that are lacking it in the `packages/virtualized-lists` directory. In one of the Jest tests, there are so many failures that for now, I just added `noflow`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75888514

fbshipit-source-id: 29d96292f3d59fd5cf2f5ba09b58fdfb9eabab2e
2025-06-04 12:03:52 -07:00
Tim YungandFacebook GitHub Bot 3d55f229cb RN: Flowify packages/react-native-fantom (#51784)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51784

Adds `flow` to the remaining files that are lacking it in the `packages/react-native-fantom` directory.

This also adds any necessary type annotations (using comment syntax).

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75886119

fbshipit-source-id: 6045b4037da21791db2a8960fbdb83aa2fb5bbf2
2025-06-04 12:03:52 -07:00
Tim YungandFacebook GitHub Bot 3728afa85f RN: Add @noflow to packages/react-native-compatibility-check (#51782)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51782

Adds `noflow` to a test in `packages/react-native-compatibility-check`.

In the future, this file should be migrated to use `flow strict-local` or `flow strict`. However, it currently has way too many type errors. Adding `noflow` makes it explicit that this is known to not be typechecked.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75885038

fbshipit-source-id: d0eccda52d39e7cb1938d395c44e4441918f7fcb
2025-06-04 12:03:52 -07:00
Tim YungandFacebook GitHub Bot 404f3ebde2 RN: Flowify packages/react-native-codegen (#51781)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51781

Adds `flow` to the remaining files that are lacking it in the `packages/react-native-codegen` directory.

This also adds any necessary type annotations (using comment syntax).

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D75884727

fbshipit-source-id: 69e880b2dc63c3d6430f841652506e57436544a8
2025-06-04 12:03:52 -07:00
Tim YungandFacebook GitHub Bot 9c38daf2ef RN: Flowify scripts (#51780)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51780

Adds `flow` to the remaining files that are lacking it (or `noflow`) in the `scripts` directory.

This also fixes what I believe to be a typo in one of the files.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75883851

fbshipit-source-id: 928b7a12a08269b6643379d46de888f2c61dcb29
2025-06-04 12:03:52 -07:00
Tim YungandFacebook GitHub Bot cc9074884a RN: Add @noflow to Node.js Scripts (#51779)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51779

Adds `noflow` to a bunch of Node.js script files.

In the future, these files could be migrated to use `flow strict-local` or `flow strict` using comment syntax for type annotations. But for now, adding `noflow` makes it explicit that these are known to not be typechecked.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75883703

fbshipit-source-id: a8fed3aaa9c55ecda919a705940f8b34504cb07c
2025-06-04 12:03:52 -07:00
Tim YungandFacebook GitHub Bot b344aec2ae RN: Add @noflow to ESLint & Babel Preset Files (#51778)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51778

Adds `noflow` to a bunch of ESLint and Babel files that are expected to be evaluated using Node.js without Babel. Additioanlly, these files tend to depend on ESLint and Babel type definitions that are not currently readily available.

In the future, these files could be migrated to use `flow strict-local` or `flow strict` using comment syntax for type annotations. But for now, adding `noflow` makes it explicit that these are known to not be typechecked.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75883642

fbshipit-source-id: 54236d123ca8773de42bce81189dfb5c0671563e
2025-06-04 12:03:52 -07:00
Tim YungandFacebook GitHub Bot c1216d99f8 RN: Flowify flow-typed/{environment/node,npm/jest} (#51777)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51777

Just adding `flow` to these two libdefs that aren't sourced directly from `flow-typed/flow-typed`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75877692

fbshipit-source-id: 0ee0ec08e2046fdba38480cddca3686109e8ca45
2025-06-04 12:03:52 -07:00
Samuel SuslaandFacebook GitHub Bot 27f4801c82 introduce Fantom.unstable_getDirectManipulationProps (#51814)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51814

changelog: [internal]

introduce Fantom.unstable_getDirectManipulationProps to make it possible to inspect what is changed by C++ Animated module before animation finishes.

Reviewed By: zeyap, rubennorte

Differential Revision: D75816105

fbshipit-source-id: 681829ca9d3f77e57213e9f88f4f24b340a982ed
2025-06-04 11:51:54 -07:00
Joe VilchesandFacebook GitHub Bot ed26358f63 Implement textVerticalAlign (#51680)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51680

Right now there are 2 flavors of vertical text alignment: `verticalAlign` and `textVerticalAlign`. Both do the same thing currently. For Facsimile, we actually want to "properly" implement `verticalAlign` so that it matches the web version, while leaving `textVerticalAlign` the same. That will take some time, however, so for now we are just going to implement the way it currently works, while fixing some issues with inline View's

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D75475915

fbshipit-source-id: ba6ff7c831bf769e9e60831ed215ab64faf143a4
2025-06-04 11:39:15 -07:00
Joe VilchesandFacebook GitHub Bot 55fd8b26f8 Move textAlignVertical to paragraph props (#51712)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51712

This prop only works on top level text components, yet it is stored as a TextAttribute. It should be a ParagraphAttribute, so I moved it there.

Changelog: [Android] [Breaking] - Move textAlignVertical to paragraph attributes instead of text attributes

Reviewed By: NickGerleman

Differential Revision: D75684576

fbshipit-source-id: 8ad2496f8a043a6a64924a6c43c7bad4593cf1db
2025-06-04 11:39:15 -07:00
Joe VilchesandFacebook GitHub Bot 573ba02530 Use PreparedLayout as opposed to Layout in PreparedLayoutTextView (#51711)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51711

This is needed to support textVerticalAlign as we are storing that offset in the prepared layout and need to read it from the new text view

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D75643360

fbshipit-source-id: 03620ecf09f525c45d0a60daad1dc1d9a5937362
2025-06-04 11:39:15 -07:00
Nicola CortiandFacebook GitHub Bot c7bbf120e3 Tweak visibility of fields inside NativeModuleRegistry (#51810)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51810

Tweaking the visiblity of some of the fields `NativeModuleRegistry` after the Kotlin migration
of that class.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D75959962

fbshipit-source-id: b3d53fc29af3b0fe32a7bd6a61898814acf90123
2025-06-04 11:19:10 -07:00
Pieter De BaetsandFacebook GitHub Bot 2ec21b4679 Remove unneeded folly deps (#51807)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51807

Remove unneeded deps from the build graph. Especially `//xplat/folly:logging_logging` ends up adding 418KB in development which is unused here.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D71316272

fbshipit-source-id: 39a73e26728cee23d4ffbdd5e4760de2029e671b
2025-06-04 11:01:19 -07:00
Gabriel DonadelandFacebook GitHub Bot f2b19608cc generate-artifacts-executor: fix parsing .class in complex classes (#51813)
Summary:
There is an edge case in the codegen `findRCTComponentViewProtocolClass` function where the parsing of the Component Class will fail if there is another `.class` call in the same file after the `Class<RCTComponentViewProtocol>` function. This ends up resulting in a `RCTThirdPartyComponentsProvider.mm` file that looks like the image bellow

<img width="1052" alt="image" src="https://github.com/user-attachments/assets/26ce93be-0370-4852-a949-9da21762ff7f" />

You can reproduce this with the following

```
Class<RCTComponentViewProtocol> XYZCls(void)
{
  return XYZ.class;
}
// this comment breaks codegen .class
```

## Changelog:

[IOS] [FIXED] - Fix codegen extracting `.class` from complex component classes

Pull Request resolved: https://github.com/facebook/react-native/pull/51813

Test Plan: Run codegen locally, use this patch in the expo/expo repo and CI should be green

Reviewed By: cipolleschi

Differential Revision: D75964424

Pulled By: cortinico

fbshipit-source-id: 50e45aa2ac6e43c75ee6fdd76791c591d81d4df7
2025-06-04 10:46:49 -07:00
Riccardo CipolleschiandFacebook GitHub Bot b266f7854d Back out "Improve e2e times by using deep links to open examples" (#51812)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51812

Commit [8960d9ea2c](https://github.com/facebook/react-native/commit/8960d9ea2cea22451e8f7c9d6c22ed1ed6de131f) fully broke the iOS tests on RNTester in CI.

All 8 of them consistently fails 5 times out of 5 within the workflow and for each retry.

Reverting the change to get CI back to green

## Changelog:
[Internal] - Reverting [8960d9ea2c](https://github.com/facebook/react-native/commit/8960d9ea2cea22451e8f7c9d6c22ed1ed6de131f)

Reviewed By: cortinico

Differential Revision: D75960750

fbshipit-source-id: 63b4a4b4cd830ec48fa60ca6cfcb4dd12a97a331
2025-06-04 09:48:42 -07:00
Samuel SuslaandFacebook GitHub Bot 2be44354c0 rename advanceAnimationsByTime to produceFramesForDuration for clarify (#51811)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51811

changelog: [internal]

after a bit of discussion it was clear the name of this method was confusing. Let's rename it to `produceFramesForDuration` to make it more obvious what happens under the hood.

Reviewed By: rubennorte

Differential Revision: D75953355

fbshipit-source-id: a62933894f9d42fbb3692134d117c05208c62699
2025-06-04 09:45:47 -07:00
Samuel SuslaandFacebook GitHub Bot 031aa4f8d3 add comment why FabricUIManagerBinding::getScheduler is public (#51801)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51801

changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D75902518

fbshipit-source-id: 4564982d8cc253df575ba93233b2eec0d336479d
2025-06-04 08:38:58 -07:00
Rubén NorteandFacebook GitHub Bot 1dae8d119f Add support for Error.cause in Fantom (#51800)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51800

Changelog: [internal]

This adds support for printing the cause of errors thrown in tests in Fantom, if available.

Reviewed By: lenaic

Differential Revision: D75946044

fbshipit-source-id: 579a2fc547cae92d2a65a4023ba1fb2e34a1f735
2025-06-04 08:28:48 -07:00
Samuel SuslaandFacebook GitHub Bot 59fcc57e1a Make ShadowNode::transferRuntimeShadowNodeReference private (#51805)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51805

changelog: [internal]

this overload of transferRuntimeShadowNodeReference is only used within ShadowNode, let's make it private.

Reviewed By: lenaic

Differential Revision: D75903646

fbshipit-source-id: 1ea86b6d0771cdffaff2d425d591f1e58da330ca
2025-06-04 08:26:03 -07:00
Dawid MałeckiandFacebook GitHub Bot 0de92b52ba Bring back @flow strict to composeStyles and fix Flow errors (#51803)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51803

The `flow strict` annotation was accidently removed in D74574293. This diff brings it back and fixes flow errors caused by this change. This makes generated TS types for `composeStyles` more relaxed but the main idea of inferring inputs base on output type annotation is preserved.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D75945388

fbshipit-source-id: c24ff8ad5d286e16bca3522e82f02e14f660c0dd
2025-06-04 06:56:05 -07:00
Samuel SuslaandFacebook GitHub Bot b338a00467 make per UI tick calculation more predictable (#51802)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51802

changelog: [internal]

avoid conversions when dealing with time in C++ Animated. This makes tests more predictable.

Reviewed By: christophpurrer

Differential Revision: D75813200

fbshipit-source-id: b8934848237e5ea7c350d9a5f0175ac0f9202ffd
2025-06-04 05:05:19 -07:00
Mateo GuzmánandFacebook GitHub Bot dc7be7c7aa Migrate NativeModuleRegistry to Kotlin (#51734)
Summary:
Migrate com.facebook.react.bridge.NativeModuleRegistry to Kotlin.

In this diff, `JavaModuleWrapper` and some of its functions/properties had to be made public again as they are exposed by the migrated class – and if the functions are kept internal, there are crashes in legacy arch due to the C++ usages.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.bridge.NativeModuleRegistry to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/51734

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D75938404

Pulled By: cortinico

fbshipit-source-id: 088286d4b100d1013cff43b81db39c6aec10f4e1
2025-06-04 04:53:45 -07:00
Jakub PiaseckiandFacebook GitHub Bot 1c6923d879 Disallow usage of unprefixed (suffixed) Props type name (#51653)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51653

Changelog: [Internal]

Adds a transform that ensures no types and interfaces named `Props` end up in the generated TypeScript definitions. Those are not descriptive and cause duplicate types in the rollup.

Reviewed By: huntie

Differential Revision: D75508800

fbshipit-source-id: 8d64ec19cbabe57495d6462df9d372ba42cda618
2025-06-04 04:38:48 -07:00
Riccardo CipolleschiandFacebook GitHub Bot a67916fdd2 Bump windows to latests as GH will remove windows-2019 EOM (#51798)
Summary:
As per title, GH is [removing windows-2019](https://github.com/facebook/react-native/actions/runs/15421451006/job/43403215354) at the end of the month. We need to migrate away from them.

## Changelog:
[Internal] - Bump windows runners

Pull Request resolved: https://github.com/facebook/react-native/pull/51798

Test Plan: GHA

Reviewed By: cortinico

Differential Revision: D75946994

Pulled By: cipolleschi

fbshipit-source-id: 972b60300c918c0eae0403ed4149347a4ffa8bd0
2025-06-04 04:28:10 -07:00
Jakub PiaseckiandFacebook GitHub Bot 06a7eaad11 Update api-extractor config to reduce number of duplicated symbols (#51796)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51796

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D75940071

fbshipit-source-id: 612aeb12ddb05a7219e69f649e7a490baf7ed7f6
2025-06-04 03:15:11 -07:00
Rubén NorteandFacebook GitHub Bot 773ee9c37c Nullability check for stderr from CLI (#51797)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51797

Changelog: [internal]

Fantom tests are generally very reliable, but a source of flakiness seems to be coming from `result.stderr` being `undefined` and throwing in this callsite. We just add a check to work around it, hoping it's just being set to `undefined` because there really are no errors.

Reviewed By: rshest

Differential Revision: D75942405

fbshipit-source-id: d8920cc2573f029de6bb108310c31f1992e74301
2025-06-04 03:04:08 -07:00
Rubén NorteandFacebook GitHub Bot d1efc5806d Remove unnecessary "using namespace" directives (#51774)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51774

Changelog: [internal]

Just a small refactor to remove some unnecessary `using namespace` directives for code in the `facebook::react` namespace.

Reviewed By: javache

Differential Revision: D75874213

fbshipit-source-id: e63a91b412b2865eb05961d2174b14230ff35e88
2025-06-04 02:31:35 -07:00
Mateo GuzmánandFacebook GitHub Bot 8960d9ea2c Improve e2e times by using deep links to open examples (#51786)
Summary:
This is similar to https://github.com/facebook/react-native/issues/51590, but way better as it improves indirectly the flakiness for tests in the API tab. When the logbox is shown in debug mode, it interferes and sometimes makes that test fail, so this prevents that.

Android also takes more advantage of the improvement with this change, the previous PR only improved significantly iOS.

All the screens inside the RNTester seem to have a deeplink, which makes it easier to open the tests as the test cases are intended to check mostly specific behaviour of RN, and it is not necessary to have a middle step to find the specific components.

Maybe it would be good to run this a few times in CI to see if there are no side effects or flakiness added by opening deep links on CI builds.

## Changelog:

[INTERNAL] - Improve e2e times by using deep links to open examples

Pull Request resolved: https://github.com/facebook/react-native/pull/51786

Test Plan:
```sh
yarn e2e-test-android
yarn e2e-test-ios
```

iOS:

| Before | After |
|--------|-------|
| <img width="387" alt="image" src="https://github.com/user-attachments/assets/03ccd957-d401-4944-bb5c-d3e7db957b2e" /> | <img width="364" alt="image" src="https://github.com/user-attachments/assets/40a14c95-63f8-441d-b718-b5f57a506393" /> |

Android:

| Before | After |
|--------|-------|
| <img width="455" alt="image" src="https://github.com/user-attachments/assets/c71da8d0-df69-44af-b1b2-580995ce55c7" /> | <img width="449" alt="image" src="https://github.com/user-attachments/assets/7357e670-3510-4bbe-8543-68d3bd8c4bea" /> |

Reviewed By: cipolleschi

Differential Revision: D75938844

Pulled By: cortinico

fbshipit-source-id: c7d4063af561e7b0e583eddefcbb289786f3805a
2025-06-04 02:30:59 -07:00
Samuel SuslaandFacebook GitHub Bot 1a6d466f18 trigger animations at time 0 in fantom (#51776)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51776

changelog: [internal]

testing animation must be predictable.
When animation takes 1 second and test calls `unstable_advanceAnimationsByTime(1000)`, the expectation is that the animation would have completed.
Previously it was necessary to wait for at least 38ms over the time it took to complete animation. This diff reduces the delta to 22ms.

Reviewed By: andrewdacenko

Differential Revision: D75813087

fbshipit-source-id: 1a27e5c227a0f3f1183ebdf41dc8c18149d68be0
2025-06-03 15:36:01 -07:00
generatedunixname89002005287564andFacebook GitHub Bot eb6e1b80a7 Fix CQS signal modernize-use-nullptr in xplat/js/react-native-github/packages/react-native/ReactCommon/cxxreact (#51783)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51783

Reviewed By: dtolnay

Differential Revision: D75852593

fbshipit-source-id: 410e0693a65a25eeec9bb26292336cee5072b12c
2025-06-03 14:55:11 -07:00
Nick GerlemanandFacebook GitHub Bot 5f83c774ca Remove Broken Caching Logic in AndroidProgressBarMeasurementsManagaer and AndroidSwitchMeasurementsManager (#51757)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51757

These both have a boolean flag `hasBeenMeasured_` which is never set to true, so the cached measurement is never used, but it would be wrong if it was used, since the cache doesn't respect the content, or measure constraints. Delete the broken code.

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D75817999

fbshipit-source-id: eb062f523840bbac7099b28f7e9b25cf9ad302aa
2025-06-03 14:28:53 -07:00
Rubén NorteandFacebook GitHub Bot 638933418e Fix crash when accessing offsetParent from documentElement (#51773)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51773

Changelog: [internal]

(This isn't a public API yet so not marking it as a bugfix).

This fixes a crash in the `offsetParent` DOM API when called on a node whose parent is the `documentElement`.

Reviewed By: andrewdacenko

Differential Revision: D75876349

fbshipit-source-id: d90fcc3cb98f592c396cb0f5ee6ec80c9570745a
2025-06-03 10:58:00 -07:00
NataliaandFacebook GitHub Bot b4ae5c1de1 refactor: migrated file LazyReactPackage to Kotlin (#51085)
Summary:
This PR migrates LazyReactPackage to Kotlin as requested in https://github.com/facebook/react-native/issues/50513.

## Changelog:

[ANDROID] [CHANGED] - Migrate com.facebook.react.LazyReactPackage to Kotlin.

Pull Request resolved: https://github.com/facebook/react-native/pull/51085

Test Plan:
- replaced `BaseReactPackage` with `LazyReactPackage` in `RNTesterApplication.kt`
- run RN tester on old architecture
- executed legacy native module screen

Reviewed By: javache

Differential Revision: D75783140

Pulled By: cortinico

fbshipit-source-id: 9e93f68c6c7ee821a1e0b74649b2438b0dcd4a1a
2025-06-03 10:56:48 -07:00
React Native BotandFacebook GitHub Bot 5324ae2831 Add changelog for v0.80.0-rc.4 (#51747)
Summary:
Add Changelog for 0.80.0-rc.4

## Changelog:
[Internal] - Add Changelog for 0.80.0-rc.4

Pull Request resolved: https://github.com/facebook/react-native/pull/51747

Test Plan: N/A

Reviewed By: rshest

Differential Revision: D75863681

Pulled By: cortinico

fbshipit-source-id: cac04b7b033977e67deb605787640bc70c7fcd98
2025-06-03 10:44:05 -07:00
Samuel SuslaandFacebook GitHub Bot 3a009beaf0 link missing methods to tasks (#51714)
Summary:
changelog: [internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/51714

add tasks to todos in code.

Reviewed By: fabriziocucci

Differential Revision: D75709061

fbshipit-source-id: 2ad976c25a012687fa41fcd6af662f588a54f9d8
2025-06-03 10:31:29 -07:00
Oskar KwaśniewskiandFacebook GitHub Bot d2464d8e7a fix: make sure RNTester builds with USE_HERMES=0 (#51772)
Summary:
This PR makes sure React Native still builds with USE_HERMES=0.

## Changelog:

[IOS] [FIXED] - make RNTester build with USE_HERMES=0

Pull Request resolved: https://github.com/facebook/react-native/pull/51772

Test Plan: CI Green

Reviewed By: andrewdacenko

Differential Revision: D75876484

Pulled By: cipolleschi

fbshipit-source-id: 72f3a7d33c19063b52c4c3e577ad2c5eae049d90
2025-06-03 09:48:36 -07:00
Nicola CortiandFacebook GitHub Bot c8dcf11423 unbreak build_android due to wrong parameter name in ReactViewGroup (#51771)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51771

This made build_android fail because the parameter name mismatched between class and one of the implementation.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D75869827

fbshipit-source-id: a40dd1fb914e0694f1958c8b19eb9672de683c75
2025-06-03 08:22:39 -07:00
Pieter De BaetsandFacebook GitHub Bot 0486604c89 Use delegate to handle commands when available (#51769)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51769

Generated delegate has this

```
  Override
  public void receiveCommand(T view, String commandName, Nullable ReadableArray args) {
    switch (commandName) {
      case "highlightTraceUpdates":
        mViewManager.highlightTraceUpdates(view, args.getArray(0));
        break;
      case "highlightElements":
        mViewManager.highlightElements(view, args.getArray(0));
        break;
      case "clearElementsHighlights":
        mViewManager.clearElementsHighlights(view);
        break;
    }
  }
````

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D75797948

fbshipit-source-id: c05f09f0afbc41b83b759e62ae020b6a7ebc6f0f
2025-06-03 07:28:18 -07:00
Moti ZilbermanandFacebook GitHub Bot ab2c81faeb Bring RNDT shell to front when paused on breakpoint (#51748)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51748

Changelog: [Internal]

Implements the first RNDT shell-specific feature based on https://github.com/facebook/react-native-devtools-frontend/pull/168 - namely, the ability for RNDT to foreground itself when certain events occur. This is most noticeable when pausing on a breakpoint.

Reviewed By: huntie, vzaidman

Differential Revision: D75795689

fbshipit-source-id: a073bf8ea96ba70d835007f5af6069d49a693d81
2025-06-03 06:37:35 -07:00
Jakub PiaseckiandFacebook GitHub Bot 75be907aa9 Integrate building a type snapshot into typegen script (#51765)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51765

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D70093373

fbshipit-source-id: 1b536f86b205f71c8a708c4ab6aaaedc3b8e9450
2025-06-03 06:15:25 -07:00
Nicola CortiandFacebook GitHub Bot 48395d346b Convert ReactViewGroup to Kotlin (#51767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51767

This is going to convert the last class inside `com.facebook.react.views.view` to Kotlin.

I still need to assess if this is going to be breaking or not for our users. Potentially some
breakages for Kotlin consumer could happen (see changes on ReactViewManager).
I'll follow-up with an investigation on that one.

Changelog:
[Android] [Changed] - Convert ReactViewGroup to Kotlin

Reviewed By: mdvacca

Differential Revision: D75797215

fbshipit-source-id: 5d58faa651d5959909a4b0237aad9c4209895083
2025-06-03 04:56:24 -07:00
Samuel SuslaandFacebook GitHub Bot 747eb3c8ae Introduce Fantom.unstable_advanceAnimationsByTime (#51752)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51752

changelog: [internal]

Introduce a way to test animations: `unstable_advanceAnimationsByTime`. An API that fakes passage of time and triggers UI ticks to simulate how animations are run on iOS and Android.

The API is marked as unstable because it might evolve as we write more tests for C++ Animated.

Reviewed By: mdvacca

Differential Revision: D75787082

fbshipit-source-id: 24e29732bbbf581871e7868289257ab60d891ddf
2025-06-03 04:43:35 -07:00
Samuel SuslaandFacebook GitHub Bot dd590c5b58 Remove outdated asserts from StubViewTree (#51751)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51751

changelog: [internal]

these asserts are not correct with C++ Animated or anything that overrides pull transaction. When pull transaction is overriden, the modified mounting instructions are not stored in shadow tree. Therefore, these asserts fail.

Reviewed By: rshest

Differential Revision: D75787083

fbshipit-source-id: ac08b96f6dea89a9f127b179a5d05e351b281c35
2025-06-03 04:43:35 -07:00
Samuel SuslaandFacebook GitHub Bot d0e402f3d9 Call onRender inline instead of from startRenderCallbackIfNeeded (#51750)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51750

changelog: [internal]

inline call `onRender()` instead of calling it from `startRenderCallbackIfNeeded`. This has identical functionality but allows to use Fantom to test C++ Animated. In Fantom, there is only one thread the existing mechanism in C++ Animated uses thread locals to capture which thread in the UI thread. Therefore, some assumptions are broken. This is just an easy workaround around the problem.

Reviewed By: javache, zeyap

Differential Revision: D75787084

fbshipit-source-id: 8d70ef2d13e4ab14807deb7ca4cb0844980f5901
2025-06-03 04:43:35 -07:00
Samuel SuslaandFacebook GitHub Bot 116fb6dab0 Make time in C++ Animated injectable (#51749)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51749

changelog: [internal]

Make it possible to inject time via `now` argument to C++ Animated. This will be used in testing.

Reviewed By: javache

Differential Revision: D75710463

fbshipit-source-id: 2d6da875c7379c4b229f8b7af0fa665cebc2ca8b
2025-06-03 04:43:35 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 80e8a6a161 Fix build after unifying RNCore in FBReactNativeSpec (#51766)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51766

Yesterday we landed [95ed8a6123](https://github.com/facebook/react-native/commit/95ed8a6123024afd03227358ab4b165fdf87b270) where we unified `rncore` and `FBReactNativeSpec` into the latter.

This of course broke the current setup of SwiftPM. This diff fixes it.

## Changelog:
[Internal] - Exclude rncore components

Reviewed By: javache

Differential Revision: D75863335

fbshipit-source-id: ad2739bed5645e41048a8bc466736712db18c3b6
2025-06-03 04:12:13 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 9c1a55a0b8 simplify searchPaths for FBLazyVectorPath (#51726)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51726

Previously we were spreading the searchPath on the FBLazyVectorPath everywhere, but that's not needed.

This change ensure that only the targets that nedds visibility over the FBLazyVectorPath depends on them.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D75756304

fbshipit-source-id: 41abe073bf271fd5059f9cb8536cc4a8948a03dd
2025-06-03 04:12:13 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 004726eeca simplify searchPaths for ReactFBReactNativeSpecPath (#51727)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51727

Previously we were spreading the searchPath on the ReactFBReactNativeSpecPath everywhere, but that's not needed.

This change ensure that only the targets that nedds visibility over the ReactFBReactNativeSpecPath depends on them.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D75756302

fbshipit-source-id: 41680b98dd07ea1abb09cebb1a1b8321f08929a0
2025-06-03 04:12:13 -07:00
Riccardo CipolleschiandFacebook GitHub Bot dbbf0f8cf8 simplify searchPaths for CallInvoker (#51728)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51728

Previously we were spreading the searchPath on the CallInvoker everywhere, but that's not needed.

This change ensure that only the targets that nedds visibility over the CallInvoker depends on them.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D75756303

fbshipit-source-id: d6fe70e43f65d8e9da5f1d18dc58491217575734
2025-06-03 04:12:13 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 7ef7736130 simplify searchPaths for RuntimeExecutor (#51729)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51729

Previously we were spreading the searchPAth on the Runtime Executor everywhere, but that's not needed.

This change ensure that only the targets that nedds visibility over the runtimeExecutor depends on them.

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D75756305

fbshipit-source-id: e54f1939d72049e7f4e8d3d14f7a33eacd5ac46f
2025-06-03 04:12:13 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 0e775ba378 Cleanup header search paths (#51730)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51730

This change cleans up the header search paths that are now mostly computed starting from other informations of the target.

There are still some execptions, for example for header only target for which we can't have a SwiftPM target. Therefore targets that depends on header only targets need to specify them in their search path.

Plus there are a small number of other exceptions, such as some circular dependencies on header only files.
We will fix them later on, by introducing separated targets

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D75756307

fbshipit-source-id: 53f24dcb08947648c8fce5c520a949b3b896c2fa
2025-06-03 04:12:13 -07:00
Riccardo CipolleschiandFacebook GitHub Bot c38007a875 Improve searchPath transitive computation (#51731)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51731

With this change, we are computing the headerSearchPaths starting from the path, and the source's path. In this way we can greatly reduce the amount of searchPaths we have to manually specify, making it much easier to maintain the SwiftPM package in the long run.

## Changelog:
[Internal] -

## Facebook:
The next diff  in the stack proceeds with the cleanup.

Reviewed By: cortinico

Differential Revision: D75756306

fbshipit-source-id: 411ba6b598e568648488921c3ee62b8111f76749
2025-06-03 04:12:13 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 527e39a470 Move scrollView to ReactFabric (#51691)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51691

In cocoapods infrastructure, Scrollview is part of ReactFabric.
In the SwiftPM implementation we erroneously moved that to reactFabricComponents. However, the new view culling features in reactFabric imports scrollview and that was broken in Swift PM.

This change fixes it.

## Changelog:
[Internal] - move scrollview to reactFabric

Reviewed By: lenaic

Differential Revision: D75638510

fbshipit-source-id: 00828956093aaa87e15c22d15ca3a647876182f5
2025-06-03 04:12:13 -07:00
Rubén NorteandFacebook GitHub Bot 8ac0ccbb91 Add tracing section for event loop tick work for IntersectionObserver (#51744)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51744

Changelog: [internal]

TSIA

Reviewed By: rshest

Differential Revision: D75789346

fbshipit-source-id: fa32cd3e5d9809bcbad48f0a6f1706efcce34d7f
2025-06-03 02:42:38 -07:00
Nick GerlemanandFacebook GitHub Bot 7979c7ce06 Remove YogaLayoutableShadowNode::cleanLayout() and Fix ParagraphShadowNode Font Size Invalidation Logic (#51760)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51760

This API is evil.

Yoga's public API never allows a dirty node to become clean again, until its laid out, but this API requires doing that, since we will otherwise automatically dirty by default.

Let's replace it with `YogaLayoutableShadowNode::shouldNewRevisionDirtyMeasurement()`, which lets individual ShadowNodes represent whether a new revision's state and props should cause dirtying, defaulting to true.

Changelog:
[General][Removed] - Remove `YogaLayoutableShadowNode::cleanLayout()`

Reviewed By: lenaic

Differential Revision: D75479902

fbshipit-source-id: a40aa531522a76dc49feb7d12bae5a8d877c6c06
2025-06-02 19:52:31 -07:00
Tim YungandFacebook GitHub Bot 5c8c5388fc RN: Fix Shadowing of Animated Styles (#51719)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51719

When `Animated` traverses props for instances of `AnimatedNode`, it flattens `props.style` before traversing it so that we correctly ignore any `AnimatedNode` instances that may be shadowed by static values:

```
{
  style: [
    {transform: [{translateX: new Animated.Value(0)}]},
    {transform: [{translateX: 100}]},
  ],
}
```

However, there is a bug that occurs when *every* `AnimatedNode` instance is shadowed. In this case, `AnimatedProps` assumes that there are *no* `AnimatedNode` instances in the entire `props.style`.

It then incorrectly operates on the unflattened `props.style`, which *does* have `AnimatedNode` instances. When this is passed to `View`, the `AnimatedNode` instances are encountered and can cause a crash in `processTransform`, as reported by: https://github.com/facebook/react-native/issues/51395

The fix for this was originally attempted by riteshshukla04 in https://github.com/facebook/react-native/pull/51442. This diff reuses the same unit test case, but it applies a different fix that does not involve re-traversing the `props.style` object.

The fix is gated behind a feature flag, `alwaysFlattenAnimatedStyles`. This will enable us to validate correctness of the new behavior before enabling it for everyone. (Beyond fixing the bug described above, this also causes styles to flatten more aggressively, so production testing is important to ensure stability.)

Changelog:
[General][Changed] - Creates a feature flag that changes Animated to no longer produce invalid `props.style` if every `AnimatedNode` instance is shadowed via style flattening.

Reviewed By: javache

Differential Revision: D75723284

fbshipit-source-id: 504f63e8edf836243d615783e119137a920ad271
2025-06-02 19:19:03 -07:00
Chang HuaandFacebook GitHub Bot 3353579946 fix ReactScrollViewHelper.kt remove listeners logic (#51718)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51718

## what

the current removing listeners code is not working. in prod, when removeScrollListener is called, it creates a new weakReference of the scroll listener and it would never match any existing weakreference listeners in the list. The remove action would end up removing nothing from the list.

This diff fixes the issue by iterating through the list and compare the obj
reference: https://stackoverflow.com/questions/6296051/how-to-remove-a-weakreference-from-a-list

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D75716993

fbshipit-source-id: af9eed218deb44e87317c19ffca7d227b96de8e2
2025-06-02 18:26:58 -07:00
Soe LynnandFacebook GitHub Bot ab9ff886fc Remove unused header import (#51754)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51754

Changelog: [Internal]

Remove unused header import from RuntimeScheduler_Modern.cpp

Reviewed By: mdvacca

Differential Revision: D75815960

fbshipit-source-id: 32f7cab30216b3a76452dc9ef6354517fe3fcaf2
2025-06-02 16:10:59 -07:00
Tim YungandFacebook GitHub Bot 0a951c1867 RN: Create virtualViewPrerenderRatio Feature Flag (#51716)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51716

Adds a feature flag to experiment with different `prerenderRatio` values from the `VirtualView` native component. Notably, this is the first time that the a feature flag has a non-boolean type.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D75713594

fbshipit-source-id: ff3feb8d8bb3292fea6e04a4cfccd87e8249144e
2025-06-02 15:48:22 -07:00
Tim YungandFacebook GitHub Bot 746376af00 RN: Represent Numeric Feature Flags as Double (#51713)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51713

Changes the React Native Feature Flags system so that numeric feature flags are represented in native languages as double instead of int, in order to avoid loss of precision for non-integral JavaScript numbers.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D75709111

fbshipit-source-id: d4b2d553ce1e719a5f4b136a4f8d2e46446ef8d8
2025-06-02 15:48:22 -07:00
David VaccaandFacebook GitHub Bot 46e70fbcfd Rename root -> view in ViewManager parameters (#51755)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51755

this diff renames root -> view in ViewManager parameters

changelog: [internal] internal

Reviewed By: mlord93

Differential Revision: D75803186

fbshipit-source-id: e70708b5b504c13d617be3becac340d65471e67c
2025-06-02 14:56:59 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 5f0d508390 Stop testing the legacy architecture (#51738)
Summary:
Following up the announcement made at AppJS, this change stops testing the legacy architecture in our CI

## Changelog:
[Internal] - Stop testing the legacy architecture in CI

Pull Request resolved: https://github.com/facebook/react-native/pull/51738

Test Plan: waiting for GHA

Reviewed By: cortinico

Differential Revision: D75791359

Pulled By: cipolleschi

fbshipit-source-id: cb3159338835f49589fa6f495cfb9f47750825fe
2025-06-02 10:23:32 -07:00
Mateo GuzmánandFacebook GitHub Bot df6eff4f8c Improve e2e times and flakiness by using the search (#51590)
Summary:
I'm writing some tests for some APIs/components, and I see some opportunity for improvement in the way how we can write e2e cases for the RNTester.

This diff improves two things:

1. e2e execution times: right now as we are using the `scrollUntilVisible` functionality, it takes quite some time *for some cases*, as some of the items are not very up in the lists and getting to them it's not always very fast.
2. Flakiness: I ran the tests multiple times locally, and in multiple occasions, the `scrollUntilVisible ` did not find anything as the scroll was too fast so the test ended up failing.

Instead of using `scrollUntilVisible` for all cases, we can simply use the search bar which we have in both Components and APIs tabs. This runs faster and we can also share the search flow across multiple test cases, so writing the tests becomes a bit simpler as well.

Initially, I did this for all cases but not all cases benefit from this change as some of them are easier to find than others – the improvement was most notable in iOS (keyboard visibility seems to make a big difference), but I still think it is a good baseline to use the search as if more test cases are added, likely, many of them are not going to be so easy to find.

## Changelog:

[INTERNAL] - Improve e2e times and flakiness by using the search

Pull Request resolved: https://github.com/facebook/react-native/pull/51590

Test Plan:
These are the differences in the time it takes to pass the tests locally.

iOS:

| Before | After |
|--------|-------|
| <img width="336" alt="image" src="https://github.com/user-attachments/assets/6bc80de6-5a10-4c0c-b6b0-f7850d746781" /> | <img width="329" alt="image" src="https://github.com/user-attachments/assets/de47a7ff-84cf-4916-abce-9b3df96a03e1" /> |

<details>
<summary>Android (no significant difference):</summary>

| Before | After |
|--------|-------|
| <img width="328" alt="image" src="https://github.com/user-attachments/assets/73023669-af8e-410c-aee2-529d1cce7acf" /> | <img width="336" alt="image" src="https://github.com/user-attachments/assets/3fb868a9-36f5-43c3-9261-6f2753e28e5f" /> |

</details>

Reviewed By: cortinico

Differential Revision: D75389138

Pulled By: cipolleschi

fbshipit-source-id: cf9d11ab0f84c91eaa20ee5c4441766729925571
2025-06-02 10:16:48 -07:00
Riccardo CipolleschiandFacebook GitHub Bot f2c9d74f11 Remove continue-on-error from e2e test in GHA (#51746)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51746

I observed that when continue-on-error is set to true, Github reports the outcome of a job as success even if it fails.

With this change, we should ensure that when an E2E test fails, the pipeline fails, so that we can retry the jobs properly.

## Changelog:
[Internal] - Remove continue-on-error from e2e tests in GHA

Reviewed By: cortinico

Differential Revision: D75796284

fbshipit-source-id: 0e769f53d7355ae6c985aace334b23205780673a
2025-06-02 10:09:13 -07:00
Moti ZilbermanandFacebook GitHub Bot fedc7f2b7a Generate rich changelog in debugger-frontend sync script, add --no-build flag for testing (#51745)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51745

Changelog: [Internal]

1. Updates debugger-frontend's sync-and-build script to include a simple Markdown changelog inline and -mention authors who are Meta employees.
2. Also adds a `--no-build` flag that is mainly helpful for iterating on changelog generation logic.

Reviewed By: hoxyq

Differential Revision: D75789680

fbshipit-source-id: b30b49a9c50e93e7161a2dad012b92ef124a3a16
2025-06-02 10:07:23 -07:00
Krystof WoldrichandFacebook GitHub Bot 8f189fce03 fix(types): Devtools.d.ts (#51737)
Summary:
- This is similar to https://github.com/facebook/react-native/pull/43566, but include also updated `StackFrame` type.

The current `Devtools.d.ts` doesn't match the `parseErrorStack.js` and `symbolicateStackTrace.js` implementations.

I've tried to run `build-types`, but only `symbolicateStackTrace.d.ts` was generated. I've not checked why.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [FIXED] - Devtools TS Types

Pull Request resolved: https://github.com/facebook/react-native/pull/51737

Test Plan: Call `parseErrorStack` and `symbolicateStackTrace` in TS.

Reviewed By: rshest

Differential Revision: D75782013

Pulled By: huntie

fbshipit-source-id: 91fe560f079731af2a5834c8de8eafb723d00bf9
2025-06-02 09:39:26 -07:00
Zeya PengandFacebook GitHub Bot 581097b8ea (Redo PR #51264) Remove native animation fabric sync in JS and infinite animation loop workaround
Summary:
## Changelog:

[General] [Changed] - Remove native animation fabric sync in JS and infinite animation loop workaround, when cxxNativeAnimated is enabled

when cxxNativeAnimated is enabled, we'll sync native animation props back to Fabric in native, when that happens we can remove the code in JS for same purpose

Reviewed By: sammy-SC

Differential Revision: D75789100

fbshipit-source-id: 966e2b187f43e8743ccbf7ba97b8e8a27273fe0c
2025-06-02 09:29:40 -07:00
Pieter De BaetsandFacebook GitHub Bot 68ed4071e2 Add missing tests references to buck targets (#51743)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51743

Noticed some of these were missing, which may lose us useful test signal, or prevent tests from being ran at all.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D75789456

fbshipit-source-id: 75645866c672c77d3dac34383105955ef6d25e60
2025-06-02 09:05:14 -07:00
Pieter De BaetsandFacebook GitHub Bot 95ed8a6123 Merge all core codegen into FBReactNativeSpec (#50317)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50317

`rncore`, `FBReactNativeSpec` and `FBReactNativeComponentSpec` contain the same symbols, which leads to conflicts when we try to merge them into a single shared library. Cleanup the duplication and standardize on `FBReactNativeSpec` everywhere. I've left the Android OSS targets names as is, to avoid breaking deps.

This aligns react-native's package.json with the codegen tooling supported across iOS and Android, which is a single target for all all type-derived codegen.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D55037569

fbshipit-source-id: dbf3c0a427c9d0df96e439b04e5b123cd1069c51
2025-06-02 08:47:05 -07:00
Tim YungandFacebook GitHub Bot 95113e9dfd RN: Default featureflags Script to Update (#51708)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51708

Changes `yarn featureflags` to default to `--update` when no options are supplied.

Provides a way to display the available options with a new `--help` option.

Changelog:
[Internal]

Reviewed By: sammy-SC

Differential Revision: D75692119

fbshipit-source-id: 50d25c5f12c7646159872661c93ebe8c42f44788
2025-06-02 08:40:55 -07:00
Tim YungandFacebook GitHub Bot 8343045404 RN: Support Non-Boolean Feature Flags (#51707)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51707

Currently, the feature flag system does not properly support non-boolean feature flags. The type definitions and generated code make assumptions about the value type being `boolean`.

This diff fixes these assumptions so that non-boolean feature flags are supported.

Changelog:
[Internal]

Reviewed By: sammy-SC

Differential Revision: D75690997

fbshipit-source-id: 870063ff979d0650ce6d0a2f6b340d97c28d7d0b
2025-06-02 07:36:53 -07:00
Moti ZilbermanandFacebook GitHub Bot 8037e20206 Update debugger-frontend from 343405b...41bf86b (#51739)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51739

Changelog: [Internal] - Update `react-native/debugger-frontend` from 343405b...41bf86b

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/343405ba784fca9290486cbce57e7f2ca953dc14...41bf86bdbb3e59e7711f11527efac67c050bca75).

Reviewed By: huntie

Differential Revision: D75785047

fbshipit-source-id: 5b2a611237e78811f140e8f3cdb8dec4a8b8a2be
2025-06-02 07:19:30 -07:00
Vladimir IlievandFacebook GitHub Bot 36ddf853c3 Fix emitting event from turbo module crashes on 32bit android (#51695)
Summary:
After testing the latest RC and nighly builds, crash appeared when emitting events from turbo modules on 32bit Android devices. The crash is always reproducible only on 32bit devices on signed production builds. Fore more details and the crash log, check the [related issue](https://github.com/facebook/react-native/issues/51628#issue-3094045077).

From what I found, the variadic functions like CallVoidMethod are unsafe on 32bit due to not type checking the passed arguments at compile time. As far as I understand the 64bit cpus and ABIs are more forgiving with alignment and calling conventions. On 32bit the ABIs are strict as arguments are passed on the stack and if there is type/size/alignment issue it reads the wrong memory, which causes the SIGEGV crashes.

## Changelog:
[ANDROID] [FIXED]  - emitting event from turbo module crashes on 32bit android

Pull Request resolved: https://github.com/facebook/react-native/pull/51695

Test Plan:
1. Pull the [reproduction demo](https://github.com/vladimirivanoviliev/rn079eventcrash), install the dependencies (v `0.80` is on PR)
2. Run codegen on android
3. Build signed apk. To create it you will need to create new demo key-store.
4. To install the build apk in 32bit mode you can use `adb -s YOURDEVICE install --abi armeabi-v7a android/app/release/app-release.apk`
5. Run the app, create key, save it. Than update the key and save it again. The app crashes when try to emit event from the turbo module.
6. Patch the related `JavaTurboModule.cpp` file with the changes from this PR and enable build from source.
7. Rebuild and reinstall the apk and test again - the issue is now fixed

## Additional notes:
I have tested the app on android using the `rn-tester` demo app, everything works as expected. I also patched our production app and tested more complex scenarios and they works as expected. I have run the tests and linter and they passed.

One thing that I didn't able to setup and run is the iOS `rn-tester` app, due to Hermes engine error `Command PhaseScriptExecution failed with a nonzero exit code`. I haven't found any information how to fix it. I have followed [this guide](https://github.com/facebook/react-native/blob/main/packages/rn-tester/README.md) and installed node modules using yarn and started the `yarn prepare-ios`. I also haven't found any information with what node version and ruby version the react native package is build on CI so I use the same versions locally. If you provide me with updated instructions for those I can contribute by updating the related guides and including `.npmrc`, `.ruby-version` files.

Reviewed By: cortinico

Differential Revision: D75782377

Pulled By: javache

fbshipit-source-id: b94998be6dd51e90ad4137b1d2e38a6850bc3cb2
2025-06-02 04:50:40 -07:00
riteshshukla04andFacebook GitHub Bot a6908ad1a5 Add pending declaration for ScrollView (#51613)
Summary:
Fixes https://github.com/facebook/react-native/issues/51548

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[General][ADDED] Added more Pending Decleration for ScrollView

Pull Request resolved: https://github.com/facebook/react-native/pull/51613

Test Plan: Can be tested on RNTester with ScrollView

Reviewed By: cortinico

Differential Revision: D75516801

Pulled By: rshest

fbshipit-source-id: 87d6f68ab0a3ffd50af57b5eeaf313da4bf7ed98
2025-06-02 03:00:05 -07:00
Riccardo CipolleschiandFacebook GitHub Bot e324874614 Fix workflow-retry for android (#51684)
Summary:
The retry mechanism introduced in [this commit]() works for iOS e2e failures but it is skipped if android e2e tests fails.
This change should fix that

## Changelog:
[Internal] - Fix retry for Android E2E tests

Pull Request resolved: https://github.com/facebook/react-native/pull/51684

Test Plan: GHA

Reviewed By: rshest

Differential Revision: D75719890

Pulled By: cipolleschi

fbshipit-source-id: 0c2a22268bb655617eaf27f61227a46650878b4e
2025-06-02 02:58:37 -07:00
Nick GerlemanandFacebook GitHub Bot 93920e38e6 (Mostly) Back out "[react-native] Fix clang tidy for react-native"
Summary:
D75596329 disabled many, many rules that we previously explicitly enabled over the codebase, due to a specific rule causing crash in linter when specifically linting some files like RCTDeviceInfo.mm.

Let's revert the change, and remove the specific problematic rule from our list of manually enabled rules instead.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D75734557

fbshipit-source-id: 9d6ee401bfa5d1efc8de993d366839c740aa0bdc
2025-06-01 17:21:48 -07:00
Mateo GuzmánandFacebook GitHub Bot d3d92b9a1d Unify RNTester Cache Policy Image example (#51580)
Summary:
The Image component in Android now supports the same cache control behaviour as in iOS, the examples needed to be separated in the past because the support was not the same for iOS and Android, but now that it is, we can unify the example.

## Changelog:

[INTERNAL] - Unify RNTester Cache Policy Image example

Pull Request resolved: https://github.com/facebook/react-native/pull/51580

Test Plan:
<details>
<summary>RNTester Screenshots</summary>

| iOS | Android |
|--------|-------|
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2025-05-24 at 12 55 30](https://github.com/user-attachments/assets/f2fd680d-67e4-42db-bc91-f09fe5b0f947) | ![Screenshot_1748084132](https://github.com/user-attachments/assets/ef1b5454-4a85-48d7-be76-3107082b883e) |
</details>

Reviewed By: yungsters

Differential Revision: D75538812

Pulled By: Abbondanzo

fbshipit-source-id: 7705c8f824cb18cebc39e84b6f48979035dc104c
2025-05-31 13:13:39 -07:00
Sam ZhouandFacebook GitHub Bot 1e967ca983 Deploy 0.272.2 to xplat (#51717)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51717

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D75715829

fbshipit-source-id: 8074481b11bfd28817b1caf315c8009cf6ae3807
2025-05-31 06:19:34 -07:00
Samuel SuslaandFacebook GitHub Bot cddfe4a035 use if statement instead of unordered_map for mapping (#51705)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51705

changelog: [internal]

use if/else instead of unordered_map to map types of nodes/drivers from string to a class. This is faster and improves binary size.

Reviewed By: javache

Differential Revision: D75676701

fbshipit-source-id: be9b8b646ebd9472382e6f692768b8fe9703d88f
2025-05-30 10:28:17 -07:00
Rubén NorteandFacebook GitHub Bot 6a7cea25ba Fix reporting of errors during test setup (#51704)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51704

Changelog: [internal]

If you create a Fantom test that throws an error during its setup (not during the execution of specific tests), Fantom fails with an error saying there are no tests defined, which isn't useful.

This fixes the problem and shows where the error in the test setup happened exactly.

Reviewed By: javache

Differential Revision: D75689283

fbshipit-source-id: 54dd2382868dda0d284f46743ed94ba94aa3afdc
2025-05-30 10:25:16 -07:00
Pieter De BaetsandFacebook GitHub Bot 96fe4a5ad7 Move default trackingName as undefined to RCTNetworking (#51703)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51703

Feedback on D75516619

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D75544422

fbshipit-source-id: f6c5e0090946b7861fd9cd9646e1b06b7c6a05d2
2025-05-30 09:56:20 -07:00
Pieter De BaetsandFacebook GitHub Bot 69b56a4ca0 Do not use delegate wrapper for NativeReactNativeFeatureFlags (#51702)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51702

We have no need for C++ bridging in this TurboModule, as the generated code matches the base codegen exactly.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D75681901

fbshipit-source-id: 4b6caafe0bcd08a06686e0a44112bdb99a64a1cf
2025-05-30 09:50:36 -07:00
Alex HuntandFacebook GitHub Bot 1a46b203b8 Re-expose src/ paths via exports (default) (#51699)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51699

Re-expose **all `"./src/*"` paths via `package.json#exports`.

Follows D72228547 — as we'd attempted to be proactive with hiding `src/`, but are now reverting — essentially reducing this change as much as possible (read: most defensive/safer effect on OSS).

**Motivation**

Mitigates a warning emitted by Metro that may surface in new bare React Native template projects.

{F1978757796}

This is due to a 1P reference to `'react-native/src/private/featureflags/ReactNativeFeatureFlags` in `react-native/virtualized-lists`.

This is enough motivation to undo part of our change with introducing `"exports"` on `react-native` in 0.80.

**Especially**, to avoid confusion with other warnings we've intentionally introduced in 0.80 around subpath imports.

- The key difference is the above screenshot is from Metro and covers **any** import from any `node_modules` file — as opposed to just the immediate project.

Changelog:
[General][Changed] - Re-expose `src/*` subpaths when not using the Strict TypeScript API

The net breaking change for 0.80, once picked, is simply the presence of `"exports"` (only very edge case effects on expanding per-platform extensions, which we've mitigated). **All exported paths equivalent**.

Reviewed By: robhogan

Differential Revision: D75682566

fbshipit-source-id: f90c7298279c6be3a4eab70f2dfdc618ffcf1124
2025-05-30 08:49:59 -07:00
Moti ZilbermanandFacebook GitHub Bot 188221052d Support conditional exports when enumerating entry points (#51698)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51698

Changelog: [Internal]

TSIA

Reviewed By: hoxyq

Differential Revision: D75682786

fbshipit-source-id: 3d70c36f26d87f0be003784aa76bec34640b38d2
2025-05-30 08:36:29 -07:00
Rubén NorteandFacebook GitHub Bot a218b63969 Refactor test setup to avoid importing the Fantom module before the body of the test (#51696)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51696

Changelog: [internal]

I realized that the Fantom module was being initialized before the execution of the test module itself (as part of the code generated by the runner), which could have problems if the test sets up the global environment that Fantom consumes. For example, if Fantom needs to use the `EventTarget` type from the global scope, it needs to wait until the initialization of the runtime so it can use it safely.

This refactors all the code calling into Fantom as part of our infra to always initialize it lazily, so the first thing that runs as part of the test execution is the test itself (apart from our test setup, which is supposed to be side-effect free).

Reviewed By: sammy-SC

Differential Revision: D75681181

fbshipit-source-id: 91e4b903a49fcee59c5875e73db314cde0adea03
2025-05-30 07:50:42 -07:00
Samuel SuslaandFacebook GitHub Bot 3fb965df0c prevent deadlock in C++ Animated (#51697)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51697

changelog: [internal]

as a general rule of thumb, do not call outside of your class when holding a mutex. It is easy to cause a deadlock because the outside code may end up trying to acquire the mutex down the stack, leading to deadlock.

Here, it happens because `startRenderCallbackIfNeeded` may end up calling onRender and in onRender, we try to acquire the mutex again

Reviewed By: javache

Differential Revision: D75675465

fbshipit-source-id: 46168ee154a54ae5cccaa74728b41f027519db59
2025-05-30 07:49:38 -07:00
Moti ZilbermanandFacebook GitHub Bot 366c89265f Fix up debugger-shell package definition (#51694)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51694

Changelog: [Internal]

D74820232 was missing an `exports` entry for `debugger-shell/package.json`, which is needed for some of our build tooling.

Reviewed By: hoxyq

Differential Revision: D75679347

fbshipit-source-id: 8deaf55ce354afcff410104948cad1b9a30093b7
2025-05-30 07:42:10 -07:00
Riccardo CipolleschiandFacebook GitHub Bot cb6d388603 Add reactRuntime target (#51690)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51690

This change adds the reactRuntime target to SwiftPM

## Changelog:
[Internal] - Add reactRuntime

Reviewed By: cortinico

Differential Revision: D75638242

fbshipit-source-id: 900a1254e3084a78f41aec5e51f7513724c152ec
2025-05-30 07:21:25 -07:00
Jay KoutavasandFacebook GitHub Bot 48b2dd355b Fix ConcurrentModificationException in InteropUIBlockListener (#51631)
Summary:
This React Native Android fix hardens the Fabric `InteropUiBlockListener` against `ConcurrentModificationException` crashes in `willMountItems` and `didMountItems`. By iterating over a shallow copy of the UI‐block lists and catching any mid‐iteration mutations, we ensure the listener never throws during a UI frame and always clears its pending blocks.

The issue was first reported in [React Native Issue https://github.com/facebook/react-native/issues/49783](https://github.com/facebook/react-native/issues/49783), and although [React Native PR#50091](https://github.com/facebook/react-native/pull/50091) was closed and not merged, the work in that PR did make it to React Native in [commit 17da3cb](https://github.com/facebook/react-native/commit/17da3cbbf4687f86226c4a80297c4d8abfc9c4f5). However, the fix didn't go far enough. We saw intermittent examples of this exception being thrown when swiping through a carousel from `react-native-reanimated-carousel`. This fix goes right to the exception site itself.

## Changelog:

[ANDROID] [FIXED] -  Hardened the Fabric `InteropUiBlockListener` against `ConcurrentModificationException` crashes in `willMountItems` and `didMountItems`

Pull Request resolved: https://github.com/facebook/react-native/pull/51631

Test Plan:
The only way to test this is to develop a standalone app that emulates what we've been seeing in our commercially available RN app. We have done extensive testing of before (intermittent crashes) and after the fix (no crashes) and things have been standing up very well for us.

Here is a the Red Box we see right at the time of the crash, before this fix:

<img width="414" alt="image" src="https://github.com/user-attachments/assets/8d1b6c6d-42f7-48a0-9574-2f05436547d4" />

And here is the beginning of the logcat crash log:

```
2025-05-07 16:01:49.212 unknown:BridgelessReact com.aura.suite                       W  ReactHost{0}.handleHostException(message = "null")
2025-05-07 16:01:49.212 unknown:ReactNative     com.aura.suite                       E  Exception in native call
                                                                                        java.util.ConcurrentModificationException
                                                                                        	at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1111)
                                                                                        	at java.util.ArrayList$Itr.next(ArrayList.java:1064)
                                                                                        	at com.facebook.react.fabric.internal.interop.InteropUIBlockListener.willMountItems(InteropUiBlockListener.kt:72)
                                                                                        	at com.facebook.react.fabric.FabricUIManager$MountItemDispatchListener.willMountItems(FabricUIManager.java:1235)
                                                                                        	at com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchMountItems(MountItemDispatcher.java:184)
                                                                                        	at com.facebook.react.fabric.mounting.MountItemDispatcher.tryDispatchMountItems(MountItemDispatcher.java:122)
                                                                                        	at com.facebook.react.fabric.FabricUIManager$3.runGuarded(FabricUIManager.java:820)
                                                                                        	at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:29)
                                                                                        	at com.facebook.react.fabric.FabricUIManager.scheduleMountItem(FabricUIManager.java:824)
                                                                                        	at com.facebook.react.fabric.FabricUIManagerBinding.reportMount(Native Method)
                                                                                        	at com.facebook.react.fabric.FabricUIManager$MountItemDispatchListener$1.run(FabricUIManager.java:1282)
                                                                                        	at android.os.Handler.handleCallback(Handler.java:959)
                                                                                        	at android.os.Handler.dispatchMessage(Handler.java:100)
                                                                                        	at android.os.Looper.loopOnce(Looper.java:232)
                                                                                        	at android.os.Looper.loop(Looper.java:317)
                                                                                        	at android.app.ActivityThread.main(ActivityThread.java:8592)
                                                                                        	at java.lang.reflect.Method.invoke(Native Method)
                                                                                        	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
                                                                                        	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
```

All of this goes away with this fix. We're using React Native 0.79.2 and this is the first time we've open a PR for react-native. I hope this is enough info as far as testing goes.

Can we see a 0.79.x release with this fix, please?

Reviewed By: Abbondanzo, cortinico

Differential Revision: D75594791

Pulled By: javache

fbshipit-source-id: 982ae27e89756fdb290a24b0bdfa67c2e47c04e3
2025-05-30 03:50:09 -07:00
Moti ZilbermanandFacebook GitHub Bot 63f4fb129f Scaffold debugger-shell package (#51688)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51688

Changelog: [Internal]

# Context

See D74904547.

## This diff

Creates the `react-native/debugger-shell` package, containing a basic implementation of an Electron-based shell for React Native DevTools. At this point, there is no direct dependency on the new package from the rest of React Native - it's designed to be used as part of a Meta-internal experimental rollout of the new debugger shell via the `BrowserLauncher` interface in `dev-middleware`.

Reviewed By: huntie

Differential Revision: D74820232

fbshipit-source-id: cb06ea9e2ed8c8822019cad8296cc19e69f9db0b
2025-05-30 02:23:12 -07:00
Moti ZilbermanandFacebook GitHub Bot 55ff50fba5 dev-middleware: Scaffold standalone Fusebox shell experiment (#51687)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51687

Changelog: [Internal]

# Context

This is the first of several commits that aim to implement a **standalone shell for React Native DevTools**. This will be a lightweight desktop app designed to host the debugger frontend, in much the same way as we currently use Chrome or Edge. The launch flow will otherwise remain **very similar** to the one that exists today.

## What's changing for users?

1. With this commit, nothing; we're merely setting up an experiment flag (for stage 1 - Meta-internal testing) and will make separate plans for open source rollout, coordinated with our framework maintainer partners.
2. If the experiment is successful, we aim to *eventually* phase out the use of Chrome/Edge in React Native DevTools and ship the standalone shell as standard to all React Native developers. This is to enable further improvements that will rely on the standalone shell to work.
3. The first iteration of the standalone shell aims to solve some concrete pain points such as the "dead window problem" - the fact that opening DevTools multiple times for the same target will leave behind a now-dead window (that would ideally have been reused).

## This diff

We amend the `unstable_experiments` and `unstable_browserLauncher` APIs in `dev-middleware` to add basic support for launching a standalone shell based on a frontend URL and a *window key* - the latter being an opaque string that the shell process can match against previous launches in order to reuse and foreground existing windows.

We leave it up to `BrowserLauncher` implementers ( = frameworks) to provide a working implementation of `unstable_showFuseboxShell`, and do not provide one with `DefaultBrowserLauncher`. This will effectively allow us to dependency-inject the actual shell implementation at stage 1 so we don't increase the download size of React Native unnecessarily.

Reviewed By: rickhanlonii, robhogan

Differential Revision: D74904547

fbshipit-source-id: fbc6eac97923062bda8892bc130b39051845ea82
2025-05-30 02:23:12 -07:00
Ramanpreet NaraandFacebook GitHub Bot 3e49d17f58 Fix clang tidy for react-native (#51679)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51679

## Problem

I noticed that clang-tidy was crashing in some of our native modules.

This diff fixes the crash. And it blocklists all the warnings that got raised when I ran clang tidy for react native.

## Fix
This rule would crash clang tidy:

```
cppcoreguidelines-avoid-const-or-ref-data-members
```

I disabled it in the .clang-tidy file via:
```
-clang-analyzer-*,
```

## Why disable existing warnings?
We need to double check which checks make sense to enable for react native github. Until we have that understanding, I don't think we should prompt people to adjust their code. After we have that understanding, it should be really easy to enable the checks: just run the linter on react native, and fix the code.

Reviewed By: lunaleaps

Differential Revision: D75596329

fbshipit-source-id: 757a8d38f203d7fb4403bbda3703fda7b44923b0
2025-05-29 14:25:57 -07:00
Rubén NorteandFacebook GitHub Bot 25f8b86dbe Replace existing usages of shadowNodeFromValue with new bridging function (#51676)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51676

Changelog: [internal]

This replaces all existing usages of `shadowNodeFromValue` (previously defined in `primitives.h`) to use the new bridging method to automatically convert `ShadowNode::Shared` from and to JS.

It also deletes the old method.

Reviewed By: javache

Differential Revision: D75597543

fbshipit-source-id: ab4e307dad80c7507b7ebd1cfa6621d020473d89
2025-05-29 11:20:15 -07:00
Rubén NorteandFacebook GitHub Bot 9c2148920c Define JSI bridging function for ShadowNode::Shared (#51675)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51675

Changelog: [internal]

This defines a new bridging method to convert ShadowNode::Shared from and to JS. This has some benefits over the existing `shadowNodeFromValue` and `valueFromShadowNode` functions:
1. It's more convenient, as we can just use `ShadowNode::Shared` in classes implementing the codegen, and the runtime will do the conversion automatically.
2. It's safer, as it checks for nullability and throws JS exceptions except of having segmentation faults down the line.

Reviewed By: javache

Differential Revision: D75597542

fbshipit-source-id: 37c0c43cbde0f4de9a740d9da910f215ae50efbd
2025-05-29 11:20:15 -07:00
Nicola CortiandFacebook GitHub Bot 3a41cdf5b2 Fully remove LOG_TAG from Buck/CMake (#51660)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51660

We should be able to clean this up as we're not using it directly.
It would be used via the NDK logging utilities from Android, that we don't use.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D75531640

fbshipit-source-id: e96932b6e77b159683728194ac2e856cb868e06f
2025-05-29 10:42:31 -07:00
Ruslan LesiutinandFacebook GitHub Bot ff4f4c8331 chore: cleanup duplicate import and typo in PerformanceTracer (#51681)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51681

# Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D75608626

fbshipit-source-id: 97236cd35afd1cd9955bf54a6fca4f19fde3007a
2025-05-29 10:37:19 -07:00
Moti ZilbermanandFacebook GitHub Bot 6d0e5b0c9d Improve reporting of API translation errors (#51683)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51683

TSIA

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D75604640

fbshipit-source-id: 05fa76fb9a3a4d97fe9bbee17b756f74dbdb746e
2025-05-29 10:05:04 -07:00
Tim YungandFacebook GitHub Bot e7a9322bdf RN: Flowify packages/react-native-scripts (#51671)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51671

Adds `flow` (or `noflow`) to all files in this directory and ensures that Flow succeeds (by adding type annotations, using minor refactors, or suppressing errors due to intentionally dynamic logic).

This will help improve type safety when making changes both in these files as well as files that these depend on.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75581879

fbshipit-source-id: 6dcd8cc55d0021973eeae2670c1ebceb6d69fa8f
2025-05-29 07:52:38 -07:00
Tim YungandFacebook GitHub Bot 1fd9508ecc RN: Refactor Jest Default Mocks (#51669)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51669

Refactors the default mocks initialized in `packages/react-native/jest/setup.js` so that each mock is defined in its own file.

This provides several benefits, including:

- The ability to use `import` statements without worrying about eager initialization of dependencies before `globals` is setup.
- The ability to verify mocks export the same types as the actual module, using a new Flow-typed `mock` helper function.
- The ergonomic of implementing mocks with more complex logic, without having to split them out into a separate module (e.g. `mockModal`, `mockScrollView`).

As part of this migration, I also fixed any minor discrepancies to match the actual type definition. For more involved discrepancies (e.g. missing methods), I added type suppressions for now to minimize breaking changes.

Changelog:
[General][Changed] - Improved default mocking for Jest unit tests.

Reviewed By: javache

Differential Revision: D75575421

fbshipit-source-id: 98d60e10b753f1505ffdccf5f12f5d3ef306ebb5
2025-05-29 07:52:38 -07:00
Samuel SuslaandFacebook GitHub Bot 5bf7eb847c clean up AnimationDriverUtils (#51674)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51674

changelog: [internal]

just a clean up of code in AnimationDriverUtils and removal of unused headers.

Reviewed By: mdvacca

Differential Revision: D75549612

fbshipit-source-id: a8ad63622478d06318b6304b886554478b43d19b
2025-05-29 07:36:26 -07:00
Moti ZilbermanandFacebook GitHub Bot d61a8f7059 Fix the ability to require() JSON files in tests (#51678)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51678

Changelog: [Internal]

TSIA

Reviewed By: hoxyq

Differential Revision: D75598975

fbshipit-source-id: ed6c151f021b5a9cc0fab22a179094064486691e
2025-05-29 06:16:48 -07:00
Samuel SuslaandFacebook GitHub Bot 014f212bce convert AnimatedModule away from lambdas (#51659)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51659

changelog: [internal]

use std::variant in AnimatedModule to generate smaller C++ binary.

Reviewed By: javache, mdvacca

Differential Revision: D75379819

fbshipit-source-id: 4dc8bbf6e2cdb7aa9080a27526ca9d43d155b5d7
2025-05-29 05:43:10 -07:00
Tim YungandFacebook GitHub Bot d626d5b623 RN: Delete nullthrows Import in MutationObserver (#51672)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51672

Deletes an unused import.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D75583225

fbshipit-source-id: be57005f5647234acf450c13345987da24e92696
2025-05-29 03:50:47 -07:00
Tim YungandFacebook GitHub Bot 235b6b180a RN: Fix Unstable Component in FlatList-multiColumn (#51673)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51673

Fixes a lint warning that seems to inconsistently fire, by improving the code that it complains about.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D75583443

fbshipit-source-id: b6df191e2e51dee688df3f3c960704dea28a4ece
2025-05-29 02:59:01 -07:00
Mateo GuzmánandFacebook GitHub Bot a42631efad Migrate CoreModulesPackage to Kotlin (#51640)
Summary:
Migrate com.facebook.react.CoreModulesPackage to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.CoreModulesPackage to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/51640

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: arushikesarwani94

Differential Revision: D75502816

Pulled By: alanleedev

fbshipit-source-id: 0914adf0b7c5c082a283d9abac595783887da268
2025-05-29 01:56:29 -07:00
Peter AbbondanzoandFacebook GitHub Bot 3d7973a3e6 Add focus/blur example to RNTester (#51634)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51634

Creates an example in the ViewExample setup for how onBlur/onFocus behave when using keyboard navigation

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D75238317

fbshipit-source-id: e69122ca17727fc7f71e9bb7a09098a2771b098e
2025-05-28 21:29:51 -07:00
Peter AbbondanzoandFacebook GitHub Bot af0a76cf5f Add support for blur and focus on View (#51570)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51570

As the title suggests: adds support strictly to `View` components on Android for `onFocus` and `onBlur` events. This is especially helpful for apps that respond to controller or remote inputs and aligns with existing support for the `focusable` prop.

In order to make this change cross-compatible with text inputs, `TextInputFocusEvent` has been deprecated in favor of the `BlurEvent`/`FocusEvent` types now available from core. Their type signatures are identical but `BlurEvent`/`FocusEvent` should be the type going forward for all views that intend to support focus/blur. Text inputs intentionally do not forward information about their state upon focus/blur and docs specifically call out `onEndEditing` as a means of reading state synchronously when blurring. Therefore, the changes to the native side to remove the event type specifically for text inputs is not breaking.

Changelog: [Android][Added] - Support for `onFocus` and `onBlur` function calls in `View` components

Reviewed By: mdvacca

Differential Revision: D75238291

fbshipit-source-id: b991d1f24fc094ba9d5d466201ecd058f59258e9
2025-05-28 21:29:51 -07:00
Nick GerlemanandFacebook GitHub Bot dd9d7c0e74 Add Tests for layout events of ellipsized Text (#51666)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51666

The platforms handle this in pretty different ways right now. Let's add a test showing the differences.

Android also adds a bunch of unicode zero width spaces in there...

Changelog: [Internal]

Reviewed By: mlord93

Differential Revision: D75567210

fbshipit-source-id: 98cac7d3fd23451868b55b69478e2667a2de3716
2025-05-28 19:20:55 -07:00
Nick GerlemanandFacebook GitHub Bot 9478c27a69 Add Flag to disable global text measure cache (#51654)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51654

Facsimile may or may not use a global measure cache. Adding flags to let us run experiment, to understand real-world performance impact, now that we have fixed some (but not all) of the issues which may lead to measurement invalidation in Fabric.

Also does some quick cleanup th `SimpleThreadSafeCache` to remove the cache key as part of the lambda, which is never used, and makes this change mildly less efficient, and to accept lambda by generic type instead of repacking into std::function which has runtime overhead.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D75509799

fbshipit-source-id: 165c08d626ab1f2758f0203d3a0d527a1a5106a7
2025-05-28 17:59:15 -07:00
Tim YungandFacebook GitHub Bot b654417afd RN: Unnecessary $FlowFixMe for jest.now() (#51665)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51665

This type suppression comment is no longer necessary.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75546017

fbshipit-source-id: 8c1f6a4260f0ca83bcba200bf550746270578534
2025-05-28 17:24:01 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 98872a1b09 Add automatic retry of failed workflows to improve E2E stability (#51627)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51627

This cdhanges are inspired by https://stackoverflow.com/a/78314483 and they should help with the stability of E2E tests on main.
Most of the time, those tests fails because of flakyness in the E2E infrastructure on GHA. Usually, rerunning the tests manually makes the workflow pass.

These couple of jobs automatically reruns the workflow up to 3 times in case one of the E2E tests fails

## Changelog:
[Internal] - improve CI by rerunning the workflow if the E2E tests fails

Reviewed By: cortinico

Differential Revision: D75449445

fbshipit-source-id: d9c235c76007a3bda048ec76b62710ca930cf252
2025-05-28 15:45:37 -07:00
Ramanpreet NaraandFacebook GitHub Bot 0b8db7e5e8 Mitigate device info main queue modules crash (#51662)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51662

## Changes
DeviceInfo: Deafult fontScale to 1 when accessibility manager isn't available

# Analysis
**The problem:** For reasons that we don't understand, accessibility manager is sometimes nil, when deviceinfo needs it. This is a long-standing issue in react native.

```
  _constants = @{
    @"Dimensions" : [self _exportedDimensions],
    // Note:
    // This prop is deprecated and will be removed in a future release.
    // Please use this only for a quick and temporary solution.
    // Use <SafeAreaView> instead.
    @"isIPhoneX_deprecated" : @(RCTIsIPhoneNotched()),
  };
```

```
- (NSDictionary *)_exportedDimensions
{
  RCTAssert(!_invalidated, @"Failed to get exported dimensions: RCTDeviceInfo has been invalidated");
  RCTAssert(_moduleRegistry, @"Failed to get exported dimensions: RCTModuleRegistry is nil");
  RCTAccessibilityManager *accessibilityManager =
      (RCTAccessibilityManager *)[_moduleRegistry moduleForName:"AccessibilityManager"];
  if (!accessibilityManager) {
    return nil;
  }
  CGFloat fontScale = accessibilityManager ? accessibilityManager.multiplier : 1.0;
  return RCTExportedDimensions(fontScale);
}

```

**The crash:** When accessibility manager is nil, device info tries to insert nil into an NSDictionary, and crashes.

We found a possible repro of this issue: [launch facebook, log out, and log back in](https://www.internalfb.com/diff/D72020801?transaction_fbid=982516293994114).

**Why this surged now:** Recently, we started initializing device info during react native init. That means this code-path just runs much more often.

# Mitigation
Remove the return nil in `[self _exportedDimensions]`. Instead, just default the fontScale to 1 when the accessibility manager isn't available.

**This should be safe:** If we assume that accessibility manager eventually becomes available, the fontScale will eventually become correct. Device info will send the updated fontScale to js when it becomes available: [native](https://www.internalfb.com/code/fbsource/[ec6fd664a9cd]/xplat/js/react-native-github/packages/react-native/React/CoreModules/RCTDeviceInfo.mm?lines=231-232), [js](https://www.internalfb.com/code/fbsource/[ec6fd664a9cd]/xplat/js/react-native-github/packages/react-native/Libraries/Utilities/Dimensions.js?lines=120-125).

# Long-term fix
Understand why accessibility manager is nil.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D75537894

fbshipit-source-id: 921cc573fdfd7e5c340ac3a4ada268caadb9e382
2025-05-28 15:29:19 -07:00
Nick GerlemanandFacebook GitHub Bot 628c1333ea Disable hasOverlappingRendering in PreparedLayoutTextView (#51549)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51549

This is copied from `ReactTextView`, with a comment explaining the shenanigans.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D75248328

fbshipit-source-id: b325cf05e0000ee0b0c5fb82f0e7412a680e5d01
2025-05-28 15:18:33 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 2c04b54c05 Fix Custom Focus Ordering for FocusForward, FocusBackward and nested children (#51575)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51575

Before we were relying on absolute focus direction to determine the next focusable view inspired by Recycler View's implementation. This turned out to be inaccurate since FocusForward and FocusBackward do the ordering differently.

For FocusForward and FocusBackwards the children of the root node are ordered first from top to bottom then, row groups are created by getting views with the same vertical position and then everything else is sorted left to right.

Android creates an array with this order and then just focuses the next or previous element of this list. We don't do this but now FocusForward and FocusBackward follow the some comparisons used to build this array on Android.

Also, there was an issue with nested children within an accessible view, this just needed a bit of refactor on the focusSearch function so that we can tell when we actually need to trigger our custom focus search

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D75301251

fbshipit-source-id: 93b708092299afa778ba5938b093c2c38209b497
2025-05-28 14:34:22 -07:00
Samuel SuslaandFacebook GitHub Bot 091eb2ea11 clean up interface of AnimationDriver (#51663)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51663

changelog: [internal]

mark getters as noexcept const and use `get` prefix.

Reviewed By: christophpurrer

Differential Revision: D75531202

fbshipit-source-id: d66132ee3ec459e73ab3dc33c726c73d5afb6e72
2025-05-28 14:18:24 -07:00
Tim YungandFacebook GitHub Bot a4c2007068 RN: Flowify packages/react-native/jest (#51652)
Summary:
Adds `flow` (or `noflow`) to all files in this directory and ensures that Flow succeeds (by adding type annotations, using minor refactors, or suppressing errors due to intentionally dynamic logic).

This will help improve type safety when making changes both in these files as well as files that these depend on.

Changelog:
[Internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/51652

Test Plan:
Ran Flow and Jest tests successfully:

```
$ yarn flow
$ yarn test
```

Ran a Jest unit test internally to make sure they work with our internal environment setup:

```
$ cd ~/fbsource
$ js1 test /View-test.js
```

Reviewed By: javache

Differential Revision: D75488160

Pulled By: yungsters

fbshipit-source-id: 536cef9699acfa1edcd3dcf61c53ebcd92f560f9
2025-05-28 12:20:48 -07:00
Ramanpreet NaraandFacebook GitHub Bot 14a115282b IntersectionObserver: Only reset modern io, if it exists (#51510)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51510

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D75077634

fbshipit-source-id: d648a5e8c1de8efd44f4b1d2c44932bfebe0fbb3
2025-05-28 11:25:50 -07:00
Bartłomiej BłoniarzandFacebook GitHub Bot 1161fb4fcd Add cloneMultiple method to the ShadowNode class (#50624)
Summary:
This PR adds a new cloning method, allowing for updating multiple nodes in a single transaction. It works in two phases:
1. Find which nodes have to be cloned (i.e. nodes given on input and all their ancestors)
2. Clone nodes in the bottom up order - so that every node is cloned exactly once

So the idea is that when we want to update all the red nodes in this picture, we first find the nodes in the green area and the clone only them in the correct order (children are cloned before parents):
![Screenshot 2025-04-10 at 14 31 14](https://github.com/user-attachments/assets/f397eeff-8279-4d0c-bf87-083bfb44b86a)

Adapting this method [brought a huge performance gain to reanimated](https://github.com/software-mansion/react-native-reanimated/pull/6214). I want to upstream it, so that:
1. we can optimize it further, because making it a part of the `ShadowNode` class gives us access to the parent field in `ShadowNodeFamily` so we can traverse the tree upwards, allowing for a optimal implementation of the first phase (in reanimated we repeatedly call `getAncestors`, which revisits some nodes multiple times)
2. the community can use it

A naive approach that calls `cloneTree` for every node is much slower, as it has to repeat many operations.
## Changelog:

[GENERAL] [ADDED] - Added `cloneMultiple` to `ShadowNode` class.

Pull Request resolved: https://github.com/facebook/react-native/pull/50624

Test Plan:
I tested it with the following reanimated implementation and everything works fine:

<details>

```c++
const auto callback =
      [&](const ShadowNode &shadowNode,
          const std::optional<ShadowNode::ListOfShared> &newChildren) {
        return shadowNode.clone(
            {mergeProps(shadowNode, propsMap, shadowNode.getFamily()),
             newChildren
                 ? std::make_shared<ShadowNode::ListOfShared>(*newChildren)
                 : ShadowNodeFragment::childrenPlaceholder(),
             shadowNode.getState()});
      };
  return std::static_pointer_cast<RootShadowNode>(
      oldRootNode.cloneMultiple(families, callback));

```

</details>

I would like to add tests for it, but I'm not sure what's the best approach for that in the repo.

Reviewed By: mdvacca

Differential Revision: D75284060

Pulled By: javache

fbshipit-source-id: 0704c4386c3041eb368adf6950d46de197479058
2025-05-28 10:55:00 -07:00
Arthur KushkaandFacebook GitHub Bot 56c1ab3253 Revert D75478125: jsi | remove redundant semi colon
Differential Revision:
D75478125

Original commit changeset: d5a9db25ebee

Original Phabricator Diff: D75478125

fbshipit-source-id: a5d06fccfb955cbb598e20c96f607b95b26795d1
2025-05-28 06:26:09 -07:00
Samuel SuslaandFacebook GitHub Bot 7dda5512ff introduce opt out mechanism for View Culling (#51657)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51657

changelog: [internal]

Introduce a new ShadowNodeTraits: `Unstable_uncullableView` and `Unstable_uncullableTrace`. As the name suggests, this is not stable API yet.

When a shadow node sets this trait, it will be opted out of view culling together with its ancestors all the way to the root.

The trait is propagated to its parent in 4 different places:
1. When node is first created.
2. When node is cloned.
3. When child is appended.
4. When child is replaced.

we can safely do it only in those places because React constructs nodes from bottom up. We are leveraging this implementation detail here but if that changes in the future, a traversal will be required.

Alternative solution considered here was a traversal of shadow tree during commit phase to propagate `Unstable_uncullable` trait. This could be done in a separate traversal or as part of layout phase where layout information is copied out of Yoga tree. Leveraging the fact that React is cloning bottom up makes the implementation simpler.

If React changes its cloning approach in the future, this will be caught by tests.

Reviewed By: lenaic

Differential Revision: D75476847

fbshipit-source-id: f1e98804565c140c64945662af0247b1bd0e1882
2025-05-28 06:25:41 -07:00
Pieter De BaetsandFacebook GitHub Bot 618ed98882 Set default XMLHttpRequest trackingName to undefined (#51656)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51656

This fixes an issue with the internal networking layer when `enableModuleArgumentNSNullConversionIOS` is enabled, as we'd try to  pass `NSNull` as trackingName instead of omitting it.
`
Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D75516619

fbshipit-source-id: 91a3bba32772fdd66edde1e24b7edd977918f727
2025-05-28 05:41:51 -07:00
Samuel SuslaandFacebook GitHub Bot 66730ae59e Fix crash in view culling when view is unflattened/flattened in deep hierarchy where each node has top offset (#51639)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51639

changelog: [internal]

### Fix Crash in View Culling

This diff fixes a crash that occurs when a view is unflattened or flattened in a deep hierarchy where each node has a top offset.

The problem is that nodes passed to *calculateShadowViewMutationsFlattener* via argument *unvisitedOtherNodes* have their positions calculated in a different coordinate space and the view culling algorithm does not have the correct data to determine visibility of a node. To fix this, we pass another argument to *calculateShadowViewMutationsFlattener* which does have original view culling context with which these nodes had their position calculated.

Reviewed By: javache

Differential Revision: D75455704

fbshipit-source-id: 925f14dfdc6c2b669c89e100629291921f27cd1e
2025-05-28 05:16:26 -07:00
Nicola CortiandFacebook GitHub Bot a6f24a5eaa Cleanup custom LOG_TAG in our CMakeLists files. (#51622)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51622

We currently support an optional 3rd params for `target_compile_reactnative_options` which allows to specify a LOG_TAG macro.
No one is actually reading that Macro. The only usage would be logging from the Android SDK which we don't explicitely use.

Here I'm updating our build to specify a LOG_TAG as `ReactNative` for all the targets without allowing to customize it as it just complicates our build setup.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D75445577

fbshipit-source-id: a426ce77ba6d1dfd0800e874d9f7838bfdc5b877
2025-05-28 02:36:26 -07:00
Arthur KushkaandFacebook GitHub Bot 17f1d91893 jsi | remove redundant semi colon (#51651)
Summary:
X-link: https://github.com/facebook/hermes/pull/1714

X-link: https://github.com/facebook/hermes/pull/1715

Pull Request resolved: https://github.com/facebook/react-native/pull/51651

this breaks certain compilers/build setups in cpp

Reviewed By: NickGerleman

Differential Revision: D75478125

fbshipit-source-id: d5a9db25ebeecb229e157babf2117e8a2096e0d2
2025-05-28 02:33:18 -07:00
Ramanpreet NaraandFacebook GitHub Bot 19d7e40c97 Introduce featureflag for main queue coordinator
Summary:
Gating for "main queue coordinator": D74769326

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D74940621

fbshipit-source-id: e5b339bd13c2015432211380ecfce00791a27f9f
2025-05-28 00:25:46 -07:00
Ramanpreet NaraandFacebook GitHub Bot b8ce7b837f RuntimeExecutor: Create an ios fork of sync ui thread utils
Summary:
RuntimeExecutor.h has sync ui thread utils:
* executeSynchronouslyOnSameThread_CAN_DEADLOCK

The ios platform has js -> ui sync calls. This util, when it executes concurrently with those sync calls, deadlocks react native.

On ios, we're going to resolve these deadlocks, which'll involve customizing this util: D74769326. Therefore, this diff forks an implementation of these sync ui thread utils for ios.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D74901907

fbshipit-source-id: f502df4216e9ba57f458435c696a2f086becf24f
2025-05-28 00:25:46 -07:00
Nick LefeverandFacebook GitHub Bot 8f2e981ab7 Remove hard-coded component name listing for Props 2.0 support testing (#51633)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51633

To fully support props diffing for a component, the component's Props implementation needs to implement the prop diffing for the derived class.

Because all Props classes extend the ViewProps, all Props classes implement the `getDiffProps` function. To support testing that the props diffing implementation support all properties of the derived Props class for the component being mounted, this diff adds the virtual function `getDiffPropsImplementationTarget` which returns the `ComponentName` that the `getDiffProps` function supports.

This removes the need for a hard-coded list of components that support props diffing and enables the use of codegen to conditionally enable props diffing.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D75465020

fbshipit-source-id: 2850a76f1036cfe930c3c69b98d478ef86a2d457
2025-05-27 19:04:03 -07:00
David VaccaandFacebook GitHub Bot 3903ce0a48 Update format for codegen prop diffing (#51644)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51644

This diff updates the format for codegen prop diffing in Android

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D75476172

fbshipit-source-id: ec1c68ae1eb652fe9986386302969f9258983d39
2025-05-27 17:55:11 -07:00
David VaccaandFacebook GitHub Bot da5d15ba0e Add support to diff ImageSource props (#51643)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51643

Add support to diff ImageSource props

/react-native/ReactCommon/react/renderer/imagemanager/primitives.h

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D69497848

fbshipit-source-id: 56afe1d8601f7f4dc5dab815b6e534d7c63f651b
2025-05-27 17:55:11 -07:00
David VaccaandFacebook GitHub Bot ad0ea17ae9 Add support to diff Point props (#51650)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51650

This diff adds support to diff props with Point type

changelog: [internal] internal

Reviewed By: mlord93

Differential Revision: D75469451

fbshipit-source-id: a6844b691d8e32326d04c2bd51e6509980feb611
2025-05-27 17:55:11 -07:00
David VaccaandFacebook GitHub Bot 508610865b Assert ImageRequest is not used as a prop in codegen (#51642)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51642

This diff asserts that ImageRequest won't be used as prop type

changelog: [internal] internal

Reviewed By: mlord93

Differential Revision: D75469453

fbshipit-source-id: e9e46bc8806e00c104b76825445fe72779106220
2025-05-27 17:55:11 -07:00
David VaccaandFacebook GitHub Bot 20da141f5f Add support for diffing ColorPrimitive props (#51641)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51641

Add support for diffing ColorPrimitive props

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D69493546

fbshipit-source-id: 7ad6a28bd42014a771c168d8d6a6d2349629f670
2025-05-27 17:55:11 -07:00
David VaccaandFacebook GitHub Bot 26d40e40e1 Add support for diffing primitve type props (#51649)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51649

 Add support for diffing primitve type props

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D69491368

fbshipit-source-id: 2b882b349e9d1bd3a9012bae3c3e0a06be2fa0e3
2025-05-27 17:55:11 -07:00
David VaccaandFacebook GitHub Bot 2df200db3f Extend getDiffProps method to support no changes of props (#51646)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51646

Extend getDiffProps method to support no changes of props

changelog: [internal] internal

Reviewed By: lenaic

Differential Revision: D69487497

fbshipit-source-id: 2cb91f1cc6cba84100750ce5dda5824824c923fe
2025-05-27 17:55:11 -07:00
David VaccaandFacebook GitHub Bot 3609d070eb Extend getDiffProps method to call HostPlatformViewProps (#51638)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51638

Extend getDiffProps method to call HostPlatformViewProps

changelog: [internal] internal

Reviewed By: lenaic

Differential Revision: D69487495

fbshipit-source-id: 4d2b508f116ec0618b42981c0880361c3d8a871a
2025-05-27 17:55:11 -07:00
David VaccaandFacebook GitHub Bot 1a43fd7927 Prototype to create getDiff method using codegen (#51637)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51637

Start prototype to create getDiff method using js codegen

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D69487496

fbshipit-source-id: 1547a7302381333bf9b005153b44de5621bc56c4
2025-05-27 17:55:11 -07:00
Nick GerlemanandFacebook GitHub Bot 6e8ce60bd4 Implement ReactCompoundView for PreparedLayoutTextView (#51551)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51551

This allows hit RN's hit testing to find nested spans, and click them.

This mechanism is fully separate from the one used by a11y virtual views, and ClickableSpan, such as those added for links via dataDetectorType (and also the `link` role).

When we do have a link accessibilityRole, that ClickableSpan hit test seems to prevent the React one, and we only activate the onPress once (but then add keyboard interaction, press visual, and add to the a11y tree).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D75257326

fbshipit-source-id: 0c693f581ec121cf4b4e3e2040d141985118224f
2025-05-27 17:23:36 -07:00
Nick GerlemanandFacebook GitHub Bot 83226431c2 Remove ShadowNodeTraits::Trait::DirtyYogaNode (#51645)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51645

It's dead, Jim

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D75324251

fbshipit-source-id: 869e81f0ae0064629ddd84b939a1e492e6646365
2025-05-27 15:26:27 -07:00
Tim YungandFacebook GitHub Bot 2a13d20085 RN: Enable avoidStateUpdateInAnimatedPropsMemo by Default (#51635)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51635

Enables a feature flag by default, that reduces the memory usage of`Animated`. For more details, see: https://github.com/facebook/react-native/pull/49184

Changelog:
[General][Changed] - Enabled a feature flag that optimizes `Animated` to reduce memory usage.

Reviewed By: jehartzog

Differential Revision: D75466724

fbshipit-source-id: 3fdb57f394448bbd0530dcb558a58958010d0edd
2025-05-27 14:17:30 -07:00
Ramanpreet NaraandFacebook GitHub Bot 7ef278af50 RuntimeExecutor: Remove noexcept from sync ui thread utils (#51514)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51514

This util can execute arbitrary runtimeWork, which can throw.

In the future, we'll also make these utils execute ui blocks posted from the javascript thread. And those will be able to throw.

Therefore, let's remove the noexcept. Otherwise, if an exception bubbles up to this util, it will just crash this app.

Changelog: [General][Changed] - RuntimeExecutor:  Remove noexcept from sync ui thread utils

Reviewed By: javache

Differential Revision: D75183993

fbshipit-source-id: 6c3a319fe3a76165a265815e6343220cf9db6fde
2025-05-27 12:21:04 -07:00
Ramanpreet NaraandFacebook GitHub Bot 4974839be9 RuntimeExecutor: Use promises in sync ui thread utils (#51429)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51429

If we use promises, I believe the code is just easier to understand.

Changelog: [Internal]

Reviewed By: javache, yungsters

Differential Revision: D74941734

fbshipit-source-id: a9bc5ac715c84a5a92f8f1c6635ebef9fe538377
2025-05-27 12:21:04 -07:00
Nicola CortiandFacebook GitHub Bot 8a04ce6656 Migrate MapBuilder to Kotlin (#51626)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51626

This just migrates the `MapBuilder` file to Kotlin.
Users on Kotlin should still use the built-in collection extensions rather than using this class that will go away at some point in the future.

Changelog:
[Internal] [Changed] -

Reviewed By: fabriziocucci

Differential Revision: D75448739

fbshipit-source-id: 2bfa24ad9bd37bd571ea4551bd9a10e848841e0a
2025-05-27 12:09:16 -07:00
Rubén NorteandFacebook GitHub Bot 619f68b720 Do not log warning for missing feature flags native module in tests (#51629)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51629

Changelog: [internal]

The native module will never be defined in tests, so there's no point in logging this warning there.

Reviewed By: rshest

Differential Revision: D75451414

fbshipit-source-id: cdc1f674d01fcaf58c1c2342c994d95e6b3b6847
2025-05-27 11:37:43 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 254a918669 properly set dependencies on JSI and React-hermes (#51623)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51623

This fix relaxes some dependencies on React-hermes that should not be in the code.

## Changelog:
[Internal] - Remove dependencies from React-Hermes when they are not needed.

Reviewed By: cortinico

Differential Revision: D75447910

fbshipit-source-id: 6d7695f0e2b6c936b4c5ed9e70261f1d3b28a3d0
2025-05-27 10:22:08 -07:00
Nicola CortiandFacebook GitHub Bot 2578fd1356 Remove unnecessary OkHttpCompat (#51624)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51624

Let's remove this class and inline all the methods to the callsites.
This class was also public which would make this a breaking change but I couldn't find any meaningful usage:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.modules.network.OkHttpCompat

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D75448162

fbshipit-source-id: 9f4793809c9115a299ac72d79dbfb44073320d54
2025-05-27 09:51:24 -07:00
Nicola CortiandFacebook GitHub Bot 4487697971 Migrate OkHttpCompat to Kotlin (#51625)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51625

This just migrates this class to Kotlin, which is also the last class in this package.

Changelog:
[Internal] [Changed] -

Reviewed By: rshest

Differential Revision: D75448161

fbshipit-source-id: d5457dd8017fd459d166d2945ff440c303943db2
2025-05-27 09:51:24 -07:00
Mateo GuzmánandFacebook GitHub Bot 66aca66c88 Migrate ReactMarker to Kotlin (#51578)
Summary:
Migrate com.facebook.react.bridge.ReactMarker to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.bridge.ReactMarker to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/51578

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D75442661

Pulled By: javache

fbshipit-source-id: f05f54f0f68b5a7012312225c28484d57accecf8
2025-05-27 07:43:54 -07:00
Mateo GuzmánandFacebook GitHub Bot 9218d1ed89 Fix InputAccessoryView example in dark mode and convert to functional components (#51583)
Summary:
As I reviewed some examples, I noticed that this one's dark mode could be improved, and the code could be modernised a bit as well by converting its classes into functional components.

## Changelog:

[INTERNAL] - Fix InputAccessoryView example in dark mode and convert to functional components

Pull Request resolved: https://github.com/facebook/react-native/pull/51583

Test Plan:
<details>
<summary>Screenshots</summary>

| Dark | Light |
|--------|-------|
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2025-05-24 at 17 39 16](https://github.com/user-attachments/assets/3ed7cb53-89d4-440d-ac4f-50816527774e) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2025-05-24 at 17 39 35](https://github.com/user-attachments/assets/94592d35-859d-4666-a836-977903e955af) |
</details>

Reviewed By: fabriziocucci

Differential Revision: D75404561

Pulled By: cortinico

fbshipit-source-id: 3318e9869919e99055e47b59c89de0b22976f142
2025-05-27 06:44:54 -07:00
Mateo GuzmánandFacebook GitHub Bot c62d9527b4 Reland: Migrate PromiseImpl to Kotlin (#51273)
Summary:
Reland of https://github.com/facebook/react-native/pull/51241, which had to be reverted due to a crash.

Migrate com.facebook.react.bridge.PromiseImpl to Kotlin.

In this diff, nothing has changed yet as from the original PR. Awaiting for next steps to apply new changes https://github.com/facebook/react-native/pull/51241#issuecomment-2873363651

## Changelog:

[INTERNAL] - Migrate com.facebook.react.bridge.PromiseImpl to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/51273

Test Plan:
Tested on IGVR here:
https://www.internalfb.com/intern/px/p/7j3zC

Reviewed By: mdvacca, cortinico

Differential Revision: D74645262

Pulled By: javache

fbshipit-source-id: 9d9a439a2e5867a3c7a114cd34277cd59fec864c
2025-05-27 05:53:23 -07:00
Nicola CortiandFacebook GitHub Bot c059ae1b77 Correctly propagate RN_SERIALIZABLE_STATE to 3rd party CMake targets (#51619)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51619

RNTester Android is currently instacrashing in OSS due to 3rd-party packages not having the `RN_SERIALIZABLE_STATE` definition.
That's because the `INTERFACE` definition is not properly propagated on the prefab boundaries.

This was happening for `react-native-popup-menu-android` and `react-native-test-library` and will also happen for Codegen libraries.

This fixes it. 3p developers with custom CMake files will also have to use the `target_compile_reactnative_options` functions to make sure the compilation flag are properly populated.

Changelog:
[Android] [Breaking] - Correctly propagate RN_SERIALIZABLE_STATE to 3rd party CMake targets. Users with custom CMake and C++ code should update to use `target_compile_reactnative_options` inside their CMakeLists.txt files. See the 0.81 release notes for more information.

Reviewed By: cipolleschi

Differential Revision: D75441245

fbshipit-source-id: 3855fdf11cbe7f4b01f68e0dde68b63b3240ad35
2025-05-27 05:33:16 -07:00
Rubén NorteandFacebook GitHub Bot 017b2d0186 Clean up compatibility code for MutationObserver (#51309)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51309

Changelog: [internal]

Clean up old compatibility code for when NativeMutationObserver.unobserveAll isn't available.

Reviewed By: lenaic

Differential Revision: D74313204

fbshipit-source-id: ef057884236563cc9592c9954d4e3edd24df74eb
2025-05-27 05:05:26 -07:00
Samuel SuslaandFacebook GitHub Bot c59a532950 mark methods as const in nodes (#51617)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51617

changelog: [internal]

mark more methods as const and noexcept.

Reviewed By: mdvacca

Differential Revision: D75218535

fbshipit-source-id: 7ba5f2144e2db2fd1befbe28d807abd669188339
2025-05-27 04:25:24 -07:00
Samuel SuslaandFacebook GitHub Bot 8e8267de1b remove unused getter method from NativeAnimatedNodesManagerProvider (#51616)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51616

changelog: [internal]

doesn't seem to be used by anything. let's delete it.

Reviewed By: javache

Differential Revision: D75218695

fbshipit-source-id: eeb3a826f06456be8de6941fa95d6ffc7917dcf8
2025-05-27 04:25:24 -07:00
Samuel SuslaandFacebook GitHub Bot d7f94af5cb rename getters and mark them as const+noexcept in ValueAnimatedNode (#51615)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51615

changelog: [internal]

rename methods to reflect that they are getters and mark them as noexcept const

Reviewed By: rshest

Differential Revision: D75217535

fbshipit-source-id: c7d77060d0f54f8043a7552eec7e2b231cb5b7bf
2025-05-27 04:25:24 -07:00
Rubén NorteandFacebook GitHub Bot 77c860898e Fix missing willPerformAsynchronously parameter in calls to MountingCoordinator::pullTransaction (#51618)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51618

Changelog: [internal]

This sets the argument to `pullTransaction` to `true` in the cases where the call is done from the JS thread and the transactions are mounted asynchronously in the UI thread (basically platforms using the push model for mounting coordinator).

It was missing on an experiment for Android (compatibility mode for Props 2.0)

Reviewed By: lenaic

Differential Revision: D75439105

fbshipit-source-id: a106a3a674e44b0cf2603782302343f60ee5450e
2025-05-27 04:17:13 -07:00
React Native BotandFacebook GitHub Bot 6d7da0cc37 Add changelog for v0.80.0-rc.3 (#51608)
Summary:
Add Changelog for 0.80.0-rc.3

## Changelog:
[Internal] - Add Changelog for 0.80.0-rc.3

Pull Request resolved: https://github.com/facebook/react-native/pull/51608

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D75431114

Pulled By: fabriziocucci

fbshipit-source-id: 645a7d8f0a8db3e542726cb81ed0db93cd618ee5
2025-05-27 03:29:27 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 69826e1f11 Fix nightlies by backing out "[RN][iOS] Decouple Hermes from JSI nd simplify dependencies" (#51620)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51620

The spirit of "Decouple Hermes from JSI nd simplify dependencies" is good, but the problem is that when we ships prebuilds of hermes-engine, it tries to load `libjsi.dylib` and that library is not available.

{F1978594163}

I'll have to investigate more how to properly decouple Hermes prebuilds and how to pass jsi to Hermes and react-native. We might have to decouple it further and have a separate job that builds jsi and feed it to hermes.

This problem will go away with SwiftPM, though, so probably not worth solving this.

## Changelog:
[Internal] - Fix nightlies with a backout

Reviewed By: cortinico

Differential Revision: D75442056

fbshipit-source-id: f1085be8247c0974854254c6bd631ca258488beb
2025-05-27 03:10:40 -07:00
Dawid MałeckiandFacebook GitHub Bot 9cdd0db138 Remove JSEventLoopWatchdog from react-native package (#51614)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51614

`JSEventLoopWatchdog` is not used in react-native package. This diff moves it to rn-tester which previously deep imported it from react-native (which we want to avoid).

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D75410548

fbshipit-source-id: d4996742578e3b068e7acad9479394388b1907ac
2025-05-27 03:10:14 -07:00
Dawid MałeckiandFacebook GitHub Bot b34e56259a Remove TextAncestor import from rn-tester TextExample (#51603)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51603

In `rn-tester` TextAncestor was used to create a inlineView wrapper:

```js
function InlineView(props) {
  return (
    <TextAncestor.Provider value={false}>
      <View {...props} />
    </TextAncestor.Provider>
  );
}
```

however, it is already done in View.js and TextAncestor shouldn't be used outside of react-native package:

```js
 if (hasTextAncestor) {
    return <TextAncestor value={false}>{actualView}</TextAncestor>;
  }
  return actualView;
```

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D75408231

fbshipit-source-id: 7f12278296dcfe56246f6b7065f5a094e4099f7a
2025-05-27 01:21:17 -07:00
Jakub PiaseckiandFacebook GitHub Bot 9be5ac1010 Update types of Animated FlatList and SectionList (#51602)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51602

Changelog: [GENERAL][FIXED] - Fixed the generated type definitions for `Animated.FlatList` and `Animated.SectionList` to correctly infer item types.

Current definitions for animated list components cast away their generic definitions, preventing the types to be inferred from usage. This diff addresses that.

Reviewed By: huntie

Differential Revision: D75407762

fbshipit-source-id: c86f20298ded707971c05a78d025a63e82fe2a64
2025-05-26 23:55:12 -07:00
Samuel SuslaandFacebook GitHub Bot 6c053006b8 remove superclass enable_shared_from_this from AnimationDriver (#51611)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51611

changelog: [internal]

AnimationDriver does not use enable_shared_from_this, let's remove it. Also mark a few methods as noexcept and const.

This helps with C++ binary size.

Reviewed By: rshest

Differential Revision: D75172851

fbshipit-source-id: d6552cd577371a51c3fa3b394b451d7ed2b61e44
2025-05-26 15:03:56 -07:00
Samuel SuslaandFacebook GitHub Bot 5bbf7e60a9 remove uiManagerBinding_ member variable from NativeAnimatedNodesManagerProvider (#51610)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51610

changelog: [internal]

No need to store uiManagerBinding in a shared_ptr. Let's just get it, pass it to classes that need it and not store it.

This helps with C++ binary size a little bit.

Reviewed By: rshest

Differential Revision: D75174567

fbshipit-source-id: 1d4e5a9f89ba2f2d2eb733eac9d103ee97550d0f
2025-05-26 15:03:56 -07:00
Samuel SuslaandFacebook GitHub Bot 0c0d24080f Make NativeAnimatedNodesManagerProvider not virtual (#51609)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51609

changelog: [internal]

NativeAnimatedNodesManagerProvider is not subclassed. Let's remove virtual methods and make it a final class.

Reviewed By: lenaic

Differential Revision: D75169108

fbshipit-source-id: 32121cf372ba94c8a7b86c61fd96efd75560f789
2025-05-26 15:03:56 -07:00
Nick LefeverandFacebook GitHub Bot a314e34d6e Move Android ScrollView props to HostPlatformScrollViewProps (#51517)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51517

The Props 2.0 implementation for ScrollView added two missing props which were Android specific.

This diff moves these to a separate HostPlatformScrollViewProps class so that other platforms wouldn't include them

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D75183132

fbshipit-source-id: 44d0e0aa974e69f8584ad6bd681fad100c3493d8
2025-05-26 10:54:35 -07:00
Samuel SuslaandFacebook GitHub Bot 1da4abd273 use folly::dynamic without std::optional (#51605)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51605

changelog: [internal]

folly::dynamic can be constructed with nullptr and it creates a null folly::dynamic. Let's use that to indicate missing value instead of std::optional to lower C++ binary size.

Reviewed By: rshest

Differential Revision: D75174590

fbshipit-source-id: f2dfef00975686f6ac4c14b42539e700e967075b
2025-05-26 09:29:00 -07:00
Samuel SuslaandFacebook GitHub Bot 53b232fd5f remove enable_shared_from_this from AnimatedModule (#51606)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51606

changelog: [internal]

When native module is destroyed, ui queue is also torn down.

this helps with C++ binary size a little bit

Reviewed By: rshest

Differential Revision: D75149437

fbshipit-source-id: 1df061db26b4fb5026114e00bbc6846bf38d83a9
2025-05-26 09:29:00 -07:00
Samuel SuslaandFacebook GitHub Bot c653eea19d remove unimplemented methods (#51607)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51607

changelog: [internal]

remove methods that are not implemented yet.

Reviewed By: rshest

Differential Revision: D75148726

fbshipit-source-id: c01002050dc9c71df559e6f89b72aeee46e3a2f6
2025-05-26 09:29:00 -07:00
Dawid MałeckiandFacebook GitHub Bot 8a0cfec815 Remove infoLog invocations from react-native and rn-tester (#51600)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51600

The `infoLog` is a `console.log` wrapper to separate ad-hoc console debug logging, however console logs are already used in some files in rn-tester (ex. RNTesterAppShared.js). The same applies to files in react-native package.

Changelog:
[General][Changed] - Removed `infoLog` from react-native package

Reviewed By: huntie

Differential Revision: D75402930

fbshipit-source-id: 1a14a9122552130415f058d3647d715225321ab8
2025-05-26 08:19:05 -07:00
Nicola CortiandFacebook GitHub Bot 827a6851d0 Gradle to 8.14.1 (#51597)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51597

Bumping Gradle patch version to address this problem:
https://github.com/facebook/react-native/pull/50960#issuecomment-2906368364

Changelog:
[Android] [Changed] - Gradle to 8.14.1

Reviewed By: fabriziocucci

Differential Revision: D75401634

fbshipit-source-id: 07726f4d882a5f447cbaea11c4d159ef85fd7636
2025-05-26 07:04:40 -07:00
Ritesh ShuklaandFacebook GitHub Bot d06909142a Typo correction in RCTFollyConvert.h (#51592)
Summary:
Just a minor typo correction

## Changelog:
[IOS][CHANGED] Minor typo correction in RCTFollyConvert

Pull Request resolved: https://github.com/facebook/react-native/pull/51592

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D75389160

Pulled By: cipolleschi

fbshipit-source-id: 03764c82fa74c2b1b604db0d9dc4b0e1e364ac4a
2025-05-26 06:26:00 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 95304f7ac7 Decouple Hermes from JSI nd simplify dependencies (#51591)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51591

This change decouples Hermes from JSI and simplify the dependency graph.

Prior to this change, Hermes was building and providing JSI to React Native.
Hermes and React Native shares the same version of JSI, so that's was not a problem, but this choice added an unnecessary dependency on hermes-engine for some pods. For example, `React-utils` was depending on hermes, although it only needs JSI.

## Changelog:
[Internal] - Decouple hermes-engine from jsi

Reviewed By: cortinico

Differential Revision: D75374285

fbshipit-source-id: 3af6846032e81b6461420dd4f4a9c34b741f31ae
2025-05-26 06:24:15 -07:00
Mateo GuzmánandFacebook GitHub Bot c1731ecd27 Update iOS RNTester build artifacts in .gitignore (#51579)
Summary:
Running `yarn prepare-ios` creates some build artifacts folders, which can be added to the .gitignore as they are generated.

## Changelog:

[INTERNAL] - Update iOS RNTester build artifacts in .gitignore

Pull Request resolved: https://github.com/facebook/react-native/pull/51579

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D75389176

Pulled By: cipolleschi

fbshipit-source-id: ecb59051f5bb25b6be8fca9ac2ebf408adc5c7b7
2025-05-26 06:07:22 -07:00
Alex HuntandFacebook GitHub Bot c93036ce7d Annotate deprecated APIs (#51599)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51599

Adds `deprecated` to 2x API exports via `index.js.flow`. This will flag these APIs appropriately to the developer under TypeScript.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D75403796

fbshipit-source-id: 670c4bd0c262a58413e7703f09d6db2927d51408
2025-05-26 05:51:00 -07:00
Rob HoganandFacebook GitHub Bot 8ad43da3be Update Metro imports to use package root exports (#51261)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51261

Cleanup to use the new public type / API exports from `metro` landed in Metro 0.82.3, which is RN's minimum as of D74181990 / [PR](https://github.com/facebook/react-native/pull/51122), in preference to deep imports.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D74141939

fbshipit-source-id: 9405f88a85e248abe8a92be1dd5a5f1ea6ceeb87
2025-05-26 04:54:26 -07:00
Alex HuntandFacebook GitHub Bot 0e37db80f9 Delete accidentally committed helloworld test in Flow (#51598)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51598

Accidentally staged as part of D75060846. `App.test.tsx` remains.

Fixes CI.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D75402566

fbshipit-source-id: 6f698cfcd4f342591f81c308b2353e7637842e7d
2025-05-26 04:08:23 -07:00
Rob HoganandFacebook GitHub Bot a3447d6b8b community-cli-plugin: Refactor CLI build command to use Metro.runBuild (#51124)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51124

Metro 0.82.3's `runBuild` API now supports retrieving assets and passing through `unstable_transformProfile`, and fine control of output paths via `bundleOut`/`sourcemapOut`, so we can use it directly in the implementation of `community-cli-plugin`'s `bundle` command with no loss of function or API change.

This simplifies the implementation by re-using Metro's, and removes use of Metro internal APIs.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D74151840

fbshipit-source-id: 3dcadaf8d38e7e77d21bacdf29e5d40467139d88
2025-05-26 03:45:58 -07:00
Dawid MałeckiandFacebook GitHub Bot 7af8c01f46 Disable deep import warning on rn-tester package (#51565)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51565

This diff silence deep import warnings globally for rn-tester package.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D75291027

fbshipit-source-id: 7b4b2fe46a5c992a420b21f09a72f17944c54f6d
2025-05-26 02:53:24 -07:00
Dawid MałeckiandFacebook GitHub Bot d8dc2d255a Remove prepare-flow-api-translator from build-types script and all experimental references (#51497)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51497

It removes `prepare-flow-api-translator` which is no longer needed as `flow-api-translator` version was bumped already and it blocks `build-types` script from running on CI (due to reference to `flow-api-translator` source). It also removes "Experimental" annotations.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D75138541

fbshipit-source-id: 897009c91adeeeaae21603dbf90020b52b61c5d5
2025-05-26 01:45:05 -07:00
Sam ZhouandFacebook GitHub Bot 5dbe32ee14 Deploy 0.272.1 to xplat (#51584)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51584

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D75356543

fbshipit-source-id: 29234de4f1b6ee2b8857b24a5de566a4afd31030
2025-05-25 08:36:30 -07:00
Samuel SuslaandFacebook GitHub Bot bf974e8de1 remove enable_shared_from_this from NativeAnimatedNodesManager (#51589)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51589

changelog: [internal]

With D75140890, there is a guarantee that `startOnRenderCallback_` won't be called after the owning class is destroyed.

There shouldn't be any events flowing through Fabric when the RN instance is torn down. Passing this to eventEmitterListener_ should be safe.

This helps with C++ binary size a little bit.

Reviewed By: rshest

Differential Revision: D75148616

fbshipit-source-id: 5110736c2ddcff738fce395bd0b9844d44e8dcb2
2025-05-25 04:20:59 -07:00
Samuel SuslaandFacebook GitHub Bot 44ebf31f3b remove use of shared_ptr from AnimatedNode (#51588)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51588

changelog: [internal]

AnimatedNode never outlive NativeAnimatedNodesManager. We can safely use raw pointer here instead of shared_ptr.

This improves a C++ binary size a little bit.

Reviewed By: rshest

Differential Revision: D75148487

fbshipit-source-id: 4c2f6dc6e4de670be37dd3b65dc3a8d63d546150
2025-05-25 04:20:59 -07:00
Samuel SuslaandFacebook GitHub Bot 1db4874bb3 Use unique_ptr instead of shared_ptr in activeAnimations_ (#51587)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51587

changelog: [internal]

use unique_ptr instead of shared_ptr to manage memory of activeAnimations_.

Active animations are only owned by NativeAnimatedNodesManager and their ownership isn't shared with any other class.

This saves a little bit of C++ binary size.

Reviewed By: rshest

Differential Revision: D75142643

fbshipit-source-id: c09753b68e70e95fedcb7b2b8fb19a0fd7010059
2025-05-25 04:20:59 -07:00
Samuel SuslaandFacebook GitHub Bot 1e31392211 remove use of shared_ptr from NativeAnimatedNodesManager::animatedNodes_ and NodesQueueItem (#51586)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51586

changelog: [internal]

using shared_ptr here is not necessary because AnimatedNodes are not shared between multiple entities, they are only owned by NativeAnimatedNodesManager.

This saves a little bit C++ binary size.

Reviewed By: rshest

Differential Revision: D75148952

fbshipit-source-id: 18b8231061cda970ad96842ee6ca3135c2ec5d68
2025-05-24 16:05:01 -07:00
Samuel SuslaandFacebook GitHub Bot afb543683c introduce a way to inspect shadow node revision in Fantom (#51566)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51566

changelog: [internal]

Expose [revision](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/renderer/core/ShadowNode.h#L229) of shadow node in Fantom tests. This makes it possible to write tests verifying that shadow nodes are only cloned when they should.

Even though excessive cloning does not usually lead to bugs, it may lead to performance problems.

Also introduce a test showing a performance problem where changing height of "Sibling" view from 1 to 2 will lead to component `D` being cloned by Yoga. Component D is not affected by the size change of Sibling and the clone is unnecessary.

```jsx
<ScrollView>
  <View id="Sibling" style={{ height: 1 }} />
  <View id="A">
    <View id="B">
      <View id="C">
        <View id="D" ref={ref} />
      </View>
    </View>
  </View>
</ScrollView>
```

Reviewed By: rshest

Differential Revision: D75287261

fbshipit-source-id: ea5acb2f5d7ba6e1e5bf895d8f82a16471122ec5
2025-05-24 15:44:11 -07:00
Pieter De BaetsandFacebook GitHub Bot ca5f4d1721 Disable enableModuleArgumentNSNullConversionIOS by default (#51576)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51576

This is causing some internal test failures for now, so disabling the behaviour to prevent further rollout.

Changelog: [iOS][Removed] Disable fix for #51103 until more testing can be done.

Differential Revision: D75320842

fbshipit-source-id: 39c115afd11e5b1aca6cdc1fc18ec7e83eb10382
2025-05-23 16:05:44 -07:00
Soe LynnandFacebook GitHub Bot b6292d2646 Remove static from the local scoped variable for getConstants - part 2 (#51573)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51573

Changelog: [Internal]

Remove unnecessary `static` in a local scoped variable.

Reviewed By: RSNara

Differential Revision: D75306776

fbshipit-source-id: 52decae228c65ea993bd5fde0be66ab094c8fcf1
2025-05-23 12:02:11 -07:00
Vitali ZaidmanandFacebook GitHub Bot e04ab60784 Update debugger-frontend from 7e19a54...343405b
Summary:
Changelog: [Internal] - Update `react-native/debugger-frontend` from 7e19a54...343405b

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/7e19a540aa1b4a2000ba94ba767a1d9dac5947e9...343405ba784fca9290486cbce57e7f2ca953dc14).

Reviewed By: huntie

Differential Revision: D75298472

fbshipit-source-id: 13fd990669eaa37b96f770193640417de3cddd08
2025-05-23 11:51:42 -07:00
Vitali ZaidmanandFacebook GitHub Bot e757c09b96 fixed typo in UNREGISTERED_DEVICE error (#51561)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51561

Changelog: [Internal] fix typo in InspectorProxy

Reviewed By: huntie

Differential Revision: D75217049

fbshipit-source-id: 2473ddf4a120175305b195ed78704e734554b423
2025-05-23 11:51:42 -07:00
Rob HoganandFacebook GitHub Bot fa79fd8f96 Bump Metro to 0.82.4 (#51567)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51567

Bump Metro minimum from 0.82.3 to 0.82.4

Release notes: https://github.com/facebook/metro/releases/tag/v0.82.4

Changelog: [General][Changed] Bump Metro to ^0.82.4

Reviewed By: vzaidman

Differential Revision: D75294674

fbshipit-source-id: 750e83db2fb5cd9a6bf4b1971cb701ac23dfa961
2025-05-23 10:53:17 -07:00
Joe VilchesandFacebook GitHub Bot d87790846b Fixup focusability logic of PreparedLayoutTextView (#51508)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51508

For now, we are opting to not auto-focus `PreparedLayoutTextViews` if they have links. The reason being this would not work well with Text nested in a View which is also accessible. If that Text had links, and was set to focusable, then TalkBack would individually focus that Text, which users may not want.

So this diff removes that link detection, and fixes up accessibility in general. Since this isn't a TextView, we need to explicitly set the `text` on the `AccessibilityNodeInfo` object in the delegate so TalkBack know what to annouce.

In the future we aim to bring back auto-focusing with links, but only if a screen reader is not on, so that keyboard users can benefit from this.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D75103779

fbshipit-source-id: 05e17f4eb8d5d79ed1d84458f6d5fc6d1571e382
2025-05-23 10:42:37 -07:00
Samuel SuslaandFacebook GitHub Bot 0f73a7ac28 Mark methods in NativeAnimatedNodesManager as noexcept (#51557)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51557

changelog: [internal]

use noexcept in NativeAnimatedNodesManager whenever feasible to lower C++ binary size.

Reviewed By: rshest

Differential Revision: D75149555

fbshipit-source-id: 03838c048d78bcfd9ad563c71a9a7a1f3c5cd2e3
2025-05-23 08:46:39 -07:00
Samuel SuslaandFacebook GitHub Bot e657862709 Do not throw error in PropsAnimatedNode (#51563)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51563

changelog: [internal]

Throwing errors in C++ is expensive and slow. Let's replace it with logging.

This is to reduce binary size of C++ Animated.

Reviewed By: mdvacca

Differential Revision: D75140875

fbshipit-source-id: 32909572141d8e1b51b60f317716f783aa760265
2025-05-23 07:10:56 -07:00
Pieter De BaetsandFacebook GitHub Bot ae4eac1eb6 RCTTurboModule nits (#51499)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51499

Small nits as follow-up to D74208525

 Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D75141440

fbshipit-source-id: 466ee3573c4afe88878f306d902c5aa82df2a3f3
2025-05-23 06:39:41 -07:00
zhongwuzwandFacebook GitHub Bot 4a4fd1cb8b Turbo module: Fixes dictionary stripped out when value is null (#51103)
Summary:
Fixes https://github.com/facebook/react-native/issues/51083. Turbo stripped out the dictionary when the value is null. The old architecture transforms null to NSNull. The null seems useful in cases like #51803 for removing the storage of the key. cipolleschi can you please help to review?

## Changelog:

[IOS] [FIXED] - Turbo module: Fixes dictionary stripped out when value is null

Pull Request resolved: https://github.com/facebook/react-native/pull/51103

Test Plan: Repro please see https://github.com/facebook/react-native/issues/51083.

Reviewed By: rshest

Differential Revision: D74208525

Pulled By: javache

fbshipit-source-id: 53d630c265fba15d25309a3e1deb19dca24f298c
2025-05-23 06:39:41 -07:00
Samuel SuslaandFacebook GitHub Bot 6ff500d694 Stop render callback on destruction to prevent crash (#51558)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51558

changelog: [internal]

we must call stopRenderCallbackIfNeeded to prevent UI tick from being called when
`NativeAnimatedNodesManager` is deallocated.

Reviewed By: mdvacca

Differential Revision: D75140890

fbshipit-source-id: 9ad32956a877f9ee8256790ba32cb5982a5b0c2f
2025-05-23 05:51:26 -07:00
Ruslan LesiutinandFacebook GitHub Bot a633d93f7f Define sampling methods implementations for Hermes fallback target delegate (#51519)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51519

# Changelog: [Internal]

Hermes Sampling Profiler doesn't require debugger to be enabled - we can use it in fallback Hermes Runtime target delegate. That's probably the last thing to make Hermes really run in `opt` mode.

When Hermes Target is compiled with no Debugger support, we can still define implementation for sampling profiler methods and call them on Hermes Runtime.

Reviewed By: huntie

Differential Revision: D75188276

fbshipit-source-id: e3e0dccd09e0870264e8abc65f96052735d63ad8
2025-05-23 05:33:38 -07:00
Alex HuntandFacebook GitHub Bot 38acb4c074 Remove flow libdefs from npm package (#51556)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51556

Excludes `packages/react-native/flow/` from being published to npm.

**As far as I know**, we already axed open source Flow support with a similar change in D46313482 (Jun 2023).

Changelog:
[General][Breaking] - The `react-native` package no longer ships with the `flow` directory

Reviewed By: cipolleschi

Differential Revision: D75060845

fbshipit-source-id: 3cb81820499383bf095abc97a9ab7e9061c870d6
2025-05-23 04:29:05 -07:00
Rubén NorteandFacebook GitHub Bot a573049c0a Improve support for multi-config benchmarks (#51559)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51559

Changelog: [internal]

Improves the support for multi-config benchmarks in Fantom by printing the Fantom configuration summary in the header of the table with the benchmark results for each variant.

Reviewed By: rshest

Differential Revision: D75281972

fbshipit-source-id: 80caf2e668a30ea1454cb932e91dac91192323bf
2025-05-23 04:24:44 -07:00
Rubén NorteandFacebook GitHub Bot 0ff4566ac7 Enable multi-config in IntersectionObserver-itest (#51541)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51541

Changelog: [internal]

Now that we have support for tests with multiple configurations in Fantom, we can configure the test for IntersectionObserver to run with all the flag configurations that affect its behavior, and make sure it doesn't break for anyone while we're rolling out the changes.

Reviewed By: rshest

Differential Revision: D75231300

fbshipit-source-id: e7addf51cffad8c94bb3bf34e99272ee1dd9da2a
2025-05-23 04:24:44 -07:00
Rubén NorteandFacebook GitHub Bot 936666d3b4 Migrate ReactFabricPublicInstance tests to a single multi-config test (#51543)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51543

Changelog: [internal]

For `ReactFabricPublicInstance-itest` we used a specific pattern to be able to run the same test with different feature flags (having multiple entrypoints with the configuration and a single implementation file). We can simplify this now that we have support for multiple configurations per test file in Fantom.

Reviewed By: rshest

Differential Revision: D75231301

fbshipit-source-id: ffd047b23217c06b1b15ba07da8b5c191cc652e7
2025-05-23 04:24:44 -07:00
Rubén NorteandFacebook GitHub Bot cc9be3048a Add support multi-config test runs (#51542)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51542

Changelog: [internal]

This adds support for Fantom to run specific test suites with different combinations of options/flags, using wildcards as values.

See the new documentation for this feature in this diff for more details.

Reviewed By: rshest

Differential Revision: D75231299

fbshipit-source-id: 0e953e6de68f004944ee29206af49770c8b7dd9b
2025-05-23 04:24:44 -07:00
Rubén NorteandFacebook GitHub Bot 9d58eb5719 Display Fantom test configuration in test output (#51528)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51528

Changelog: [internal]

This adds some logic to the Fantom runner to display the test configuration with the test results.

Reviewed By: lenaic

Differential Revision: D75063176

fbshipit-source-id: 8371e90247c1a0c24f29a13ead25fa5dbf98ec10
2025-05-23 04:24:44 -07:00
Christian FalchandFacebook GitHub Bot 592b09781b added missing search path to reactPerfLogger (#51555)
Summary:
ReactPerfLogger target now has an include file that wasn't in the search path.

This commit fixes this by adding "ReactCommon" as search path to the target.

## Changelog:

[IOS] [FIXED] - Added missing search path to swift package

Pull Request resolved: https://github.com/facebook/react-native/pull/51555

Test Plan: No tests yet.

Reviewed By: cortinico

Differential Revision: D75279320

Pulled By: rshest

fbshipit-source-id: b4d217bdcdb45d4b2decee0aeee155b829cdec9d
2025-05-23 03:22:39 -07:00
Wojciech LewickiandFacebook GitHub Bot 90da666691 fix: call delete instead of free in imagefetcher (#51492)
Summary:
I've been digging into memleaks in RN for some time and noticed that instances of `FabricUIManager` are leaking on reload action even on an empty app. I managed to pinpoint it to [ContextContainer](https://github.com/facebook/react-native/blob/36df97f500aa0aa8031098caf7526db358b6ddc1/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp#L522) (which holds `FabricUIManager` on the cpp side) not being deallocated after reload. After much much digging (since contextContainer is passed around in many places) I found that destructor of `ImageFetcher` never runs on reload, and its instance holds `contextContainer`. It turns out that `ImageManager`, which holds `ImageFetcher`, was calling `free` instead of `delete` and the former does not call destructor. After applying it, `contextContainer` does not leak making `FabricUIManager` instances not to leak too 🎉.

## Changelog:

[ANDROID] [FIXED] - Change `free` to `delete` to call destructor of `ImageFetcher` and release `contextContainer`.

Pull Request resolved: https://github.com/facebook/react-native/pull/51492

Test Plan: Run empty RN app in AS, do reload multiple times and see in AS profiler that instances of `FabricUIManager` are kept in memory without this change.

Reviewed By: Abbondanzo

Differential Revision: D75141983

Pulled By: javache

fbshipit-source-id: f13eea96cb7b614c1d6b53184498ef6294614986
2025-05-23 02:38:54 -07:00
Tomek ZawadzkiandFacebook GitHub Bot 2da4a6059a Apply baseline offset separately for each line of text on iOS (#51344)
Summary:
This PR removes extraneous blank space at the bottom of multiline `TextInput` when using nested `Text` with different font sizes on iOS with the New Architecture enabled.

| Before | After |
|:-:|:-:|
| <img width="283" alt="Screenshot 2025-05-15 at 12 16 05" src="https://github.com/user-attachments/assets/47256267-86ff-45f9-9e60-162d444a4b9d" /> | <img width="286" alt="Screenshot 2025-05-15 at 12 01 32" src="https://github.com/user-attachments/assets/43ce4b0b-6410-4ca5-be37-59c6374ea15c" /> |

The proposed solution is to call `RCTApplyBaselineOffset` separately for each line of text.

Ideally, we would call it separately for each part of text with different font size.

## Changelog:

[IOS] [FIXED] - Fixed blank space at the bottom of multiline TextInput on iOS

Pull Request resolved: https://github.com/facebook/react-native/pull/51344

Test Plan:
```tsx
<TextInput
  multiline
  style={{borderWidth: 1, width: 300, fontSize: 20}}
  ref={ref}
  placeholder="Type here...">
  First line{'\n'}
  <Text style={{fontSize: 30, lineHeight: 60}}>Second line</Text>
  {'\n'}Third line{'\n'}Fourth line
  {'\n'}
  Fifth line
</TextInput>
```

Reviewed By: NickGerleman

Differential Revision: D74802648

Pulled By: j-piasecki

fbshipit-source-id: 30f02ae8af66264c1776d241ed8542899e9cdf99
2025-05-22 23:02:34 -07:00
Luna WeiandFacebook GitHub Bot 139f3d5ef9 Clean up double render flag (#51552)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51552

Changelog: [Internal] - Clean up double state render experiment

Reviewed By: yungsters

Differential Revision: D75248135

fbshipit-source-id: 360c7918ae7b7e7f3ddd76a58d54daf31e4b122a
2025-05-22 21:43:22 -07:00
Tim YungandFacebook GitHub Bot 1977dd6596 RN: Sort Pragmas in Headers (#51554)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51554

Sorts pragma directives file headers in React Native.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75264593

fbshipit-source-id: 9e4b253dd0fc94dc2fc469d7114b93a8aae305f4
2025-05-22 21:18:53 -07:00
Tim YungandFacebook GitHub Bot 5a4be31a6a RN: Fix Extraneous & Erroneous Pragma in Headers (#51553)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51553

Fixes extraneous and erroneous pragma in file headers in React Native.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75264384

fbshipit-source-id: b104c48dae09d6afbbb51450618c917be0df9e38
2025-05-22 21:18:53 -07:00
Nick GerlemanandFacebook GitHub Bot b70c73d8f7 Fix missing height constraints when creating Fabric layout for adjustsFontSizeToFit (#51550)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51550

`adjustsFontSizeToFit` will adjust font size so that given text fits in both veritcal and horizontal bounds. The algorithm to mutate text to fit is executed during TextLayoutManager during layout creation for Fabric, and then re-executed in `TextView.onDraw()`. See D56134348 which introduced the logic.

In Facsimile, we were not seeing font size adjusted when text is too tall. This is because we are only incorporating the height constraint during Spannable mutation during draw, but not the original layout, which Facsimile uses directly.

This could potentially fix other bugs, where width may not corredpond to the final font size we settle on during drawing.

Changelog:
[Android][Fixed] - Fix missing height constraints when creating Fabric layout for `adjustsFontSizeToFit`

Reviewed By: mdvacca

Differential Revision: D75251391

fbshipit-source-id: 77d90c49d48911e63131f9f088cfce13946c67d6
2025-05-22 17:42:29 -07:00
Peter AbbondanzoandFacebook GitHub Bot 1040cd62b6 Remove unused constructor (#51546)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51546

A bit of housekeeping: this constructor is deprecated and unused as the class is internal

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D75233988

fbshipit-source-id: 8272ef4a9465c447d04b377b42071f9834092709
2025-05-22 14:57:06 -07:00
Alex Taylor (alta)andFacebook GitHub Bot 535444bca4 Deploy 0.272.0 to xplat (#51536)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51536

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D75228208

fbshipit-source-id: ad6666deedd976b02e8e0e475831df27b3a63984
2025-05-22 13:22:01 -07:00
David VaccaandFacebook GitHub Bot f4cea64ff0 Update documentation for DebugCorePackage (#51501)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51501

Update documentation for DebugCorePackage

changelog: [internal] internal

Reviewed By: javache, arushikesarwani94

Differential Revision: D75113218

fbshipit-source-id: e02e5385b42453623369a52f788c0225d644625f
2025-05-22 12:46:43 -07:00
David VaccaandFacebook GitHub Bot 95d6b03b61 Avoid reflection call to ReactInstanceManager.handleCxxError when MINIFY_LEGACY_ARCHITECTURE is enabled (#51484)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51484

In this diff I'm avoiding a reflection call to ReactInstanceManager.handleCxxError when MINIFY_LEGACY_ARCHITECTURE is enabled, to help proguard to compile-out this method when MINIFY_LEGACY_ARCHITECTURE is enabled

changelog: [internal] internal

Reviewed By: mlord93

Differential Revision: D75085524

fbshipit-source-id: c80246fdb5940c549cc1d310f7ad042cc0482f0f
2025-05-22 12:46:43 -07:00
Nick LefeverandFacebook GitHub Bot 86ffa88bbd Add missing dependency to CMakeLists for mounting (#51540)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51540

The view culling `CullingContext` depends on the ScrollView component. This adds the dependency to the mounting target in CMakeLists

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D75233669

fbshipit-source-id: 8342ed791082174ac6d5c6f21270b0cd0adcc95f
2025-05-22 12:27:51 -07:00
Panos VekrisandFacebook GitHub Bot 206cdc1f05 enable natural inference in xplat/js (#51538)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51538

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D75196563

fbshipit-source-id: 1039e2234cb4f7ca81fef28bb1acbf4c6bd7e7d9
2025-05-22 11:50:16 -07:00
Panos VekrisandFacebook GitHub Bot ff9d33073d unbreak flow trunk (#51544)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51544

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D75235560

fbshipit-source-id: 7767aa3a9cabc6174d778f437bc31624224a530e
2025-05-22 11:29:22 -07:00
Alex HuntandFacebook GitHub Bot 44e36e6d9f Consolidate location for Flow libdefs (#51539)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51539

Follow up to D70322032. Relocates some of our newly added Flow library definitions into the package level `flow/` directory, to help disambiguate their use.

**Types directories after changes**

`packages/react-native/`

- `flow/` — Longstanding location for Flow package/global library definitions. Not imported by source code.
- `src/types/` — Contains public typedefs useful to 3P consumers (TypeScript) (today, just `globals.d.ts` as one module). Not imported by source code.
- `src/private/types/` — Source type modules **in Flow**, that **are imported** by other files in `src/private/`.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D75060846

fbshipit-source-id: 750a31e11b8f65579ce0831273df4d3b86335bdc
2025-05-22 10:34:04 -07:00
Ruslan LesiutinandFacebook GitHub Bot 3dc58f04dd Remove JSExecutor::performanceNow() (#51513)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51513

Pull Request resolved: https://github.com/facebook/react-native/pull/51481

# Changelog: [Internal]

This is replaced by `HighResTimeStamp::now()`, which is available in a dedicated smal `react/timing` module.

Reviewed By: lenaic

Differential Revision: D75185783

fbshipit-source-id: 2eb37ce25ca319f3c37def43de4e1db89e0f5be9
2025-05-22 10:16:45 -07:00
Ruslan LesiutinandFacebook GitHub Bot f03268b896 Replace DOMHighResTimeStamp alias in ReactCommon with new abstractions (#51512)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51512

Pull Request resolved: https://github.com/facebook/react-native/pull/50585

# Changelog: [Internal]

Replaces `DOMHighResTimeStamp` alias completely in `ReactCommon` with `HighResTimeStamp`.

`DOMHighResTimeStamp` as a type is now expected to be used only in JavaScript.

I didn't update places where we explcitly use `std::chrono::high_resolution_clock`, since it is platform-specific and there is no guarantee that `std::chrono::high_resolution_clock` == `std::chrono::steady_clock`.

Also, places that are isolated and not part of the Web Performance APIs, such as Telemetry for Fabric, are not updates as part of this diff. Although these subsystems are also using `std::chrono::steady_clock` as a low-level representation, they are not sharing it with other parts of the React Native core.

Reviewed By: rubennorte

Differential Revision: D75185613

fbshipit-source-id: 889719368de163e6f529689df6cc16d816fde66c
2025-05-22 10:16:45 -07:00
Ruslan LesiutinandFacebook GitHub Bot aa7202861f Use HighResTimeStamp (#51511)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51511

# Changelog: [Internal]

There are multiple changes:
1. `PerformanceTracer` class, `TraceEvent` struct are moved to `tracing` namespace. These are parts of the Tracing subsystems of the jsinspector, this should bring more clarity and make things more explicit.
2. Added `Timing.h` class which defines conversion logic from `HighResTimeStamp` to absolute units that are expected by CDP.
3. `PerformanceTracer` will receive timestamps for Performance Web API entries in `HighResTimeStamp`.

Also, we will explicilty define a Tracking Clock time origin that will be epoch of the `steady_clock`. This aligns with the approach in Chromium and saves us from aligning custom DOMHighResTimeStamps that can be specified in performance.mark / performance.measure calls: these should not extend the timeline window. I've confirmed that this is the current behavior in Chromium.

Reviewed By: rubennorte, huntie

Differential Revision: D75185467

fbshipit-source-id: 37444392f12e8c9c4479c47c42b2c4badca7ecfd
2025-05-22 10:16:45 -07:00
Riccardo CipolleschiandFacebook GitHub Bot cd01ecbb6a Rename RNDEP_VERSION to RN_DEP_VERSION (#51537)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51537

To adhere more closely to our conventions, this change renames `RNDEP_VERSION` to `RN_DEP_VERSION`

## Changelog:
[Internal] -

Reviewed By: cortinico

Differential Revision: D75223248

fbshipit-source-id: 7ba44d7b358981bfbabe71c9876e3c865bdf9f50
2025-05-22 10:06:14 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 66ec4b3778 Add documentation to the SwiftPM structure (#51532)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51532

This change adds documentation to the SwiftPM structure to simplify changing it, especially if we have to port some changes from the cocoapods infra to the Swift PM implementation.

## Changelog:
[Internal] - Add docs

Reviewed By: cortinico

Differential Revision: D75217331

fbshipit-source-id: 153e87883d10ceed5a899c9a7dc362b4d2b7e510
2025-05-22 10:06:14 -07:00
Christian FalchandFacebook GitHub Bot 1477cc0dbd simplify logging in prebuild scripts (#51527)
Summary:
To reduce reduntant code by repeating the logging functionality in each JS module, this commit introduces a factory for creating a logger with a given prefix.

- Create factory `createLogger`
- Remove redundant log implementations
- Changed to use factory in hermes.js and ios-prebuild.js

bypass-github-export-checks

## Changelog:

[IOS] [CHANGED] - simplified logging in prebuild scripts

Pull Request resolved: https://github.com/facebook/react-native/pull/51527

Test Plan: No tests so far.

Reviewed By: cortinico

Differential Revision: D75213656

Pulled By: cipolleschi

fbshipit-source-id: 8403cfb8ed76ca3a30cfaaeabcd61ac790e7f0a1
2025-05-22 10:06:14 -07:00
Alex HuntandFacebook GitHub Bot c937439e87 Add a basic Jest test to helloworld (#51534)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51534

Aims to give us CI coverage of React Native's Jest preset, preventing future bugs like https://github.com/facebook/react-native/pull/51525.

Changes:
- Add a basic "it renders" Jest test to helloworld
- Add "Run Helloworld tests" step to `test-ios-helloworld` job in CI
- Also convert helloworld's `App.tsx` to TypeScript, as easiest way to unblock Jest JSX behaviour.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D75218901

fbshipit-source-id: 601155c59c4483696971df4c29d51549d97f49f2
2025-05-22 09:44:15 -07:00
Alex HuntandFacebook GitHub Bot 0acd0828aa Delete helloworld CLI tests (#51533)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51533

Motivation:

- These fail, when ran from `packages/helloworld/` with the available `jest.config.js` file.
- These aren't currently run in CI.
- Don't seem high value (only covers `set-version` behaviour).

In the next diff, I will be adding a missing basic ReactTestRenderer test.

{F1978505710}

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D75218694

fbshipit-source-id: b22f725aeea49deac069a3268bcf30d4981d44b6
2025-05-22 09:44:15 -07:00
Nick LefeverandFacebook GitHub Bot 7674cd25a7 Add tests for @fantom_hermes_variant (#51457)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51457

See title

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D74999954

fbshipit-source-id: bd140b2df71477e2966406ed612a00ff3ea6de8b
2025-05-22 08:52:09 -07:00
Zeya PengandFacebook GitHub Bot cb02744fa8 Move c++ native animated code to github (#51509)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51509

## Changelog:

[Internal] [Added] - Move c++ native animated code to github

⚠️ Note that this is not buildable in OSS yet ⚠️

Reviewed By: sammy-SC, rshest

Differential Revision: D75169430

fbshipit-source-id: 499ce209f815474f12007c3c74f81fe0c9ad3f86
2025-05-22 08:28:29 -07:00
louixandFacebook GitHub Bot 9b1a8ffac4 Implement size for URLSearchParams (#51507)
Summary:
The current `URLSearchParams` is missing the readonly `size` property defined in the [whatwg spec](https://url.spec.whatwg.org/#interface-urlsearchparams), and attempting to use it returns `undefined`. This PR adds it.

## Changelog:
[GENERAL] [FIXED] - Added size property to URLSearchParams implementation
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/51507

Test Plan: I've modified the [tests](packages/react-native/Libraries/Blob/__tests__/URL-test.js) to assert the `size` property is correct.

Reviewed By: cipolleschi

Differential Revision: D75205273

Pulled By: rshest

fbshipit-source-id: 4b773dfc95693a5e084663258de50d161d6facff
2025-05-22 07:57:57 -07:00
Oskar KwaśniewskiandFacebook GitHub Bot 50ec74e2d5 fix(iOS): use getNextRootViewTag() on new architecture (#51522)
Summary:
Sometime ago Fabric specific root view tag allocator was added to the codebase: https://github.com/facebook/react-native/commit/7dec625ecabdc23cbae37e0034d29bb7bff17755 This PR makes sure to use it on iOS. It removes the need for additional conversions.

## Changelog:

[INTERNAL] [CHANGED] -  use getNextRootViewTag() on new architecture

Pull Request resolved: https://github.com/facebook/react-native/pull/51522

Test Plan: CI Green

Reviewed By: javache

Differential Revision: D75204499

Pulled By: rshest

fbshipit-source-id: 12927887ae229c9fe89fa680f2bd55b5e378f9ae
2025-05-22 07:50:24 -07:00
Andrew CoatesandFacebook GitHub Bot d42d46306a Allow platforms to provide custom IsColorMeaningful implementation (#51478)
Summary:
On windows, not all PlatformColors are convertible directly into colorComponents.  For PlatformColors, the Color.isColorMeaningful may need to do something other than check the alpha component of the color.

Here I'm moving the implementation of isColorMeaningful into the HostPlatformColor implemantion to allow the host platform to customize the implemenation of isColorMeaningful.

## Changelog:

[INTERNAL] [ADDED] - Allow platforms to override isColorMeaningful

Pull Request resolved: https://github.com/facebook/react-native/pull/51478

Test Plan: No behavior change in core. -- Will be used in react-native-windows to fix https://github.com/microsoft/react-native-windows/issues/14006

Reviewed By: NickGerleman

Differential Revision: D75088378

Pulled By: javache

fbshipit-source-id: 0a456bfe6be93098e3d8fa22390a971e14a4312b
2025-05-22 07:20:32 -07:00
Alex HuntandFacebook GitHub Bot 6044e01460 Move RefreshControlMock into Jest preset files (#51530)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51530

Alternative to https://github.com/facebook/react-native/pull/50784.

`__mocks__` (and other underscored dirs) are correctly excluded from our npm package via `package.json#files`. But in this instance, this is a source file for the `jest/` directory (Jest preset within `react-native`), and should be included — fix by relocating.

Changelog:
[General][Fixed] - Fix missing RefreshControlMock source in Jest preset

Reviewed By: rshest

Differential Revision: D75215731

fbshipit-source-id: 1240344c4236288f31b16513f4df16766ad1e571
2025-05-22 06:00:49 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 88ca4bb1b7 Use native .isNaN instead of java.lang.Float.isNaN
Summary:
# Changelog:
[Internal] -

Based on review discussions in on a previous PR, it's a better style to use native Kotlin's `.isNaN` instead of `java.lang.Float.isNaN()`.

This makes sure that we uniformly do so throughout the codebase.

Reviewed By: fabriziocucci

Differential Revision: D75215199

fbshipit-source-id: 3c73638caa26717feb6bf0b08d1d79df6a6c58b2
2025-05-22 05:54:35 -07:00
Christian FalchandFacebook GitHub Bot be11f2ee77 fix wrong path in prebuild hermes check (#51526)
Summary:
When checking if we should download hermes artifacts, the path to the folder we're checking was wrong, causing hermes to always be downloaded.

This commit fixes this by renaming it from `Libraries` -> `Library`

bypass-github-export-checks

## Changelog:

[IOS] [FIXED] - fixed wrong path in prebuild hermes check

Pull Request resolved: https://github.com/facebook/react-native/pull/51526

Test Plan: Test to run the prebuild script twice with the same hermes version. Hermes should only be downloaded the first time.

Reviewed By: rshest

Differential Revision: D75213331

Pulled By: cipolleschi

fbshipit-source-id: 6eab6befa8f6a15b2215ec5ec9446063ec395ef7
2025-05-22 05:48:04 -07:00
Christian FalchandFacebook GitHub Bot e40c1d265a add missing React-RCTSettings (#51523)
Summary:
Added missing module React-RCTSettings to the Swift package.

This was found when testing intergrating with a bare bones React Native project.

## Changelog:

[IOS] [FIXED] - add missing React-RCTSettings to Swift package

Pull Request resolved: https://github.com/facebook/react-native/pull/51523

Test Plan: Run against a bare bones React Native project (not available in repo yet)

Reviewed By: rshest

Differential Revision: D75204445

Pulled By: cipolleschi

fbshipit-source-id: d9fcb27cc532846eece591152462ff9c88f82302
2025-05-22 05:48:04 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 11b16ed95d Automate the download of ReactNativeDependencies (#51505)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51505

to simplify how we download and manage the `ReactNativeDependencies.xcframework`, we added a script that is specular to the `hermes.js` script to handle the download of ReactNativeDependencies.

## Changelog:
[Internal] - Add script to automate the download of ReactNativeDependencies

Reviewed By: mdvacca

Differential Revision: D75151884

fbshipit-source-id: 2938c2919a24e496f5287e7ba31f87970c923d5d
2025-05-22 05:48:04 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 1d2d336dd1 Automate fetching of the latest nightly (#51504)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51504

This change simplify testing building React Native core using SwiftPM.

It let you use the HERMES_VERSION env var to automatically fetch the latest nightly.

To do so, just call:
```
HERMES_VERSION=nightly node script/ios-prebuild
```

## Changelog:
[Internal] - Handle the `HERMES_VERSION=nightly` case for iOS prebuilds

Reviewed By: rshest

Differential Revision: D75146936

fbshipit-source-id: 1933979b12d80eff005c9a1349df52602b254978
2025-05-22 05:48:04 -07:00
Phil PluckthunandFacebook GitHub Bot 480a4642e5 fix: Align TimerManager sequential ids and function error handling with web standard (#51500)
Summary:
Calls to create timers should return sequential ids (integers greater than zero in the spec's words). This regressed in the `TimerManager` implementation, which instead starts at zero inclusively.

This has two side-effects for code assuming a spec-compliant implementation of `setTimeout` and `setInterval`:
- Calls to `clearTimeout(0)` or `clearInterval(0)` will potentially cancel scheduled timers, although it's supposed to be a noop
- Predicates like `if (timeoutId)` will fail since they assume non-negative ids

The change in this PR is to align with WHATWG HTML 8.6.2 (Timers): https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers

> otherwise, let id be an [implementation-defined](https://infra.spec.whatwg.org/#implementation-defined) integer that is **greater than zero** and does not already [exist](https://infra.spec.whatwg.org/#map-exists) in global's [map of setTimeout and setInterval IDs](https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#map-of-settimeout-and-setinterval-ids).

Specifically,
- we should return `0` to indicate that no timer was scheduled
- we should start generating timer IDs at `1` instead of `0`

This was previously raised in review comments here: https://github.com/facebook/react-native/pull/45092/files#r1650790008

The spec-incompliant behaviour was raised in an issue here: https://github.com/apollographql/apollo-client/issues/12632#issue-3075269978

This PR does not,
- add bounds checking on `timerIndex_` and add a search of an available id that isn't in the unordered map
- exclude `0` from being an accepted `TimerHandle` in `TimerManager::createTimer` or `TimerManager::deleteTimer` since the above bounds checking hasn't been added either

## Changelog:

[GENERAL] [FIXED] - Align timer IDs and timer function argument error handling with web standards.

Pull Request resolved: https://github.com/facebook/react-native/pull/51500

Test Plan:
- Run `setTimeout` / `setInterval`; before applied changes the timeout for the first timer will be `0`
- Run `setTimeout(null)`; before applied changes the timer ID will be non-zero
- Run `setInterval(null)`; before applied changes an error will be thrown rather than `0` being returned

Reviewed By: cipolleschi

Differential Revision: D75145909

Pulled By: rshest

fbshipit-source-id: 6646439abd29cf3cfa9e5cf0a57448e3b7cd1b48
2025-05-22 04:43:27 -07:00
Dawid MałeckiandFacebook GitHub Bot 44b0f5560b Fix VirtualizeSectionList generic arguments (#51496)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51496

Fixes problem with generics passed to `VirtualizedSectionList` in generated types. The `flow-api-translator` creates a re-declaration for `export default` variables which shadows generics.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D75141051

fbshipit-source-id: 260ef066038320eee3ffa93692f77f1eff5c9205
2025-05-22 03:41:25 -07:00
Nick LefeverandFacebook GitHub Bot f900551216 Use RN_SERIALIZABLE_STATE for conditional getDiffProps code (#51516)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51516

See title

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D75153818

fbshipit-source-id: 66c9dee3bfdc56ebcffdceb7302cdb7efea70c75
2025-05-22 03:11:56 -07:00
Panos VekrisandFacebook GitHub Bot 0c70c0166e pre-suppress errors for natural inference rollout in xplat/js (#51524)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51524

Links in error suppressions will point to the announcement post in Flow FYI.

Changelog: [Internal]

drop-conflicts

Reviewed By: marcoww6

Differential Revision: D75188177

fbshipit-source-id: 27ea1fbee848e9371e679cf423e30bc9608edea0
2025-05-22 02:50:47 -07:00
Ruslan LesiutinandFacebook GitHub Bot 0f128f8b2c Update debugger-frontend from f5506e6...7e19a54 (#51515)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51515

Changelog: [Internal] - Update `react-native/debugger-frontend` from f5506e6...7e19a54

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/f5506e62112464952f4ca3f19878a18cdebc7d77...7e19a540aa1b4a2000ba94ba767a1d9dac5947e9).

Reviewed By: vzaidman

Differential Revision: D75187678

fbshipit-source-id: 9dd404ba77e8ffab1a227b2ac949f62642958f95
2025-05-22 02:43:50 -07:00
Dawid MałeckiandFacebook GitHub Bot 67a63804f8 Remove tslint.json and tsconfig.test.json (#51498)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51498

Removes unnecessary config files which were added in D74804967

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D75129416

fbshipit-source-id: 20868da100ed463e2e11f664bf04a383e24165ea
2025-05-22 00:49:04 -07:00
Luna WeiandFacebook GitHub Bot b8a4fb2a4d Add docs about react flags and debugging (#51521)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51521

Changelog: [Internal] - Add docs about react flags and debugging

Reviewed By: lenaic

Differential Revision: D75152355

fbshipit-source-id: 4ef69d036e8b70a3903ba2d2dbda6530b1893d2b
2025-05-21 23:11:25 -07:00
generatedunixname89002005232357andFacebook GitHub Bot 089621ebbe Revert D65085733 (#51520)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51520
Changelog: [Internal] - revert Intersection Observer `root` due to bug

Reviewed By: lunaleaps

Differential Revision: D75186289

fbshipit-source-id: d644b1ef3261996596af6a243076f7172d500167
2025-05-21 21:08:11 -07:00
Panos VekrisandFacebook GitHub Bot 50ca7e5730 manual annotations in preparation of natural inference rollout in react-native, tools, etc.
Summary:
The Flow team is improving the way Flow infers type for primitive literals. This diff prepares the codebase for the new behavior by adding type annotations, or annotations of the form `'abc' as const`.

Changelog: [internal]

Reviewed By: marcoww6

Differential Revision: D75188179

fbshipit-source-id: be50990f23f79cf2d8dae7576af5190218adcafe
2025-05-21 20:06:46 -07:00
Yannick LoriotandFacebook GitHub Bot 12ced22f70 Improve error messages when enum members are missing (#51502)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51502

While working on a case for Editor on mac, it took me a while to figure out what enum was the root cause:

 {F1978470518}

Adding the blaming enum name in the error message would have made my life much easier.

## Changelog:

[GENERAL][Added] - Improve error messages when enum members are missing

Reviewed By: rshest

Differential Revision: D75141414

fbshipit-source-id: 3625d817b218788891252add225f8fffb99e3145
2025-05-21 14:31:25 -07:00
Jiawei LüandFacebook GitHub Bot 5489e18abc Revert D74892330: Use HighResTimeStamp
Differential Revision:
D74892330

Original commit changeset: 514ca23dde8e

Original Phabricator Diff: D74892330

fbshipit-source-id: e7e2a778fb12ad5214217d3efb48c9f74dfb80f3
2025-05-21 14:12:16 -07:00
Jiawei LüandFacebook GitHub Bot 65ef8fe6b8 Revert D72649815: Replace DOMHighResTimeStamp alias in ReactCommon with new abstractions
Differential Revision:
D72649815

Original commit changeset: 96bcfaf909d4

Original Phabricator Diff: D72649815

fbshipit-source-id: 491579e20fed41f0f31639f51d6051022ae9de55
2025-05-21 14:12:16 -07:00
Jiawei LüandFacebook GitHub Bot cbfa2ecc9a Revert D75006354: Remove JSExecutor::performanceNow()
Differential Revision:
D75006354

Original commit changeset: d41bf73238e9

Original Phabricator Diff: D75006354

fbshipit-source-id: 99c60268d8d829ff87a8486b0ca67a47bfb198b4
2025-05-21 14:12:16 -07:00
Panos VekrisandFacebook GitHub Bot 1eebb5aa11 Back out "add 'as const' annotations in preparation of natural inference rollout in xplat/js [4/n]"
Summary:
Original commit changeset: 67ee5673816d

Original Phabricator Diff: D75114154

Reviewed By: SamChou19815

Differential Revision: D75161840

fbshipit-source-id: 144fc0e488154b957f4f2a549c077a2784124849
2025-05-21 12:03:51 -07:00
Ruslan LesiutinandFacebook GitHub Bot 6e50603faa Remove JSExecutor::performanceNow() (#51481)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51481

# Changelog: [Internal]

This is replaced by `HighResTimeStamp::now()`, which is available in a dedicated smal `react/timing` module.

Reviewed By: lenaic

Differential Revision: D75006354

fbshipit-source-id: d41bf73238e9c6bf5c5a9509d60713ce11e6ea4a
2025-05-21 11:56:22 -07:00
Ruslan LesiutinandFacebook GitHub Bot 84fa745be6 Replace DOMHighResTimeStamp alias in ReactCommon with new abstractions (#50585)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50585

# Changelog: [Internal]

Replaces `DOMHighResTimeStamp` alias completely in `ReactCommon` with `HighResTimeStamp`.

`DOMHighResTimeStamp` as a type is now expected to be used only in JavaScript.

I didn't update places where we explcitly use `std::chrono::high_resolution_clock`, since it is platform-specific and there is no guarantee that `std::chrono::high_resolution_clock` == `std::chrono::steady_clock`.

Also, places that are isolated and not part of the Web Performance APIs, such as Telemetry for Fabric, are not updates as part of this diff. Although these subsystems are also using `std::chrono::steady_clock` as a low-level representation, they are not sharing it with other parts of the React Native core.

Reviewed By: rubennorte

Differential Revision: D72649815

fbshipit-source-id: 96bcfaf909d4a7a5bb2ecfdd76f9939f1645fb69
2025-05-21 11:56:22 -07:00
Ruslan LesiutinandFacebook GitHub Bot 0ec36c4073 Use HighResTimeStamp (#51454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51454

# Changelog: [Internal]

There are multiple changes:
1. `PerformanceTracer` class, `TraceEvent` struct are moved to `tracing` namespace. These are parts of the Tracing subsystems of the jsinspector, this should bring more clarity and make things more explicit.
2. Added `Timing.h` class which defines conversion logic from `HighResTimeStamp` to absolute units that are expected by CDP.
3. `PerformanceTracer` will receive timestamps for Performance Web API entries in `HighResTimeStamp`.

Also, we will explicilty define a Tracking Clock time origin that will be epoch of the `steady_clock`. This aligns with the approach in Chromium and saves us from aligning custom DOMHighResTimeStamps that can be specified in performance.mark / performance.measure calls: these should not extend the timeline window. I've confirmed that this is the current behavior in Chromium.

Reviewed By: rubennorte

Differential Revision: D74892330

fbshipit-source-id: 514ca23dde8e23fbe07faf673e765674f328f60e
2025-05-21 11:56:22 -07:00
Ruslan LesiutinandFacebook GitHub Bot 53ae567488 Add toChronoSteadyClockTimePoint and fromChronoSteadyClockTimePoint converters (#51455)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51455

# Changelog: [Internal]

The main idea is that subsystems who might use a different time origin (the starting point of the whole timeline of events), can use `toChronoSteadyClockTimePoint` method to get raw `std::chrono::steady_clock::time_point` and then offset it by some arbitrary epoch: be it unix time origin or `std::chrono::steady_clock::epoch`.

`fromChronoSteadyClockTimePoint` can be used to convert time stamps from external systems, like Hermes.

Reviewed By: rubennorte

Differential Revision: D74892329

fbshipit-source-id: 70f34ce99aead6e0552d87d310c4d6ea4653b8fe
2025-05-21 11:56:22 -07:00
David VaccaandFacebook GitHub Bot f44a0da019 Mark ReactRawTextManager as @LegacyArchitecture (#51506)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51506

ReactRawTextManager is not used in new architecture, this diff marks it as so

changelog: [internal] internal

Reviewed By: mlord93, cortinico

Differential Revision: D75150100

fbshipit-source-id: 868420e87dc80185d5a51299736ce2ed6a855fe9
2025-05-21 11:36:38 -07:00
Panos VekrisandFacebook GitHub Bot 2a068c6559 add 'as const' annotations in preparation of natural inference rollout in xplat/js [4/n] (#51488)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51488

The Flow team is improving the way Flow infers type for primitive literals.
Announcement: https://fb.workplace.com/groups/flowlang/permalink/1725180268087629/

This diff prepares the codebase for the new behavior by codemoding `as const` annotations.

## Repro steps

1/ Used steps in D73610163 to produce the code changes.

2/ Reverted files where `flow` errored:
```
flow status --show-all-errors > errors.log
node ~/fbsource/fbcode/flow/facebook/error-analyzer.js errors.log |
  awk -F':' '{ print $1 }' | sort -u | grep -v 'Total Error Count' |
  xargs hg revert --rev .
```

3/ Reverted files that did not improve error count in new Flow mode
```
# Run Flow before change
~/fbsource/fbcode/flow/facebook/flowd status --show-all-errors > errors-0.log
# Run Flow after change
~/fbsource/fbcode/flow/facebook/flowd status --show-all-errors > errors-1.log

# Compute error counts before and after
node ~/fbsource/fbcode/flow/facebook/error-analyzer.js errors-0.log | sort > errors-counts-0.log
node ~/fbsource/fbcode/flow/facebook/error-analyzer.js errors-1.log | sort > errors-counts-1.log

# Revert files with no change in error count
comm -12 errors-counts-0.log errors-counts-1.log | awk -F':' '{ print $1 }' | xargs hg revert --rev .~1
```

## Note to code owners

Due to the large number of errors involved in this rollout, adding `as const` was the most feasible large-scale automated solution. Ideally, a lot of these errors would be fixed by adding other appropriate type annotations. For example instead of annotating
```
type Shape = {type: 'circle', radius: number} | {type: 'square', side: number} | ...;
type ShapeKind = 'circle' | 'square' | 'triangle';
const circle = {
  type: "circle" as const,  // <-- annotation added here
  radius: 42,
};
shape.type as ShapeKind;
takesShape(circle);
```
a more appropriate annotation would be
```
const circle: Circle = { type: "circle"; radius: 42 };
...
```

Changelog: [Internal]

drop-conflicts

Reviewed By: SamChou19815

Differential Revision: D75114154

fbshipit-source-id: 67ee5673816da9625431e2a2466a1e0038386151
2025-05-21 08:42:30 -07:00
Ruslan LesiutinandFacebook GitHub Bot 380dd59e80 Disable DevSupport for Profiling builds with Fusebox (#51495)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51495

# Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D75140274

fbshipit-source-id: 5793c3ec02282391c1d2aaa5e5c735ddb88cd889
2025-05-21 08:33:33 -07:00
Panos VekrisandFacebook GitHub Bot 5250b59ee2 manual annotations in preparation of natural inference rollout in xplat/js (#51487)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51487

The Flow team is improving the way Flow infers type for primitive literals. This diff prepares the codebase for the new behavior by adding type annotations, or annotations of the form `'abc' as const`.

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D75114156

fbshipit-source-id: e3175af85cdd2388c3b45af4beb314f334e3f9b5
2025-05-21 07:07:18 -07:00
Vitali ZaidmanandFacebook GitHub Bot 9af86ab25b renamed CDPMessagesLogging to CdpDebugLogging (#51471)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51471

Changelog: [Internal] renamed CDPMessagesLogging to CdpDebugLogging

Reviewed By: robhogan

Differential Revision: D75062639

fbshipit-source-id: d5c51375ffe1f7275bc48cea514319ac97fe81d4
2025-05-21 06:53:25 -07:00
Vitali ZaidmanandFacebook GitHub Bot c97853aeb1 log large cdp messages
Summary:
Running with
```
DEBUG=Metro:InspectorProxy DEV=1 js1 run --no-tty-print
```
When a message larger than 100kb is send over the cdp, log it.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D75000887

fbshipit-source-id: 6f426ed4db7ac1996c4f26461a6e0d13c096e5cd
2025-05-21 06:53:25 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 36df97f500 Stop testing JSC (#51475)
Summary:
As next step of the JSC deprecation, we are removing the CI testing for the JSC engine

## Changelog:
[Internal] -

Pull Request resolved: https://github.com/facebook/react-native/pull/51475

Test Plan: GHA

Reviewed By: NickGerleman

Differential Revision: D75089216

Pulled By: cipolleschi

fbshipit-source-id: 3839914cb58e872ddd82089bd7cb1391ddda20c1
2025-05-21 03:31:42 -07:00
Mateo GuzmánandFacebook GitHub Bot bcfa5ca474 Migrate TextAttributes to Kotlin (#51448)
Summary:
Migrate com.facebook.react.views.text.TextAttributes to Kotlin.

`TextTransform` is exposed in the `textTransform` var setter, and there doesn't seem to be a clean way to avoid having to make the `TextTransform` class public again. I have limited its companion to keep it internal as much as possible.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.views.text.TextAttributes to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/51448

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D74978129

Pulled By: rshest

fbshipit-source-id: ea0594f01738b8c8f4696434fe76974bbb9ff661
2025-05-21 03:25:11 -07:00
Chang Liu (RL)andFacebook GitHub Bot dc737cb909 Back out "Remove native animation fabric sync in JS and infinite animation loop workaround" (#51486)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51486

Original commit changeset: 5b313a5e8c07

Original Phabricator Diff: D74198568

Fix the issue that dropdown menus in HSR worlds menu are not clickable.

Reviewed By: xieswufe

Differential Revision: D75108344

fbshipit-source-id: d134ff9287929f8e1fc0995acf2b884d6a67131c
2025-05-20 20:58:50 -07:00
Luna WeiandFacebook GitHub Bot 3cb70bb6ad Introduce root to IntersectionObserver (#47394)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47394

## Changelog:

[General] [Added] - Support for observation `root` for Intersection Observer

Reviewed By: rubennorte

Differential Revision: D65085733

fbshipit-source-id: e67a74ace16c3f6f8ebba7eb811c1a9e0d559b0a
2025-05-20 14:20:25 -07:00
Ramanpreet NaraandFacebook GitHub Bot ff62ad1c04 Refactor RCTUnsafeExecute{On,Once}MainQueueSync utils (#51428)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51428

Just refactoring the control flow in these functions (in a separate diff). So, that the logic in subsequent diffs is easier to read: D74769326.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74940681

fbshipit-source-id: 7aabc722948666a13993a1feff7eeca8ef1403cf
2025-05-20 14:18:57 -07:00
Tomasz ZawadzkiandFacebook GitHub Bot bca7c5a553 Restore the possibility to extend LayoutAnimationController (#51479)
Summary:
In https://github.com/facebook/react-native/pull/50734, `LayoutAnimationController` was migrated to Kotlin and all of its methods are now marked as final.

However, this class is used and extended by `react-native-reanimated` in order to provide Layout Animations for Android on the Old Architecture. With all its methods being marked as final, the builds are failing.

This PR restores the possibility to extend `LayoutAnimationController`.

## Changelog:

[ANDROID] [FIXED] - Restored the possibility to extend `LayoutAnimationController`

Pull Request resolved: https://github.com/facebook/react-native/pull/51479

Test Plan: I've checked that this PR fixes build errors caused by `LayoutAnimationController` in react-native-reanimated.

Reviewed By: cipolleschi, mdvacca

Differential Revision: D75079557

Pulled By: cortinico

fbshipit-source-id: beeb700cbad87362dda4b60941124562c4753815
2025-05-20 12:42:00 -07:00
Samuel SuslaandFacebook GitHub Bot 580de87124 stop sending events to Paper if C++ Animated is enabled (#51477)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51477

changelog: [internal]

when using C++ Animated, no need to send events to Objective-C Native Animated.

Reviewed By: lenaic

Differential Revision: D75066259

fbshipit-source-id: 224d15ba2f707f2272a4fec56e5b2685694c7809
2025-05-20 11:09:47 -07:00
Rubén NorteandFacebook GitHub Bot b1e8729f4d Fix incorrect view flattening when using a specific not fully transparent color (#51379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51379

Changelog: [General][Fixed] Fix incorrect flattening / non-rendering of views with backgroundColor set to `rgba(255, 255, 255, 127/256)`

Fixes #51378.

## Context

When testing some unrelated things with Fantom is realized that the color for some text that I wasn't explicitly defining was being set to `rgba(255, 255, 255, 127)`, like here:

https://github.com/facebook/react-native/blob/249a24ac756275eadbe3b4df1ff9c974af1671d2/packages/react-native-fantom/src/__tests__/Fantom-itest.js#L540-L542

When digging a bit more about why, I realized that was actually the value for `UndefinedColor`. When looking a bit deeper, I saw that the value for that constant was being set like this:

```
using Color = int32_t;

namespace HostPlatformColor {
static const facebook::react::Color UndefinedColor =
    std::numeric_limits<facebook::react::Color>::max();
}
```

I'm not sure what the logic could've been here:
- Defining it as a value out of bounds for all valid colors? In this case, it's a 32 bit value so all the range of values are actually valid RGBA colors.
- Defining it as a fully opaque white? Seems dangerous for a default because you wouldn't be able to distinguish a explicitly set white color from a non-set color, relevant if you're seeing a white background color in a view on top of another view with any other background color.

The result of this existing logic was actually setting `UndefinedColor` to `rgba(255, 255, 255, 127)` because the alpha channel is defined in the first bits of the value, and `Color` being a signed int with 32 bits, the largest value is `01111....1`, so extracting the first 8 bits, you get 127.

## Changes

This changes the value set for the `UndefinedColor` constant (which is used, among other things, to determine if a view sets a background color, or otherwise could potentially be flattened).

The new value, instead of white with a 127/256 opacity, is black with 0% opacity (or simply the number 0 in `int32_t`).

Reviewed By: javache

Differential Revision: D74869311

fbshipit-source-id: 5582b4803b0b5c72cb3c1b33720c4542c5e3f1de
2025-05-20 10:38:05 -07:00
Rubén NorteandFacebook GitHub Bot 6581c69e10 Fix structuredClone test and added test to clarify behavior in IntersectionObserver (#51476)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51476

Changelog: [internal]

When we added integration of IntersectionObserver in the event loop by default, we changed the timing of the observer notification:
- Before, it was scheduled synchronously from the `observe` call.  That means that, if you schedule another task immediately after the observe call, the order is IO callback then task.
- After, it was scheduled at the end of the current event loop tick. That means that, if you schedule another task immediately after the observe call, the order is task then IO callback.

This change in order wasn't accounted for in the tests for IO (which it's added here) and made a test for `structuredClone` break because it was using incorrect assumptions.

This fixes that test.

Reviewed By: rshest

Differential Revision: D75073118

fbshipit-source-id: 38ad2d03686891daf4caa836e1f597917910ddd0
2025-05-20 09:54:58 -07:00
Samuel SuslaandFacebook GitHub Bot 0ac82ef83a use C++ Native Animated from JS if enabled (#51337)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51337

changelog: [internal]

When C++ Native Animated is used, we can't be using TurboModuleAnimated native module. This diff just add the check to make sure that if C++ Native Animated is used, it will be correctly referenced from JS.

Reviewed By: lenaic

Differential Revision: D74490166

fbshipit-source-id: 1b6de3227707168618052ff4ca6a02ca11337607
2025-05-20 06:48:11 -07:00
Samuel SuslaandFacebook GitHub Bot 8672faef87 implement SchedulerDelegateProxy::schedulerShouldSynchronouslyUpdateViewOnUIThread (#51334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51334

changelog: [internal]

Implement schedulerShouldSynchronouslyUpdateViewOnUIThread for C++ Native Animated. This simply passes along the data.

Reviewed By: zeyap

Differential Revision: D74739294

fbshipit-source-id: 7ef65e0b76004b9a2f6c3353169a6aa55ebeb44e
2025-05-20 06:48:11 -07:00
Samuel SuslaandFacebook GitHub Bot 8d3e971baa introduce an option to drive animations with folly::dynamic (#51470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51470

changelog: [internal]

To support C++ Native Animated and prevent unnecessary conversion between `folly::dynamic` <-> and `NSDictionary`, a method to apply `folly::dynamic` changes needs to be exposed on RCTMountingManager.

Previously I tried to change existing method `synchronouslyUpdateViewOnUIThread` to take folly::dynamic instead of `NSDictionary`. However this requires a change where we would expose C++ API to Objective-C class only, breaking build system in open source. This approach was backed out in  D74881580.

In this diff, I take an alternative approach and expose two methods to apply animation changes:
- Keep the existing API `synchronouslyUpdateViewOnUIThread` as is. This way, Objective-C Native Animated does not need to change.
- Introduce new method for `[RCTSurfacePresenter schedulerDidSynchronouslyUpdateViewOnUIThread]` which accepts `folly::dynamic`. This is used by C++ Native Animated only

Reviewed By: javache

Differential Revision: D74885607

fbshipit-source-id: 124b8800c01deeb6d57af8f4c47bea46cc1bcd66
2025-05-20 06:48:11 -07:00
Rubén NorteandFacebook GitHub Bot 4ae86e651c Enable enableIntersectionObserverEventLoopIntegration feature flag by default (#51472)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51472

Changelog: [internal]

This enables the integration of `IntersectionObserver` with the Event Loop by default.

Reviewed By: rshest, javache

Differential Revision: D74991641

fbshipit-source-id: 7f12d7d5413d12a6a7de53e9d6701195d48996dc
2025-05-20 05:40:00 -07:00
Rubén NorteandFacebook GitHub Bot 3aeba22dda Integrate IntersectionObserver in Event Loop (#51452)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51452

Changelog: [internal]

This implements a long planned refactor of `IntersectionObserver` to have a proper integration with the Event Loop, which unblocks `FragmentRef` in React Native.

The existing integration doesn't integrate with the Event Loop, so the intersection determination doesn't happen as a step in the event loop but in 2 different moments:
1. When you start observing a new target, we check if there are any pending transactions for that target, and otherwise determine the intersection immediately and queue the notifications.
2. Using mount hooks, when a transaction for a surfaceId is mounted, we check intersections for all the observers in that surface.

This has an important problem:
* If you attach a observer on a target before the target is attached to the tree (something that `FragmentRef` will start doing soon), we don't have a pending transaction so we determine intersections immediately. In that case, it's always "not visible" because it's not attached, and then we immediately trigger a transition when mounted in the same tick.

To fix this, we can implement a step in the Event Loop the same way that `IntersectionObserver` does on Web. We would still wait for pending transactions to be mounted to determine intersection timing (the same way we do now, but now checking at the end of the current Event Loop tick), but the dispatch of initial notifications for target that won't change is done at the end of the tick instead of synchronously.

It also refactors the list of active observers as a list of shared pointers to `IntersectionObserver` objects, instead of as list of `IntersectionObserver` objects directly. This is necessary to build the list of pending observers (with stable references) while making sure the ownership stays in the list of active observers.

Reviewed By: javache

Differential Revision: D74883214

fbshipit-source-id: 24accf1dba48d13b5773950a5cbf9ea38f4a1745
2025-05-20 05:40:00 -07:00
Oskar KwaśniewskiandFacebook GitHub Bot 50ce8c77a7 fix: make RCTScreenSize take horizontal orientation into account (#51444)
Summary:
This PR improves `RCTScreenSize` to handle horizontal orientations. This was causing a flicker whenever opening a Modal in horizontal orientation. Currently, `RCTScreenSize` is used to supply initial state for `ModalHostViewState`:

https://github.com/facebook/react-native/blob/f1697544cd720df21bd7dc8ca993d95a41321e3f/packages/react-native/ReactCommon/react/renderer/components/modal/ModalHostViewState.h#L31

This works great in portrait mode, but causes onLayout the be called twice in horizontal orientation (first with screen size and then with actual size..)

## Changelog:

[IOS] [FIXED] - make RCTScreenSize take horizontal orientation into account

Pull Request resolved: https://github.com/facebook/react-native/pull/51444

Test Plan: Open modal in horizontal orientation

Reviewed By: cipolleschi

Differential Revision: D74978651

Pulled By: rshest

fbshipit-source-id: f026e727b3529766de38dd31059c51b255f33e78
2025-05-20 04:54:33 -07:00
Riccardo CipolleschiandFacebook GitHub Bot f4250fa09e Refactor the prebuild script to use fetch instead of curl (#51398)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51398

As a followup after the comment of D74565936 (https://www.internalfb.com/diff/D74565936?dst_version_fbid=727294986523938&transaction_fbid=1121452289999956), I refactored the code to use `fetch` instead of `curl`.

## Changelog:
[Internal] - Refactor the code to use Fetch instead of curl

Reviewed By: NickGerleman

Differential Revision: D74886699

fbshipit-source-id: 843e915a5b13f420e9036c32a421d47beb5b5860
2025-05-20 04:32:46 -07:00
Christian FalchandFacebook GitHub Bot 9371e20192 fixed build type when downloading hermes artifacts (#51283)
Summary:
Hermes build-type was hardcoded to 'release' in the previous version of the prebuild scripts.

This commit fixes this so that we can provide a build-type for hermes when downloading prebuilt tarballs.

- Cleaned up parameters in hermes.js
- Updated with buildType parameter when suitable
- Fixed some function names
- Updated version file so that it contains build type
- Removed version file when using a local tarball

## Changelog:

[IOS] [FIXED] - Fixed resolving build type when downloading hermes artifacts

Pull Request resolved: https://github.com/facebook/react-native/pull/51283

Test Plan: No test-plan yet

Reviewed By: cortinico

Differential Revision: D74882001

Pulled By: cipolleschi

fbshipit-source-id: cfeed934023712e70f7d04c137e8611164120cec
2025-05-20 04:32:46 -07:00
Christian FalchandFacebook GitHub Bot e2f6ce4ddf fixed defines in package.swift (#51284)
Summary:
Our Cocoapods config has a list of defines that are used mostly when setting up pods:

- RCT_FABRIC_ENABLED
- USE_HERMES
- RCT_AGGREGATE_PRIVACY_FILES
- RCT_NEW_ARCH_ENABLED
- APP_PATH
- REACT_NATIVE_PATH
- RCT_SKIP_CODEGEN
- SWIFT_ACTIVE_COMPILATION_CONDITIONS
- USE_FRAMEWORKS
- USE_THIRD_PARTY_JSC
- HERMES_ENABLE_DEBUGGER
- REACT_NATIVE_DEBUGGER_ENABLED
- REACT_NATIVE_DEBUGGER_ENABLED_DEVONLY

Out of these, only the following are used in objective-c/c code:

- USE_HERMES
- HERMES_ENABLE_DEBUGGER
- REACT_NATIVE_DEBUGGER_ENABLED
- REACT_NATIVE_DEBUGGER_ENABLED_DEVONLY

This commit adds the required defines to the correct targets.

## Changelog:

Pick one each for the category and type tags:

[IOS] [FIXED] - fixed defines in package.swift

Pull Request resolved: https://github.com/facebook/react-native/pull/51284

Test Plan: No test-plan yet

Reviewed By: cortinico

Differential Revision: D74872272

Pulled By: cipolleschi

fbshipit-source-id: 5d9a68c1d819409bc7400ade622f62bb332d0896
2025-05-20 04:32:46 -07:00
Christian FalchandFacebook GitHub Bot ccbf878fb8 cleanup logging (#51243)
Summary:
Cleaned up logging

- Added `prebuildLog` function to harmonize output
- Reduced output from creating headers

bypass-github-export-checks

## Changelog:

[INTERNAL] [CHANGED] - cleaned up iOS-prebuild logging

Pull Request resolved: https://github.com/facebook/react-native/pull/51243

Test Plan: No tests required.

Reviewed By: cortinico

Differential Revision: D74569484

Pulled By: cipolleschi

fbshipit-source-id: b41d336320762a6adcb82faec4e6d633c6a9a8a5
2025-05-20 04:32:46 -07:00
Christian FalchandFacebook GitHub Bot 41d2b5de0a add download/extract hermes prebuilts (#51216)
Summary:
When running the prebuild script:

`node scripts/ios-prebuild.js`

The script will now try to resolve and download a prebuilt version of hermes:

1. Hermes artifacts will be extracted to the `./build/artifacts/hermes` folder to ensure that Package.swift can find a version to link against.
2. The script checks the environment variable `HERMES_ENGINE_TARBALL_PATH` and tries do expand the tarball into the artifacts folder from 1
3. If not found, the script reads the hermes version from either the hidden environment-variable `HERMES_VERSION` and tries to download a release-tarball or a nightly tarball for this version. If the version does not exist, the script will fail.

Also added some extra logging features to the script.

bypass-github-export-checks

## Changelog:

[IOS] [ADDED] - Added downloading of hermes artifacts when pre-building for iOS.

Pull Request resolved: https://github.com/facebook/react-native/pull/51216

Test Plan:
1. Delete the `packages/react-native/.build` folder
2. Run the build script (provide a valid HERMES_ENGINE_TARBALL_PATH or a valid Hermes version (or nightly version)
3. Verify that the script successfully exits
4. Build the Package.swift in Xcode and verify that it finds and links the relevant Hermes files, verifying is done by the build succeeding.

Reviewed By: NickGerleman

Differential Revision: D74565936

Pulled By: cipolleschi

fbshipit-source-id: 5bd231999da24cfcce446150ac0fc1b5a4b6a4ae
2025-05-20 04:32:46 -07:00
Pieter De BaetsandFacebook GitHub Bot d6371bd6ac Improve naming of template args in bridging (#51418)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51418

Improve readability

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74884371

fbshipit-source-id: 26b6966458097c8ac8d030629a1bee131418a34d
2025-05-20 03:57:43 -07:00
Mateo GuzmánandFacebook GitHub Bot 5596923189 Legacy Native Module e2e test (#51449)
Summary:
Found an issue with the legacy native module calls in old architecture (https://github.com/facebook/react-native/issues/51443) and got the idea of adding some simple e2e tests for the native modules so regressions like this can be captured moving forward.

This doesn't cover all methods, as not all of them are available for both Android and iOS, and also some of them are currently crashing, so it makes no sense to cover them all yet – but this can be used as a good starting point to increase coverage for essential APIs.

## Changelog:

[INTERNAL]  - Legacy Native Module e2e test

Pull Request resolved: https://github.com/facebook/react-native/pull/51449

Test Plan:
```sh
cd packages/rn-tester && maestro test .maestro/legacy-native-module.yml -e APP_ID=com.facebook.react.uiapp
```

<img width="594" alt="image" src="https://github.com/user-attachments/assets/6237613d-f5dc-4d8a-9b12-0980177793eb" />

<img width="740" alt="image" src="https://github.com/user-attachments/assets/8bdef368-13ac-494c-a506-88fff01dc8d6" />

Reviewed By: cortinico

Differential Revision: D74978093

Pulled By: rshest

fbshipit-source-id: f9c7ba3ca5177eb3d3863d2b8252ac17f3d07aa0
2025-05-20 03:35:42 -07:00
React Native BotandFacebook GitHub Bot 5d30829eb4 Add changelog for v0.80.0-rc.2 (#51463)
Summary:
Add Changelog for 0.80.0-rc.2

## Changelog:
[Internal] - Add Changelog for 0.80.0-rc.2

Pull Request resolved: https://github.com/facebook/react-native/pull/51463

Test Plan: N/A

Reviewed By: cipolleschi

Differential Revision: D75050745

Pulled By: rshest

fbshipit-source-id: 91739212e3e646acdb33c01e65ed6fff4330cf7e
2025-05-20 03:27:32 -07:00
riteshshukla04andFacebook GitHub Bot 89e6c72fd4 Correct Link for Networking (#51396)
Summary:
I noticed the link to networking in new app screen is wrong. So correcting it here

## Changelog:
[GENERAL][FIXED] - Fix Networking URL in New app screen

Pull Request resolved: https://github.com/facebook/react-native/pull/51396

Test Plan: Click on the link to open

Reviewed By: arushikesarwani94

Differential Revision: D74886240

Pulled By: cortinico

fbshipit-source-id: 19ccf63e64f0e40df4a0ab4082299c654926e35d
2025-05-20 03:07:42 -07:00
Krystof WoldrichandFacebook GitHub Bot 6399caef63 fix(types): Reference global.d.ts using path not types (#51104)
Summary:
After https://github.com/facebook/react-native/pull/49516 TSC would not find the global types.

Types reference expect a package name but was given a path to a declaration.

TS doc: https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-path-

This PR changes `types` to `path` to fix the issue.

`dtslint` fails with `no-bad-reference` rule, but the `../src` lives in the same package in `react-native` package.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [FIXED] - Reference `global.d.ts` using `path` so they can be resolved by TSC

Pull Request resolved: https://github.com/facebook/react-native/pull/51104

Test Plan:
Before the change with current RN 0.79.2 TSC would fail on resolving the global types (example from [Sentry RN SDK build](https://github.com/getsentry/sentry-react-native/commit/134d810cf95416091779806e00d3a3cc6cbace89)):

![Screenshot 2025-05-05 at 17 18 04](https://github.com/user-attachments/assets/b264c8da-aa21-49d8-9597-82586291a01a)

After the change to path TSC finds the global types.

Using TSC Version 4.9.5

Reviewed By: huntie

Differential Revision: D74208815

Pulled By: coado

fbshipit-source-id: 2fd51d79061ffb356c047604213cff7a425f167e
2025-05-20 00:52:43 -07:00
Nick GerlemanandFacebook GitHub Bot 9fe20d4ea3 Remove Measurement Placeholder Logic from Text ShadowNodes (#51465)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51465

Prior to D63303709 AttributedString could not represent formatting on an empty string, and so some text content was forcefully added to empty strings during measurement.

This is problematic in combination with Facsimile, where we directly render the layout we used during measurement, since empty text now has a random "I" in it.

Android's TextLayoutManager already knows how to interpret `baseTextAttributes`, and the placeholder is not needed. Other platforms should be updated to do the same, but that may be non-trivial to validate everywhere.

This diff removes logic from ShadowNodes to always inset a placeholder, and instead shims it in platform TextLayoutManagers which have not yet been updated to use `BaseTextAttributes`. That way, we don't force placeholders during measurement, and different platforms can incrementally unjank their code.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74770916

fbshipit-source-id: 7cf19db1a9a5cf68137bbff81b14ce5288235b2b
2025-05-19 18:15:39 -07:00
Nick GerlemanandFacebook GitHub Bot 0cd6a29981 TextSharedExamples and empty text E2E test (#51464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51464

Add a module of shared examples, like `TextInputSharedExamples`, to avoid copy/paste between these.

Modifies the empty test example a bit and adds an E2E test.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74780847

fbshipit-source-id: 30c2830ef0b638680fe75b4bcf9f138f5c01e190
2025-05-19 18:15:39 -07:00
Ruslan LesiutinandFacebook GitHub Bot ce4334233c Validate marks presense, if specified (#51389)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51389

# Changelog: [Internal]

This is the pre-requisite for the diff on top, which migrates performance-related classes to start using `HighResTimeStamp`.

We should be throwing `SyntaxError` if the specified mark name is not buffered. Like Chromium does:
 {F1978032319}

In this diff:
- `PerformanceEntryReporter::getMarkTime` is now public, ca be called by `NativePerformance` and returns `std::optional`.
- `NativePerformance` is responsible for validating that marks are present in the buffer, if their names are specified in `.measure()` call.
- Mark names take precedence over `startTime` and `endTime` values, so if they are specified and not available, then we will throw Error over `jsi` that will be catched on JavaScript side in `Performance.js`.

Reviewed By: rubennorte

Differential Revision: D74837812

fbshipit-source-id: ca2ba198c4c9e6e2d8d37f852affea667f1c174c
2025-05-19 15:24:36 -07:00
Nick GerlemanandFacebook GitHub Bot 5ac46bbb67 Fix random characters in comment in CSSTokenizer (#51417)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51417

tsia

Changelog: [Internal]

Created from CodeHub with https://fburl.com/edit-in-codehub

Reviewed By: joevilches

Differential Revision: D74837890

fbshipit-source-id: b07a30ea49c555f606dbb348c16d5c9f0a6e7b47
2025-05-19 13:58:54 -07:00
Eric RozellandFacebook GitHub Bot 2f761ee7c4 Do not flush Animated operation queue on mount for some feature flags (#51461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51461

We are trying to minimize the amount of non-determinism in flushing Animated operation queues. Initially the `ReactNativeFeatureFlags.animatedShouldSignalBatch` handled non-determinism on the native side, eliminating the use of native mount hooks to trigger operation batch flushes in the native module. However, there is additional non-determinism introduced by JS, where the set of pending Animated operations may be flushed as a result of an effect.

This change eliminates the flushing of Animated operations in the `useEffect` for `createAnimatedPropsHook.js`.

## Changelog

[Internal]

Reviewed By: yungsters, zeyap

Differential Revision: D75003751

fbshipit-source-id: 73c7bb02355b5f634f4a800f46ca5f529cd15ebd
2025-05-19 13:49:27 -07:00
Eric RozellandFacebook GitHub Bot 71caf2c557 Fix cross-over issue with animatedShouldUseSingleOp and animatedShouldSignalBatch (#51459)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51459

When using `animatedShouldSignalBatch` in combination with `animatedShouldUseSingleOp`, we were seeing an issue where the queue is not flushed deterministically. It would be flushed in an ad-hoc manner by `createAnimatedPropsHook.js`, but this was only if a mount happened to occur in the same frame.

Adding a deterministic queue flush mechanism to the logic handling `animatedShouldUseSingleOp` appears to resolve the issue.

## Changelog

[Internal]

Reviewed By: javache

Differential Revision: D75002657

fbshipit-source-id: 51f50af0f22becf152da15a720ba70dfc158cdbf
2025-05-19 13:49:27 -07:00
kocburakandFacebook GitHub Bot a703d4cfc1 Typo fix in InterpolationAnimatedNode for debugging (#51460)
Summary:
I noticed a missing debugging text while working on https://github.com/facebook/react-native/issues/50496. It was a typo. I though I might as well send a PR.

## Changelog:

[Android] [Fixed] - Fixing a typo in InterpolationAnimatedNode for debug text.

<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/51460

Reviewed By: cortinico, shwanton

Differential Revision: D75005096

Pulled By: javache

fbshipit-source-id: 390452b2b0c6eabfa003b9c95719649c79444d3a
2025-05-19 11:02:47 -07:00
Nick LefeverandFacebook GitHub Bot 3306c3b962 Improve naming of the hermes variants (#51456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51456

Going from:
* static_hermes_stable -> static_hermes
* static_hermes_trunk -> static_hermes_experimental

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D74999979

fbshipit-source-id: f20b07af4c7fddc6d162937b4c96f0bf60902dbd
2025-05-19 10:08:10 -07:00
Ruslan LesiutinandFacebook GitHub Bot efcc798de9 Make processingStartTime and processingEndTime optional (#51390)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51390

# Changelog: [Internal]

Ideally, these should not be optional, but these values are set at runtime.

Assertions added to validate that these values are set before reporting to `PerformanceEntryReporter`.

Reviewed By: rshest

Differential Revision: D74811439

fbshipit-source-id: 5e95931848263a58d977c07bac0eb18e53b91140
2025-05-19 08:34:29 -07:00
Rubén NorteandFacebook GitHub Bot 935cba270c Adds basic Fantom test for <Button> (#51380)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51380

Changelog: [internal]

Adding more examples of tests for core components with Fantom :)

Reviewed By: lenaic

Differential Revision: D74874581

fbshipit-source-id: 1285c4d222cb811b51155871c245b1bd5889b47a
2025-05-19 04:00:31 -07:00
Nick LefeverandFacebook GitHub Bot 8d8cb718aa Fix NaN value comparison for TextInput component (#51422)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51422

See title

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74915630

fbshipit-source-id: e7a556229d04f835b80752259d01330d0f4fcd62
2025-05-19 03:12:48 -07:00
Nick LefeverandFacebook GitHub Bot 995129c757 Fix NaN value comparison for Text component (#51421)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51421

See title

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74915629

fbshipit-source-id: 0c24426c5e04ab3fc6ee85a4ca53e6095f0d3fce
2025-05-19 03:12:48 -07:00
Nick LefeverandFacebook GitHub Bot f278c94a12 Fix accessibilityState serialization for props diffing of View component (#51420)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51420

The checked and unchecked state of the accessibility state property has to be serialized as `{ "checked": true }` and `{"checked": false}`.

This diff updates the serialization of the `accessibilityState` prop for the prop diffing on the View component.

This fixes the e2e test selectors for radio buttons.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74910744

fbshipit-source-id: 212b78e29a007744ac9283c7ec9b96ce80fd5681
2025-05-19 03:12:48 -07:00
Nick LefeverandFacebook GitHub Bot 01db5aa230 Support running tests with different hermes variants (#51451)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51451

This diff adds the `fantom_hermes_variant` pragma which can be set to:
- `hermes` for the default Hermes runtime used by RN
- `static_hermes` for the stable version of Static Hermes
- `static_hermes_trunk` for the "trunk" version of Static Hermes

Each variant will set up the correct build options for the runner and the correct compiler to use for the bundle.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74959718

fbshipit-source-id: 5d30c8e15ab052eb5686f26632f08ab42b5e68c7
2025-05-19 03:06:53 -07:00
Nick LefeverandFacebook GitHub Bot b1772de409 Make default mode used for benchmarks more obvious (#51446)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51446

See title

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74958927

fbshipit-source-id: 245397c6e9a89a40e5c1260fcd624e5f6b9f7c8d
2025-05-19 03:06:53 -07:00
Nick LefeverandFacebook GitHub Bot 0769ddf85b Add documentation for passChildrenWhenCloning feature (#51447)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51447

Changelog: [Internal]

Document how the `passChildrenWhenCloningPersistedNodes` feature works.

Reviewed By: rshest

Differential Revision: D74961913

fbshipit-source-id: 6f412de36acc233a6bdf3d59548035ad884264a8
2025-05-19 02:43:33 -07:00
Nick LefeverandFacebook GitHub Bot b2775a4501 Add technical documentation for RSNRU (#51435)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51435

Changelog: [Internal]

Adding a technical documentation for the Runtime Shadow Node Referece Update (RSNRU) feature.

Reviewed By: rshest

Differential Revision: D74943809

fbshipit-source-id: cf5cc02adefa2635efb29e498747fc733711c2e4
2025-05-19 02:43:33 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 2fa9c850f7 Avoid duplicated symbols for FollyConvert.h functions (#51393)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51393

In D74738548 we copied RCTFollyConvert to Follyconvert and we moved it to a separate file.

The problem is that when we build react native, we now might have duplicated symbols, especially with prebuilds where the symbols are "flattened" together.

To fix this, we can have the old file point to the new file in order not to break our suers and have a single symbol anyway.

## Changelog:
[Internal] -

Reviewed By: sammy-SC

Differential Revision: D74883143

fbshipit-source-id: 98361307286cdc19c57b8f5c9f066aebea992896
2025-05-18 11:27:39 -07:00
Tim YungandFacebook GitHub Bot 55cf1e7fd3 RN: Unbreak Rules of React in RNTesterPlatformTestEventRecorder (#51441)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51441

Refactors `RNTesterPlatformTestEventRecorder` so that it does not use `useMemo` from an instance method.

Instead, this diff changes the module to export a hook by the same name, `useRecorderTestEventHandlers`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74950333

fbshipit-source-id: 6cb222a6ec077abadbdc7008e822645aba3d07f6
2025-05-18 08:08:24 -07:00
Tim YungandFacebook GitHub Bot 3371fb57b7 RN: Migrate to ESM - ReactDevToolsSettingsManager (#51440)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51440

Migrates files to use ESM to mitigate the existing lint warning.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74949984

fbshipit-source-id: e89eb482835cb3a3d3b997dc766803dd307a6b99
2025-05-18 08:08:24 -07:00
Tim YungandFacebook GitHub Bot 77f2cb27be RN: Migrate to ESM - BackHandler (#51439)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51439

Migrates the `BackHandler` mock to use ESM to mitigate the existing lint warning.

I'm actually not sure this is even used anywhere… and the unmocked `BackHandler` is already using ESM.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74949885

fbshipit-source-id: 7f37212db2125bb7afdbd342175e3beae6c7c14f
2025-05-18 08:08:24 -07:00
Tim YungandFacebook GitHub Bot 4434707967 RN: Suppress Lint Error in ReactNativePrivateInterface (#51438)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51438

The `ReactNativePrivateInterface` module needs to continue using `module.exports` in order to lazily import dependencies.

For now, we just suppress the `lint/no-commonjs-exports` lint rule.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74949839

fbshipit-source-id: 295853be7fb988b879b6fd0b15ef31dd6e47cf85
2025-05-18 08:08:24 -07:00
Tim YungandFacebook GitHub Bot d798423c29 RN: Migrate to ESM - __flowtests__ (#51437)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51437

Migrates files to use ESM to mitigate the existing lint warning.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74949792

fbshipit-source-id: d1372bb3a8615fe4544d67f04d26237b06515bad
2025-05-18 08:08:24 -07:00
Tim YungandFacebook GitHub Bot f1697544cd RN: Migrate to ESM - Libraries/Components/Image (#51434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51434

Migrates files to use ESM to mitigate the existing lint warning.

I am suppressing `RelativeImageStub` to preserve compatibility with the dynamic asset exports generated by Metro (i.e. not ESM with `default` exports).

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74943031

fbshipit-source-id: ac4b2afd96fe5446acb4452395d7cb42bb5a6c17
2025-05-17 23:17:37 -07:00
Tim YungandFacebook GitHub Bot 1218a8a6d0 RN: Delete ErrorUtils Mock (#51433)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51433

This `ErrorUtils` mock is dead code.

There is no `ErrorUtils` module in React Native. (Maybe there was once upon a time...)

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74942884

fbshipit-source-id: 893458c4bc6f9ed29452579ce81915a52e6cd649
2025-05-17 17:18:55 -07:00
Tim YungandFacebook GitHub Bot 42d2b1f675 RN: Migrate to ESM - Libraries/Components/RefreshControl (#51431)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51431

Migrates files to use ESM to mitigate the existing lint warning.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74942842

fbshipit-source-id: bc68b1a3422e97bafc23516e429877a6624f37a3
2025-05-17 17:18:55 -07:00
Tim YungandFacebook GitHub Bot bfb177cd9e RN: Migrate to ESM - Libraries/Blob (#51427)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51427

Migrates files to use ESM to mitigate the existing lint warning.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74942792

fbshipit-source-id: a9f5b3e73d4c89f3dd499053d9b575c2eb3b9842
2025-05-17 17:18:55 -07:00
Tim YungandFacebook GitHub Bot a1da4b102c RN: Fix Existing Lint Warnings (#51426)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51426

Fixes a bunch of ESLint warnings across the codebase.

The only remaining warnings are from the `lint/no-commonjs-exports` rule.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74942686

fbshipit-source-id: 384de34c7297f7f7fcff1827c8b2e46714a5cda7
2025-05-17 17:18:55 -07:00
Tim YungandFacebook GitHub Bot 84de8a075e RN: Delete @oncall Annotations (#51416)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51416

Deletes `oncall` annotations from the `facebook/react-native` repository.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D74902524

fbshipit-source-id: 32a6a5b2ff27281792d572f151e2b094d9a79029
2025-05-17 16:18:05 -07:00
Tim YungandFacebook GitHub Bot ba092bfaba RN: Add Missing @format Annotations (#51415)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51415

Adds the `format` annotation to all files that were missing them.

Also, adds `noformat` to generated files, and removed it from files that no longer need them.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74901034

fbshipit-source-id: 7e0b85ca8ee2de41278f3aa23cb03e9c266d9c28
2025-05-16 18:09:09 -07:00
Samuel SuslaandFacebook GitHub Bot ef17880fb0 remove return value from synchronouslyUpdateViewOnUIThread (#51402)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51402

changelog: [internal]

the return value is unused. Let's remove it.

Reviewed By: zeyap

Differential Revision: D74884875

fbshipit-source-id: 83449ea298bdfbd7d083080aaa4d214bf246fcab
2025-05-16 16:46:37 -07:00
Tim YungandFacebook GitHub Bot ebe2a857f1 RN: Prefer Destructured Import for isValidElement (#51413)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51413

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74895841

fbshipit-source-id: c1d3af40134a3721c9a7b676ee1f2c4a18612e4d
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot ab1ac938c9 RN: Prefer Destructured Import for createElement (#51409)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51409

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74895837

fbshipit-source-id: b9d6082e4882d95f0d2aa1eed13b725edeb854cd
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot d78916d6ca RN: Prefer Destructured Import for cloneElement (#51410)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51410

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74895844

fbshipit-source-id: 67f334981a1effce051c89e3d4643232aa22b4e9
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 0a41b70164 RN: Prefer Destructured Import for useReducer (#51411)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51411

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74895840

fbshipit-source-id: 0a3d78d2871c3334b6e1b570744962a4d0168a9e
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 2e95617c2b RN: Prefer Destructured Import for use (#51408)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51408

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74895838

fbshipit-source-id: 2cc369e168a7ee10aa4374717f817636841c372c
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 2f77e0d7fd RN: Prefer Destructured Import for useContext (#51412)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51412

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74895839

fbshipit-source-id: 9ab9fc8bdee6d1764ad86fa2165da32cb266174e
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 4c1477073f RN: Prefer Destructured Import for useMemo (#51407)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51407

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74894324

fbshipit-source-id: 7179f27f8ff1fb1b67745650b38d87cb2ea982b2
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 7d3c4c81b5 RN: Prefer Destructured Import for useCallback (#51406)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51406

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74894207

fbshipit-source-id: 00286b3dbaa6ce1e4d8d0f0f6c0dfef6505824c5
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 3e70714cff RN: Prefer Destructured Import for useEffect (#51405)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51405

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74894042

fbshipit-source-id: 93fbadb32e4a1225836db9d729d7bf502ebddd84
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 1bf167ce97 RN: Prefer Destructured Import for useRef (#51404)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51404

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74893440

fbshipit-source-id: 9032f1e867a34b9cfa808f920a38f2630046eed7
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 00108a1ac3 RN: Prefer Destructured Import for useState (#51403)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51403

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D74891875

fbshipit-source-id: 981e85b5da84950c9e66e8d6b6496019e536711d
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 7af10f7a1a RN: Prefer Destructured Import for memo (#51401)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51401

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D74889277

fbshipit-source-id: 0d42921758c5d6e108a4c82dbd52b7de89fbef00
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot d7d10a4f0d RN: Prefer Destructured Import for createContext (#51400)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51400

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D74888314

fbshipit-source-id: 9224c7c371471fe1fc42c8d42d4b37a4edadcacf
2025-05-16 16:33:18 -07:00
Tim YungandFacebook GitHub Bot 255c197baf RN: Prefer Destructured Import for createRef (#51399)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51399

Prefers using this as a destructured import instead of as a member expression of `React`.

Changelog:
[Internal]

Reviewed By: rubennorte

Differential Revision: D74888097

fbshipit-source-id: a22ca4b791153ff0c2f4ab34ff8e3ce5e9280e0d
2025-05-16 16:33:18 -07:00
Ruslan LesiutinandFacebook GitHub Bot a7810f6995 Use std::optional instead of stub constexpr value for unset event start (#51252)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51252

# Changelog: [Internal]

Removes usage of `DOM_HIGH_RES_TIME_STAMP_UNSET` stub contstexpr.

Instead, all events that were using it will now declare timestamps as optional. This is the pre-requisite before migrating these raw `double` values to `HighResTimeStamp`.

Reviewed By: javache

Differential Revision: D74248998

fbshipit-source-id: 9ef223420823d036db815f956e91ff3a712c9833
2025-05-16 12:20:42 -07:00
Ruslan LesiutinandFacebook GitHub Bot 535150bc96 Replace RuntimeSchedulerClock with HighResTimeStamp, HighResDuration (#51251)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51251

# Changelog: [Internal]

Replaces `RuntimeSchedulerClock`, which was an alias for `std::chrono::steady_clock` with previously defined single timestamp abstraction.

Reviewed By: rubennorte

Differential Revision: D74246459

fbshipit-source-id: 2f5e31eb2299856e7eb69f3915fec6597963a3b8
2025-05-16 12:20:42 -07:00
Ruslan LesiutinandFacebook GitHub Bot 5d9cc9e407 Define Bridging protocol for HighResTimeStamp and HighResTimeDuration (#51253)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51253

# Changelog: [Internal]

Defines bridging template for `HighResTimeStamp` and `HighResTimeDuration`.

When these values are passed to JavaScript over bridge, they will be converted to [`DOMHighResTimeStamp`](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp).

Also the other way around, when we list `HighResTimeStamp` or `HighResTimeDuration` as a type of TurboModule spec, it will expect number value from JavaScript.

Reviewed By: rubennorte

Differential Revision: D74506516

fbshipit-source-id: b5893cef4525793eb6fb6326055c261c7b84a724
2025-05-16 12:20:42 -07:00
Ruslan LesiutinandFacebook GitHub Bot a882f19974 Define HighResTimeStamp, HighResDuration (#51254)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51254

# Changelog: [Internal]

Defines single timestamp abstraction that will be used in C++ layer of React Native core:
Key primitives include:
- `HighResTimeStamp`: A class representing a specific point in time with high precision.
- `HighResDuration`: A class representing a duration of time with high precision.

Right now, all these just encapsulate `std::chrono::steady_clock` with no extra custom logic. We might revisit this in a future, once we decide to add support for [`Performance.timeOrigin`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/timeOrigin).

This diff also adds a `README.md` documentation file with a brief summary of the `react/timing` module.

Reviewed By: rubennorte

Differential Revision: D72796412

fbshipit-source-id: 7a92b61202f5e527e020edea2b756b0063971242
2025-05-16 12:20:42 -07:00
Andrew DatsenkoandFacebook GitHub Bot 3e1b9a9182 Fix order of ancestor titles (#51397)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51397

Changelog: [Internal]

Fix order of ancestor titles.

Due to reverse being applied to the title order it flipped order on even contexts.

Reviewed By: rubennorte

Differential Revision: D74886550

fbshipit-source-id: c556af977f1abee633527151a5896c7d69bd0b48
2025-05-16 10:05:01 -07:00
Christian FalchandFacebook GitHub Bot 378f163a25 adding accessor for backing map (#51386)
Summary:
Expo is using the backingmap to be able to update properties in a fast and performant way in two overridden view manager subclasses (ViewGroupManager subclass is one of them).

This diff exposes the backing field via JvmName using the `internal_` prefix.

So Expo can keep on accessing the field as they were doing before. In the long run we should prevent them from accessing this property altogether but this would require a different API.

## Changelog:

[INTERNAL] -

Pull Request resolved: https://github.com/facebook/react-native/pull/51386

Test Plan: Build with Expo modules

Reviewed By: cipolleschi

Differential Revision: D74884533

Pulled By: cortinico

fbshipit-source-id: e76673c794a6a125059633d29445d991d867b770
2025-05-16 09:54:48 -07:00
Dawid MałeckiandFacebook GitHub Bot cfd4932bb0 Fix generated types base on __typetests__ (#51383)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51383

This diff is a set of alignments/improvements in generated TS types. It includes:
- extending `AppStateStatus` with `extension` and `unknown`,
- exporting `AnimatedProps` under `Animated` namespace,
- resolving issue with discriminated unions in `ProgressBarAndroidTypes`,
- fixing `StyleSheet.create` type to accept only specified style properties,
- extending `TextProps` with `AccessibilityProps`,
extending Fn Args generic with `$ReadOnlyArray` in `ErrorUtils`,
- small `__typetests__` adjustments,
- removing type test `styleDimensionValueValidAnimated` as `DimensionValue` no longer accepts `AnimatedNode`,
- removing `styleDimensionValueInvalid` as `DimensionValue` accepts any string now - template literal types in Flow are not supported,
- changing `overlayColor` type to `ColorValue` to align with manual types,
- fixing `AnimatedPropsAllowList` type which wasn't correct in TS because index signature type was different from style type,
- using `DeviceEventEmitter` instead of `DeviceEventEmitterStatic` in type tests which is equivalent in both new and old types - `DeviceEventEmitterStatic` was only a type of `DeviceEventEmitter`,
- removing type test for checking forwarded key type - doesn't work with new types and that shouldn't be supported,
- removing `Animated.legacyRef` type test - not included in new types,
- adding `DOMRect` from "dom" lib to `globals.d.ts` to not include "dom" lib in the tsconfig - tries to compare globals with `lib.dom.d.ts` and produces many errors,
- exporting `SectionListData`,

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D74807552

fbshipit-source-id: c5254ea0f701f3602b9d716faeb50ca1ab21b013
2025-05-16 09:50:51 -07:00
Pieter De BaetsandFacebook GitHub Bot 6d25274a52 Add unit test for NSNull behaviour in RCTTurboModule (#51370)
Summary:
Changelog: [Internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/51370

Reviewed By: NickGerleman

Differential Revision: D74815079

fbshipit-source-id: 87e72dfbe4841655bc1420e0e1d4377455bd5c1c
2025-05-16 08:47:55 -07:00
Pieter De BaetsandFacebook GitHub Bot 05dee839d8 Use methodSignatureForSelector instead of instanceMethodSignatureForSelector (#51366)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51366

We inherited this from the legacy native module infra, where we didn't have access to the module instance. Instead we can use the simpler `methodSignatureForSelector` which works correctly with OCMock (needed in D74815079).

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74817191

fbshipit-source-id: 6f3f741e9a78dea967a7654e6410ddacfad6d8a3
2025-05-16 08:47:55 -07:00
Nicola CortiandFacebook GitHub Bot 83ed4620d6 Add react-native/build to .gitignore
Summary:
This folder should have been added to the .gitignore.
Gradle is placing some build file over there in the latest version. This prevents it.

Changelog:
[Internal] [Changed] -

bypass-github-export-checks

Reviewed By: cipolleschi

Differential Revision: D74884379

fbshipit-source-id: 7da9682589c2bc161c1b0e3d741d1049b94505e4
2025-05-16 08:27:45 -07:00
Samuel SuslaandFacebook GitHub Bot ba6323b12e Back out "refactor native animated to pass folly::dynamic to fabric" (#51392)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51392

Original commit changeset: a3f1373bb0c6

Original Phabricator Diff: D74738548

changelog: [internal]

Reviewed By: cipolleschi

Differential Revision: D74881580

fbshipit-source-id: 5809fa8336e555accbbff05faec33ea23ef312e3
2025-05-16 08:15:30 -07:00
Dawid MałeckiandFacebook GitHub Bot 2e0c2c6df1 Remove dtslint from type tests (#51382)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51382

This diff replaces `dtslint` which is obsolete and [It is not intended to be used on its own, but as part of the definitelytyped set of packages](https://github.com/microsoft/dtslint) in favor of `tsc` type tests.

It's probably not necessary to have `test-typescript-offline` as tsc does that out of the box but doesn't test with multiple TS versions.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D74804967

fbshipit-source-id: 4c581ba5debf6fd0bb8dcddbb95f3c85b05082d4
2025-05-16 08:08:25 -07:00
Christian FalchandFacebook GitHub Bot 2a0c1e6a9e make DevServerHelper open (#51323)
Summary:
Expo inherits from the DevServerHelper class, and needs it to be declared as open, the same goes for its public interface.

Expo is using this in `DevLauncherDevServerHelper` and overrides the methods:

- getDevServerBundleURL
- getDevServerSplitBundleURL
- getSourceUrl
- getSourceMapUrl
- isPackagerRunning

This PR fixes this by adding the open to the class and to the methods that should be open

## Changelog:

[ANDROID] [FIXED] - Made DevServerHelper and its method open so that they can be overridden.

Pull Request resolved: https://github.com/facebook/react-native/pull/51323

Test Plan: Verify that we can build against Expo.

Reviewed By: cipolleschi

Differential Revision: D74876479

Pulled By: cortinico

fbshipit-source-id: 0037d6f7cee190a690ec3ec59896df04f46797b2
2025-05-16 07:52:01 -07:00
Jakub PiaseckiandFacebook GitHub Bot e4ef685dd7 Restore legacy semantics of modulesConformingToProtocol (#51381)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51381

Changelog: [General][Fixed] Fixed codegen breaking when a subset of `modulesConformingToProtocol` fields was specified or when the value was string

D70822061 introduced a new way of defininf modules and components in codegen, but accidentally introduced two breaking changes to the legacy syntax:
- before that diff, in case of 1:1 mapping, the value of the fileds could be a string, while after, it required it to be an array
- before that diff, not all of the fields on `modulesConformingToProtocol` had to be defined in `package.json`, while after, it required all fields to be defined even if unused

Reviewed By: cipolleschi

Differential Revision: D74875251

fbshipit-source-id: 610103b508f1462b4de01725f9b0a87341571197
2025-05-16 05:59:05 -07:00
Samuel SuslaandFacebook GitHub Bot 82279bd981 refactor native animated to pass folly::dynamic to fabric (#51335)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51335

## Changelog:
[iOS][Breaking] - synchronouslyUpdateViewOnUIThread now accepts folly::dynamic instead of NSDictionary. Use https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/utils/platform/ios/react/utils/FollyConvert.h#L14 for conversion.

pass folly::dynamic directly from native animated since Fabric consumes folly::dynamic for direct manipulation.
Additionally, remove return value from `synchronouslyUpdateViewOnUIThread` as it was never used.

Reviewed By: lenaic, zeyap

Differential Revision: D74738548

fbshipit-source-id: a3f1373bb0c643e8dcfb3e065edbcad42aa5d4d7
2025-05-16 04:27:59 -07:00
Sam ZhouandFacebook GitHub Bot 249a24ac75 Deploy 0.271.0 to xplat (#51376)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51376

Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D74836348

fbshipit-source-id: 33c354c4e2e59baf4815bc6c58fc3ca0066763df
2025-05-15 15:10:02 -07:00
Sam ZhouandFacebook GitHub Bot aecd6f1079 Make use of ref-as-prop support in ProgressBarAndroid (#51362)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51362

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74814465

fbshipit-source-id: 7264e137040381621dddc2641fb31114273cfb28
2025-05-15 14:56:13 -07:00
Sam ZhouandFacebook GitHub Bot 6129d3c48e Make use of ref-as-prop support in TouchableBounce (#51369)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51369

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74815336

fbshipit-source-id: b45f563ee73bd53794319b0d9886d3214caf0544
2025-05-15 14:25:37 -07:00
Sam ZhouandFacebook GitHub Bot 0312e9968c Make use of ref-as-prop support in Pressable (#51374)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51374

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74808387

fbshipit-source-id: e724130f88018b2cbe581dfd7a700cfbb0700bb9
2025-05-15 14:07:32 -07:00
Sam ZhouandFacebook GitHub Bot ba86a8f863 Make use of ref-as-prop support in ScrollView (#51365)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51365

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74814123

fbshipit-source-id: 5f9410df1710f6a9c59fea7ce1f225b04b67d664
2025-05-15 13:59:31 -07:00
Sam ZhouandFacebook GitHub Bot 22a55dc9b9 Make use of ref-as-prop support in TouchableHighlight (#51364)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51364

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74814121

fbshipit-source-id: b9b9f09577da1ba59a4b858b538140ab34bdc60d
2025-05-15 13:49:17 -07:00
Sam ZhouandFacebook GitHub Bot 80482d6be3 Make use of ref-as-prop support in TextInput (#51367)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51367

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74810113

fbshipit-source-id: cb841ab71ef582f10f478f2094837cf52d9cdf68
2025-05-15 13:48:05 -07:00
Joe VilchesandFacebook GitHub Bot 0c6a60e2fe Fix crash when link endOffset > line offset (#51372)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51372

I got notified that a recent change I made was causing a crash. This would happen when the endOffset of the link is larger than the end offset of the line. This can be repro'd with

```
/**
 * (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
 *
 * flow strict-local
 * format
 */

import {useState} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';

export default function Playground() {
  const [state, setState] = useState(false);
  function toggle() {
    setState(old => !old);
  }

  return (
    <View style={styles.container}>
      <Text
        style={[styles.paragraph, state && {backgroundColor: 'red'}]}
        numberOfLines={3}>
        <Text>Bacon Ipsum{'\n'}</Text>
        <Text>Dolor sit amet{'\n'}</Text>
        <Text>{'\n'}</Text>
        <Text accessibilityRole="link" onPress={toggle}>
          http://www.google.com
        </Text>
      </Text>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    paddingTop: 24,
    backgroundColor: '#ecf0f1',
    padding: 8,
  },
  paragraph: {
    margin: 24,
    fontSize: 18,
    fontWeight: 'bold',
    textAlign: 'center',
  },
});
```

This was encountered already by NickGerleman in D46206673 (https://github.com/facebook/react-native/pull/37050) and the fix is fairly straightforward. I modified that fix to check for the endOffset as well.

Changelog: [Internal]

Reviewed By: zeyap

Differential Revision: D74823458

fbshipit-source-id: 08fe81893f1c41d1934215515f88a6e0e546e705
2025-05-15 13:39:19 -07:00
Sam ZhouandFacebook GitHub Bot dcf45f73b9 Make use of ref-as-prop support in TouchableOpacity (#51363)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51363

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74814122

fbshipit-source-id: 88a184f84b811ad527e004edf0eb2344db8fe266
2025-05-15 13:34:53 -07:00
Sam ZhouandFacebook GitHub Bot 8146c07365 Make use of ref-as-prop support in Image (#51368)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51368

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74813682

fbshipit-source-id: c6bb9e286049c8ed16375c3bbb674b26a34459ca
2025-05-15 13:33:33 -07:00
Sam ZhouandFacebook GitHub Bot 6b0aedc72e Make use of ref-as-prop support in Animated (#51371)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51371

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74815987

fbshipit-source-id: 1f19757d0219f1d62deb263edfa2a0cc562dd9d2
2025-05-15 13:29:55 -07:00
Samuel SuslaandFacebook GitHub Bot 685a60e6b4 merge RCTCxxUtils into utils module (#51348)
Summary:
## changelog
[iOS][Deprecated] - RCTFollyConvert.h is deprecated please use /ReactCommon/react/utils/platform/ios/react/utils/FollyConvert.h instead

Pull Request resolved: https://github.com/facebook/react-native/pull/51348

move RCTFollyConverter to utils module so it is more accessible and delete RCTCxxUtils (which only held that one file). Also align on naming and drop RCT prefix.

Reviewed By: cipolleschi

Differential Revision: D74804476

fbshipit-source-id: 9a702b4823a986ed9849707cbb62d024e589bc1d
2025-05-15 12:31:34 -07:00
Sam ZhouandFacebook GitHub Bot 824e2deae0 Remove unused forwardRef import in SectionListModern (#51373)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51373

Followup of https://github.com/facebook/react-native/pull/51360

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D74825642

fbshipit-source-id: 1ba8f4f1934279a0be484b7809cadeacee03d59d
2025-05-15 11:45:46 -07:00
Christian FalchandFacebook GitHub Bot 9d11dcd3b0 make removeView open in ViewGroupManager (#51322)
Summary:
After conversion to Kotlin we could no longer override the removeView function since it is no longer open. The rest of this class can be overridden as before, but since functions are final by default this doesn't work for the new `removeView` function.

Expo is overriding the `removeView` functions in `GroupViewManagerWrapper.kt` (a lot of other ViewManager methods are also overridden here, but the `removeView` is introduced in `ViewGroupManager` and needs to be open as well. `GroupViewManagerWrapper.kt` is a replacement view manager that adds support for a delegate that will receive callbacks whenever one of the methods in the view manager are called.

This commit fixes this by making the removeView function explicitly open.

## Changelog:

[ANDROID] [FIXED] - Made function `removeView` open in Kotlin class

Pull Request resolved: https://github.com/facebook/react-native/pull/51322

Test Plan: Verify that Expo can build against this class.

Reviewed By: javache

Differential Revision: D74807744

Pulled By: cortinico

fbshipit-source-id: 55f4b9deccb7d82ceb78be1d56c2b99a6f7e3ce9
2025-05-15 10:36:14 -07:00
Sam ZhouandFacebook GitHub Bot 2fa2c2071c Make use of ref-as-prop support in Text (#51361)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51361

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74810512

fbshipit-source-id: 0f902da8b487db353609b8de14f46a4cec23a46b
2025-05-15 10:01:54 -07:00
Sam ZhouandFacebook GitHub Bot 797705c00d Make use of ref-as-prop support in examples (#51358)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51358

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74812747

fbshipit-source-id: 7ded547ff62ca59d28abfc46a2f57466e2486acd
2025-05-15 09:55:32 -07:00
Joe VilchesandFacebook GitHub Bot d07b2a9d99 Remove useEditTextStockAndroidBehavior and resolve old android blur issue (#51338)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51338

There was some problems removing this feature flag earlier in that, on older android versions, we would try to focus the top most text input whenever any other text input would try to blur. This was ultimately and issue with how Android implements `clearFocus`. To fix this, lets block the focusability of all views while we clear the focus, then re-enable.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D74760594

fbshipit-source-id: 2811c08ad6ed0855da0a4d7fca89fb08f84905c2
2025-05-15 09:50:32 -07:00
Joe VilchesandFacebook GitHub Bot f6378c3390 Back out "Clean up useEditTextStockAndroidFocusBehavior feature flag"
Summary:
Original commit changeset: 4682cf709aa2

Original Phabricator Diff: D73954790

I want to pick this into 0.80 so users can enable the feature flag so this doesn't break older versions

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D74754010

fbshipit-source-id: 75dc96516b00035984741b43814d6fc7df6be0ac
2025-05-15 09:50:32 -07:00
Joe VilchesandFacebook GitHub Bot 7a04f985fd Back out "Fix issue where text inputs cannot blur on <= Android 8.1" (#51336)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51336

Original commit changeset: 12dcaf0c9c35

Original Phabricator Diff: D74678847

I plan on reverting this so that we can in turn revert the diff that this diff fixed so we can pick it into RN 0.80 so that users have some fix on all versions. Right now 0.80 will be broken for older android devices

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D74754164

fbshipit-source-id: fda17da3e9b61ca13f68f6681726ffb3f4f4f6c0
2025-05-15 09:50:32 -07:00
Nicola CortiandFacebook GitHub Bot 036e47ef9f Add a gradle task to download native 3p dependencies. (#51357)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51357

This adds a `prepareNative3pDependencies` Gradle task that downloads and prepares all the 3p dependecies.
This will be needed before we download native deps for Fantom.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D74812436

fbshipit-source-id: 85796d0bcffaeef05d3a21d50f39954ef39ae92c
2025-05-15 09:31:42 -07:00
Sam ZhouandFacebook GitHub Bot e7e4cdd12e Make use of ref-as-prop support in SectionListModern (#51360)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51360

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74812991

fbshipit-source-id: 9df7247bcdaed7a880ed0a75a5dcc33fce6f1d86
2025-05-15 09:17:45 -07:00
Rubén NorteandFacebook GitHub Bot 6e9a816940 Migrate test to use React.createRef insted of ref functions (#51345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51345

Changelog: [internal]

I just realized there were some tests where we didn't migrate to the new recommended pattern.

Reviewed By: rshest

Differential Revision: D74803018

fbshipit-source-id: b74468f1be35fba8d20d3b96ea2b55452a8175ee
2025-05-15 08:46:32 -07:00
Rubén NorteandFacebook GitHub Bot c7611e0d79 Add definition of setNativeProps in NativeDOM and use it if available (#51343)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51343

Changelog: [internal]

This implements `setNativeProps` as a method in the `NativeDOM` C++ TurboModule, so we can replace usages of the method from `FabricUIManager`.

Reviewed By: javache

Differential Revision: D74800815

fbshipit-source-id: cf3c2d4b75c8d30e2528f96d4d63318e1366096a
2025-05-15 08:46:32 -07:00
Rubén NorteandFacebook GitHub Bot 89e21b866a Add missing setNativeProps tests (#51342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51342

Changelog: [internal]

Adding a test for `setNativeProps`, as it was missing because we couldn't test this when this test suite was implemented.

Reviewed By: fabriziocucci

Differential Revision: D74800816

fbshipit-source-id: 5f4721e61d1fb41a1898f56be35e6e3b12c9537e
2025-05-15 08:46:32 -07:00
Rubén NorteandFacebook GitHub Bot f49083db69 Replace usage of FabricUIManager methods with NativeDOM methods where available (#51341)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51341

Changelog: [internal]

`measure`, `measureInWindow` and `measureLayout` have been defined in the `NativeDOM` C++ TurboModule for a while, but we didn't migrate the callsites in the DOM APIs to use them. This does that migration so we can remove a few `$FlowFixMe`s and use a cleaner API.

Reviewed By: javache

Differential Revision: D74800814

fbshipit-source-id: 117e4a8798036f2266e25cfc0931e91c148eaf52
2025-05-15 08:46:32 -07:00
Sam ZhouandFacebook GitHub Bot f4c9df5b38 Make use of ref-as-prop support in ActivityIndicator (#51356)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51356

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74808564

fbshipit-source-id: 68f55d31c07ceaf7282833bd4b04039e35987935
2025-05-15 08:30:33 -07:00
Sam ZhouandFacebook GitHub Bot a6a073765a Make use of ref-as-prop support in ScrollViewStickyHeader (#51355)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51355

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74810588

fbshipit-source-id: e979e8fb59d46be6dabc4327b47b20d635864aa9
2025-05-15 08:28:48 -07:00
Sam ZhouandFacebook GitHub Bot 28c375fb53 Make use of ref-as-prop support in Switch (#51353)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51353

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74809899

fbshipit-source-id: aaa4ef65ea4d4a20c9d9315ae95957e67484c2d8
2025-05-15 08:24:58 -07:00
Sam ZhouandFacebook GitHub Bot 83401b5d44 Make use of ref-as-prop support in Button (#51354)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51354

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74808349

fbshipit-source-id: a359278b5d516eb04fc88ea14c21b628f1053fec
2025-05-15 08:18:30 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 84c5f294e5 Fix Maestro E2E Tests (#51347)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51347

The new warnings on RNTester for the imports are covering the New Architecture list item, as you can see from the video.

This prevents maestro from clicking on the list item, and therefore the test fails.

{F1977997600}

## Changelog:
[Internal] - Fix E2E Tests

Reviewed By: cortinico

Differential Revision: D74803709

fbshipit-source-id: 747af57d04c96ba9b0ee642eb70ebf84bca3a3fa
2025-05-15 08:15:26 -07:00
Sam ZhouandFacebook GitHub Bot 34c9612f93 Make use of ref-as-prop support in DebuggingOverlay (#51352)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51352

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74808254

fbshipit-source-id: 2f5f8d8dbe1bd5fcaba179bea5deed1592dc900c
2025-05-15 08:07:21 -07:00
Rubén NorteandFacebook GitHub Bot ca764bb511 Fix Fantom tests to avoid logging errors to test output (#51346)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51346

Changelog: [internal]

I saw that this test was logging errors to the console, which is considered a bad practice in Jest tests.

This prevents the logs from being printed in the test output and also adds assertions to verify what should be logged.

Reviewed By: rshest

Differential Revision: D74803463

fbshipit-source-id: 9c840a51e0e616a6bb15b7a40b3a6937fcb88b64
2025-05-15 05:27:02 -07:00
Chi TsaiandFacebook GitHub Bot bf26cf9c31 Add Hermes Root API in all other versions of Hermes (#51082)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51082

Introduces the `IHermesRootAPI` interface and a class implementation.
This root API will contain the previously static methods on
`HermesRuntime`.

The root API will serve as an entry point for users to create the Hermes
runtime and invoke methods that do not necessarily require a runtime.

Diff also moves all usages of the static methods on `HermesRuntime` to
getting the methods from the root API.

Multiple places are depending on Hermes, Hermes snapshot, and Shermes,
so this diff will also update all of these verions of Hermes at once.

Changelog: [Internal]

Reviewed By: neildhar

Differential Revision: D71132855

fbshipit-source-id: fddda83517682779b4aef062efe84e29fd027fae
2025-05-14 17:14:47 -07:00
Nick GerlemanandFacebook GitHub Bot 0455f8ff53 Use PreparedLayoutTextViewManager when Enabled by Gating (#51182)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51182

Wires up the logic to use Facsimile View Manager when flags for prepared layout enabled.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D73161911

fbshipit-source-id: dc8824ecf8a712d5ff52cb8e2d63e85646297d40
2025-05-14 16:10:08 -07:00
Nick GerlemanandFacebook GitHub Bot 9394813689 Update PreparedLayoutTextView for new state type (#51301)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51301

The type of the state we pass has changed, since the original prototype. Need to update the Java side to reflect this.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74417253

fbshipit-source-id: 9159689e07d6f00504b5116a647c7afdf79005f4
2025-05-14 16:10:08 -07:00
Nick GerlemanandFacebook GitHub Bot 729b5ae7d9 Send prepared layouts in Android ParagraphState updates (#51184)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51184

This change adds prepared layouts to `ParagraphState` on Android, for us to send to the client when gating is enabled

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D74356128

fbshipit-source-id: bd1dd5a457869075c561173de398ae1954a20ab5
2025-05-14 16:10:08 -07:00
Nick GerlemanandFacebook GitHub Bot 88de631d05 RN_SERIALIZABLE_STATE (#51185)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51185

Was running into issues with split Android ParagraphState, because a lot of code is tied to `#ifdef ANDROID`, which also builds for react-native-cxx.

This does that spliitting, and also introduces `RN_SERIALIZABLE_STATE` to replace previous ANDROID checks related to state serialization, so we can cofine that to just the Android platform. These changes are dependent on each other.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D74374376

fbshipit-source-id: ffb246ea2e16773f85de12209f2d88a95f8bb792
2025-05-14 16:10:08 -07:00
Nick LefeverandFacebook GitHub Bot 09832198cc Add role and screenReaderFocusable to prop diffing for View component (#51332)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51332

See title

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74747715

fbshipit-source-id: dc0380b0402d6023971a902f22d44b87bad0edde
2025-05-14 15:43:33 -07:00
Nick LefeverandFacebook GitHub Bot b6d7451291 Add missing borderEndColor prop diffing for View component (#51331)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51331

See title

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74744566

fbshipit-source-id: dc70310e47dfd5e29070519fa29b7af7ce6ffeab
2025-05-14 15:43:33 -07:00
Nick LefeverandFacebook GitHub Bot c301a25251 Add hitSlop prop diffing to View component (#51329)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51329

See title

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74741639

fbshipit-source-id: da7317c8800d2f25c69ecd7d3aca9b75350c2a56
2025-05-14 15:43:33 -07:00
Nick LefeverandFacebook GitHub Bot 07c64ba341 Add mixBlendMode prop diffing to View component (#51326)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51326

See title

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74739648

fbshipit-source-id: 3123f001cf7520d39bc3e92cee79b1baa17bd7cf
2025-05-14 15:43:33 -07:00
Nick LefeverandFacebook GitHub Bot d4ee62793d Add filter prop diffing to View component (#51325)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51325

See title

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74738361

fbshipit-source-id: 71c704b1a977327c05d06e48f5572753c2847b38
2025-05-14 14:33:53 -07:00
Nick LefeverandFacebook GitHub Bot 37ad315ebc Add outline prop diffing to View component (#51321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51321

See title

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74734893

fbshipit-source-id: f9b96c7bbfc791fa601dd8e4d8c1a4a27b94e36c
2025-05-14 14:33:53 -07:00
Joe VilchesandFacebook GitHub Bot 14e53e4845 Allow links in facsimile to be keyboard focusable (#51305)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51305

tsia, there is a lot of TextView specific API calls and instance checks in the delegate that need to be modified. Additionally, facsimile has some custom focusing logic we do not need if we have a delegate

I opted to just do a lot of instance specific logic using `is` . That seems easier for the time being with this text view that should replace our other text view over time.

I also expose a new way of focusing a span on facsimile, which may not be the best way to do that, lmk

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D74104419

fbshipit-source-id: 87c2259bb1698d93afad88ed91cb6322b90714f0
2025-05-14 14:24:21 -07:00
Ramanpreet NaraandFacebook GitHub Bot 99505e0c74 RuntimeExecutor: Make executeSynchronouslyOnSameThread_CAN_DEADLOCK more readable (#51324)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51324

This diff just renames the mutexes, so that the method is more understandable.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74692506

fbshipit-source-id: 3e928ee0465ebed90f9c95ba3eaf28ea148b0e60
2025-05-14 14:22:59 -07:00
Chi TsaiandFacebook GitHub Bot 6766cf6285 Used shared_ptr<Runtime> in jsi testlib (#51081)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51081

After introducing the interfaces, runtime should be managed through a
shared pointer instead of a unique pointer.

This diff will change the usage in JSI testlib. Later diffs will
actually change the HermesRuntime usages.

Changelog: [Internal]

Reviewed By: lavenzg

Differential Revision: D70113190

fbshipit-source-id: ea831dd8f79750851fd626afe0f1f5550142ac05
2025-05-14 13:44:49 -07:00
Chi TsaiandFacebook GitHub Bot f7f60dc794 Add castInterface API in JSI (#49604)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49604

Add JSI castInterface API. This provides a structured way to provide
optional APIs that may or may not be supported in all engines.

Every interface will have its own set of APIs. For instance, Hermes
will provide an interface (`IHermes`) containing Hermes-specific
APIs. In the future, an interface may be created to expose optional
APIs.

A runtime will inherit the interfaces of which the APIs are supported by
the runtime. Users who want to access a specific API may call
castInterface with the UUID of interface containing the API.

For backwards compatibility, the current `jsi::Runtime` will remain as
an object, and its functionalities will not be described by an
interface. However, this may be revisited later.

Changelog: [Internal]

Reviewed By: tmikov

Differential Revision: D68964360

fbshipit-source-id: 3efe61c5bc1a0fa113a192f4abad6d0f135b4301
2025-05-14 13:44:49 -07:00
Ramanpreet NaraandFacebook GitHub Bot e275da45ea Migrate surface view off RCTSurface (#51328)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51328

RCTSurface is a legacy class. We might be able to kill it off.

Let's decouple RCTSurfaceView from RCTSurface.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D72582309

fbshipit-source-id: 0ffb6c2d08c5ee1eda6ae90955ccbc14f57036b7
2025-05-14 13:10:41 -07:00
Ramanpreet NaraandFacebook GitHub Bot 70eeb9f541 Migrate display link off RCTModuleData (#51327)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51327

RCTModuleData is a legacy class. We might be able to kill it off.

Let's deocuple bridgeless from RCTModuleData.

Changelog: [ios][Breaking] - Migrate RCTDisplayLink's API from RCTModuleData

Reviewed By: cipolleschi

Differential Revision: D72582306

fbshipit-source-id: 3e06f8b2036e1f65425c8312644cc92c076e958e
2025-05-14 13:10:41 -07:00
Nick GerlemanandFacebook GitHub Bot 2fe6c1a947 Include fallback line spacing in BoringLayout Metrics (#51304)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51304

A potential source of truncation we previously experienced with D65171352 is difference in how TextView calculates line spacing with StaticLayout.

As of Android 13, this also appies to how TextView creates the metrics of BoringLayout. Oddly, this is not also applied to `BoringLayout.make()` (I think it ends up only impacting metrics), so we don't pass the flag there. See https://cs.android.com/android/_/android/platform/frameworks/base/+/78c774defb238c05c42b34a12b6b3b0c64844ed7

This could cause some theoretical truncation of simple single line text, so let's match TextView expectations.

Changelog:
[Android][Fixed] - Include fallback line spacing in BoringLayout

Reviewed By: javache, joevilches

Differential Revision: D74694483

fbshipit-source-id: 76dd980b827824f19ac755b3a9a1ec8912cd6ff1
2025-05-14 12:03:44 -07:00
Ruslan LesiutinandFacebook GitHub Bot 3148f0fb2b Deduplicate strings and provide std::string_view (#51098)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51098

# Changelog: [Internal]

Depending on the sampling rate, there could be lots of samples recorded. Right now, React Native requests the rate to be 10kHz. In reality, Hermes will be slower. How exactly slower will depend on the platform, because sampling profiler implementation is platform-specific. Windows peaks at ~500Hz, whereas iOS and Android that are using signals can reach up to 5kHz, based on my observations. This means that we could record sample approximately every 0.5ms.

For 30 seconds of sampling, we can get around 150k samples, every one of which may have up to 500 call frames (it is a custom limitation on Hermes side). Previously, every call frame could have a unique copy of function name string and url string.

This diff changes the approach to deduplicate strings, keeping a single copy for every unique string. A new abstraction `StringEntry` is added that will keep a const pointer to the string storage and an offset to the entry in this storage.

On React Native side, we are going to re-use these `std::string_view` and keep Hermes' `Profile` alive as long as they are used. We are going to achieve this by keeping unique pointer to the Hermes' `Profile` in React Native's Profile abstraction - `RuntimeSamplingProfile`, which is agnostic to the runtime.

Reviewed By: fbmal7

Differential Revision: D73106068

fbshipit-source-id: bdc7026e19c2677e39e20f14c8532080c5842026
2025-05-14 11:34:14 -07:00
Zeya PengandFacebook GitHub Bot 2d7342f8b4 Remove native animation fabric sync in JS and infinite animation loop workaround (#51264)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51264

## Changelog:

[General] [Changed] - Remove native animation fabric sync in JS and infinite animation loop workaround, when cxxNativeAnimated is enabled

when cxxNativeAnimated is enabled, we'll sync native animation props back to Fabric in native, when that happens we can remove the code in JS for same purpose

Reviewed By: lenaic

Differential Revision: D74198568

fbshipit-source-id: 5b313a5e8c07058f939134e9a6d60dcfa3b45842
2025-05-14 11:31:11 -07:00
Nick LefeverandFacebook GitHub Bot 109fe1394a Add missing view events to View prop diffing (#51318)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51318

Adding parsing and diffing for
- `onClickCapture`
- `onPointerOutCapture`
- `onPointerOverCapture`

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74732872

fbshipit-source-id: 458f476f645970e2bee608e020b63c14e7affafe
2025-05-14 10:25:28 -07:00
Nick LefeverandFacebook GitHub Bot 85994c9f62 Add boxShadow prop diffing to View component (#51314)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51314

See title

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74726605

fbshipit-source-id: 4a26d05af51a7d77f3aade9fbea3dff47b2ea4ed
2025-05-14 10:25:28 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 8d634267f8 Add E2E test for FabricInteropLayer (#51269)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51269

This adds an E2E Tests for the fabric interop layer in RNTester, so we can make sure that we don't break the mechanism to add children after the view is rendered

## Changelog:
[Internal] - Add E2E test for FabricInteropLayer

Reviewed By: sammy-SC

Differential Revision: D74590458

fbshipit-source-id: 9483d1ac648d923a8494d6402b9b2f971b9b2547
2025-05-14 10:11:03 -07:00
Christian FalchandFacebook GitHub Bot d53a60dd23 fix adding children (#51213)
Summary:
See https://github.com/facebook/react-native/issues/51212 - children aren't updated correctly in an old arch native view using the interop layer under Fabric.

This is caused by the mountChildComponentView method not updating the view, only adding the new view to a list that will be used on the next update to mount the child.

This commit fixes this by adding the same pattern as in unmountChildComponentView where children are inserted directly if the underlying paperview is available in the adapter - otherwise it uses the mounting list as before.

#Closes 51212

bypass-github-export-checks

## Changelog:

[IOS] [FIXED] - fixed adding child views to a native view using the interop layer

Pull Request resolved: https://github.com/facebook/react-native/pull/51213

Test Plan:
**Previous output**:

<image src="https://github.com/user-attachments/assets/472b95e7-0921-46c9-be6a-f31759c0cd26" width="200px" />

**After fix**:

<image src="https://github.com/user-attachments/assets/554387cd-c264-483e-9c52-d9cd40b42601" width="200px" />

Reviewed By: sammy-SC

Differential Revision: D74471278

Pulled By: cipolleschi

fbshipit-source-id: 798f9e7be389359bd6e3aa1b6a6e9fb799fcb369
2025-05-14 10:11:03 -07:00
Riccardo CipolleschiandFacebook GitHub Bot e9c8fee4ef Add Example for InteropLayer on RNTester (#51260)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51260

This is a preparatory change that adds an example to RNTester for the Fabric interop layer on iOS.
This example is needed to create a Jest E2E tests that will make sure that the Fabric Interop Layer can properly add views as subviews.

We discovered the bug thanks to react-native-maps.

## Changelog:
[Internal] - Add Example for the Fabric Interop Layer to RNTester iOS

Reviewed By: cortinico

Differential Revision: D74579737

fbshipit-source-id: 0c1bbb06790b01313cd98aa4b7152d8aba0cded3
2025-05-14 10:11:03 -07:00
Vitali ZaidmanandFacebook GitHub Bot 337ae3bacb improve the message displayed when opening devtools while bundle builds (#51315)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51315

Changelog: [General][Internal] improve the message displayed when opening devtools while bundle builds

Reviewed By: motiz88

Differential Revision: D74718454

fbshipit-source-id: 8b0cc9ca08dc98d766ddd5a3685d60b5d2800119
2025-05-14 09:11:34 -07:00
Pieter De BaetsandFacebook GitHub Bot 039a333df5 Remove any props set by default on View (#51225)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51225

We process a number of props by default in View, so we can provide some amount of compatibility with web API's. The way we then pass these to React means we end up setting a number of props with 'undefined' values. These props need to be diffed, sent to native (so string keys copied via JSI) and serialized to folly::dynamic (on Android) which is just wasteful.

Instead we can mutate the destructured props object and update/insert keys only as necessary to reduce the props payload size.

Changelog: [General][Breaking] View no longer sets any default accessibility props, which should not result in visible changes in behaviour but may affect snapshot tests.

Reviewed By: yungsters

Differential Revision: D74472767

fbshipit-source-id: 462a4495c0672d4bf1752a532acff49b14598e8e
2025-05-14 09:02:00 -07:00
Jakub PiaseckiandFacebook GitHub Bot ee9bd851ac Add a custom Jest resolver to opt out from handling "exports" in tests (#51307)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51307

D72228547 added the `exports` field to the main `react-native` package, in which all imports from `./src/*` are explicitly disallowed. This was expected to be a breaking change and to limit the surface area of it, this diff will allow using all imports in jest tests.

Changelog: [General][Added] Added a custom Jest resolver to opt out from handling "exports" in tests

Reviewed By: huntie

Differential Revision: D74708701

fbshipit-source-id: 9a2714f4e6f78ffbad9e56b5bb92657c9ea908ef
2025-05-14 08:01:15 -07:00
Dawid MałeckiandFacebook GitHub Bot 4d0f2b2ca7 Align ImageStyle overflow prop type and compose function type (#51285)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51285

The `composeStyles` function should correctly determine the type of the input styles (`ViewStyle`, `ImageStyle`, `TextStyle`) base on the output type:

```ts
const combinedStyle8: StyleProp<ImageStyle> = StyleSheet.compose(
  // ts-expect-error
  composeTextStyle,
  composeTextStyle,
);
```

This diff adds generic type checking for `compose` function and fixes `ImageStyle` overflow prop type which accepted `scroll` property (which wasn't previously accepted in manual types) and which enables type system to distinguish `ImageStyle` from `ViewStyle` and `TextStyle`:

previous:
```ts
overflow?: 'visible' | 'hidden' | 'scroll'
```

current:
```t
overflow?: 'visible' | 'hidden'
```

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D74574293

fbshipit-source-id: 751a44f2d3cd43055d93031343995f16ef87b185
2025-05-14 07:44:05 -07:00
Vitali ZaidmanandFacebook GitHub Bot b817b1a75b Update debugger-frontend from 3d17e0f...f5506e6 (#51316)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51316

Changelog: [Internal] - Update `react-native/debugger-frontend` from 3d17e0f...f5506e6

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/3d17e0fd462dc698db34586697cce2371b25e0d3...f5506e62112464952f4ca3f19878a18cdebc7d77).

Reviewed By: motiz88

Differential Revision: D74727700

fbshipit-source-id: b0923b7fd1a7c1d721b9b4322270507c07fcedaf
2025-05-14 07:23:45 -07:00
Vitali ZaidmanandFacebook GitHub Bot 46f91fd34d Improved the description of the error shown when a previous debugger is closed when a new one is opened (#51296)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51296

Changelog: [General][Internal] Improved the description of the error shown when a previous debugger is closed when a new one is opened

Corresponding DevTools PR:
https://github.com/facebook/react-native-devtools-frontend/pull/162

Reviewed By: hoxyq

Differential Revision: D74657572

fbshipit-source-id: fa601aab22099bbf957e5e66420f94752f03b6f3
2025-05-14 07:23:45 -07:00
Nick LefeverandFacebook GitHub Bot 169525d33b Fix nativeID and testID prop diffing for View component (#51312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51312

The nativeID and testID prop mapping on the native Java side use full caps `ID` in the setter mapping. Fixing the props diffing result to use the right key in the result for both.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74724759

fbshipit-source-id: 4291a72cd3081981f4a25f16f8f2bef17230da54
2025-05-14 06:02:37 -07:00
Samuel SuslaandFacebook GitHub Bot 4c0607ee36 add test for ViewCulling when sibling in FLatList resizes (#51311)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51311

changelog: [internal]

add a test case for view culling to cover a crash observed in production.

Reviewed By: lenaic, rubennorte

Differential Revision: D74720814

fbshipit-source-id: ed1246ccbaa0d0ab51a6073f20642c1c78872f30
2025-05-14 05:38:49 -07:00
Rubén NorteandFacebook GitHub Bot 7776122e2e Move playground tests to their own directory (#51310)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51310

Changelog: [internal]

Just a bit of separation between these and Fantom own tests.

Reviewed By: lenaic

Differential Revision: D74717487

fbshipit-source-id: f9d8667c823fcda7b1f3222803367c6b15d9309d
2025-05-14 04:01:31 -07:00
Ritesh ShuklaandFacebook GitHub Bot 68d6ada448 Fixed borderBottomEndRadius on RTL (#51229)
Summary:
Fixes https://github.com/facebook/react-native/issues/51193
## Changelog:
[ANDROID][FIXED] Wrong borderBottomEndRadius on RTL

Pull Request resolved: https://github.com/facebook/react-native/pull/51229

Test Plan:
Tested with Arabic (RTL) and English(LTR)

English
<img src="https://github.com/user-attachments/assets/5bd1eca9-194c-4d83-b75f-689bc13d827b" width=200>

Arabic
<img src="https://github.com/user-attachments/assets/459320a0-6bb2-4585-97bb-bd4ded6ec399" width=200>

Reviewed By: cortinico

Differential Revision: D74709219

Pulled By: NickGerleman

fbshipit-source-id: 885bb84d97d73324983d044fd2874a457b40f646
2025-05-14 03:54:04 -07:00
megandFacebook GitHub Bot 777397667c fix issue #51297 which addresses allWarningsAsErrors type error (#51300)
Summary:
Resolved a build error [issue https://github.com/facebook/react-native/issues/51297](https://github.com/facebook/react-native/issues/51297) caused by assigning a Boolean to a Property<Boolean>.
Switched from direct assignment to using .set(...) to correctly configure allWarningsAsErrors from project properties.

## Changelog:

- Gradle fix: assign allWarningsAsErrors using .set() for Property<Boolean>

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - [ANDROID] [FIXED]

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/51300

Test Plan:
Fixes build failure with React Native v0.79.2 and Gradle v8.0.
```
npm run start
npm run android
```
no more build errors

Reviewed By: cortinico

Differential Revision: D74706741

Pulled By: rshest

fbshipit-source-id: 31ec923f49a6da63fb5abb464bc38b99b1e8650a
2025-05-14 02:54:02 -07:00
Nick GerlemanandFacebook GitHub Bot 7f8b6566c4 Resubmit: Ensure that ShadowNode measure functions respect constraints (#51299)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51299

## Resubmit

This change was backed out, due to the WinUI Fabric TextLayoutManager not respecting minimum size constraints, causing early debug assert. D74494087 was confirmed to fix this.

For more safety, we limit fatal debug assertsions to `ParagraphShadowNode`, and only log a native error for other ShadowNodes.

## Original

Android's TextLayoutManager may return widths greather than the max measure constraint.

Yoga will clamp these, but this sort of issue points to a logic bug, and creates issues when we are looking at caching text measurements based on constraint reuse.

Let's debug assert that we don't do that, and fix a case of rounding up at a pixel boundary, to ensure that it doesn't go above max width. This should theoretically be safe, since Yoga is already doing this clamping, which is what dictates final size of the TextView.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D74674460

fbshipit-source-id: 807d6629bb799a3b1a55e378a3243065055ce219
2025-05-13 19:49:20 -07:00
Nick GerlemanandFacebook GitHub Bot 1fe3ff86c3 Fix more text rounding bugs (#51303)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51303

We do a lot of incorrect `cei()` in text measurement, compensated later by other incorrect bits.

There are a couple of interesting bits here:

A "desired width" is how large a hypothetical text layout would like to be. It is a floating point value, and to avoid truncation, a container must be larger than the desired width. So ceiling this is correct.

We are also passed available width, which may be an exact specification, not at a subpixel boundary. Ceiling this is totally incorrect, since Yoga will disregard our ceiled version, and we just created a layout, larger than our actual measure will be.

We must instead floor `availableWidth`, and we create our layout based off of that, to not give an extra physical pixel, that may not be given to us, if later layout rounding doesn't go our way. We then ceil `desiredWidth` earlier.

Finally, when we have an exact measuremode, we create the layout so that it uses guaranteedWidth`, but act as if it takes the full available space, per-contract, which may be a subpixel size larger. This means we cannot create layouts which cause truncation.

I used this change as an opportunity to clean up `createLayout()`, since we are gating anyways, to remove the duplicated paths, and to avoid the unnecessary `TextDirectionHeuristic` work for BoringLayout case, and since `StaticLayoutBuilder` already defaults to the heuristic we are manually setting.

Changelog:
[Android][Fixed] - Fix more text rounding bugs

Reviewed By: joevilches

Differential Revision: D74685353

fbshipit-source-id: 3700df657958c6efb46bfbbe674051d16a2b7c26
2025-05-13 19:49:20 -07:00
Nick GerlemanandFacebook GitHub Bot 3391959fd8 Resubmit: Expose Unsnapped Dimensions (#51298)
Summary:
X-link: https://github.com/facebook/yoga/pull/1811

Pull Request resolved: https://github.com/facebook/react-native/pull/51298

## Resubmit

This was backed out due to being up the stack from another change that was backed out, but should be safe by itself.

## Original

We want to know if an artifact created during measurement can fully be reused after final layout, but the final layout is allowed to be slightly larger due to pixel grid rounding (while still allowing reuse). It's hard to tell after the fact, whether it is larger because of this rounding (though the measure is used), or if it may be a pixel larger for valid reasons.

We can expose the unsnapped dimensions of a node to give us this information, and to correlate measurement artifacts.

This is most of the time the same as the layout's measured dimension, though I don't think it's safe to use this, since anything else measuring the node after could clobber this (I think `YGNodeLayoutGetOverflow` may also be prone to this as a bug).

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D74673119

fbshipit-source-id: 06d2eb21e28b76458ec88f4dfcaec809707d0390
2025-05-13 18:21:04 -07:00
Joe VilchesandFacebook GitHub Bot 79c47987b7 Fix issue where text inputs cannot blur on <= Android 8.1 (#51302)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51302

We got https://github.com/facebook/react-native/issues/51072#issue-3035616801 which demonstrates that if we have 2 text inputs on a screen we cannot blur them. If you try to blur any, focus jumps to the first one.

This seems to be a bug with Android's `clearFocus` per https://developer.android.com/reference/android/view/View#clearFocus(), this behavior is intended when we are not in touch mode, yet it happens regardless of what mode we are in on this version.

I modified this a bit to swallow `requestFocus` calls if we are in touch mode. This should be fine as no JS focus calls will go through this path. On hardware keyboard focus and focus from `clearFocus`

Changelog: [Android] [Fixed] - Fix bug where focus would jump to top text input upon clearing a separate text input.

Reviewed By: mlord93

Differential Revision: D74678847

fbshipit-source-id: 12dcaf0c9c350d3ed697ff81e8dfb205b7942119
2025-05-13 17:56:46 -07:00
Rubén NorteandFacebook GitHub Bot 5dd489190c Handle platform objects in structuredClone (#51257)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51257

Changelog: [internal]

Fixes the semantics for `structruredClone` when dealing with platform objects (cloning the supported ones and throwing exceptions for the rest).

Reviewed By: hoxyq

Differential Revision: D74574857

fbshipit-source-id: 71b99e9659cf3fb4bed8f431e9b54d2f9f514706
2025-05-13 14:29:01 -07:00
Rubén NorteandFacebook GitHub Bot 6454d2f0db Introduce concept of platform objects and serialization (#51256)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51256

Changelog: [internal]

This is just in preparation for `structuredClone` handling the cloning (or not) of platform objects correctly.

It marks all existing Web platform objects in RN as such, and defines the clone method for `DOMRectReadOnly`, `DOMRect` and `DOMException`.

Reviewed By: hoxyq

Differential Revision: D74574856

fbshipit-source-id: 9e9647fcaafcc1d32fb36e5ee40167871572c544
2025-05-13 14:29:01 -07:00
Rubén NorteandFacebook GitHub Bot 1bb8546698 Introduce better mechanism for non-serializable built-ins in structuredClone (#51255)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51255

Changelog: [internal]

Just a small refactor of how we handle non-serializable built-ins in structuredClone

Reviewed By: hoxyq

Differential Revision: D74398113

fbshipit-source-id: 26211920fcd4cf11c5da278e213eaa2b6b9aa1b5
2025-05-13 14:29:01 -07:00
Rubén NorteandFacebook GitHub Bot caaa5c93fb Optimize structuredClone (#51250)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51250

Changelog: [internal]

Optimizes the implementation of `structuredClone`.

Before:
| (index) | Task name                | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | ------------------------ | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'clone a string'         | '955.81 ± 1.45%'     | '902.00'            | '1095925 ± 0.01%'          | '1108647'                 | 1046239 |
| 1       | 'clone a basic array'    | '7684.79 ± 0.76%'    | '7542.00'           | '131980 ± 0.02%'           | '132591'                  | 130128  |
| 2       | 'clone a basic object'   | '6286.35 ± 0.53%'    | '6179.00'           | '161179 ± 0.02%'           | '161838'                  | 159075  |
| 3       | 'clone a complex object' | '22446.96 ± 0.32%'   | '22223.00'          | '44819 ± 0.03%'            | '44998'                   | 44550   |

After:

| (index) | Task name                | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | ------------------------ | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'clone a string'         | '793.81 ± 0.09%'     | '781.00'            | '1270316 ± 0.01%'          | '1280410'                 | 1259755 |
| 1       | 'clone a basic array'    | '5079.81 ± 2.13%'    | '4798.00'           | '206235 ± 0.03%'           | '208420'                  | 196858  |
| 2       | 'clone a basic object'   | '3823.37 ± 1.60%'    | '3636.00'           | '271030 ± 0.03%'           | '275028'                  | 261550  |
| 3       | 'clone a complex object' | '13095.13 ± 2.04%'   | '12499.00'          | '79701 ± 0.03%'            | '80006'                   | 76365   |

Reviewed By: hoxyq

Differential Revision: D74576514

fbshipit-source-id: f452dcfca6398dbfa40c5a41b77b0157777fa59b
2025-05-13 14:29:01 -07:00
Rubén NorteandFacebook GitHub Bot f7327bddb5 Add benchmark for structuredClone (#51249)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51249

Changelog: [internal]

This adds a basic benchmark for `structuredClone`, so we can optimize it in the following diff.

Baseline:

| (index) | Task name                | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | ------------------------ | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'clone a string'         | '955.81 ± 1.45%'     | '902.00'            | '1095925 ± 0.01%'          | '1108647'                 | 1046239 |
| 1       | 'clone a basic array'    | '7684.79 ± 0.76%'    | '7542.00'           | '131980 ± 0.02%'           | '132591'                  | 130128  |
| 2       | 'clone a basic object'   | '6286.35 ± 0.53%'    | '6179.00'           | '161179 ± 0.02%'           | '161838'                  | 159075  |
| 3       | 'clone a complex object' | '22446.96 ± 0.32%'   | '22223.00'          | '44819 ± 0.03%'            | '44998'                   | 44550   |

Reviewed By: hoxyq

Differential Revision: D71407319

fbshipit-source-id: ee1c89d6ba3fd2484b2f4115cc58dc4b08e04fa7
2025-05-13 14:29:01 -07:00
Rubén NorteandFacebook GitHub Bot 46b55d2146 Basic implementation of structuredClone (#51248)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51248

Changelog: [internal]

This implements an initial version of `structuredClone`, but only to be used internally (not exposed as a global yet).

The goal is to use this implementation to fix the semantics of the `detail` field in performance entries, which is meant to be cloned.

Reviewed By: hoxyq

Differential Revision: D71407320

fbshipit-source-id: c7ec1229f9c3414d8b95110da6f65828d74b8c8e
2025-05-13 14:29:01 -07:00
Rubén NorteandFacebook GitHub Bot 955c61c738 Implement DOMException (#51247)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51247

Changelog: [internal]

This implements an initial version of `DOMException`, but only to be used internally (not exposed as a global yet).

The goal is to make this available to `structuredClone`, which will be added after this.

Reviewed By: hoxyq

Differential Revision: D71407318

fbshipit-source-id: b28f11542749ceef6485ff934a712eed941a4545
2025-05-13 14:29:01 -07:00
Samuel SuslaandFacebook GitHub Bot 34e9cba764 fix crash in view culling where differentiator creates create instruction for existing view (#51294)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51294

changelog: [internal]

Fix a crash where a node that is supposed to be culled doesn't get visited because culling context is not updated.
The differentiator would generate a create instruction for a view that already exists.

Stack trace for the crash:
```
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x0000000111740874 libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x00000001117aa2ec libsystem_pthread.dylib`pthread_kill + 264
    frame #2: 0x0000000180171ea8 libsystem_c.dylib`abort + 100
    frame #3: 0x00000001802b0144 libc++abi.dylib`abort_message + 128
    frame #4: 0x000000018029fe4c libc++abi.dylib`demangling_terminate_handler() + 296
    frame #5: 0x000000018006f220 libobjc.A.dylib`_objc_terminate() + 124
    frame #6: 0x00000001375d1964 INFRAFramework`meta_terminate() + 5468
    frame #7: 0x00000001802af570 libc++abi.dylib`std::__terminate(void (*)()) + 12
    frame #8: 0x00000001802b2498 libc++abi.dylib`__cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 32
    frame #9: 0x00000001802b2478 libc++abi.dylib`__cxa_throw + 88
    frame #10: 0x0000000180093904 libobjc.A.dylib`objc_exception_throw + 384
    frame #11: 0x0000000180e6999c Foundation`-[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 268
    frame #12: 0x000000031a3bcfc8 XPLAT_6_Framework`-[RCTComponentViewRegistry dequeueComponentViewWithComponentHandle:tag:] + 528
    frame #13: 0x000000031a3ccdec XPLAT_6_Framework`RCTPerformMountInstructions(std::__1::vector<facebook::react::ShadowViewMutation, std::__1::allocator<facebook::react::ShadowViewMutation>> const&, RCTComponentViewRegistry*, RCTMountingTransactionObserverCoordinator&, int) + 356
    frame #14: 0x000000031a3ccc7c XPLAT_6_Framework`-[RCTMountingManager performTransaction:]::$_1::operator()(facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) const + 80
    frame #15: 0x000000031a3ccc20 XPLAT_6_Framework`decltype(std::declval<-[RCTMountingManager performTransaction:]::$_1&>()(std::declval<facebook::react::MountingTransaction const&>(), std::declval<facebook::react::SurfaceTelemetry const&>())) std::__1::__invoke[abi:ne190102]<-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&>(-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 40
    frame #16: 0x000000031a3ccbc8 XPLAT_6_Framework`void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:ne190102]<-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&>(-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 40
    frame #17: 0x000000031a3ccb94 XPLAT_6_Framework`std::__1::__function::__alloc_func<-[RCTMountingManager performTransaction:]::$_1, std::__1::allocator<-[RCTMountingManager performTransaction:]::$_1>, void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)>::operator()[abi:ne190102](facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 44
    frame #18: 0x000000031a3cba1c XPLAT_6_Framework`std::__1::__function::__func<-[RCTMountingManager performTransaction:]::$_1, std::__1::allocator<-[RCTMountingManager performTransaction:]::$_1>, void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)>::operator()(facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 44
    frame #20: 0x000000032f219804 XPLAT_1_Framework`std::__1::function<void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)>::operator()(this=0x000000016d4f0c78, __arg=0x000000016d4f0a10, __arg=0x000000016d4f0978) const at function.h:989:10
    frame #21: 0x000000032f219668 XPLAT_1_Framework`facebook::react::TelemetryController::pullTransaction(this=0x00000003f4680f00, willMount=0x000000016d4f0c98, doMount=0x000000016d4f0c78, didMount=0x000000016d4f0c58) const at TelemetryController.cpp:39:3
    frame #22: 0x000000031a3c5b28 XPLAT_6_Framework`-[RCTMountingManager performTransaction:] + 544
    frame #23: 0x000000031a3c5864 XPLAT_6_Framework`-[RCTMountingManager initiateTransaction:] + 456
    frame #24: 0x000000031a3c5240 XPLAT_6_Framework`__42-[RCTMountingManager scheduleTransaction:]_block_invoke + 308
    frame #25: 0x0000000131f81b84 BOTTOMFramework`__RCTExecuteOnMainQueue_block_invoke + 40
    frame #26: 0x000000018017c788 libdispatch.dylib`_dispatch_call_block_and_release + 24
    frame #27: 0x0000000180197278 libdispatch.dylib`_dispatch_client_callout + 12
    frame #28: 0x00000001801b2fcc libdispatch.dylib`_dispatch_main_queue_drain.cold.7 + 24
    frame #29: 0x000000018018c1c4 libdispatch.dylib`_dispatch_main_queue_drain + 1184
    frame #30: 0x000000018018bd14 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 40
    frame #31: 0x0000000180427fec CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
    frame #32: 0x00000001804229f8 CoreFoundation`__CFRunLoopRun + 1920
    frame #33: 0x0000000180421e3c CoreFoundation`CFRunLoopRunSpecific + 536
    frame #34: 0x0000000190f62d00 GraphicsServices`GSEventRunModal + 164
    frame #35: 0x0000000185bcec98 UIKitCore`-[UIApplication _run] + 796
    frame #36: 0x0000000185bd3064 UIKitCore`UIApplicationMain + 124
    frame #37: 0x0000000115fbf0bc PRODUCTFramework`main + 200
    frame #38: 0x00000001114293d8 dyld_sim`start_sim + 20
    frame #39: 0x0000000111506b4c dyld`start + 6000
```

Reviewed By: rubennorte

Differential Revision: D74654157

fbshipit-source-id: 9181bcd28524c71d0ca4620bd630dc0baa172386
2025-05-13 13:59:51 -07:00
Tomasz ZawadzkiandFacebook GitHub Bot 4a8fda83e3 Fix deprecation message for BindingsInstallerHolder (#51295)
Summary:
This PR replaces non-existent `BindingsInstaller` with `BindingsInstallerHolder` in deprecation message for old variant of `BindingsInstallerHolder`.

## Changelog:

[GENERAL] [FIXED] - Fixed deprecation message for `BindingsInstallerHolder`

Pull Request resolved: https://github.com/facebook/react-native/pull/51295

Reviewed By: javache

Differential Revision: D74656439

Pulled By: cortinico

fbshipit-source-id: b29ffabbc8f8218e13d305e9f5143f084fea8dea
2025-05-13 12:47:14 -07:00
Vincent RiemerandFacebook GitHub Bot 49002fa0b4 Expose ShadowNodeFamily to RawEvent (#51267)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51267

Changelog: [Internal]

This diff exposes the corresponding target ShadowNodeFamily to a RawEvent through a weak pointer. This is necessary for the upcoming move of pointer event interception from the JS to main thread.

Reviewed By: javache

Differential Revision: D74500630

fbshipit-source-id: 3bcf32855a004e091be64b6171dc65127375534c
2025-05-13 11:23:17 -07:00
Nicola CortiandFacebook GitHub Bot 4fda28ee4c Remove the "Newer Patch Available" logic from @react-native-bot (#51286)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51286

This bog action is not really useful. It's currently buggy and spams the user twice + we agreed it provide little value for the user.
Therefore we're removing this message for the time being.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D74645716

fbshipit-source-id: a6b8aa6aa3f3f101ad649d2590bbcb2dc80ee30a
2025-05-13 10:38:05 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 80eed4a4a7 Fix data race in usage of ShadowTreeRevisionConsistencyManager (#51293)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51293

# Changelog:
[Internal] -

Indirect consequence of https://github.com/facebook/react-native/pull/50484, TSAN started to detect a data race in some configurations.

It's possible to have the data race between the `ShadowTreeRevisionConsistencyManager` being set in `RuntimeScheduler` and it being already used in the executor thread (as these things are generally done from different threads).

Differential Revision: D74651070

fbshipit-source-id: bda49371d541815119f119e6986de39c21f9b374
2025-05-13 09:39:04 -07:00
Nicola CortiandFacebook GitHub Bot 1d5bbf1ccf Cleanup several warnings inside DisplayMetricsHolder (#51074)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51074

While working on this class I noticed there are a number of warnings. Let's clean them up.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D74001269

fbshipit-source-id: 7e86ffdaf9c82ff5a165618813fa700f8e850a74
2025-05-13 08:44:29 -07:00
Mateo GuzmánandFacebook GitHub Bot 2c1726a073 Suppress unused androidx.core.content.res.use warning (#51272)
Summary:
Follow up from https://github.com/facebook/react-native/pull/51170, static code analysis shows androidx.core.content.res.use as unused, it looked pretty harmless to remove it as there was no context about its usage, but it caused some crashes.

I'm suppressing the warning here, plus adding an explanation on why it is needed to prevent a future developer from touching this file and causing the same regression.

## Changelog:

[INTERNAL] - Suppress unused androidx.core.content.res.use warning

Pull Request resolved: https://github.com/facebook/react-native/pull/51272

Test Plan: Static code analysis should not show the import as unused.

Reviewed By: cortinico

Differential Revision: D74642726

Pulled By: rshest

fbshipit-source-id: 14cec4fe92f06827636410df4b88a3b7088abe52
2025-05-13 08:02:22 -07:00
Vitali ZaidmanandFacebook GitHub Bot f5fba73439 Update debugger-frontend from bc635fa...3d17e0f (#51292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51292

Changelog: [Internal] - Update `react-native/debugger-frontend` from bc635fa...3d17e0f

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/bc635fa428baf08a0667f89e3ee03f92c2f96416...3d17e0fd462dc698db34586697cce2371b25e0d3).

Reviewed By: hoxyq

Differential Revision: D74648171

fbshipit-source-id: d2c45b6d27ab71a933a7c6d6fedc07abc13cf3d2
2025-05-13 07:39:12 -07:00
Nick LefeverandFacebook GitHub Bot 4166cc0dd8 Fix NaN value comparison for paragraph props diffing (#51289)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51289

Because NaN is always different from NaN, these Float props were always included in the diff when set to NaN. This checks for the specific case where both the current and the prev prop value is NaN.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74647582

fbshipit-source-id: 7941dcc6a96bed13c2e43232606bd1f9a9179606
2025-05-13 07:02:10 -07:00
Samuel SuslaandFacebook GitHub Bot 3e3f8eade5 enable enableEagerAlternateStateNodeCleanup in tests (#51291)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51291

changelog: [internal]

enable enableEagerAlternateStateNodeCleanup in tests and remove workarounds.

Reviewed By: rubennorte

Differential Revision: D74643973

fbshipit-source-id: 00f9a6b36546fdea246b587e0e716c7aa76c6bbc
2025-05-13 07:00:26 -07:00
Nick LefeverandFacebook GitHub Bot 76ed662f1e Fix numberOfLines prop diffing for Paragraph component (#51277)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51277

The number of lines prop diffing was not being updated when enabling Props 2.0 and when set through the paragraph attributes. This diff fixes the typo that was causing the bug.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74619497

fbshipit-source-id: 2ad7d1629106ff16d511760694dcef0cafd9a96e
2025-05-13 05:27:17 -07:00
Nick LefeverandFacebook GitHub Bot cde792ae5e Add getDiffProps for TextInput component - Android text input props (#51276)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51276

This diff adds the Android specific props to the `getDiffProps` implementation and enables `TextInput` components for Props 2.0 use in the Fabric mounting manager

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74610303

fbshipit-source-id: c45abf2b272f5dfb50f4f1bad256e9130a808900
2025-05-13 05:27:17 -07:00
Nick LefeverandFacebook GitHub Bot 63c0287c83 Add getDiffProps for TextInput component - base text input props (#51275)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51275

See title

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74610301

fbshipit-source-id: cbd3f8eab75838f8b68a668ec44d3e14aa591f25
2025-05-13 05:27:17 -07:00
Nick LefeverandFacebook GitHub Bot d08e668a1a Add getDiffProps for TextInput component - paragraph attributes (#51274)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51274

See title

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74610302

fbshipit-source-id: ef1f946e0b7f7b51c06da167e5b8df2fc57933f6
2025-05-13 05:27:17 -07:00
Mateo GuzmánandFacebook GitHub Bot d7b056c198 Migrate JSTouchDispatcher to Kotlin (#51242)
Summary:
Migrate com.facebook.react.uimanager.JSTouchDispatcher to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.uimanager.JSTouchDispatcher to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/51242

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D74568593

Pulled By: rshest

fbshipit-source-id: 2ce0087ce96025fd85aab2d61806cc9ada1d68cd
2025-05-13 05:05:51 -07:00
Mateo GuzmánandFacebook GitHub Bot 436bddadda Migrate ModuleSpec to Kotlin (#51240)
Summary:
Migrate com.facebook.react.bridge.ModuleSpec to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.bridge.ModuleSpec to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/51240

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D74568550

Pulled By: rshest

fbshipit-source-id: 15cedc9e97f95aa2582ce12c9086336c12564371
2025-05-13 05:03:09 -07:00
Vitali ZaidmanandFacebook GitHub Bot 9b4be02ae8 standardize error messages thrown from inspector proxy when connection is closed to debugger (#51227)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51227

Standardize error messages thrown from inspector proxy when connection is closed to debugger and link to where they are used in `react-native-devtools-frontend`

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D74484316

fbshipit-source-id: 7885bc5ea41397539814f97d764c9a376ef50eaa
2025-05-13 04:38:29 -07:00
React Native BotandFacebook GitHub Bot d06c28833f Add changelog for v0.80.0-rc.1 (#51266)
Summary:
Add Changelog for 0.80.0-rc.1

## Changelog:
[Internal] - Add Changelog for 0.80.0-rc.1

Pull Request resolved: https://github.com/facebook/react-native/pull/51266

Test Plan: N/A

Reviewed By: arushikesarwani94

Differential Revision: D74592294

Pulled By: cortinico

fbshipit-source-id: 0f06d14ddec054bea2f09e9e34079516eb0f9256
2025-05-13 03:52:20 -07:00
Tim YungandFacebook GitHub Bot 12b2b56102 RN: Enable Hermes GC on Memory Pressure Warning (iOS) (#51271)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51271

Deletes the feature flag that was gating the new logic to invoke Hermes GC when iOS emits a memory pressure warning.

Changelog:
[iOS][Changed] - Hermes GC is now triggered in response to iOS memory pressure warning.

Reviewed By: fkgozali

Differential Revision: D74605206

fbshipit-source-id: b0753b15f5a30f37ed17bfebff0b491c7e7a6b59
2025-05-12 20:22:54 -07:00
Pieter VanderwerffandFacebook GitHub Bot e30ba139b6 Deploy 0.270.0 to xplat (#51278)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51278

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D74622474

fbshipit-source-id: 6735c16ed9677050dc476e30671448d52c5ed6dd
2025-05-12 19:39:07 -07:00
Mateo GuzmánandFacebook GitHub Bot d469cca4ba Make SoftAssertions internal (#51172)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.bridge.SoftAssertions).

## Changelog:

[INTERNAL] - Make com.facebook.react.bridge.SoftAssertions internal

Pull Request resolved: https://github.com/facebook/react-native/pull/51172

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D74368288

Pulled By: arushikesarwani94

fbshipit-source-id: 50e9559f7f15700ea9adfb03a260615e3b397a0c
2025-05-12 17:22:24 -07:00
Mateo GuzmánandFacebook GitHub Bot 23e693ad67 Make ReactSoftExceptionLogger internal (#51173)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.bridge.ReactSoftExceptionLogger).

## Changelog:

[INTERNAL] - Make com.facebook.react.bridge.ReactSoftExceptionLogger internal

Pull Request resolved: https://github.com/facebook/react-native/pull/51173

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D74368261

Pulled By: arushikesarwani94

fbshipit-source-id: 913d790eb64ffda6bb48ddf69dd5ab996cd363d9
2025-05-12 17:22:24 -07:00
HyunWoo LeeandFacebook GitHub Bot b2ffd34a39 Refactor ReactAndroid to use buildReadableMap, buildReadableArray DSL (#51145)
Summary:
This PR refactors the entire ReactAndroid package to replace manual `Arguments.createMap()…` and `Arguments.createArray()…` calls with the new Kotlin DSL helpers `buildReadableMap { … }` and `buildReadableArray { … }`. All eligible call sites have been migrated to the DSL, except in functions whose signatures explicitly declare or return WritableMap or WritableArray.

No runtime behavior changes are introduced; existing functionality and tests continue to pass unchanged.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [CHANGED] Apply Collections DSL on ReactAndroid package

Pull Request resolved: https://github.com/facebook/react-native/pull/51145

Test Plan:
```
yarn android
yarn test-android
```

Reviewed By: rshest

Differential Revision: D74401357

Pulled By: cortinico

fbshipit-source-id: 0f7b7dfbb7b495675bc4730bdf018666e9041884
2025-05-12 16:35:07 -07:00
Joe VilchesandFacebook GitHub Bot d362e496eb Fix string comparison when self has accessibility order reference (#51270)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51270

I was informed that we could not reference ourselves with accessibility order when using `useID`. The reason for that ended up being because of this if statement which uses `==`. Note this worked with a normal string like `"foo"` but `useID` has ids like `"<<r0>>"` so I imagine the < and > made this break.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74601689

fbshipit-source-id: 25adc84248fbfcaff36607d18c170e6c8000cffb
2025-05-12 15:09:18 -07:00
Mofei ZhangandFacebook GitHub Bot af4cfbf03f repro edge cases for noEmit and module opt-outs (#33144)
Summary:
see test fixtures
 ---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/33144).
* #33146
* #33145
* __->__ #33144

DiffTrain build for [fbe7bc21b9aa00afa230132b3f7eee6d2b5c94a7](https://github.com/facebook/react/commit/fbe7bc21b9aa00afa230132b3f7eee6d2b5c94a7)

Reviewed By: jackpope

Differential Revision: D74404265

fbshipit-source-id: 8a2fc2856e2da9ca7c63d8d49191c4f9e6b015b9
2025-05-12 13:51:47 -07:00
Fabrizio CucciandFacebook GitHub Bot 4918b30f49 Kotlinify ViewManagerRegistry (#51262)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51262

As per title.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D74571782

fbshipit-source-id: 4acec9b9c0801d863074b7a91fb116780f22929a
2025-05-12 13:50:10 -07:00
Ruslan LesiutinandFacebook GitHub Bot 7430ee0b99 Define precise return types for toJs conversions, instead of generic jsi::Value (#51224)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51224

Changelog: [Internal]

We have a bunch of places where we rely on implicit conversion operators of `jsi::Value` and return some primitive type.

This doesn't work well with Bridging, because currently it doesn't take into account these implicit operator conversions: primitives won't be treated as primitivies, but rather as generic `jsi::Value`, which could be many things.

We should be explicit about return type in `toJs`, because it affects the type checking logic.

Reviewed By: javache

Differential Revision: D74478571

fbshipit-source-id: 0633159c5af3a02aafe14e2b137c133d4554a5f8
2025-05-12 12:38:58 -07:00
Ruslan LesiutinandFacebook GitHub Bot e403b510d0 Support bridging for Class methods return types (#51223)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51223

Changelog:
[General][Added] - Added support for bridging Class methods return types

Previously, this wouldn't work, unless you define your C++ implementation of the TM to have primitive return type that can be converted to JavaScript's type.

Reviewed By: javache

Differential Revision: D74478572

fbshipit-source-id: 75c7f589559394704446be1ebac245d38a5c4b2b
2025-05-12 12:38:58 -07:00
Mohamed SalamaandFacebook GitHub Bot 775c16d8b4 Revert D74567102: Migrate PromiseImpl to Kotlin
Differential Revision:
D74567102

Original commit changeset: 1a7a36a88c04

Original Phabricator Diff: D74567102

fbshipit-source-id: 30814137c711757079fdc574dd21715089b23a25
2025-05-12 10:11:02 -07:00
Pieter De BaetsandFacebook GitHub Bot 5413304530 Convert com.facebook.react.runtime.ReactHostImpl to Kotlin (#51017)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51017

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D73846053

fbshipit-source-id: 98017000e8f10df4156b232bc8b5d6e132502ea5
2025-05-12 10:02:19 -07:00
Tim YungandFacebook GitHub Bot 7e5a2663f9 RN: Simplify createAnimatedPropsHook-test.js (#51234)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51234

Since `createAnimatedPropsHook-test.js` no longer needs to override feature flags, clean up some of the extra logic.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D74535116

fbshipit-source-id: 09dd4c5085f6ee1cbf7d87ab2b7c320119e69651
2025-05-12 09:15:43 -07:00
Szymon RybczakandFacebook GitHub Bot 0925ee8545 Update Callstack description in ECOSYSTEM.md (#51226)
Summary:
Updates Callstack's description in `ECOSYSTEM.md` file.

## Changelog:

[Internal] - Updates Callstack's description in `ECOSYSTEM.md` file.

Pull Request resolved: https://github.com/facebook/react-native/pull/51226

Test Plan: n/a

Reviewed By: NickGerleman

Differential Revision: D74483225

Pulled By: cortinico

fbshipit-source-id: baab5984b4580c0395c1a987a8890d8465e139f1
2025-05-12 08:14:45 -07:00
Rubén NorteandFacebook GitHub Bot 0766587b5d Add playground benchmark (#51259)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51259

Changelog: [internal]

We recently added `Playground-itest` as a quick way to test things with Fantom without committing them.

This does the same for benchmarks, so we can quickly answer questions like:

> is `key in obj` faster than `obj[key]`?

Without having to create a new benchmark manually.

Reviewed By: yungsters

Differential Revision: D74578297

fbshipit-source-id: d86604d459f15652d0c2e1ad16a99d011a1324ca
2025-05-12 07:59:59 -07:00
Evan BaconandFacebook GitHub Bot eedd60b9e6 chore: convert View to React 19 (#51023)
Summary:
- Convert View implementation to React 19:
  - Remove legacy `forwardRef` in favor of built-in `ref` prop.
  - Use `use` API instead of `useContext`.
  - Drop the extraneous `.Provider` for `TextAncestor` context.
  - Remove `displayName` in favor of component name. I'm not 100% sure this is a full fallback but it is valid according to `react/display-name` eslint rule—https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/display-name.md
- Based on discussion with Nicola Carti and Riccardo Cipolleschi.
- I tried using flow `component` keyword but it's not enabled in this project. Given the `react-native` package is shipped untranspiled, it's probably safer to avoid newer flow types.
- Overall matched the component style of LogBox.
- It's unclear the exact right way to type a ref since it should be optional for external users of the component but required inside the component. Erring on the side of caution and using optional types so users don't get type errors when `ref` isn't defined.

## Changelog:

[GENERAL] [BREAKING] Upgrade `View` component to React 19.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/51023

Test Plan: - Type checks should pass.

Reviewed By: rshest

Differential Revision: D74546184

Pulled By: yungsters

fbshipit-source-id: b8257e3a75477c1117b19cd3f8e0843947b092ca
2025-05-12 07:14:22 -07:00
Samuel SuslaandFacebook GitHub Bot 5d7f35cd7c add test for BaseTextProps.writingDirection (#51245)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51245

changelog: [internal]

Add test to prevent https://github.com/facebook/react-native/issues/51235 from happening in the future.

Reviewed By: cipolleschi, rubennorte

Differential Revision: D74571453

fbshipit-source-id: 49d8400543516a861c9034a8be562ee81b323c25
2025-05-12 06:14:14 -07:00
Jakub PiaseckiandFacebook GitHub Bot c9f2055097 Fix generated types in @react-native/virtualized-lists being used without opt-in (#51246)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51246

Changelog: [General][Fixed] Fix generated types in react-native/virtualized-lists being used without opt-in

D71969602 introduces `exports` field to `package.json` files in `react-native` and `virtualized-lists`. In that diff, the `types` in `virtualized-lists` by default pointed to the new generated types without requiring the opt-in.

This fixes that by requiring the opt-in before using the generated types.

Reviewed By: huntie

Differential Revision: D74573321

fbshipit-source-id: fe05b0204a7200c1c91aac2614aa786bbbced2a5
2025-05-12 04:53:20 -07:00
Mateo GuzmánandFacebook GitHub Bot 25abb0acdf Migrate PromiseImpl to Kotlin (#51241)
Summary:
Migrate com.facebook.react.bridge.PromiseImpl to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.bridge.PromiseImpl to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/51241

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D74567102

Pulled By: cortinico

fbshipit-source-id: 1a7a36a88c0499e5bc35dc37d276219aaf823c90
2025-05-12 04:48:28 -07:00
Nick LefeverandFacebook GitHub Bot a12d9f9d33 Fix image source size props in getDiffProps (#51222)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51222

The size parameters are flattened in the source object in the Android image component. This diff converts the `size` object to `width` and `height` props directly set on the source object, fixing image source setting more than one image source.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D74477884

fbshipit-source-id: f6064b4222d5eeafd5d74f9a2044babedd1e291b
2025-05-12 04:01:03 -07:00
Nick LefeverandFacebook GitHub Bot 3edc8d4e2c Add getDiffProps for Paragraph component (#51219)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51219

See title

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D74473177

fbshipit-source-id: 88d8d29a1640fd9217460ac04f172f821bb47a91
2025-05-12 04:01:03 -07:00
Nick LefeverandFacebook GitHub Bot 571a0ae7bc Add getDiffProps for Text component (#51218)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51218

See title

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D74473101

fbshipit-source-id: 7303a8b184f42e8b264a2d37c5a6570252c64d54
2025-05-12 04:01:03 -07:00
Nick LefeverandFacebook GitHub Bot 0cdf5c16b4 Add updateDiffProps to BaseTextProps (#51217)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51217

Add helper method to build the prop diffing based on the BaseTextProps which are used by the Text and Paragraph props.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D74473004

fbshipit-source-id: 0ae8c0c033ee136da3b8376bd485f8926310dcd4
2025-05-12 04:01:03 -07:00
zhongwuzwandFacebook GitHub Bot 3461e98936 Fabric: Fixes Text style prop 'writingDirection' not working on IOS New Architecture (#51238)
Summary:
Fixes https://github.com/facebook/react-native/issues/51235 .

## Changelog:

[IOS] [FIXED] - Fabric: Fixes Text style prop 'writingDirection' not working on  IOS New Architecture

Pull Request resolved: https://github.com/facebook/react-native/pull/51238

Test Plan: Repro please see https://github.com/facebook/react-native/issues/51235

Reviewed By: sammy-SC

Differential Revision: D74564832

Pulled By: cipolleschi

fbshipit-source-id: 82702ec3b3e963c454e23a9b18543cae6f378749
2025-05-12 03:56:25 -07:00
Mateo GuzmánandFacebook GitHub Bot 77fccb73fe Make DeprecatedInNewArchitecture internal (#51201)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.common.annotations.DeprecatedInNewArchitecture).

This class in particular is not in the ReactAndroid.api, so I have the question on whether we should leave these annotations marked as public in case we are already reducing the visibility in another way (and If that's the case, we can close this PR)

## Changelog:

[INTERNAL] - Make com.facebook.react.common.annotations.DeprecatedInNewArchitecture internal

Pull Request resolved: https://github.com/facebook/react-native/pull/51201

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D74461086

Pulled By: cortinico

fbshipit-source-id: a58aa4794c91d632ce9f21a1021de7aa23e662f8
2025-05-12 03:46:30 -07:00
Riccardo CipolleschiandFacebook GitHub Bot a3da4abb31 Remove react-native-exit-app from nightly testing (#51230)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51230

react-native-exit-app last commit is from 2 years ago.
Removing it as it is broken with our nightly integration

## Changelog:
[Internal] - Remove react-native-exit-app from nightly testing

Reviewed By: cortinico

Differential Revision: D74527792

fbshipit-source-id: 0974b2d857aa6f76c59b0411204798a5fe48cffe
2025-05-12 02:36:39 -07:00
Jakub PiaseckiandFacebook GitHub Bot 32ce95cc01 Move transforms to build-types (#50982)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50982

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D73667539

fbshipit-source-id: dc9ab6f3efef17f8ffd58a854363b39a31ec59d7
2025-05-11 22:49:43 -07:00
Tim YungandFacebook GitHub Bot 77c1eb6154 RN: Migrate VirtualView to Feature Flags (#51233)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51233

Migrates internal operational and experimental feature flags to React Native's feature flag system, in order to simplify integration of other infrastructure features (e.g. Fantom).

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D74534921

fbshipit-source-id: 1559cba4f208a554bb043a203f331062036c60de
2025-05-11 00:30:21 -07:00
Rubén NorteandFacebook GitHub Bot 996be87071 Add Playground test (#51220)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51220

Changelog: [internal]

Just a playground file to do quick tests in the Fantom environment.

For example, I just used it to know if Hermes supports `AggregateError`, which does:

```
  it('...', () => {
    console.log('AggregateError', global.AggregateError);
  });
```

{F1977824992}

Reviewed By: lenaic

Differential Revision: D74474870

fbshipit-source-id: cbe8a287738b09afe336ae479cc3105d1474e58b
2025-05-10 01:53:28 -07:00
Jan KassensandFacebook GitHub Bot 32fafdf980 cleanup shipped flag enableFabricCompleteRootInCommitPhase
Summary:
Flag was removed in {D74196673}, this cleans up the dynamic flag.

bypass-github-export-checks

Changelog: [internal]

Reviewed By: jackpope

Differential Revision: D74493584

fbshipit-source-id: 6ade542b7e1bd9c4367b7dbef4d2f1ec2d79d0df
2025-05-09 23:01:51 -07:00
Chi TsaiandFacebook GitHub Bot 891ee78f13 Add JSI APIs setRuntimeData and getRuntimeData (#50197)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50197

Adds `setRuntimeData` and `getRuntimeData` JSI APIs. This provides a
convenient way for users to store some custom data associated with an
UUID.

For the default implementation of this feature, store the runtime data
in the global map that is shared between all VMs. This is done to keep
JSI lightweight and stateless, instead of adding data members.

Changelog: [Internal]

Reviewed By: neildhar

Differential Revision: D71579532

fbshipit-source-id: 553e28fbf80c93e268d475860197a00d2c5bacf7
2025-05-09 21:07:15 -07:00
Chi TsaiandFacebook GitHub Bot 499fcfad53 Add UUID struct to JSI (#50270)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50270

Add UUID struct to JSI. This will be used in the incoming changes, such
as identifying JSI interfaces and storing custom runtime data.

Changelog: [Internal]

Reviewed By: tmikov

Differential Revision: D71826382

fbshipit-source-id: e0d9bc20fb0f0e75407b9c88e731623e6a9975dd
2025-05-09 21:07:15 -07:00
Chi TsaiandFacebook GitHub Bot 316f86f29f Build JSI with C++17 (#50413)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50413

Build JSI with C++17.

Changelog: [Internal]

Reviewed By: dannysu

Differential Revision: D72079417

fbshipit-source-id: 3b7796a100db8db75a7089423be303312a4f0e10
2025-05-09 21:07:15 -07:00
generatedunixname89002005287564andFacebook GitHub Bot cda82f5dd8 fbsource//xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated:animatedAndroid (#51215)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51215

Reviewed By: javache

Differential Revision: D74463923

fbshipit-source-id: a2494b9f1881b40488d284f84dbaafc807c2a2e9
2025-05-09 17:19:14 -07:00
Nick GerlemanandFacebook GitHub Bot 71ef049065 Directly Trust Text Layout Width (#51206)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51206

When we create a layout from measure constraints, we do some processing of the width, to return a different one, potentially smaller than the layout width, sometimes using line width, and sometimes using the container width.

This logic has gotten spooooky over time, and after a series of changes, and bugfixes, now effectively does nothing!

1. Way back in 2020, yungsters made D21056031 introducing this logic to "shrink wrap" text which is wrapped.
2. "Shrink wrapping" is not how web works when text is wrapped, (though it is how it works when there is explicit newline), and https://github.com/facebook/react-native/pull/47435 later undid this change
3. https://github.com/facebook/react-native/pull/37790 made changes specific to the case of trailing newline, because the logic to "shrink wrap" did not handle correctly.

After D74366936, which changes width used for layout creation to correctly respect `Layout.desiredWidth`, we should be back to multiline layouts, with no paragraph whose lines take up more than container width, being "shrink wrapped", while not doing so when there is wrapping or ellipsization, like current behavior. The desired width also excludes the non-visible trailing whitespace.

It means we can remove all of this logic, while preserving the same behavior. Mismatched measure widths from those used in the intermediate layout may also result in issues for Facsimile (see example in last diff of stack).

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D74368513

fbshipit-source-id: df5d7b773ad1888ebca1966ee4020a5c2ce7fd64
2025-05-09 12:52:36 -07:00
Mateo GuzmánandFacebook GitHub Bot 3a84d42aa1 Make RetryableMountingLayerException internal (#51171)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.bridge.RetryableMountingLayerException).

## Changelog:

[INTERNAL] - Make com.facebook.react.bridge.RetryableMountingLayerException internal

Pull Request resolved: https://github.com/facebook/react-native/pull/51171

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D74381780

Pulled By: cortinico

fbshipit-source-id: 6d7255318669ac8edd0010d9655a105e72adf011
2025-05-09 10:40:19 -07:00
Pieter De BaetsandFacebook GitHub Bot cf428bde1c Simplify StubViewTree creation (#51221)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51221

In the case of an empty root node, we don't need `buildStubViewTreeWithoutUsingDifferentiator` to create the initial `StubViewTree`

When testing with Fantom, this caused an additional unnecessary clone of RootShadowNode.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D74472766

fbshipit-source-id: 076e859a6c5795e9026c7a5f8246a5658db4a94b
2025-05-09 08:36:44 -07:00
Nicola CortiandFacebook GitHub Bot 35c96007eb Fix the use import on DefaultStyleValuesUtil (#51214)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51214

D74381864 caused a series of crashes to spike due to .IncompatibleClassChangeError: Class 'android.content.res.TypedArray' does not implement interface 'java.lang.AutoCloseable'

This fixes it.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D74468593

fbshipit-source-id: 70c14bdba4f229d4f59a01da3b56cd4fec29752f
2025-05-09 08:24:52 -07:00
Vitali ZaidmanandFacebook GitHub Bot 0750b5f040 Improve the error thrown when a bundle fails to load (#51070)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51070

Changelog: [General][Internal][Breaking] When a bundle is failing to load throw an error of special type.

### Breaking
`didCompleteNetworkResponse` now throws an Error instead of throwing a string.

In dev, we use [lazy bundling](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0605-lazy-bundling.md#__loadbundleasync-in-metro) which allows us to re-build only the parts of the app that are changed.

However the function that loads these lazy bundles in `loadBundleFromServer.js` for requests that reach `didCompleteNetworkResponse` with an error **throws a string representing the error message** which makes debugging very inconvenient because it lacks stack trace and error type. Throwing strings is not a standard practice. We better throw an error in these cases so it can be handled better.

Why a special type of error?
* As you can see in the "after", in the test plan below, even with a stack trace, it might be hard to know where this error originates from
* Also so extra information can be added on it. Currently adding "url"
* Also to support error handling based on the type of error

Reviewed By: hoxyq

Differential Revision: D73925027

fbshipit-source-id: a0f98d283ec8842696f1b87864fb63cb30c0c028
2025-05-09 07:24:37 -07:00
Rubén NorteandFacebook GitHub Bot 54499d8007 Ensure LogBox is disabled in Fantom tests (#51210)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51210

Changelog: [internal]

This adds a safety mechanism to Fantom tests to prevent LogBox from swallowing errors.

Now we validate that LogBox isn't installed when running tasks, so we can properly fix error reporting in tests.

Reviewed By: rshest

Differential Revision: D74464749

fbshipit-source-id: ef5e814b14aedbc681a4c7f9f8f60f454b239b6d
2025-05-09 07:11:24 -07:00
Rubén NorteandFacebook GitHub Bot 30363070a3 Define Fantom specific initialization module (#51211)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51211

Changelog: [internal]

This modifies the setup for Fantom so:
1. We don't inject "InitializeCore" by default.
2. We define a default environment setup module for Fantom with good defaults (LogBox, etc. disabled).

We also migrate all existing tests to use the new module.

The goal of this is to prevent LogBox from being used in tests so we can properly fix error propagation in the work loop (so they're not intercepted by it).

Reviewed By: rshest

Differential Revision: D69003812

fbshipit-source-id: 00353b5055e3700943a08ea67f698d49e068555b
2025-05-09 07:11:24 -07:00
Rubén NorteandFacebook GitHub Bot 9494eee868 Extract RN environment setup to a specific module (#51209)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51209

Changelog: [internal]

This refactors `InitializeCore` to extract the initialization logic to a separate configurable module.

By default, this does the same thing it does now, but the new module could be used without `InitializeCore` to set up the environment forcing disabling developer tools (e.g.: for testing in Fantom in development environments).

Reviewed By: rshest

Differential Revision: D69003811

fbshipit-source-id: ab85b10e4f21adccd8844a848d3272c407832031
2025-05-09 07:11:24 -07:00
Rubén NorteandFacebook GitHub Bot 7e640b5dd3 Add additional test cases for error handling in Fantom event loop (#51208)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51208

Changelog: [internal]

Adding a few more test cases to make sure error handling is fixed considering these use cases.

Reviewed By: rshest

Differential Revision: D74459974

fbshipit-source-id: 9a5865a9a09dd64535b4d38307db6c30f213b45f
2025-05-09 07:11:24 -07:00
Christian FalchandFacebook GitHub Bot 8f722937ff Add Package.swift file to prebuild React native core (#51197)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51197

This change adds the Package.swift file that can finally build React Native core using SPM

## Changelog:
[Internal] - Add Swift PM file to uild React Native Core using SwiftPM

Test Plan:
prepare the repo with
```
node packages/react-native/scripts/ios-prebuilds.js
```
and by downloading the ReactNativedependencies from the CI

Then open the Package.swift file in Xcode. I successfully built:
- iOS
- iOS Simulator
- Mac Catalyst

Reviewed By: lenaic

Differential Revision: D74393435

Pulled By: cipolleschi

fbshipit-source-id: 7d61ad1d09444a0c16e865062ae448ec1e7ef5ad
2025-05-09 03:19:47 -07:00
Yannick LoriotandFacebook GitHub Bot 7a72037b37 Revert D74291373: Ensure that ShadowNode measure functions respect constraints
Differential Revision:
D74291373

Original commit changeset: 44166f2e4732

Original Phabricator Diff: D74291373

fbshipit-source-id: 54a4dd0af1c020caacebe6f02cb95eba0c95c62f
2025-05-09 01:45:16 -07:00
Yannick LoriotandFacebook GitHub Bot 435d2e84ef Revert D74292949: Expose Unsnapped Dimensions
Differential Revision:
D74292949

Original commit changeset: 05011c66a9a9

Original Phabricator Diff: D74292949

fbshipit-source-id: c6ca51c7b882950d54b6a43e206973774db40429
2025-05-09 01:45:16 -07:00
Ramanpreet NaraandFacebook GitHub Bot f00fbaedbe Revert D74361644: IntersectionObserver: Clean up shadow nodes after unobserve
Differential Revision:
D74361644

Original commit changeset: 1a5ccce1486a

Original Phabricator Diff: D74361644

fbshipit-source-id: 89792482a09501aed24c21627c44b3229a0c7a32
2025-05-08 22:11:27 -07:00
Ramanpreet NaraandFacebook GitHub Bot a55f430daa IntersectionObserver: Clean up shadow nodes after unobserve
Summary:
After unobserve is called, the shadow node actually isn't deleted from the `targetToShadowNode` WeakMap. So, if the element is kept around, the shadow node will leak.

We suspect this doesn't happen in practice. But, still it's good to just do this cleanup, just in case.

Changelog: [General][Fixed] Fix potential leak inside IntersectionObserver

Reviewed By: lunaleaps, yungsters

Differential Revision: D74361644

fbshipit-source-id: 1a5ccce1486aa200fc7318c689bfa887f713c284
2025-05-08 20:52:13 -07:00
Ramanpreet NaraandFacebook GitHub Bot e6516f2d7b IntersectionObserver: Migrate js infra to shadow node family (#51148)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51148

Intersection observer should not be holding on to shadow nodes.

This diff migrates the javascript infra to instead use families.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74262804

fbshipit-source-id: cc090be54f7312ce32b853ddf86567bb43e676b8
2025-05-08 20:52:13 -07:00
Ramanpreet NaraandFacebook GitHub Bot a4be563935 Migrate IntersectionObserverManager to shadow node family
Summary:
IntersectionObserverManager now uses families to manage IntersectionObservers.

This diff just migrates its apis to family too.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74263375

fbshipit-source-id: d2e5fda327dfc75f0f711932626643d49cb3322f
2025-05-08 20:52:13 -07:00
Nick GerlemanandFacebook GitHub Bot 8ed5ccca62 Expose Unsnapped Dimensions (#51181)
Summary:
X-link: https://github.com/facebook/yoga/pull/1809

Pull Request resolved: https://github.com/facebook/react-native/pull/51181

We want to know if an artifact created during measurement can fully be reused after final layout, but the final layout is allowed to be slightly larger due to pixel grid rounding (while still allowing reuse). It's hard to tell after the fact, whether it is larger because of this rounding (though the measure is used), or if it may be a pixel larger for valid reasons.

We can expose the unsnapped dimensions of a node to give us this information, and to correlate measurement artifacts.

This is most of the time the same as the layout's measured dimension, though I don't think it's safe to use this, since anything else measuring the node after could clobber this (I think `YGNodeLayoutGetOverflow` may also be prone to this as a bug).

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74292949

fbshipit-source-id: 05011c66a9a9480544313eb1dfe2c46bf7742bac
2025-05-08 17:45:16 -07:00
Nick GerlemanandFacebook GitHub Bot 99119a2104 Fix TextLayoutManager MeasureMode Regression (#51183)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51183

D58818560 tried to deduplicate some code, but introduced an error, where we no longer correctly incorporate the width MeasureMode into the text layout that we create, instead, passing `YogaMeasureMode.EXACTLY`.

In effect, this means the Android layout created always takes up the maximum allowable space, even if content is smaller. This is later masked, because our returned measure when `AT_MOST` is based on maximum line length, and the layout is then recreated when drawing a TextView, but means:

1. Attachments may not be positioned correctly, when using a non-left-aligned paragraph alignment
2. Directly drawing the layout shows the wrong thing

Changelog:
[Android][Fixed] - Fix TextLayoutManager MeasureMode Regression

Reviewed By: rshest

Differential Revision: D74366936

fbshipit-source-id: 3eda8c716ba9790a61c2da19023e140afbb6971d
2025-05-08 16:18:01 -07:00
Nick GerlemanandFacebook GitHub Bot 1c52eec2c6 Ensure that ShadowNode measure functions respect constraints (#51180)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51180

Android's TextLayoutManager may return widths greather than the max measure constraint.

Yoga will clamp these, but this sort of issue points to a logic bug, and creates issues when we are looking at caching text measurements based on constraint reuse.

Let's debug assert that we don't do that, and fix a case of rounding up at a pixel boundary, to ensure that it doesn't go above max width. This should theoretically be safe, since Yoga is already doing this clamping, which is what dictates final size of the TextView.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74291373

fbshipit-source-id: 44166f2e47323384cb00f3cf4c32f398e298a63e
2025-05-08 14:41:50 -07:00
Christian FalchandFacebook GitHub Bot 65544024b3 Add script to prepare the .build folder to prebuild React Native with SwiftPM (#51195)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51195

This change adds a script that prepares the repository by creating hard links to the header files in the `.build` folder that is also gitignored

## Changelog:
[Internal] - Add sdcript to setup the repository so that we can build it properly.

Test Plan:
run:
```
node packages/react-native/scripts/ios-prebuilds.js
```
observe the folder `.build` being created with all the files.

Reviewed By: cortinico

Differential Revision: D74393116

Pulled By: cipolleschi

fbshipit-source-id: 4951e61b49db83fbebbcc265ae025f53185fec81
2025-05-08 12:59:49 -07:00
Christian FalchandFacebook GitHub Bot 500f458e5d Add utils script to create folders to prebuild React Native core (#51194)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51194

This change adds an utils script to set up folders when needed.

## Changelog:

[INTERNAL] - Add utils script

Test Plan: This is tested in the next diff of the stack.

Reviewed By: cortinico

Differential Revision: D74393298

Pulled By: cipolleschi

fbshipit-source-id: db3db61ec938d2ebe5c0bf5ae0a42aa20c673bb0
2025-05-08 12:59:49 -07:00
Christian FalchandFacebook GitHub Bot 43bfb5da11 building up to React Core (#50766)
Summary:
- Added multiple targets to Package.swift
- WIP: Builds up untill we need to touch files in React/Base

## Changelog:

[INTERNAL] - WIP: prebuilding using Swift packages

Pull Request resolved: https://github.com/facebook/react-native/pull/50766

Test Plan: This will be tested in a diff in the stack.

Reviewed By: cortinico

Differential Revision: D74386522

Pulled By: cipolleschi

fbshipit-source-id: 7bac3c21a362c4ef79d0104727cdd3494419012f
2025-05-08 12:59:49 -07:00
Mark VerlingieriandFacebook GitHub Bot a21a4b87c3 Allow fadingEdgeLength to be set independently on the start and end of the scrollview (#51174)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51174

Allows the start and end of the scrollview to be faded to different values independently by passing an object containing a "start" and "end" value to the fadingEdgeLength prop.

To support non-uniform edge lengths we use the [FadingEdgeStrength](https://developer.android.com/reference/android/view/View#getTopFadingEdgeStrength()) api to set different values for the start/end of the scrollview. The FadingEdgeStrength value is multiplied by the FadingEdgeLength value [internally by Android when drawing the view.](https://cs.android.com/android/platform/superproject/+/android15-qpr1-release:frameworks/base/core/java/android/view/View.java;l=25007)

Because the value of FadingEdgeStrength is required to be between 0 and 1, we set setFadingEdgeLength to the max value and set the smaller side as a percentage of that value.

Changelog: [Android][Added] Allow fadingEdgeLength to be set independently on the start and end of the scrollview

Reviewed By: martinbooth

Differential Revision: D74222606

fbshipit-source-id: 7010ca803cc48450ab98c2a457fdc72ff47c29d7
2025-05-08 10:59:32 -07:00
Nick LefeverandFacebook GitHub Bot 536aa67817 Add getDiffProps for RawText component (#51179)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51179

See title

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74365934

fbshipit-source-id: a1db8db1f3f2b63f3e3facd7070e9a12c01cbc5b
2025-05-08 09:37:26 -07:00
Nick LefeverandFacebook GitHub Bot 0dbfcda6c6 Add getDiffProps for ScrollView component (#51168)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51168

See title

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74327336

fbshipit-source-id: 9e306400578ac6d83c49537ab2c38e86209fbcfd
2025-05-08 09:37:26 -07:00
Nick LefeverandFacebook GitHub Bot 4591bb2909 Add missing ScrollView props to ScrollProps (#51167)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51167

Adding the ScrollView properties that are android specific to the common ScrollView props so that they can be diffed in a getDiffProps implementation.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74327335

fbshipit-source-id: 8e5683d4bf7fe0f6d54d4b97f535731721c60292
2025-05-08 09:37:26 -07:00
Nick LefeverandFacebook GitHub Bot 68baff1d67 Add getDiffProps for Unimplemented View component (#51166)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51166

See title

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74327337

fbshipit-source-id: c5b44d833fccaa200d6019932dd5e9b1760c3af3
2025-05-08 09:37:26 -07:00
Nick LefeverandFacebook GitHub Bot 73a03d5314 Add getDiffProps for Image component (#51165)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51165

See title

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74327298

fbshipit-source-id: 8faa04807615e223033cbede80112df4496f77ef
2025-05-08 09:37:26 -07:00
Dawid MałeckiandFacebook GitHub Bot f3c289835f Move imported types from @react-native/assets-registry and @react-native/js-polyfills to react-native repo (#51192)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51192

The `build-types` script cannot currently resolve `react-native/assets-registry` and `react-native/js-polyfills`. This diff moves imported types from these packages to `react-native` to include them in generated types.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D74392568

fbshipit-source-id: cbce977b710f54dc53ce1b0fc080704b420490d4
2025-05-08 09:07:42 -07:00
Alan LeeandFacebook GitHub Bot 14cea6e70e migrate deprecated KEYCODE_BACK in Modal (#51097)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51097

**Problem:** `Event.KEYCODE_BACK`has been deprecated with targetSdk 36, predictive back will be enforced and KEYCODE_BACK no longer triggered. We need to migrate to backward compatible `OnBackPressedCallback`.
- https://developer.android.com/about/versions/16/behavior-changes-16#predictive-back.

**Solution:**
Use `OnBackPressedCallback` to handle BACK. Logic for ESC key handling still remains.
To support the callback mechanism, we are using AndroidX ComponentDialog ([src](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:activity/activity/src/main/java/androidx/activity/ComponentDialog.kt)) which is a thin wrapper on the existing Dialog.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D74162844

fbshipit-source-id: ebd0e89c29999d3dd99431a4359c442e42d23911
2025-05-08 08:50:45 -07:00
Alan LeeandFacebook GitHub Bot bc876fb3b3 migrate deprecated onBackPressed() (#51096)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51096

**Problem:** `Activity.onBackPressed()` has been deprecated and with targetSdk 36, predictive back will be enforced and the API no longer called. We need to migrate to backward compatible AndroidX `OnBackPressedCallback`.
- https://developer.android.com/about/versions/16/behavior-changes-16#predictive-back.

**Solution:**
`OnBackPressedCallback` is registered conditionally only if it is `targetSdk` 36 or greater.
If the callback in enabled, `onBackPressed()` is not called and callback is used regardless of `android:enableOnBackInvokedCallback` property in <application> or <activity> set in AndroidManifest.xml.

As a workaround callback is manually calling existing `onBackPressed()`.

This is done rather than removing onBackPressed() completely and using only `OnBackPressedCallback` as we are not sure of the impact of removing the implementation entirely. Once we determine it is safe to do so then, we should remove the workaround and fully transition to `OnBackPressedCallback`

* I also surveyed child classes extending ReactActivity for overridden `onPressedBack()` usage and found only one usage which will be handled later.

NOTE: `ReactDelegate.onHostResume()` sets up the `DefaultHardwareBackBtnHandler` using `ReactActivity` (https://fburl.com/ul47tbeo) and will be called from JS `BackHanderl.exitApp` (https://fburl.com/code/a4l2pjsw). Calling `BackHanderl.exitApp` enables predictive back to work.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D74161428

fbshipit-source-id: 2e081ba6922b315e9d1746e83a41bab5277fa62e
2025-05-08 08:50:45 -07:00
Dawid MałeckiandFacebook GitHub Bot fd21570a3c Attach @deprecated tag and doc block to ProgressBarAndroid (#51136)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51136

This diff attaches doc block to ProgressBarAndroid copied from the manual TS types.

Generated types result:

```ts
import * as React from "react";
import type $$IMPORT_TYPEOF_1$$ from "./ProgressBarAndroidNativeComponent";
type ProgressBarAndroidNativeComponentType = typeof $$IMPORT_TYPEOF_1$$;
import type { ProgressBarAndroidProps } from "./ProgressBarAndroidTypes";
export type { ProgressBarAndroidProps };
declare let ProgressBarAndroid: (props: Omit<ProgressBarAndroidProps, keyof {
  ref?: React.Ref<React.ComponentRef<ProgressBarAndroidNativeComponentType>>;
}> & {
  ref?: React.Ref<React.ComponentRef<ProgressBarAndroidNativeComponentType>>;
}) => React.ReactNode;
/**
 * ProgressBarAndroid has been extracted from react-native core and will be removed in a future release.
 * It can now be installed and imported from `react-native-community/progress-bar-android` instead of 'react-native'.
 * see https://github.com/react-native-community/progress-bar-android
 * deprecated
 */
declare const $$ProgressBarAndroid: typeof ProgressBarAndroid;
declare type $$ProgressBarAndroid = typeof $$ProgressBarAndroid;
export default $$ProgressBarAndroid;

```

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D73855212

fbshipit-source-id: c6c09ea68c9f61f305f96c0954370bb938fc59d9
2025-05-08 08:14:32 -07:00
Fabrizio CucciandFacebook GitHub Bot 090a8da0d1 Kotlinify ReactInstanceManagerInspectorTarget + make internal (#51196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51196

As per title.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D74325454

fbshipit-source-id: a490614c83bd69660ecdd4cc8439a1a168de3010
2025-05-08 07:47:57 -07:00
Dawid MałeckiandFacebook GitHub Bot 69fe957dcf Add transform that moves comments for default exported variable declarations (#51135)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51135

In generated types default exported variables are re-declared which shadows attached tags and doc blocks. This transform moves necessary comments on top of re-declarations to keep them accessible.

Example output for SafeAreaView:

```ts
import type { ViewProps } from "../View/ViewPropTypes";
import View from "../View/View";
import * as React from "react";
declare const exported: (props: Omit<ViewProps, keyof {
  ref?: React.Ref<React.ComponentRef<typeof View>>;
}> & {
  ref?: React.Ref<React.ComponentRef<typeof View>>;
}) => React.ReactNode;
/**
 * Renders nested content and automatically applies paddings reflect the portion
 * of the view that is not covered by navigation bars, tab bars, toolbars, and
 * other ancestor views.
 *
 * Moreover, and most importantly, Safe Area's paddings reflect physical
 * limitation of the screen, such as rounded corners or camera notches (aka
 * sensor housing area on iPhone X).
 */
declare const SafeAreaView_DEFAULT: typeof exported;
declare type SafeAreaView_DEFAULT = typeof SafeAreaView_DEFAULT;
export default SafeAreaView_DEFAULT;
```

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D74249424

fbshipit-source-id: 5cdd1c746e7fed99e3d3427d6ebf4c0e7ba3f3fd
2025-05-08 07:07:02 -07:00
Jakub PiaseckiandFacebook GitHub Bot 1f795eb93d Validate that typegen script can run in action (#51189)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51189

Changelog: [Internal]

Adds a Github action that validates that the typegen script can successfully translate every necessary Flow file to TypeScript.

Reviewed By: huntie

Differential Revision: D74390916

fbshipit-source-id: 8c6d554c8681a2b92a8b182244a329ee538d9e53
2025-05-08 06:11:22 -07:00
Alex HuntandFacebook GitHub Bot 320231c6f9 Narrow file set for no-commonjs-exports lint rule (#51191)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51191

Avoids over-matching non-runtime files such as `packages/react-native/scripts/`.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D74394261

fbshipit-source-id: dbfd13e305d51c91d36fbc844af7631f066b8297
2025-05-08 06:09:57 -07:00
ismarbesicandFacebook GitHub Bot be8595b18a Exclude selectively disabled libraries from codegen generation (#51078)
Summary:
Selectively disabling autolinking of a native dependency with components registered in the codegen configuration in react-native.config.js causes builds to crash upon launch on iOS. This is because the generated `RCTThirdPartyComponentsProvider.mm` file contains references to the excluded library using `NSClassFromString` causing the returned NSDictionary from `+[RCTThirdPartyComponentsProvider thirdPartyFabricComponents]` to be populated with nil values and therefore crashing the app. This has been confirmed in 0.78.2 and 0.79.2 but probably exists in 0.77.x as well.

The issue has been further described in https://github.com/facebook/react-native/issues/51077.

## Changelog:

[IOS][FIXED] - Skip codegen for selectively disabled libraries in react-native.config.js

Pull Request resolved: https://github.com/facebook/react-native/pull/51078

Test Plan:
1. Install a library that has the componentProvider field set in the codegen config (see reproducer) and install the iOS pods.
2. Build the app.
3. App should run successfully without any crashes.

Reviewed By: cortinico

Differential Revision: D74248371

Pulled By: cipolleschi

fbshipit-source-id: 1ff7b477ed3d94ca45616ae243d3d2d30bd897db
2025-05-08 04:38:29 -07:00
Mateo GuzmánandFacebook GitHub Bot 04ab28fb7e Kotlin: Clean up redundant constructs (2/n) (#51170)
Summary:
Follow up from https://github.com/facebook/react-native/issues/51061 – Static code analysis detected several redundant constructs across the codebase. Most of the ones fixed here are marked as warnings/weak warnings, likely code smells post-migration from Java.

Doing another small round to clean up some of them.

## Changelog:

[INTERNAL] - Kotlin: Clean up redundant constructs

Pull Request resolved: https://github.com/facebook/react-native/pull/51170

Test Plan:
```sh
yarn android
yarn test-android
```

Reviewed By: rshest

Differential Revision: D74381864

Pulled By: cortinico

fbshipit-source-id: 25244cdf384875f7cc4e2d091c8b247710de5ecf
2025-05-08 03:53:33 -07:00
Nicola CortiandFacebook GitHub Bot db18aac521 hermes-engine should build with target Java version 17 (#51162)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51162

We specify the java target version to 17 for ReactAndroid but not for hermes-engine.
This is causing it to be the default (8) which will cause our build to fail on JDK 21.
This fixes it.

Changelog:
[Internal] [Changed] -

Reviewed By: alanleedev

Differential Revision: D74325107

fbshipit-source-id: 39ba745be4fa754fb0b0408160202940a61fcd94
2025-05-08 03:17:16 -07:00
React Native BotandFacebook GitHub Bot f75c8f6f04 Add changelog for v0.80.0-rc.0 (#51152)
Summary:
Add Changelog for 0.80.0-rc.0

## Changelog:
[Internal] - Add Changelog for 0.80.0-rc.0

Pull Request resolved: https://github.com/facebook/react-native/pull/51152

Test Plan: N/A

Reviewed By: rshest

Differential Revision: D74333203

Pulled By: hezi

fbshipit-source-id: 052147550ecbe47f9e75dba6ebf6257a10a49f5b
2025-05-08 02:33:00 -07:00
Kacper RożniataandFacebook GitHub Bot 473e42bbc3 fix(iOS): enable DEFINES_MODULE in React-jsc (#51160)
Summary:
Enables `DEFINES_MODULE` in `React-jsc.podspec`

After upgrading app to RN `0.79`, when installing pods with JSC enabled there is an error being thrown that

`The following Swift pods cannot yet be integrated as static libraries`
`The Swift pod 'RNFlashList' depends upon 'React-jsc', which does not define modules. ...`
when installing packages that use Swift

## Changelog:

[IOS] [CHANGED] -  enable `DEFINES_MODULE` in `React-jsc.podspec`

Pull Request resolved: https://github.com/facebook/react-native/pull/51160

Test Plan: RNTester runs and builds correctly

Reviewed By: huntie

Differential Revision: D74325357

Pulled By: cipolleschi

fbshipit-source-id: b994b7e678633440d5e362ae6965b2d5188d34f1
2025-05-08 02:12:45 -07:00
Intl SchedulerandFacebook GitHub Bot 457f29f09c translation auto-update for batch 0/58 on master
Summary:
Chronos Job Instance ID: 1125907957818733
Sandcastle Job Instance ID: 31525199229818080

Processed xml files:
android_res/com/facebook/common/util/res/values/strings.xml
android_res/com/oculus/auth/authenticator/meta/res/values/strings.xml
android_res/com/oculus/horizon/common/res/values/strings.xml
android_res/com/oculus/horizon/platformplugin/res/values/strings.xml
android_res/com/oculus/horizon/try_before_you_buy/res/values/strings.xml
android_res/com/oculus/os/q4b/mma/res/values/strings.xml
android_res/com/oculus/horizon/mediaupload/res/values/strings.xml
android_res/com/oculus/horizon/linkedaccounts/res/values/strings.xml
android_res/com/oculus/auth/authenticator/work/res/values/strings.xml
android_res/com/oculus/auth/authenticator/oculus/res/values/strings.xml
android_res/com/oculus/auth/authenticator/instagramsso/res/values/strings.xml
android_res/com/oculus/auth/authenticator/horizonworldsplatform/res/values/strings.xml
android_res/com/oculus/auth/authenticator/facebooksso/res/values/strings.xml
android_res/com/oculus/auth/authenticator/facebook/res/values/strings.xml
android_res/com/oculus/demoapp/res/values/strings.xml
android_res/com/facebook/wearable/common/comms/notification/res/values/strings.xml
android_res/com/facebook/wearable/apps/igdirect/res/values/strings.xml
android_res/com/facebook/wearable/common/wds/theme/res/values/strings.xml
../xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values/strings.xml
../xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/res/systeminfo/values/strings.xml
android_res/rendercore/res/values/strings.xml
../xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/res/devsupport/values/strings.xml
android_res/com/facebook/content/res/values/strings.xml
android_res/com/facebook/common/i18n/res/values/strings.xml
android_res/com/facebook/common/timeformat/res/values/strings.xml
libraries/foa/ui/cds/widgets-litho/brandasset/res/values/strings.xml
android_res/com/meta/icon/res/values/strings.xml
android_res/com/facebook/resources/res/values/strings.xml
android_res/com/facebook/common/strings/external/res/values/strings.xml
android_res/com/facebook/common/strings/res/values/strings.xml
android_res/com/oculus/twilight/app/res/values/strings.xml
android_res/com/facebook/fbui/widget/pagerindicator/res/values/strings.xml
android_res/com/facebook/fbui/widget/contentview/res/values/strings.xml
android_res/com/facebook/stella/res/values/strings.xml
android_res/com/facebook/wearable/companion/settings/keys/res/values/strings.xml
android_res/com/bloks/foa/cds/bottomsheet/strings/res/values/strings.xml
android_res/com/facebook/reportaproblem/res/values/strings.xml
android_res/com/oculus/twilight/reportaproblem/res/values/strings.xml
android_res/com/facebook/widget/res/values/strings.xml
android_res/com/facebook/config/appspecific/res/values/strings.xml
android_res/com/facebook/fbavatar/res/values/strings.xml
android_res/com/facebook/messaging/ui/stickerstore/res/values/strings.xml
android_res/com/facebook/stickers/res/values/strings.xml
android_res/com/facebook/messaging/shared/res/values/strings.xml
android_res/com/facebook/caspian/res/values/strings.xml
android_res/com/facebook/timeline/widget/actionbar/res/values/strings.xml
android_res/com/facebook/showpages/res/values/strings.xml
android_res/com/facebook/nux/res/values/strings.xml
android_res/com/facebook/facecast/common/badge/res/values/strings.xml
android_res/com/facebook/nativetemplates/res/values/strings.xml
android_res/com/facebook/iorg/common/upsell/res/values/strings.xml
android_res/com/facebook/iorg/common/res/values/strings.xml
android_res/com/facebook/zero/common/res/values/strings.xml
android_res/com/facebook/video/components/feed/res/values/strings.xml
android_res/com/facebook/runtimepermissions/res/values/strings.xml
android_res/com/facebook/dialtone/res/values/strings.xml
android_res/com/oculus/twilight/gcm/messaging/res/values/strings.xml
android_res/com/oculus/twilight/gcm/followrequest/res/values/strings.xml
android_res/com/facebook/rtc/notification/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/common/res/values/strings.xml
android_res/com/facebook/zero/messenger/semi/res/values/strings.xml
android_res/com/facebook/zero/res/values/strings.xml
android_res/com/facebook/widget/facepile/res/values/strings.xml
android_res/com/facebook/tabbar/res/values/strings.xml
android_res/com/facebook/ui/toolbar/res/values/strings.xml
android_res/com/facebook/dialtone/messenger/res/values/strings.xml
android_res/com/facebook/catalyst/shell/res/values/strings.xml
android_res/com/facebook/rtc/runtimepermissions/manager/res/values/strings.xml
android_res/com/facebook/rtc/connectionservice/res/values/strings.xml
android_res/com/facebook/rtc/helpers/connectionservicecoordinator/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/callstatus/participantinfo/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/callstatus/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/incoming/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/participant/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/pip/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/header/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/callcontrols/audioselector/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/callcontrols/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/incall/res/values/strings.xml
android_res/com/facebook/rp/platform/ui/ended/res/values/strings.xml
android_res/com/facebook/payments/dcp/res/values/strings.xml
libraries/smartcapture/common/common-ui/res/values/strings.xml
android_res/com/bloks/common/components/autogenmediagallery/res/values/strings.xml
android_res/com/facebook/ui/mainview/res/values/strings.xml
android_res/com/facebook/audience/stories/storysurface/activity/main/res/values/strings.xml
android_res/com/facebook/horizon/res/values/strings.xml
android_res/com/meta/fxmetalogin/res/values/strings.xml
android_res/com/instagram/ui/common/res/values/strings.xml
android_res/com/instagram/actionbar/res/values/strings.xml
android_res/com/instagram/tabs/res/values/strings.xml
android_res/com/instagram/avatar/res/values/strings.xml
android_res/com/instagram/icons/igax/res/values/strings.xml
android_res/com/instagram/debug/res/values/strings.xml
android_res/com/facebookpay/widget/res/values/strings.xml
android_res/com/facebookpay/ecpexception/res/values/strings.xml
android_res/com/facebookpay/expresscheckout/res/values/strings.xml
android_res/com/fbpay/auth/res/values/strings.xml
android_res/com/oculus/twilight/hsrmobile/res/values/strings.xml
android_res/com/oculus/twilight/calling/res/values/strings.xml
../xplat/messengervr/msys/feature_aggregation/src/i18n/res/values/strings.xml

allow-large-files
ignore-conflict-markers
opt-out-review
drop-conflicts

Differential Revision: D74381578

fbshipit-source-id: 3e17ebecf9bd5a6822bf98c9d195885320705655
2025-05-08 01:28:36 -07:00
Maddie LordandFacebook GitHub Bot bbc1e121c7 Allow Custom ReactNativeFeatureFlags for Shell 2.0 (#51177)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51177

Introduce DefaultNewArchitectureEntryPoint.loadWithFeatureFlags() to allow custom feature flags while using DefaultNewArchitectureEntryPoint

Reviewed By: arushikesarwani94

Differential Revision: D74228467

fbshipit-source-id: ec3fe7edd31cc9713498b316d6306eaa3686398b
2025-05-07 18:58:21 -07:00
Jan KassensandFacebook GitHub Bot a96aeab147 use difftrain version of eslint-plugin-react-hooks
Summary:
Switches to use the version imported through diff train for `eslint-plugin-react-hooks`. This should allow us to finally use component syntax in RN.

bypass-github-export-checks

Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D74203162

fbshipit-source-id: d9ea17e5c6533e8df0889404a7f7798f6f5061c0
2025-05-07 14:57:36 -07:00
Joe VilchesandFacebook GitHub Bot be60aed1b0 Allow links that are entire text views to be focusable when co-opted (#51138)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51138

The co-opting logic failed to account fo the case where the entire text view as a link and therefore turns off ax. In this case I think it makes sense to re-focus that element again so the user can interact with the link.

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D74262675

fbshipit-source-id: c8d11cdff76cd92170581d167d5a8df64d0dd101
2025-05-07 14:46:39 -07:00
Samuel SuslaandFacebook GitHub Bot 1c312befd5 add tests for some accessibility props (#51155)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51155

changelog: [internal]

we have experienced breakages where we stopped propagating accessibility prop to the mounting layer. These tests should catch it.

Reviewed By: fabriziocucci

Differential Revision: D74317767

fbshipit-source-id: 72c6d8c788afe3a9d4d41f7cfc0aa37605b20b6a
2025-05-07 13:02:18 -07:00
Fabrizio CucciandFacebook GitHub Bot 1908b3dfac Kotlinify JavaScriptModuleRegistry (#51164)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51164

As per title.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D74326679

fbshipit-source-id: ecd15fda9ea8686b65171c462e7e82dc9609377b
2025-05-07 10:34:14 -07:00
Mateo GuzmánandFacebook GitHub Bot 84253c4e20 Add missing ReplaceWith on deprecations (#51144)
Summary:
Static code analysis detected several missing `ReplaceWith` on deprecated methods. This diff addresses some of them by adding the most accurate suggestions based on the implementations.

## Changelog:

[INTERNAL] - Add missing ReplaceWith on deprecations

Pull Request resolved: https://github.com/facebook/react-native/pull/51144

Test Plan:
```sh
yarn android
yarn test-android
```

Reviewed By: fabriziocucci

Differential Revision: D74327121

Pulled By: javache

fbshipit-source-id: 5b338531210bef104208d14cbd0e3320dc566b8e
2025-05-07 10:09:35 -07:00
Nicola CortiandFacebook GitHub Bot cf94070416 Unbreak build_android due to broken StateReconciliationTest.cpp (#51161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51161

This unbreaks the CI after D74245228

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D74324800

fbshipit-source-id: b89147f4f57b5d94fd8ae1549ef18ef2deb97c5b
2025-05-07 08:49:39 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 130fb7fd30 Fix set-rn-version to account for codegen snapshot test files (#51157)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51157

test-js jobs are failing because the codegen snapshot tests generates a Podspecs withan hardcoded version that does not matches the version we are about to release.

This fix updates the script that set the RN version to make sure it also updates the Codegen snapshots.

This is a porting to `main` of [this PR](https://github.com/facebook/react-native/pull/51156).

## Changelog:
[Internal] - Fix set-rn-version to account for codegen snapshot test files

Reviewed By: fabriziocucci, cortinico

Differential Revision: D74321590

fbshipit-source-id: 6837e60a0a2834030680f7ec0c7584bf2622f33e
2025-05-07 07:18:45 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 56b2690ecd Fix creation of Draft release (#51159)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51159

This change fixes a syntax error in the GH Action that generates the draft PR.

## Changelog:
[Internal] - Fix draft release generation

Reviewed By: fabriziocucci, cortinico

Differential Revision: D74322577

fbshipit-source-id: 0fcb03403ea35f7c64217bce5f1cbf93e7d5bd9a
2025-05-07 07:07:59 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 807dfb4a1b Fix build codegen (#51130)
Summary:
When testing the release by running the `test-e2e-local` for RNTester on iOS, the script sometimes fails because it expect to have codegen properly built before running the app.
This fix makes sure we build the codegen package.

## Changelog:
[Internal] - Fix building the codegen

Pull Request resolved: https://github.com/facebook/react-native/pull/51130

Test Plan: Tested locally

Reviewed By: fabriziocucci

Differential Revision: D74248031

Pulled By: cipolleschi

fbshipit-source-id: 319f3332c616f7118b673fb7acb63c2e15946b2c
2025-05-07 06:12:06 -07:00
Mateo GuzmánandFacebook GitHub Bot a3c9db6122 Make ReactQueueConfigurationImpl internal (#51143)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.bridge.queue.ReactQueueConfigurationImpl).

## Changelog:

[INTERNAL] - Make com.facebook.react.bridge.queue.ReactQueueConfigurationImpl internal

Pull Request resolved: https://github.com/facebook/react-native/pull/51143

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest, cortinico

Differential Revision: D74309556

Pulled By: javache

fbshipit-source-id: 1c5eaa0e975bd2db5d451c5e21f14cfa3856e4c3
2025-05-07 05:21:37 -07:00
Mateo GuzmánandFacebook GitHub Bot f81a721b57 Make DebugServerException internal (#51140)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.common.DebugServerException).

## Changelog:

[INTERNAL] - Make com.facebook.react.common.DebugServerException internal

Pull Request resolved: https://github.com/facebook/react-native/pull/51140

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D74309486

Pulled By: rshest

fbshipit-source-id: 092ffb350d9093deb6b12ad639dd7453027c4c06
2025-05-07 04:54:39 -07:00
Samuel SuslaandFacebook GitHub Bot 12fb101e30 deprecate type aliases ShadowNode::Unshared and ShadowNode::Weak (#51151)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51151

changelog: [General][Deprecated] - deprecate type aliases ShadowNode::Unshared and ShadowNode::Weak in favour of std::shared_ptr<ShadowNode> and std::weak_ptr<ShadowNode>

migrate away from using these type aliases to avoid confusion.

It is unclear from ShadowNode::Unshared what it means. This can be avoided by using std::shared_ptr<ShadowNode> directly. The same applies to ShadowNode::Weak.

Reviewed By: rubennorte

Differential Revision: D74245228

fbshipit-source-id: f22a18e87f170e46f5079e0ee7678700a3f5f623
2025-05-07 04:51:38 -07:00
Alex HuntandFacebook GitHub Bot f4dd3addb6 Remove force disable Fusebox flag (#51127)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51127

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D74246823

fbshipit-source-id: af3978c120853d4ef1150fffb38c71c74728f907
2025-05-07 04:26:06 -07:00
Rubén NorteandFacebook GitHub Bot 79c3b4c409 MutationObserver: switch from ShadowNode to ShadowNodeFamily to prevent leaks (#51149)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51149

Changelog: [internal]

This replaces the use of `ShadowNode` with `ShadowNodeFamily` in the `MutationObserver` logic to prevent retaining stale subtrees of the nodes being observed.

It refactors some existing logic so we don't need to keep track of the shadow nodes in JS. It was only used to be able to find the node for a target after unmounted, so we could "unobserve" it, but `MutationObserver` doesn't support unobserving individual targets anyway, so we removed that use case and implemented a more general `unobserveAll` method that doesn't require the shadow nodes in the first place.

Reviewed By: javache

Differential Revision: D74240834

fbshipit-source-id: 6d4c43a561780962874c76615fb53369c0c68cf7
2025-05-07 04:17:26 -07:00
Rubén NorteandFacebook GitHub Bot da56d57ac7 Refactor MutationObserver.disconnect (#51128)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51128

Changelog: [internal]

Just a minor refactor of a method in `MutationObserver` which was doing some redundant work that could be avoided.

Reviewed By: javache

Differential Revision: D74247437

fbshipit-source-id: 510d26f2a315582df9cddc215bf516d3d4ebd341
2025-05-07 04:17:26 -07:00
Rubén NorteandFacebook GitHub Bot 759652b09f Refactor existing native module into a general purpose native module for Fantom test specific methods (#51133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51133

Changelog: [internal]

Having a single native module with all the test-specific functionality that we need in native in Fantom is just more convenient.

Reviewed By: rshest, huntie

Differential Revision: D73997209

fbshipit-source-id: 5d3aa69a2c799166a1351fbff3e80e4396cec9c6
2025-05-07 04:16:41 -07:00
Alex HuntandFacebook GitHub Bot 12627f10b3 Report PerformanceResourceTiming events (#51126)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51126

NOTE: Resubmission of D73922341, fixing a dependency cycle (T223145455).

(Sparsely) wires up reporting of Network events to the Web Performance subsystem.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D74245441

fbshipit-source-id: ce8f47dfb3f5cd415f51287d7fcc6a048336018e
2025-05-07 03:49:56 -07:00
Mateo GuzmánandFacebook GitHub Bot f9225635bf Fix unresolved KDoc references (#51142)
Summary:
Static code analysis shows that there are a lot of unresolved KDoc references. This is just another round addressing several of them.

## Changelog:

[INTERNAL] - Fix unresolved KDoc references

Pull Request resolved: https://github.com/facebook/react-native/pull/51142

Test Plan: Verify that the comments link the classes correctly using Android Studio.

Reviewed By: rshest

Differential Revision: D74305933

Pulled By: javache

fbshipit-source-id: f512a33fa5da46fb828bb76bd95d9502261ea08a
2025-05-07 03:31:30 -07:00
Jakub PiaseckiandFacebook GitHub Bot e48b496665 Update fabric-component type test to use namespaced types (#51120)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51120

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D74242678

fbshipit-source-id: b39b56bb3a34633bec55f07c8bf081fb70b62249
2025-05-07 03:06:04 -07:00
David VaccaandFacebook GitHub Bot a254b5e69e Introduce ReactSoftExceptionLogger.CategoryMode to warn categories used on soft errors (#51141)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51141

This diff introduces ReactSoftExceptionLogger.CategoryMode to limit categories used on soft errors, the limiation will only create a lint warning but won't create a compilation error.

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D74263367

fbshipit-source-id: 56fb2ef0ad3d24810172af300e43ecc1f479464f
2025-05-06 15:46:23 -07:00
Tim YungandFacebook GitHub Bot d945c5863a IntersectionObserver: Switch from ShadowNode to ShadowNodeFamily (#51089)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51089

Currently, `IntersectionObserver#observe` retains a reference to the `ShadowNode` of the view that is supplied as an argument, which is used to compute intersection whenever a shadow tree is committed.

However, the `shadowNode` includes all of child nodes and state at the time that `IntersectionObserver#observe` is called. This means that an active `IntersectionObserverEntry` will retain references to memory that would otherwise be deallocated (e.g. if children of the observed view are unmounted after `IntersectionObserver#observe` is called).

This diff refactors `IntersectionObserver` to instead retain a reference to the `ShadowNodeFamily`, which does not retain references to child nodes and still eanbles `IntersectionObserver` to compute intersections.

Changelog:
[General][Changed] - Fixed `IntersectionObserver#observe` to avoid retaining memory for unmounted child nodes of observed views.

Reviewed By: RSNara

Differential Revision: D74130479

fbshipit-source-id: 6b581f73f06b93e6463d5004c181c39aae13896a
2025-05-06 15:24:42 -07:00
Abhijeet JhaandFacebook GitHub Bot d94f4d8c9d Added decalaration for pressRetentionOffset prop to be recognised by typescript (#51068)
Summary:
Added decalaration for  pressRetentionOffset prop to be recognised by typescript

## Changelog:
Added decalaration for  pressRetentionOffset prop to be recognised by typescript in Text.d.ts

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:
[General] [Added] - Add  pressRetentionOffset prop to be recognised by typescript in Text.d.ts

Pull Request resolved: https://github.com/facebook/react-native/pull/51068

Test Plan:
Before fix

https://github.com/user-attachments/assets/476364c4-6602-4916-84f2-1ede56bce285

After fix

https://github.com/user-attachments/assets/e5f720d9-cd7d-4cf0-8499-ebe9f83eb17b

Tested here: Related PR: (https://github.com/microsoft/react-native-windows/pull/14596)

Reviewed By: yungsters

Differential Revision: D74208617

Pulled By: philIip

fbshipit-source-id: 625996bec64058e4e4cdbe108ed53a62426d1222
2025-05-06 10:20:41 -07:00
Rob HoganandFacebook GitHub Bot db0fa9200e Update Metro to ^0.82.3 (#51122)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51122

Update Metro to 0.82.2 => 0.82.3, containing important bug fixes for `package.json#exports` support.

Changelog: [General][Changed] Metro to ^0.82.3

Reviewed By: huntie

Differential Revision: D74181990

fbshipit-source-id: 8320a0cf4aa671d9e7f2976c36d260934807a179
2025-05-06 09:29:30 -07:00
Samuel SuslaandFacebook GitHub Bot 4b06965b30 add fantom test for View.accessibilityRole (#51131)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51131

changelog: [internal]

add test for View.accessibilityRole.

Reviewed By: rubennorte

Differential Revision: D74247897

fbshipit-source-id: 9246e690fe15fc659b134cf2484a5ac64ff321d7
2025-05-06 09:17:49 -07:00
Samuel SuslaandFacebook GitHub Bot 93b8868c77 small changes to ctor of State and ConcreteState (#51118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51118

changelog: [internal]

1. `ConcreteState` and `State` were taking shared_ptr to family even though they only use weak_ptr.
2. `ConcreteState` was taking a const& to `data`. It unconditionally takes ownership of data, make it obvious in the interface.

Reviewed By: lenaic

Differential Revision: D74024980

fbshipit-source-id: 22401d4153588861f3edd04af0bdc7213a8056ac
2025-05-06 07:42:47 -07:00
Alex HuntandFacebook GitHub Bot 9bccd6c4ea Explicitly exclude types_generated/ from "exports" (#51121)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51121

Previously could match via the `"./*"` subpath when `"react-native-strict-api"` is not set. Only the entry point `./types_generated/index.d.ts` should be exposed.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D74242716

fbshipit-source-id: 232c90f34fafe8fdf1a5a7ef1fec4acc191525b4
2025-05-06 07:26:04 -07:00
Alex HuntandFacebook GitHub Bot c34987f0b5 Remove redundant config value for @types/react-native (#51119)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51119

See https://www.typescriptlang.org/tsconfig/#types.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D74242632

fbshipit-source-id: d4b5cbb42340e40a7e6770e3a6c41964366fe71e
2025-05-06 06:49:27 -07:00
Jakub PiaseckiandFacebook GitHub Bot 9010e691e0 Update transform types to preserve behavior in TypeScript (#51115)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51115

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D74229819

fbshipit-source-id: 08e363ae58c29ca910601b2f078153b8ff30103c
2025-05-06 06:21:15 -07:00
Dawid MałeckiandFacebook GitHub Bot 5e612e6eca Fix suggesting components from types_generated directory (#51101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51101

TS LSP suggests importing/using components from `types_generated` directory which are exported under slightly different name than root exports. Prefixing default exports with `$$` fixes the issue.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D74177107

fbshipit-source-id: 86a6869c2aa7a113915184e4857a7882710b1db4
2025-05-06 06:01:19 -07:00
Jakub PiaseckiandFacebook GitHub Bot a65744fd4a Unify ref usages in TS type tests (#51117)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51117

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D74240080

fbshipit-source-id: 5cc7042b5ac1515887d20b72a0b7d96cc8313ed7
2025-05-06 05:42:29 -07:00
Pieter De BaetsandFacebook GitHub Bot ef6f2fb32d Create granite.target_platform for RN overrides (#51076)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51076

Changelog: [Internal]

Reviewed By: MichaelTay, rshest

Differential Revision: D73451500

fbshipit-source-id: b31962fed5004204e15f4adbaf8a8ce2432b94a2
2025-05-06 03:38:22 -07:00
Christian FalchandFacebook GitHub Bot 3ac16dd6a8 replaced use of rsync with cp in prebuild scripts (#51095)
Summary:
When building the RNDependencies XCFrameworks we saw some errors in the CI servers about rsync failing:

`rsync(3031): error: poll: hangup on nonblocking write`

We decided to fix this by changing from using rsync to cp.

This commit fixes this by replacing rsync with cp, and adding a cleanup step after copying the XCFramework files.

## Changelog:

[INTERNAL] [FIXED] - Replacing rsync with cp, and adding a cleanup step after copying the XCFramework files.

Pull Request resolved: https://github.com/facebook/react-native/pull/51095

Test Plan: Run RNDependencies scripts on CI and verify that they're working as expected.

Reviewed By: fabriziocucci

Differential Revision: D74236114

Pulled By: cipolleschi

fbshipit-source-id: accd84abf7601919cfdbc1b6a8681a61d4293ca5
2025-05-06 02:19:54 -07:00
David VaccaandFacebook GitHub Bot 3ad0b8244a Throw if getCatalystInstance() is executed when running on bridgless mode + legacy arch minification (#51112)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51112

Throw if getCatalystInstance() is executed when running on bridgless mode + legacy arch minification

This should be safe given that all the methods of BridgelessCatalystInstance throw exceptions

changelog: [internal] internal

Reviewed By: alanleedev

Differential Revision: D74200099

fbshipit-source-id: a888061250f19348a22895c3684aa2333280c916
2025-05-05 23:53:10 -07:00
David VaccaandFacebook GitHub Bot a02052d37f Mark BridgelessCatalystInstance as LegacyArchitecture and remove DoNotStrip (#51111)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51111

BridgelessCatalystInstance is unused in bridgeless, any usage will lead to an exception / crash.
This diffs marks BridgelessCatalystInstance as LegacyArchitecture and removes DoNotStrip annotation to enable further optimizations

changelog: [internal] internal

Reviewed By: alanleedev

Differential Revision: D74200097

fbshipit-source-id: f99b6fa74c30bdf0e1cd6758e223601b3ce5826c
2025-05-05 23:53:10 -07:00
Tim YungandFacebook GitHub Bot e69e35e370 Fantom: Create Shadow Node Reference Counter (#51088)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51088

Creates `ShadowNodeReferenceCounter`, a module with utilities for writing Fantom tests that make assertions about the reference count for a `ShadowNode` object.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D74131710

fbshipit-source-id: a949a402ee52f40445ce99c712540e80c8a05065
2025-05-05 23:43:41 -07:00
Nick GerlemanandFacebook GitHub Bot f85b30b24b Underpinnings for Caching Text Layouts (#51065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51065

This adds infrastructure to let us start storing cached Android text layouts as part of a `ParagraphShadowNode`. After this, we will clear them out, and propagate them to state. Right now, the flag doesn't do much, apart from extra work.

This is done by adding `TextLayoutManagerExtended::supportsPreparedLayout()`, and `TextLayoutManager::PreparedLayout` types, to shim between platforms, then on Android, we add a `PreparedLayout`, which is for now just an Android layout, with extra field (`maxNumberOfLines`, for some reason not exposed on recent versions).

Android `TextLayoutManager` java side is split a little bit, so that we reuse all the existing logic for prepared layouts. I tried to set up the boundary, so that we don't reserialize a MapBuffer after preparation, and for simplicity, this means source of truth for attachment count, and attachment sizes, now lives on the layout. This means we need to change boundary a bit, where we are no longer able to pass in a buffer to fill from C++ side of attachment positions.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D73970149

fbshipit-source-id: ff71c227e062c16fe52a4eb3ba2acbebf3d96e56
2025-05-05 16:48:16 -07:00
Aaron CoplanandFacebook GitHub Bot 2562440385 Construct FBImagePerfImageInfo and pass to completion handler from within FBIconModule (#51110)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51110

Changelog: [iOS][Changed] Update RCTImageLoader.mm to cast loadHandler to RCTImageLoaderLoggable before calling shouldEnablePerfLogging

Replacing cast from RCTImageURLLoaderWithAttribution to RCTImageLoaderLoggable

Reviewed By: philIip

Differential Revision: D73148595

fbshipit-source-id: 01f61bc60624e2bb9cb4ff9b45094e38ea77dcaa
2025-05-05 16:37:56 -07:00
Aaron CoplanandFacebook GitHub Bot 43c9a609de Update loadImageURL signature in RCTImageURLLoader to include metadata in completion callback (#51107)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51107

Changelog: [iOS][Deprecated] Deprecate loadImageForURL in favor of new signature which uses completionHandlerWithMetadata

Updating the signature of completionHandlerWithMetadata to allow passing metadata through the completionHandlerWithMetadata in order to enable better instrumentation of image loading.

Reviewed By: philIip

Differential Revision: D73162738

fbshipit-source-id: 8e7e4ac35c9685a362a2efe08ebebbf0dd249ff9
2025-05-05 16:37:56 -07:00
Nick GerlemanandFacebook GitHub Bot e565c662d7 Assume full container width when ellipsizing line (#51108)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51108

We calculate the width of text to be the full width of the container, if the text overflows the bounds of the container, instead of the wrapped width, to match the behavior on web.

Incorporating line count into layout defeats this logic, since the final layout never overflows. We need to also check to see if we are ellipsized (had overflow) instead.

Changelog:
[Android][Fixed] - Assume full container width when ellipsizing line

Reviewed By: joevilches

Differential Revision: D74204041

fbshipit-source-id: 1c2a7fc50f101bd4c9ed2f979534731992b5310b
2025-05-05 15:47:10 -07:00
Joe VilchesandFacebook GitHub Bot f1e7bbb88b Fix "detected text" annoucement (#51106)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51106

There was a strange bug reported to us with `accessibilityOrder` where an OCR model would announce text on the screen sometimes. This would happen if a focused `View` without a label would wrap `Text` that was was not included in the `accessibilityOrder` array. What happens under the hood is we have a focused `View` trying to coopt a label. It finds no accessibility nodes under it (because the `Text` has `importantForAccessibility` set to `NO`) so it falls back to this weird TalkBack behavior. It both reads the text from the TextView and announces an OCR announcement - leading to repeating the text.

To fix this we just check if we are going to coopt text and if we do then we do not set `importantForAccessibility`. Behavior here changes a bit. Links are not accessible without having to reference the Text, setting `accessible={true}` on non-referenced `Text` will lead to be focusable.

These are both less bad than what we had before though, so I think this tradeoff is fine.

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D74101530

fbshipit-source-id: 0678915efdc46a6273f79927b87f22bc9017814a
2025-05-05 12:58:18 -07:00
Rob HoganandFacebook GitHub Bot f4936894f0 Miscellaneous lint fixes (#51099)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51099

Fix up some misc broken lints and add temporary suppressions to reduce noise in the subsequent stack.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D74141669

fbshipit-source-id: dc19378e41f6d8d45fc7d2ecf18c1c01a1e501be
2025-05-05 09:48:46 -07:00
Eric RozellandFacebook GitHub Bot d9823d80bb Delete ShadowTreeRevision on background thread (#50997)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50997

In some apps, we spend a non-trivial amount of time calling ShadowNode destructors on the UI thread.

A simple way to avoid stalling the UI thread is to move the `baseRevision_` instance to a data structure that is cleared on a background thread, so it's tree of ShadowNode shared_ptrs are released (and in most cases destroyed) on the background thread.

Rather than using std::thread, this change introduces the LowPriorityExecutor abstraction that should be supplied by host platforms. The implementation of this LowPriorityExecutor for each platform is as follows:
- iOS: uses dispatch_async to a low priority dispatch queue
- Android: uses a pthread with SCHED_OTHER and priority = 19

Moving the ShadowTreeRevision into a lambda capture and punting the lambda to the LowPriorityExecutor moves the destructor calls of the ShadowNodes to the host platform implementation of the LowPriorityExecutor.

This change is also guarded by a feature flag so we can keep an eye out for potential memory leaks.

## Changelog

[Internal]

Reviewed By: NickGerleman

Differential Revision: D73688009

fbshipit-source-id: 6a66da248e6fe5c38375bf026499346e8381e75a
2025-05-05 07:44:02 -07:00
Dawid MałeckiandFacebook GitHub Bot 8d08845cda Root export PublicRootInstance and PublicTextInstance for ReactNativeTypes to use (#51018)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51018

`ReactNativeTypes` deep imports  `MeasureOnSuccessCallback`, `PublicInstance`, `PublicRootInstance` and `PublicTextInstance`. The `MeasureOnSuccessCallback` type  is already root exported, `PublicInstance` is exported as `HostInstance` and there are two types left to export to root import all of them from react-native. This is needed for `simpleResolve` to properly resolve and build types located in `ReactNativePrivateInterface`.

This cannot be fixed on the resolver level because that would also involve change in the `exports` field in `package.json` to enable types resolution for deep paths which should be strict by design.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D73926160

fbshipit-source-id: 3a711a0f002ea42d9ad538c07ec00f22cc4afb6b
2025-05-05 03:24:02 -07:00
Ruslan LesiutinandFacebook GitHub Bot 271232d856 Make call frames point to function definition, not callsite (#51084)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51084

# Changelog: [Internal]

Reviewed By: dannysu

Differential Revision: D73850528

fbshipit-source-id: fc1c22c5bf7cf71f76cf49643af06eeb188b770c
2025-05-05 02:20:58 -07:00
Alex HuntandFacebook GitHub Bot 69f9a9a029 Add status bar offset to New App Screen on Android (#51091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51091

Fix for top padding with Android edge-to-edge (default for current version of the RN template). We add a `statusBarHeightOffset` explicitly, since this is not covered by the builtin `SafeAreaView`.

{F1977676990}

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D74142357

fbshipit-source-id: 6d70db43d8b80b7e3d2d4b598e29560efa046b5c
2025-05-04 13:07:52 -07:00
Rob HoganandFacebook GitHub Bot 93f22e79d4 community-cli-plugin: Use TerminalReporter type from metro, replace deep imports (#51092)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51092

`TerminalReporter` is re-exported from `metro` (since [0.76.7](https://github.com/facebook/metro/releases/tag/v0.76.7)), so we can update these deep imports to use public exports.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D74141704

fbshipit-source-id: 22cd3209868ed9ab260e199f9099ef98335feaeb
2025-05-04 09:57:57 -07:00
Nick GerlemanandFacebook GitHub Bot 5eed872463 Split Java TextLayoutManager Logic (#51066)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51066

Splits up some of the `measureText` code in Android TextLayoutManager, ahead of D73970149, which adds `measurePreparedLayout` to reuse most of this logic. Most significant change, is we pull out logic to iterate and retrieve metrics for attachments, since `measurePreparedLayout`, needs to also return dimensions, and fill into ArrayList, instead of received buffer.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74035246

fbshipit-source-id: 2a0f5b171c4343e26ffa5b2538a0018939b06773
2025-05-02 23:22:09 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 989b3f61a0 Fix clipToPaddingBox on new Background and Border drawable (#51055)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51055

When clipping to the padding box without a background or border set, we should default to clipping to the drawing rectangle.

This ensures accurate clipping behavior when there is no background or border set. This is because it seems bounds accommodates the contents of the drawables but when no content is present (either a background or a border) the bounds are 0. In which case we want to rely on the drawing rect instead of the bounds for this edge case.

Changelog: [Android][Fixed] - Fix incorrect clip to padding box on new Background and Border drawables

Reviewed By: NickGerleman

Differential Revision: D74014372

fbshipit-source-id: bd5a496db6de44c4185760ed72b3013d9f2faa00
2025-05-02 19:00:28 -07:00
Jiawei LüandFacebook GitHub Bot d45c0419ac Revert D73922341: Report PerformanceResourceTiming events
Differential Revision:
D73922341

Original commit changeset: bcfc03c3d8a9

Original Phabricator Diff: D73922341

fbshipit-source-id: 3898ae763332b79f5a37fc91abb70be53c299655
2025-05-02 14:42:24 -07:00
Joe VilchesandFacebook GitHub Bot e00028f6bb Clean up useEditTextStockAndroidFocusBehavior feature flag (#51039)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51039

We added a feature flag in case this broke things. Its been about 4 months now with now issues, I think we can clean this up.

Changelog: [Android][Fixed] - Can now focus TextInput with keyboard

Reviewed By: NickGerleman

Differential Revision: D73954790

fbshipit-source-id: 4682cf709aa2f34ba69e76a35d07a908edb28f23
2025-05-02 13:21:27 -07:00
Mateo GuzmánandFacebook GitHub Bot 6fa1864d52 Make ModuleDataCleaner internal (#51060)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.modules.common.ModuleDataCleaner).

Only one library uses it (https://github.com/jbrodriguez/react-native-android-sqlite), but it's hasn't been updated for 10 years. Marking it as breaking, but it's unlikely that the library is used nowadays. See:

## Changelog:

[ANDROID][BREAKING] - Make com.facebook.react.modules.common.ModuleDataCleaner internal

Pull Request resolved: https://github.com/facebook/react-native/pull/51060

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico, shwanton

Differential Revision: D74036994

Pulled By: arushikesarwani94

fbshipit-source-id: 520fc3dfdc1ecfb27f161a1b59ad5d79dfc854cf
2025-05-02 12:51:13 -07:00
Ramanpreet NaraandFacebook GitHub Bot f4d99d6a23 Reland: [rn][ios] Bridgeless: Fix unstable_hasComponent (#51053)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51053

unstable_hasComponent(component) first registers the component with react native, if possible. Then, it returns you whether registration succeeded.

## Problem
For unregistered components, the initial call returns false. But, all subsequent calls return true.

The reason why: After the initial call fails, react native registers unimplemented view under that component name. So, all subsequent calls return true.

## Solution
Just record the initial loopup result. And always return that initial lookup result from this method.

Changelog: [iOS][Fixed] Fix bug: unstable_hasComponent(*) = true for unregistered components for n > 1th call.

Reviewed By: yungsters, cipolleschi

Differential Revision: D73949864

fbshipit-source-id: ac5b6fc373cb1b2436045ae1f78391f0712bca17
2025-05-02 12:27:58 -07:00
generatedunixname499836121andFacebook GitHub Bot c514333f41 Apply fixup patch to fbsource
Summary:
This is an automatically generated fixup patch to bring fbsource back into sync with
facebook/react on GitHub. Please land this patch as soon as possible, as the difference
reflected on here is already on GitHub and future changes may depend on these
changes!

Changelog: [Internal]

<< DO NOT EDIT BELOW THIS LINE >>
diff-train-skip-merge

Generated by: https://www.internalfb.com/intern/sandcastle/job/22517999956752681/

GitHub Repo: facebook/react

Reviewed By: kassens

Differential Revision: D73844457

fbshipit-source-id: 840a8448839992538427cd52501cdfaf0a2e82da
2025-05-02 12:24:24 -07:00
David VaccaandFacebook GitHub Bot 3f62d001fd Update error message for non-registered ViewManagers (#51067)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51067

Update error message for non-registered ViewManagers

changelog: [internal] internal

Reviewed By: arushikesarwani94, cortinico

Differential Revision: D74048740

fbshipit-source-id: 016469ec79654863d51a7b1acff513bf50fd4e86
2025-05-02 12:22:32 -07:00
David VaccaandFacebook GitHub Bot 8c231b7d81 Document logic implemented in ComponentDescriptorRegistry when a component is not found (#51062)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51062

Document logic implemented in ComponentDescriptorRegistry when a component is not found

changelog: [internal] internal

Reviewed By: arushikesarwani94, cortinico

Differential Revision: D74036572

fbshipit-source-id: 20a5d182e0308538cdfa3f5e97957d488f010f0d
2025-05-02 12:22:32 -07:00
David VaccaandFacebook GitHub Bot 5ae6f6be25 Cleanup and document ReactUnimplementedView (#51063)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51063

Cleanup and document ReactUnimplementedView

changelog: [internal] internal

Reviewed By: rshest, cortinico

Differential Revision: D74036571

fbshipit-source-id: 75077914697cac56743c99fba7d7cdccad5c828a
2025-05-02 12:22:32 -07:00
Mateo GuzmánandFacebook GitHub Bot 809372c49e Make EventBeatManager internal (#51057)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.fabric.events.EventBeatManager).

## Changelog:

[INTERNAL] - Make com.facebook.react.fabric.events.EventBeatManager internal

Pull Request resolved: https://github.com/facebook/react-native/pull/51057

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache, cortinico

Differential Revision: D74037193

Pulled By: arushikesarwani94

fbshipit-source-id: 77e677a977d8a5c4d7f985c3eff352c19ca1140c
2025-05-02 11:55:01 -07:00
HyunWoo LeeandFacebook GitHub Bot 78dbbaafdd Support collections dsl (#51042)
Summary:
This PR introduces a concise Kotlin DSL for constructing `ReadableMap` and `ReadableArray` in Android native modules:

- Adds `buildReadableMap { … }` and `buildReadableArray { … }` functions, modeled after Kotlin’s `buildMap`/`buildList` APIs.
- Wraps `Arguments.createMap()` / `Arguments.createArray()` in a type-safe, nested DSL to reduce boilerplate and prevent errors.
- Improves readability and maintainability when assembling nested map/array structures for React Native bridges.

Current code like:
```kotlin
val map = Arguments.createMap().apply {
  putString("name", user.name)
  putInt("age", user.age)
  // …
}
```

can now be written as:

```kotlin
val userMap = buildReadableMap {
  put("name", user.name)
  put("age", user.age)
  put("scores") {
    user.scores.forEach { add(it) }
  }
}
```

This feature proposal also written in [[Android] Support Collection DSL](https://github.com/react-native-community/discussions-and-proposals/issues/899)

## Changelog:

[Android] [Added] - Collections DSL functions for Kotlin(`buildReadableMap`, `buildReadableArray`)

Pull Request resolved: https://github.com/facebook/react-native/pull/51042

Test Plan:
### Run Unit Test

```shell
cd packages/react-native/ReactAndroid
./gradlew :ReactAndroid:unitTest
```

Ensure all tests in `src/test/java/.../ReadableMapBuilderTest.kt` and `ReadableArrayBuilderTest.kt` pass.

Reviewed By: javache

Differential Revision: D73986390

Pulled By: cortinico

fbshipit-source-id: b9f94327646bcb6e0190cdd06dfb9bb5eaa6375c
2025-05-02 11:02:52 -07:00
Nicola CortiandFacebook GitHub Bot 2590438b67 Minor cleanup of AbstractLayoutAnimationTest (#51079)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51079

This test was not using AssertJ. I've updated it then.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D74065455

fbshipit-source-id: 2393340fd75aaf9599ba789237c29bb91e0192ae
2025-05-02 10:21:57 -07:00
Alex HuntandFacebook GitHub Bot ec38728c75 Report PerformanceResourceTiming events (#51025)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51025

(Sparsely) wires up reporting of Network events to the Web Performance subsystem.

Our plan is to report to the Web Performance APIs (lightweight timing metadata, here) for all build flavours, and report to CDP (more costly full metadata/previews) in dev/profiling builds.

**Notes**

- Introduces `PerformanceEntryReporter::unstable_reportResourceTiming` — this will become "stable" when further network events/fields are fully hydrated on Android and iOS.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D73922341

fbshipit-source-id: bcfc03c3d8a9a286ae72ba00a3313602fb2adea8
2025-05-02 08:14:40 -07:00
Alex HuntandFacebook GitHub Bot 6b304bc551 Fix missing podspec dependency in RCTNetwork (#51071)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51071

Follows D73995864.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D74062263

fbshipit-source-id: 2cb9bc30b36ecd2cd925bf5efa5ee31e9c8a92a6
2025-05-02 08:14:40 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 58a9046978 Improve cleanup script for ios (#51046)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51046

This small change improves the cleanup script for ios, which is now not deleting the workspace and that it might be keeping an outdated version of the codegen for OSS.

## Changelog:
[Internal] - Improve yarn clean-ios script

Reviewed By: cortinico

Differential Revision: D73988442

fbshipit-source-id: 6de5d6ab08812ba7fdb19b0cc955a38840d82f89
2025-05-02 04:21:12 -07:00
Mateo GuzmánandFacebook GitHub Bot 5d98f6f364 Kotlin: Clean up redundant constructs (#51061)
Summary:
Static code analysis detected several redundant constructs across the codebase. Most of the ones fixed here are marked as warnings/weak warnings, likely code smells post-migration from Java.

Doing a small round to clean up some of them.

## Changelog:

[INTERNAL] - Kotlin: Clean up redundant constructs

Pull Request resolved: https://github.com/facebook/react-native/pull/51061

Test Plan:
```sh
yarn android
yarn test-android
```

Reviewed By: rshest

Differential Revision: D74056259

Pulled By: javache

fbshipit-source-id: 04f7ce7ce7b4f6063c8e1712840a44fd91d3b9e1
2025-05-02 03:59:22 -07:00
Nicola CortiandFacebook GitHub Bot c6685d29ad Fix RNTester SampleLegacyModule not rendering in Old Arch (#51073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51073

Currently the SampleLegacyModule screen is not loading in OldArch for RNTester.

That's because we gate adding a `SampleLegacyModule` to the BaseReactPackage
only if NewArch is enabled.

This shouldn't be the case as we can still build RNTester in oldarch and we
should be able to visualize the SampleLegacyModule example.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D74009245

fbshipit-source-id: 55eae3dc6063343f57261af2742e643a8e5c2b50
2025-05-02 03:59:10 -07:00
Mateo GuzmánandFacebook GitHub Bot 506f03b5e1 Make ShareModule internal (#51059)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.modules.share.ShareModule).

## Changelog:

[INTERNAL] - Make com.facebook.react.modules.share.ShareModule internal

Pull Request resolved: https://github.com/facebook/react-native/pull/51059

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D74037444

Pulled By: arushikesarwani94

fbshipit-source-id: 13f7652a0db35200b4de9ea95a800cf9ea52b837
2025-05-02 02:18:47 -07:00
Alex HuntandFacebook GitHub Bot e1632da01c Gate network event reporting with feature flag (#51050)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51050

Gate network event reporting on iOS (inputting into the network reporting subsystem), now that this is load-bearing with the Performance API.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D73995864

fbshipit-source-id: 65a15485cdae445eadff6c57148f3682af6de215
2025-05-01 23:19:29 -07:00
Mateo GuzmánandFacebook GitHub Bot c4a2cb9d90 Make JSResponderHandler internal (#51058)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.touch.JSResponderHandler).

## Changelog:

[INTERNAL] - Make com.facebook.react.touch.JSResponderHandler internal

Pull Request resolved: https://github.com/facebook/react-native/pull/51058

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: mdvacca

Differential Revision: D74036832

Pulled By: arushikesarwani94

fbshipit-source-id: c31cd271e7c1007fdfe9582c8c3055ecbda324a6
2025-05-01 22:45:33 -07:00
Alex HuntandFacebook GitHub Bot 195b723d74 Refactor performanceNow call, remove cxxreact dependency (#51024)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51024

Prevents a dependency cycle in the next diff.

Changelog: [Internal]

Reviewed By: rubennorte, hoxyq

Differential Revision: D73933671

fbshipit-source-id: 79c66cd5f6a32ed7287a2d6e7840a512466306a9
2025-05-01 22:40:39 -07:00
Alex HuntandFacebook GitHub Bot baf895c239 Add internal support for PerformanceResourceTiming (#50996)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50996

Adds a representation of the [`PerformanceResourceTiming`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming) event type to the Web Performance subsystem, ahead of integration with our network event reporting.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D73861431

fbshipit-source-id: 8258058c432727808d30c338bba79ca92a17c1c8
2025-05-01 22:40:39 -07:00
Alex HuntandFacebook GitHub Bot 1135f10e05 Refactor PerformanceEntry as std::variant (#50995)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50995

Refactors our previous single-struct representation for `PerformanceEntry` ([see MDN](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry)) as a `std::variant`.

This maps closely to the `PerformanceEntry` type inheritance in the web spec, and makes this type substantially cleaner to extend and work with in D73861431.

Changelog: [Internal]

Reviewed By: rubennorte, rshest

Differential Revision: D73860532

fbshipit-source-id: f3b7a7444d2456370620c1a1ba9a43f118cb9730
2025-05-01 22:40:39 -07:00
Alex HuntandFacebook GitHub Bot e6870c68f9 Limit request body size for Network.requestWillBeSent (#51026)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51026

Performance optimisation — truncate request body content (sent as `Request.postData` over CDP) at 1MB.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D71905868

fbshipit-source-id: ba82b4937902e057d4694bf4f000eb77ee37aa8a
2025-05-01 21:46:36 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 04f0e66a6b Avoid accessing the MainBundle multiple times (#51044)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51044

This change prevents RN from accessing the MainBundle every time a NativeModule is registered by caching the `legacyLogEnabled` property in a static variable.

## Changelog:
[Internal] - Prevent multiple access to mainBundle

Reviewed By: javache

Differential Revision: D73992070

fbshipit-source-id: a14aada43f367314b7f868a0b5e30b9f92d0971a
2025-05-01 20:22:50 -07:00
Richard HowellandFacebook GitHub Bot 21bf7cf6cf remove ATOMIC_VAR_INIT
Summary:
ATOMIC_VAR_INIT is deprecated in C17, and does nothing anyway.

Changelog:
[iOS][Fixed] - Remove deprecated ATOMIC_VAR_INIT macro in RCTProfile.m

Reviewed By: NSProgrammer

Differential Revision: D74002901

fbshipit-source-id: e453fbc084cd0b1049c7f8b052c9779d9b19b44f
2025-05-01 19:16:54 -07:00
Nick GerlemanandFacebook GitHub Bot e4b6b346bc Remove ENABLE_MEASURE_LOGGING (#51064)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51064

This is pretty much just checked in printf debugging. Let's clean it up, before we duplicate some code which has the logs.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D73975310

fbshipit-source-id: d2b936ad62a17aef20903fd2ca0defc23c647aa0
2025-05-01 18:13:39 -07:00
Nick GerlemanandFacebook GitHub Bot b1367eeb81 Resubmit: Incorporate maxLines and ellipsization into text layout (#51040)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51040

## Resubmit

We were previously only checking for `maxNumberOfLines` of `ReactConstants.UNSET` (-1), but it may also be `0` to signify unset from other checks (wut), and different versions of Android would handle this case of `maxLines={0}` differently.

The resubmission adds an explicit check for zero here as well.

```
      if (ReactNativeFeatureFlags.incorporateMaxLinesDuringAndroidLayout()) {
        if (maxNumberOfLines != ReactConstants.UNSET && maxNumberOfLines != 0) {
          builder.setEllipsize(ellipsizeMode).setMaxLines(maxNumberOfLines);
        }
      }
```

## Previous

Right now, we fully layout text, then use max lines to determine  a metric to use when calculating size.

Android API 23+ which we fully target allows incorporating ellipsization and maxlines directly into the layout. This will let us directly draw the layout when using maxLines later. This may also let Android optimize line-breaking a bit, when we hit truncation.

Special care is taken not to set this when we are in `adjustsFontSizeToFit` path, so that line count will flow over, signifing overflow.

I think the main user-facing change is that `onTextLayout` events will have measures post-ellipsization.

Changelog:
[Android][Changed] - Incorporate maxLines and ellipsization into text layout

Reviewed By: lenaic, joevilches

Differential Revision: D73953691

fbshipit-source-id: 2e08faab5bb9eda90a126545571bb441ea1ece39
2025-05-01 18:13:39 -07:00
Zeya PengandFacebook GitHub Bot 0c58ccf501 Call Java AudioModule from C++ TM to play audio (#51037)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51037

## Changelog:

[Android] [Changed] - Make mHybridData in CxxReactPackage protected

In some cases subclass needs to override it in constructor

Reviewed By: javache

Differential Revision: D73894471

fbshipit-source-id: 7958f9b88841a0201d39e49fba09af76927e5737
2025-05-01 14:22:10 -07:00
Fabrizio CucciandFacebook GitHub Bot b406c0a37e Add changelog entry for 0.79.2 (#51054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51054

As per title.

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D74013007

fbshipit-source-id: f5a8a99956ec3fe4dcf56ffd5f7ed2f4cef158eb
2025-05-01 12:45:39 -07:00
Alex HuntandFacebook GitHub Bot b731ea3d3f Internalise RNTester examples referencing unexported APIs (#51019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51019

Follows D72228547 and D73770609.

This diff internalises (moves files from fbsource+GitHub to fbsource only) a number of RNTester examples which referenced `'react-native/src/private/'` subpaths.

In future, new components/APIs should be exported from index as `unstable_`, or added to `RNTesterListFbInternal` if they are exported from `src/fb_internal/`.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D73777092

fbshipit-source-id: d9fb0833c56f2ae580b6db62ddbbbeae774a0004
2025-05-01 09:58:30 -07:00
Alex HuntandFacebook GitHub Bot ba5acdba83 Introduce enableNetworkEventReporting and enableResourceTimingAPI feature flags
Summary: Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D73995231

fbshipit-source-id: ade6f858b14928a32fa022d4e9a85704bc944726
2025-05-01 07:00:52 -07:00
Nick LefeverandFacebook GitHub Bot 07073fbac8 Override useShadowNodeStateOnClone for OSS (#51041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51041

Enabling `useShadowNodeStateOnClone` by default on OSS to resolve https://github.com/facebook/react-native/issues/49694

Changelog: [Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D73970421

fbshipit-source-id: 4021c9fc07a7fc28012c022f6131409486e8aea7
2025-05-01 05:48:52 -07:00
Riccardo CipolleschiandFacebook GitHub Bot e1d2285791 Do not access to main bundle when running in prod (#51043)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51043

The call to the mainBundle to read the `RCTLegacyWarningsEnabled` key can sometime deadlock in prod.
However, these are development logs that we don't want to run in Prod.

This change should disable the logs in prod, skipping the access to the `mainBundle`, and avoid the deadlock completely.

## Changelog:
[Internal] - Fix deadlock at startup to read `RCTLegacyWarningsEnabled`

Reviewed By: philIip, javache

Differential Revision: D73987454

fbshipit-source-id: 014410266733fdfa1e7b29d41fab5f7112b1ddb4
2025-05-01 04:48:55 -07:00
Pieter De BaetsandFacebook GitHub Bot 773ba66c64 Cleanup unnecessary unsafe dereferences in BlobModule (#51016)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51016

Addressing some lint feedback.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D73840204

fbshipit-source-id: ed1035bb785ce0246e714bca86a1ae84578f1464
2025-05-01 04:07:30 -07:00
Mateo GuzmánandFacebook GitHub Bot 81f3f091ae Make ReactModalHostManager internal (#51002)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.views.modal.ReactModalHostManager).

## Changelog:

[INTERNAL] - Make com.facebook.react.views.modal.ReactModalHostManager internal

Pull Request resolved: https://github.com/facebook/react-native/pull/51002

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico, rshest

Differential Revision: D73890830

Pulled By: alanleedev

fbshipit-source-id: 6443c4ab80a287fbe963ee60e361ff7864a0d73f
2025-05-01 02:23:01 -07:00
Joe VilchesandFacebook GitHub Bot 69f41ca367 a11y] Let links discovered by dataDetectorType be accessible (#50914)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50914

The URL spans generated by Linkify are not actually accessible because we do not update the delegate's virtual views.

I also had to change how AccessibilityLinks get generated, since it does not work well if it includes spans that are not `ReactClickableSpans`

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D73612119

fbshipit-source-id: 0c6028a7473e0484216300863f2d7a043fb2ea85
2025-05-01 01:52:46 -07:00
Joe VilchesandFacebook GitHub Bot 70aced5eb1 Let LinkMovementMethod take precedence over accessibility delegate when dataDetector is present (#50887)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50887

There is currently a bug with the recent changes to keyboard accessibility with Text and nested links. If something with nested links has a `dataDetectorType` prop then we have 2 different selections when we navigate with arrow keys since the drawing behind the 2 are separate.

Removing LinkMovementMethod is not possible since it allows for clicking the links it detects

As a result, lets just allow it to take precedence over the delegate when handling link navigation in the cases its present.

Changelog: [Android][Fixed] - Double selection with dataDetectorType and links

Reviewed By: NickGerleman

Differential Revision: D73549839

fbshipit-source-id: bbe37470e78841bb119fa68e197b327023031c7e
2025-05-01 01:52:46 -07:00
Ruslan LesiutinandFacebook GitHub Bot 0f5eeb6970 Use correct scriptId (#51030)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51030

# Changelog: [Internal]

I've been using the wrong thing this whole time, because it is referenced in `ChromeTraceSerializer.cpp`:
https://www.internalfb.com/code/fbsource/[b422eeb3bb6334ef95e8cf01b18e32ba8ab72bbe]/xplat/hermes-snapshot/lib/VM/Profiler/ChromeTraceSerializer.cpp?lines=439

Turns out, there is a real `scriptId`, defined by the Runtime and which is unique for every script. This also aligns with other parts of the CDP stack in Hermes. Since this scriptId is always available, there is no need to make it optional.

Reviewed By: dannysu

Differential Revision: D73185984

fbshipit-source-id: 1bb057584cf3f18bd7b440fef44de9e880ceb961
2025-05-01 00:22:44 -07:00
Ruslan LesiutinandFacebook GitHub Bot 0b6ed6c7d5 Define range for iteration over samples and call stack frames (#51029)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51029

# Changelog: [Internal]

Instead of exposing vector of samples / call frames directly, we will share pair of iterators that would allow iterating over them in a specified order.

Reviewed By: dannysu

Differential Revision: D73448002

fbshipit-source-id: 16c476453e943a71403b375b168b30da7d261cfa
2025-05-01 00:22:44 -07:00
Ruslan LesiutinandFacebook GitHub Bot a5f2acde20 Avoid heap allocations when serializing sampling profile (#51028)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51028

# Changelog: [Internal]

There is a way to implement the trie without allocating `ProfileTreeNode` on the heap. The serialization logic (`RuntimeSamplingProfilerTraceEventSerializer.cpp`) remained mostly the same, the only new limitation is that we can only use pointer to `ProfileTreeNode` until the next push into a `children` container, when all pointers are invalidated. Not sure if we can avoid this invalidation, since we don't know the potential size of `children` vector, it has to be dynamically allocated.

Main changes are in `ProfileTreeNode`:
- Instead of receving already created instane that will be check if it should be added as a child, it will expose predicate to check if such node already exists - `getIfAlreadyExists`. If not, then caller can use `addChild` to register it and receive a pointer.

Reviewed By: huntie

Differential Revision: D73213284

fbshipit-source-id: 385be884bcc5feb61b3a8cbd0ff36402e3b20c6c
2025-05-01 00:22:44 -07:00
Ruslan LesiutinandFacebook GitHub Bot c09340e73e Use std::variant, remove heap allocations (#50847)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50847

# Changelog: [Internal]

We have different types of call frames, right now we defined 4 of them. Previously, they would descend from `ProfileSampleCallStackFrame`, which has `kind_` field that can be used for determining the type of the call frame.
We were using polymorphism later on React Native side to cast from base type to derived.

Instead of this, and instead of doing heap allocations for potentially tens of thousands of objects, we will use std::variant for storing frames in a single container and them distinguishing them.

This fixes memory leaks caused by new-ing objects and not clearing out when Profile is destroyed.

Reviewed By: dannysu

Differential Revision: D72803934

fbshipit-source-id: a279c6d68c7c2628f0eab585f33137222ad9e3f1
2025-05-01 00:22:44 -07:00
Sam ZhouandFacebook GitHub Bot 88a04c530e Pre-suppress errors related to Object.assign
Summary:
The `Object.assign` support is [inherently unsound](https://github.com/facebook/flow/issues/3392), carries a lot of tech debt, and we want to error on them.

This diff pre-suppresses errors that will be added in the next version of Flow, to make the next release easier.

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D73963639

fbshipit-source-id: ebefc82c123588eb0b72ab48a24e45c42be33267
2025-04-30 19:44:58 -07:00
Nick GerlemanandFacebook GitHub Bot 025f2d931e Back out "Incorporate maxLines and ellipsization into text layout" (#51035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51035

This is causing some problems with older versions of Android. Let's back out for now.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D73950625

fbshipit-source-id: 424dfc1216ae811e1e287774c6ac5d0c9ba5aa17
2025-04-30 17:45:25 -07:00
Joe VilchesandFacebook GitHub Bot 4d8eeb34f9 Allow accessibilityOrder to reference itself (#51004)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51004

It would be very convenient if `accessibilityOrder` could reference itself. Meaning the View with the `accessibilityOrder` prop can include its own `nativeID` in the array. This makes sense API wise - we allow for referencing parents and their descendants, so long as they are treated as an element and not a container. This is pretty nice since you no longer have to wrap everything in a View who's sole purpose is `accessibilityOrder`.

Under the hood things get a bit garbled, however, since iOS only lets you have UIViews that are either accessibility elements or accessibility containers - and we need to support both at the same time for this to work. To do this, we make use of the `UIAccessibilityElement` class and just forward all of the logic to the View with the `accessibilityOrder` prop. This View will also not be an accessibility element from the point of view of iOS.

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D73792934

fbshipit-source-id: b0810277c8e410319639b863b59e4e60782bffca
2025-04-30 15:33:35 -07:00
Joe VilchesandFacebook GitHub Bot 62742e21c9 getShadowNodeClass() impl in PreparedLayoutTextViewManager (#50925)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50925

This crashes without this change, now it does not!

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D73626930

fbshipit-source-id: 37fd99372d1781a9e895e854e8b2f75c568ef9c0
2025-04-30 15:08:53 -07:00
Mateo GuzmánandFacebook GitHub Bot b40157e758 Make FabricEventEmitter internal (#51001)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.fabric.events.FabricEventEmitter).

## Changelog:

[INTERNAL] - Make com.facebook.react.fabric.events.FabricEventEmitter internal

Pull Request resolved: https://github.com/facebook/react-native/pull/51001

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico, NickGerleman

Differential Revision: D73895164

Pulled By: arushikesarwani94

fbshipit-source-id: 46adb077f5d3ee93fe7006c0ffc6c9e87d50147f
2025-04-30 12:33:28 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot ae2773f231 Make AccessibilityOrder also include the host view (#51027)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51027

Simple change to make the host of `experimental_accessibilityOrder` include the view that hosts the property in its order.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D73808337

fbshipit-source-id: 441329a6ca0cd4b0aba08bddb15143215d337e01
2025-04-30 11:54:09 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 2d3285ab60 Bump Xcode to version 16.2 (#51014)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51014

Starting from the [24th of April](https://developer.apple.com/news/upcoming-requirements/?id=02212025a), Apple only accepts app built with Xcode 16.0 or greater

This change bumps our CI to ensure that everything works with Xcode 16.

## Changelog:
[Internal] - Bump CI to Xcode 16.2

Reviewed By: javache

Differential Revision: D73924819

fbshipit-source-id: 82cdca5e12cee505de6e97513c07678776642d88
2025-04-30 09:49:42 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 9683287319 Bump maestro to 1.40 (#51022)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51022

As per title, it bumps maestro to 1.40 in CI

## Changelog:
[Internal] - Bump Maestro to 1.40

Reviewed By: cortinico

Differential Revision: D73929936

fbshipit-source-id: 7dfd974a0d1227520c5a6892ff4f157633fdbd54
2025-04-30 09:25:34 -07:00
generatedunixname89002005287564andFacebook GitHub Bot c232148e74 fbsource//xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/deviceinfo:deviceinfoAndroid (#51011)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51011

Reviewed By: rshest

Differential Revision: D73840378

fbshipit-source-id: 8a902c454b4b8252f8e690fb10de58cfecd6c703
2025-04-30 09:07:19 -07:00
Pieter De BaetsandFacebook GitHub Bot 8de401c625 Make ResourceDrawableIdHelper an object (#51013)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51013

There's no need to use a singleton pattern here, we can just use a Kotlin object.

Changelog: [Android][Removed] Deprecated `ResourceDrawableIdHelper.instance`

Reviewed By: Abbondanzo

Differential Revision: D73923281

fbshipit-source-id: f46e125ce595fe4506b9fb5aa471109f5ba150f0
2025-04-30 08:53:59 -07:00
Pieter De BaetsandFacebook GitHub Bot 16bfb2f87a Fixup tests for ReactHostImpl Kotlin migration (#51012)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51012

Splitting of from D73846053 to reduce size.

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D73923280

fbshipit-source-id: 61840fce0a5ef8c5fb19396e55ce4bded0cdd9ff
2025-04-30 08:53:59 -07:00
Anupriya VermaandFacebook GitHub Bot f53d066d26 Support minimumFontScale in paragraphAttributes (#50933)
Summary:
Support minimumFontScale in paragraphAttributes

Resolves https://github.com/facebook/react-native/issues/50934

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[GENERAL] [ADDED] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
Support minimumFontScale in paragraphAttributes

Pull Request resolved: https://github.com/facebook/react-native/pull/50933

Test Plan:
Tested via this code here: https://github.com/microsoft/react-native-windows/pull/14617

Before:
![image](https://github.com/user-attachments/assets/76b94aa8-228b-4a7e-9ec0-c366c7bf38ac)

After:
![image](https://github.com/user-attachments/assets/f9fbf8c2-9776-429f-8605-5663f9c7b7c9)

https://github.com/user-attachments/assets/fb9ae889-7d01-4317-a6e6-61e6b0708bc4

Reviewed By: NickGerleman

Differential Revision: D73658489

Pulled By: cipolleschi

fbshipit-source-id: 87ed27c0de2363e2ce0d908cc26670349586e7a6
2025-04-30 05:30:19 -07:00
Nicola CortiandFacebook GitHub Bot 0abd5d63e1 Back out "Migrate ReactActivity" (#50998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50998

I'm reverting this as this change is too disruptive for the OSS ecosystem.
It will break ALL the apps written in Kotlin and it's coming too close to the branch cut which is in less than one week.

We need to re-do this migration in a non breaking manner after the branch cut as this is highly disruptive for little benefit at this point

Changelog
[Android][Changed] - Back out "[RN][Kotlin] Migrate ReactActivity"

Original commit changeset: 936263100ca9

Original Phabricator Diff: D73507044

Reviewed By: mdvacca

Differential Revision: D73864144

fbshipit-source-id: 264921b1f1cd38301e66364de4b619807272bd27
2025-04-29 21:50:25 -07:00
Mateo GuzmánandFacebook GitHub Bot 79d3cb7e1e Make EventEmitterWrapper internal (#51003)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.fabric.events.EventEmitterWrapper).

## Changelog:

[INTERNAL] - Make com.facebook.react.fabric.events.EventEmitterWrapper internal

Pull Request resolved: https://github.com/facebook/react-native/pull/51003

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: NickGerleman

Differential Revision: D73888667

Pulled By: arushikesarwani94

fbshipit-source-id: 2119775a5630e76a46924d7db3afd8d5ab6f082b
2025-04-29 19:16:31 -07:00
Nick GerlemanandFacebook GitHub Bot e43c5db84b Spannable -> Spanned (#51006)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51006

Moves a bit of code, reading spans that we may not control, to query for `Spanned`, instead of `Spannable`, since some code (see last diff around ellipsization) may wrap intermediate Spannables.

Changelog: [internal]

Reviewed By: joevilches

Differential Revision: D73820368

fbshipit-source-id: e107bcf1f2f7d5555fca68fb2209c12c3f99c099
2025-04-29 18:45:58 -07:00
Nick GerlemanandFacebook GitHub Bot 746275ff14 Incorporate maxLines and ellipsization into text layout (#51007)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51007

Right now, we fully layout text, then use max lines to determine  a metric to use when calculating size.

Android API 23+ which we fully target allows incorporating ellipsization and maxlines directly into the layout. This will let us directly draw the layout when using maxLines later. This may also let Android optimize line-breaking a bit, when we hit truncation.

Special care is taken not to set this when we are in `adjustsFontSizeToFit` path, so that line count will flow over, signifing overflow.

I think the main user-facing change is that `onTextLayout` events will have measures post-ellipsization.

Changelog:
[Android][Changed] - Incorporate maxLines and ellipsization into text layout

Reviewed By: joevilches

Differential Revision: D73811573

fbshipit-source-id: df83295d0902ae8b043ce57b06cbb9c8f0c194fc
2025-04-29 18:45:58 -07:00
Nick GerlemanandFacebook GitHub Bot 6f0a0a5c2c Correctly Pass SurfaceID to TextLayoutManager (#51005)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51005

We need to get a context corresponding to the root being passed, to be able to resolve things like theme to use. RIght now that's a TODO, that's been around since new arch. Let's pass the real data along.

Changelog:
[Android][Fixed] - Correctly Pass SurfaceID to TextLayoutManager

Reviewed By: javache

Differential Revision: D73819640

fbshipit-source-id: 1ae2505b59b8577d35a4dc5bb2a524663f3bd47f
2025-04-29 18:45:58 -07:00
Nick GerlemanandFacebook GitHub Bot 2e42eab6df Platform specific TextLayoutManager Headers (#50889)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50889

This effectively reverts D67064488

We are trying to smash together functions, variables, virtual or non-virtual, all required by different platforms, into a single header, often using #ifdefs that are not what we want (apart from a bad editor experience, `#ifdef ANDROID` may or may not be compiled into the react-native-cxx platform, and we cannot use it for the Android platform reliably).

For Facsimile, we are going to be introducing more potential divergence, with the idea of `PreparedText`, where we can generate intermediate products as part of the layout process to be reused later. I'm planning to design that in a way which can be eventually reused across platforms, but not everywhere.

I think the best path for this is going to be to allow each platform to have their own headers, instead of the current messiness, then allow shared code (e.g. in `ParagraphShadowNode`) to pick how to interact at compile time. I added an example of this as part of `TextLayoutManagerExtended`, to customize how we act if a `TextLayoutManager` chooses not to implement `measureLines`.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D73557126

fbshipit-source-id: 9851ebba691b0d123f6a355126f2d5b003aceba0
2025-04-29 18:45:58 -07:00
Martin BoothandFacebook GitHub Bot 2efe8094c0 Include offset as separate field in payloads (#50970)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50970

__onAnimatedValueUpdateReceived is called from 2 places.

It is called from the onAnimatedValueUpdate subscription where the source of the values comes from here: https://fburl.com/8v2cwd2x with getValue() returning the offset + value components combined.

It's also called from in the animation end callback here: https://fburl.com/h36xy2nw where the source of this value comes from https://fburl.com/sud7m7st. In this case it's accessing `nodeValue` directly rather than calling getValue() and so it only includes the value component.

In this diff we pass both the value and offset in both onAnimatedValueUpdate callbacks as well as endCallback.

This allows us to separate the value from the offset on the JS side and ensures we have the latest offset value from native

Changelog: [Android][Fixed] - Sync offset and value from native -> js in separate fields

Reviewed By: zeyap

Differential Revision: D73795619

fbshipit-source-id: e8ed234497e3fcaf9d2a137aa1e17ca8d0f76d97
2025-04-29 17:03:44 -07:00
Samuel SuslaandFacebook GitHub Bot 1c5ec4bd35 introduce more tests for edge cases for view culling (#51000)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51000

changelog: [internal]

# Why so many tests?
Differentiator has two modes: regular and reparenting. The reparenting one is almost a completely separate Differentiator, effectively doubling the complexity. It handles quite a few different special cases and is not covered by any reasonable tests, so here I am adding the tests to make sure every branch of the reparenting Differentiator is traversed.

Reviewed By: lenaic

Differential Revision: D73845746

fbshipit-source-id: 27a9fd72a5f8111b84e231cf8f495e278037a323
2025-04-29 14:57:08 -07:00
David VaccaandFacebook GitHub Bot 0a5b21c44c Setup feature flag to fix double measurement of android components (#50971)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50971

This feature flag enables a fix of double measurement on a subset of android components

changelog: [internal] internal

Reviewed By: yungsters

Differential Revision: D73804996

fbshipit-source-id: 3271deb8a8bf4c132cbfb6819f72cab556c6253c
2025-04-29 13:50:57 -07:00
Ruslan LesiutinandFacebook GitHub Bot 996630b5b5 Avoid copying samples list when serializing (#50985)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50985

# Changelog: [Internal]

There may be tens of thousands of samples stored, so we should avoid copying it. I don't think we should restrict it from being copied, though, but we don't need it to copy in this case.

Reviewed By: huntie, dannysu

Differential Revision: D73106950

fbshipit-source-id: 45c027ea8bfc3424fe3428f5578d5bed3d1cdda9
2025-04-29 12:03:11 -07:00
Ruslan LesiutinandFacebook GitHub Bot b08f87aa90 TraceEventProfile as plain data structs (#50984)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50984

# Changelog: [Internal]

We are only using these struct to define how they will be serialize before sending over CDP, no need for custom constructors.

Also updated the naming of the serialization method to align with other parts of the project: `asDynamic()` -> `toDynamic()`.

Reviewed By: huntie

Differential Revision: D73774114

fbshipit-source-id: d0371cf3dee7584daa77054f73aced440550e674
2025-04-29 12:03:11 -07:00
Alex Taylor (alta)andFacebook GitHub Bot 78e45e5828 Deploy 0.269.1 to xplat (#50993)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50993

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D73853679

fbshipit-source-id: 4860c205f764a0be14080015cab1759bb59f442b
2025-04-29 10:24:21 -07:00
Rubén NorteandFacebook GitHub Bot 6dc4da466a Refactor event dispatching logic to improve readability and performance slightly (#50991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50991

Changelog: [internal]

TSIA.

Reviewed By: javache

Differential Revision: D73853068

fbshipit-source-id: 93e33072e4ce14225cc76ca8daf5d8816489ac7b
2025-04-29 10:13:09 -07:00
Rubén NorteandFacebook GitHub Bot 030ca3c543 Fix bug when dispatching unique and non-unique events of the same type on the same target (#50988)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50988

Changelog: [internal]

This fixes a potential bug where we coalesce unique events with non-unique ones of the same type and target.

Not marked as a bug fix in the changelog because this wouldn't happen in practice, as we always dispatch events of a given type the same way (all unique or all non-unique).

Reviewed By: sammy-SC, javache

Differential Revision: D73849222

fbshipit-source-id: 6f387d63b3a68dccc81c110287d42e15e31c181e
2025-04-29 10:13:09 -07:00
Rubén NorteandFacebook GitHub Bot ab543d1ab1 Add isUnique option in RawEvent and refactor EventQueue to use it (#50987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50987

Changelog: [internal]

This adds a new `isUnique` option in `RawEvent` to determine if it's unique (whether it should be coalesced with other unique events of the same type and target).

This effectively makes `dispatchUniqueEvent` redundant, as we can use `dispatchEvent` with a `RawEvent` marked as unique.

This will allow us to fix the bug we found in the new tests for event dispatching, where non-unique events of a given type where being coalesced with non-unique events of the same type.

Reviewed By: javache

Differential Revision: D73849220

fbshipit-source-id: ce89623aee509071ab6a86654ee25d9614863a8a
2025-04-29 10:13:09 -07:00
Rubén NorteandFacebook GitHub Bot 41de764c83 Add Fantom test for Fabric event dispatching (#50989)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50989

Changelog: [internal]

Just adding a test suite to verify the behavior of event dispatching in Fabric (especially around event priorities, automatic determination based on ContinuousStart/ContinuousEnd and unique events).

This also surfaced a bug where we incorrectly batch unique and non-unique events together (see the disabled test).

Reviewed By: javache

Differential Revision: D73849218

fbshipit-source-id: 404172822d6985283a161c8a56575e0b5658a5cc
2025-04-29 10:13:09 -07:00
Rubén NorteandFacebook GitHub Bot 524afb4c2a Expose event priorities in Fantom and JS (#50986)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50986

Changelog: [internal]

This just exposes some enum values and methods that we forgot to expose in a few interfaces.

Reviewed By: javache

Differential Revision: D73849221

fbshipit-source-id: 19014d53216e67c77b0c31e5ade8f86de071b001
2025-04-29 10:13:09 -07:00
riteshshukla04andFacebook GitHub Bot 761b15888d Migrate ViewGroupManager to kotlin (#50895)
Summary:
This PR aims to migrate ViewGroupManager to kotlin as part of https://github.com/facebook/react-native/issues/50513
## Changelog:
[ANDROID][CHANGED]Migrate ViewGroupManager to kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/50895

Test Plan: Tested with RN tester with old and new arch

Reviewed By: javache

Differential Revision: D73770843

Pulled By: cortinico

fbshipit-source-id: 45959a8bf512b3590ca8bc64dac281e13fa41ca3
2025-04-29 09:47:33 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 9a448736c1 Fix E2E tests for template (#50990)
Summary:
With the redesign of the new app screen, the E2E tests against the template started failing because we don't have a `Step One` string anymore.

This change should fix them.

## Changelog:
[Internal] - Fix Template E2E tests

Pull Request resolved: https://github.com/facebook/react-native/pull/50990

Test Plan: tested by running the E2E tests on this PR

Reviewed By: huntie

Differential Revision: D73855988

Pulled By: cipolleschi

fbshipit-source-id: d0d72e5a07cd88923e310767eae27f5df376d637
2025-04-29 09:14:11 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 91829bef5a Integrate sending notification to discord (#50979)
Summary:
As part of the work to integrate libraries with our nightlies, we want to receive a message when the libraries are failing to build on discord. This will help us catch breaking changes early on and onboarding library maintainer as soon as possible.

## Changelog:
[Internal] - Integrate with Discord when nightly fails

Pull Request resolved: https://github.com/facebook/react-native/pull/50979

Test Plan: GHA

Reviewed By: cortinico

Differential Revision: D73845810

Pulled By: cipolleschi

fbshipit-source-id: c6cfdf16b29642b1c3ad3872096c0e815fa88a0a
2025-04-29 08:57:30 -07:00
Lenny KarununganandFacebook GitHub Bot 868ec3db86 fix crash when host pause called and mCurrentActivity is null (#50992)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50992

shouldnt happen but when it does it shouldnt crash some more

fix for P1798860939

Changelog: [Internal] - fix crash when onHostPause is called and mCurrentActivity is null

Reviewed By: cortinico

Differential Revision: D73852655

fbshipit-source-id: 19ee4ada1c71a34a6115882e9a558b4ea9f9d8c7
2025-04-29 08:53:09 -07:00
Alex HuntandFacebook GitHub Bot 0968707ef7 Create src/fb_internal/ directory, initially migrate VirtualView (#50965)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50965

While D72228547 has recently disallowed all `./src/*` subpath imports from React Native (functionally, `./src/private/*`), we have a number of APIs that are imported from Meta product code legitimately — e.g. as part of validating under-development React Native features internally in real Meta apps.

This diff defines a new, exported `./src/fb_internal/*` subpath via `package.json#exports`, which will allow us to expose select entry points for this purpose.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D73770609

fbshipit-source-id: 397019669e565b95a86302ef30f80b65a17dcc0d
2025-04-29 07:52:24 -07:00
Jakub PiaseckiandFacebook GitHub Bot d2556c3cbd Update exports field to include the types entry (#50974)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50974

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D73835331

fbshipit-source-id: dc5002287408177db527140db967928a7714cf56
2025-04-29 07:37:39 -07:00
Alex HuntandFacebook GitHub Bot 46ddb604d9 Update Metro dependencies to 0.82.2 (#50977)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50977

Updates all `metro*` dependencies to the latest `^0.82.2`.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D73841705

fbshipit-source-id: dc550abfecddce933ed148f094aaf8629ffe549b
2025-04-29 06:25:22 -07:00
Dawid MałeckiandFacebook GitHub Bot 7959a63a1a Migrate rn-tester codegen types imports to use root exported CodegenTypes namespace (#50976)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50976

This is the second part of the migration of `rn-tester` package to use root imports. In this diff the `CodegenTypes` namespace is used to define Codegen primitives.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D73780584

fbshipit-source-id: c13c2dfcfa4d023978a9463af1d2a3bf7b72476c
2025-04-29 06:06:16 -07:00
Dawid MałeckiandFacebook GitHub Bot 9666a68977 Attach docs in AnimatedExports (#50975)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50975

Re-defining types in `AnimatedExports.js.flow` shadows their documentation located in `AnimatedImplementation`. Moving them to the `AnimatedExports` fixes the issue for generated TS types.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D73840908

fbshipit-source-id: 2648498a53660b483c70be647716accc11e96d82
2025-04-29 05:05:37 -07:00
Nicola CortiandFacebook GitHub Bot f882206bc9 Fix typo in ScrollView.d.ts (#50978)
Summary:
Fixes https://github.com/facebook/react-native/issues/50969

## Changelog:

[INTERNAL] -

Pull Request resolved: https://github.com/facebook/react-native/pull/50978

Test Plan: N/A

Reviewed By: fabriziocucci

Differential Revision: D73842116

Pulled By: cortinico

fbshipit-source-id: 90bcbdec46a5de02c34c909e6e411f7cd0ae34eb
2025-04-29 04:01:37 -07:00
Joe VilchesandFacebook GitHub Bot e486fda106 Check feature flags for a11yOrder iff prop exists (#50967)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50967

In some cases we may want to check this only if the prop exists

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D73793783

fbshipit-source-id: b498f82414edf63d8644b90bb3932298eb37b43c
2025-04-28 14:39:31 -07:00
Martin BoothandFacebook GitHub Bot 3e3094c3dd Sync offset value to native immediately (#50941)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50941

Without doing this, using Animated.event to update a value with an offset causes the value to revert to not having an offset because the native side doesn't even know about the offset if it hasn't been synced.

Don't think there's a better place to sync this for the cases where an animation is kicked off entirely from the native side

Changelog: [Android][Fixed] - Ensure latest offset value is synced to native

Reviewed By: javache

Differential Revision: D73622302

fbshipit-source-id: 7e67a7f41d900cc225af410af94ccdfd33c170c8
2025-04-28 14:06:44 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 4ce093154d Add screenReaderFocusable prop (#50850)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50850

This prop will be used to enable screen reader focusability without allowing keyboard focus. Mostly a quality of life prop for product engineers and maps 1:1 to Android

Changelog: [Android][Added] - Expose Android's screenReaderFocusable prop

Reviewed By: javache

Differential Revision: D73382051

fbshipit-source-id: 8171b9d24a735dd42d54abe4537fb487bdd011b7
2025-04-28 12:11:04 -07:00
Alex HuntandFacebook GitHub Bot 99c3aa3861 Add "./scripts/*" exports subpath (#50966)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50966

Should fix non-`.js` script resolution using `require.resolve` (currently breaking CI).

Changelog: [Internal]

Reviewed By: mdvacca, cipolleschi, rshest

Differential Revision: D73786668

fbshipit-source-id: 9f793cd9df217158aa4ade0a0b41c183caefae49
2025-04-28 11:41:50 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot fd8a3456ca Add accessibilityRespondsToUserInteraction prop (#50837)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50837

This prop can be used to disable user interaction with switch control, voice control or full keyboard access.

VoiceOver is not affected by it.

https://developer.apple.com/documentation/swiftui/view/accessibilityrespondstouserinteraction(_:)

Changelog: [iOS][Added] - Expose iOS's accessibilityRespondsToUserInteraction as a prop

Reviewed By: joevilches

Differential Revision: D73382060

fbshipit-source-id: c9f3137adc0ea34a58435f7f0438748fbfcc5a18
2025-04-28 11:15:35 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 1cfb46b63b Override updateRuntimeShadowNodeReferencesOnCommit for OSS (#50962)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50962

OSS is affected by https://github.com/facebook/react-native/issues/49694 and it is endangering the migration of multiple apps to the New Architecture.

We fixed the issue but it is hidden behind feature flag while we are experimenting with it internally, to make sure it does not causes regressions.

However, the fix has been verified for the reproducer code and the OSS will be beneficial for the community.

We are overriding the featureFlag, enabling it for OSS.

## Changelog:
[Internal] - Enable `updateRuntimeShadowNodeReferencesOnCommit` for OSS

Reviewed By: lenaic, cortinico

Differential Revision: D73771648

fbshipit-source-id: 4394a2370d9edd9699c8e03293868defd465853c
2025-04-28 10:55:07 -07:00
Jakub GrzywaczandFacebook GitHub Bot 4d7c4bd6e8 Fix ImageSource require (#50963)
Summary:
In react-native-svg, I found that the `Image` component stopped working starting with `react-native@0.79`. After some debugging, I traced the issue to the migration of `Libraries/Image` to the new export syntax (see https://github.com/facebook/react-native/commit/8783196ee540f8f78ce60ad20800338cc7645194). To fix this, I updated the import to match other requires, similar to https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js#L84.

## Changelog:

[GENERAL] [FIXED] - Fix codegen ImageSource require

Pull Request resolved: https://github.com/facebook/react-native/pull/50963

Test Plan:
`validAttributes` process should be a function instead of object with a default property.

Before:
<img width="1041" alt="image" src="https://github.com/user-attachments/assets/9fbc9e9f-6c45-4b0b-adb8-2eb911676fe1" />

After:
<img width="1005" alt="image" src="https://github.com/user-attachments/assets/ee594103-90da-4917-8252-72f4ecfc28e1" />

Reviewed By: Abbondanzo

Differential Revision: D73778127

Pulled By: huntie

fbshipit-source-id: ae80c770e8e578794ae1356751f170ff955e1f5a
2025-04-28 10:30:21 -07:00
Alex HuntandFacebook GitHub Bot 6ea24f7bb9 Define "react-native-strict-api" type exports (#50909)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50909

Enables and maps the `types_generated/` directory for `react-native` and `react-native/virtualized-lists` — exposing the new Strict TypeScript API entry points to React Native.

**New `"exports"` conditions**

- `"react-native-strict-api"` — The Strict TypeScript API opt in, exposing the `index.d.ts` entry point only.
- `"react-native-strict-api-UNSAFE-ALLOW-SUBPATHS"` — Opts into the new from-source generated types, but allows accessing subpaths (unsafe).
    - We intend for this unsafe condition to be an escape hatch for Frameworks only (i.e. Expo).

Note: In the case of `virtualized-lists`, we simply use the `"types"` condition — since this package did not expose any TypeScript API previously.

NOTE: Should we need to roll back JS Stable API phase 1, **this is the single diff to revert**.

Changelog:
[General][Added] - Configure the "react-native-strict-api" opt in for our next-gen TypeScript API

Reviewed By: cipolleschi

Differential Revision: D71969602

fbshipit-source-id: 291182cc826db8b33f21fc79698e6096876d17ef
2025-04-28 10:00:39 -07:00
Alex HuntandFacebook GitHub Bot 1d8fec19f0 Fix all active ESLint warnings (#50964)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50964

Address/supress ESLint warnings across the codebase, currently flagged on every PR via GitHub's "Unchanged files with check annotations" check.

{F1977480883}

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D73778510

fbshipit-source-id: 91bed86877eae74fa3b9ebea71e26cdcaeee1761
2025-04-28 09:31:46 -07:00
Vin-XiandFacebook GitHub Bot 93efaeb241 refactor: rewrite Inspector from Java to Kotlin (#50947)
Summary:
Rewrite of the Inspector class from Java to Kotlin in scope of https://github.com/facebook/react-native/issues/50513

## Changelog:
[ANDROID] [CHANGED] - Migrated Inspector to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/50947

Test Plan: Tested using RNTester app, on both old and new arch, and tested by navigating to multiple pages

Reviewed By: cortinico

Differential Revision: D73767386

Pulled By: javache

fbshipit-source-id: e0098568aa0ed9863503e206a88d3b171c8f9966
2025-04-28 09:20:56 -07:00
Nicola CortiandFacebook GitHub Bot 0e963aaa54 Gradle to 8.14 (#50960)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50960

This brings Gradle to the latest minor ahead of branch cut.

Changelog:
[Android] [Changed] - Gradle to 8.14

Reviewed By: cipolleschi

Differential Revision: D73769416

fbshipit-source-id: 52fd6b36068a719fbfdee6b5df0e80573567487a
2025-04-28 08:01:08 -07:00
Dawid MałeckiandFacebook GitHub Bot ddcab831b1 Migrate already root exported deep imports in rn-tester. (#50958)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50958

In rn-tester package there are many react-native deep imports which will be deprecated in the future. It is a starter for migrating rn-tester to using root imports instead. Only deep imports that are already root exported are changed. This diff avoids using `CodegenTypes` as it causes build errors and will be resolved in next stages.

Besides import changes, `PointerEvent` type is now also exported from the root.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D73656526

fbshipit-source-id: 5814a3d9c6a04b1236581dbbe291cd109e2c71c0
2025-04-28 07:24:46 -07:00
Rubén NorteandFacebook GitHub Bot e162fba413 Update interruptible rendering test to use feature flag to fix React<>Fabric priorities (#50959)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50959

Changelog: [internal]

This updates the test for interruptible rendering to use the feature flag that fixes priority mapping between Fabric and React.

In this case, it shows how the change fixed how React Native implements the React programming model, as before this change continuous events weren't interrupting transitions (and they should): https://github.com/facebook/react/blob/c498bfce8b9baa3dd21bd0d5124eb3a4549886f1/packages/react-reconciler/src/__tests__/ReactUpdatePriority-test.js#L109

Reviewed By: sammy-SC

Differential Revision: D73662527

fbshipit-source-id: 6276fe6f02b6c4e1af8dbb7d46c9a14ee6846636
2025-04-28 06:55:25 -07:00
Rubén NorteandFacebook GitHub Bot 9ae7f7fcc1 Refactor InterruptibleRendering Fantom test to use dispatchNativeEvent (#50957)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50957

Changelog: [internal]

Now we can use the higher level API for event dispatching in this test.

Reviewed By: javache

Differential Revision: D73663626

fbshipit-source-id: 961af26f62128f093c71ad14f457ac8544348415
2025-04-28 06:55:25 -07:00
Dawid MałeckiandFacebook GitHub Bot a120c5c4db Ignore warnings for imports from react-native/Libraries/Core/InitializeCore (#50903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50903

For now we do not change the way this module is exported to prevent breaking changes (due to high usage in external packages).  It is a tentative mitigation - this case requires more discussion and what could be sufficient. The `no-deep-imports` rule and plugin shouldn't emit a warning when encountered.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D73590627

fbshipit-source-id: 6f85c52373ee6c7c538c632b55cd9e0b9357f2a3
2025-04-28 05:32:11 -07:00
Sanjay ThakurandFacebook GitHub Bot 7a919d6966 Fix EXC_BAD_ACCESS within RCTInspectorNetworkReporter (#50952)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50952

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D73720844

fbshipit-source-id: 5acde68e811782a1a402ad633b56c7bdd9b7ea22
2025-04-28 04:55:05 -07:00
Nicola CortiandFacebook GitHub Bot 9345c88a61 Implement LegacyArchitecture warning for ShadowNode measure() (#50932)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50932

Add a warning for LegacyArch users that are providing a ViewManager with a corresponding shadow node that implements the `YogaMeasureFunction`.

For those users, we know that the ViewManager is most likely not working on the NewArch (unless they have a backward compat ViewManager with a C++ shadow node implementation).

Changelog:
[Android] [Added] - Warn Legacy Arch users if they use a Component with a ShadowNode with `YogaMeasureFunction.measure()` function. That Component will stop working on NewArch.

Reviewed By: javache

Differential Revision: D73654273

fbshipit-source-id: 70d232434f94bc2a6970379d566b276f73850fce
2025-04-28 04:28:06 -07:00
Alex HuntandFacebook GitHub Bot 3cf0102007 Redesign New App Screen and move to package (#50939)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50939

Redesigns React Native's `NewAppScreen` component, and moves it into a new `react-native/new-app-screen` package with a single component export. Deletes the old New App Screen under `'react-native/Libraries/NewAppScreen/'`.

{F1977434404}

**Motivation**

- **Reduces our public API** (see https://github.com/react-native-community/discussions-and-proposals/pull/894)
    - Separates this screen from the main `react-native` package, where it was a number of subpath exports.
    - Reduces the size of the main `react-native` package, including image assets — which are redundant for consumers like Expo.
- **Updated visual treatment**
    - Replace outdated logo, update to a responsive tablet/windowed layout.
    - Removes outdated guidance (e.g. "use cmd+R to reload"), and generally simplifies the layout (with the aim of reducing future maintenance).
- **Simplifies template boilerplate**
    - `NewAppScreen` is now a fully encapsulated screen layout, avoiding the cruft of the previous modular design.

**Integration plan**

When we cut the `0.80-stable` branch, we'll update [the template](https://github.com/react-native-community/template/blob/main/template/App.tsx) to import and use `<NewAppScreen />`.

- This will cause an extra runtime dependency in the template `package.json`, which will require user cleanup. We are happy with this tradeoff, given the self-evident package name, reduction of template boilerplate, and size reduction on the main `react-native` package.

Changelog:
[General][Breaking] - The `NewAppScreen` component is redesigned and moved to the `react-native/new-app-screen` package

Reviewed By: cipolleschi

Differential Revision: D73657878

fbshipit-source-id: 9ca07afa9fbdd6f32015eafa2f27d52ed182918e
2025-04-28 04:17:21 -07:00
Oskar KwaśniewskiandFacebook GitHub Bot 1b4a6ec1ca fix(CI): run monitor-new-issues only in the main repo (#50951)
Summary:
This PR makes sure that monitor-new-issues runs only in the main repo. It was failing on my fork and spamming notifications.

## Changelog:

[INTERNAL] [FIXED] - run monitor-new-issues only in the main repo

Pull Request resolved: https://github.com/facebook/react-native/pull/50951

Test Plan: CI Green

Reviewed By: cipolleschi

Differential Revision: D73763006

Pulled By: cortinico

fbshipit-source-id: cbb22f8804448b41de970d3d11930110b353994f
2025-04-28 03:22:04 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 403feb9bc2 Migrate ReactActivity (#50871)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50871

# Changelog:
[Android][Changed] - ReactActivity has been migrated to Kotlin.

Reviewed By: cortinico

Differential Revision: D73507044

fbshipit-source-id: 936263100ca93dafd643a53e5cb799fd5ed7e584
2025-04-28 01:53:11 -07:00
Mateo GuzmánandFacebook GitHub Bot 29cc2357e2 Remove unused com.facebook.react.bridge.MemoryPressure class (#50924)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.bridge.MemoryPressure).

Edit: we can remove it as has no usages

## Changelog:

[INTERNAL] - Remove unused com.facebook.react.bridge.MemoryPressure class

Pull Request resolved: https://github.com/facebook/react-native/pull/50924

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D73643870

Pulled By: rshest

fbshipit-source-id: 80c9abe82352a13cdd9f4110349e03656d423a05
2025-04-28 01:23:25 -07:00
Martin BoothandFacebook GitHub Bot 9efcdc091c Calling setOffset actually calls setAnimatedNodeOffset currently (#50913)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50913

Changelog: [Android][Fixed] - Fix BatchExecutionOpCodes.OP_CODE_SET_ANIMATED_NODE_OFFSET mapping to call setAnimatedNodeOffset (rather than setAnimatedNodeValue)

Reviewed By: zeyap, Abbondanzo

Differential Revision: D73608624

fbshipit-source-id: 38e5b94d9fa8b0a0d776e7886020b4cb1e347821
2025-04-27 17:52:17 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot eb2f6b1ae5 Fix RemoveClipped subviews algorithm
Summary:
For real this time, the change was lost due to some merge conflict

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D73726167

fbshipit-source-id: 1e0cef75f59a166d795922266365b2b7b060472e
2025-04-26 17:35:22 -07:00
Alex HuntandFacebook GitHub Bot 319ba0afd2 Define "exports" field on main package (#50872)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50872

NOTE: Resubmission of D71968187.

Define `"exports"` field on the main `react-native` package.

**Notes**

Module resolution should be equivalent to the previous implicit `"main"` field (backwards compatible).

- Exports all module subpaths to JavaScript (Flow) source files, with and without `.js` suffix (unchanged )
    - These are restricted to the `flow/` and `Libraries/` subdirectories (ℹ️ this should be unchanged, matching any JS imports apps may have today)
        - Still includes 3P integration scripts such as `./jest-preset.js` and `./rn-get-polyfills.js` (unchanged )
- Exports `./package.json` (unchanged )
- TypeScript should:
    - fall back to the `"types"` field (unchanged )
    - OR to `"."`,`"./*"` when Package Exports support is enabled via `compilerOptions`, and use the *adjacent `.d.ts` file* (unchanged )

Changelog:
[General][Breaking] - The `react-native` package now defines package.json `"exports"`.
- While these expose existing JavaScript and TypeScript modules, this change may affect deep imports of non-JS files via Node in third party tools.
- Jest mocks to a `react-native` subpath will need to be updated to match the import path used in your code.
- Imports from `src/` and `src/private/` directories are disallowed.

Reviewed By: robhogan

Differential Revision: D72228547

fbshipit-source-id: d50d6e556d32a9cf2f90855a562e61549853acb9
2025-04-25 15:40:14 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 9526406fc2 Fix crash with nested FlatLists and fix edge case with nested views (#50855)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50855

This diff addresses a crash caused by view duplication in React Native Android. The issue occurred when a view was not already clipped and was laid out again, resulting in duplicated views.

This problem was particularly noticeable when using nested FlatLists, which triggered a custom focus search with an incomplete and buggy duplicated FlatList container view.

The fix involves preventing the duplication of views by checking if a view is clipped already before laying it out again. Additionally, this diff includes two other improvements:
- Preventing clipping issues: When a view is nested within a non-ReactClippingViewGroup ancestor, focus searching would fail due to the needUpdateClippingRecursive logic only running on instances of ReactClippingViewGroup. By excluding these ancestors, we ensure that the next focusable view can be properly excluded from being clipped.
- Minor fix: A minor fix was made to prevent potential issues in deeply nested cases.
- Add a Kill switch with a feature flag and mobile config combo.

Reviewed By: joevilches

Differential Revision: D73471780

fbshipit-source-id: efbb968600f21b24ab1fa32222d555f346fb336e
2025-04-25 13:01:31 -07:00
Adrian StoneandFacebook GitHub Bot 0f55ef7754 Replace hsr_core dependency for react profiling with hz_tracing dependency (#50936)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50936

D63141469 introduced an option to use HSR Core's trace macros for profiling react.  I believe this was to enable Tracy support.  However, the consequence of this is that hsr core is statically linked twice into Worlds, once in libclient_server_android.so and once into libxplat_js_react-native-github_packages_react-native_ReactCxxPlatform_react_profiling_profiling.so.
It isn't obvious that this causes any problems, but it does result in some weirdness with regard to symbol interposition between the two shared libraries.  Some tracing categories are registered twice in hz_tracing, for example.

Since the HSR Core macros call directly through to hz_tracing, this change simply replaces the HSR Core dependency with an equivalent hz_tracing dependency.

Reviewed By: javache

Differential Revision: D73532803

fbshipit-source-id: 56d4b62873aabcbf0a92cebd7a0f720fed616158
2025-04-25 11:31:43 -07:00
David VaccaandFacebook GitHub Bot dfa3a9575a Remove usages of ShadowNodes by fully releasing disableShadowNodeOnNewArchitectureAndroid() (#50908)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50908

This diff removes the usages of ShadowNodes in the new architecture by fully releasing disableShadowNodeOnNewArchitectureAndroid() feature flag.
changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D73519567

fbshipit-source-id: e222e3b4fab371c8bc5480950da005d2a12a8619
2025-04-25 10:29:33 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 6520db2868 Fix RNTester running in the old architecture (#50940)
Summary:
We landed a PR that was importing a file available only in the New Architecture also when the app was running in the old architecture.
This was creating a corrupted bundle for rntester.

This PR fixes the issue

bypass-github-export-checks

## Changelog:
[Internal] - Fix RNTester on Android

Pull Request resolved: https://github.com/facebook/react-native/pull/50940

Test Plan: Tested locally by setting `newArchEnabled` to false in the gradle.properties file

Reviewed By: javache, cortinico

Differential Revision: D73663049

Pulled By: cipolleschi

fbshipit-source-id: c8d6e4190adee7388e51901360a811b0007ee3a5
2025-04-25 09:53:38 -07:00
Rubén NorteandFacebook GitHub Bot 2489308871 Improve pattern to access host instances in tests (#50938)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50938

Changelog: [internal]

No more `maybeNode`s. Using ref objects makes the tests cleaner and the JSX easier to read than injecting lambdas.

This speaks for itself:
* 617 lines added
* 1393 lines removed

{F1977434870}

Reviewed By: lenaic

Differential Revision: D73659018

fbshipit-source-id: d1c23e6457bb1d351ce02b9f6fa8778b06ee0e55
2025-04-25 09:22:02 -07:00
Samuel SuslaandFacebook GitHub Bot 12b4a0f4f3 Back out "Bridgeless: Fix unstable_hasComponent" (#50937)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50937

changelog: [internal]

Reviewed By: yungsters

Differential Revision: D73657804

fbshipit-source-id: d1069f7d8def662f7a26a1ff2d5e90fe3e31b9f9
2025-04-25 08:44:10 -07:00
Nicola CortiandFacebook GitHub Bot 0ad9de86d1 Removing internal ModalHostShadowNode and ModalHostHelper classes (#50935)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50935

Those classes are internal and deprecated since a while.
It should now be safe to fully remove them.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D73655877

fbshipit-source-id: cdca8f032fe865f9a08c40e4a0145945c7e25a85
2025-04-25 08:20:51 -07:00
Nicola CortiandFacebook GitHub Bot 465469e92c Cleanup LegacyArchitectureLogger.OSS_LEGACY_WARNINGS_ENABLED (#50931)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50931

This removes all the `OSS_LEGACY_WARNINGS_ENABLED` infrastructure from LegacyArchitectureLogger. We'll instead pivot to use ad-hoc functions for scenarios that don't work in LegacyArch + Interop Layers (see D73654273).

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D73654272

fbshipit-source-id: d10eac2ded92f2c0191503e64f0c1d9db688d6e9
2025-04-25 07:49:59 -07:00
Nicola CortiandFacebook GitHub Bot 1c920d305d RNTester - Do not explicitely enable legacyWarningsEnabled (#50930)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50930

Due to D73591315, we don't need to specify the `legacyWarningsEnabled` for RNTester anymore as it's effectively ignored.

Changelog:
[Internal] [Changed] -

Reviewed By: rshest, cipolleschi

Differential Revision: D73654270

fbshipit-source-id: 9428634fb8374024940e4041de60d679b6f352a2
2025-04-25 07:49:59 -07:00
Nicola CortiandFacebook GitHub Bot 5a476e94be RNGP - Ignore the legacyWarningsEnabled property if provided (#50929)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50929

We decided to change the warning model for LegacyArch/NewArch.

I'm currently removing the infra to read the `legacyWarningsEnabled` Gradle property if provided.

Warnings will be enabled by default for all Legacy Arch users in the new model.

This change was never shipped in a numbered version, so that's not breaking.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D73591315

fbshipit-source-id: a46fade91b46fcc9b81984577161c046dc0939b6
2025-04-25 07:49:59 -07:00
Mateo GuzmánandFacebook GitHub Bot 8b0635bd15 Make MeasureUtil internal (#50918)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.views.view.MeasureUtil).

## Changelog:

[INTERNAL] - Make com.facebook.react.views.view.MeasureUtil internal

Pull Request resolved: https://github.com/facebook/react-native/pull/50918

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache, cortinico

Differential Revision: D73642487

Pulled By: Abbondanzo

fbshipit-source-id: a6bfa875883ec1c179022305734eadc00184123b
2025-04-25 06:56:11 -07:00
Jacek PudyszandFacebook GitHub Bot 8a8737af62 feat: add support for numeric font weight values in shadow tree (#50901)
Summary:
This PR aligns the JS `fontWeight` types and supports numeric `fontWeight` values in the C++ converter.
Previously, React Native cast `fontWeight` to a string on the JS layer, so handling integers was unnecessary.

Some libraries, such as `react-native-unistyles` and `react-native-reanimated`, use `ShadowTree` to update user styles. In these cases, `ShadowTree` cannot handle numeric `fontWeight` values passed directly from the user, resulting in the default `fontWeight` being applied instead.

This PR introduces a simple numeric converter to cover this case.

Fixes https://github.com/facebook/react-native/issues/50544

## Changelog:

[INTERNAL] [ADDED]

Pull Request resolved: https://github.com/facebook/react-native/pull/50901

Test Plan:
Patched locally with the Unistyles repo, as it is very difficult to create a small reproducer for working with ShadowTree.

### Test description:

Add custom logic that changes the Text's `fontWeight` based on the user's color scheme.
For light mode we should use `fontWeight: 100`; for dark mode `fontWeight: 500`.

#### Before:

https://github.com/user-attachments/assets/fe98fe92-3853-4bca-802a-8ec8b80862f3

https://github.com/user-attachments/assets/9ad82909-4b4f-4502-a2e1-d2837aacf524

#### After:

https://github.com/user-attachments/assets/520ed266-4d05-44ad-9dbe-e800917657a9

<video src="https://github.com/user-attachments/assets/acb37354-7ce4-4b9c-81bd-977cad04818b" width="400" />

Reviewed By: NickGerleman

Differential Revision: D73596819

Pulled By: javache

fbshipit-source-id: d609ee986f52875c5cf06ae3eaa01ecdb1428980
2025-04-25 06:52:11 -07:00
Pieter De BaetsandFacebook GitHub Bot aa8c072870 Fix Switch broken as controlled component (#50928)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50928

This broke in D72979663, since we relied on the object identify of `native` changing to correctly reset the native state back to the controlled JS state.

Changelog: [General][Fixed] Fixed switches correctly reverting to controlled state

Reviewed By: vzaidman

Differential Revision: D73653323

fbshipit-source-id: d6ca8a31d9f08a339c7acf6bba264137690dd794
2025-04-25 06:13:11 -07:00
Yogesh Choudhary PaliyalandFacebook GitHub Bot de165a2cfd refactor: Rewrite JSBundleLoader from Java to Kotlin (#50911)
Summary:
Rewrite of JSBundleLoader from Java to Kotlin in scope of https://github.com/facebook/react-native/issues/50513

## Changelog:
[ANDROID] [CHANGED] - Migrated JSBundleLoader to Kotlin

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/50911

Test Plan: Tested using RNTester app, on both old and new arch, and tested by navigating to multiple pages

Reviewed By: cortinico

Differential Revision: D73649145

Pulled By: javache

fbshipit-source-id: 7ef1fc1ea1c53a8b914ae1aada1966e64b4c3d80
2025-04-25 05:23:43 -07:00
Samuel SuslaandFacebook GitHub Bot 0c8f3aca0e incorporate feedback to Fantom's user guide (#50899)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50899

changelog: [internal]

making things clearer in the docs for Fantom.

Reviewed By: rubennorte

Differential Revision: D73580305

fbshipit-source-id: 0e5edaa3baf57fc54f7a0c454fe4d2fa81627f66
2025-04-25 04:54:58 -07:00
Mateo GuzmánandFacebook GitHub Bot 4207f9951f Make DrawerStateChangedEvent internal (#50917)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.views.drawer.events.DrawerStateChangedEvent).

## Changelog:

[INTERNAL] - Make com.facebook.react.views.drawer.events.DrawerStateChangedEvent internal

Pull Request resolved: https://github.com/facebook/react-native/pull/50917

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D73643872

Pulled By: rshest

fbshipit-source-id: b181af5be7e67e9f088d9cbf685436b3e9600500
2025-04-25 03:31:05 -07:00
Mateo GuzmánandFacebook GitHub Bot 7dea1d734e Make ReactInterceptingViewGroup and OnInterceptTouchEventListener internal (#50919)
Summary:
These classes can be internalized as part of the initiative to reduce the public API surface. I've checked there are no relevant OSS usages.

- [ReactInterceptingViewGroup](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.touch.ReactInterceptingViewGroup)
- [OnInterceptTouchEventListener](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.touch.OnInterceptTouchEventListener)

## Changelog:

[INTERNAL] - Make ReactInterceptingViewGroup and OnInterceptTouchEventListener internal

Pull Request resolved: https://github.com/facebook/react-native/pull/50919

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache, cortinico

Differential Revision: D73643867

Pulled By: rshest

fbshipit-source-id: 8e3c9d36f3cdd985d53189c83e462ca1c612d96c
2025-04-25 03:02:46 -07:00
David VaccaandFacebook GitHub Bot 906474a709 Annotate Interop Event APIs (#50927)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50927

Annotate Interop Event APIs

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D73407612

fbshipit-source-id: 90cd6d888b3d72c09e3eb4c5142cc50da65d9b4c
2025-04-24 22:06:30 -07:00
David VaccaandFacebook GitHub Bot 7e4ec7d8d3 Mark NativeModule interop classes with InteropLegacyArchitecture (#50926)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50926

Mark NativeModule interop classes with InteropLegacyArchitecture

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D73407611

fbshipit-source-id: 57de0ec81209ec0947520278f3adbc9c0bb58369
2025-04-24 22:06:30 -07:00
David VaccaandFacebook GitHub Bot a7b0619846 Introduce InteropLegacyArchitecture annotation (#50906)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50906

Annotation to mark classes or functions that are part of the interop APIs that provide support for legacy architecture APIs in the new architecture of React Native .

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D73407613

fbshipit-source-id: 887a14ca4dea891b50e7df01e0ffff5064cd43ea
2025-04-24 22:06:30 -07:00
Nick GerlemanandFacebook GitHub Bot 01cc16bbfe Extract TextLayoutManager::baseline() (#50888)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50888

This is shared between platforms using a very strange pattern. Let's just extract this into its own function. Not considering breaking, since TextLayoutManager is internal interface.

Changelog: [internal]

Reviewed By: rshest

Differential Revision: D73555465

fbshipit-source-id: ea99fbebd9db44efd1dc56c2cad68b5b56e77ad1
2025-04-24 20:10:57 -07:00
Nick GerlemanandFacebook GitHub Bot eb459a9f42 Platform specific PargraphState (#50890)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50890

With Facsimile, we are introducing some new concept of `PreparedText`, where platform TextLayoutManager which implement, can lead to additional optimizations.

`#ifdef ANDROID` is not a workable pattern for this. Apart from react-native-cxx getting hooked into it, and all of the existing bugs there, it is bad for editor environment, and hard to reason about.

This splits up `ParagraphState`, so that we can control platform specific bits more easily. We do not split `ParagraphShadowNode`, which will use concepts (e.g. `TextLayoutManagerWithPreparedText`) to control which paths it takes, based on platform capaibilities.

Changelog: [internal]

Reviewed By: rshest

Differential Revision: D73555441

fbshipit-source-id: fd585eb99d26b0b6966efb1867d03fbd5cc7e7e2
2025-04-24 20:10:57 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot fcb3ef3f76 Add unit tests for Radial Gradient and fix typo on conversion.h (#50835)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50835

tsia

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D73371776

fbshipit-source-id: 0016f42de4dc95d76da561f6af9c7ef57e407a2c
2025-04-24 17:27:52 -07:00
Nick GerlemanandFacebook GitHub Bot fd126b36b7 PreparedLayoutTextViewManager (#50923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50923

This implements the view manager for `PreparedLayoutTextView`, originating by taking the view managers composing `ReactTextView`, converting to Kotlin, and removing everything no longer needed.

In Facsimile, anything influencing text appearance is applied earlier, when creating the Fabric layout, so there are many less setters here. Most visual attributes are instead present in the state we are presenting.

We have tasks for some of these, that need to be reimplemented, as they do not currently influence the Spannable being measured. That includes e.g. `ReactTextViewManagerCallback`, used for injection, and `dataDetectorType` for linkifying Spannable.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D73287706

fbshipit-source-id: 938b57d4e443f6b8bb127e17b47cc371f31a416d
2025-04-24 17:20:03 -07:00
Nick GerlemanandFacebook GitHub Bot 6465cb1b0b PreparedLayoutTextView (#50922)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50922

This forms the basis for a replacement of `TextView`.

This started off with Litho's [`RCTextView`](https://github.com/facebook/litho/blob/master/litho-rendercore-text/src/main/java/com/facebook/rendercore/text/RCTextView.java), which is a simple view, for rendering a text layout, and providing some built-in keyboard navigation and a11y support. Many changes were made to it, including:

1. Removing many parts not relevant to RN, or which will be replaced by other RN infra. E.g. we will reuse existing a11y delegates, have existing ways of creating Spannables and text layouts, inline views, etc
2. Converting to Kotlin
3. Adding back in some changes required for RN's drawing, and expected view manager APIs (e.g. overflow/clipping customization)
4. Making it target a ViewGroup instead of a View, for correct inline view support down the line

Because we rely on drawing text layout, with the same Spannable as before, most things "just work", because they are part of the layout we are drawing, generated by TextLayoutManager on the Fabric side. We don't offer much customization to what can be drawn, forcing it to have happened in the layout we are showing already.

There are quite a few bits not implemented yet. Some of these are cases, like `textAlignVertical`, were previously incorrectly implemented just at the ReactTextView layer, so Fabric layout was unaware of them. Another similar class to this is any non-default fonts which we must load. `adjustsFontSizeToFit` (stubbed out in later diff) will also need some tweaking with the new assumption we don’t want to mutate Spans/layouts set in State.

Fine grained selection support is the largest tbd.

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D73282649

fbshipit-source-id: abe3a30461095d2d0ddbc6c939704f3982f44771
2025-04-24 17:20:03 -07:00
Nick GerlemanandFacebook GitHub Bot 75a01c37ae Add unstable ReferenceStateWrapper API (#50921)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50921

This adds the ability to represent Fabric State sent to Java View managers as a raw JNI reference. This is used by Facsimile to tell a component to mount a layout, previously generated during measurement.

This API is consciously well hidden (in comparison to MapBuffer which is fairly public). To use it:
1. The concrete state data representation must implement a method named `getJNIReference()` that returns an fbjni ref
2. The Java view manager must cast the `StateWrapper` to an internal `ReferenceStateWrapper` type, not exposed outside of React Native internals

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D73159146

fbshipit-source-id: b7602bf7717bff28d2f3b259073bc47606fd76e4
2025-04-24 17:20:03 -07:00
Nick GerlemanandFacebook GitHub Bot 9f941c50c9 Make StateWrapperImpl Internal (#50920)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50920

We construct this from JNI, which doesn't care about visibility, and then only want to expose `StateWrapper` as the public interface.

Changelog:
[Android][Removed] - Make StateWrapperImpl Internal

Reviewed By: Abbondanzo

Differential Revision: D73161592

fbshipit-source-id: b787e31e190dc52a02d73cadfa77b1c1defb9703
2025-04-24 17:20:03 -07:00
Luna WeiandFacebook GitHub Bot dd52b4e212 Update Fantom tests to use scrollTo (#50912)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50912

Changelog: [Internal] - Update IntersectionObserver Fantom tests to use the new `scrollTo` api which didn't exist when I first wrote these tests. As well, do clean up between tests

Reviewed By: rubennorte

Differential Revision: D73551695

fbshipit-source-id: 9625328879230d178f23a089436f2a3c7b8323bd
2025-04-24 15:03:31 -07:00
AjitandFacebook GitHub Bot 87c54a7eba fix fetch of content scheme urls failing on Android (#50122)
Summary:
This PR fixes https://github.com/facebook/react-native/issues/48762
- fix creating Blobs from Android 'content://' scheme urls was failing on the js side due to [this check](https://github.com/JakeChampion/fetch/blob/ba5cf1ed2e02ebb96fa1e60b4fd2eb04071b60e4/fetch.js#L547)

## Changelog:
[ANDROID] [FIXED] - fix fetch of content scheme uris failing on Android.

Pull Request resolved: https://github.com/facebook/react-native/pull/50122

Test Plan:
Used the App here to test Android Blob creation. https://github.com/giantslogik/blob-large-file-fetch.

EDIT: Added tester to RNTester

Reviewed By: rshest

Differential Revision: D73576300

Pulled By: javache

fbshipit-source-id: 3fa5966aabd10d5fbe9f441948309c66e7113199
2025-04-24 12:39:58 -07:00
Pieter De BaetsandFacebook GitHub Bot ac8b01fb6f Fix OSS build error in JavaModuleWrapper (#50905)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50905

Subtle compiler differences cause this to fail, but we can just `Class<*>` here instead.

Changelog: [Internal]

Reviewed By: cortinico, rshest

Differential Revision: D73593304

fbshipit-source-id: ea3996fc0641ae5d12a6923bd78645e21232afe7
2025-04-24 11:41:11 -07:00
Anupriya VermaandFacebook GitHub Bot 49ea9d80b8 Support headers [crossOrigin and referralPolicy] in Image without src and srcSet and only remote source.uri (#50799)
Summary:
Resolves https://github.com/facebook/react-native/issues/50778

### Problem Description

Implement the crossOrigin property for Image in RNW Fabric when only source.uri is passed and not src/ srcSet.

For reference, check the public API documentation: https://reactnative.dev/docs/image#crossorigin

Implement the referrerPolicy property for Image in RNW Fabric when only source.uri is passed and not src/ srcSet.

For reference, check the public API documentation: https://reactnative.dev/docs/image#referrerpolicy

Also refer docs for source, src, srcSet
https://reactnative.dev/docs/image#source
https://reactnative.dev/docs/image#src
https://reactnative.dev/docs/image#srcset

It's not mentioned in the doc that when src / srcSet is missing then crossOrigin / referralPolicy would be ignored when source uri is a remote URL that is passed.

Currently these were ignored if src / srcSet was not passed and not added to sources headers.

This change adds headers support even without passing src / srcSet and only sources uri that consists of remote URL.

crossOrigin and referrerPolicy are passed as source.headers here:

![Image](https://github.com/user-attachments/assets/6df1a274-353e-4e03-9033-75695d04e2c0)

### Steps to reproduce

```
 <Image
              defaultSource={{uri: this.state.defaultImageUri}}
              source={{uri: this.state.imageUri}}
              crossOrigin="use-credentials"
              referrerPolicy="no-referrer"
            />
```

Pass this in React Native and check source headers

## Changelog:
[GENERAL] [ADDED] - Support headers [crossOrigin and referralPolicy] in Image without src and srcSet and only remote source.uri

Pull Request resolved: https://github.com/facebook/react-native/pull/50799

Test Plan:
Refer this PR for testing; https://github.com/microsoft/react-native-windows/pull/14521
## Screenshots
_Add any relevant screen captures here from before or after your changes._
Before
![image](https://github.com/user-attachments/assets/21804411-91f4-4a27-b6e9-971675cbd546)

After
<img width="790" alt="image" src="https://github.com/user-attachments/assets/8e0a2522-7009-430d-b848-da80896670f4" />

## Testing
_If you added tests that prove your changes are effective or that your feature works, add a few sentences here detailing the added test scenarios._

Tested in playground and RNW Tester and Visual Studio Debugger

_Optional_: Describe the tests that you ran locally to verify your changes.

1. Tested with only source remote uri passed
2. Tested with both source, src
3. Tested with source, src, srcSet

Reviewed By: javache

Differential Revision: D73427747

Pulled By: cipolleschi

fbshipit-source-id: f09174d1e4eaa2173b27970a6079eeb8ba6f3069
2025-04-24 11:10:59 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 0e11e6a28b Sync React 19.1 into React Native OSS (#50865)
Summary:
X-link: https://github.com/facebook/metro/pull/1492

Pull Request resolved: https://github.com/facebook/react-native/pull/50865

This change updates React in React Native OSS from 19 to 19.1
bypass-github-export-checks
## Changelog:
[General][Changed] - Bump React to 19.1

## Internal:
jest_e2e[run_all_tests]

Reviewed By: cortinico

Differential Revision: D73502629

fbshipit-source-id: 362897e8b491d1474f433ee7ad3306baf95d2e6c
2025-04-24 10:15:42 -07:00
Nicola CortiandFacebook GitHub Bot e4bf88a076 AGP to 8.9.2 (#50900)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50900

This bumps the minor of Android Gradle Plugin ahead of the branch cut for 0.80

Changelog:
[Android] [Changed] - AGP to 8.9.2

Reviewed By: rshest

Differential Revision: D73579447

fbshipit-source-id: f0d40ba3d160e332ee9ab2853a949ed6ec51a3fc
2025-04-24 09:44:26 -07:00
aleqsioandFacebook GitHub Bot 4cc9db1cd5 Fix disappearing redbox on initial load of an invalid bundle. (#50867)
Summary:
Right now having a javascript error like an invalid import statement during first bundle load results in a disappearing redbox screen.

https://github.com/user-attachments/assets/ab9c64f5-6e32-481c-a58f-6d37bb920acb

The `invalidate` call removed in this PR cleans up all turbomodules, including the RedBox module, which in turns calls `dismiss` in `RCTRedBox`.

After removing this line the result is as following:

https://github.com/user-attachments/assets/6eeb4d43-f883-440f-ade3-5628f85f833a

I made sure that the `invalidate` function is still called when executing only two possible ways to reload the bundle:
- the Reload button
- Cmd+R

The HMR/hot reload is not connected if the bundle has an error on initial load, so we don't need to worry about it.

Longer term, it would be better to establish HMR and use a different redbox in this case:

![simulator_screenshot_DFF4EA47-DA12-46A9-81DF-9904B35EB1D9](https://github.com/user-attachments/assets/c46eb0e9-845a-4b62-96e2-74215cbdad18)

Doing this requires larger changes to the bundle loading flow – happy to to try and land that change if there's any guidance you could give.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[IOS][FIXED] – Fix disappearing redbox on initial load of an invalid bundle.

Pull Request resolved: https://github.com/facebook/react-native/pull/50867

Test Plan: I have tested this change using RN from main and RNTester app (see videos).

Reviewed By: cortinico

Differential Revision: D73511154

Pulled By: cipolleschi

fbshipit-source-id: dfe149ebc15d845f07fd3926db2e063b468870af
2025-04-24 08:54:09 -07:00
Dawid MałeckiandFacebook GitHub Bot 3e14d1638c Add babel plugin to @react-native/babel-preset for console.warn injection under deep react native imports (#50802)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50802

The plugin analyses the source of all `import`, `require`, and `export` statements and injects the `console.warn` statement for each path targeting deep react-native source code. It runs only on a dev mode so there is no need to keep that in the `if (__DEV__) ` block. It is possible to disable this plugin by setting `disableDeepImportWarnings: true` and **resetting** the Metro cache:

```js
module.exports = {
  presets: [['module:react-native/babel-preset', {
    "disableDeepImportWarnings": true
  }]],
};
```

Changelog:
[General][Internal] - Added plugin to react-native/babel-preset injecting `console.warn` for each react native deep import in dev mode.

For a given code:
```js
import { Image } from 'react-native';
import View from 'react-native/Libraries/Components/View/View';
const Text = require('react-native/Libraries/Text/Text');
export { PressabilityDebugView } from 'react-native/Libraries/Pressability/PressabilityDebug';
```

The transformed output should look like:

```js
import { Image } from 'react-native';
import View from 'react-native/Libraries/Components/View/View';
const Text = require('react-native/Libraries/Text/Text');
export { PressabilityDebugView } from 'react-native/Libraries/Pressability/PressabilityDebug';
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Components/View/View').");
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Text/Text').");
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Pressability/PressabilityDebug').");
```

For more information about why this plugin was needed, please check [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/894).

Reviewed By: huntie

Differential Revision: D70783145

fbshipit-source-id: ae145db6471d861099566a8faf2fbd93bd136450
2025-04-24 08:04:21 -07:00
Wojciech LewickiandFacebook GitHub Bot bef5cc1007 fix: build proper hermes for all debug variants (#50897)
Summary:
When building hermes from source in a project that has a debug scheme not named strictly "Debug", hermes is built with wrong flags which makes the compilation fail. We should use a better check for such cases, analogous to https://github.com/facebook/react-native/blob/ec43150b2a8db3a93137ae69ac414859a2fff73e/packages/react-native/scripts/react-native-xcode.sh#L16. I haven't found any other usages of this pattern: https://github.com/search?q=repo%3Afacebook%2Freact-native%20%24CONFIGURATION&type=code, hopefully other places use the correct semantics already.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[IOS] [FIXED] - properly check for debug schemes when building hermes from source

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[IOS] [FIXED] - properly check for debug schemes when building hermes from source

Pull Request resolved: https://github.com/facebook/react-native/pull/50897

Test Plan: Use e.g. https://github.com/martinlAP/keyboardcrash with `Dev-Debug` scheme and try to build hermes from source based on https://github.com/facebook/hermes/blob/rn/0.79-stable/doc/ReactNativeIntegration.md. to see that it fails without this PR.

Reviewed By: rshest

Differential Revision: D73579031

Pulled By: cortinico

fbshipit-source-id: 3a48c6fe63f78fbc9cf566d300b9518aa9abdd89
2025-04-24 06:15:42 -07:00
Samuel SuslaandFacebook GitHub Bot 51091d434a add a view culling test case when for reparenting a culled grand (#50894)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50894

changelog: [internal]

adding more tests to cover all branches of `calculateShadowViewMutationsFlattener`.

calculateShadowViewMutationsFlattener is over 400 lines of code and covers quite a few edge cases. I plan to cover every branch with a test to make it easier to refactor Differentiator in the future.

Reviewed By: rubennorte

Differential Revision: D73543444

fbshipit-source-id: b0b22aba4b9cc4718edd2a6c4535993be437ed9f
2025-04-24 05:32:48 -07:00
Samuel SuslaandFacebook GitHub Bot d8fe0d2ee2 simplify parent-child flattening-unflattening (#50893)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50893

changelog: [internal]

In the two branches changed by this diff, it is unnecessary to check `reparentMode` because `reparentMode` and `childReparentMode` will always mismatch. When `childReparentMode` is unflatten, `reparentMode` will be flatten and vice versa. This is guaranteed by a `if else` statement above: https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.cpp#L674

This slightly simplifies code and lowers the burden on the reader.

Reviewed By: javache, rubennorte

Differential Revision: D73571160

fbshipit-source-id: 8623d991f7b063f70c95720ca0d3b63318dfc08b
2025-04-24 05:32:48 -07:00
Mateo GuzmánandFacebook GitHub Bot 94fed5facc Flip mockito usages to mockito-kotlin (#50878)
Summary:
As the repository is moving towards Kotlin and the tests have also been moving towards mockito-kotlin, I'm doing another round here.

## Changelog:

[INTERNAL] - Flip mockito usages to mockito-kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/50878

Test Plan:
```sh
yarn test-android
```

Reviewed By: javache

Differential Revision: D73569293

Pulled By: rshest

fbshipit-source-id: 9bfe7d3f69480367384eafdde429db15eb81d11c
2025-04-24 05:21:57 -07:00
drrefactorandFacebook GitHub Bot 79d3eea0b7 refactor: Rewrite JavaModuleWrapper from Java to Kotlin (#50882)
Summary:
Rewrite of JavaModuleWrapper from Java to Kotlin in scope of https://github.com/facebook/react-native/issues/50513

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [CHANGED] - Migrated JavaModuleWrapper to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/50882

Test Plan:
Test RNTester using old arch. SampleLegacyModule is the one I've used, it needs to be enabled for old arch though (RNTesterApplication.kt -> getPackages & getReactModuleInfoProvider).

I may enable SampleLegacyModule for old arch to make testing easier. mateoguzmana
It breaks on `getDynamic` on old arch, but I could filter these from examples or add some fallback in SampleLegacyModule.kt for old arch.

Reviewed By: cortinico

Differential Revision: D73576099

Pulled By: javache

fbshipit-source-id: c940be27133258fa589571a600435fa478e6b51e
2025-04-24 04:58:43 -07:00
Samuel SuslaandFacebook GitHub Bot c443bc18f5 clean up removeTurboModuleManagerDelegateMutex feature flag (#50891)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50891

changelog: [internal]

remove unnecessary mutex in RCTTurboModuleManager.mm.

Reviewed By: philIip

Differential Revision: D73506191

fbshipit-source-id: 54c83704ffb8066f214e683a163face78f1922d5
2025-04-24 04:23:42 -07:00
Pieter De BaetsandFacebook GitHub Bot fc55cc3318 Simplify InteropModuleRegistry API (#50863)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50863

No need for `shouldReturnInteropModule` if we can just use the nullability of what's returned by `getInteropModule` instead.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D73501845

fbshipit-source-id: 9b7628707edc3eb288733baffaca59a9d3c40b40
2025-04-24 03:20:12 -07:00
Pieter De BaetsandFacebook GitHub Bot 22f2247a96 Migrate ReactInstanceProcessedErrorConverter to Kotlin (#50870)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50870

As explained in the doc block, now that ReactInstance is in Kotlin we can move this logic to StackTraceHelper and migrate it to Kotlin

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D73503879

fbshipit-source-id: 38a9ff346e00d68bbc3c383834e2a1763dbba9b8
2025-04-24 03:03:06 -07:00
Mateo GuzmánandFacebook GitHub Bot 12147e3bee TypeScript: Replace deprecated React.ElementRef usages to React.ComponentRef (#50883)
Summary:
While upgrading a project to React 19, I noticed React.ElementRef is deprecated (see [types/react/index.d.ts#L199](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L199)). I think we can replace it for the RN types as well.

Not sure if this is considered as a breaking change.

## Changelog:

[GENERAL] [CHANGED] - TypeScript: Replace deprecated React.ElementRef usages to React.ComponentRef

Pull Request resolved: https://github.com/facebook/react-native/pull/50883

Test Plan:
Create a RNTesterPlayground.tsx next to the normal .js just to validate the type checking is not throwing an unexpected error.

<details>
<summary>Code snippet:</summary>

```tsx
import React, { useRef, useEffect } from 'react';
import { FlatList, Text, View } from 'react-native';

type Item = { id: string; title: string };

const data: Item[] = Array.from({ length: 10 }, (_, i) => ({
  id: i.toString(),
  title: `Item ${i + 1}`,
}));

const FlatListScrollRefExample: React.FC = () => {
  const flatListRef = useRef<FlatList<Item>>(null);

  useEffect(() => {
    if (flatListRef.current) {
      const nativeRef = flatListRef.current.getNativeScrollRef();

      console.log('nativeRef', nativeRef?.componentWillUnmount);
    }
  }, []);

  return (
    <FlatList
      ref={flatListRef}
      data={data}
      keyExtractor={(item) => item.id}
      renderItem={({ item }) => (
        <View style={{ padding: 16 }}>
          <Text>{item.title}</Text>
        </View>
      )}
    />
  );
};

export default FlatListScrollRefExample;

```

</details>

Reviewed By: cipolleschi

Differential Revision: D73569274

Pulled By: rshest

fbshipit-source-id: f72477b9b3c0eda1007187c7dac3da0433410e86
2025-04-24 03:02:27 -07:00
Samuel SuslaandFacebook GitHub Bot 4e679a22e7 group reparenting tests for view culling together (#50886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50886

changelog: [internal]

Group tests related to reparenting in "describe" block. Differentiator is two algorithms hidden behind a single interface: regular and reparenting. The tests are structured this way as well where regular tests focus on common scenarios and reparenting section focuses on reparenting and special cases around that. The reparenting implementation is considerably more complex as it handles edge cases that don't happen often.

Reviewed By: mdvacca

Differential Revision: D73541053

fbshipit-source-id: c3905a0f0117cb1aa6c468e24e6bb982de48545d
2025-04-23 20:21:49 -07:00
Samuel SuslaandFacebook GitHub Bot 6f345cb852 add a test for view culling where during reparenting a view is culled (#50885)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50885

changelog: [internal]

a special case inside of Differentiator handling parent-child switching from unflattened-flattened to flattened-unflattened. If a child has view that is culled, this needs to be handled.

This diff also simplifies the implementation inside of calculateShadowViewMutationsFlattener by passing only one cullingContext.

Reviewed By: mdvacca

Differential Revision: D73523523

fbshipit-source-id: d6f314da6b9ff40bcf3362243b03de1b39e7aabb
2025-04-23 20:21:49 -07:00
Samuel SuslaandFacebook GitHub Bot f51d6ec9ff fix bug in reparenting where wrong parentTag is used in differentiator (#50884)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50884

changelog: [internal]

Fix incorrect parentTag coming from differentiator when reparenting. The fix is hidden behind existing feature flag that is already fixing similar issue: D73428312

The problem occurs under very specific circumstances that are covered by an integration test. The *parentTag* is also [only used on Android](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp#L566) and only if layout changes as part of the update.

This diff introduces a new test specifically triggering the incorrect behaviour: `Differentiator-itest.js`. Without this fix, the test fails on following assert:           [react_native_assert(hasTag(mutation.parentTag))](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/renderer/mounting/stubs/StubViewTree.cpp#L245).

Reviewed By: mdvacca

Differential Revision: D73545165

fbshipit-source-id: 43344eebfa4cc0119e5b42170f6b9097dacd704d
2025-04-23 20:21:49 -07:00
Arushi KesarwaniandFacebook GitHub Bot d28d4c5ff8 Rename Codegen Component Descriptors Entrypoint for FAC and hook it up in DefaultComponentsRegistry (#50881)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50881

Rename Codegen Component Descriptors Entrypoint for FAC and hook it up in DefaultComponentsRegistry

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D73535745

fbshipit-source-id: dad68e7e6c8d7ba2ed86bbd1c06131101e00689e
2025-04-23 16:56:45 -07:00
Zeya PengandFacebook GitHub Bot 5ec00097b6 Add pan gesture animation examples to rntester (#50851)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50851

## Changelog:

[General] [Added] - Add pan gesture animation example to rntester

Including examples of
* using native driven Animated.event + touch event (which will not be interrupted by busy js thread, and is potentially a boost to performance) - the code requires some hacks but it's doable
* using js PanResponder to drive pan gesture animation

Reviewed By: sammy-SC

Differential Revision: D68909931

fbshipit-source-id: 484ecb0646fb249b31362013725219a1c1ec6181
2025-04-23 16:41:46 -07:00
Nick GerlemanandFacebook GitHub Bot 42251ec0ed Fix Non-uniform border colors on TextInput (#50880)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50880

Kotlin conversion exposes unused variable warning. Looks like I broke this a year ago.

Changelog:
[Android][Fixed] - Fix Non-uniform border colors on TextInput

Reviewed By: mdvacca

Differential Revision: D73453825

fbshipit-source-id: 8e3fcac8ea55feb518a8d11a6fbdba7ea548ea2b
2025-04-23 15:26:04 -07:00
Nick GerlemanandFacebook GitHub Bot cf9514e549 Fix ReactTextAnchorViewManager Nullability (#50879)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50879

The view for a view manager should not be nullable. Let's fix that.

These are also all bound specifically to `ReactTextView` instead of the generic constraint, so I just changed the constraint. Really this should just be totally merged with `ReactTextViewManager`.

Changelog: [Internal]

Reviewed By: cortinico, rshest

Differential Revision: D73453631

fbshipit-source-id: 74bcadeef0e83a719dfe2b989784501575b58168
2025-04-23 15:26:04 -07:00
Nick LefeverandFacebook GitHub Bot 1156c08ac4 Move shadow node reference updates to tree commit (#50753)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50753

Runtime Shadow Node Reference Updates (RSNRU) is currently implemented through the clone method which on each internal clone updates the runtime reference to point to the new clone. This guarantees that the runtime reference always points at the latest revision of the shadow node.

This came with the constraint that RSNRU could only run from one thread at all times, otherwise the React renderer state (current fiber tree) would end up being corrupted by receiving reference updates from multiple threads cloning shadow nodes.

This change moves the reference update step to the locked scope of the commit phase. Since the runtime is blocking on the commit and the scope is locked, it is safe and correct to update the runtime references with the latest revision of the shadow node after running state progression and layout.

By moving the reference update to the commit, we can support shadow node syncing from any thread since the actual runtime references are now executing at a safe time and the renderer state will stay valid at all times.

This change is gated behind the `updateRuntimeShadowNodeReferencesOnCommit` feature flag, which enabled shadow node syncing from any thread and reference updates only during the commit.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D73038439

fbshipit-source-id: d90308498f3c0625dc87158f15311d1088aad8b0
2025-04-23 14:55:23 -07:00
Nick LefeverandFacebook GitHub Bot 2080fd81f9 Split shadow node reference setter and update functionality (#50752)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50752

Storing the runtime reference for a shadow node and updating the runtime reference to point at a specific shadow node should be separated so that these actions can be done at different moments in time.

We want to keep a reference to the runtime reference of a shadow node for all revisions cloned internally (not triggered by the React renderer, e.g. on layout or shadow node state updates).

We also want to support updating that runtime reference to point at a specific shadow node revision, ideally the one that will end up being used to mount the host component.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D73038438

fbshipit-source-id: 68c3912cbb077d790dd8d2abe8291548b12c8231
2025-04-23 14:55:23 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot ee215800d7 Fix backgroundImage on new Background Drawable (#50877)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50877

At some point I made some changes to how alpha works on BackgroundDrawable. This inadvertently broke BackgroundImage because we need a non transparent color to apply shaders.

Setting the alpha to 255 temporarily when drawing background-image layers fixes it

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D73520952

fbshipit-source-id: b8017bb06adc0d3d328d9831fbc4c74f2ec0b783
2025-04-23 14:13:05 -07:00
David VaccaandFacebook GitHub Bot 4d44273672 Temporarily revert removal of ShadowNodes (#50876)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50876

This diff is temporarily reverting the code shipped in D72671083 to wait for more data before fully release this change

changelog: [internal] internal

Reviewed By: rshest, arushikesarwani94

Differential Revision: D73515903

fbshipit-source-id: 6566e9533ebffc93348e24eb6c0512020b220eae
2025-04-23 13:54:09 -07:00
Peter AbbondanzoandFacebook GitHub Bot 93f12eb71d Add prop to filter drag and drop pasting on iOS (#50533)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50533

Builds upon https://github.com/facebook/react-native/pull/49446

On iOS, by default, every EditText accepts DragEvent and will automatically focus themselves to accept these data. In some rare cases, it might not be desirable to allow data from arbitrary drag and drop events to be pasted into a text input.

This change adds a new prop `acceptDragAndDropTypes` to do exactly that: reject drag and drop events by telling the system to ignore certain types of drag data and, by proxy, disabling behavior that automatically focuses the text input.

The prop accepts a list of [Uniform Type Identifiers](https://developer.apple.com/documentation/uniformtypeidentifiers) that iOS supports. It's important to note that these are *not* MIME types. A MIME type would be something like `text/plain` but the equivalent for iOS is `public.plain-text`.

It's important to note that this is an experimental prop, as is evident by the `experimental_` prefix on the JS side. Its signature could change before the prop has fully matured, use at your own risk

Changelog: [iOS][Added] - Add new prop for filtering drag and drop targeting to text inputs

Reviewed By: javache

Differential Revision: D70992749

fbshipit-source-id: 22b5aa1b4ced14147bf16a844361acf6f99c5a40
2025-04-23 13:13:17 -07:00
Peter AbbondanzoandFacebook GitHub Bot d10dd7130c Add prop to filter drag and drop pasting on Android (#49446)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49446

On Android, by default, every EditText accepts `DragEvent` and will automatically focus themselves to accept these data. In some rare cases, it might not be desirable to allow data from arbitrary drag and drop events to be pasted into a text input.

This change adds a new prop `acceptDragAndDropTypes`  to do exactly that: reject drag and drop events by telling the system to ignore certain types of drag data and, by proxy, disabling behavior that automatically focuses the text input.

The prop accepts a subset of MIME types supported by Android as documented [here](https://developer.android.com/reference/android/content/ClipDescription#MIMETYPE_TEXT_HTML).

It's important to note that this is an experimental prop, as is evident by the `experimental_` prefix on the JS side. Its signature could change before the prop has fully matured, use at your own risk

Changelog: [Android][Added] - Add new prop for filtering drag and drop targeting to text inputs

Reviewed By: javache

Differential Revision: D69674225

fbshipit-source-id: 4dbbdd81bb0f394b6206da5a377c75ea71671626
2025-04-23 13:13:17 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 3b17cdb643 Add back the folly_compiler_flags for backward compatibility (#50875)
Summary:
Some libraries still use the `folly_flags` method provided by our infra. When updating how folly should be installed in an app, we removed that function.
We are putting it back as deprecated, to avoid unnecessary breaking changes in libraries

## Changelog:
[iOS][Fixed] - Put back the `folly_compiler_flag` function to make libraries install pods

Pull Request resolved: https://github.com/facebook/react-native/pull/50875

Test Plan: Tested locally in a nightly app, using the react-native-exit-app library which still uses these flags

Reviewed By: cortinico

Differential Revision: D73512830

Pulled By: cipolleschi

fbshipit-source-id: 28f099064e93ecd5a5a6a7b82e3f7e9db4d35cb9
2025-04-23 12:15:49 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 3f41fe2948 Make fmt and SocketRocket compatible with Swift (#50874)
Summary:
`SocketRocket` and `fmt` are part of React Native dependencies.
If a library is written in swift and depends on them, it will fail to install the pods because these pods are not compatible with Swift.

This change makes sure that the pods are installed in a way that is swift compatible.

## Changelog:
[iOS][Fixed] - Make fmt and SocketRocket Swift friendly

Pull Request resolved: https://github.com/facebook/react-native/pull/50874

Test Plan:
Tested locally in a nightly app.

### Before the change:

```
yarn add react-native-video
cd ios
bundle exec pod install
```

This script resulted in this error:

```
[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `react-native-video` depends upon `fmt` and `SocketRocket`, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
```

### After the change

```
yarn add react-native-video
cd ios
bundle exec pod install
```

This script installed pods successfully.

Reviewed By: cortinico

Differential Revision: D73512109

Pulled By: cipolleschi

fbshipit-source-id: 222d85dba1cbdf4044e3c8459008a4083a720016
2025-04-23 12:07:20 -07:00
Pieter De BaetsandFacebook GitHub Bot b9b61f002c Tweak SoftError tags (#50862)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50862

Changelog: [Internal]

Reviewed By: arushikesarwani94

Differential Revision: D73501837

fbshipit-source-id: 7889dd994900cec54845263286e24da24a3c9542
2025-04-23 10:31:50 -07:00
Iwo PlazaandFacebook GitHub Bot dc494bb341 Revert [RN][JS Stable API] Limit @react-native/virtualized-lists subpath imports (#50846)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50846

## Motivation
After a more rigorous search through GitHub uses of the restricted APIs, and consultation with framework authors, it became apparent that this restriction should be lifted.

Changelog: [Internal]

Reviewed By: zeyap

Differential Revision: D73267844

fbshipit-source-id: e6c0c146690c07debf74c51f82171a9239be5c15
2025-04-23 10:20:06 -07:00
bornkissandFacebook GitHub Bot 96b6604037 chore: update license-docs link (#50868)
Summary:
The source for the React Native documentation and website is hosted on a separate repository, [**facebook/react-native-website**][repo-website]. [LICENSE-docs](https://github.com/facebook/react-native/blob/main/LICENSE-docs) had been removed, so it should be replaced by [**this link**](https://github.com/facebook/react-native-website/blob/main/LICENSE-docs). Of course we could delete it directly.

## Changelog:
[Internal] [Fixed] - Update link

Pull Request resolved: https://github.com/facebook/react-native/pull/50868

Test Plan: nothing

Reviewed By: cipolleschi

Differential Revision: D73512121

Pulled By: cortinico

fbshipit-source-id: dba43626eb2a65a73ca2f46a830488e1437c3a1f
2025-04-23 09:33:43 -07:00
Riccardo CipolleschiandFacebook GitHub Bot ec43150b2a Disable react-native-maps for nightlies (#50873)
Summary:
the `react-native-maps` library has a complex setup for iOS. It doesn't work with autolinking, therefore we need to disable the test with the nightlies

## Changelog:
[Internal] - Disable nitghtly test for react-native-maps

Pull Request resolved: https://github.com/facebook/react-native/pull/50873

Test Plan: GHA

Reviewed By: cortinico

Differential Revision: D73510995

Pulled By: cipolleschi

fbshipit-source-id: a8abadfc8f0656de1288aa28e65abeab07bb9074
2025-04-23 08:14:36 -07:00
5188 changed files with 224051 additions and 126236 deletions
-9
View File
@@ -9,12 +9,3 @@ end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
[*.gradle]
indent_size = 4
[*.kts]
indent_size = 4
[BUCK]
indent_size = 4
-1
View File
@@ -13,7 +13,6 @@ packages/*/dist
packages/*/types_generated
packages/debugger-frontend/dist/**/*
packages/react-native-codegen/lib
tools/eslint/rules/sort-imports.js
**/Pods/*
**/*.macos.js
**/*.windows.js
+36 -28
View File
@@ -4,21 +4,18 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @noflow
* @format
*/
'use strict';
const path = require('node:path');
require('eslint-plugin-lint').load(path.join(__dirname, 'tools/eslint/rules'));
module.exports = {
root: true,
extends: ['@react-native'],
plugins: ['@react-native/eslint-plugin-specs', 'lint'],
plugins: ['@react-native/monorepo', '@react-native/specs'],
overrides: [
// overriding the JS config from @react-native/eslint-config to ensure
@@ -27,28 +24,37 @@ module.exports = {
files: ['*.js', '*.js.flow', '*.jsx'],
parser: 'hermes-eslint',
rules: {
'@react-native/monorepo/sort-imports': 'warn',
'eslint-comments/no-unlimited-disable': 'off',
'ft-flow/require-valid-file-annotation': ['error', 'always'],
'no-extra-boolean-cast': 'off',
'no-void': 'off',
// These rules are not required with hermes-eslint
'ft-flow/define-flow-type': 0,
'ft-flow/use-flow-type': 0,
'lint/sort-imports': 1,
// flow handles this check for us, so it's not required
'no-undef': 0,
'ft-flow/define-flow-type': 'off',
'ft-flow/use-flow-type': 'off',
// Flow handles these checks for us, so they aren't required
'no-undef': 'off',
'no-unreachable': 'off',
// Throwing from function or rejecting promises with non-error values could result in unclear error stack traces and lead to harder debugging
'prefer-promise-reject-errors': 'error',
'no-throw-literal': 'error',
},
},
{
files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
rules: {
'@react-native/no-deep-imports': 0,
'@react-native/no-deep-imports': 'off',
},
},
{
files: [
'./packages/react-native/**/*.{js,flow}',
'./packages/react-native/Libraries/**/*.{js,flow}',
'./packages/react-native/src/**/*.{js,flow}',
'./packages/assets/registry.js',
],
parser: 'hermes-eslint',
rules: {
'lint/no-commonjs-exports': 1,
'@react-native/monorepo/no-commonjs-exports': 'warn',
},
},
{
@@ -58,15 +64,17 @@ module.exports = {
{
files: ['package.json'],
rules: {
'lint/react-native-manifest': 2,
'@react-native/monorepo/react-native-manifest': 'error',
},
},
{
files: ['flow-typed/**/*.js'],
files: ['flow-typed/**/*.js', 'packages/react-native/flow/**/*'],
rules: {
'lint/valid-flow-typed-signature': 2,
'no-unused-vars': 0,
quotes: 0,
'@react-native/monorepo/valid-flow-typed-signature': 'error',
'ft-flow/require-valid-file-annotation': 'off',
'no-shadow': 'off',
'no-unused-vars': 'off',
quotes: 'off',
},
},
{
@@ -75,14 +83,14 @@ module.exports = {
'packages/react-native/src/**/*.js',
],
rules: {
'@react-native/platform-colors': 2,
'@react-native/specs/react-native-modules': 2,
'lint/no-haste-imports': 2,
'lint/no-react-native-imports': 2,
'lint/require-extends-error': 2,
'lint/no-react-node-imports': 2,
'lint/no-react-default-imports': 2,
'lint/no-react-named-type-imports': 2,
'@react-native/monorepo/no-haste-imports': 'error',
'@react-native/monorepo/no-react-default-imports': 'error',
'@react-native/monorepo/no-react-named-type-imports': 'error',
'@react-native/monorepo/no-react-native-imports': 'error',
'@react-native/monorepo/no-react-node-imports': 'error',
'@react-native/monorepo/require-extends-error': 'error',
'@react-native/platform-colors': 'error',
'@react-native/specs/react-native-modules': 'error',
},
},
{
@@ -134,9 +142,9 @@ module.exports = {
},
},
{
files: ['**/*-itest{.fb,}.js'],
files: ['**/__tests__/**'],
rules: {
'lint/no-react-native-imports': 'off',
'@react-native/monorepo/no-react-native-imports': 'off',
},
},
],
+11 -11
View File
@@ -2,11 +2,14 @@
; Ignore build cache folder
<PROJECT_ROOT>/packages/react-native/sdks/.*
; Ignore fb_internal modules
<PROJECT_ROOT>/packages/react-native/src/fb_internal/.*
; Ignore the codegen e2e tests
<PROJECT_ROOT>/packages/react-native-codegen/e2e/__test_fixtures__/modules/NativeEnumTurboModule.js
; Ignore the Dangerfile
<PROJECT_ROOT>/packages/react-native-bots/dangerfile.js
<PROJECT_ROOT>/private/react-native-bots/dangerfile.js
; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/
@@ -24,7 +27,7 @@
<PROJECT_ROOT>/packages/.*/dist
; helloworld
<PROJECT_ROOT>/packages/helloworld/ios/Pods/
<PROJECT_ROOT>/private/helloworld/ios/Pods/
; Ignore rn-tester Pods
<PROJECT_ROOT>/packages/rn-tester/Pods/
@@ -41,11 +44,12 @@
flow-typed/
packages/react-native/interface.js
packages/react-native/flow/
packages/react-native/src/types/
[options]
enums=true
experimental.pattern_matching=true
casting_syntax=both
component_syntax=true
emoji=true
@@ -65,16 +69,12 @@ munge_underscores=true
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/packages/react-native/index.js'
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/packages/react-native/\1'
module.name_mapper='^@react-native/dev-middleware$' -> '<PROJECT_ROOT>/packages/dev-middleware'
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\|xml\)$' -> '<PROJECT_ROOT>/packages/react-native/Libraries/Image/RelativeImageStub'
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\|xml\|ktx\)$' -> '<PROJECT_ROOT>/packages/react-native/Libraries/Image/RelativeImageStub'
module.system.haste.module_ref_prefix=m#
react.runtime=automatic
suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FlowFixMeEmpty
ban_spread_key_props=true
[lints]
@@ -98,4 +98,4 @@ untyped-import
untyped-type-import
[version]
^0.268.0
^0.289.0
+1 -1
View File
@@ -83,7 +83,7 @@ body:
path: /bin/zsh
Binaries:
Node: ...
version: 18.14.0
version: 22.14.0
...
render: text
validations:
@@ -1,6 +1,6 @@
name: 🔍 Debugger - Bug Report
description: Report a bug with React Native DevTools and the New Debugger
labels: ["Needs: Triage :mag:", "Debugger"]
labels: ["Needs: Triage :mag:", "Debugging"]
body:
- type: markdown
@@ -62,7 +62,7 @@ body:
path: /bin/zsh
Binaries:
Node: ...
version: 18.14.0
version: 22.14.0
...
render: text
validations:
@@ -95,7 +95,7 @@ body:
path: /bin/zsh
Binaries:
Node: ...
version: 18.14.0
version: 22.14.0
...
render: text
validations:
+13 -30
View File
@@ -4,9 +4,6 @@ inputs:
release-type:
required: true
description: The type of release we are building. It could be nightly, release or dry-run
run-e2e-tests:
default: 'false'
description: If we need to build to run E2E tests. If yes, we need to build also x86.
gradle-cache-encryption-key:
description: "The encryption key needed to store the Gradle Configuration cache"
runs:
@@ -20,6 +17,9 @@ runs:
- name: Install node dependencies
uses: ./.github/actions/yarn-install
- name: Set React Native Version
# We don't want to set the version for stable branches, because this has been
# already set from the 'create release' commits on the release branch.
if: ${{ !endsWith(github.ref_name, '-stable') }}
shell: bash
run: node ./scripts/releases/set-rn-artifacts-version.js --build-type ${{ inputs.release-type }}
- name: Setup gradle
@@ -31,10 +31,11 @@ runs:
uses: actions/cache/restore@v4
with:
path: /github/home/.cache/ccache
key: v1-ccache-android-${{ github.job }}-${{ github.ref }}
key: v2-ccache-android-${{ github.job }}-${{ github.ref }}-${{ hashFiles('packages/react-native/ReactAndroid/**/*.cpp', 'packages/react-native/ReactAndroid/**/*.h', 'packages/react-native/ReactCommon/**/*.cpp', 'packages/react-native/ReactAndroid/**/CMakeLists.txt', 'packages/react-native/ReactCommon/**/CMakeLists.txt') }}
restore-keys: |
v1-ccache-android-${{ github.job }}-
v1-ccache-android-
v2-ccache-android-${{ github.job }}-${{ github.ref }}-
v2-ccache-android-${{ github.job }}-
v2-ccache-android-
- name: Show ccache stats
shell: bash
run: ccache -s -v
@@ -43,11 +44,7 @@ runs:
run: |
if [[ "${{ inputs.release-type }}" == "dry-run" ]]; then
# dry-run: we only build ARM64 to save time/resources. For release/nightlies the default is to build all archs.
if [[ "${{ inputs.run-e2e-tests }}" == 'true' ]]; then
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a,x86" # x86 is required for E2E testing
else
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a"
fi
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a,x86" # x86 is required for E2E testing
TASKS="publishAllToMavenTempLocal build"
elif [[ "${{ inputs.release-type }}" == "nightly" ]]; then
# nightly: we set isSnapshot to true so artifacts are sent to the right repository on Maven Central.
@@ -63,7 +60,7 @@ runs:
uses: actions/cache/save@v4
with:
path: /github/home/.cache/ccache
key: v1-ccache-android-${{ github.job }}-${{ github.ref }}
key: v2-ccache-android-${{ github.job }}-${{ github.ref }}-${{ hashFiles('packages/react-native/ReactAndroid/**/*.cpp', 'packages/react-native/ReactAndroid/**/*.h', 'packages/react-native/ReactCommon/**/*.cpp', 'packages/react-native/ReactAndroid/**/CMakeLists.txt', 'packages/react-native/ReactCommon/**/CMakeLists.txt') }}
- name: Show ccache stats
shell: bash
run: ccache -s -v
@@ -86,27 +83,13 @@ runs:
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.4
with:
name: rntester-hermes-debug
path: packages/rn-tester/android/app/build/outputs/apk/hermes/debug/
name: rntester-debug
path: packages/rn-tester/android/app/build/outputs/apk/debug/
compression-level: 0
- name: Upload RNTester APK - hermes-release
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.4
with:
name: rntester-hermes-release
path: packages/rn-tester/android/app/build/outputs/apk/hermes/release/
compression-level: 0
- name: Upload RNTester APK - jsc-debug
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.4
with:
name: rntester-jsc-debug
path: packages/rn-tester/android/app/build/outputs/apk/jsc/debug/
compression-level: 0
- name: Upload RNTester APK - jsc-release
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.4
with:
name: rntester-jsc-release
path: packages/rn-tester/android/app/build/outputs/apk/jsc/release/
name: rntester-release
path: packages/rn-tester/android/app/build/outputs/apk/release/
compression-level: 0
@@ -1,103 +0,0 @@
name: build-apple-slices-hermes
description: This action builds hermesc for Apple platforms
inputs:
hermes-version:
required: true
description: The version of Hermes
react-native-version:
required: true
description: The version of Hermes
slice:
required: true
description: The slice of hermes you want to build. It could be iphone, iphonesimulator, macos, catalyst, appletvos, appletvsimulator, xros, or xrossimulator
flavor:
required: true
description: The flavor we want to build. It can be Debug or Release
runs:
using: composite
steps:
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Restore HermesC Artifact
uses: actions/download-artifact@v4
with:
name: hermesc-apple
path: ./packages/react-native/sdks/hermes/build_host_hermesc
- name: Restore Slice From Cache
id: restore-slice-cache
uses: actions/cache/restore@v4
with:
path: ./packages/react-native/sdks/hermes/build_${{ inputs.slice }}_${{ inputs.flavor }}
key: v6-hermes-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ inputs.slice }}-${{ inputs.flavor }}
- name: Build the Hermes ${{ inputs.slice }} frameworks
shell: bash
run: |
cd ./packages/react-native/sdks/hermes || exit 1
SLICE=${{ inputs.slice }}
FLAVOR=${{ inputs.flavor }}
FINAL_PATH=build_"$SLICE"_"$FLAVOR"
echo "Final path for this slice is: $FINAL_PATH"
if [[ -d "$FINAL_PATH" ]]; then
echo "[HERMES] Skipping! Found the requested slice at $FINAL_PATH".
exit 0
fi
if [[ "$ARTIFACTS_EXIST" ]]; then
echo "[HERMES] Skipping! Artifacts exists already."
exit 0
fi
export RELEASE_VERSION=${{ inputs.react-native-version }}
# HermesC is used to build hermes, so it has to be executable
chmod +x ./build_host_hermesc/bin/hermesc
if [[ "$SLICE" == "macosx" ]]; then
echo "[HERMES] Building Hermes for MacOS"
chmod +x ./utils/build-mac-framework.sh
BUILD_TYPE="${{ inputs.flavor }}" ./utils/build-mac-framework.sh
else
echo "[HERMES] Building Hermes for iOS: $SLICE"
chmod +x ./utils/build-ios-framework.sh
BUILD_TYPE="${{ inputs.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
fi
echo "Moving from build_$SLICE to $FINAL_PATH"
mv build_"$SLICE" "$FINAL_PATH"
# check whether everything is there
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework" ]]; then
echo "Successfully built hermes.framework for $SLICE in $FLAVOR"
else
echo "Failed to built hermes.framework for $SLICE in $FLAVOR"
exit 1
fi
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework.dSYM" ]]; then
echo "Successfully built hermes.framework.dSYM for $SLICE in $FLAVOR"
else
echo "Failed to built hermes.framework.dSYM for $SLICE in $FLAVOR"
echo "Please try again"
exit 1
fi
- name: Compress slices to preserve Symlinks
shell: bash
run: |
cd ./packages/react-native/sdks/hermes
tar -czv -f build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz build_${{ matrix.slice }}_${{ matrix.flavor }}
- name: Upload Artifact for Slice (${{ inputs.slice }}, ${{ inputs.flavor }}}
uses: actions/upload-artifact@v4.3.4
with:
name: slice-${{ inputs.slice }}-${{ inputs.flavor }}
path: ./packages/react-native/sdks/hermes/build_${{ inputs.slice }}_${{ inputs.flavor }}.tar.gz
- name: Save slice cache
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
uses: actions/cache/save@v4
with:
path: ./packages/react-native/sdks/hermes/build_${{ inputs.slice }}_${{ inputs.flavor }}
key: v6-hermes-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ inputs.SLICE }}-${{ inputs.FLAVOR }}
@@ -1,227 +0,0 @@
name: build-hermes-macos
description: This action builds hermesc for Apple platforms
inputs:
hermes-version:
required: true
description: The version of Hermes
react-native-version:
required: true
description: The version of React Native
flavor:
required: true
description: The flavor we want to build. It can be Debug or Release
runs:
using: composite
steps:
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Restore Cached Artifacts
uses: actions/cache/restore@v4
with:
key: v4-hermes-artifacts-${{ inputs.flavor }}-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashFiles('./packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
path: |
/tmp/hermes/osx-bin/${{ inputs.flavor }}
/tmp/hermes/dSYM/${{ inputs.flavor }}
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ inputs.flavor }}.tar.gz
- name: Check if the required artifacts already exist
id: check_if_apple_artifacts_are_there
shell: bash
run: |
FLAVOR="${{ inputs.flavor }}"
echo "Flavor is $FLAVOR"
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
DSYM="/tmp/hermes/dSYM/$FLAVOR"
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
if [[ -d "$OSX_BIN" ]] && \
[[ -d "$DSYM" ]] && \
[[ -f "$HERMES" ]]; then
echo "Artifacts are there!"
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
fi
- name: Yarn- Install Dependencies
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: ./.github/actions/yarn-install
- name: Slice cache macosx
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-macosx-${{ inputs.flavor }}
- name: Slice cache iphoneos
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-iphoneos-${{ inputs.flavor }}
- name: Slice cache iphonesimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-iphonesimulator-${{ inputs.flavor }}
- name: Slice cache appletvos
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-appletvos-${{ inputs.flavor }}
- name: Slice cache appletvsimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-appletvsimulator-${{ inputs.flavor }}
- name: Slice cache catalyst
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-catalyst-${{ inputs.flavor }}
- name: Slice cache xros
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-xros-${{ inputs.flavor }}
- name: Slice cache xrsimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-xrsimulator-${{ inputs.flavor }}
- name: Unzip slices
shell: bash
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
run: |
cd ./packages/react-native/sdks/hermes
ls -l .
tar -xzv -f build_catalyst_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_iphoneos_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_iphonesimulator_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_appletvos_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_appletvsimulator_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_macosx_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_xros_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_xrsimulator_${{ matrix.flavor }}.tar.gz
- name: Move back build folders
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
shell: bash
run: |
ls -l ./packages/react-native/sdks/hermes
cd ./packages/react-native/sdks/hermes || exit 1
mv build_macosx_${{ inputs.flavor }} build_macosx
mv build_iphoneos_${{ inputs.flavor }} build_iphoneos
mv build_iphonesimulator_${{ inputs.flavor }} build_iphonesimulator
mv build_appletvos_${{ inputs.flavor }} build_appletvos
mv build_appletvsimulator_${{ inputs.flavor }} build_appletvsimulator
mv build_catalyst_${{ inputs.flavor }} build_catalyst
mv build_xros_${{ inputs.flavor }} build_xros
mv build_xrsimulator_${{ inputs.flavor }} build_xrsimulator
- name: Prepare destroot folder
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
shell: bash
run: |
cd ./packages/react-native/sdks/hermes || exit 1
chmod +x ./utils/build-apple-framework.sh
. ./utils/build-apple-framework.sh
prepare_dest_root_for_ci
- name: Create fat framework for iOS
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
shell: bash
run: |
cd ./packages/react-native/sdks/hermes || exit 1
echo "[HERMES] Creating the universal framework"
chmod +x ./utils/build-ios-framework.sh
./utils/build-ios-framework.sh build_framework
chmod +x ./destroot/bin/hermesc
- name: Package the Hermes Apple frameworks
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
shell: bash
run: |
BUILD_TYPE="${{ inputs.flavor }}"
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
TARBALL_OUTPUT_DIR=$(mktemp -d /tmp/hermes-tarball-output-XXXXXXXX)
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
TARBALL_OUTPUT_PATH=$(node ./packages/react-native/scripts/hermes/create-tarball.js \
--inputDir ./packages/react-native/sdks/hermes \
--buildType "$BUILD_TYPE" \
--outputDir $TARBALL_OUTPUT_DIR)
echo "Hermes tarball saved to $TARBALL_OUTPUT_PATH"
mkdir -p $HERMES_TARBALL_ARTIFACTS_DIR
cp $TARBALL_OUTPUT_PATH $HERMES_TARBALL_ARTIFACTS_DIR/.
mkdir -p /tmp/hermes/osx-bin/${{ inputs.flavor }}
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ inputs.flavor }}
ls -lR /tmp/hermes/osx-bin/
- name: Create dSYM archive
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
shell: bash
run: |
FLAVOR=${{ inputs.flavor }}
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
mkdir -p "$WORKING_DIR/macosx"
mkdir -p "$WORKING_DIR/catalyst"
mkdir -p "$WORKING_DIR/iphoneos"
mkdir -p "$WORKING_DIR/iphonesimulator"
mkdir -p "$WORKING_DIR/appletvos"
mkdir -p "$WORKING_DIR/appletvsimulator"
mkdir -p "$WORKING_DIR/xros"
mkdir -p "$WORKING_DIR/xrsimulator"
cd ./packages/react-native/sdks/hermes || exit 1
DSYM_FILE_PATH=API/hermes/hermes.framework.dSYM
cp -r build_macosx/$DSYM_FILE_PATH "$WORKING_DIR/macosx/"
cp -r build_catalyst/$DSYM_FILE_PATH "$WORKING_DIR/catalyst/"
cp -r build_iphoneos/$DSYM_FILE_PATH "$WORKING_DIR/iphoneos/"
cp -r build_iphonesimulator/$DSYM_FILE_PATH "$WORKING_DIR/iphonesimulator/"
cp -r build_appletvos/$DSYM_FILE_PATH "$WORKING_DIR/appletvos/"
cp -r build_appletvsimulator/$DSYM_FILE_PATH "$WORKING_DIR/appletvsimulator/"
cp -r build_xros/$DSYM_FILE_PATH "$WORKING_DIR/xros/"
cp -r build_xrsimulator/$DSYM_FILE_PATH "$WORKING_DIR/xrsimulator/"
DEST_DIR="/tmp/hermes/dSYM/$FLAVOR"
tar -C "$WORKING_DIR" -czvf "hermes.framework.dSYM" .
mkdir -p "$DEST_DIR"
mv "hermes.framework.dSYM" "$DEST_DIR"
- name: Upload hermes dSYM artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: hermes-dSYM-${{ inputs.flavor }}
path: /tmp/hermes/dSYM/${{ inputs.flavor }}
- name: Upload hermes Runtime artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: hermes-darwin-bin-${{ inputs.flavor }}
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ inputs.flavor }}.tar.gz
- name: Upload hermes osx artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: hermes-osx-bin-${{ inputs.flavor }}
path: /tmp/hermes/osx-bin/${{ inputs.flavor }}
- name: Upload Hermes Artifacts
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
with:
key: v4-hermes-artifacts-${{ inputs.flavor }}-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashFiles('./packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
path: |
/tmp/hermes/osx-bin/${{ inputs.flavor }}
/tmp/hermes/dSYM/${{ inputs.flavor }}
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ inputs.flavor }}.tar.gz
@@ -1,37 +0,0 @@
name: build-hermesc-apple
description: This action builds hermesc for Apple platforms
inputs:
hermes-version:
required: true
description: The version of Hermes
react-native-version:
required: true
description: The version of React Native
runs:
using: composite
steps:
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Hermes apple cache
uses: actions/cache/restore@v4
with:
path: ./packages/react-native/sdks/hermes/build_host_hermesc
key: v2-hermesc-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
- name: Build HermesC Apple
shell: bash
run: |
cd ./packages/react-native/sdks/hermes || exit 1
. ./utils/build-apple-framework.sh
build_host_hermesc_if_needed
- name: Upload HermesC Artifact
uses: actions/upload-artifact@v4.3.4
with:
name: hermesc-apple
path: ./packages/react-native/sdks/hermes/build_host_hermesc
- name: Cache hermesc apple
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
with:
path: ./packages/react-native/sdks/hermes/build_host_hermesc
key: v2-hermesc-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
enableCrossOsArchive: true
@@ -1,53 +0,0 @@
name: build-hermesc-linux
description: This action builds hermesc for linux platforms
inputs:
hermes-version:
required: True
description: The version of Hermes
react-native-version:
required: True
description: The version of React Native
runs:
using: composite
steps:
- name: Install dependencies
shell: bash
run: |
sudo apt update
sudo apt install -y git openssh-client build-essential \
libreadline-dev libicu-dev jq zip python3
# Install cmake 3.28.3-1build7
sudo apt-get install cmake=3.28.3-1build7
sudo ln -sf /usr/bin/cmake /usr/local/bin/cmake
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Linux cache
uses: actions/cache@v4
with:
key: v1-hermes-${{ github.job }}-linux-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
path: |
/tmp/hermes/linux64-bin/
/tmp/hermes/hermes/destroot/
- name: Set up workspace
shell: bash
run: |
mkdir -p /tmp/hermes/linux64-bin
- name: Build HermesC for Linux
shell: bash
run: |
if [ -f /tmp/hermes/linux64-bin/hermesc ]; then
echo 'Skipping; Clean "/tmp/hermes/linux64-bin" to rebuild.'
else
cd /tmp/hermes
cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release -DHERMES_ENABLE_TEST_SUITE=OFF \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
cmake --build build --target hermesc -j 4
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
fi
- name: Upload linux artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
@@ -1,86 +0,0 @@
name: build-hermesc-windows
description: This action builds hermesc for Windows platforms
inputs:
hermes-version:
required: True
description: The version of Hermes
react-native-version:
required: True
description: The version of React Native
runs:
using: composite
steps:
- name: Download Previous Artifacts
uses: actions/download-artifact@v4
with:
name: hermes-workspace
path: 'D:\tmp\hermes'
- name: Set up workspace
shell: powershell
run: |
mkdir -p D:\tmp\hermes\osx-bin
mkdir -p .\packages\react-native\sdks\hermes
cp -r -Force D:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
- name: Windows cache
uses: actions/cache@v4
with:
key: v2-hermes-${{ github.job }}-windows-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
path: |
D:\tmp\hermes\win64-bin\
D:\tmp\hermes\hermes\icu\
D:\tmp\hermes\hermes\deps\
D:\tmp\hermes\hermes\build_release\
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1.3.2
- name: Set up workspace
shell: powershell
run: |
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\icu
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\deps
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\win64-bin
- name: Downgrade CMake
shell: powershell
run: choco install cmake --version 3.31.6 --force
- name: Build HermesC for Windows
shell: powershell
run: |
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
cd $Env:HERMES_WS_DIR\icu
# If Invoke-WebRequest shows a progress bar, it will fail with
# Win32 internal error "Access is denied" 0x5 occurred [...]
$progressPreference = 'silentlyContinue'
Invoke-WebRequest -Uri "$Env:ICU_URL" -OutFile "icu.zip"
Expand-Archive -Path "icu.zip" -DestinationPath "."
cd $Env:HERMES_WS_DIR
Copy-Item -Path "icu\bin64\icu*.dll" -Destination "deps"
# Include MSVC++ 2015 redistributables
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps"
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
cmake -S hermes -B build_release -G 'Visual Studio 16 2019' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
if (-not $?) { throw "Failed to configure Hermes" }
echo "Running windows build..."
cd build_release
cmake --build . --target hermesc --config Release
if (-not $?) { throw "Failed to build Hermes" }
echo "Copying hermesc.exe to win64-bin"
cd $Env:HERMES_WS_DIR
Copy-Item -Path "build_release\bin\Release\hermesc.exe" -Destination "win64-bin"
# Include Windows runtime dependencies
Copy-Item -Path "deps\*" -Destination "win64-bin"
}
else {
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
}
- name: Upload windows artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: hermes-win64-bin
path: D:\tmp\hermes\win64-bin\
+9 -87
View File
@@ -4,9 +4,6 @@ inputs:
release-type:
required: true
description: The type of release we are building. It could be nightly, release or dry-run
hermes-ws-dir:
required: 'true'
description: The workspace for hermes
gha-npm-token:
required: false
description: The GHA npm token, required only to publish to npm
@@ -20,102 +17,27 @@ runs:
- name: Setup git safe folders
shell: bash
run: git config --global --add safe.directory '*'
- name: Create /tmp/hermes/osx-bin directory
shell: bash
run: mkdir -p /tmp/hermes/osx-bin
- name: Download osx-bin release artifacts
uses: actions/download-artifact@v4
with:
name: hermes-osx-bin-Release
path: /tmp/hermes/osx-bin/Release
- name: Download osx-bin debug artifacts
uses: actions/download-artifact@v4
with:
name: hermes-osx-bin-Debug
path: /tmp/hermes/osx-bin/Debug
- name: Download darwin-bin release artifacts
uses: actions/download-artifact@v4
with:
name: hermes-darwin-bin-Release
path: /tmp/hermes/hermes-runtime-darwin
- name: Download darwin-bin debug artifacts
uses: actions/download-artifact@v4
with:
name: hermes-darwin-bin-Debug
path: /tmp/hermes/hermes-runtime-darwin
- name: Download hermes dSYM debug artifacts
uses: actions/download-artifact@v4
with:
name: hermes-dSYM-Debug
path: /tmp/hermes/dSYM/Debug
- name: Download hermes dSYM release vartifacts
uses: actions/download-artifact@v4
with:
name: hermes-dSYM-Release
path: /tmp/hermes/dSYM/Release
- name: Download windows-bin artifacts
uses: actions/download-artifact@v4
with:
name: hermes-win64-bin
path: /tmp/hermes/win64-bin
- name: Download linux-bin artifacts
uses: actions/download-artifact@v4
with:
name: hermes-linux-bin
path: /tmp/hermes/linux64-bin
- name: Show /tmp/hermes directory
shell: bash
run: ls -lR /tmp/hermes
- name: Copy Hermes binaries
shell: bash
run: |
mkdir -p ./packages/react-native/sdks/hermesc ./packages/react-native/sdks/hermesc/osx-bin ./packages/react-native/sdks/hermesc/win64-bin ./packages/react-native/sdks/hermesc/linux64-bin
# When build_hermes_macos runs as a matrix, it outputs
if [[ -d ${{ inputs.hermes-ws-dir }}/osx-bin/Release ]]; then
cp -r ${{ inputs.hermes-ws-dir }}/osx-bin/Release/* ./packages/react-native/sdks/hermesc/osx-bin/.
elif [[ -d ${{ inputs.hermes-ws-dir }}/osx-bin/Debug ]]; then
cp -r ${{ inputs.hermes-ws-dir }}/osx-bin/Debug/* ./packages/react-native/sdks/hermesc/osx-bin/.
else
ls ${{ inputs.hermes-ws-dir }}/osx-bin || echo "hermesc macOS artifacts directory missing."
echo "Could not locate macOS hermesc binary."; exit 1;
fi
# Sometimes, GHA creates artifacts with lowercase Debug/Release. Make sure that if it happen, we uppercase them.
if [[ -f "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-debug.tar.gz" ]]; then
mv "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-debug.tar.gz" "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Debug.tar.gz"
fi
if [[ -f "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-release.tar.gz" ]]; then
mv "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-release.tar.gz" "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Release.tar.gz"
fi
cp -r ${{ inputs.hermes-ws-dir }}/win64-bin/* ./packages/react-native/sdks/hermesc/win64-bin/.
cp -r ${{ inputs.hermes-ws-dir }}/linux64-bin/* ./packages/react-native/sdks/hermesc/linux64-bin/.
# Make sure the hermesc files are actually executable.
chmod -R +x packages/react-native/sdks/hermesc/*
mkdir -p ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
cp ${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Debug.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz
cp ${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Release.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
cp ${{ inputs.hermes-ws-dir }}/dSYM/Debug/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-debug.tar.gz
cp ${{ inputs.hermes-ws-dir }}/dSYM/Release/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-release.tar.gz
- name: Download ReactNativeDependencies
uses: actions/download-artifact@v4
with:
pattern: ReactNativeDependencies*
path: ./packages/react-native/ReactAndroid/external-artifacts/artifacts
merge-multiple: true
- name: Download ReactCore artifacts
uses: actions/download-artifact@v4
with:
pattern: ReactCore*
path: ./packages/react-native/ReactAndroid/external-artifacts/artifacts
merge-multiple: true
- name: Print Artifacts Directory
shell: bash
run: ls -lR ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup gradle
uses: ./.github/actions/setup-gradle
with:
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install dependencies
uses: ./.github/actions/yarn-install
- name: Build packages
@@ -123,7 +45,7 @@ runs:
run: yarn build
- name: Build types
shell: bash
run: yarn build-types
run: yarn build-types --skip-snapshot
# Continue with publish steps
- name: Set npm credentials
if: ${{ inputs.release-type == 'release' ||
@@ -14,6 +14,8 @@ inputs:
runs:
using: composite
steps:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Yarn install
uses: ./.github/actions/yarn-install
- name: Configure Git
@@ -0,0 +1,23 @@
name: diff-js-api-breaking-changes
description: Check for breaking changes in the public React Native JS API
runs:
using: composite
steps:
- name: Fetch snapshot from PR head
shell: bash
env:
SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-breaking-changes
run: |
mkdir $SCRATCH_DIR
git fetch --depth=1 origin ${{ github.event.pull_request.head.sha }}
git show ${{ github.event.pull_request.head.sha }}:packages/react-native/ReactNativeApi.d.ts > $SCRATCH_DIR/ReactNativeApi-after.d.ts \
|| echo "" > $SCRATCH_DIR/ReactNativeApi.d.ts
- name: Run breaking change detection
shell: bash
env:
SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-breaking-changes
run: |
node ./scripts/js-api/diff-api-snapshot \
${{ github.workspace }}/packages/react-native/ReactNativeApi.d.ts \
$SCRATCH_DIR/ReactNativeApi-after.d.ts \
> $SCRATCH_DIR/output.json
+8 -5
View File
@@ -4,7 +4,7 @@ inputs:
node-version:
description: "The node.js version to use"
required: false
default: "20"
default: "22"
github-token:
description: "The GitHub token used by pull-bot"
required: true
@@ -26,15 +26,12 @@ runs:
- name: Lint code
shell: bash
run: ./.github/workflow-scripts/exec_swallow_error.sh yarn lint --format junit -o ./reports/junit/eslint/results.xml
- name: Lint java
shell: bash
run: ./.github/workflow-scripts/exec_swallow_error.sh yarn lint-java --check
- name: Lint file structure
shell: bash
run: ./.github/workflow-scripts/lint_files.sh
- name: Verify not committing repo after running build
shell: bash
run: yarn run build --check
run: yarn run build --validate
- name: Run flowcheck
shell: bash
run: yarn flow-check
@@ -50,3 +47,9 @@ runs:
- name: Lint markdown
shell: bash
run: yarn run lint-markdown
- name: Build types
shell: bash
run: yarn build-types --skip-snapshot
- name: Run typescript check of generated types
shell: bash
run: yarn test-generated-typescript
+4 -11
View File
@@ -1,5 +1,5 @@
name: Maestro E2E Android
description: Runs E2E Tests on iOS using Maestro
description: Runs E2E Tests on Android using Maestro
inputs:
app-path:
required: true
@@ -7,9 +7,6 @@ inputs:
app-id:
required: true
description: The id of the app to test
jsengine:
required: true
description: The js engine we are using
maestro-flow:
required: true
description: the folder that contains the maestro tests
@@ -25,17 +22,13 @@ inputs:
required: false
default: "."
description: The directory from which metro should be started
architecture:
required: false
default: "NewArch"
description: The react native architecture to test
runs:
using: composite
steps:
- name: Installing Maestro
shell: bash
run: export MAESTRO_VERSION=1.39.7; curl -Ls "https://get.maestro.mobile.dev" | bash
run: export MAESTRO_VERSION=1.40.0; curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Set up JDK 17
if: ${{ inputs.install-java == 'true' }}
uses: actions/setup-java@v4
@@ -79,7 +72,7 @@ runs:
uses: actions/upload-artifact@v4.3.4
if: always()
with:
name: e2e_android_${{ steps.normalize-app-id.outputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}_${{ inputs.architecture }}
name: e2e_android_${{ steps.normalize-app-id.outputs.app-id }}_report_${{ inputs.flavor }}_NewArch
path: |
report.xml
screen.mp4
@@ -87,5 +80,5 @@ runs:
if: steps.run-tests.outcome == 'failure'
uses: actions/upload-artifact@v4.3.4
with:
name: maestro-logs-android-${{ steps.normalize-app-id.outputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.architecture }}
name: maestro-logs-android-${{ steps.normalize-app-id.outputs.app-id }}-${{ inputs.flavor }}-NewArch
path: /tmp/MaestroLogs
+11 -16
View File
@@ -7,9 +7,6 @@ inputs:
app-id:
required: true
description: The id of the app to test
jsengine:
required: true
description: The js engine we are using
maestro-flow:
required: true
description: the folder that contains the maestro tests
@@ -21,17 +18,13 @@ inputs:
required: false
default: "."
description: The directory from which metro should be started
architecture:
required: false
default: "NewArch"
description: The react native architecture to test
runs:
using: composite
steps:
- name: Installing Maestro
shell: bash
run: export MAESTRO_VERSION=1.39.7; curl -Ls "https://get.maestro.mobile.dev" | bash
run: export MAESTRO_VERSION=1.40.0; curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Installing Maestro dependencies
shell: bash
run: |
@@ -42,6 +35,8 @@ runs:
with:
java-version: '17'
distribution: 'zulu'
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Start Metro in Debug
@@ -66,24 +61,24 @@ runs:
"${{ inputs.app-path }}" \
"${{ inputs.app-id }}" \
"${{ inputs.maestro-flow }}" \
"${{ inputs.jsengine }}" \
"Hermes" \
"${{ inputs.flavor }}" \
"${{ inputs.working-directory }}"
- name: Store video record
if: always()
uses: actions/upload-artifact@v4.3.4
with:
name: e2e_ios_${{ inputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}_${{ inputs.architecture }}
name: e2e_ios_${{ inputs.app-id }}_report_${{ inputs.flavor }}_NewArch
path: |
video_record_${{ inputs.jsengine }}_1.mov
video_record_${{ inputs.jsengine }}_2.mov
video_record_${{ inputs.jsengine }}_3.mov
video_record_${{ inputs.jsengine }}_4.mov
video_record_${{ inputs.jsengine }}_5.mov
video_record_1.mov
video_record_2.mov
video_record_3.mov
video_record_4.mov
video_record_5.mov
report.xml
- name: Store Logs
if: failure() && steps.run-tests.outcome == 'failure'
uses: actions/upload-artifact@v4.3.4
with:
name: maestro-logs-${{ inputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.architecture }}
name: maestro-logs-${{ inputs.app-id }}-${{ inputs.flavor }}-NewArch
path: /tmp/MaestroLogs
@@ -1,100 +0,0 @@
name: prepare-hermes-workspace
description: This action prepares the hermes workspace with the right hermes and react-native versions.
inputs:
hermes-ws-dir:
required: true
description: The hermes dir we need to use to setup the workspace
hermes-version-file:
required: true
description: the path to the file that will contain the hermes version
outputs:
hermes-version:
description: the version of Hermes tied to this run
value: ${{ steps.hermes-version.outputs.VERSION }}
react-native-version:
description: the version of React Native tied to this run
value: ${{ steps.react-native-version.outputs.VERSION }}
runs:
using: composite
steps:
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup hermes version
shell: bash
id: hermes-version
run: |
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
if [ -f "${{ inputs.hermes-version-file }}" ]; then
echo "Hermes Version file found! Using this version for the build:"
echo "VERSION=$(cat ${{ inputs.hermes-version-file }})" >> "$GITHUB_OUTPUT"
else
echo "Hermes Version file not found!!!"
echo "Using the last commit from main for the build:"
HERMES_TAG_SHA=$(git ls-remote https://github.com/facebook/hermes main | cut -f 1 | tr -d '[:space:]')
echo "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT"
fi
echo "Hermes commit is $HERMES_TAG_SHA"
- name: Get react-native version
shell: bash
id: react-native-version
run: |
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
# Save the react native version we are building in an output variable so we can use that file as part of the cache key.
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "React Native Version is $VERSION"
- name: Cache hermes workspace
id: restore-hermes
uses: actions/cache/restore@v4
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ steps.hermes-version.outputs.version }}
enableCrossOsArchive: true
# It happened while testing that a cache was created from the right folders
# but those folders where empty. Thus, the next check ensures that we can work with those caches.
- name: Check if cache was meaningful
id: meaningful-cache
shell: bash
run: |
if [[ -d /tmp/hermes/hermes ]] && [[ -n "$(ls -A /tmp/hermes/hermes)" ]]; then
echo "Found a good hermes cache"
echo "HERMES_CACHED=true" >> "$GITHUB_OUTPUT"
fi
- name: Yarn- Install Dependencies
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
uses: ./.github/actions/yarn-install
- name: Download Hermes tarball
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
shell: bash
run: |
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
cp packages/react-native/sdks/download/* ${{ inputs.hermes-ws-dir }}/download/.
cp -r packages/react-native/sdks/hermes/* ${{ inputs.hermes-ws-dir }}/hermes/.
echo ${{ steps.hermes-version.outputs.version }}
- name: Upload Hermes artifact
uses: actions/upload-artifact@v4.3.4
with:
name: hermes-workspace
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
- name: Cache hermes workspace
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode.
with:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ steps.hermes-version.outputs.version }}
enableCrossOsArchive: true
@@ -1,16 +0,0 @@
name: restore-hermes-workspace
description: "Restore hermes workspace that has been created in Prepare Hermes Workspace"
runs:
using: composite
steps:
- name: Download Previous Artifacts
uses: actions/download-artifact@v4
with:
name: hermes-workspace
path: /tmp/hermes
- name: Set up workspace
shell: bash
run: |
mkdir -p $HERMES_OSXBIN_ARTIFACTS_DIR ./packages/react-native/sdks/hermes
cp -r $HERMES_WS_DIR/hermes/* ./packages/react-native/sdks/hermes/.
cp -r ./packages/react-native/sdks/hermes-engine/utils ./packages/react-native/sdks/hermes/.
@@ -0,0 +1,83 @@
name: Run Fantom Tests
inputs:
release-type:
required: true
description: The type of release we are building. It could be nightly, release or dry-run
gradle-cache-encryption-key:
description: "The encryption key needed to store the Gradle Configuration cache"
runs:
using: composite
steps:
- name: Install dependencies
shell: bash
run: |
sudo apt update
sudo apt install -y git cmake openssl libssl-dev clang
- name: Setup git safe folders
shell: bash
run: git config --global --add safe.directory '*'
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Install node dependencies
uses: ./.github/actions/yarn-install
- name: Setup gradle
uses: ./.github/actions/setup-gradle
with:
cache-read-only: "false"
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
- name: Restore Fantom ccache
uses: actions/cache/restore@v4
with:
path: /github/home/.cache/ccache
key: v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-${{ hashFiles(
'packages/react-native/ReactAndroid/**/*.cpp',
'packages/react-native/ReactAndroid/**/*.h',
'packages/react-native/ReactAndroid/**/CMakeLists.txt',
'packages/react-native/ReactCommon/**/*.cpp',
'packages/react-native/ReactCommon/**/*.h',
'packages/react-native/ReactCommon/**/CMakeLists.txt',
'private/react-native-fantom/tester/**/*.cpp',
'private/react-native-fantom/tester/**/*.h',
'private/react-native-fantom/tester/**/CMakeLists.txt'
) }}
restore-keys: |
v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-
v2-ccache-fantom-${{ github.job }}-
v2-ccache-fantom-
- name: Show ccache stats
shell: bash
run: ccache -s -v
- name: Run Fantom Tests
shell: bash
run: yarn fantom
env:
CC: clang
CXX: clang++
- name: Save Fantom ccache
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }}
uses: actions/cache/save@v4
with:
path: /github/home/.cache/ccache
key: v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-${{ hashFiles(
'packages/react-native/ReactAndroid/**/*.cpp',
'packages/react-native/ReactAndroid/**/*.h',
'packages/react-native/ReactAndroid/**/CMakeLists.txt',
'packages/react-native/ReactCommon/**/*.cpp',
'packages/react-native/ReactCommon/**/*.h',
'packages/react-native/ReactCommon/**/CMakeLists.txt',
'private/react-native-fantom/tester/**/*.cpp',
'private/react-native-fantom/tester/**/*.h',
'private/react-native-fantom/tester/**/CMakeLists.txt'
) }}
- name: Show ccache stats
shell: bash
run: ccache -s -v
- name: Upload test results
if: ${{ always() }}
uses: actions/upload-artifact@v4.3.4
with:
name: run-fantom-tests-results
compression-level: 1
path: |
private/react-native-fantom/build/reports
+1 -1
View File
@@ -4,7 +4,7 @@ inputs:
node-version:
description: 'The node.js version to use'
required: false
default: '20'
default: '22.14.0'
runs:
using: "composite"
steps:
@@ -1,38 +0,0 @@
name: setup-xcode-build-cache
description: Add caching to iOS jobs to speed up builds
inputs:
hermes-version:
description: The version of hermes
required: true
jsengine:
dscription: The js engine in use
default: Hermes
flavor:
description: The flavor that is going to be built
default: Debug
architecture:
description: The architecture that is going to be built
default: NewArch
use-frameworks:
description: Whether we are bulding with DynamicFrameworks or StaticLibraries
default: StaticLibraries
ruby-version:
description: The ruby version we are going to use
default: 2.6.10
runs:
using: composite
steps:
- name: See commands.yml with_xcodebuild_cache
shell: bash
run: echo "See commands.yml with_xcodebuild_cache"
- name: Cache podfile lock
uses: actions/cache@v4
with:
path: packages/rn-tester/Podfile.lock
key: v13-podfilelock-${{ github.job }}-${{ inputs.architecture }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.use-frameworks }}-${{ inputs.ruby-version }}-${{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version }}
- name: Cache cocoapods
uses: actions/cache@v4
with:
path: packages/rn-tester/Pods
key: v15-cocoapods-${{ github.job }}-${{ inputs.architecture }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.use-frameworks }}-${{ inputs.ruby-version }}-${{ hashfiles('packages/rn-tester/Podfile.lock') }}-${{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version}}
+23 -1
View File
@@ -4,7 +4,11 @@ inputs:
xcode-version:
description: 'The xcode version to use'
required: false
default: '15.2'
default: '16.2.0'
platform:
description: 'The platform to use. Valid values are: ios, ios-simulator, macos, mac-catalyst, tvos, tvos-simulator, xros, xros-simulator'
required: false
default: 'macos'
runs:
using: "composite"
steps:
@@ -12,3 +16,21 @@ runs:
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
with:
xcode-version: ${{ inputs.xcode-version }}
- name: Setup Platform ${{ inputs.platform }}
if: ${{ inputs.platform != 'macos' && inputs.platform != 'mac-catalyst' }}
shell: bash
run: |
# https://github.com/actions/runner-images/issues/12541
sudo xcodebuild -runFirstLaunch
sudo xcrun simctl list
# Install platform based on the platform
if [[ "${{ inputs.platform }}" == "xros" || "${{ inputs.platform }}" == "xros-simulator" ]]; then
sudo xcodebuild -downloadPlatform visionOS
elif [[ "${{ inputs.platform }}" == "tvos" || "${{ inputs.platform }}" == "tvos-simulator" ]]; then
sudo xcodebuild -downloadPlatform tvOS
else
sudo xcodebuild -downloadPlatform iOS
fi
sudo xcodebuild -runFirstLaunch
+31 -53
View File
@@ -1,51 +1,36 @@
name: test-ios-helloworld
description: Test iOS Hello World
inputs:
jsengine:
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
default: Hermes
use-frameworks:
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
default: StaticLibraries
architecture:
description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup. Must be one of "OldArch" or "NewArch"
default: OldArch
ruby-version:
description: The version of ruby that must be used
default: 2.6.10
flavor:
description: The flavor of the build. Must be one of "Debug", "Release".
default: Debug
hermes-version:
description: The version of hermes
required: true
react-native-version:
description: The version of react-native
required: true
runs:
using: composite
steps:
- name: Setup xcode
uses: ./.github/actions/setup-xcode
with:
platform: ios
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Create Hermes folder
shell: bash
run: mkdir -p "$HERMES_WS_DIR"
- name: Download Hermes
uses: actions/download-artifact@v4
with:
name: hermes-darwin-bin-${{ inputs.flavor }}
path: /tmp/hermes/hermes-runtime-darwin/
- name: Print Downloaded hermes
shell: bash
run: ls -lR "$HERMES_WS_DIR"
- name: Run yarn
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Setup ruby
uses: ruby/setup-ruby@v1.170.0
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ inputs.ruby-version }}
- name: Set nightly Hermes versions
shell: bash
run: |
node ./scripts/releases/use-hermes-nightly.js
- name: Run yarn install again, with the correct hermes version
uses: ./.github/actions/yarn-install
- name: Download ReactNativeDependencies
uses: actions/download-artifact@v4
with:
@@ -54,46 +39,39 @@ runs:
- name: Print third-party folder
shell: bash
run: ls -lR /tmp/third-party
- name: Install iOS dependencies - Configuration ${{ inputs.flavor }}; New Architecture ${{ inputs.architecture }}; JS Engine ${{ inputs.jsengine }}
- name: Download React Native Prebuilds
uses: actions/download-artifact@v4
with:
name: ReactCore${{ inputs.flavor }}.xcframework.tar.gz
path: /tmp/ReactCore
- name: Print ReactCore folder
shell: bash
run: ls -lR /tmp/ReactCore
- name: Install iOS dependencies - Configuration ${{ inputs.flavor }};
shell: bash
run: |
cd packages/helloworld
cd private/helloworld
args=()
if [[ ${{ inputs.architecture }} == "OldArch" ]]; then
args+=(--arch old)
fi
if [[ ${{ inputs.use-frameworks }} == "DynamicFrameworks" ]]; then
args+=(--frameworks dynamic)
fi
if [[ ${{ inputs.jsengine }} == "JSC" ]]; then
args+=(--jsvm jsc)
yarn bootstrap ios "${args[@]}" | cat
else
# Tarball is restored with capital flavors suffix, but somehow the tarball name from JS at line 96 returns as lowercased.
# Let's ensure that the tarballs have the right names
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ inputs.flavor }}.xcframework.tar.gz"
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz"
fi
yarn bootstrap ios "${args[@]}" | cat
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" ]]; then
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz"
fi
BUILD_TYPE="${{ inputs.flavor }}"
TARBALL_FILENAME=$(node ../react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
export HERMES_ENGINE_TARBALL_PATH="$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME"
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
yarn bootstrap ios "${args[@]}" | cat
fi
- name: Build HelloWorld project
- name: Run Helloworld tests
shell: bash
run: |
cd packages/helloworld
cd private/helloworld
yarn test
- name: Build HelloWorld project
shell: bash
run: |
cd private/helloworld
args=()
if [[ ${{ inputs.flavor }} == "Release" ]]; then
+20 -79
View File
@@ -1,33 +1,18 @@
name: test-ios-rntester
description: Test iOS RNTester
inputs:
jsengine:
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
default: Hermes
use-frameworks:
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
default: StaticLibraries
architecture:
description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup
default: NewArch
ruby-version:
description: The version of ruby that must be used
default: 2.6.10
run-unit-tests:
description: whether unit tests should run or not.
default: "false"
hermes-tarball-artifacts-dir:
description: The directory where the hermes tarball artifacts are stored
default: /tmp/hermes/hermes-runtime-darwin
flavor:
description: The flavor of the build. Must be one of "Debug", "Release".
default: Debug
hermes-version:
description: The version of hermes
required: true
react-native-version:
description: The version of react-native
required: true
run-e2e-tests:
description: Whether we want to run E2E tests or not
required: false
@@ -38,60 +23,25 @@ runs:
steps:
- name: Setup xcode
uses: ./.github/actions/setup-xcode
with:
platform: ios
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn
uses: ./.github/actions/yarn-install
- name: Download Hermes
uses: actions/download-artifact@v4
with:
name: hermes-darwin-bin-${{ inputs.flavor }}
path: ${{ inputs.hermes-tarball-artifacts-dir }}
- name: Setup ruby
uses: ruby/setup-ruby@v1.170.0
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ inputs.ruby-version }}
- name: Set nightly Hermes versions
shell: bash
run: |
node ./scripts/releases/use-hermes-nightly.js
- name: Run yarn install again, with the correct hermes version
uses: ./.github/actions/yarn-install
- name: Prepare IOS Tests
if: ${{ inputs.run-unit-tests == 'true' }}
uses: ./.github/actions/prepare-ios-tests
- name: Set HERMES_ENGINE_TARBALL_PATH envvar if Hermes tarball is present
shell: bash
run: |
HERMES_TARBALL_ARTIFACTS_DIR=${{ inputs.hermes-tarball-artifacts-dir }}
if [ ! -d $HERMES_TARBALL_ARTIFACTS_DIR ]; then
echo "Hermes tarball artifacts dir not present ($HERMES_TARBALL_ARTIFACTS_DIR). Build Hermes from source."
exit 0
fi
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ inputs.flavor }}")
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
echo "$TARBALL_PATH"
if [ ! -f $TARBALL_PATH ]; then
echo "Hermes tarball not present ($TARBALL_PATH). Build Hermes from source."
exit 0
fi
echo "Found Hermes tarball at $TARBALL_PATH"
echo "HERMES_ENGINE_TARBALL_PATH=$TARBALL_PATH" >> $GITHUB_ENV
- name: Print Hermes version
shell: bash
run: |
HERMES_TARBALL_ARTIFACTS_DIR=${{ inputs.hermes-tarball-artifacts-dir }}
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ inputs.flavor }}")
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
if [[ -e $TARBALL_PATH ]]; then
tar -xf $TARBALL_PATH
echo 'print(HermesInternal?.getRuntimeProperties?.()["OSS Release Version"])' > test.js
chmod +x ./destroot/bin/hermes
./destroot/bin/hermes test.js
rm test.js
rm -rf destroot
else
echo 'No Hermes tarball found.'
fi
- name: Download ReactNativeDependencies
uses: actions/download-artifact@v4
with:
@@ -100,37 +50,28 @@ runs:
- name: Print third-party folder
shell: bash
run: ls -lR /tmp/third-party
- name: Setup xcode build cache
uses: ./.github/actions/setup-xcode-build-cache
- name: Download React Native Prebuilds
uses: actions/download-artifact@v4
with:
hermes-version: ${{ inputs.hermes-version }}
jsengine: ${{ inputs.jsengine }}
architecture: ${{ inputs.architecture }}
use-frameworks: ${{ inputs.use-frameworks }}
flavor: ${{ inputs.flavor }}
ruby-version: ${{ inputs.ruby-version }}
name: ReactCore${{ inputs.flavor }}.xcframework.tar.gz
path: /tmp/ReactCore
- name: Print ReactCore folder
shell: bash
run: ls -lR /tmp/ReactCore
- name: Install CocoaPods dependencies
shell: bash
run: |
if [[ ${{ inputs.jsengine }} == "JSC" ]]; then
export USE_HERMES=0
else
export HERMES_ENGINE_TARBALL_PATH=$HERMES_ENGINE_TARBALL_PATH
fi
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ inputs.flavor }}.xcframework.tar.gz"
if [[ ${{ inputs.use-frameworks }} == "DynamicFrameworks" ]]; then
export USE_FRAMEWORKS=dynamic
fi
if [[ ${{ inputs.architecture }} == "OldArch" ]]; then
export RCT_NEW_ARCH_ENABLED=0
fi
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
cd packages/rn-tester
bundle install
bundle exec pod install
bundle exec pod update hermes-engine --no-repo-update
- name: Build RNTester
shell: bash
run: |
@@ -170,7 +111,7 @@ runs:
if: ${{ inputs.use-frameworks == 'StaticLibraries' && inputs.ruby-version == '2.6.10' }} # This is needed to avoid conflicts with the artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: RNTesterApp-${{ inputs.architecture }}-${{ inputs.jsengine }}-${{ inputs.flavor }}
name: RNTesterApp-NewArch-${{ inputs.flavor }}
path: ${{ env.app-path }}
- name: Store test results
if: ${{ inputs.run-unit-tests == 'true' }}
+1 -1
View File
@@ -4,7 +4,7 @@ inputs:
node-version:
description: "The node.js version to use"
required: false
default: "20"
default: "22"
runs:
using: composite
steps:
@@ -1,46 +0,0 @@
name: test-library-on-nightly
description: Tests a library on a nightly
inputs:
library-npm-package:
description: The library npm package to add
required: true
platform:
description: whether we want to build for iOS or Android
required: true
runs:
using: composite
steps:
- name: Create new app
shell: bash
run: |
cd /tmp
npx @react-native-community/cli init RNApp --skip-install --version nightly
- name: Add library
shell: bash
run: |
cd /tmp/RNApp
yarn add ${{ inputs.library-npm-package }}
- name: Build iOS
shell: bash
if: ${{ inputs.platform == 'ios' }}
run: |
cd /tmp/RNApp/ios
bundle install
bundle exec pod install
xcodebuild build \
-workspace RNApp.xcworkspace \
-scheme RNApp \
-sdk iphonesimulator
- name: Setup Java for Android
if: ${{ inputs.platform == 'android' }}
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'zulu'
- name: Build Android
shell: bash
if: ${{ inputs.platform == 'android' }}
run: |
cd /tmp/RNApp/android
./gradlew assembleDebug
@@ -121,7 +121,7 @@ describe('Create Draft Release', () => {
});
describe('#_computeBody', () => {
it('computes body for release', async () => {
it('computes body for release when no hermes versions are passed', async () => {
const version = '0.77.1';
const changelog = `## v${version}
### Breaking Changes
@@ -134,20 +134,83 @@ describe('Create Draft Release', () => {
#### iOS
- [PR #3436](https://github.com/facebook/react-native/pull/3436) - Some other change
- [PR #3437](https://github.com/facebook/react-native/pull/3437) - Some other change`;
const body = _computeBody(version, changelog);
const body = _computeBody(changelog, version);
expect(body).toEqual(`${changelog}
---
Hermes dSYMS:
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-hermes-framework-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-hermes-framework-dSYM-release.tar.gz)
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${version}/hermes-ios-${version}-hermes-framework-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${version}/hermes-ios-${version}-hermes-framework-dSYM-release.tar.gz)
Hermes V1 dSYMS:
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${version}/hermes-ios-${version}-hermes-framework-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${version}/hermes-ios-${version}-hermes-framework-dSYM-release.tar.gz)
ReactNativeDependencies dSYMs:
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-release.tar.gz)
ReactNative Core dSYMs:
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-core-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-core-release.tar.gz)
---
You can file issues or pick requests against this release [here](https://github.com/reactwg/react-native-releases/issues/new/choose).
---
To help you upgrade to this version, you can use the [Upgrade Helper](https://react-native-community.github.io/upgrade-helper/) ⚛️.
---
View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/react-native/blob/main/CHANGELOG.md).`);
});
it('computes body for release when hermes versions are passed', async () => {
const version = '0.77.1';
const hermesVersion = '0.15.0';
const hermesV1Version = '250829098.0.2';
const changelog = `## v${version}
### Breaking Changes
- [PR #9012](https://github.com/facebook/react-native/pull/9012) - Some other change
#### Android
- [PR #3456](https://github.com/facebook/react-native/pull/3456) - Some other change
- [PR #3457](https://github.com/facebook/react-native/pull/3457) - Some other change
#### iOS
- [PR #3436](https://github.com/facebook/react-native/pull/3436) - Some other change
- [PR #3437](https://github.com/facebook/react-native/pull/3437) - Some other change`;
const body = _computeBody(
changelog,
version,
hermesVersion,
hermesV1Version,
);
expect(body).toEqual(`${changelog}
---
Hermes dSYMS:
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-release.tar.gz)
Hermes V1 dSYMS:
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesV1Version}/hermes-ios-${hermesV1Version}-hermes-framework-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesV1Version}/hermes-ios-${hermesV1Version}-hermes-framework-dSYM-release.tar.gz)
ReactNativeDependencies dSYMs:
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-release.tar.gz)
ReactNative Core dSYMs:
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-core-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-core-release.tar.gz)
---
You can file issues or pick requests against this release [here](https://github.com/reactwg/react-native-releases/issues/new/choose).
@@ -188,6 +251,7 @@ View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/
status: 201,
json: () =>
Promise.resolve({
id: 1,
html_url:
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
}),
@@ -208,9 +272,11 @@ View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/
body: fetchBody,
},
);
expect(response).toEqual(
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
);
expect(response).toEqual({
id: 1,
html_url:
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
});
});
it('creates a draft release for prerelease on GitHub', async () => {
@@ -238,6 +304,7 @@ View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/
status: 201,
json: () =>
Promise.resolve({
id: 1,
html_url:
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
}),
@@ -258,9 +325,11 @@ View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/
body: fetchBody,
},
);
expect(response).toEqual(
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
);
expect(response).toEqual({
id: 1,
html_url:
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
});
});
it('throws if the post failes', async () => {
@@ -117,13 +117,13 @@ describe('#verifyPublishedTemplate', () => {
it('will timeout if npm does not update package version after a set number of retries', async () => {
const RETRIES = 2;
await verifyPublishedTemplate('0.77.0', true, RETRIES),
(await verifyPublishedTemplate('0.77.0', true, RETRIES),
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
'@react-native-community/template',
'0.77.0',
'latest',
2,
);
));
});
});
});
@@ -38,7 +38,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
expect(mockSleep).toHaveBeenCalledTimes(1);
expect(mockFetch).toHaveBeenCalledWith(
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
);
});
@@ -55,7 +55,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
expect(mockSleep).toHaveBeenCalledTimes(1);
expect(mockFetch).toHaveBeenCalledWith(
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
);
});
@@ -67,7 +67,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
expect(mockSleep).toHaveBeenCalledTimes(0);
expect(mockFetch).toHaveBeenCalledWith(
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
);
});
@@ -81,7 +81,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
expect(mockSleep).toHaveBeenCalledTimes(90);
expect(mockExit).toHaveBeenCalledWith(1);
expect(mockFetch).toHaveBeenCalledWith(
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
);
});
});
@@ -83,13 +83,13 @@ describe('#verifyReleaseOnNPM', () => {
it('will timeout if npm does not update package version after a set number of retries', async () => {
const RETRIES = 2;
await verifyReleaseOnNpm('0.77.0', true, RETRIES),
(await verifyReleaseOnNpm('0.77.0', true, RETRIES),
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
'react-native',
'0.77.0',
'latest',
2,
);
));
});
it('will timeout if npm does not update latest tag after a set number of retries', async () => {
-6
View File
@@ -95,12 +95,6 @@ module.exports = async (github, context, labelWithContext) => {
);
await requestAuthorFeedback();
return;
case 'Newer Patch Available':
await addComment(
`> [!TIP]\n` +
`> **Newer version available**: You are on a supported minor version, but it looks like there's a newer patch available - ${labelWithContext.newestPatch}. Please [upgrade](https://reactnative.dev/docs/upgrading) to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.`,
);
return;
case 'Needs: Version Info':
await addComment(
`> [!WARNING]\n` +
+10 -5
View File
@@ -4,12 +4,16 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
GITHUB_OWNER=-facebook
GITHUB_REPO=-react-native
export GITHUB_OWNER
export GITHUB_REPO
export GITHUB_OWNER=-facebook
export GITHUB_REPO=-react-native
cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow-check --silent --json; echo google-java-format; node scripts/lint-java.js --diff) | node packages/react-native-bots/code-analysis-bot.js
{
echo eslint
npm run lint --silent -- --format=json
echo flow
npm run flow-check --silent --json
} | node private/react-native-bots/code-analysis-bot.js
STATUS=$?
if [ $STATUS == 0 ]; then
@@ -17,3 +21,4 @@ if [ $STATUS == 0 ]; then
else
echo "Code analysis failed, error status $STATUS."
fi
exit $STATUS
@@ -1,76 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
const fs = require('fs');
const path = require('path');
function readOutcomes() {
const baseDir = '/tmp';
let outcomes = [];
fs.readdirSync(baseDir).forEach(file => {
const fullPath = path.join(baseDir, file);
if (fullPath.endsWith('outcome') && fs.statSync(fullPath).isDirectory) {
fs.readdirSync(fullPath).forEach(subFile => {
const subFullPath = path.join(fullPath, subFile);
if (subFullPath.endsWith('outcome')) {
const [library, status] = String(fs.readFileSync(subFullPath, 'utf8'))
.trim()
.split(':');
const platform = subFile.includes('android') ? 'Android' : 'iOS';
console.log(
`[${platform}] ${library} completed with status ${status}`,
);
outcomes.push({
library: library.trim(),
platform,
status: status.trim(),
});
}
});
} else if (fullPath.endsWith('outcome')) {
const [library, status] = String(fs.readFileSync(fullPath, 'utf8'))
.trim()
.split(':');
const platform = file.includes('android') ? 'Android' : 'iOS';
console.log(`[${platform}] ${library} completed with status ${status}`);
outcomes.push({
library: library.trim(),
platform,
status: status.trim(),
});
}
});
return outcomes;
}
function printFailures(outcomes) {
console.log('Printing failures...');
let failures = 0;
outcomes.forEach(entry => {
if (entry.status !== 'success') {
console.log(
`❌ [${entry.platform}] ${entry.library} failed with status ${entry.status}`,
);
failures++;
}
});
return failures > 0;
}
function collectResults() {
const outcomes = readOutcomes();
const failures = printFailures(outcomes);
if (failures) {
process.exit(1);
}
console.log('✅ All tests passed!');
}
module.exports = {
collectResults,
};
+28 -7
View File
@@ -40,19 +40,29 @@ function _extractChangelog(version) {
return changelog.slice(changelogStarts, changelogEnds).join('\n').trim();
}
function _computeBody(version, changelog) {
function _computeBody(changelog, version, hermesVersion, hermesV1Version) {
hermesVersion = hermesVersion ?? version;
hermesV1Version = hermesV1Version ?? version;
return `${changelog}
---
Hermes dSYMS:
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-hermes-framework-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-hermes-framework-dSYM-release.tar.gz)
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-release.tar.gz)
Hermes V1 dSYMS:
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesV1Version}/hermes-ios-${hermesV1Version}-hermes-framework-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesV1Version}/hermes-ios-${hermesV1Version}-hermes-framework-dSYM-release.tar.gz)
ReactNativeDependencies dSYMs:
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-release.tar.gz)
ReactNative Core dSYMs:
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-core-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-core-release.tar.gz)
---
You can file issues or pick requests against this release [here](https://github.com/reactwg/react-native-releases/issues/new/choose).
@@ -101,7 +111,11 @@ async function _createDraftReleaseOnGitHub(version, body, latest, token) {
}
const data = await response.json();
return data.html_url;
const {html_url, id} = data;
return {
html_url,
id,
};
}
function moveToChangelogBranch(version) {
@@ -109,7 +123,13 @@ function moveToChangelogBranch(version) {
run(`git checkout -b changelog/v${version}`);
}
async function createDraftRelease(version, latest, token) {
async function createDraftRelease(
version,
latest,
token,
hermesVersion,
hermesV1Version,
) {
if (version.startsWith('v')) {
version = version.substring(1);
}
@@ -117,14 +137,15 @@ async function createDraftRelease(version, latest, token) {
_verifyTagExists(version);
moveToChangelogBranch(version);
const changelog = _extractChangelog(version);
const body = _computeBody(version, changelog);
const body = _computeBody(changelog, version, hermesVersion, hermesV1Version);
const release = await _createDraftReleaseOnGitHub(
version,
body,
latest,
token,
);
log(`Created draft release: ${release}`);
log(`Created draft release: ${release.html_url}, ID ${release.id}`);
return release;
}
module.exports = {
@@ -25,6 +25,31 @@ function extractUsersFromScheduleAndDate(schedule, userMap, date) {
return [user1, user2];
}
/**
* You can invoke this script by doing:
* ```
* node .github/workflow-scripts/extractIssueOncalls.js $DATA
* ```
*
* the $DATA is stored in the github secrets as ONCALL_SCHEDULE variable.
* The format of the data is:
* ```
* {
* \"userMap\": {
* \"discord_handle1\": \"discord_id1\",
* \"discord_handle2\": \"discord_id2\",
* ...
* },
* \"schedule\": {
* \"2025-07-29\": [\"discord_handle1\", \"discord_handle2\"],
* \"2025-08-05\": [\"discord_handle3\", \"discord_handle4\"],
* ...
* }
* ```
*
* When uploading the secret, make sure that the JSON strings are escaped!
* The script will fail otherwise, because GitHub will remove the `"` characters.
*/
function main() {
const configuration = process.argv[2];
const {userMap, schedule} = JSON.parse(configuration);
+3 -3
View File
@@ -87,11 +87,11 @@ async function launchAppOnSimulator(appId, udid, isDebug) {
function startVideoRecording(jsengine, currentAttempt) {
console.log(
`Start video record using pid: video_record_${jsengine}_${currentAttempt}.pid`,
`Start video record using pid: video_record_${currentAttempt}.pid`,
);
const recordingArgs =
`simctl io booted recordVideo video_record_${jsengine}_${currentAttempt}.mov`.split(
`simctl io booted recordVideo video_record_${currentAttempt}.mov`.split(
' ',
);
const recordingProcess = childProcess.spawn('xcrun', recordingArgs, {
@@ -162,7 +162,7 @@ async function main() {
console.info(`WORKING_DIRECTORY: ${WORKING_DIRECTORY}`);
console.info('==============================\n');
const simulatorName = 'iPhone 15 Pro';
const simulatorName = 'iPhone 16 Pro';
launchSimulator(simulatorName);
installAppOnSimulator(APP_PATH);
const udid = extractSimulatorUDID();
@@ -13,13 +13,14 @@ const SLEEP_S = 60; // 1 minute
const MAX_RETRIES = 90; // 90 attempts. Waiting between attempt: 1 min. Total time: 90 min.
const ARTIFACT_URL =
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/';
const ARTIFACT_NAME = 'react-native-artifacts-';
async function verifyArtifactsAreOnMaven(version, retries = MAX_RETRIES) {
if (version.startsWith('v')) {
version = version.substring(1);
}
const artifactUrl = `${ARTIFACT_URL}${version}`;
const artifactUrl = `${ARTIFACT_URL}${version}/${ARTIFACT_NAME}${version}.pom`;
for (let currentAttempt = 1; currentAttempt <= retries; currentAttempt++) {
const response = await fetch(artifactUrl);
-28
View File
@@ -45,18 +45,6 @@ module.exports = async (github, context) => {
if (!isVersionSupported(issueVersion, latestVersion)) {
return {label: 'Type: Unsupported Version'};
}
// We want to encourage users to repro the issue on the highest available patch for the given minor.
const latestPatchForVersion = getLatestPatchForVersion(
issueVersion,
recentReleases,
);
if (latestPatchForVersion > issueVersion.patch) {
return {
label: 'Newer Patch Available',
newestPatch: `${issueVersion.major}.${issueVersion.minor}.${latestPatchForVersion}`,
};
}
};
/**
@@ -87,22 +75,6 @@ function isVersionTooOld(actualVersion, latestVersion) {
);
}
// Assumes that releases are sorted in the order of recency (i.e. most recent releases are earlier in the list)
// This enables us to stop looking as soon as we find the first release with a matching major/minor version, since
// we know it's the most recent release, therefore the highest patch available.
function getLatestPatchForVersion(version, releases) {
for (releaseName of releases) {
const release = parseVersionFromString(releaseName);
if (
release &&
release.major == version.major &&
release.minor == version.minor
) {
return release.patch;
}
}
}
function getReactNativeVersionFromIssueBodyIfExists(issue) {
if (!issue || !issue.body) return;
const rnVersionRegex = /React Native Version[\r\n]+(?<version>.+)[\r\n]*/;
+4
View File
@@ -18,6 +18,10 @@ jobs:
run: |
git config --local user.email "bot@reactnative.dev"
git config --local user.name "React Native Bot"
- name: Setup xcode
uses: ./.github/actions/setup-xcode
with:
platform: 'ios'
- name: Extract branch name
run: |
TAG="${{ github.ref_name }}";
+2 -2
View File
@@ -14,7 +14,7 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Trim the cache
run: node scripts/clean-gha-cache.js
-32
View File
@@ -1,32 +0,0 @@
# This jobs runs every day 2 hours after the nightly job and its purpose is to report
# a failure in case the nightly failed to be published. We are going to hook this to an internal automation.
name: Check Nigthlies
on:
workflow_dispatch:
# nightly build @ 4:15 AM UTC
schedule:
- cron: '15 4 * * *'
jobs:
check-nightly:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check nightly
run: |
TODAY=$(date "+%Y%m%d")
echo "Checking nightly for $TODAY"
NIGHTLY="$(npm view react-native | grep $TODAY)"
if [[ -z $NIGHTLY ]]; then
echo 'Nightly job failed.'
exit 1
else
echo 'Nightly Worked, All Good!'
fi
test-libraries:
uses: ./.github/workflows/test-libraries-on-nightlies.yml
needs: check-nightly
+26 -2
View File
@@ -2,6 +2,15 @@ name: Create Draft Release
on:
workflow_call:
inputs:
hermesVersion:
required: false
type: string
description: The version of Hermes to use for this release (eg. 0.15.0). If not specified, it will use React Native Version
hermesV1Version:
required: false
type: string
description: The version of Hermes V1 to use for this release (eg. 250829098.0.2). If not specified, it will use React Native Version
jobs:
create-draft-release:
@@ -21,9 +30,24 @@ jobs:
git config --local user.name "React Native Bot"
- name: Create draft release
uses: actions/github-script@v6
id: create-draft-release
with:
script: |
const {createDraftRelease} = require('./.github/workflow-scripts/createDraftRelease.js');
const version = ${{ github.ref_name }}';
const version = '${{ github.ref_name }}';
const {isLatest} = require('./.github/workflow-scripts/publishTemplate.js');
await createDraftRelease(version, isLatest(), '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}');
return (await createDraftRelease(version, isLatest(), '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}', ${{ inputs.hermesVersion }}, ${{ inputs.hermesV1Version }})).id;
result-encoding: string
- name: Upload release assets for DotSlash
uses: actions/github-script@v6
env:
RELEASE_ID: ${{ steps.create-draft-release.outputs.result }}
with:
script: |
const {uploadReleaseAssetsForDotSlashFiles} = require('./scripts/releases/upload-release-assets-for-dotslash.js');
const version = '${{ github.ref_name }}';
await uploadReleaseAssetsForDotSlashFiles({
version,
token: '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}',
releaseId: process.env.RELEASE_ID,
});
+1
View File
@@ -19,6 +19,7 @@ on:
jobs:
create_release:
if: github.repository == 'facebook/react-native'
runs-on: ubuntu-latest
steps:
- name: Checkout
+5 -1
View File
@@ -18,10 +18,14 @@ jobs:
if: github.repository == 'facebook/react-native'
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Run diff-js-api-breaking-changes
uses: ./.github/actions/diff-js-api-breaking-changes
- name: Danger
run: yarn danger ci --use-github-checks --failOnErrors
working-directory: packages/react-native-bots
working-directory: private/react-native-bots
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
+2 -7
View File
@@ -12,13 +12,12 @@ on:
jobs:
monitor-issues:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
uses: ./.github/actions/setup-node
- name: Install dependencies
uses: ./.github/actions/yarn-install
- name: Extract next oncall
@@ -28,10 +27,6 @@ jobs:
ONCALL2=$(echo $ONCALLS | cut -d ' ' -f 2)
echo "oncall1=$ONCALL1" >> $GITHUB_ENV
echo "oncall2=$ONCALL2" >> $GITHUB_ENV
- name: Print oncalls
run: |
echo "oncall1: ${{ env.oncall1 }}"
echo "oncall2: ${{ env.oncall2 }}"
- name: Monitor New Issues
uses: react-native-community/repo-monitor@v1.0.1
with:
+10 -119
View File
@@ -21,125 +21,21 @@ jobs:
echo "Setting release type to nightly"
echo "RELEASE_TYPE=nightly" >> $GITHUB_OUTPUT
prepare_hermes_workspace:
runs-on: ubuntu-latest
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
outputs:
react-native-version: ${{ steps.prepare-hermes-workspace.outputs.react-native-version }}
hermes-version: ${{ steps.prepare-hermes-workspace.outputs.hermes-version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare Hermes Workspace
id: prepare-hermes-workspace
uses: ./.github/actions/prepare-hermes-workspace
with:
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
hermes-version-file: ${{ env.HERMES_VERSION_FILE }}
build_hermesc_apple:
runs-on: macos-13
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: /tmp/hermes
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build HermesC Apple
uses: ./.github/actions/build-hermesc-apple
with:
hermes-version: ${{ needs.prepare_hermes_workspace.output.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.output.react-native-version }}
build_apple_slices_hermes:
runs-on: macos-14
needs: [build_hermesc_apple, prepare_hermes_workspace]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
IOS_DEPLOYMENT_TARGET: "15.1"
XROS_DEPLOYMENT_TARGET: "1.0"
MAC_DEPLOYMENT_TARGET: "10.15"
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
slice: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, catalyst, xros, xrsimulator]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Slice
uses: ./.github/actions/build-apple-slices-hermes
with:
flavor: ${{ matrix.flavor }}
slice: ${{ matrix.slice}}
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
build_hermes_macos:
runs-on: macos-13
needs: [build_apple_slices_hermes, prepare_hermes_workspace]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
continue-on-error: true
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Hermes MacOS
uses: ./.github/actions/build-hermes-macos
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
flavor: ${{ matrix.flavor }}
prebuild_apple_dependencies:
uses: ./.github/workflows/prebuild-ios.yml
if: github.repository == 'facebook/react-native'
uses: ./.github/workflows/prebuild-ios-dependencies.yml
secrets: inherit
build_hermesc_linux:
runs-on: ubuntu-latest
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build HermesC Linux
uses: ./.github/actions/build-hermesc-linux
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
build_hermesc_windows:
runs-on: windows-2019
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build HermesC Windows
uses: ./.github/actions/build-hermesc-windows
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
prebuild_react_native_core:
uses: ./.github/workflows/prebuild-ios-core.yml
with:
use-hermes-nightly: true
secrets: inherit
needs: [prebuild_apple_dependencies]
build_android:
runs-on: 8-core-ubuntu
if: github.repository == 'facebook/react-native'
needs: [set_release_type]
container:
image: reactnativecommunity/react-native-android:latest
@@ -164,12 +60,9 @@ jobs:
needs:
[
set_release_type,
prepare_hermes_workspace,
build_hermes_macos,
build_hermesc_linux,
build_hermesc_windows,
build_android,
prebuild_apple_dependencies,
prebuild_react_native_core,
]
container:
image: reactnativecommunity/react-native-android:latest
@@ -179,7 +72,6 @@ jobs:
# By default we only build ARM64 to save time/resources. For release/nightlies, we override this value to build all archs.
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
env:
HERMES_WS_DIR: /tmp/hermes
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
@@ -191,7 +83,6 @@ jobs:
- name: Build and Publish NPM Package
uses: ./.github/actions/build-npm-package
with:
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
gha-npm-token: ${{ env.GHA_NPM_TOKEN }}
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
+198
View File
@@ -0,0 +1,198 @@
name: Prebuild iOS Dependencies
on:
workflow_call: # this directive allow us to call this workflow from other workflows
inputs:
use-hermes-nightly:
description: 'Whether to use the hermes nightly build or read the version from the versions.properties file'
type: boolean
required: false
default: false
jobs:
build-rn-slice:
runs-on: macos-15
strategy:
fail-fast: false
matrix:
flavor: ['Debug', 'Release']
slice: [
'ios',
'ios-simulator',
'mac-catalyst',
]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore cache if present
id: restore-ios-slice
uses: actions/cache/restore@v4
with:
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
path: packages/react-native/
- name: Setup node.js
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
uses: ./.github/actions/setup-node
- name: Setup xcode
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
uses: ./.github/actions/setup-xcode
with:
platform: ${{ matrix.slice }}
- name: Yarn Install
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
uses: ./.github/actions/yarn-install
- name: Set Hermes version
shell: bash
run: |
if [ "${{ inputs.use-hermes-nightly }}" == "true" ]; then
HERMES_VERSION="nightly"
else
HERMES_VERSION=$(sed -n 's/^HERMES_VERSION_NAME=//p' packages/react-native/sdks/hermes-engine/version.properties)
fi
echo "Using Hermes version: $HERMES_VERSION"
echo "HERMES_VERSION=$HERMES_VERSION" >> $GITHUB_ENV
- name: Download ReactNativeDependencies
uses: actions/download-artifact@v4
with:
name: ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
path: /tmp/third-party/
- name: Extract ReactNativeDependencies
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
shell: bash
run: |
# Extract ReactNativeDependencies
tar -xzf /tmp/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz -C /tmp/third-party/
# Create destination folder
mkdir -p packages/react-native/third-party/
# Move the XCFramework in the destination directory
mv /tmp/third-party/packages/react-native/third-party/ReactNativeDependencies.xcframework packages/react-native/third-party/ReactNativeDependencies.xcframework
VERSION=$(jq -r '.version' packages/react-native/package.json)
echo "$VERSION-${{matrix.flavor}}" > "packages/react-native/third-party/version.txt"
cat "packages/react-native/third-party/version.txt"
# Check destination directory
ls -lR packages/react-native/third-party/
- name: Setup the workspace
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
shell: bash
run: |
cd packages/react-native
node scripts/ios-prebuild.js -s -f "${{ matrix.flavor }}"
- name: Build React Native
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
shell: bash
run: |
# This is going to be replaced by a CLI script
cd packages/react-native
node scripts/ios-prebuild -b -f "${{ matrix.flavor }}" -p "${{ matrix.slice }}"
- name: Upload headers
uses: actions/upload-artifact@v4
with:
name: prebuild-ios-core-headers-${{ matrix.flavor }}-${{ matrix.slice }}
path:
packages/react-native/.build/headers
- name: Upload artifacts
uses: actions/upload-artifact@v4.3.4
with:
name: prebuild-ios-core-slice-${{ matrix.flavor }}-${{ matrix.slice }}
path: |
packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
- name: Save Cache
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
with:
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
path: |
packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
packages/react-native/.build/headers
compose-xcframework:
runs-on: macos-15
needs: [build-rn-slice]
strategy:
fail-fast: false
matrix:
flavor: ['Debug', 'Release']
env:
REACT_ORG_CODE_SIGNING_P12_CERT: ${{ secrets.REACT_ORG_CODE_SIGNING_P12_CERT }}
REACT_ORG_CODE_SIGNING_P12_CERT_PWD: ${{ secrets.REACT_ORG_CODE_SIGNING_P12_CERT_PWD }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore cache if present
id: restore-ios-xcframework
uses: actions/cache/restore@v4
with:
path: packages/react-native/.build/output/xcframeworks
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
- name: Setup node.js
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
uses: ./.github/actions/setup-node
- name: Setup xcode
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
uses: ./.github/actions/setup-xcode
with:
xcode-version: '16.2.0'
- name: Yarn Install
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
uses: ./.github/actions/yarn-install
- name: Download slice artifacts
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
uses: actions/download-artifact@v4
with:
pattern: prebuild-ios-core-slice-${{ matrix.flavor }}-*
path: packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
merge-multiple: true
- name: Download headers
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
uses: actions/download-artifact@v4
with:
pattern: prebuild-ios-core-headers-${{ matrix.flavor }}-*
path: packages/react-native/.build/headers
merge-multiple: true
- name: Setup Keychain
if: ${{ steps.restore-ios-xcframework.outputs.cache-hit != 'true' && env.REACT_ORG_CODE_SIGNING_P12_CERT != '' }}
uses: apple-actions/import-codesign-certs@v3 # https://github.com/marketplace/actions/import-code-signing-certificates
with:
p12-file-base64: ${{ secrets.REACT_ORG_CODE_SIGNING_P12_CERT }}
p12-password: ${{ secrets.REACT_ORG_CODE_SIGNING_P12_CERT_PWD }}
- name: Create XCFramework
if: ${{ steps.restore-ios-xcframework.outputs.cache-hit != 'true' && env.REACT_ORG_CODE_SIGNING_P12_CERT == '' }}
run: |
cd packages/react-native
node scripts/ios-prebuild -c -f "${{ matrix.flavor }}"
- name: Create and Sign XCFramework
if: ${{ steps.restore-ios-xcframework.outputs.cache-hit != 'true' && env.REACT_ORG_CODE_SIGNING_P12_CERT != '' }}
run: |
cd packages/react-native
node scripts/ios-prebuild -c -f "${{ matrix.flavor }}" -i "React Org"
- name: Compress and Rename XCFramework
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
run: |
cd packages/react-native/.build/output/xcframeworks/${{matrix.flavor}}
tar -cz -f ../ReactCore${{matrix.flavor}}.xcframework.tar.gz React.xcframework
- name: Compress and Rename dSYM
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
run: |
cd packages/react-native/.build/output/xcframeworks/${{matrix.flavor}}/Symbols
tar -cz -f ../../ReactCore${{ matrix.flavor }}.framework.dSYM.tar.gz .
- name: Upload XCFramework Artifact
uses: actions/upload-artifact@v4
with:
name: ReactCore${{ matrix.flavor }}.xcframework.tar.gz
path: packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.xcframework.tar.gz
- name: Upload dSYM Artifact
uses: actions/upload-artifact@v4
with:
name: ReactCore${{ matrix.flavor }}.framework.dSYM.tar.gz
path: packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.framework.dSYM.tar.gz
- name: Save cache if present
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
uses: actions/cache/save@v4
with:
path: |
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.xcframework.tar.gz
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.framework.dSYM.tar.gz
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
@@ -1,4 +1,4 @@
name: Prebuild iOS
name: Prebuild iOS Dependencies
on:
workflow_call: # this directive allow us to call this workflow from other workflows
@@ -7,7 +7,7 @@ on:
jobs:
prepare_workspace:
name: Prepare workspace
runs-on: macos-14
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -18,7 +18,7 @@ jobs:
uses: actions/cache/restore@v4
with:
path: packages/react-native/third-party/
key: v2-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
key: v3-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
enableCrossOsArchive: true
- name: Yarn Install
if: steps.restore-ios-prebuilds.outputs.cache-hit != 'true'
@@ -40,13 +40,13 @@ jobs:
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
with:
key: v2-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
key: v3-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
enableCrossOsArchive: true
path: packages/react-native/third-party/
build-apple-slices:
name: Build Apple Slice
runs-on: macos-14
runs-on: macos-15
needs: [prepare_workspace]
strategy:
fail-fast: false
@@ -65,16 +65,17 @@ jobs:
uses: actions/checkout@v4
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Setup xcode
uses: ./.github/actions/setup-xcode
with:
xcode-version: '16.1'
- name: Restore slice folder
id: restore-slice-folder
uses: actions/cache/restore@v4
with:
path: packages/react-native/third-party/.build/Build/Products
key: v2-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
key: v3-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
- name: Setup xcode
if: steps.restore-slice-folder.outputs.cache-hit != 'true'
uses: ./.github/actions/setup-xcode
with:
platform: ${{ matrix.slice }}
- name: Yarn Install
if: steps.restore-slice-folder.outputs.cache-hit != 'true'
uses: ./.github/actions/yarn-install
@@ -85,15 +86,8 @@ jobs:
name: ios-prebuilds-workspace
path: packages/react-native/third-party/
- name: Print third-party folder structure
if: steps.restore-slice-folder.outputs.cache-hit != 'true'
run: ls -lR packages/react-native/third-party
- name: Install VisionOS
if: ${{ steps.restore-slice-folder.outputs.cache-hit != 'true' && (matrix.slice == 'xros' || matrix.slice == 'xros-simulator') }}
run: |
# https://github.com/actions/runner-images/issues/10559
sudo xcodebuild -runFirstLaunch
sudo xcrun simctl list
sudo xcodebuild -downloadPlatform visionOS
sudo xcodebuild -runFirstLaunch
- name: Build slice ${{ matrix.slice }} for ${{ matrix.flavor }}
if: steps.restore-slice-folder.outputs.cache-hit != 'true'
run: node scripts/releases/prepare-ios-prebuilds.js -b -p ${{ matrix.slice }} -r ${{ matrix.flavor }}
@@ -107,14 +101,14 @@ jobs:
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
with:
key: v2-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
key: v3-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
enableCrossOsArchive: true
path: |
packages/react-native/third-party/.build/Build/Products
create-xcframework:
name: Prepare XCFramework
runs-on: macos-14
runs-on: macos-15
needs: [build-apple-slices]
strategy:
fail-fast: false
@@ -138,7 +132,7 @@ jobs:
with:
path: |
packages/react-native/third-party/
key: v2-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
key: v3-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
# If cache hit, we already have our binary. We don't need to do anything.
- name: Yarn Install
if: steps.restore-xcframework.outputs.cache-hit != 'true'
@@ -179,8 +173,9 @@ jobs:
- name: Compress and Rename dSYM
if: steps.restore-xcframework.outputs.cache-hit != 'true'
run: |
tar -cz -f packages/react-native/third-party/Symbols/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz \
packages/react-native/third-party/Symbols/ReactNativeDependencies.framework.dSYM
cd packages/react-native/third-party/Symbols/
tar -cz -f ../ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz .
mv ../ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz ./ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
- name: Upload XCFramework Artifact
uses: actions/upload-artifact@v4
with:
@@ -199,4 +194,4 @@ jobs:
path: |
packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
key: v2-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
key: v3-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
@@ -9,6 +9,7 @@ on:
jobs:
publish_bumped_packages:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
env:
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
steps:
@@ -21,7 +22,7 @@ jobs:
- name: Build packages
run: yarn build
- name: Build types
run: yarn build-types
run: yarn build-types --skip-snapshot
- name: Set NPM auth token
run: echo "//registry.npmjs.org/:_authToken=$GHA_NPM_TOKEN" > ~/.npmrc
- name: Find and publish all bumped packages
+26 -133
View File
@@ -19,153 +19,45 @@ jobs:
echo "Setting release type to release"
echo "RELEASE_TYPE=release" >> $GITHUB_OUTPUT
prepare_hermes_workspace:
set_hermes_versions:
runs-on: ubuntu-latest
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
if: github.repository == 'facebook/react-native'
outputs:
react-native-version: ${{ steps.prepare-hermes-workspace.outputs.react-native-version }}
hermes-version: ${{ steps.prepare-hermes-workspace.outputs.hermes-version }}
HERMES_VERSION: ${{ steps.set_hermes_versions.outputs.HERMES_VERSION }}
HERMES_V1_VERSION: ${{ steps.set_hermes_versions.outputs.HERMES_V1_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare Hermes Workspace
id: prepare-hermes-workspace
uses: ./.github/actions/prepare-hermes-workspace
with:
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
hermes-version-file: ${{ env.HERMES_VERSION_FILE }}
- id: set_hermes_versions
run: |
echo "Setting hermes versions to latest"
hermes_version=$(grep -oE 'HERMES_VERSION_NAME=([0-9]+\.[0-9]+\.[0-9]+)' packages/react-native/sdks/hermes-engine/version.properties | cut -d'=' -f2)
hermes_v1_version=$(grep -oE 'HERMES_V1_VERSION_NAME=([0-9]+\.[0-9]+\.[0-9]+)' packages/react-native/sdks/hermes-engine/version.properties | cut -d'=' -f2)
build_hermesc_apple:
runs-on: macos-13
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: /tmp/hermes
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build HermesC Apple
uses: ./.github/actions/build-hermesc-apple
with:
hermes-version: ${{ needs.prepare_hermes_workspace.output.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.output.react-native-version }}
build_apple_slices_hermes:
runs-on: macos-14
needs: [build_hermesc_apple, prepare_hermes_workspace]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
IOS_DEPLOYMENT_TARGET: "15.1"
XROS_DEPLOYMENT_TARGET: "1.0"
MAC_DEPLOYMENT_TARGET: "10.15"
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
slice: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, catalyst, xros, xrsimulator]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Slice
uses: ./.github/actions/build-apple-slices-hermes
with:
flavor: ${{ matrix.flavor }}
slice: ${{ matrix.slice}}
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
echo "HERMES_VERSION=$hermes_version" >> $GITHUB_OUTPUT
echo "HERMES_V1_VERSION=$hermes_v1_version" >> $GITHUB_OUTPUT
- name: Print hermes versions
run: |
echo "HERMES_VERSION=${{ steps.set_hermes_versions.outputs.HERMES_VERSION }}"
echo "HERMES_V1_VERSION=${{ steps.set_hermes_versions.outputs.HERMES_V1_VERSION }}"
build_hermes_macos:
runs-on: macos-13
needs: [build_apple_slices_hermes, prepare_hermes_workspace]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
continue-on-error: true
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Hermes MacOS
uses: ./.github/actions/build-hermes-macos
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
flavor: ${{ matrix.flavor }}
prebuild_apple_dependencies:
uses: ./.github/workflows/prebuild-ios.yml
if: github.repository == 'facebook/react-native'
uses: ./.github/workflows/prebuild-ios-dependencies.yml
secrets: inherit
build_hermesc_linux:
runs-on: ubuntu-latest
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build HermesC Linux
uses: ./.github/actions/build-hermesc-linux
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
build_hermesc_windows:
runs-on: windows-2019
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build HermesC Windows
uses: ./.github/actions/build-hermesc-windows
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
build_android:
runs-on: 8-core-ubuntu
needs: [set_release_type]
container:
image: reactnativecommunity/react-native-android:latest
env:
TERM: "dumb"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Android
uses: ./.github/actions/build-android
with:
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
prebuild_react_native_core:
uses: ./.github/workflows/prebuild-ios-core.yml
secrets: inherit
needs: [prebuild_apple_dependencies]
build_npm_package:
runs-on: 8-core-ubuntu
needs:
[
set_release_type,
prepare_hermes_workspace,
build_hermes_macos,
build_hermesc_linux,
build_hermesc_windows,
build_android,
prebuild_apple_dependencies,
prebuild_react_native_core,
]
container:
image: reactnativecommunity/react-native-android:latest
@@ -175,7 +67,6 @@ jobs:
# By default we only build ARM64 to save time/resources. For release/nightlies, we override this value to build all archs.
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
env:
HERMES_WS_DIR: /tmp/hermes
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
@@ -191,7 +82,6 @@ jobs:
- name: Build and Publish NPM Package
uses: ./.github/actions/build-npm-package
with:
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
gha-npm-token: ${{ env.GHA_NPM_TOKEN }}
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
@@ -249,6 +139,9 @@ jobs:
secrets: inherit
create_draft_release:
needs: generate_changelog
needs: [generate_changelog, set_hermes_versions]
uses: ./.github/workflows/create-draft-release.yml
secrets: inherit
with:
hermesVersion: ${{ needs.set_hermes_versions.outputs.HERMES_VERSION }}
hermesV1Version: ${{ needs.set_hermes_versions.outputs.HERMES_V1_VERSION }}
+20
View File
@@ -0,0 +1,20 @@
name: Retry workflow
# Based on https://stackoverflow.com/a/78314483
on:
workflow_dispatch:
inputs:
run_id:
required: true
jobs:
rerun:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
steps:
- name: rerun ${{ inputs.run_id }}
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
gh run rerun ${{ inputs.run_id }} --failed
+2 -2
View File
@@ -14,8 +14,8 @@ jobs:
with:
repo-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
days-before-stale: 180
stale-issue-message: 'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
stale-pr-message: 'This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
stale-issue-message: 'This issue is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.'
stale-pr-message: 'This PR is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.'
close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.'
close-pr-message: 'This PR was closed because it has been stalled for 7 days with no activity.'
exempt-issue-labels: 'Help Wanted :octocat:, Good first issue, Never gets stale, Issue: Author Provided Repro'
+122 -257
View File
@@ -2,11 +2,6 @@ name: Test All
on:
workflow_dispatch:
inputs:
run-e2e-tests:
description: Whether to run E2E tests or not
type: boolean
default: false
pull_request:
push:
branches:
@@ -16,6 +11,7 @@ on:
jobs:
set_release_type:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
outputs:
RELEASE_TYPE: ${{ steps.set_release_type.outputs.RELEASE_TYPE }}
env:
@@ -37,96 +33,22 @@ jobs:
echo "Should I run E2E tests? ${{ inputs.run-e2e-tests }}"
prepare_hermes_workspace:
runs-on: ubuntu-latest
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
outputs:
react-native-version: ${{ steps.prepare-hermes-workspace.outputs.react-native-version }}
hermes-version: ${{ steps.prepare-hermes-workspace.outputs.hermes-version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare Hermes Workspace
id: prepare-hermes-workspace
uses: ./.github/actions/prepare-hermes-workspace
with:
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
hermes-version-file: ${{ env.HERMES_VERSION_FILE }}
build_hermesc_apple:
runs-on: macos-13
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: /tmp/hermes
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build HermesC Apple
uses: ./.github/actions/build-hermesc-apple
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
build_apple_slices_hermes:
runs-on: macos-14
needs: [build_hermesc_apple, prepare_hermes_workspace]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
IOS_DEPLOYMENT_TARGET: "15.1"
XROS_DEPLOYMENT_TARGET: "1.0"
MAC_DEPLOYMENT_TARGET: "10.15"
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
slice: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, catalyst, xros, xrsimulator]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Slice
uses: ./.github/actions/build-apple-slices-hermes
with:
flavor: ${{ matrix.flavor }}
slice: ${{ matrix.slice}}
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
build_hermes_macos:
runs-on: macos-13
needs: [build_apple_slices_hermes, prepare_hermes_workspace]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
continue-on-error: true
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Hermes MacOS
uses: ./.github/actions/build-hermes-macos
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
flavor: ${{ matrix.flavor }}
prebuild_apple_dependencies:
uses: ./.github/workflows/prebuild-ios.yml
if: github.repository == 'facebook/react-native'
uses: ./.github/workflows/prebuild-ios-dependencies.yml
secrets: inherit
prebuild_react_native_core:
uses: ./.github/workflows/prebuild-ios-core.yml
with:
use-hermes-nightly: ${{ !endsWith(github.ref_name, '-stable') }}
secrets: inherit
needs: [prebuild_apple_dependencies]
test_ios_rntester_ruby_3_2_0:
runs-on: macos-13
runs-on: macos-15
needs:
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
[prebuild_apple_dependencies, prebuild_react_native_core]
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -134,133 +56,81 @@ jobs:
uses: ./.github/actions/test-ios-rntester
with:
ruby-version: "3.2.0"
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
test_ios_rntester_dynamic_frameworks:
runs-on: macos-13
needs:
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
continue-on-error: true
strategy:
fail-fast: false
matrix:
jsengine: [Hermes, JSC]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run it
uses: ./.github/actions/test-ios-rntester
with:
jsengine: ${{ matrix.jsengine }}
use-frameworks: DynamicFrameworks
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
flavor: Debug
test_ios_rntester:
runs-on: macos-13-large
runs-on: macos-15-large
needs:
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
[prebuild_apple_dependencies, prebuild_react_native_core]
continue-on-error: true
strategy:
fail-fast: false
matrix:
jsengine: [Hermes, JSC]
architecture: [NewArch, OldArch]
flavor: [Debug, Release]
exclude: # We don't want to test the Old Arch in Release for E2E
- jsengine: Hermes
architecture: OldArch
flavor: Release
- jsengine: JSC
architecture: OldArch
flavor: Release
frameworks: [StaticLibraries, DynamicFrameworks]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run it
uses: ./.github/actions/test-ios-rntester
with:
jsengine: ${{ matrix.jsengine }}
architecture: ${{ matrix.architecture }}
run-unit-tests: "false"
use-frameworks: StaticLibraries
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
use-frameworks: ${{ matrix.frameworks }}
flavor: ${{ matrix.flavor }}
test_e2e_ios_rntester:
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
runs-on: macos-13-large
runs-on: macos-15-large
needs:
[test_ios_rntester]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
continue-on-error: true
strategy:
fail-fast: false
matrix:
jsengine: [Hermes, JSC]
architecture: [NewArch]
flavor: [Debug, Release]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Download App
uses: actions/download-artifact@v4
with:
name: RNTesterApp-${{ matrix.architecture }}-${{ matrix.jsengine }}-${{ matrix.flavor }}
name: RNTesterApp-NewArch-${{ matrix.flavor }}
path: /tmp/RNTesterBuild/RNTester.app
- name: Check downloaded folder content
run: ls -lR /tmp/RNTesterBuild
- name: Setup xcode
uses: ./.github/actions/setup-xcode
with:
platform: ios
- name: Run E2E Tests
uses: ./.github/actions/maestro-ios
with:
app-path: "/tmp/RNTesterBuild/RNTester.app"
app-id: com.meta.RNTester.localDevelopment
jsengine: ${{ matrix.jsengine }}
maestro-flow: ./packages/rn-tester/.maestro/
flavor: ${{ matrix.flavor }}
test_e2e_ios_templateapp:
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
runs-on: macos-13-large
runs-on: macos-15-large
needs: [build_npm_package, prebuild_apple_dependencies]
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
continue-on-error: true
strategy:
fail-fast: false
matrix:
jsengine: [Hermes, JSC]
flavor: [Debug, Release]
architecture: [OldArch, NewArch]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup xcode
uses: ./.github/actions/setup-xcode
with:
platform: ios
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn
uses: ./.github/actions/yarn-install
- name: Setup ruby
uses: ruby/setup-ruby@v1.170.0
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.10
- name: Download Hermes
uses: actions/download-artifact@v4
with:
name: hermes-darwin-bin-${{matrix.flavor}}
path: /tmp/react-native-tmp
- name: Download React Native Package
uses: actions/download-artifact@v4
with:
@@ -276,14 +146,24 @@ jobs:
- name: Print third-party folder
shell: bash
run: ls -lR /tmp/third-party
- name: Download React Native Prebuilds
uses: actions/download-artifact@v4
with:
name: ReactCore${{ matrix.flavor }}.xcframework.tar.gz
path: /tmp/ReactCore
- name: Print ReactCore folder
shell: bash
run: ls -lR /tmp/ReactCore
- name: Configure git
shell: bash
run: |
git config --global user.email "react-native-bot@meta.com"
git config --global user.name "React Native Bot"
- name: Prepare artifacts
run: |
REACT_NATIVE_PKG=$(find /tmp/react-native-tmp -type f -name "*.tgz")
echo "React Native tgs is $REACT_NATIVE_PKG"
HERMES_PATH=$(find /tmp/react-native-tmp -type f -name "*.tar.gz")
echo "Hermes path is $HERMES_PATH"
# For stable branches, we want to use the stable branch of the template
# In all the other cases, we want to use "main"
BRANCH=${{ github.ref_name }}
@@ -296,13 +176,11 @@ jobs:
cd /tmp/RNTestProject/ios
bundle install
NEW_ARCH_ENABLED=1
if [[ ${{ matrix.architecture }} == "OldArch" ]]; then
echo "Disable the New Architecture"
NEW_ARCH_ENABLED=0
fi
export RCT_USE_LOCAL_RN_DEP=/tmp/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
HERMES_ENGINE_TARBALL_PATH=$HERMES_PATH RCT_NEW_ARCH_ENABLED=$NEW_ARCH_ENABLED bundle exec pod install
# Disable prebuilds for now, as they are causing issues with E2E tests for 0.82-stable branch
# export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ matrix.flavor }}.xcframework.tar.gz"
RCT_NEW_ARCH_ENABLED=$NEW_ARCH_ENABLED bundle exec pod install
xcodebuild \
-scheme "RNTestProject" \
@@ -316,23 +194,17 @@ jobs:
with:
app-path: "/tmp/RNTestProject/Build/Products/${{ matrix.flavor }}-iphonesimulator/RNTestProject.app"
app-id: org.reactjs.native.example.RNTestProject
jsengine: ${{ matrix.jsengine }}
maestro-flow: ./scripts/e2e/.maestro/
flavor: ${{ matrix.flavor }}
working-directory: /tmp/RNTestProject
architecture: ${{ matrix.architecture }}
test_e2e_android_templateapp:
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
runs-on: 4-core-ubuntu
needs: build_npm_package
continue-on-error: true
strategy:
fail-fast: false
matrix:
jsengine: [Hermes, JSC]
flavor: [debug, release]
architecture: [OldArch, NewArch]
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -378,16 +250,6 @@ jobs:
cd /tmp/RNTestProject
echo "react.internal.mavenLocalRepo=$MAVEN_LOCAL" >> android/gradle.properties
if [[ ${{matrix.architecture}} == "OldArch" ]]; then
echo "Disabling the New Architecture"
sed -i 's/newArchEnabled=true/newArchEnabled=false/' android/gradle.properties
fi
if [[ ${{matrix.jsengine}} == "JSC" ]]; then
echo "Using JSC instead of Hermes"
sed -i 's/hermesEnabled=true/hermesEnabled=false/' android/gradle.properties
fi
# Build
cd android
CAPITALIZED_FLAVOR=$(echo "${{ matrix.flavor }}" | awk '{print toupper(substr($0, 1, 1)) substr($0, 2)}')
@@ -399,46 +261,29 @@ jobs:
with:
app-path: /tmp/RNTestProject/android/app/build/outputs/apk/${{ matrix.flavor }}/app-${{ matrix.flavor }}.apk
app-id: com.rntestproject
jsengine: ${{ matrix.jsengine }}
maestro-flow: ./scripts/e2e/.maestro/
install-java: 'false'
flavor: ${{ matrix.flavor }}
working-directory: /tmp/RNTestProject
architecture: ${{ matrix.architecture }}
build_hermesc_linux:
runs-on: ubuntu-latest
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
run_fantom_tests:
runs-on: 8-core-ubuntu
needs: [set_release_type]
container:
image: reactnativecommunity/react-native-android:latest
env:
TERM: "dumb"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build HermesC Linux
uses: ./.github/actions/build-hermesc-linux
- name: Build and Test Fantom
uses: ./.github/actions/run-fantom-tests
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
build_hermesc_windows:
runs-on: windows-2019
needs: prepare_hermes_workspace
env:
HERMES_WS_DIR: 'D:\tmp\hermes'
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
CMAKE_DIR: 'C:\Program Files\CMake\bin'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build HermesC Windows
uses: ./.github/actions/build-hermesc-windows
with:
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
build_android:
runs-on: 8-core-ubuntu
@@ -457,17 +302,14 @@ jobs:
uses: ./.github/actions/build-android
with:
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
run-e2e-tests: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
test_e2e_android_rntester:
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
runs-on: 4-core-ubuntu
needs: [build_android]
strategy:
fail-fast: false
matrix:
jsengine: [hermes, jsc]
flavor: [debug, release]
steps:
- name: Checkout
@@ -479,17 +321,16 @@ jobs:
- name: Download APK
uses: actions/download-artifact@v4
with:
name: rntester-${{ matrix.jsengine }}-${{ matrix.flavor }}
path: ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.jsengine }}/${{ matrix.flavor }}/
name: rntester-${{ matrix.flavor }}
path: ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.flavor }}/
- name: Print folder structure
run: ls -lR ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.jsengine }}/${{ matrix.flavor }}/
run: ls -lR ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.flavor }}/
- name: Run E2E Tests
uses: ./.github/actions/maestro-android
timeout-minutes: 60
with:
app-path: ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.jsengine }}/${{ matrix.flavor }}/app-${{ matrix.jsengine }}-x86-${{ matrix.flavor }}.apk
app-path: ./packages/rn-tester/android/app/build/outputs/apk/${{ matrix.flavor }}/app-x86-${{ matrix.flavor }}.apk
app-id: com.facebook.react.uiapp
jsengine: ${{ matrix.jsengine }}
maestro-flow: ./packages/rn-tester/.maestro
flavor: ${{ matrix.flavor }}
@@ -498,27 +339,21 @@ jobs:
needs:
[
set_release_type,
prepare_hermes_workspace,
build_hermes_macos,
build_hermesc_linux,
build_hermesc_windows,
build_android,
prebuild_apple_dependencies,
prebuild_react_native_core,
]
container:
image: reactnativecommunity/react-native-android:latest
env:
TERM: "dumb"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
env:
HERMES_WS_DIR: /tmp/hermes
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build NPM Package
uses: ./.github/actions/build-npm-package
with:
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
@@ -540,8 +375,6 @@ jobs:
fail-fast: false
matrix:
flavor: [Debug, Release]
architecture: [NewArch, OldArch]
jsengine: [Hermes, JSC]
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -563,20 +396,20 @@ jobs:
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Set nightly Hermes versions
shell: bash
run: |
node ./scripts/releases/use-hermes-nightly.js
- name: Run yarn install again, with the correct hermes version
uses: ./.github/actions/yarn-install
- name: Prepare the Helloworld application
shell: bash
run: node ./scripts/e2e/init-project-e2e.js --useHelloWorld --pathToLocalReactNative "$GITHUB_WORKSPACE/build/$(cat build/react-native-package-version)"
- name: Build the Helloworld application for ${{ matrix.flavor }} with Architecture set to ${{ matrix.architecture }}, and using the ${{ matrix.jsengine }} JS engine.
- name: Build the Helloworld application for ${{ matrix.flavor }} with Architecture set to New Architecture.
shell: bash
run: |
cd packages/helloworld/android
cd private/helloworld/android
args=()
if [[ ${{ matrix.architecture }} == "OldArch" ]]; then
args+=(--arch old)
fi
if [[ ${{ matrix.jsengine }} == "JSC" ]]; then
args+=(--jsvm jsc)
fi
if [[ ${{ matrix.flavor }} == "Release" ]]; then
args+=(--prod)
fi
@@ -584,16 +417,15 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v4.3.4
with:
name: helloworld-apk-${{ matrix.flavor }}-${{ matrix.architecture }}-${{ matrix.jsengine }}
path: ./packages/helloworld/android/app/build/outputs/apk/
name: helloworld-apk-${{ matrix.flavor }}-NewArch-hermes
path: ./private/helloworld/android/app/build/outputs/apk/
compression-level: 0
test_ios_helloworld_with_ruby_3_2_0:
runs-on: macos-13
needs: [prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
runs-on: macos-15
needs: [prebuild_apple_dependencies, prebuild_react_native_core]
env:
PROJECT_NAME: iOSTemplateProject
HERMES_WS_DIR: /tmp/hermes
YARN_ENABLE_IMMUTABLE_INSTALLS: false
steps:
- name: Checkout
@@ -601,27 +433,21 @@ jobs:
- uses: ./.github/actions/test-ios-helloworld
with:
ruby-version: 3.2.0
architecture: NewArch
flavor: Debug
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
test_ios_helloworld:
runs-on: macos-13
needs: [prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
runs-on: macos-15
needs: [prebuild_apple_dependencies, prebuild_react_native_core]
strategy:
matrix:
flavor: [Debug, Release]
jsengine: [Hermes, JSC]
use_frameworks: [StaticLibraries, DynamicFrameworks]
exclude:
# This config is tested with Ruby 3.2.0. Let's not double test it.
- flavor: Debug
jsengine: Hermes
use_frameworks: StaticLibraries
env:
PROJECT_NAME: iOSTemplateProject
HERMES_WS_DIR: /tmp/hermes
YARN_ENABLE_IMMUTABLE_INSTALLS: false
steps:
- name: Checkout
@@ -629,17 +455,15 @@ jobs:
- uses: ./.github/actions/test-ios-helloworld
with:
flavor: ${{ matrix.flavor }}
jsengine: ${{ matrix.jsengine }}
use-frameworks: ${{ matrix.use_frameworks }}
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
test_js:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
strategy:
fail-fast: false
matrix:
node-version: ["22", "20", "18"]
node-version: ["24.4.1", "22", "20.19.4"]
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -650,12 +474,53 @@ jobs:
lint:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run all the Linters
- name: Run all the linters
uses: ./.github/actions/lint
with:
github-token: ${{ env.GH_TOKEN }}
# This job should help with the E2E flakyness.
# In case E2E tests fails, it launches a new retry-workflow workflow, passing the current run_id as input.
# The retry-workflow reruns only the failed jobs of the current test-all workflow using
# ```
# gh run rerun ${{ inputs.run_id }} --failed
# ```
# From https://stackoverflow.com/a/78314483 it seems like that adding the extra workflow
# rather then calling directly this command should improve stability of this solution.
# This is exactly the same as rerunning failed tests from the GH UI, but automated.
rerun-failed-jobs:
runs-on: ubuntu-latest
needs: [test_e2e_ios_rntester, test_e2e_android_rntester, test_e2e_ios_templateapp, test_e2e_android_templateapp]
if: ${{ github.ref == 'refs/heads/main' && always() }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Rerun failed jobs in the current workflow
env:
GH_TOKEN: ${{ github.token }}
run: |
SHOULD_RETRY=${{fromJSON(github.run_attempt) < 3}}
if [[ $SHOULD_RETRY == "false" ]]; then
exit 0
fi
RNTESTER_ANDROID_FAILED=${{ needs.test_e2e_android_rntester.result == 'failure' }}
TEMPLATE_ANDROID_FAILED=${{ needs.test_e2e_android_templateapp.result == 'failure' }}
RNTESTER_IOS_FAILED=${{ needs.test_e2e_ios_rntester.result == 'failure' }}
TEMPLATE_IOS_FAILED=${{ needs.test_e2e_ios_templateapp.result == 'failure' }}
echo "RNTESTER_ANDROID_FAILED: $RNTESTER_ANDROID_FAILED"
echo "TEMPLATE_ANDROID_FAILED: $TEMPLATE_ANDROID_FAILED"
echo "RNTESTER_IOS_FAILED: $RNTESTER_IOS_FAILED"
echo "TEMPLATE_IOS_FAILED: $TEMPLATE_IOS_FAILED"
if [[ $RNTESTER_ANDROID_FAILED == "true" || $TEMPLATE_ANDROID_FAILED == "true" || $RNTESTER_IOS_FAILED == "true" || $TEMPLATE_IOS_FAILED == "true" ]]; then
echo "Rerunning failed jobs in the current workflow"
gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }}
fi
@@ -1,96 +0,0 @@
name: Test Libraries on Nightlies
on:
workflow_call:
# We use the matrix.library entry to specify the dependency we want to use
# The key is used directly as the <pkg> in the `yarn add <pkg>` command.
jobs:
runner-setup:
runs-on: ubuntu-latest
outputs:
runners: '{"ios":"macos-13-large", "android": "ubuntu-latest"}'
steps:
- run: echo no-op
test-library-on-nightly:
name: "[${{ matrix.platform }}] ${{ matrix.library }}"
needs: runner-setup
runs-on: ${{ fromJSON(needs.runner-setup.outputs.runners)[matrix.platform] }}
continue-on-error: true
strategy:
matrix:
library: [
"react-native-async-storage",
"react-native-blob-util",
"@react-native-clipboard/clipboard",
"@react-native-community/datetimepicker",
"react-native-gesture-handler",
"react-native-image-picker",
"react-native-linear-gradient",
"@react-native-masked-view/masked-view",
"react-native-maps",
"@react-native-community/netinfo",
"react-native-reanimated@nightly react-native-worklets@nightly", #reanimated requires worklet to be explicitly installed as a separate package
"react-native-svg",
"react-native-video",
"react-native-webview",
"react-native-mmkv",
"react-native-screens",
"react-native-pager-view",
"@react-native-community/slider",
#additional OSS libs used internally
"scandit-react-native-datacapture-barcode scandit-react-native-datacapture-core",
"react-native-contacts",
"react-native-device-info",
"react-native-email-link",
"react-native-exit-app",
"@dr.pogodin/react-native-fs",
"react-native-permissions",
"react-native-vector-icons",
"react-native-masked-view",
"@react-native-community/image-editor",
]
platform: [ios, android]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test ${{ matrix.library }}
id: run-test
uses: ./.github/actions/test-library-on-nightly
with:
library-npm-package: ${{ matrix.library }}
platform: ${{ matrix.platform}}
- name: Save outcome
id: save-outcome
if: always()
run: |
LIB_FOLDER=$(echo "${{matrix.library}}" | tr ' ' '_' | tr '/' '_')
echo "${{matrix.library}}: ${{steps.run-test.outcome}}" > "/tmp/$LIB_FOLDER-${{ matrix.platform }}-outcome"
echo "lib_folder=$LIB_FOLDER" >> $GITHUB_OUTPUT
- name: Upload Artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ steps.save-outcome.outputs.lib_folder }}-${{ matrix.platform }}-outcome
path: /tmp/${{ steps.save-outcome.outputs.lib_folder }}-${{ matrix.platform }}-outcome
collect-results:
runs-on: ubuntu-latest
needs: [test-library-on-nightly]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore outcomes
uses: actions/download-artifact@v4
with:
pattern: '*-outcome'
path: /tmp
- name: Collect failures
uses: actions/github-script@v6
with:
script: |
const {collectResults} = require('./.github/workflow-scripts/collectNightlyOutcomes.js');
collectResults();
@@ -0,0 +1,49 @@
name: Validate DotSlash Artifacts
on:
workflow_dispatch:
release:
types: [published]
push:
branches:
- main
paths:
- packages/debugger-shell/bin/react-native-devtools
- "scripts/releases/**"
- package.json
- yarn.lock
pull_request:
branches:
- main
paths:
- packages/debugger-shell/bin/react-native-devtools
- "scripts/releases/**"
- package.json
- yarn.lock
# Same time as the nightly build: 2:15 AM UTC
schedule:
- cron: "15 2 * * *"
jobs:
validate-dotslash-artifacts:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Install dependencies
uses: ./.github/actions/yarn-install
- name: Configure Git
shell: bash
run: |
git config --local user.email "bot@reactnative.dev"
git config --local user.name "React Native Bot"
- name: Validate DotSlash artifacts
uses: actions/github-script@v6
with:
script: |
const {validateDotSlashArtifacts} = require('./scripts/releases/validate-dotslash-artifacts.js');
await validateDotSlashArtifacts();
+25 -11
View File
@@ -30,6 +30,7 @@ project.xcworkspace
/packages/rn-tester/android/app/gradle/
/packages/rn-tester/android/app/gradlew
/packages/rn-tester/android/app/gradlew.bat
/packages/react-native/build/
/packages/react-native/ReactAndroid/build/
/packages/react-native/ReactAndroid/.cxx/
/packages/react-native/ReactAndroid/gradle/
@@ -39,10 +40,9 @@ project.xcworkspace
/packages/react-native/ReactAndroid/external-artifacts/artifacts/
/packages/react-native/ReactAndroid/hermes-engine/build/
/packages/react-native/ReactAndroid/hermes-engine/.cxx/
/packages/helloworld/android/app/build/
/packages/helloworld/android/build/
/private/helloworld/android/app/build/
/private/helloworld/android/build/
/packages/react-native-popup-menu-android/android/build/
/packages/react-native-test-library/android/build/
# Buck
.buckd
@@ -107,33 +107,43 @@ package-lock.json
# Ruby Gems (Bundler)
/packages/react-native/vendor
/packages/helloworld/vendor
/private/helloworld/vendor
.ruby-version
/**/.ruby-version
vendor/
# iOS / CocoaPods
/packages/helloworld/ios/build/
/packages/helloworld/ios/Pods/
/packages/helloworld/ios/Podfile.lock
/private/helloworld/ios/build/
/private/helloworld/ios/Pods/
/private/helloworld/ios/Podfile.lock
/packages/rn-tester/bin/
/packages/rn-tester/cache/
/packages/rn-tester/extensions/
/packages/rn-tester/gems/
/packages/rn-tester/specifications/
/packages/rn-tester/Gemfile.lock
/packages/**/RCTLegacyInteropComponents.mm
/packages/sourcemap.ios.map
# Ignore RNTester specific Pods, but keep the __offline_mirrors__ here.
/packages/rn-tester/Pods/*
!/packages/rn-tester/Pods/__offline_mirrors_hermes__
!/packages/rn-tester/Pods/__offline_mirrors_jsc__
# Swift Package build folder
/packages/react-native/.build
/packages/react-native/.swiftpm
/packages/react-native/React/includes/
# @react-native/codegen
/packages/react-native/React/FBReactNativeSpec/
/packages/react-native-codegen/lib
/packages/react-native-codegen/tmp/
/packages/react-native/ReactCommon/react/renderer/components/rncore/
/packages/rn-tester/NativeModuleExample/ScreenshotManagerSpec*
/**/RCTThirdPartyFabricComponentsProvider.*
# @react-native/codegen-typescript-test
/packages/react-native-codegen-typescript-test/lib
/private/react-native-codegen-typescript-test/lib
# Additional SDKs
/packages/react-native/sdks/download
@@ -160,8 +170,12 @@ fix_*.patch
.metro-health-check*
# Jest Integration
/packages/react-native-fantom/build/
/packages/react-native-fantom/tester/build/
/private/react-native-fantom/build/
/private/react-native-fantom/.out/
/private/react-native-fantom/tester/build/
# [Experimental] Generated TS type definitions
/packages/**/types_generated/
/packages/debugger-shell/build/
/packages/*/dist/
-36
View File
@@ -1,36 +0,0 @@
{
"arrowParens": "avoid",
"bracketSameLine": true,
"bracketSpacing": false,
"requirePragma": true,
"singleQuote": true,
"trailingComma": "all",
"endOfLine": "lf",
"overrides": [
{
"files": ["*.code-workspace"],
"options": {
"parser": "json"
}
},
{
"files": [
"*.js",
"*.js.flow"
],
"options": {
"parser": "hermes"
}
},
{
"files": [
"**/__docs__/*.md"
],
"options": {
"parser": "markdown",
"proseWrap": "always",
"requirePragma": false
}
}
]
}
+46
View File
@@ -0,0 +1,46 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
let plugins = ['prettier-plugin-hermes-parser'];
try {
plugins = require('./.prettier-plugins.fb.js');
} catch {}
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
requirePragma: true,
singleQuote: true,
trailingComma: 'all',
endOfLine: 'lf',
plugins,
overrides: [
{
files: ['*.code-workspace'],
options: {
parser: 'json',
},
},
{
files: ['*.js', '*.js.flow'],
options: {
parser: 'hermes',
},
},
{
files: ['**/__docs__/*.md'],
options: {
parser: 'markdown',
proseWrap: 'always',
requirePragma: false,
},
},
],
};
+4964
View File
File diff suppressed because it is too large Load Diff
+1313 -4502
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -28,7 +28,7 @@ Examples of contributing to the release include being a [community releaser](htt
### Current partners:
* **[Coinbase](https://www.coinbase.com/):** Publishes [posts](https://blog.coinbase.com/tagged/react-native) advocating React Native usage. Supports `@react-native-community/datetimepicker` and other community modules to migrate to the new architecture. Supports releases in testing and feedback.
* **[Callstack](https://callstack.com/):** Maintains the [React Native CLI](https://github.com/react-native-community/react-native-cli) and [other community libraries](https://github.com/callstack), organizes [React Native EU](https://react-native.eu/) and hosts [The React Native Show podcast](https://www.callstack.com/podcast-react-native-show)
* **[Callstack](https://callstack.com/):** Maintains [React Native Community CLI](https://github.com/react-native-community/cli), develops [RNEF](https://rnef.dev), [Re.Pack](https://re-pack.dev) and [other community libraries](https://github.com/callstack). Hosts [React Universe Conf](https://www.reactuniverseconf.com/) and [React Universe On Air](https://www.callstack.com/podcast).
* **[Expo](https://expo.dev/):** Builds [Expo Go and SDK](https://github.com/expo/expo), [Snack](https://snack.expo.dev/), and [Expo Application Services](https://expo.dev/eas). Maintains [React Native Directory](https://reactnative.directory/), stewards [React Navigation](https://reactnavigation.org/) along with other partners.
* **[Infinite Red](https://infinite.red/):** Maintains the [ignite cli/boilerplate](https://github.com/infinitered/ignite), organizes [Chain React Conf](https://cr.infinite.red/), hosts the [React Native Radio podcast](https://reactnativeradio.com), publishes the [React Native Newsletter](https://reactnativenewsletter.com)
* **[Meta](https://opensource.fb.com/):** Oversees the React Native product and maintains the [React Native core repo](https://reactnative.dev/)
+5 -5
View File
@@ -17,10 +17,13 @@
<img src="https://img.shields.io/npm/v/react-native?color=brightgreen&label=npm%20package" alt="Current npm package version." />
</a>
<a href="https://reactnative.dev/docs/contributing">
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" />
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs are welcome!" />
</a>
<a href="https://twitter.com/intent/follow?screen_name=reactnative">
<img src="https://img.shields.io/twitter/follow/reactnative.svg?label=Follow%20@reactnative" alt="Follow @reactnative" />
<img src="https://img.shields.io/twitter/follow/reactnative.svg?label=Follow%20@reactnative" alt="Follow @reactnative on X" />
</a>
<a href="https://bsky.app/profile/reactnative.dev">
<img src="https://img.shields.io/badge/Bluesky-0285FF?logo=bluesky&logoColor=fff" alt="Follow @reactnative.dev on Bluesky" />
</a>
</p>
@@ -138,7 +141,4 @@ Larger discussions and proposals are discussed in [**@react-native-community/dis
React Native is MIT licensed, as found in the [LICENSE][l] file.
React Native documentation is Creative Commons licensed, as found in the [LICENSE-docs][ld] file.
[l]: https://github.com/facebook/react-native/blob/main/LICENSE
[ld]: https://github.com/facebook/react-native/blob/main/LICENSE-docs
+3 -1
View File
@@ -45,6 +45,8 @@ TODO: Explain the different components of React Native at a high level.
- UI / Fabric
- Events
- Shadow Tree Lifecycle
- [Runtime Shadow Node Reference Update](../packages/react-native/ReactCommon/react/renderer/core/__docs__/RSNRU.md)
- [passChildrenWhenCloningPersistedNodes](../packages/react-native/ReactCommon/react/renderer/core/__docs__/passChildrenWhenCloning.md)
- Layout
- Mounting
- Native Modules / TurboModules
@@ -88,7 +90,7 @@ TODO: Explain the different components of React Native at a high level.
- Jest
- ESLint
- Integration / E2E
- [Fantom](../packages/react-native-fantom/__docs__/README.md)
- [Fantom](../private/react-native-fantom/__docs__/README.md)
- Tooling
- React Native DevTools
+63 -14
View File
@@ -13,6 +13,7 @@ plugins {
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.binary.compatibility.validator) apply true
alias(libs.plugins.android.test) apply false
alias(libs.plugins.ktfmt) apply true
}
val reactAndroidProperties = java.util.Properties()
@@ -25,10 +26,12 @@ fun getListReactAndroidProperty(name: String) = reactAndroidProperties.getProper
apiValidation {
ignoredPackages.addAll(
getListReactAndroidProperty("binaryCompatibilityValidator.ignoredPackages"))
getListReactAndroidProperty("binaryCompatibilityValidator.ignoredPackages")
)
ignoredClasses.addAll(getListReactAndroidProperty("binaryCompatibilityValidator.ignoredClasses"))
nonPublicMarkers.addAll(
getListReactAndroidProperty("binaryCompatibilityValidator.nonPublicMarkers"))
getListReactAndroidProperty("binaryCompatibilityValidator.nonPublicMarkers")
)
validationDisabled =
reactAndroidProperties
.getProperty("binaryCompatibilityValidator.validationDisabled")
@@ -36,8 +39,9 @@ apiValidation {
}
version =
if (project.hasProperty("isSnapshot") &&
(project.property("isSnapshot") as? String).toBoolean()) {
if (
project.hasProperty("isSnapshot") && (project.property("isSnapshot") as? String).toBoolean()
) {
"${reactAndroidProperties.getProperty("VERSION_NAME")}-SNAPSHOT"
} else {
reactAndroidProperties.getProperty("VERSION_NAME")
@@ -55,6 +59,8 @@ nexusPublishing {
sonatype {
username.set(sonatypeUsername)
password.set(sonatypePassword)
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
}
}
}
@@ -63,8 +69,10 @@ tasks.register("clean", Delete::class.java) {
description = "Remove all the build files and intermediate build outputs"
dependsOn(gradle.includedBuild("gradle-plugin").task(":clean"))
subprojects.forEach {
if (it.project.plugins.hasPlugin("com.android.library") ||
it.project.plugins.hasPlugin("com.android.application")) {
if (
it.project.plugins.hasPlugin("com.android.library") ||
it.project.plugins.hasPlugin("com.android.application")
) {
dependsOn(it.tasks.named("clean"))
}
}
@@ -74,10 +82,13 @@ tasks.register("clean", Delete::class.java) {
delete(rootProject.file("./packages/react-native/sdks/download/"))
delete(rootProject.file("./packages/react-native/sdks/hermes/"))
delete(
rootProject.file("./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/arm64-v8a/"))
rootProject.file("./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/arm64-v8a/")
)
delete(
rootProject.file(
"./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/armeabi-v7a/"))
"./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/armeabi-v7a/"
)
)
delete(rootProject.file("./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/x86/"))
delete(rootProject.file("./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/x86_64/"))
delete(rootProject.file("./packages/react-native-codegen/lib"))
@@ -93,9 +104,6 @@ tasks.register("build") {
tasks.register("publishAllToMavenTempLocal") {
description = "Publish all the artifacts to be available inside a Maven Local repository on /tmp."
dependsOn(":packages:react-native:ReactAndroid:publishAllPublicationsToMavenTempLocalRepository")
// We don't publish the external-artifacts to Maven Local as ci is using it via workspace.
dependsOn(
":packages:react-native:ReactAndroid:hermes-engine:publishAllPublicationsToMavenTempLocalRepository")
}
tasks.register("publishAndroidToSonatype") {
@@ -116,15 +124,56 @@ if (project.findProperty("react.internal.useHermesNightly")?.toString()?.toBoole
That's fine for local development, but you should not commit this change.
********************************************************************************
"""
.trimIndent())
"""
.trimIndent()
)
allprojects {
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(project(":packages:react-native:ReactAndroid:hermes-engine"))
.using(module("com.facebook.react:hermes-android:0.0.0-+"))
.using(module("com.facebook.hermes:hermes-android:0.+"))
.because("Users opted to use hermes from nightly")
}
}
}
}
ktfmt {
blockIndent.set(2)
continuationIndent.set(4)
maxWidth.set(100)
removeUnusedImports.set(false)
manageTrailingCommas.set(false)
}
// Configure ktfmt tasks to include gradle-plugin
listOf("ktfmtCheck", "ktfmtFormat").forEach { taskName ->
tasks.named(taskName) { dependsOn(gradle.includedBuild("gradle-plugin").task(":$taskName")) }
}
allprojects {
// Apply exclusions for specific files that should not be formatted
val excludePatterns =
listOf(
"**/build/**",
"**/hermes-engine/**",
"**/internal/featureflags/**",
"**/systeminfo/ReactNativeVersion.kt",
)
listOf(
com.ncorti.ktfmt.gradle.tasks.KtfmtCheckTask::class,
com.ncorti.ktfmt.gradle.tasks.KtfmtFormatTask::class,
)
.forEach { tasks.withType(it) { exclude(excludePatterns) } }
// Disable the problematic ktfmt script tasks due to symbolic link issues in subprojects
afterEvaluate {
listOf("ktfmtCheckScripts", "ktfmtFormatScripts").forEach {
tasks.findByName(it)?.enabled = false
}
}
}
// We intentionally disable the `ktfmtCheck` tasks as the formatting is primarly handled inside
// fbsource
allprojects { tasks.withType<com.ncorti.ktfmt.gradle.tasks.KtfmtCheckTask>() { enabled = false } }
+87 -17
View File
@@ -4,8 +4,8 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
* @oncall flow
*/
// Adapted from https://github.com/flow-typed/flow-typed/blob/main/definitions/environments/node/flow_v0.261.x-/node.js
@@ -3057,30 +3057,30 @@ type util$InspectOptions = {
};
declare type util$ParseArgsOption =
| {|
| $ReadOnly<{|
type: 'boolean',
multiple?: false,
short?: string,
default?: boolean,
|}
| {|
|}>
| $ReadOnly<{|
type: 'boolean',
multiple: true,
short?: string,
default?: Array<boolean>,
|}
| {|
|}>
| $ReadOnly<{|
type: 'string',
multiple?: false,
short?: string,
default?: string,
|}
| {|
|}>
| $ReadOnly<{|
type: 'string',
multiple: true,
short?: string,
default?: Array<string>,
|};
|}>;
type util$ParseArgsOptionToValue<TOption> = TOption['type'] extends 'boolean'
? TOption['multiple'] extends true
@@ -3137,7 +3137,7 @@ declare module 'util' {
declare function stripVTControlCharacters(str: string): string;
declare function parseArgs<
TOptions: {[string]: util$ParseArgsOption} = {||},
TOptions: {+[string]: util$ParseArgsOption} = {||},
>(config: {|
args?: Array<string>,
options?: TOptions,
@@ -3229,6 +3229,73 @@ declare module 'util' {
isWebAssemblyCompiledModule: (value: mixed) => boolean,
...
};
declare type BackgroundColors =
| 'bgBlack'
| 'bgBlackBright'
| 'bgBlue'
| 'bgBlueBright'
| 'bgCyan'
| 'bgCyanBright'
| 'bgGray'
| 'bgGreen'
| 'bgGreenBright'
| 'bgGrey'
| 'bgMagenta'
| 'bgMagentaBright'
| 'bgRed'
| 'bgRedBright'
| 'bgWhite'
| 'bgWhiteBright'
| 'bgYellow'
| 'bgYellowBright';
declare type ForegroundColors =
| 'black'
| 'blackBright'
| 'blue'
| 'blueBright'
| 'cyan'
| 'cyanBright'
| 'gray'
| 'green'
| 'greenBright'
| 'grey'
| 'magenta'
| 'magentaBright'
| 'red'
| 'redBright'
| 'white'
| 'whiteBright'
| 'yellow'
| 'yellowBright';
declare type Modifiers =
| 'blink'
| 'bold'
| 'dim'
| 'doubleunderline'
| 'framed'
| 'hidden'
| 'inverse'
| 'italic'
| 'overlined'
| 'reset'
| 'strikethrough'
| 'underline';
declare function styleText(
format:
| ForegroundColors
| BackgroundColors
| Modifiers
| $ReadOnlyArray<ForegroundColors | BackgroundColors | Modifiers>,
text: string,
options?: $ReadOnly<{
stream?: ?stream$Stream,
validStream?: ?boolean,
}>,
): string;
}
type vm$ScriptOptions = {
@@ -3928,13 +3995,16 @@ declare class Process extends events$EventEmitter {
initgroups?: (user: number | string, extra_group: number | string) => void;
kill(pid: number, signal?: string | number): void;
mainModule: Object;
memoryUsage(): {
arrayBuffers: number,
rss: number,
heapTotal: number,
heapUsed: number,
external: number,
...
memoryUsage: {
(): {
arrayBuffers: number,
rss: number,
heapTotal: number,
heapUsed: number,
external: number,
...
},
rss: () => number,
};
nextTick: <T>(cb: (...T) => mixed, ...T) => void;
pid: number;
+46
View File
@@ -0,0 +1,46 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
declare module '@expo/spawn-async' {
type SpawnOptions = {
cwd?: string,
env?: Object,
argv0?: string,
stdio?: string | Array<any>,
detached?: boolean,
uid?: number,
gid?: number,
shell?: boolean | string,
windowsVerbatimArguments?: boolean,
windowsHide?: boolean,
encoding?: string,
ignoreStdio?: boolean,
};
declare class SpawnPromise<T> extends Promise<T> {
child: child_process$ChildProcess;
}
type SpawnResult = {
pid?: number,
output: string[],
stdout: string,
stderr: string,
status: number | null,
signal: string | null,
};
declare function spawnAsync(
command: string,
args?: $ReadOnlyArray<string>,
options?: SpawnOptions,
): SpawnPromise<SpawnResult>;
declare module.exports: typeof spawnAsync;
}
+61
View File
@@ -0,0 +1,61 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
// Partial types for Octokit based on the usage in react-native-github
declare module '@octokit/rest' {
declare class Octokit {
constructor(options?: {auth?: string, ...}): this;
repos: $ReadOnly<{
listReleaseAssets: (
params: $ReadOnly<{
owner: string,
repo: string,
release_id: string,
}>,
) => Promise<{
data: Array<{
id: string,
name: string,
...
}>,
...
}>,
uploadReleaseAsset: (
params: $ReadOnly<{
owner: string,
repo: string,
release_id: string,
name: string,
data: Buffer,
headers: $ReadOnly<{
'content-type': string,
...
}>,
...
}>,
) => Promise<{
data: {
browser_download_url: string,
...
},
...
}>,
deleteReleaseAsset: (params: {
owner: string,
repo: string,
asset_id: string,
...
}) => Promise<mixed>,
}>;
}
declare export {Octokit};
}
@@ -6,7 +6,6 @@
*
* @flow strict
* @format
* @oncall react_native
*/
declare module '@react-native-community/cli-server-api' {
@@ -6,7 +6,6 @@
*
* @flow
* @format
* @oncall react_native
*/
declare module '@react-native-community/cli-types' {
@@ -8,6 +8,6 @@
* @format
*/
declare module '@tsconfig/node18/tsconfig.json' {
declare module '@tsconfig/node22/tsconfig.json' {
declare module.exports: any;
}
-1
View File
@@ -6,7 +6,6 @@
*
* @flow strict-local
* @format
* @oncall react_native
*/
declare module 'actual-request-url' {
-1
View File
@@ -6,7 +6,6 @@
*
* @flow
* @format
* @oncall react_native
*/
// The sections between BEGIN GENERATED and END GENERATED are generated
-231
View File
@@ -1,231 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
* @oncall react_native
*/
// flow-typed signature: 79cfa6bcaa67fdb60f10d320da0470fc
// flow-typed version: 6cecea2e51/chalk_v4.x.x/flow_>=v0.104.x
// From: https://github.com/chalk/chalk/blob/master/index.d.ts
declare module 'chalk' {
declare type ForegroundColor =
| 'black'
| 'red'
| 'green'
| 'yellow'
| 'blue'
| 'magenta'
| 'cyan'
| 'white'
| 'gray'
| 'grey'
| 'blackBright'
| 'redBright'
| 'greenBright'
| 'yellowBright'
| 'blueBright'
| 'magentaBright'
| 'cyanBright'
| 'whiteBright';
declare type BackgroundColor =
| 'bgBlack'
| 'bgRed'
| 'bgGreen'
| 'bgYellow'
| 'bgBlue'
| 'bgMagenta'
| 'bgCyan'
| 'bgWhite'
| 'bgGray'
| 'bgGrey'
| 'bgBlackBright'
| 'bgRedBright'
| 'bgGreenBright'
| 'bgYellowBright'
| 'bgBlueBright'
| 'bgMagentaBright'
| 'bgCyanBright'
| 'bgWhiteBright';
declare type Color = ForegroundColor | BackgroundColor;
declare type Modifiers =
| 'reset'
| 'bold'
| 'dim'
| 'italic'
| 'underline'
| 'inverse'
| 'hidden'
| 'strikethrough'
| 'visible';
declare type TemplateStringsArray = $ReadOnlyArray<string>;
declare type Level = $Values<{
None: 0,
Basic: 1,
Ansi256: 2,
TrueColor: 3,
...
}>;
declare type ChalkOptions = {|
level?: Level,
|};
declare type ColorSupport = {|
level: Level,
hasBasic: boolean,
has256: boolean,
has16m: boolean,
|};
declare class Instance implements Chalk {
constructor(options?: ChalkOptions): this;
(...text: string[]): string;
(text: TemplateStringsArray, ...placeholders: string[]): string;
Instance: typeof Instance;
level: Level;
rgb(r: number, g: number, b: number): Chalk;
hsl(h: number, s: number, l: number): Chalk;
hsv(h: number, s: number, v: number): Chalk;
hwb(h: number, w: number, b: number): Chalk;
bgHex(color: string): Chalk;
bgKeyword(color: string): Chalk;
bgRgb(r: number, g: number, b: number): Chalk;
bgHsl(h: number, s: number, l: number): Chalk;
bgHsv(h: number, s: number, v: number): Chalk;
bgHwb(h: number, w: number, b: number): Chalk;
hex(color: string): Chalk;
keyword(color: string): Chalk;
+reset: Chalk;
+bold: Chalk;
+dim: Chalk;
+italic: Chalk;
+underline: Chalk;
+inverse: Chalk;
+hidden: Chalk;
+strikethrough: Chalk;
+visible: Chalk;
+black: Chalk;
+red: Chalk;
+green: Chalk;
+yellow: Chalk;
+blue: Chalk;
+magenta: Chalk;
+cyan: Chalk;
+white: Chalk;
+gray: Chalk;
+grey: Chalk;
+blackBright: Chalk;
+redBright: Chalk;
+greenBright: Chalk;
+yellowBright: Chalk;
+blueBright: Chalk;
+magentaBright: Chalk;
+cyanBright: Chalk;
+whiteBright: Chalk;
+bgBlack: Chalk;
+bgRed: Chalk;
+bgGreen: Chalk;
+bgYellow: Chalk;
+bgBlue: Chalk;
+bgMagenta: Chalk;
+bgCyan: Chalk;
+bgWhite: Chalk;
+bgBlackBright: Chalk;
+bgRedBright: Chalk;
+bgGreenBright: Chalk;
+bgYellowBright: Chalk;
+bgBlueBright: Chalk;
+bgMagentaBright: Chalk;
+bgCyanBright: Chalk;
+bgWhiteBright: Chalk;
supportsColor: ColorSupport;
}
declare interface Chalk {
(...text: string[]): string;
(text: TemplateStringsArray, ...placeholders: string[]): string;
Instance: typeof Instance;
level: Level;
rgb(r: number, g: number, b: number): Chalk;
hsl(h: number, s: number, l: number): Chalk;
hsv(h: number, s: number, v: number): Chalk;
hwb(h: number, w: number, b: number): Chalk;
bgHex(color: string): Chalk;
bgKeyword(color: string): Chalk;
bgRgb(r: number, g: number, b: number): Chalk;
bgHsl(h: number, s: number, l: number): Chalk;
bgHsv(h: number, s: number, v: number): Chalk;
bgHwb(h: number, w: number, b: number): Chalk;
hex(color: string): Chalk;
keyword(color: string): Chalk;
+reset: Chalk;
+bold: Chalk;
+dim: Chalk;
+italic: Chalk;
+underline: Chalk;
+inverse: Chalk;
+hidden: Chalk;
+strikethrough: Chalk;
+visible: Chalk;
+black: Chalk;
+red: Chalk;
+green: Chalk;
+yellow: Chalk;
+blue: Chalk;
+magenta: Chalk;
+cyan: Chalk;
+white: Chalk;
+gray: Chalk;
+grey: Chalk;
+blackBright: Chalk;
+redBright: Chalk;
+greenBright: Chalk;
+yellowBright: Chalk;
+blueBright: Chalk;
+magentaBright: Chalk;
+cyanBright: Chalk;
+whiteBright: Chalk;
+bgBlack: Chalk;
+bgRed: Chalk;
+bgGreen: Chalk;
+bgYellow: Chalk;
+bgBlue: Chalk;
+bgMagenta: Chalk;
+bgCyan: Chalk;
+bgWhite: Chalk;
+bgBlackBright: Chalk;
+bgRedBright: Chalk;
+bgGreenBright: Chalk;
+bgYellowBright: Chalk;
+bgBlueBright: Chalk;
+bgMagentaBright: Chalk;
+bgCyanBright: Chalk;
+bgWhiteBright: Chalk;
supportsColor: ColorSupport;
}
declare module.exports: Chalk;
}
-1
View File
@@ -6,7 +6,6 @@
*
* @flow strict
* @format
* @oncall react_native
*/
declare module 'chrome-launcher' {
-1
View File
@@ -6,7 +6,6 @@
*
* @flow strict
* @format
* @oncall react_native
*/
declare module 'chromium-edge-launcher' {
-1
View File
@@ -6,7 +6,6 @@
*
* @flow strict
* @format
* @oncall react_native
* @generated
*/
-1
View File
@@ -6,7 +6,6 @@
*
* @flow strict
* @format
* @oncall react_native
*/
declare module 'connect' {
+20
View File
@@ -0,0 +1,20 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
declare module 'cross-spawn' {
import * as child_process from 'child_process';
type spawn = typeof child_process.spawn & {
spawn: spawn,
sync: typeof child_process.spawnSync,
};
declare module.exports: spawn;
}
+149
View File
@@ -0,0 +1,149 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
declare module '@electron/packager' {
declare export type AsarOptions = $FlowFixMe;
declare export type ElectronDownloadRequestOptions = $FlowFixMe;
declare export type TargetDefinition = {
arch: TargetArch,
platform: TargetPlatform,
};
declare export type FinalizePackageTargetsHookFunction = (
targets: TargetDefinition[],
callback: HookFunctionErrorCallback,
) => void;
declare export type HookFunction = (
buildPath: string,
electronVersion: string,
platform: TargetPlatform,
arch: TargetArch,
callback: HookFunctionErrorCallback,
) => void;
declare export type IgnoreFunction = (path: string) => boolean;
declare export type HookFunctionErrorCallback = (err?: Error | null) => void;
declare export interface MacOSProtocol {
name: string;
schemes: string[];
}
declare export type NotaryToolCredentials = $FlowFixMe;
declare export type OsxSignOptions = $FlowFixMe;
declare export type OsxUniversalOptions = $FlowFixMe;
declare export type Win32MetadataOptions = $ReadOnly<{
CompanyName?: string,
FileDescription?: string,
OriginalFilename?: string,
ProductName?: string,
InternalName?: string,
'requested-execution-level'?:
| 'asInvoker'
| 'highestAvailable'
| 'requireAdministrator',
'application-manifest'?: string,
}>;
declare export type WindowsSignOptions = $FlowFixMe;
declare export type OfficialArch =
| 'ia32'
| 'x64'
| 'armv7l'
| 'arm64'
| 'mips64el'
| 'universal';
declare export type OfficialPlatform = 'linux' | 'win32' | 'darwin' | 'mas';
declare export type TargetArch = OfficialArch | string;
declare export type TargetPlatform = OfficialPlatform | string;
declare export type ArchOption = TargetArch | 'all';
declare export type PlatformOption = TargetPlatform | 'all';
declare export interface Options {
dir: string;
afterAsar?: HookFunction[];
afterComplete?: HookFunction[];
afterCopy?: HookFunction[];
afterCopyExtraResources?: HookFunction[];
afterExtract?: HookFunction[];
afterFinalizePackageTargets?: FinalizePackageTargetsHookFunction[];
afterInitialize?: HookFunction[];
afterPrune?: HookFunction[];
all?: boolean;
appBundleId?: string;
appCategoryType?: string;
appCopyright?: string;
appVersion?: string;
arch?: ArchOption | ArchOption[];
asar?: boolean | AsarOptions;
beforeAsar?: HookFunction[];
beforeCopy?: HookFunction[];
beforeCopyExtraResources?: HookFunction[];
buildVersion?: string;
darwinDarkModeSupport?: boolean;
derefSymlinks?: boolean;
download?: ElectronDownloadRequestOptions;
electronVersion?: string;
electronZipDir?: string;
executableName?: string;
extendHelperInfo?:
| string
| {
[property: string]: any,
};
extendInfo?:
| string
| {
[property: string]: any,
};
extraResource?: string | string[];
helperBundleId?: string;
icon?: string;
ignore?: RegExp | (string | RegExp)[] | IgnoreFunction;
junk?: boolean;
name?: string;
osxNotarize?: NotaryToolCredentials;
osxSign?: true | OsxSignOptions;
osxUniversal?: OsxUniversalOptions;
out?: string;
overwrite?: boolean;
platform?: TargetPlatform | 'all' | Array<TargetPlatform | 'all'>;
prebuiltAsar?: string;
protocols?: MacOSProtocol[];
prune?: boolean;
quiet?: boolean;
tmpdir?: string | false;
usageDescription?: {
[property: string]: string,
};
win32metadata?: Win32MetadataOptions;
windowsSign?: true | WindowsSignOptions;
}
declare function packager(options: Options): Promise<string[]>;
declare module.exports: typeof packager & {
packager: typeof packager,
default: typeof packager,
};
}
@@ -8,12 +8,7 @@
* @format
*/
export default {
primary: '#1292B4',
white: '#FFF',
lighter: '#F3F3F3',
light: '#DAE1E7',
dark: '#444',
darker: '#222',
black: '#000',
};
// Types for Electron when required as a Node package.
declare module 'electron' {
declare module.exports: string;
}
-1
View File
@@ -6,7 +6,6 @@
*
* @flow strict
* @format
* @oncall react_native
*/
// Modified from flow-typed repo:
+13
View File
@@ -0,0 +1,13 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
declare module 'fb-dotslash' {
declare module.exports: string;
}
-1
View File
@@ -3,7 +3,6 @@
*
* @flow strict
* @format
* @oncall react_native
*/
declare module 'jest-diff' {
-1
View File
@@ -6,7 +6,6 @@
*
* @flow strict
* @format
* @oncall react_native
*/
declare module 'jest-snapshot' {
+5 -2
View File
@@ -4,15 +4,14 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
* @oncall react_native
*/
// Modified from https://raw.githubusercontent.com/flow-typed/flow-typed/master/definitions/npm/jest_v29.x.x/flow_v0.134.x-/jest_v29.x.x.js
// Modifications are explained inline by comments beginning with `// MODIFIED`.
// MODIFIED: Added ESLint suppression comment - no-unused-vars doesn't understand declaration files
/* eslint-disable no-unused-vars */
type JestMockFn<TArguments: $ReadOnlyArray<mixed>, TReturn> = {
(...args: TArguments): TReturn,
@@ -855,6 +854,10 @@ type JestObjectType = {
* Returns the number of fake timers still left to run.
*/
getTimerCount(): number,
/**
* Returns the time in ms of the current clock.
*/
now(): number,
/**
* Set the current system time used by fake timers.
* Simulates a user changing the system clock while your program is running.
+421
View File
@@ -0,0 +1,421 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
declare module 'jsonc-parser' {
/**
* Creates a JSON scanner on the given text.
* If ignoreTrivia is set, whitespaces or comments are ignored.
*/
declare export const createScanner: (
text: string,
ignoreTrivia?: boolean,
) => JSONScanner;
export type ScanError = number;
export type SyntaxKind = number;
/**
* The scanner object, representing a JSON scanner at a position in the input string.
*/
export type JSONScanner = $ReadOnly<{
/**
* Sets the scan position to a new offset. A call to 'scan' is needed to get the first token.
*/
setPosition(pos: number): void,
/**
* Read the next token. Returns the token code.
*/
scan(): SyntaxKind,
/**
* Returns the zero-based current scan position, which is after the last read token.
*/
getPosition(): number,
/**
* Returns the last read token.
*/
getToken(): SyntaxKind,
/**
* Returns the last read token value. The value for strings is the decoded string content. For numbers it's of type number, for boolean it's true or false.
*/
getTokenValue(): string,
/**
* The zero-based start offset of the last read token.
*/
getTokenOffset(): number,
/**
* The length of the last read token.
*/
getTokenLength(): number,
/**
* The zero-based start line number of the last read token.
*/
getTokenStartLine(): number,
/**
* The zero-based start character (column) of the last read token.
*/
getTokenStartCharacter(): number,
/**
* An error code of the last scan.
*/
getTokenError(): ScanError,
}>;
/**
* For a given offset, evaluate the location in the JSON document. Each segment in the location path is either a property name or an array index.
*/
declare export const getLocation: (
text: string,
position: number,
) => Location;
/**
* Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
* Therefore, always check the errors list to find out if the input was valid.
*/
declare export const parse: (
text: string,
errors?: ParseError[],
options?: ParseOptions,
) => any;
/**
* Parses the given text and returns a tree representation the JSON content. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
*/
declare export const parseTree: (
text: string,
errors?: ParseError[],
options?: ParseOptions,
) => Node | void;
/**
* Finds the node at the given path in a JSON DOM.
*/
declare export const findNodeAtLocation: (
root: Node,
path: JSONPath,
) => Node | void;
/**
* Finds the innermost node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset.
*/
declare export const findNodeAtOffset: (
root: Node,
offset: number,
includeRightBound?: boolean,
) => Node | void;
/**
* Gets the JSON path of the given JSON DOM node
*/
declare export const getNodePath: (node: Node) => JSONPath;
/**
* Evaluates the JavaScript object of the given JSON DOM node
*/
declare export const getNodeValue: (node: Node) => any;
/**
* Parses the given text and invokes the visitor functions for each object, array and literal reached.
*/
declare export const visit: (
text: string,
visitor: JSONVisitor,
options?: ParseOptions,
) => any;
/**
* Takes JSON with JavaScript-style comments and remove
* them. Optionally replaces every none-newline character
* of comments with a replaceCharacter
*/
declare export const stripComments: (
text: string,
replaceCh?: string,
) => string;
export type ParseError = {
error: ParseErrorCode,
offset: number,
length: number,
};
export type ParseErrorCode = number;
declare export function printParseErrorCode(
code: ParseErrorCode,
):
| 'InvalidSymbol'
| 'InvalidNumberFormat'
| 'PropertyNameExpected'
| 'ValueExpected'
| 'ColonExpected'
| 'CommaExpected'
| 'CloseBraceExpected'
| 'CloseBracketExpected'
| 'EndOfFileExpected'
| 'InvalidCommentToken'
| 'UnexpectedEndOfComment'
| 'UnexpectedEndOfString'
| 'UnexpectedEndOfNumber'
| 'InvalidUnicode'
| 'InvalidEscapeCharacter'
| 'InvalidCharacter'
| '<unknown ParseErrorCode>';
export type NodeType =
| 'object'
| 'array'
| 'property'
| 'string'
| 'number'
| 'boolean'
| 'null';
export type Node = {
type: NodeType,
value?: any,
offset: number,
length: number,
colonOffset?: number,
parent?: Node,
children?: Node[],
};
/**
* A {@linkcode JSONPath} segment. Either a string representing an object property name
* or a number (starting at 0) for array indices.
*/
export type Segment = string | number;
export type JSONPath = Segment[];
export type Location = {
/**
* The previous property key or literal value (string, number, boolean or null) or undefined.
*/
previousNode?: Node,
/**
* The path describing the location in the JSON document. The path consists of a sequence of strings
* representing an object property or numbers for array indices.
*/
path: JSONPath,
/**
* Matches the locations path against a pattern consisting of strings (for properties) and numbers (for array indices).
* '*' will match a single segment of any property name or index.
* '**' will match a sequence of segments of any property name or index, or no segment.
*/
matches: (patterns: JSONPath) => boolean,
/**
* If set, the location's offset is at a property key.
*/
isAtPropertyKey: boolean,
};
export type ParseOptions = {
disallowComments?: boolean,
allowTrailingComma?: boolean,
allowEmptyContent?: boolean,
};
/**
* Visitor called by {@linkcode visit} when parsing JSON.
*
* The visitor functions have the following common parameters:
* - `offset`: Global offset within the JSON document, starting at 0
* - `startLine`: Line number, starting at 0
* - `startCharacter`: Start character (column) within the current line, starting at 0
*
* Additionally some functions have a `pathSupplier` parameter which can be used to obtain the
* current `JSONPath` within the document.
*/
export type JSONVisitor = {
/**
* Invoked when an open brace is encountered and an object is started. The offset and length represent the location of the open brace.
*/
onObjectBegin?: (
offset: number,
length: number,
startLine: number,
startCharacter: number,
pathSupplier: () => JSONPath,
) => void,
/**
* Invoked when a property is encountered. The offset and length represent the location of the property name.
* The `JSONPath` created by the `pathSupplier` refers to the enclosing JSON object, it does not include the
* property name yet.
*/
onObjectProperty?: (
property: string,
offset: number,
length: number,
startLine: number,
startCharacter: number,
pathSupplier: () => JSONPath,
) => void,
/**
* Invoked when a closing brace is encountered and an object is completed. The offset and length represent the location of the closing brace.
*/
onObjectEnd?: (
offset: number,
length: number,
startLine: number,
startCharacter: number,
) => void,
/**
* Invoked when an open bracket is encountered. The offset and length represent the location of the open bracket.
*/
onArrayBegin?: (
offset: number,
length: number,
startLine: number,
startCharacter: number,
pathSupplier: () => JSONPath,
) => void,
/**
* Invoked when a closing bracket is encountered. The offset and length represent the location of the closing bracket.
*/
onArrayEnd?: (
offset: number,
length: number,
startLine: number,
startCharacter: number,
) => void,
/**
* Invoked when a literal value is encountered. The offset and length represent the location of the literal value.
*/
onLiteralValue?: (
value: any,
offset: number,
length: number,
startLine: number,
startCharacter: number,
pathSupplier: () => JSONPath,
) => void,
/**
* Invoked when a comma or colon separator is encountered. The offset and length represent the location of the separator.
*/
onSeparator?: (
character: string,
offset: number,
length: number,
startLine: number,
startCharacter: number,
) => void,
/**
* When comments are allowed, invoked when a line or block comment is encountered. The offset and length represent the location of the comment.
*/
onComment?: (
offset: number,
length: number,
startLine: number,
startCharacter: number,
) => void,
/**
* Invoked on an error.
*/
onError?: (
error: ParseErrorCode,
offset: number,
length: number,
startLine: number,
startCharacter: number,
) => void,
};
/**
* An edit result describes a textual edit operation. It is the result of a {@linkcode format} and {@linkcode modify} operation.
* It consist of one or more edits describing insertions, replacements or removals of text segments.
* * The offsets of the edits refer to the original state of the document.
* * No two edits change or remove the same range of text in the original document.
* * Multiple edits can have the same offset if they are multiple inserts, or an insert followed by a remove or replace.
* * The order in the array defines which edit is applied first.
* To apply an edit result use {@linkcode applyEdits}.
* In general multiple EditResults must not be concatenated because they might impact each other, producing incorrect or malformed JSON data.
*/
export type EditResult = Edit[];
/**
* Represents a text modification
*/
export type Edit = {
/**
* The start offset of the modification.
*/
offset: number,
/**
* The length of the modification. Must not be negative. Empty length represents an *insert*.
*/
length: number,
/**
* The new content. Empty content represents a *remove*.
*/
content: string,
};
/**
* A text range in the document
*/
export type Range = {
/**
* The start offset of the range.
*/
offset: number,
/**
* The length of the range. Must not be negative.
*/
length: number,
};
/**
* Options used by {@linkcode format} when computing the formatting edit operations
*/
export type FormattingOptions = $ReadOnly<{
/**
* If indentation is based on spaces (`insertSpaces` = true), the number of spaces that make an indent.
*/
tabSize?: number,
/**
* Is indentation based on spaces?
*/
insertSpaces?: boolean,
/**
* The default 'end of line' character. If not set, '\n' is used as default.
*/
eol?: string,
}>;
/**
* Computes the edit operations needed to format a JSON document.
*
* @param documentText The input text
* @param range The range to format or `undefined` to format the full content
* @param options The formatting options
* @returns The edit operations describing the formatting changes to the original document following the format described in {@linkcode EditResult}.
* To apply the edit operations to the input, use {@linkcode applyEdits}.
*/
declare export function format(
documentText: string,
range: Range | void,
options: FormattingOptions,
): EditResult;
/**
* Options used by {@linkcode modify} when computing the modification edit operations
*/
export type ModificationOptions = {
/**
* Formatting options.
*/
formattingOptions: FormattingOptions,
/**
* Optional function to define the insertion index given an existing list of properties.
*/
getInsertionIndex?: (properties: string[]) => number,
};
/**
* Computes the edit operations needed to modify a value in the JSON document.
*
* @param documentText The input text
* @param path The path of the value to change. The path represents either to the document root, a property or an array item.
* If the path points to an non-existing property or item, it will be created.
* @param value The new value for the specified property or item. If the value is undefined,
* the property or item will be removed.
* @param options Options
* @returns The edit operations describing the changes to the original document, following the format described in {@linkcode EditResult}.
* To apply the edit operations to the input, use {@linkcode applyEdits}.
*/
declare export function modify(
text: string,
path: JSONPath,
value: any,
options: ModificationOptions,
): EditResult;
/**
* Applies edits to an input string.
* @param text The input text
* @param edits Edit operations following the format described in {@linkcode EditResult}.
* @returns The text with the applied edits.
* @throws An error if the edit operations are not well-formed as described in {@linkcode EditResult}.
*/
declare export function applyEdits(text: string, edits: EditResult): string;
}
-1
View File
@@ -6,7 +6,6 @@
*
* @flow strict
* @format
* @oncall react_native
*/
// Modified from flow-typed repo:
-1
View File
@@ -6,7 +6,6 @@
*
* @flow strict
* @format
* @oncall react_native
*/
declare module 'open' {
-1
View File
@@ -3,7 +3,6 @@
*
* @flow strict
* @format
* @oncall react_native
*/
declare type Print = (value: mixed) => string;
declare type Indent = (value: string) => string;
-1
View File
@@ -6,7 +6,6 @@
*
* @flow strict-local
* @format
* @oncall react_native
*/
declare module 'selfsigned' {
-1
View File
@@ -6,7 +6,6 @@
*
* @flow strict
* @format
* @oncall react_native
*/
declare module 'serve-static' {
+1 -1
View File
@@ -1,8 +1,8 @@
/**
* (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.
*
* @format
* @flow strict
* @format
*/
declare module 'signedsource' {
@@ -6,7 +6,6 @@
*
* @flow strict
* @format
* @oncall react_native
*/
declare module 'tinybench' {
@@ -92,7 +91,19 @@ declare module 'tinybench' {
beforeEach?: (this: Task) => void | Promise<void>,
};
export type Fn = () => Promise<mixed> | mixed;
// This is defined as an interface in tinybench but we define it as an object
// to catch problems like `overriddenDuration` being misspelled.
export type FnReturnedObject = {
overriddenDuration?: number,
};
// This type is defined as returning `unknown` instead of `void` in tinybench,
// but we type it this way to avoid mistakes (we can make breaking changes
// in our definition that they can't).
export type Fn = () =>
| Promise<void | FnReturnedObject>
| void
| FnReturnedObject;
declare export class Bench extends EventTarget {
concurrency: null | 'task' | 'bench';
+5
View File
@@ -48,6 +48,11 @@ declare module 'typescript' {
file: SourceFile,
start?: number,
): $ReadOnly<{line: number, character: number}>,
convertCompilerOptionsFromJson(
jsonOptions: any,
basePath: string,
configFileName?: string,
): {options: Object, errors: Diagnostic[]},
ModuleResolutionKind: typeof ModuleResolutionKind,
...
};
-1
View File
@@ -6,7 +6,6 @@
*
* @flow strict-local
* @format
* @oncall react_native
*/
// Very incomplete types for the undici package.

Some files were not shown because too many files have changed in this diff Show More