Commit Graph

38536 Commits

Author SHA1 Message Date
David Vacca 3f62d001fd Update error message for non-registered ViewManagers (#51067)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51067

Update error message for non-registered ViewManagers

changelog: [internal] internal

Reviewed By: arushikesarwani94, cortinico

Differential Revision: D74048740

fbshipit-source-id: 016469ec79654863d51a7b1acff513bf50fd4e86
2025-05-02 12:22:32 -07:00
David Vacca 8c231b7d81 Document logic implemented in ComponentDescriptorRegistry when a component is not found (#51062)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51062

Document logic implemented in ComponentDescriptorRegistry when a component is not found

changelog: [internal] internal

Reviewed By: arushikesarwani94, cortinico

Differential Revision: D74036572

fbshipit-source-id: 20a5d182e0308538cdfa3f5e97957d488f010f0d
2025-05-02 12:22:32 -07:00
David Vacca 5ae6f6be25 Cleanup and document ReactUnimplementedView (#51063)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51063

Cleanup and document ReactUnimplementedView

changelog: [internal] internal

Reviewed By: rshest, cortinico

Differential Revision: D74036571

fbshipit-source-id: 75077914697cac56743c99fba7d7cdccad5c828a
2025-05-02 12:22:32 -07:00
Mateo Guzmán 809372c49e Make EventBeatManager internal (#51057)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.fabric.events.EventBeatManager).

## Changelog:

[INTERNAL] - Make com.facebook.react.fabric.events.EventBeatManager internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache, cortinico

Differential Revision: D74037193

Pulled By: arushikesarwani94

fbshipit-source-id: 77e677a977d8a5c4d7f985c3eff352c19ca1140c
2025-05-02 11:55:01 -07:00
HyunWoo Lee 78dbbaafdd Support collections dsl (#51042)
Summary:
This PR introduces a concise Kotlin DSL for constructing `ReadableMap` and `ReadableArray` in Android native modules:

- Adds `buildReadableMap { … }` and `buildReadableArray { … }` functions, modeled after Kotlin’s `buildMap`/`buildList` APIs.
- Wraps `Arguments.createMap()` / `Arguments.createArray()` in a type-safe, nested DSL to reduce boilerplate and prevent errors.
- Improves readability and maintainability when assembling nested map/array structures for React Native bridges.

Current code like:
```kotlin
val map = Arguments.createMap().apply {
  putString("name", user.name)
  putInt("age", user.age)
  // …
}
```

can now be written as:

```kotlin
val userMap = buildReadableMap {
  put("name", user.name)
  put("age", user.age)
  put("scores") {
    user.scores.forEach { add(it) }
  }
}
```

This feature proposal also written in [[Android] Support Collection DSL](https://github.com/react-native-community/discussions-and-proposals/issues/899)

## Changelog:

[Android] [Added] - Collections DSL functions for Kotlin(`buildReadableMap`, `buildReadableArray`)

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

Test Plan:
### Run Unit Test

```shell
cd packages/react-native/ReactAndroid
./gradlew :ReactAndroid:unitTest
```

Ensure all tests in `src/test/java/.../ReadableMapBuilderTest.kt` and `ReadableArrayBuilderTest.kt` pass.

Reviewed By: javache

Differential Revision: D73986390

Pulled By: cortinico

fbshipit-source-id: b9f94327646bcb6e0190cdd06dfb9bb5eaa6375c
2025-05-02 11:02:52 -07:00
Nicola Corti 2590438b67 Minor cleanup of AbstractLayoutAnimationTest (#51079)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51079

This test was not using AssertJ. I've updated it then.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D74065455

fbshipit-source-id: 2393340fd75aaf9599ba789237c29bb91e0192ae
2025-05-02 10:21:57 -07:00
Alex Hunt ec38728c75 Report PerformanceResourceTiming events (#51025)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51025

(Sparsely) wires up reporting of Network events to the Web Performance subsystem.

Our plan is to report to the Web Performance APIs (lightweight timing metadata, here) for all build flavours, and report to CDP (more costly full metadata/previews) in dev/profiling builds.

**Notes**

- Introduces `PerformanceEntryReporter::unstable_reportResourceTiming` — this will become "stable" when further network events/fields are fully hydrated on Android and iOS.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D73922341

fbshipit-source-id: bcfc03c3d8a9a286ae72ba00a3313602fb2adea8
2025-05-02 08:14:40 -07:00
Alex Hunt 6b304bc551 Fix missing podspec dependency in RCTNetwork (#51071)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51071

Follows D73995864.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D74062263

fbshipit-source-id: 2cb9bc30b36ecd2cd925bf5efa5ee31e9c8a92a6
2025-05-02 08:14:40 -07:00
Riccardo Cipolleschi 58a9046978 Improve cleanup script for ios (#51046)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51046

This small change improves the cleanup script for ios, which is now not deleting the workspace and that it might be keeping an outdated version of the codegen for OSS.

## Changelog:
[Internal] - Improve yarn clean-ios script

Reviewed By: cortinico

Differential Revision: D73988442

fbshipit-source-id: 6de5d6ab08812ba7fdb19b0cc955a38840d82f89
2025-05-02 04:21:12 -07:00
Mateo Guzmán 5d98f6f364 Kotlin: Clean up redundant constructs (#51061)
Summary:
Static code analysis detected several redundant constructs across the codebase. Most of the ones fixed here are marked as warnings/weak warnings, likely code smells post-migration from Java.

Doing a small round to clean up some of them.

## Changelog:

[INTERNAL] - Kotlin: Clean up redundant constructs

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

Test Plan:
```sh
yarn android
yarn test-android
```

Reviewed By: rshest

Differential Revision: D74056259

Pulled By: javache

fbshipit-source-id: 04f7ce7ce7b4f6063c8e1712840a44fd91d3b9e1
2025-05-02 03:59:22 -07:00
Nicola Corti c6685d29ad Fix RNTester SampleLegacyModule not rendering in Old Arch (#51073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51073

Currently the SampleLegacyModule screen is not loading in OldArch for RNTester.

That's because we gate adding a `SampleLegacyModule` to the BaseReactPackage
only if NewArch is enabled.

This shouldn't be the case as we can still build RNTester in oldarch and we
should be able to visualize the SampleLegacyModule example.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D74009245

fbshipit-source-id: 55eae3dc6063343f57261af2742e643a8e5c2b50
2025-05-02 03:59:10 -07:00
Mateo Guzmán 506f03b5e1 Make ShareModule internal (#51059)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.modules.share.ShareModule).

## Changelog:

[INTERNAL] - Make com.facebook.react.modules.share.ShareModule internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: javache

Differential Revision: D74037444

Pulled By: arushikesarwani94

fbshipit-source-id: 13f7652a0db35200b4de9ea95a800cf9ea52b837
2025-05-02 02:18:47 -07:00
Alex Hunt e1632da01c Gate network event reporting with feature flag (#51050)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51050

Gate network event reporting on iOS (inputting into the network reporting subsystem), now that this is load-bearing with the Performance API.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D73995864

fbshipit-source-id: 65a15485cdae445eadff6c57148f3682af6de215
2025-05-01 23:19:29 -07:00
Mateo Guzmán c4a2cb9d90 Make JSResponderHandler internal (#51058)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.touch.JSResponderHandler).

## Changelog:

[INTERNAL] - Make com.facebook.react.touch.JSResponderHandler internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: mdvacca

Differential Revision: D74036832

Pulled By: arushikesarwani94

fbshipit-source-id: c31cd271e7c1007fdfe9582c8c3055ecbda324a6
2025-05-01 22:45:33 -07:00
Alex Hunt 195b723d74 Refactor performanceNow call, remove cxxreact dependency (#51024)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51024

Prevents a dependency cycle in the next diff.

Changelog: [Internal]

Reviewed By: rubennorte, hoxyq

Differential Revision: D73933671

fbshipit-source-id: 79c66cd5f6a32ed7287a2d6e7840a512466306a9
2025-05-01 22:40:39 -07:00
Alex Hunt baf895c239 Add internal support for PerformanceResourceTiming (#50996)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50996

Adds a representation of the [`PerformanceResourceTiming`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming) event type to the Web Performance subsystem, ahead of integration with our network event reporting.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D73861431

fbshipit-source-id: 8258058c432727808d30c338bba79ca92a17c1c8
2025-05-01 22:40:39 -07:00
Alex Hunt 1135f10e05 Refactor PerformanceEntry as std::variant (#50995)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50995

Refactors our previous single-struct representation for `PerformanceEntry` ([see MDN](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry)) as a `std::variant`.

This maps closely to the `PerformanceEntry` type inheritance in the web spec, and makes this type substantially cleaner to extend and work with in D73861431.

Changelog: [Internal]

Reviewed By: rubennorte, rshest

Differential Revision: D73860532

fbshipit-source-id: f3b7a7444d2456370620c1a1ba9a43f118cb9730
2025-05-01 22:40:39 -07:00
Alex Hunt e6870c68f9 Limit request body size for Network.requestWillBeSent (#51026)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51026

Performance optimisation — truncate request body content (sent as `Request.postData` over CDP) at 1MB.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D71905868

fbshipit-source-id: ba82b4937902e057d4694bf4f000eb77ee37aa8a
2025-05-01 21:46:36 -07:00
Riccardo Cipolleschi 04f0e66a6b Avoid accessing the MainBundle multiple times (#51044)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51044

This change prevents RN from accessing the MainBundle every time a NativeModule is registered by caching the `legacyLogEnabled` property in a static variable.

## Changelog:
[Internal] - Prevent multiple access to mainBundle

Reviewed By: javache

Differential Revision: D73992070

fbshipit-source-id: a14aada43f367314b7f868a0b5e30b9f92d0971a
2025-05-01 20:22:50 -07:00
Richard Howell 21bf7cf6cf remove ATOMIC_VAR_INIT
Summary:
ATOMIC_VAR_INIT is deprecated in C17, and does nothing anyway.

Changelog:
[iOS][Fixed] - Remove deprecated ATOMIC_VAR_INIT macro in RCTProfile.m

Reviewed By: NSProgrammer

Differential Revision: D74002901

fbshipit-source-id: e453fbc084cd0b1049c7f8b052c9779d9b19b44f
2025-05-01 19:16:54 -07:00
Nick Gerleman e4b6b346bc Remove ENABLE_MEASURE_LOGGING (#51064)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51064

This is pretty much just checked in printf debugging. Let's clean it up, before we duplicate some code which has the logs.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D73975310

fbshipit-source-id: d2b936ad62a17aef20903fd2ca0defc23c647aa0
2025-05-01 18:13:39 -07:00
Nick Gerleman b1367eeb81 Resubmit: Incorporate maxLines and ellipsization into text layout (#51040)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51040

## Resubmit

We were previously only checking for `maxNumberOfLines` of `ReactConstants.UNSET` (-1), but it may also be `0` to signify unset from other checks (wut), and different versions of Android would handle this case of `maxLines={0}` differently.

The resubmission adds an explicit check for zero here as well.

```
      if (ReactNativeFeatureFlags.incorporateMaxLinesDuringAndroidLayout()) {
        if (maxNumberOfLines != ReactConstants.UNSET && maxNumberOfLines != 0) {
          builder.setEllipsize(ellipsizeMode).setMaxLines(maxNumberOfLines);
        }
      }
```

## Previous

Right now, we fully layout text, then use max lines to determine  a metric to use when calculating size.

Android API 23+ which we fully target allows incorporating ellipsization and maxlines directly into the layout. This will let us directly draw the layout when using maxLines later. This may also let Android optimize line-breaking a bit, when we hit truncation.

Special care is taken not to set this when we are in `adjustsFontSizeToFit` path, so that line count will flow over, signifing overflow.

I think the main user-facing change is that `onTextLayout` events will have measures post-ellipsization.

Changelog:
[Android][Changed] - Incorporate maxLines and ellipsization into text layout

Reviewed By: lenaic, joevilches

Differential Revision: D73953691

fbshipit-source-id: 2e08faab5bb9eda90a126545571bb441ea1ece39
2025-05-01 18:13:39 -07:00
Zeya Peng 0c58ccf501 Call Java AudioModule from C++ TM to play audio (#51037)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51037

## Changelog:

[Android] [Changed] - Make mHybridData in CxxReactPackage protected

In some cases subclass needs to override it in constructor

Reviewed By: javache

Differential Revision: D73894471

fbshipit-source-id: 7958f9b88841a0201d39e49fba09af76927e5737
2025-05-01 14:22:10 -07:00
Fabrizio Cucci b406c0a37e Add changelog entry for 0.79.2 (#51054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51054

As per title.

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D74013007

fbshipit-source-id: f5a8a99956ec3fe4dcf56ffd5f7ed2f4cef158eb
2025-05-01 12:45:39 -07:00
Alex Hunt b731ea3d3f Internalise RNTester examples referencing unexported APIs (#51019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51019

Follows D72228547 and D73770609.

This diff internalises (moves files from fbsource+GitHub to fbsource only) a number of RNTester examples which referenced `'react-native/src/private/'` subpaths.

In future, new components/APIs should be exported from index as `unstable_`, or added to `RNTesterListFbInternal` if they are exported from `src/fb_internal/`.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D73777092

fbshipit-source-id: d9fb0833c56f2ae580b6db62ddbbbeae774a0004
2025-05-01 09:58:30 -07:00
Alex Hunt ba5acdba83 Introduce enableNetworkEventReporting and enableResourceTimingAPI feature flags
Summary: Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D73995231

fbshipit-source-id: ade6f858b14928a32fa022d4e9a85704bc944726
2025-05-01 07:00:52 -07:00
Nick Lefever 07073fbac8 Override useShadowNodeStateOnClone for OSS (#51041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51041

Enabling `useShadowNodeStateOnClone` by default on OSS to resolve https://github.com/facebook/react-native/issues/49694

Changelog: [Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D73970421

fbshipit-source-id: 4021c9fc07a7fc28012c022f6131409486e8aea7
2025-05-01 05:48:52 -07:00
Riccardo Cipolleschi e1d2285791 Do not access to main bundle when running in prod (#51043)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51043

The call to the mainBundle to read the `RCTLegacyWarningsEnabled` key can sometime deadlock in prod.
However, these are development logs that we don't want to run in Prod.

This change should disable the logs in prod, skipping the access to the `mainBundle`, and avoid the deadlock completely.

## Changelog:
[Internal] - Fix deadlock at startup to read `RCTLegacyWarningsEnabled`

Reviewed By: philIip, javache

Differential Revision: D73987454

fbshipit-source-id: 014410266733fdfa1e7b29d41fab5f7112b1ddb4
2025-05-01 04:48:55 -07:00
Pieter De Baets 773ba66c64 Cleanup unnecessary unsafe dereferences in BlobModule (#51016)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51016

Addressing some lint feedback.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D73840204

fbshipit-source-id: ed1035bb785ce0246e714bca86a1ae84578f1464
2025-05-01 04:07:30 -07:00
Mateo Guzmán 81f3f091ae Make ReactModalHostManager internal (#51002)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.views.modal.ReactModalHostManager).

## Changelog:

[INTERNAL] - Make com.facebook.react.views.modal.ReactModalHostManager internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico, rshest

Differential Revision: D73890830

Pulled By: alanleedev

fbshipit-source-id: 6443c4ab80a287fbe963ee60e361ff7864a0d73f
2025-05-01 02:23:01 -07:00
Joe Vilches 69f41ca367 a11y] Let links discovered by dataDetectorType be accessible (#50914)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50914

The URL spans generated by Linkify are not actually accessible because we do not update the delegate's virtual views.

I also had to change how AccessibilityLinks get generated, since it does not work well if it includes spans that are not `ReactClickableSpans`

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D73612119

fbshipit-source-id: 0c6028a7473e0484216300863f2d7a043fb2ea85
2025-05-01 01:52:46 -07:00
Joe Vilches 70aced5eb1 Let LinkMovementMethod take precedence over accessibility delegate when dataDetector is present (#50887)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50887

There is currently a bug with the recent changes to keyboard accessibility with Text and nested links. If something with nested links has a `dataDetectorType` prop then we have 2 different selections when we navigate with arrow keys since the drawing behind the 2 are separate.

Removing LinkMovementMethod is not possible since it allows for clicking the links it detects

As a result, lets just allow it to take precedence over the delegate when handling link navigation in the cases its present.

Changelog: [Android][Fixed] - Double selection with dataDetectorType and links

Reviewed By: NickGerleman

Differential Revision: D73549839

fbshipit-source-id: bbe37470e78841bb119fa68e197b327023031c7e
2025-05-01 01:52:46 -07:00
Ruslan Lesiutin 0f5eeb6970 Use correct scriptId (#51030)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51030

# Changelog: [Internal]

I've been using the wrong thing this whole time, because it is referenced in `ChromeTraceSerializer.cpp`:
https://www.internalfb.com/code/fbsource/[b422eeb3bb6334ef95e8cf01b18e32ba8ab72bbe]/xplat/hermes-snapshot/lib/VM/Profiler/ChromeTraceSerializer.cpp?lines=439

Turns out, there is a real `scriptId`, defined by the Runtime and which is unique for every script. This also aligns with other parts of the CDP stack in Hermes. Since this scriptId is always available, there is no need to make it optional.

Reviewed By: dannysu

Differential Revision: D73185984

fbshipit-source-id: 1bb057584cf3f18bd7b440fef44de9e880ceb961
2025-05-01 00:22:44 -07:00
Ruslan Lesiutin 0b6ed6c7d5 Define range for iteration over samples and call stack frames (#51029)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51029

# Changelog: [Internal]

Instead of exposing vector of samples / call frames directly, we will share pair of iterators that would allow iterating over them in a specified order.

Reviewed By: dannysu

Differential Revision: D73448002

fbshipit-source-id: 16c476453e943a71403b375b168b30da7d261cfa
2025-05-01 00:22:44 -07:00
Ruslan Lesiutin a5f2acde20 Avoid heap allocations when serializing sampling profile (#51028)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51028

# Changelog: [Internal]

There is a way to implement the trie without allocating `ProfileTreeNode` on the heap. The serialization logic (`RuntimeSamplingProfilerTraceEventSerializer.cpp`) remained mostly the same, the only new limitation is that we can only use pointer to `ProfileTreeNode` until the next push into a `children` container, when all pointers are invalidated. Not sure if we can avoid this invalidation, since we don't know the potential size of `children` vector, it has to be dynamically allocated.

Main changes are in `ProfileTreeNode`:
- Instead of receving already created instane that will be check if it should be added as a child, it will expose predicate to check if such node already exists - `getIfAlreadyExists`. If not, then caller can use `addChild` to register it and receive a pointer.

Reviewed By: huntie

Differential Revision: D73213284

fbshipit-source-id: 385be884bcc5feb61b3a8cbd0ff36402e3b20c6c
2025-05-01 00:22:44 -07:00
Ruslan Lesiutin c09340e73e Use std::variant, remove heap allocations (#50847)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50847

# Changelog: [Internal]

We have different types of call frames, right now we defined 4 of them. Previously, they would descend from `ProfileSampleCallStackFrame`, which has `kind_` field that can be used for determining the type of the call frame.
We were using polymorphism later on React Native side to cast from base type to derived.

Instead of this, and instead of doing heap allocations for potentially tens of thousands of objects, we will use std::variant for storing frames in a single container and them distinguishing them.

This fixes memory leaks caused by new-ing objects and not clearing out when Profile is destroyed.

Reviewed By: dannysu

Differential Revision: D72803934

fbshipit-source-id: a279c6d68c7c2628f0eab585f33137222ad9e3f1
2025-05-01 00:22:44 -07:00
Sam Zhou 88a04c530e Pre-suppress errors related to Object.assign
Summary:
The `Object.assign` support is [inherently unsound](https://github.com/facebook/flow/issues/3392), carries a lot of tech debt, and we want to error on them.

This diff pre-suppresses errors that will be added in the next version of Flow, to make the next release easier.

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D73963639

fbshipit-source-id: ebefc82c123588eb0b72ab48a24e45c42be33267
2025-04-30 19:44:58 -07:00
Nick Gerleman 025f2d931e Back out "Incorporate maxLines and ellipsization into text layout" (#51035)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51035

This is causing some problems with older versions of Android. Let's back out for now.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D73950625

fbshipit-source-id: 424dfc1216ae811e1e287774c6ac5d0c9ba5aa17
2025-04-30 17:45:25 -07:00
Joe Vilches 4d8eeb34f9 Allow accessibilityOrder to reference itself (#51004)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51004

It would be very convenient if `accessibilityOrder` could reference itself. Meaning the View with the `accessibilityOrder` prop can include its own `nativeID` in the array. This makes sense API wise - we allow for referencing parents and their descendants, so long as they are treated as an element and not a container. This is pretty nice since you no longer have to wrap everything in a View who's sole purpose is `accessibilityOrder`.

Under the hood things get a bit garbled, however, since iOS only lets you have UIViews that are either accessibility elements or accessibility containers - and we need to support both at the same time for this to work. To do this, we make use of the `UIAccessibilityElement` class and just forward all of the logic to the View with the `accessibilityOrder` prop. This View will also not be an accessibility element from the point of view of iOS.

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D73792934

fbshipit-source-id: b0810277c8e410319639b863b59e4e60782bffca
2025-04-30 15:33:35 -07:00
Joe Vilches 62742e21c9 getShadowNodeClass() impl in PreparedLayoutTextViewManager (#50925)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50925

This crashes without this change, now it does not!

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D73626930

fbshipit-source-id: 37fd99372d1781a9e895e854e8b2f75c568ef9c0
2025-04-30 15:08:53 -07:00
Mateo Guzmán b40157e758 Make FabricEventEmitter internal (#51001)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.fabric.events.FabricEventEmitter).

## Changelog:

[INTERNAL] - Make com.facebook.react.fabric.events.FabricEventEmitter internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico, NickGerleman

Differential Revision: D73895164

Pulled By: arushikesarwani94

fbshipit-source-id: 46adb077f5d3ee93fe7006c0ffc6c9e87d50147f
2025-04-30 12:33:28 -07:00
Jorge Cabiedes Acosta ae2773f231 Make AccessibilityOrder also include the host view (#51027)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51027

Simple change to make the host of `experimental_accessibilityOrder` include the view that hosts the property in its order.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D73808337

fbshipit-source-id: 441329a6ca0cd4b0aba08bddb15143215d337e01
2025-04-30 11:54:09 -07:00
Riccardo Cipolleschi 2d3285ab60 Bump Xcode to version 16.2 (#51014)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51014

Starting from the [24th of April](https://developer.apple.com/news/upcoming-requirements/?id=02212025a), Apple only accepts app built with Xcode 16.0 or greater

This change bumps our CI to ensure that everything works with Xcode 16.

## Changelog:
[Internal] - Bump CI to Xcode 16.2

Reviewed By: javache

Differential Revision: D73924819

fbshipit-source-id: 82cdca5e12cee505de6e97513c07678776642d88
2025-04-30 09:49:42 -07:00
Riccardo Cipolleschi 9683287319 Bump maestro to 1.40 (#51022)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51022

As per title, it bumps maestro to 1.40 in CI

## Changelog:
[Internal] - Bump Maestro to 1.40

Reviewed By: cortinico

Differential Revision: D73929936

fbshipit-source-id: 7dfd974a0d1227520c5a6892ff4f157633fdbd54
2025-04-30 09:25:34 -07:00
generatedunixname89002005287564 c232148e74 fbsource//xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/deviceinfo:deviceinfoAndroid (#51011)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51011

Reviewed By: rshest

Differential Revision: D73840378

fbshipit-source-id: 8a902c454b4b8252f8e690fb10de58cfecd6c703
2025-04-30 09:07:19 -07:00
Pieter De Baets 8de401c625 Make ResourceDrawableIdHelper an object (#51013)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51013

There's no need to use a singleton pattern here, we can just use a Kotlin object.

Changelog: [Android][Removed] Deprecated `ResourceDrawableIdHelper.instance`

Reviewed By: Abbondanzo

Differential Revision: D73923281

fbshipit-source-id: f46e125ce595fe4506b9fb5aa471109f5ba150f0
2025-04-30 08:53:59 -07:00
Pieter De Baets 16bfb2f87a Fixup tests for ReactHostImpl Kotlin migration (#51012)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51012

Splitting of from D73846053 to reduce size.

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D73923280

fbshipit-source-id: 61840fce0a5ef8c5fb19396e55ce4bded0cdd9ff
2025-04-30 08:53:59 -07:00
Anupriya Verma f53d066d26 Support minimumFontScale in paragraphAttributes (#50933)
Summary:
Support minimumFontScale in paragraphAttributes

Resolves https://github.com/facebook/react-native/issues/50934

## Changelog:

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

Pick one each for the category and type tags:

[GENERAL] [ADDED] - Message

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

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

Test Plan:
Tested via this code here: https://github.com/microsoft/react-native-windows/pull/14617

Before:
![image](https://github.com/user-attachments/assets/76b94aa8-228b-4a7e-9ec0-c366c7bf38ac)

After:
![image](https://github.com/user-attachments/assets/f9fbf8c2-9776-429f-8605-5663f9c7b7c9)

https://github.com/user-attachments/assets/fb9ae889-7d01-4317-a6e6-61e6b0708bc4

Reviewed By: NickGerleman

Differential Revision: D73658489

Pulled By: cipolleschi

fbshipit-source-id: 87ed27c0de2363e2ce0d908cc26670349586e7a6
2025-04-30 05:30:19 -07:00
Nicola Corti 0abd5d63e1 Back out "Migrate ReactActivity" (#50998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50998

I'm reverting this as this change is too disruptive for the OSS ecosystem.
It will break ALL the apps written in Kotlin and it's coming too close to the branch cut which is in less than one week.

We need to re-do this migration in a non breaking manner after the branch cut as this is highly disruptive for little benefit at this point

Changelog
[Android][Changed] - Back out "[RN][Kotlin] Migrate ReactActivity"

Original commit changeset: 936263100ca9

Original Phabricator Diff: D73507044

Reviewed By: mdvacca

Differential Revision: D73864144

fbshipit-source-id: 264921b1f1cd38301e66364de4b619807272bd27
2025-04-29 21:50:25 -07:00
Mateo Guzmán 79d3cb7e1e Make EventEmitterWrapper internal (#51003)
Summary:
This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.fabric.events.EventEmitterWrapper).

## Changelog:

[INTERNAL] - Make com.facebook.react.fabric.events.EventEmitterWrapper internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: NickGerleman

Differential Revision: D73888667

Pulled By: arushikesarwani94

fbshipit-source-id: 2119775a5630e76a46924d7db3afd8d5ab6f082b
2025-04-29 19:16:31 -07:00