Commit Graph
37710 Commits
Author SHA1 Message Date
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