Commit Graph

38893 Commits

Author SHA1 Message Date
Devmate Bot 32b5907271 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java
Reviewed By: javache

Differential Revision: D85546696
2025-10-29 02:11:48 -07:00
Tim Yung 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 Pluckthun 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 Abbondanzo 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 Cipolleschi 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 Susla 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 Lesiutin 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 Purrer 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'Brien 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 Rozell 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 Purrer 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 Scheduler 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 Cipolleschi 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) 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 Lesiutin 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 Lesiutin 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 Hung 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 Kim 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 Lutsenko 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 Peng 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 Kim 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 Lefever 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 Lefever 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) 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) 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) 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 Hunt 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 Cipolleschi 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 Piasecki 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 Piasecki 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 Purrer 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 Lesiutin 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 Zaidman 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 Zaidman 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 Zhou 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 Piasecki 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 Wei 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 Abbondanzo 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 Tang 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 Peng 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 Peng 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 Hanlon 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 Piasecki 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 Piasecki 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 Piasecki 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 Piasecki 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 Piasecki 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 Piasecki 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 Cipolleschi 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 Hanlon 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