Commit Graph

38536 Commits

Author SHA1 Message Date
Jakub Piasecki edfc73d1a1 Align DrawerLayoutAndroid type definitions with OSS (#49620)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49620

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70081361

fbshipit-source-id: 203a9a984fddef6dfd2fce7e84ae44e8e68e8fcc
2025-02-25 05:51:21 -08:00
Mateo Guzmán 4a0a10ba50 Make ValueAnimatedNode, AnimatedNodeValueListener & InterpolationAnimatedNode internal (#49644)
Summary:
As part of the initiative to reduce the public API surface, this classes can be internalized. I've checked there are no relevant OSS usages:

- [ValueAnimatedNode](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.animated.ValueAnimatedNode)
- [AnimatedNodeValueListener](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.animated.AnimatedNodeValueListener)
- [InterpolationAnimatedNode](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.animated.InterpolationAnimatedNode)

## Changelog:

[INTERNAL] - Make ValueAnimatedNode, AnimatedNodeValueListener & InterpolationAnimatedNode internal

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

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

Reviewed By: javache

Differential Revision: D70100915

Pulled By: cortinico

fbshipit-source-id: e3068326034c4a050c12be4f886546486c570b16
2025-02-25 05:34:15 -08:00
Joanna Qu 4121d24454 Update deprecated enums in RCTTextPrimitivesConversions.h (#49648)
Summary:
`NSUnderlinePatternDash`/`NSUnderlinePatternDot` are [deprecated](https://developer.apple.com/documentation/uikit/nsunderlinepatterndash). Use their drop-in replacements (`NSUnderlineStylePatternDash` and `NSUnderlineStylePatternDot`) instead.

## Changelog:

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

Pick one each for the category and type tags:

[IOS] [DEPRECATED] - Update deprecated enums in RCTTextPrimitivesConversions.h

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

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

Test Plan: Local build

Reviewed By: cortinico

Differential Revision: D70153675

Pulled By: cipolleschi

fbshipit-source-id: e64c9df1a5282a3f33f742a455c64c002f0c8044
2025-02-25 05:31:49 -08:00
Oskar Kwaśniewski a033cf9d5e fix: remove UISceneDelegate from AppDelegate (#49628)
Summary:
After this change: https://github.com/facebook/react-native/pull/49078 UIWindowSceneDelegate is no longer needed.

This wasn't removed in the original PR.

## Changelog:

[iOS] [Removed] - Remove no longer needed UISceneDelegate

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

Test Plan: CI GREEN

Reviewed By: cortinico

Differential Revision: D70102384

Pulled By: cipolleschi

fbshipit-source-id: e33185a4becd949a9f0ec1eabeeb4fe85ef3ee79
2025-02-25 05:03:12 -08:00
Intl Scheduler acc4c9ed57 translation auto-update for Apps/Wilde/scripts/intl-config.json on master
Summary:
Chronos Job Instance ID: 1125907956139478
Sandcastle Job Instance ID: 4503601315782801
allow-large-files
ignore-conflict-markers
opt-out-review
drop-conflicts

Differential Revision: D70170466

fbshipit-source-id: de74b0d82d1ebf3a825acfdb228822f3166d0b8b
2025-02-25 04:42:22 -08:00
Peter Hsieh 823ede1fab Backout D69745459 to resolve more Twilight headset pairing issues (#49656)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49656

changelog: [internal]

Differential Revision: D70116923

fbshipit-source-id: ead8b1551acd6713372e1b500d921c8590bf6ac0
2025-02-25 04:34:25 -08:00
Parsa Nasirimehr d8df3a68fc chore(Android): migrate most of the files under MessageQueue to Kotlin (#48748)
Summary:
A continuation of the work done in https://github.com/facebook/react-native/pull/48652, This PR migrates every other Java file other than `QueueThreadExceptionHandler` under `com.facebook.react.bridge.queue` to Kotlin

## Changelog:

[INTERNAL] [FIXED] - Migrate most of the message queue files to Kotlin

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

Test Plan:
./gradlew test:
<img width="1567" alt="Screenshot 2025-01-16 at 21 10 47" src="https://github.com/user-attachments/assets/5bd6824d-b31c-45f8-9398-9cde658f8ff7" />

Reviewed By: cortinico

Differential Revision: D68294382

Pulled By: rshest

fbshipit-source-id: 3d919b43fea1c3656097f7730194ee8e2ac644d3
2025-02-25 04:18:37 -08:00
Mateo Guzmán 514fccf8dc Migrate ReactMarkerConstants to Kotlin (#49645)
Summary:
Migrate com.facebook.react.bridge.ReactMarkerConstants to Kotlin

## Changelog:

[INTERNAL]- Migrate com.facebook.react.bridge.ReactMarkerConstants to Kotlin

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

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

Reviewed By: rshest

Differential Revision: D70120968

Pulled By: javache

fbshipit-source-id: c69ad2f3920ea877d51fd81c8b2a573844996e04
2025-02-25 04:13:59 -08:00
Samuel Susla 91b4354fa0 add arguments to command logs (#49646)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49646

changelog: [internal]

- Log command arguments so they can be asserted against in tests.

Use this in a TextInput test and add a test to check whether view command accidentally resets TextInput value to empty.

Reported: https://github.com/facebook/react-native/issues/49368?fbclid=IwZXh0bgNhZW0CMTEAAR2KUbc5F17NIX_WSJ_ojyUHQrR5UyASfSbkPl05nTj1tRV9knPI7GIFNmE_aem_O2I1F5tZTsvRX9anpv7gMg

Reviewed By: NickGerleman

Differential Revision: D70098109

fbshipit-source-id: 03482278b7adb0fa42dbc9e02e636ea1df9e6be6
2025-02-25 02:58:11 -08:00
Julian Tigler e3d607fc2e Fix new arch refresh control not shown when refreshing on mount (#49240)
Summary:
- In the old architecture on iOS, it was possible to begin refreshing a [`RefreshControl`](https://reactnative.dev/docs/refreshcontrol) backed by  [`RCTRefreshControl.m`](https://github.com/facebook/react-native/blob/ea876054cfdcdfba1d8ded69ab359f20072aef6c/packages/react-native/React/Views/RefreshControl/RCTRefreshControl.m) on mount (see [old arch rn-tester video](https://github.com/user-attachments/assets/0a759072-8931-438b-b9af-698b5f8fa072)).
- In the new architecture on iOS, when attempting to refresh on mount, the `RefreshControl` backed by [`RCTPullToRefreshViewComponentView.mm`](https://github.com/facebook/react-native/blob/ea876054cfdcdfba1d8ded69ab359f20072aef6c/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm) is not shown. Additionally, recycled `RefreshControl`s are missing their [`title`s](https://reactnative.dev/docs/refreshcontrol#title-ios) (see [new arch rn-tester video](https://github.com/user-attachments/assets/22f87a82-4703-470b-9c00-6454eb9458dd)).
- This change fixes the new arch issues mentioned above, so that the new arch behaves the same as the old arch did (see [new arch rn-tester video with fix](https://github.com/user-attachments/assets/3ab6c90c-6ad4-4dc7-b2f5-7cf1378e50b9)).
- This change also updates the rn-tester [`RefreshControlExample`](https://github.com/facebook/react-native/blob/442a368af5bda653e84514b870084c73607645eb/packages/rn-tester/js/examples/RefreshControl/RefreshControlExample.js) to include a refresh-on-mount to prevent future regressions

## Changelog:

[IOS] [FIXED] - Fix new arch RefreshControl wasn't shown when refreshing on mount
[IOS] [FIXED] - Fix new arch recycled RefreshControl was missing its title
[INTERNAL] [CHANGED] - Update rn-tester RefreshControlExample to refresh on mount

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

Test Plan:
- I created a [video](https://github.com/user-attachments/assets/0a759072-8931-438b-b9af-698b5f8fa072) of the baseline old arch behavior by overriding [`new_arch_enabled`](https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/cocoapods/new_architecture.rb#L163-L165) to return `false`
- I created a [video](https://github.com/user-attachments/assets/22f87a82-4703-470b-9c00-6454eb9458dd) of the broken new arch behavior by overriding [`new_arch_enabled`](https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/cocoapods/new_architecture.rb#L163-L165) to return `true`
- I applied the changes in this PR and created a [video](https://github.com/user-attachments/assets/3ab6c90c-6ad4-4dc7-b2f5-7cf1378e50b9) that confirms that the new arch with fix now behaves the same as the old arch
- I also used [patch-package](https://github.com/ds300/patch-package) to verify that the changes in this PR work as expected in my production React Native app, running `react-native@0.77.0`, with the new arch now enabled by default. Note that this app uses [`react-navigation`](https://github.com/react-navigation/react-navigation) and [`react-native-screens`](https://github.com/software-mansion/react-native-screens), which I expected might complicate the fix. The changes in this PR continue to work as expected, even with the complications of those popular libraries.

## Details:
- All of my changes were inspired by the many years of fixes that are included in [`RCTRefreshControl.m`](https://github.com/facebook/react-native/blob/ea876054cfdcdfba1d8ded69ab359f20072aef6c/packages/react-native/React/Views/RefreshControl/RCTRefreshControl.m), which haven't yet been included in the new [`RCTPullToRefreshViewComponentView.mm`](https://github.com/facebook/react-native/blob/ea876054cfdcdfba1d8ded69ab359f20072aef6c/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm)
    - My `_isBeforeInitialLayout` is inspired by the old [`_isInitialRender`](https://github.com/facebook/react-native/blob/442a368af5bda653e84514b870084c73607645eb/packages/react-native/React/Views/RefreshControl/RCTRefreshControl.m#L17)
    - My `layoutSubviews` is inspired by the old [`layoutSubviews`](https://github.com/facebook/react-native/blob/442a368af5bda653e84514b870084c73607645eb/packages/react-native/React/Views/RefreshControl/RCTRefreshControl.m#L43-L59)
    - My `beginRefreshingProgrammatically` is inspired by the old [`beginRefreshingProgrammatically`](https://github.com/facebook/react-native/blob/442a368af5bda653e84514b870084c73607645eb/packages/react-native/React/Views/RefreshControl/RCTRefreshControl.m#L72-L107)
- I have tried to comment all of the unexpected changes. Some of these comments are taken directly from the old `RCTRefreshControl.m`
- In general, it seems like [`UIRefreshControl`](https://developer.apple.com/documentation/uikit/uirefreshcontrol) ignores many style updates, and even calls to `beginRefreshing`, until it's been added to the view hierarchy. That's why the `layoutSubviews` hack was needed in the old arch, and is similarly needed in this PR.
    - Here's a [Stack Overflow answer](https://stackoverflow.com/a/67758859) that hints at this, by saying that `beingRefreshing` needed to be called in a ViewController's `viewWillAppear` lifecycle callback
    - Here's a different [Stack Overflow answer](https://stackoverflow.com/a/32688124) that shows that `viewWillLayoutSubviews` (and by extension, all of the subviews' `layoutSubviews`) is indeed called after `viewWillAppear`
- Since `_refreshControl` effectively ignores updates until the first `layoutSubviews` call, I needed to buffer all calls to `updateProps:oldProps:` into my new `_initialProps` before finally re-calling `updateProps:oldProps:` with `_initialProps` against `PullToRefreshViewShadowNode::defaultSharedProps` in `layoutSubviews`
- Additionally, I needed to move the `if` block regarding refreshing from the top of `updateProps:oldProps:` to the bottom of it, because `_refreshControl` ignores updates that are made after the call to `beginRefreshing`

## Known issues:
- There is one small difference between the old arch and the new arch with this PR. The old arch [programmatically animates the pull down content offset](https://github.com/facebook/react-native/blob/442a368af5bda653e84514b870084c73607645eb/packages/react-native/React/Views/RefreshControl/RCTRefreshControl.m#L89-L102), whereas this PR does not. See `[scrollView setContentOffset:offset]` in the PR code.
    - I tried animating it with the block below, and this did work in the rn-tester app. However, it caused the fix to not work when used with the extremely popular `react-navigation` and `react-native-screens` libraries. In that case, the `RefreshControl` exhibited the same buggy behavior of not being shown when refreshing on mount.
    ```objective-c
    [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
        [_scrollViewComponentView.scrollView setContentOffset:offset];
    } completion:^(BOOL finished) {
        [_refreshControl beginRefreshing];
    }];
    ```
    - I thought it would be better to fix this for a larger number of real-world scenarios without animation than it would be to fix it for just the rn-tester app with animation.

Reviewed By: javache

Differential Revision: D69980100

Pulled By: cipolleschi

fbshipit-source-id: bbacd8ffffff5d87728a1c8c0063acc60215d1a6
2025-02-25 02:19:37 -08:00
Dawid Małecki 094c5be42e Merge and align global.d.ts and globals.d.ts files (#49516)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49516

Merge global.d.ts and globals.d.ts into one file and align some definitions with implementations.

Changelog:
[General][Changed] - Improve TypeScript types for `global` objects

Reviewed By: huntie

Differential Revision: D69772463

fbshipit-source-id: 4771e27a97e1e9cbc33d8f75ba11cffd4d200124
2025-02-25 01:55:26 -08:00
Dawid Małecki 721f85adf7 Set minimum typescript version to 4.9 (#49637)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49637

The dtslint requires that the minimum typescript version of 4.9 is used.

Changelog:
[General][Changed] - Increase minimum typescript version in index.d.ts

Reviewed By: huntie

Differential Revision: D69749044

fbshipit-source-id: be255d108c2e9e9452808ba3dea981a7fac0bc21
2025-02-25 01:55:26 -08:00
Dawid Małecki 4e79ca4464 Add Touchable to buildTypes and align Flow with TS types (#49562)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49562

Changelog:
[Internal]: Added Touchable to buildTypes and aligned Flow with TS types.

Reviewed By: huntie

Differential Revision: D69843245

fbshipit-source-id: 578987a277c3407890a541e442bb347311f71efa
2025-02-25 01:49:28 -08:00
Jakub Piasecki dee6168027 Align Keyboard types with OSS (#49623)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49623

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70083211

fbshipit-source-id: c91d3cd7e8f4ad8770bc686768103b43611d4ebb
2025-02-25 01:23:04 -08:00
Jakub Piasecki 091f542a2e Add a pretransform replacing Stringish with string (#49636)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49636

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70094483

fbshipit-source-id: 3ec23f19af437e28e82f73f03541cbf38469d670
2025-02-25 01:22:31 -08:00
Jakub Piasecki 4309a5d2b1 Fix URLSearchParams common interface definition (#49640)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49640

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70096501

fbshipit-source-id: 33c6406beaab06285675fdb7c2ab75ebd2bb280f
2025-02-25 01:20:23 -08:00
Joe Vilches e6af7951f8 Remove some confusing comments in ReactAccessibilityDelegate (#49655)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49655

This tripped me up since this if hits for TextViews in general, not just EditText

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D70139349

fbshipit-source-id: 1993dda4c6472265c5e61fa4cad4f2beaf4a9930
2025-02-24 23:55:27 -08:00
Joe Vilches 0c6dcfdd48 Use isEmpty as opposed to .size() > 0 in BaseViewManager.java (#49654)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49654

This is a lint error, so figured I would fix it

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D70138099

fbshipit-source-id: 489bedc28ac15bed8f98cc3eceb9e393cd4598e7
2025-02-24 23:55:27 -08:00
Soe Lynn cccd93b4ed Fix typo in RCTLegacyViewMangerInteropComponentView (#49652)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49652

Changelog [Internal]
Fixing simple typo

Reviewed By: shwanton

Differential Revision: D70136618

fbshipit-source-id: 994b0915c946449a7a01ab15304d35323b58b009
2025-02-24 18:29:31 -08:00
Liron Yahdav 8c848b4293 Reland: Throw exception with name of TurboModule instead of deadlock during sync rendering (#49587)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49587

This is a reland diff for D69805065.

The problems with the original diff were:
- wrong header search path in the `React-NativeModuleApple.podspec`
- adding an implementation `RuntimeExecutor.cpp` file to implement a function that is used by an inline function in the `RuntimeExecutor.h`.

I believe that the last point specifically was creating issues to the linker which was not able to resolve the symbols properly in transitive dependencies.

The fix was to move the implementation of `getMainThreadMutex` to be `inline`.

## Changelog:
[Internal]

Reviewed By: cipolleschi

Differential Revision: D69922771

fbshipit-source-id: 285ce1f232e8c94b99d80aafe1ffbc473921d52f
2025-02-24 17:00:17 -08:00
Maddie Lord a302fbcaaf Set ReactSurface and ReactRootView to ReactDelegate when created via ReactNavigationActivityDelegate (#49580)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49580

Add setReactSurface and setReactRootView methods for custom delegates.

Reviewed By: arushikesarwani94

Differential Revision: D69925812

fbshipit-source-id: b2acd3e541bd34216d9f8cadbdf2fa5c04e46b98
2025-02-24 15:58:11 -08:00
Shawn Dempsey f17c26437b Revert D69849314: Use implicit namespace to better align Animated module with OSS types
Differential Revision:
D69849314

Original commit changeset: cdaa605ba536

Original Phabricator Diff: D69849314

fbshipit-source-id: b97b049cf5f3728568a55abfb93dc67cadfa26ba
2025-02-24 15:40:33 -08:00
Rick Hanlon ddf9338dfb enable owner stacks everywhere (#32376)
Summary:
this is now canary and on everywhere

DiffTrain build for [8a7b487e3b171c91f2fe18e9142af53f4dd83454](https://github.com/facebook/react/commit/8a7b487e3b171c91f2fe18e9142af53f4dd83454)

Reviewed By: jackpope, kassens

Differential Revision: D69784493

fbshipit-source-id: 363d28c1ffe3eb264ac78f55bac105dd14f571d1
2025-02-24 11:32:49 -08:00
Rubén Norte 8989bc24b9 Refactor tracing in performance.mark and performance.measure (#49639)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49639

Changelog: [internal]

This refactors some code in the performance API and Perfetto to avoid doing unnecessary work when not tracing (e.g.: string manipulation for tracks).

It also reduces the cost of logging marks/measures to tracing backends if not actively tracing (e.g.: moving the check to outside the lock).

Reviewed By: bgirard

Differential Revision: D69246772

fbshipit-source-id: 141a13f609f12be7ab8ca00f7aa1892b34770bbb
2025-02-24 10:57:29 -08:00
Rubén Norte f424b68c37 Add basic benchmarks for the Performance API (#49638)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49638

Changelog: [internal]

This adds a basic benchmark for different use cases of the `performance` API.

Baseline:
| (index) | Task name                                                 | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | --------------------------------------------------------- | -------------------- | ------------------- | -------------------------- | ------------------------- | ------- |
| 0       | 'mark (default)'                                          | '5692.08 ± 0.33%'    | '5590.00'           | '177735 ± 0.02%'           | '178891'                  | 175683  |
| 1       | 'mark (with custom startTime)'                            | '5775.21 ± 0.27%'    | '5690.00'           | '174880 ± 0.02%'           | '175747'                  | 173154  |
| 2       | 'measure (with start and end timestamps)'                 | '6842.61 ± 0.35%'    | '6730.00'           | '147672 ± 0.02%'           | '148588'                  | 146144  |
| 3       | 'measure (with mark names)'                               | '6828.01 ± 0.75%'    | '6700.00'           | '148371 ± 0.02%'           | '149254'                  | 146456  |
| 4       | 'clearMarks'                                              | '817.04 ± 0.03%'     | '800.00'            | '1233054 ± 0.01%'          | '1250000'                 | 1223933 |
| 5       | 'clearMeasures'                                           | '835.59 ± 0.03%'     | '820.00'            | '1203121 ± 0.01%'          | '1219512'                 | 1196758 |
| 6       | 'mark + clearMarks'                                       | '6137.42 ± 1.32%'    | '5920.00'           | '167661 ± 0.02%'           | '168919'                  | 162935  |
| 7       | 'measure + clearMeasures (with start and end timestamps)' | '7353.85 ± 0.60%'    | '7200.00'           | '138196 ± 0.02%'           | '138889'                  | 135984  |
| 8       | 'measure + clearMeasures (with mark names)'               | '7342.93 ± 0.66%'    | '7170.00'           | '138726 ± 0.02%'           | '139470'                  | 136186  |

Reviewed By: bgirard

Differential Revision: D66926182

fbshipit-source-id: b314b359147e758810598a241269d0c019f77466
2025-02-24 10:57:29 -08:00
zhongwuzw 929c8e4baa Fabric: disable React-Fabric stable_sort strict weak sort check in debug mode (#49422)
Summary:
Fixes assert crash in https://github.com/facebook/react-native/issues/46568#issuecomment-2653747732.

We can temporarily downgrade  _LIBCPP_HARDENING_MODE to _LIBCPP_HARDENING_MODE_EXTENSIVE, it disables strict weak ordering check in debug mode. Actually, when we sort animation mutations, we don't need it to satisfy strict weak ordering.

https://libcxx.llvm.org/Hardening.html#id3

Another solution is we make sort satisfy it, but we don't have any key to compare when two mutation is the same mutation type but not the same parentTag. Maybe we can use pointer of muation to compare?

## Changelog:

[IOS] [FIXED] - Fabric: disable  React-Fabric stable_sort strict weak sort check in debug mode

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

Test Plan: Fixes  https://github.com/facebook/react-native/issues/46568#issuecomment-2653747732.

Reviewed By: sammy-SC

Differential Revision: D69984937

Pulled By: cipolleschi

fbshipit-source-id: 2a3d17970def513c4ba915068f25338169db82d6
2025-02-24 10:25:52 -08:00
Sam Zhou 6f968f01eb Pre-suppress errors ahead of builtin libdef improvements (#49647)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49647

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D70103465

fbshipit-source-id: 24f3c9fa7c56ed88609e60202d2a8c865fe18b47
2025-02-24 10:23:14 -08:00
Iwo Plaza b56548969a Use implicit namespace to better align Animated module with OSS types (#49559)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49559

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
Renames `Animated.js` to `AnimatedExports.js`, and introduces an intermediate file that reexports `* as Animated` as a default. This should have equivalent runtime behavior, but allows for a common interface file: `Animated.js.flow` to reinterpret the module as having single exports. TypeScript treats this as a namespace.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69849314

fbshipit-source-id: cdaa605ba5361d3349c6dd0e84fd0fbfee263941
2025-02-24 09:20:04 -08:00
Jakub Piasecki c66728dc35 Add ButtonProps export (#49593)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49593

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69984581

fbshipit-source-id: 1a9607866dee564718081a15f9f6740dfb8dd0e4
2025-02-24 08:50:19 -08:00
Ruslan Lesiutin 8bce4a37e1 Change TouchedViewDataAtPoint type in ReactNativeTypes to use supported by Flow tooling syntax (#32382)
Summary:
## Summary

The `flow-api-translator` from the `hermes` repo does not support flow
type spreads. It is currently not able to digest the ReactNativeTypes
file as it contains unsupported syntax. The simplest solution is to
change the type of the `TouchedViewDataAtPoint` to equivalent, yet
supported by the Flow tooling. In this case the intersection can be used
as
the `TouchedViewDataAtPoint` and `InspectorData` have no common
property.

## How did you test this change?

Run yarn flow native

DiffTrain build for [e670e72fa076449e40172e20d17cc67c1c15419c](https://github.com/facebook/react/commit/e670e72fa076449e40172e20d17cc67c1c15419c)

Reviewed By: rickhanlonii

Differential Revision: D69661050

fbshipit-source-id: 1732bd9ac9c1af1e4c0b95758e92d9ccf3b807e6
2025-02-24 08:29:34 -08:00
Olivier Bouillet e3b176a598 fix: set text position should not reset component text (#49450)
Summary:
fix: https://github.com/facebook/react-native/issues/49368
description is provided inside the ticket.
When we use TextInput on ios and manage selection with the selection prop, TextInput is reset when we change selection.

## Changelog:

[IOS] [FIXED] - Fix selection makes TextInput clear its content when using children

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

Test Plan:
Tested with sample provided in ticket.
I also test it with my app on both android and ios, but I cannot share video

Reviewed By: sammy-SC

Differential Revision: D69984616

Pulled By: cipolleschi

fbshipit-source-id: a17169608f9df0ea1cb579e6038345f8e48bbc27
2025-02-24 08:23:30 -08:00
Dawid Małecki 92e21688db Add RefreshControl to buildTypes and align Flow with TS types (#49564)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49564

Changelog:
[Internal] - Added RefreshControl to buildTypes and aligned Flow with TS types

Reviewed By: huntie

Differential Revision: D69924368

fbshipit-source-id: 1a01ede28f9d0729c483036f8d3f9c9eced58286
2025-02-24 07:08:03 -08:00
zhongwuzw 5c1e01fdfe Fabric: Fixes shouldRasterizeIOS prop of View not work on iOS (#49615)
Summary:
The js prop name is `shouldRasterizeIOS` https://reactnative.dev/docs/view#shouldrasterizeios-ios, so we should change the prop name when parsing the props.

## Changelog:

[IOS] [FIXED] - Fabric: Fixes shouldRasterizeIOS prop of View not work on iOS

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

Test Plan:
Enable `shouldRasterizeIOS` should work in Fabric:
```
      <View shouldRasterizeIOS={true}>
```

Reviewed By: rshest

Differential Revision: D70085480

Pulled By: javache

fbshipit-source-id: 499524b7812f932b0da4a4f239ff6a79043b2f87
2025-02-24 06:47:46 -08:00
Jakub Piasecki f8627e5627 Align ActivityIndicator with OSS types (#49519)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49519

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69661567

fbshipit-source-id: 35e3849eeea188f8bdfa0664c90d3d9e5328ef80
2025-02-24 06:36:56 -08:00
Pieter De Baets 3f3066f72b Remove unused sample turbo cxx module variants (#49629)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49629

I don't think `RCTSampleTurboCxxModule_v1` does anything useful anymore since we no longer use the `getTurboModuleWithJsInvoker:` API anywhere.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D70088150

fbshipit-source-id: 6391531c412dec18c63948db883aba07ab21499e
2025-02-24 06:32:00 -08:00
Jakub Piasecki db4086de97 Align LayoutConformance types with OSS (#49625)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49625

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70084487

fbshipit-source-id: f4f0a06f3d7cf87659696ac41a27be5f5972d99f
2025-02-24 06:19:45 -08:00
Rubén Norte dbc0bf34ea Prepare for removal of types in ReactNativeTypes (#49602)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49602

Changelog: [internal]

This just prepares for the removal of some types from `ReactNativeTypes`, and defines some types in `ReactNativePrivateInterface` that `ReactNativeTypes` expects to be defined after https://github.com/facebook/react/pull/32446

Reviewed By: huntie

Differential Revision: D69996009

fbshipit-source-id: 3c156b4dede8e217d6a828ab310533a2f8bfd42c
2025-02-24 05:32:43 -08:00
Rubén Norte e630b2ca18 Create specific module in RN to define the types for host instances and host components that ReactNativeTypes defines (#49601)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49601

Changelog: [internal]

This creates a new module in React Native to define some of the types related to `HostInstance` that are currently defined in `ReactNativeTypes` (synced from the React repo).

We want to remove the types from `ReactNativeTypes` so this is a necessary initial step.

Reviewed By: huntie

Differential Revision: D69996010

fbshipit-source-id: 21cfed4c222e22332936e56aca895fe578809792
2025-02-24 05:32:43 -08:00
Vitali Zaidman 14b0c27045 remove duplicate call to json stringify (#49621)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49621

Changelog:
[General][Internal] - remove duplicate call to json stringify

Reviewed By: robhogan

Differential Revision: D70082245

fbshipit-source-id: 01a4277a73978fcee1fc44b5bc6ae5a728e6b504
2025-02-24 05:07:22 -08:00
Jakub Piasecki 0a87f0cf5c Align ScrollView with the OSS types (#49617)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49617

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69981167

fbshipit-source-id: d4b2661b9ec746f30b512bad2c84d4dd0c1755c7
2025-02-24 05:03:18 -08:00
Jakub Piasecki dcaa33e6d9 Add support for numberOfLines for TextInput on iOS (#49549)
Summary:
`TextInput` component has been missing support for `numberOfLines` prop on iOS, this PR adds it.

## Changelog:

[IOS] [ADDED] - Add support for `numberOfLines` prop on `TextInput`

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

Test Plan: Tested on RNTester and added a new case utilizing the prop

Reviewed By: cipolleschi

Differential Revision: D69915133

Pulled By: j-piasecki

fbshipit-source-id: b6a86bc64bd3c2129a64e99c9bcec9cf5bfde3bc
2025-02-24 04:23:58 -08:00
Nicola Corti 53ff6133a7 Re-land: Make RedBoxContentView internal (#49596)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49596

I'm relanding D69934543 as it was previsouly reverted.

I'm making this class internal as I've verified that there are no meaningful usages.

[Source](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+com.facebook.react.devsupport.RedBoxContentView)

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D69987752

fbshipit-source-id: 191a5f5aacbe6ff642e98d4e8c621c17156e55de
2025-02-24 03:15:56 -08:00
Dawid Małecki b060fbe99c Add StatusBar to buildTypes and align Flow with TS types (#49598)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49598

Changelog:
[Internal] - Added StatusBar to buildTypes and aligned Flow with TS types

Reviewed By: huntie

Differential Revision: D69990300

fbshipit-source-id: 684c3692fd3cc4862fd3cd3fe4731129887b9bcc
2025-02-24 03:11:31 -08:00
Vitali Zaidman 4e7b77eb1a create a heartbeat for device, and not only for debugger (#49618)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49618

Changelog:
[General][Internal] - create a heartbeat for device, and not only for debugger.

Introducing a heartbeat for the connection between the proxy and the device similarly to the one between the proxy and the debugger. This will allow us to:
* Most importantly I'd like to track the ping-pong roundtrip to the device as well, to see if we have any anomalies there
* Terminate the connection if it is abandoned for 60seconds- this might have a real effect in some case where the device runs remotely
* Also keep that connection alive if the other side disconnects after a period of inactivity. While a no-op in our case, this is an implementation detail. It is a no-op because the WebSocket on the Device is implemented by us and is not supposed to drop connections like the browser does.

Reviewed By: robhogan

Differential Revision: D69990715

fbshipit-source-id: 6bb3a2ed3eaffff9535aa2d0fc8cff0262af022f
2025-02-24 01:57:34 -08:00
Dawid Małecki 56ed15ee12 Add optional reference to the TouchableHighlight and new types test (#49591)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49591

Changelog:
[Internal] - Added optional reference to the TouchableHighlight and new types test

Reviewed By: huntie

Differential Revision: D69984286

fbshipit-source-id: f6757720d0914ea3da3a32c824eb9aaeb5a1f39b
2025-02-24 01:32:38 -08:00
Jakub Piasecki 7b5b7b20de Update VirtualizedSectionList props name (#49592)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49592

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69984225

fbshipit-source-id: 753917f31a803c3bc8ea2e4635ec1d58cecb9224
2025-02-23 23:59:51 -08:00
Mateo Guzmán 021167ea57 Remove MessageQueueThreadHandler.java to fix CI (#49613)
Summary:
MessageQueueThreadHandler was migrated to Kotlin in https://github.com/facebook/react-native/pull/49583 but during merging the Java file was kept, this is currently breaking the `build-android` action in CI. [See this action for example](https://github.com/facebook/react-native/actions/runs/13472084782/job/37646841097?pr=49607)

## Changelog:

[INTERNAL] - Remove MessageQueueThreadHandler.java implementation to fix CI

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

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

Reviewed By: fkgozali

Differential Revision: D70059045

Pulled By: arushikesarwani94

fbshipit-source-id: 93665a8ac4ccc1cb1b03908179e2fcd12c61b3dd
2025-02-23 12:52:35 -08:00
Devan Buggay 1fe8d587a8 Remove sharedApplication use in SafeAreaProxy (#49612)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49612

`[UIApplication sharedApplication]` is not allowed in Mac Catalyst. This #ifdef's it out which is a common pattern elsewhere.

Changelog: [Internal]

Reviewed By: shwanton

Differential Revision: D69971189

fbshipit-source-id: 89dbc0a02ed2a06936f910fbfc13e1fb91972540
2025-02-21 18:20:26 -08:00
Samuel Susla 814e1ebff6 avoid sync dispatch with locked mutex in RCTKeyWindowValuesProxy (#49605)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49605

changelog: [internal]

Calling `RCTUnsafeExecuteOnMainQueueSync` while holding a lock can lead to a deadlock. In this diff, we remove it from RCTKeyWindowValuesProxy.

Reviewed By: javache

Differential Revision: D69997888

fbshipit-source-id: a09fc641c9fb2aec59aef34e4047e1ef11cdaf02
2025-02-21 16:41:30 -08:00
Joe Vilches a003be0f23 Allow text links to be navigatable via keyboard by default v2 (#49381)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49381

A much improved version of my previous attempt in D68306316 (https://github.com/facebook/react-native/pull/48773).

Instead of LinkMovementMethod which makes TextViews scrollable if they overflow, this implementation uses `ExploreByTouchHelper`'s `onVirtualViewKeyboardFocusChanged` and `onPerformActionForVirtualView` to handle focus changes and clicks on virtual views (aka spans in our case). This impl will correctly ellipsize text and allow tab to nav through the links.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D69551206

fbshipit-source-id: 6a88ccd507dc5534c1f494e3303c6bfc2bae5e9f
2025-02-21 16:10:03 -08:00