Commit Graph

12270 Commits

Author SHA1 Message Date
Rubén Norte 7325531eae Fix all Excalidraw SVG diagrams in the docs (#50760)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50760

Changelog: [internal]

This updates all Excalidraw SVG diagrams in the repository to use the latest format exported by Excalidraw after the fix in https://github.com/excalidraw/excalidraw/pull/9386.

I basically opened every image in Excalidraw and re-exported it.

Reviewed By: lenaic

Differential Revision: D73107703

fbshipit-source-id: 4432e952f9e6ee29f59ef8a9ff05479552744a31
2025-04-16 07:24:33 -07:00
Ruslan Shestopalyuk 44c274ae6e Kotlinify ReactScrollViewManager
Summary:
## Changelog:
[Android] [Internal] - As in the title

Reviewed By: cortinico

Differential Revision: D72971263

fbshipit-source-id: 8bd0c4e29e48f7e3d47a97f1a4e988e7b0282646
2025-04-16 04:57:43 -07:00
Jakub Piasecki e0a506fac3 Import React namespace instead of specific types (#50749)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50749

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D73088912

fbshipit-source-id: 23e4d530fc3b7fb2a0611ba1721474671ab0b9fd
2025-04-16 03:58:58 -07:00
Ruslan Shestopalyuk e05c0e67d0 Migrate BridgelessReactContext (#50729)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50729

## Changelog:
[Android] [Internal] - As in the title

Reviewed By: cortinico

Differential Revision: D73033754

fbshipit-source-id: 624c36735ec29ce97e426289fd05cf3405fc93d7
2025-04-16 03:32:28 -07:00
Ruslan Shestopalyuk 0f9af750d4 Migrate ReactHorizontalScrollViewManager (#50703)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50703

## Changelog:
[Android] [Internal] - As in the title

Reviewed By: cortinico

Differential Revision: D72966797

fbshipit-source-id: e295b04719f4390242eebd707518cc261a1631c6
2025-04-16 03:11:30 -07:00
Mateo Guzmán b880d470e0 Make StatusBarModule internal (#50742)
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.statusbar.StatusBarModule).

## Changelog:

[INTERNAL] - Make com.facebook.react.modules.statusbar.StatusBarModule internal

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

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

Reviewed By: cortinico

Differential Revision: D73089888

Pulled By: rshest

fbshipit-source-id: c66c2bfe9e1a97855617374a9d46d1378e6e45a5
2025-04-16 02:53:32 -07:00
Ruslan Shestopalyuk 989fddc45d Migrate LayoutAnimationController (#50734)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50734

## Changelog:
[Android] [Internal] - As in the title

Reviewed By: cortinico

Differential Revision: D73040384

fbshipit-source-id: adb1ef4c505888deb65403a8339c7d8e1a82786e
2025-04-15 23:56:59 -07:00
Ruslan Shestopalyuk bb6f55e774 Migrate TurboModuleManagerDelegate to Kotlin (#50727)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50727

## Changelog:
[Android] [Internal] - As in the title

Reviewed By: cortinico

Differential Revision: D73031128

fbshipit-source-id: b61f46d6877e4fda55e87552874aed7a0bee2736
2025-04-15 23:50:46 -07:00
Alan Lee 0c77bb9f58 Suppress deprecation warning in OSS for BlobModule
Summary:
We have a different version of OkHttp internally and in OSS so we need to suppress these for now.
Only Error was supressed in previous diff, also suppress warning.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D73085528

fbshipit-source-id: a38a6e15e8ca33d4e93678c54d337ad9e86c2bbe
2025-04-15 22:50:48 -07:00
Alan Lee a070d529fc Suppress deprecation error in OSS for BlobModule (#50748)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50748

We have a different version of OkHttp internally and in OSS so we need to suppress these for now.

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D73079163

fbshipit-source-id: 1928b00acbba5bc6577a248bc46a091d5b970f10
2025-04-15 20:45:07 -07:00
Alan Lee c2aa4c14e9 fix naming error in AndroidInfoModule
Summary:
const val NAME had quotes around it breaking native module loading from CoreReactPackage
This error was uncaught in previous diff.

Changelog:
[Internal]

Reviewed By: makovkastar

Differential Revision: D73070533

fbshipit-source-id: a7f14f4b4bd25003529c625d9182554dd2c2ee3e
2025-04-15 18:14:30 -07:00
Alan Lee 912b10416d Fix crash with wrong type comparison in TurboModuleInteropUtils.kt (#50744)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50744

Crash was discovered after converting source code from Java to Kotlin.
This was due to type checking against Kotlin types instead of Java types.
Also added minor refactoring of code

Changelog:
[Internal]

Reviewed By: Abbondanzo

Differential Revision: D73064216

fbshipit-source-id: 3429f0627740438be3bbc345c9e7b2c4a535da7e
2025-04-15 16:24:48 -07:00
Fabrizio Cucci a89f67fe9c Kotlinify BlobModule
Summary:
As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D72866832

fbshipit-source-id: 7e67224859a4526ce535f6fc1b17daa08ee1a046
2025-04-15 15:05:38 -07:00
Alan Lee a13f84adcc Convert CoreReactPackage.java to Kotlin (#50709)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50709

Convert Java to Kotlin

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D72825456

fbshipit-source-id: 4c71ae9892c217a722a74d662f6ae1ca68b97d3f
2025-04-15 11:47:24 -07:00
Ruslan Lesiutin c9bee009c3 Record Microtasks step (#50586)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50586

# Changelog: [Internal]

We are going to record microtasks phase of the Event Loop.

RAII reporter that was added in D69399955 will be updated to support phase as a parameter.

There is one downside of the current implementation. Every Event Loop task will have a corresponding "Run Microtasks" block displayed, even if the microtasks queue was empty. There is no API in `jsi` that would allow us to get the size of the queue. If we had that, we could emit this event only when there is something in a microtasks queue.

The good this is that these frames usually have duration of 1-2 microseconds, so they are not visible, until user fully zooms in.

Reviewed By: rubennorte

Differential Revision: D72649816

fbshipit-source-id: d597f5b75aaf0975b14f61d2aa28b9c8bc34f4d5
2025-04-15 10:40:51 -07:00
Andrew Datsenko 5bf54bc1f8 Add support for multiple TurboModule providers (#50707)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50707

Changelog: [Internal]

Reviewed By: zeyap

Differential Revision: D72968663

fbshipit-source-id: 87026d0a774b3b44980095c31f6df697717951ff
2025-04-15 10:14:07 -07:00
Mateo Guzmán a8bb7ea67a Make JSTimers internal (#50711)
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.core.JSTimers).

## Changelog:

[INTERNAL] - Make com.facebook.react.modules.core.JSTimers internal

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

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

Reviewed By: cortinico, rshest

Differential Revision: D73010826

Pulled By: arushikesarwani94

fbshipit-source-id: ab86059e927350340e379832184d15ccede34207
2025-04-15 09:31:00 -07:00
Peter Abbondanzo 8726e26348 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java (#50705)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50705

Changelog: [Android][Breaking] - Convert NetworkModule to Kotlin, mark methods as final

Reviewed By: mlord93

Differential Revision: D72731227

fbshipit-source-id: 80569f1cc88754492f48fca558db7eab3e1c28b2
2025-04-15 09:26:31 -07:00
Sanjaiyan Parthipan 38fefb2771 Minor Performance and Code Quality Improvements ✈️ (#50682)
Summary:
*Hi,*

I made a small update to the dependency array in `useLayoutEffect`, changing it from `[native]` to `[native.value]` for better precision. Since JavaScript compares objects by reference, this change can lead to a minor performance improvement. Additionally, as `useLayoutEffect` is render-blocking, I wanted to ensure we optimize its usage as much as possible.

As a micro-optimization and in line with good coding practices, I also changed a `let + if` variable to `const`. While the performance gain is minimal, it contributes to cleaner and more consistent code.

Please feel free to review, and I sincerely apologize if I made any mistakes in the process.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
*[General] [Changed]* – Refined `useLayoutEffect` dependency array from `[native]` to `[native.value]` for improved precision and efficiency in re-renders.
*[General] [Changed]* – Replaced `let` with `const` where applicable for better code standards and micro-optimization.

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

Reviewed By: huntie

Differential Revision: D72979663

Pulled By: yungsters

fbshipit-source-id: 64ac09811b78ca67be903d8cd91da8cd6f0a45fa
2025-04-15 09:17:02 -07:00
Mateo Guzmán be247076bd Make DrawerOpenedEvent internal (#50712)
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.drawer.events.DrawerOpenedEvent).

## Changelog:

[INTERNAL] - Make com.facebook.react.views.drawer.events.DrawerOpenedEvent internal

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

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

Reviewed By: cortinico

Differential Revision: D73010844

Pulled By: arushikesarwani94

fbshipit-source-id: 0fe44c20d0ad0d82d37f5920e37158b20f61479a
2025-04-15 08:47:36 -07:00
Rubén Norte 4930d83d51 Move docs for specs_DEPRECATED to __docs__ to follow the convention (#50724)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50724

Changelog: [internal]

TSIA

Reviewed By: huntie

Differential Revision: D73027507

fbshipit-source-id: 3028a30758de0dcb6eff22ce5ef0b6d962227455
2025-04-15 08:34:41 -07:00
Rubén Norte 2b3726b6a3 Add README explaning why we have the Fantom specs in src/private (#50723)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50723

Changelog: [internal]

TSIA

Reviewed By: huntie

Differential Revision: D73027410

fbshipit-source-id: c48c384373bd906344a9604a17102b1e9881b34f
2025-04-15 08:34:41 -07:00
Rubén Norte a482726a44 Use SVG for all diagrams in RN (#50722)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50722

Changelog: [internal]

Just replacing PNG with SVG in a diagram.

Reviewed By: huntie

Differential Revision: D73026611

fbshipit-source-id: 641b40e410ac60bee9afaec3afe454d7ad459044
2025-04-15 08:34:41 -07:00
Fabrizio Cucci c74a2cfb36 Kotlinify TouchTargetHelper (2nd attempt) (#50733)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50733

Second attempt after the first diff (i.e. D72716749) was reverted (i.e. D72796716) due to input breakage (see [post](https://fb.workplace.com/groups/rn.panelapps/permalink/1176149354006489/)).

 groundhogday

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D72968558

fbshipit-source-id: b0f3713d000e383d59816fcd777dbc14f571e72b
2025-04-15 08:32:26 -07:00
rohitverma-d11 800b12406f Kotlinify ReactLifecycleStateManager (#50685)
Summary:
Implemented ReactLifecycleStateManager.java in Kotlin as part of Kotlin-ifying RN Round 3

## Changelog:

[ANDROID] [CHANGED] - Migrate ReactLifecycleStateManager to Kotlin

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

Test Plan: Run RN-Tester and interacted with Mulitple components(Image, Flatlist, Input ) with both new architecture enabled and disabled

Reviewed By: rshest

Differential Revision: D73003097

Pulled By: cortinico

fbshipit-source-id: 27b90a0b94c17aa42cbb1665ca6fcf06db7cbf96
2025-04-15 07:51:14 -07:00
Mateo Guzmán 555ffd82e8 Make ReactRootViewTagGenerator internal (#50687)
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.uimanager.ReactRootViewTagGenerator).

## Changelog:

[INTERNAL] - Make com.facebook.react.uimanager.ReactRootViewTagGenerator internal

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

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

Reviewed By: rshest

Differential Revision: D73029600

Pulled By: cortinico

fbshipit-source-id: daaa76c823e8b55983e1219766f025301c0db881
2025-04-15 07:39:07 -07:00
Jakub Piasecki 81db7e7426 Omit mouse events from Pressable props (#50717)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50717

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D73018165

fbshipit-source-id: 7a5ec463adf614587d107ae052e1cd413d24c189
2025-04-15 05:02:32 -07:00
poonamjain96 a0f016ecad Migrated file ReactStylesDiffMap to kotlin (#50616)
Summary:
This PR aims to migrate ReactStylesDiffMap from Java to kotlin as part of https://github.com/facebook/react-native/issues/50513

## Changelog:
[ANDROID][CHANGED]Migrate ReactStylesDiffMap to Kotlin

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

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

Test Plan: Tested on RN tester with both new and old arch

Reviewed By: alanleedev

Differential Revision: D72962016

Pulled By: cortinico

fbshipit-source-id: 4de63ab78cd692822c01b5964209000c9d41f595
2025-04-15 04:23:18 -07:00
Jakub Piasecki 86bede9c60 Update hermes-parser and related packages in fbsource to 0.28.0 (#50695)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50695

Bump hermes-parser and related packages to 0.28.0.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D72693713

fbshipit-source-id: f529b78a933ae7a6497f67f1f616c1acb95995c3
2025-04-15 03:56:39 -07:00
Ruslan Shestopalyuk 49d3d0fd9d Migrate MaintainVisibleScrollPositionHelper (#50701)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50701

## Changelog:
[Android] [Internal] - As in the title

Reviewed By: cortinico

Differential Revision: D72965907

fbshipit-source-id: f5e2faebf950ab8ba337bf133c2e049af6c43a2e
2025-04-15 03:18:44 -07:00
Dawid Małecki eb67bec958 Use sum of subpaths instead of path.join in no-deep-imports lint rule (#50718)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50718

On Windows `path.join` returns path with separators unsupported by resolution mechanism. This change enforces the use of `/` separators in `no-deep-imports` rule tests.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D73021185

fbshipit-source-id: d4799c01a5aef5b27fad961d774b58627115d213
2025-04-15 02:39:48 -07:00
David Vacca e8da86a7fe Reduce log level for NativeModuleRegistry.onBatchComplete (#50715)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50715

This diff reduces the log level for NativeModuleRegistry.onBatchComplete(), to track logs before throwing exceptions

changelog: [internal] internal

Reviewed By: makovkastar

Differential Revision: D72999456

fbshipit-source-id: 9ea2f7ed4c86be78837ec2011e3e17e3b2126120
2025-04-14 20:56:07 -07:00
David Vacca e1f562fc2b Categorize LegacyArchitectureLogger soft errors as SOFT_ASSERTIONS (#50714)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50714

This diff changes the category used by LegacyArchitectureLogger soft errors to be SOFT_ASSERTIONS

changelog: [internal] internal

Reviewed By: makovkastar

Differential Revision: D72999455

fbshipit-source-id: b5378fb92b22a3d06dda550192c7eba0db97ddcb
2025-04-14 20:56:07 -07:00
Nick Gerleman a7e7651586 Use standard infra for sample legacy module example
Summary: Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D72896577

fbshipit-source-id: 5d3d10a274385e9c73eda48f841fdf58e1f0869a
2025-04-14 19:34:27 -07:00
priyanka.raghuvanshi 2834825b8b Migrate ReactClippingViewGroupHelper.java to Kotlin (#50679)
Summary:
Migrated ReactClippingViewGroupHelper.java to Kotlin as part of the React Native Kotlin migration initiative.
This change helps modernize the React Native Android codebase and improve maintainability.
No functional changes were introduced—only a language conversion while preserving the original logic and behavior.

## Changelog:
[ANDROID] [CHANGED] - Migrated ReactClippingViewGroupHelper.java to Kotlin

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

Test Plan:
 Ran yarn && yarn android in the root directory and verified RNTester builds successfully.
  Opened RNTester on an Android emulator/device and navigated through various screens to ensure the app works as expected.
 Specifically tested views with removeClippedSubviews enabled to confirm runtime behavior remains unchanged.
 Used [KtFmt](https://github.com/facebook/ktfmt) to format the Kotlin file properly.

Reviewed By: arushikesarwani94

Differential Revision: D72973621

Pulled By: cortinico

fbshipit-source-id: e6f426a0cb7eb583935a560660900b29786df4c3
2025-04-14 18:18:36 -07:00
Jorge Cabiedes Acosta fc9f2fe0ea Fix keyboard navigation for FlatList with removeClippedSubviews enabled (#50105)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50105

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

When using `ReactScrollView` or `ReactHorizontalScrollView` Views with `removeClippedSubviews` keyboard navigation didn't work.

This is because keyboard navigation relies on Android's View hierarchy to find the next focusable element. With `removeClippedSubviews` the next View might've been removed from the hierarchy.

With this change we delegate the job of figuring out the next focusable element to the Shadow Tree, which will always contain layout information of the next element of the ScrollView.

We then prevent the clipping of the topmost parent of the next focusable view to lay out the entire containing element in case we have some necessary context in the parent

Changelog: [Android][Fixed] - Fix keyboard navigation on lists with `removeClippedSubviews` enabled

Reviewed By: joevilches

Differential Revision: D71324219

fbshipit-source-id: b55b7735a30714b2a5e1c9e0ed4ae84ab43f6694
2025-04-14 18:08:36 -07:00
Jorge Cabiedes Acosta d56971011a Add fabric implementation to find Top-Most relative and relevant parent of a child view (#50404)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50404

Add another function to fabric to get the topmost stacking context parent given a root and a child.

This is to be used on focus searching algorithm in the case where the next focusable child is deeper in the hierarchy meaning we need to find the top most parent in the Android hierarchy and lay that out as well before transferring focus.

If we don't lay out the parent as well as the next focusable view:

- The next focusable view might lack context given by the parent
- If the parent is a scrollview and has removeClippedSubviews enabled then laying out the next focusable view will not work
- If the view is deeper in the android hierarchy in some cases it won't be layed out unless the parent is

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D72178408

fbshipit-source-id: 7b91ea695e236f3a92f9703bcc9ca943bf0dec24
2025-04-14 18:08:36 -07:00
Jorge Cabiedes Acosta c8a9b9d342 Add fabric implementation to find next focusable view (#50196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50196

Currently when `removeClippedSubviews` is enabled on Android keyboard navigation breaks and we can never focus the elements that are clipped. iOS has a similar issue but not as drastic, it only happens when elements on the FlatList have a lot of margin between them.

This algorithm aims to find the next focusable view and return it to native so that we can prevent the clipping of the view on the view clipping algorithm and hence fix keyboard navigation. For more information see D71324219

Fabric algorithm to find the next focusable view given:

`parentTag`: Top most relevant parent of the focused view
`focusedTag`: Tag of the currently focused view
`direction`: Direction in which focus is moving

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D71558965

fbshipit-source-id: 1a13c82d067834337e7f7936860780f467c9a15d
2025-04-14 18:08:36 -07:00
Jorge Cabiedes Acosta 96e49330f8 Add KeyboardFocusableNode ShadowNodeTrait
Summary:
Introduce a trait to be able to tell if a ShadowNode is focusable by keyboard. This will be used for focus ordering that delegates the work to the shadow tree when Native platforms don't have enough information to define the next focusable node

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D72258544

fbshipit-source-id: dcc2410b408eab5dbefc4512e0680cbe7f18c811
2025-04-14 18:08:36 -07:00
Joe Vilches 0929697a6d Fix some edge cases with box shadow (#50638)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50638

There were two issues with inset shadows here that I fixed

* If spread was big enough it would "invert" the clear region. [RectF's inset](https://developer.android.com/reference/android/graphics/RectF#inset(float,%20float)) method does not bound to a 0x0 rect, it will instead start making the rect bigger if the inset value is large enough.
* If the clear region was outside the rect the shadow disappeared. This is because [Canvas's drawDoubleRoundRect](https://developer.android.com/reference/android/graphics/Canvas#drawDoubleRoundRect(android.graphics.RectF,%20float[],%20android.graphics.RectF,%20float[],%20android.graphics.Paint)) will fail to draw if the inner rect is not completely inside of the outer.

Changelog: [Android][Fixed] - Fix inset shadow edge cases

Reviewed By: GijsWeterings

Differential Revision: D72833275

fbshipit-source-id: 3f42fb767630319c51a380f8ea28d682df9771a6
2025-04-14 13:57:54 -07:00
David Vacca ab7ef77120 Update assert message in ReactNativeNewArchitectureFeatureFlags (#50666)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50666

This diff updates the assert message in ReactNativeNewArchitectureFeatureFlags to reflect the behavior required by the assert

changelog: [internal] internal

Reviewed By: mlord93

Differential Revision: D72868428

fbshipit-source-id: 7a43aa9d3b3a2ee60e88cf77d117d97edc955af3
2025-04-14 13:50:53 -07:00
Omar Bafagih 5aa8288e85 Convert ReactProp.java to Kotlin (#50671)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50671

Changelog:
[Internal]

Reviewed By: cortinico

Differential Revision: D72803988

fbshipit-source-id: 00bacd99f1bde19d905eba71a820496ad6328b2c
2025-04-14 13:22:09 -07:00
Mateo Guzmán 47157aaf3a Make ClearableSynchronizedPool internal (#50690)
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.common.ClearableSynchronizedPool).

## Changelog:

[INTERNAL] - Make com.facebook.react.common.ClearableSynchronizedPool internal

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

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

Reviewed By: cortinico

Differential Revision: D72948047

Pulled By: rshest

fbshipit-source-id: c1fab4dc50a0244f57f771c5976d5e549ac7c40f
2025-04-14 12:21:06 -07:00
Alan Lee f9c318b05d Convert TurboModuleManager.java to Kotlin (#50706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50706

Convert Java to Kotlin

Changelog:
[Internal]

Reviewed By: cortinico

Differential Revision: D72771539

fbshipit-source-id: 2646987d12bfed35a1692b96a8548a0952fc41d7
2025-04-14 10:40:32 -07:00
Ruslan Shestopalyuk 309ccb8b60 IntBufferBatchMountItem - migrate to Kotlin (#50700)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50700

## Changelog:
[Android] [Internal] - IntBufferBatchMountItem is now in Kotlin

Reviewed By: cortinico

Differential Revision: D72965060

fbshipit-source-id: d036030ddd3fbd0bc387e02236ee330bb310ca64
2025-04-14 10:37:01 -07:00
Jakub Piasecki f622923374 Update VirtualizedLists react-native imports (#50551)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50551

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D72634484

fbshipit-source-id: 128c4eb1b8d7ca2f3821d138afb6750c19bc5f84
2025-04-14 10:32:48 -07:00
Alan Lee 402ada828a Convert DevToolsReactPerfLogger.java to Kotlin
Summary:
Convert Java to Kotlin

Changelog:
[Internal]

Reviewed By: rshest

Differential Revision: D72773730

fbshipit-source-id: 1dfd0b70b950f7270497afcdac3ba465e4d017e1
2025-04-14 10:07:07 -07:00
Jakub Piasecki c008604e0a Fix changing font scale breaking text (#45978)
Summary:
Fixes https://github.com/facebook/react-native/issues/45857

The general idea behind this PR is the same for both platforms: dirty all nodes with `MeasurableYogaNode` trait when the layout is constrained with a new `fontSizeMultiplier`. There were a few caveats:
- `ParagraphShadowNode` marks its layout as clean in the constructor in most cases. To prevent that from using a stale measurement I'm using the font scale multiplier stored in `content_` property of the node. That value is then compared with the scale used to create the attributed string kept in the node's state. If those differ, the layout is not cleared.
- On Android, font scale wasn't passed down to the `SurfaceHandler`
- On Android, text measurement relies on cached `DisplayMetrics` which were not updated when the system font scale changed.
- `AndroidTextInputShadowNode` wasn't using `fontSizeMultiplier` at all. I needed to add it in all places where an `AttributedString` is constructed.

## Changelog:

[GENERAL] [FIXED] - Fixed text not updating correctly after changing font scale in settings

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

Test Plan:
So far tested on the following code:

```jsx
function App() {
  const [counter,setCounter] = useState(0);
  const [text,setText] = useState('TextInput');
  const [flag,setFlag] = useState(true);

  return (
    <SafeAreaView
        style={{
          flex: 1,
          backgroundColor: '#fff',
          alignItems: 'center',
          justifyContent: 'center',
        }}
    >
      <Text style={{fontSize: 24}}>RN 24 Label Testing {flag ? 'A' : 'B'}</Text>
      <TextInput value={text} onChangeText={setText} style={{fontSize: 24, borderWidth: 1}} placeholder="Placeholder" />
      <Pressable onPress={() => setCounter(prevState => prevState + 1)} style={{backgroundColor: counter % 2 === 0 ? 'red' : 'blue', width: 200, height: 50}} />
      <Pressable onPress={() => setFlag(!flag)} style={{backgroundColor: 'green', width: 200, height: 50}} />
    </SafeAreaView>
  );
}
```

Reviewed By: NickGerleman

Differential Revision: D71727907

Pulled By: j-piasecki

fbshipit-source-id: 240fb5fa4967a9182bce7e885798b233d1e25aea
2025-04-14 08:57:05 -07:00
Alan Lee d791a85911 Convert TurboModuleInteropUtils.java to Kotlin
Summary:
Convert Java to Kotlin

Changelog:
[Internal]

Reviewed By: rshest

Differential Revision: D72752341

fbshipit-source-id: d8e760244f433328ea48533fc694c2a6d62f7b1c
2025-04-14 08:50:02 -07:00
Tim Yung 68cad5d2d3 RN: Configure Hermes Parser for React 19 (#50377)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50377

Configures the Hermes Parser to target React 19, which changes components written with Component Syntax to stop generating `forwardRef` calls (because `ref` is now a prop).

Changelog:
[General][Changed] - Configured Hermes Parser to target React 19, resulting in Component Syntax no longer producing `forwardRef` calls.

Reviewed By: javache, SamChou19815

Differential Revision: D72070021

fbshipit-source-id: b891789d4ff1cbcb8eebea3525361ab14e628b51
2025-04-14 08:36:24 -07:00