Commit Graph

38536 Commits

Author SHA1 Message Date
Riccardo Cipolleschi 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 Cipolleschi 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 Corti 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 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 Corti 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 Lefever 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án 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 Susla 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 Jha 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 Baets 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 Norte 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 Hogan 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 Vacca 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 Gerleman 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 Gerleman 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 Zaidman 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 Purrer 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 Purrer 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 Hunt 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 Hunt 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 Baets 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
generatedunixname89002005287564 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 Corti 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 Piasecki 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 Piasecki 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 Vacca 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 Vacca 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 Hunt 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 Hogan 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 Hogan 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 Nara 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 Nara 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 Baets 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
generatedunixname89002005287564 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 Hogan 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 Hogan 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
generatedunixname89002005287564 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 Purrer 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 Cipolleschi 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 Norte 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 Norte 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 Corti 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 Cipolleschi 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 Cipolleschi 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 Cipolleschi 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 Purrer 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 Peng 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 Peng 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 Norte 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 Norte 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