Commit Graph

38536 Commits

Author SHA1 Message Date
Rubén Norte 46b55d2146 Basic implementation of structuredClone (#51248)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51248

Changelog: [internal]

This implements an initial version of `structuredClone`, but only to be used internally (not exposed as a global yet).

The goal is to use this implementation to fix the semantics of the `detail` field in performance entries, which is meant to be cloned.

Reviewed By: hoxyq

Differential Revision: D71407320

fbshipit-source-id: c7ec1229f9c3414d8b95110da6f65828d74b8c8e
2025-05-13 14:29:01 -07:00
Rubén Norte 955c61c738 Implement DOMException (#51247)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51247

Changelog: [internal]

This implements an initial version of `DOMException`, but only to be used internally (not exposed as a global yet).

The goal is to make this available to `structuredClone`, which will be added after this.

Reviewed By: hoxyq

Differential Revision: D71407318

fbshipit-source-id: b28f11542749ceef6485ff934a712eed941a4545
2025-05-13 14:29:01 -07:00
Samuel Susla 34e9cba764 fix crash in view culling where differentiator creates create instruction for existing view (#51294)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51294

changelog: [internal]

Fix a crash where a node that is supposed to be culled doesn't get visited because culling context is not updated.
The differentiator would generate a create instruction for a view that already exists.

Stack trace for the crash:
```
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x0000000111740874 libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x00000001117aa2ec libsystem_pthread.dylib`pthread_kill + 264
    frame #2: 0x0000000180171ea8 libsystem_c.dylib`abort + 100
    frame #3: 0x00000001802b0144 libc++abi.dylib`abort_message + 128
    frame #4: 0x000000018029fe4c libc++abi.dylib`demangling_terminate_handler() + 296
    frame #5: 0x000000018006f220 libobjc.A.dylib`_objc_terminate() + 124
    frame #6: 0x00000001375d1964 INFRAFramework`meta_terminate() + 5468
    frame #7: 0x00000001802af570 libc++abi.dylib`std::__terminate(void (*)()) + 12
    frame #8: 0x00000001802b2498 libc++abi.dylib`__cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 32
    frame #9: 0x00000001802b2478 libc++abi.dylib`__cxa_throw + 88
    frame #10: 0x0000000180093904 libobjc.A.dylib`objc_exception_throw + 384
    frame #11: 0x0000000180e6999c Foundation`-[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 268
    frame #12: 0x000000031a3bcfc8 XPLAT_6_Framework`-[RCTComponentViewRegistry dequeueComponentViewWithComponentHandle:tag:] + 528
    frame #13: 0x000000031a3ccdec XPLAT_6_Framework`RCTPerformMountInstructions(std::__1::vector<facebook::react::ShadowViewMutation, std::__1::allocator<facebook::react::ShadowViewMutation>> const&, RCTComponentViewRegistry*, RCTMountingTransactionObserverCoordinator&, int) + 356
    frame #14: 0x000000031a3ccc7c XPLAT_6_Framework`-[RCTMountingManager performTransaction:]::$_1::operator()(facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) const + 80
    frame #15: 0x000000031a3ccc20 XPLAT_6_Framework`decltype(std::declval<-[RCTMountingManager performTransaction:]::$_1&>()(std::declval<facebook::react::MountingTransaction const&>(), std::declval<facebook::react::SurfaceTelemetry const&>())) std::__1::__invoke[abi:ne190102]<-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&>(-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 40
    frame #16: 0x000000031a3ccbc8 XPLAT_6_Framework`void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:ne190102]<-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&>(-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 40
    frame #17: 0x000000031a3ccb94 XPLAT_6_Framework`std::__1::__function::__alloc_func<-[RCTMountingManager performTransaction:]::$_1, std::__1::allocator<-[RCTMountingManager performTransaction:]::$_1>, void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)>::operator()[abi:ne190102](facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 44
    frame #18: 0x000000031a3cba1c XPLAT_6_Framework`std::__1::__function::__func<-[RCTMountingManager performTransaction:]::$_1, std::__1::allocator<-[RCTMountingManager performTransaction:]::$_1>, void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)>::operator()(facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 44
    frame #20: 0x000000032f219804 XPLAT_1_Framework`std::__1::function<void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)>::operator()(this=0x000000016d4f0c78, __arg=0x000000016d4f0a10, __arg=0x000000016d4f0978) const at function.h:989:10
    frame #21: 0x000000032f219668 XPLAT_1_Framework`facebook::react::TelemetryController::pullTransaction(this=0x00000003f4680f00, willMount=0x000000016d4f0c98, doMount=0x000000016d4f0c78, didMount=0x000000016d4f0c58) const at TelemetryController.cpp:39:3
    frame #22: 0x000000031a3c5b28 XPLAT_6_Framework`-[RCTMountingManager performTransaction:] + 544
    frame #23: 0x000000031a3c5864 XPLAT_6_Framework`-[RCTMountingManager initiateTransaction:] + 456
    frame #24: 0x000000031a3c5240 XPLAT_6_Framework`__42-[RCTMountingManager scheduleTransaction:]_block_invoke + 308
    frame #25: 0x0000000131f81b84 BOTTOMFramework`__RCTExecuteOnMainQueue_block_invoke + 40
    frame #26: 0x000000018017c788 libdispatch.dylib`_dispatch_call_block_and_release + 24
    frame #27: 0x0000000180197278 libdispatch.dylib`_dispatch_client_callout + 12
    frame #28: 0x00000001801b2fcc libdispatch.dylib`_dispatch_main_queue_drain.cold.7 + 24
    frame #29: 0x000000018018c1c4 libdispatch.dylib`_dispatch_main_queue_drain + 1184
    frame #30: 0x000000018018bd14 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 40
    frame #31: 0x0000000180427fec CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
    frame #32: 0x00000001804229f8 CoreFoundation`__CFRunLoopRun + 1920
    frame #33: 0x0000000180421e3c CoreFoundation`CFRunLoopRunSpecific + 536
    frame #34: 0x0000000190f62d00 GraphicsServices`GSEventRunModal + 164
    frame #35: 0x0000000185bcec98 UIKitCore`-[UIApplication _run] + 796
    frame #36: 0x0000000185bd3064 UIKitCore`UIApplicationMain + 124
    frame #37: 0x0000000115fbf0bc PRODUCTFramework`main + 200
    frame #38: 0x00000001114293d8 dyld_sim`start_sim + 20
    frame #39: 0x0000000111506b4c dyld`start + 6000
```

Reviewed By: rubennorte

Differential Revision: D74654157

fbshipit-source-id: 9181bcd28524c71d0ca4620bd630dc0baa172386
2025-05-13 13:59:51 -07:00
Tomasz Zawadzki 4a8fda83e3 Fix deprecation message for BindingsInstallerHolder (#51295)
Summary:
This PR replaces non-existent `BindingsInstaller` with `BindingsInstallerHolder` in deprecation message for old variant of `BindingsInstallerHolder`.

## Changelog:

[GENERAL] [FIXED] - Fixed deprecation message for `BindingsInstallerHolder`

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

Reviewed By: javache

Differential Revision: D74656439

Pulled By: cortinico

fbshipit-source-id: b29ffabbc8f8218e13d305e9f5143f084fea8dea
2025-05-13 12:47:14 -07:00
Vincent Riemer 49002fa0b4 Expose ShadowNodeFamily to RawEvent (#51267)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51267

Changelog: [Internal]

This diff exposes the corresponding target ShadowNodeFamily to a RawEvent through a weak pointer. This is necessary for the upcoming move of pointer event interception from the JS to main thread.

Reviewed By: javache

Differential Revision: D74500630

fbshipit-source-id: 3bcf32855a004e091be64b6171dc65127375534c
2025-05-13 11:23:17 -07:00
Nicola Corti 4fda28ee4c Remove the "Newer Patch Available" logic from @react-native-bot (#51286)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51286

This bog action is not really useful. It's currently buggy and spams the user twice + we agreed it provide little value for the user.
Therefore we're removing this message for the time being.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D74645716

fbshipit-source-id: a6b8aa6aa3f3f101ad649d2590bbcb2dc80ee30a
2025-05-13 10:38:05 -07:00
Ruslan Shestopalyuk 80eed4a4a7 Fix data race in usage of ShadowTreeRevisionConsistencyManager (#51293)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51293

# Changelog:
[Internal] -

Indirect consequence of https://github.com/facebook/react-native/pull/50484, TSAN started to detect a data race in some configurations.

It's possible to have the data race between the `ShadowTreeRevisionConsistencyManager` being set in `RuntimeScheduler` and it being already used in the executor thread (as these things are generally done from different threads).

Differential Revision: D74651070

fbshipit-source-id: bda49371d541815119f119e6986de39c21f9b374
2025-05-13 09:39:04 -07:00
Nicola Corti 1d5bbf1ccf Cleanup several warnings inside DisplayMetricsHolder (#51074)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51074

While working on this class I noticed there are a number of warnings. Let's clean them up.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D74001269

fbshipit-source-id: 7e86ffdaf9c82ff5a165618813fa700f8e850a74
2025-05-13 08:44:29 -07:00
Mateo Guzmán 2c1726a073 Suppress unused androidx.core.content.res.use warning (#51272)
Summary:
Follow up from https://github.com/facebook/react-native/pull/51170, static code analysis shows androidx.core.content.res.use as unused, it looked pretty harmless to remove it as there was no context about its usage, but it caused some crashes.

I'm suppressing the warning here, plus adding an explanation on why it is needed to prevent a future developer from touching this file and causing the same regression.

## Changelog:

[INTERNAL] - Suppress unused androidx.core.content.res.use warning

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

Test Plan: Static code analysis should not show the import as unused.

Reviewed By: cortinico

Differential Revision: D74642726

Pulled By: rshest

fbshipit-source-id: 14cec4fe92f06827636410df4b88a3b7088abe52
2025-05-13 08:02:22 -07:00
Vitali Zaidman f5fba73439 Update debugger-frontend from bc635fa...3d17e0f (#51292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51292

Changelog: [Internal] - Update `react-native/debugger-frontend` from bc635fa...3d17e0f

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/bc635fa428baf08a0667f89e3ee03f92c2f96416...3d17e0fd462dc698db34586697cce2371b25e0d3).

Reviewed By: hoxyq

Differential Revision: D74648171

fbshipit-source-id: d2c45b6d27ab71a933a7c6d6fedc07abc13cf3d2
2025-05-13 07:39:12 -07:00
Nick Lefever 4166cc0dd8 Fix NaN value comparison for paragraph props diffing (#51289)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51289

Because NaN is always different from NaN, these Float props were always included in the diff when set to NaN. This checks for the specific case where both the current and the prev prop value is NaN.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74647582

fbshipit-source-id: 7941dcc6a96bed13c2e43232606bd1f9a9179606
2025-05-13 07:02:10 -07:00
Samuel Susla 3e3f8eade5 enable enableEagerAlternateStateNodeCleanup in tests (#51291)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51291

changelog: [internal]

enable enableEagerAlternateStateNodeCleanup in tests and remove workarounds.

Reviewed By: rubennorte

Differential Revision: D74643973

fbshipit-source-id: 00f9a6b36546fdea246b587e0e716c7aa76c6bbc
2025-05-13 07:00:26 -07:00
Nick Lefever 76ed662f1e Fix numberOfLines prop diffing for Paragraph component (#51277)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51277

The number of lines prop diffing was not being updated when enabling Props 2.0 and when set through the paragraph attributes. This diff fixes the typo that was causing the bug.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74619497

fbshipit-source-id: 2ad7d1629106ff16d511760694dcef0cafd9a96e
2025-05-13 05:27:17 -07:00
Nick Lefever cde792ae5e Add getDiffProps for TextInput component - Android text input props (#51276)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51276

This diff adds the Android specific props to the `getDiffProps` implementation and enables `TextInput` components for Props 2.0 use in the Fabric mounting manager

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74610303

fbshipit-source-id: c45abf2b272f5dfb50f4f1bad256e9130a808900
2025-05-13 05:27:17 -07:00
Nick Lefever 63c0287c83 Add getDiffProps for TextInput component - base text input props (#51275)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51275

See title

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74610301

fbshipit-source-id: cbd3f8eab75838f8b68a668ec44d3e14aa591f25
2025-05-13 05:27:17 -07:00
Nick Lefever d08e668a1a Add getDiffProps for TextInput component - paragraph attributes (#51274)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51274

See title

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74610302

fbshipit-source-id: ef1f946e0b7f7b51c06da167e5b8df2fc57933f6
2025-05-13 05:27:17 -07:00
Mateo Guzmán d7b056c198 Migrate JSTouchDispatcher to Kotlin (#51242)
Summary:
Migrate com.facebook.react.uimanager.JSTouchDispatcher to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.uimanager.JSTouchDispatcher to Kotlin

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

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

Reviewed By: cortinico

Differential Revision: D74568593

Pulled By: rshest

fbshipit-source-id: 2ce0087ce96025fd85aab2d61806cc9ada1d68cd
2025-05-13 05:05:51 -07:00
Mateo Guzmán 436bddadda Migrate ModuleSpec to Kotlin (#51240)
Summary:
Migrate com.facebook.react.bridge.ModuleSpec to Kotlin.

## Changelog:

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

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

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

Reviewed By: cortinico

Differential Revision: D74568550

Pulled By: rshest

fbshipit-source-id: 15cedc9e97f95aa2582ce12c9086336c12564371
2025-05-13 05:03:09 -07:00
Vitali Zaidman 9b4be02ae8 standardize error messages thrown from inspector proxy when connection is closed to debugger (#51227)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51227

Standardize error messages thrown from inspector proxy when connection is closed to debugger and link to where they are used in `react-native-devtools-frontend`

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D74484316

fbshipit-source-id: 7885bc5ea41397539814f97d764c9a376ef50eaa
2025-05-13 04:38:29 -07:00
React Native Bot d06c28833f Add changelog for v0.80.0-rc.1 (#51266)
Summary:
Add Changelog for 0.80.0-rc.1

## Changelog:
[Internal] - Add Changelog for 0.80.0-rc.1

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

Test Plan: N/A

Reviewed By: arushikesarwani94

Differential Revision: D74592294

Pulled By: cortinico

fbshipit-source-id: 0f06d14ddec054bea2f09e9e34079516eb0f9256
2025-05-13 03:52:20 -07:00
Tim Yung 12b2b56102 RN: Enable Hermes GC on Memory Pressure Warning (iOS) (#51271)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51271

Deletes the feature flag that was gating the new logic to invoke Hermes GC when iOS emits a memory pressure warning.

Changelog:
[iOS][Changed] - Hermes GC is now triggered in response to iOS memory pressure warning.

Reviewed By: fkgozali

Differential Revision: D74605206

fbshipit-source-id: b0753b15f5a30f37ed17bfebff0b491c7e7a6b59
2025-05-12 20:22:54 -07:00
Pieter Vanderwerff e30ba139b6 Deploy 0.270.0 to xplat (#51278)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51278

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D74622474

fbshipit-source-id: 6735c16ed9677050dc476e30671448d52c5ed6dd
2025-05-12 19:39:07 -07:00
Mateo Guzmán d469cca4ba Make SoftAssertions internal (#51172)
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.bridge.SoftAssertions).

## Changelog:

[INTERNAL] - Make com.facebook.react.bridge.SoftAssertions internal

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

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

Reviewed By: rshest

Differential Revision: D74368288

Pulled By: arushikesarwani94

fbshipit-source-id: 50e9559f7f15700ea9adfb03a260615e3b397a0c
2025-05-12 17:22:24 -07:00
Mateo Guzmán 23e693ad67 Make ReactSoftExceptionLogger internal (#51173)
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.bridge.ReactSoftExceptionLogger).

## Changelog:

[INTERNAL] - Make com.facebook.react.bridge.ReactSoftExceptionLogger internal

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

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

Reviewed By: rshest

Differential Revision: D74368261

Pulled By: arushikesarwani94

fbshipit-source-id: 913d790eb64ffda6bb48ddf69dd5ab996cd363d9
2025-05-12 17:22:24 -07:00
HyunWoo Lee b2ffd34a39 Refactor ReactAndroid to use buildReadableMap, buildReadableArray DSL (#51145)
Summary:
This PR refactors the entire ReactAndroid package to replace manual `Arguments.createMap()…` and `Arguments.createArray()…` calls with the new Kotlin DSL helpers `buildReadableMap { … }` and `buildReadableArray { … }`. All eligible call sites have been migrated to the DSL, except in functions whose signatures explicitly declare or return WritableMap or WritableArray.

No runtime behavior changes are introduced; existing functionality and tests continue to pass unchanged.

## Changelog:

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

Pick one each for the category and type tags:

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

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

[ANDROID] [CHANGED] Apply Collections DSL on ReactAndroid package

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

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

Reviewed By: rshest

Differential Revision: D74401357

Pulled By: cortinico

fbshipit-source-id: 0f7b7dfbb7b495675bc4730bdf018666e9041884
2025-05-12 16:35:07 -07:00
Joe Vilches d362e496eb Fix string comparison when self has accessibility order reference (#51270)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51270

I was informed that we could not reference ourselves with accessibility order when using `useID`. The reason for that ended up being because of this if statement which uses `==`. Note this worked with a normal string like `"foo"` but `useID` has ids like `"<<r0>>"` so I imagine the < and > made this break.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74601689

fbshipit-source-id: 25adc84248fbfcaff36607d18c170e6c8000cffb
2025-05-12 15:09:18 -07:00
Mofei Zhang af4cfbf03f repro edge cases for noEmit and module opt-outs (#33144)
Summary:
see test fixtures
 ---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/33144).
* #33146
* #33145
* __->__ #33144

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

Reviewed By: jackpope

Differential Revision: D74404265

fbshipit-source-id: 8a2fc2856e2da9ca7c63d8d49191c4f9e6b015b9
2025-05-12 13:51:47 -07:00
Fabrizio Cucci 4918b30f49 Kotlinify ViewManagerRegistry (#51262)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51262

As per title.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D74571782

fbshipit-source-id: 4acec9b9c0801d863074b7a91fb116780f22929a
2025-05-12 13:50:10 -07:00
Ruslan Lesiutin 7430ee0b99 Define precise return types for toJs conversions, instead of generic jsi::Value (#51224)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51224

Changelog: [Internal]

We have a bunch of places where we rely on implicit conversion operators of `jsi::Value` and return some primitive type.

This doesn't work well with Bridging, because currently it doesn't take into account these implicit operator conversions: primitives won't be treated as primitivies, but rather as generic `jsi::Value`, which could be many things.

We should be explicit about return type in `toJs`, because it affects the type checking logic.

Reviewed By: javache

Differential Revision: D74478571

fbshipit-source-id: 0633159c5af3a02aafe14e2b137c133d4554a5f8
2025-05-12 12:38:58 -07:00
Ruslan Lesiutin e403b510d0 Support bridging for Class methods return types (#51223)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51223

Changelog:
[General][Added] - Added support for bridging Class methods return types

Previously, this wouldn't work, unless you define your C++ implementation of the TM to have primitive return type that can be converted to JavaScript's type.

Reviewed By: javache

Differential Revision: D74478572

fbshipit-source-id: 75c7f589559394704446be1ebac245d38a5c4b2b
2025-05-12 12:38:58 -07:00
Mohamed Salama 775c16d8b4 Revert D74567102: Migrate PromiseImpl to Kotlin
Differential Revision:
D74567102

Original commit changeset: 1a7a36a88c04

Original Phabricator Diff: D74567102

fbshipit-source-id: 30814137c711757079fdc574dd21715089b23a25
2025-05-12 10:11:02 -07:00
Pieter De Baets 5413304530 Convert com.facebook.react.runtime.ReactHostImpl to Kotlin (#51017)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51017

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D73846053

fbshipit-source-id: 98017000e8f10df4156b232bc8b5d6e132502ea5
2025-05-12 10:02:19 -07:00
Tim Yung 7e5a2663f9 RN: Simplify createAnimatedPropsHook-test.js (#51234)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51234

Since `createAnimatedPropsHook-test.js` no longer needs to override feature flags, clean up some of the extra logic.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D74535116

fbshipit-source-id: 09dd4c5085f6ee1cbf7d87ab2b7c320119e69651
2025-05-12 09:15:43 -07:00
Szymon Rybczak 0925ee8545 Update Callstack description in ECOSYSTEM.md (#51226)
Summary:
Updates Callstack's description in `ECOSYSTEM.md` file.

## Changelog:

[Internal] - Updates Callstack's description in `ECOSYSTEM.md` file.

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

Test Plan: n/a

Reviewed By: NickGerleman

Differential Revision: D74483225

Pulled By: cortinico

fbshipit-source-id: baab5984b4580c0395c1a987a8890d8465e139f1
2025-05-12 08:14:45 -07:00
Rubén Norte 0766587b5d Add playground benchmark (#51259)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51259

Changelog: [internal]

We recently added `Playground-itest` as a quick way to test things with Fantom without committing them.

This does the same for benchmarks, so we can quickly answer questions like:

> is `key in obj` faster than `obj[key]`?

Without having to create a new benchmark manually.

Reviewed By: yungsters

Differential Revision: D74578297

fbshipit-source-id: d86604d459f15652d0c2e1ad16a99d011a1324ca
2025-05-12 07:59:59 -07:00
Evan Bacon eedd60b9e6 chore: convert View to React 19 (#51023)
Summary:
- Convert View implementation to React 19:
  - Remove legacy `forwardRef` in favor of built-in `ref` prop.
  - Use `use` API instead of `useContext`.
  - Drop the extraneous `.Provider` for `TextAncestor` context.
  - Remove `displayName` in favor of component name. I'm not 100% sure this is a full fallback but it is valid according to `react/display-name` eslint rule—https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/display-name.md
- Based on discussion with Nicola Carti and Riccardo Cipolleschi.
- I tried using flow `component` keyword but it's not enabled in this project. Given the `react-native` package is shipped untranspiled, it's probably safer to avoid newer flow types.
- Overall matched the component style of LogBox.
- It's unclear the exact right way to type a ref since it should be optional for external users of the component but required inside the component. Erring on the side of caution and using optional types so users don't get type errors when `ref` isn't defined.

## Changelog:

[GENERAL] [BREAKING] Upgrade `View` component to React 19.

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

Pick one each for the category and type tags:

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

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

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

Test Plan: - Type checks should pass.

Reviewed By: rshest

Differential Revision: D74546184

Pulled By: yungsters

fbshipit-source-id: b8257e3a75477c1117b19cd3f8e0843947b092ca
2025-05-12 07:14:22 -07:00
Samuel Susla 5d7f35cd7c add test for BaseTextProps.writingDirection (#51245)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51245

changelog: [internal]

Add test to prevent https://github.com/facebook/react-native/issues/51235 from happening in the future.

Reviewed By: cipolleschi, rubennorte

Differential Revision: D74571453

fbshipit-source-id: 49d8400543516a861c9034a8be562ee81b323c25
2025-05-12 06:14:14 -07:00
Jakub Piasecki c9f2055097 Fix generated types in @react-native/virtualized-lists being used without opt-in (#51246)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51246

Changelog: [General][Fixed] Fix generated types in react-native/virtualized-lists being used without opt-in

D71969602 introduces `exports` field to `package.json` files in `react-native` and `virtualized-lists`. In that diff, the `types` in `virtualized-lists` by default pointed to the new generated types without requiring the opt-in.

This fixes that by requiring the opt-in before using the generated types.

Reviewed By: huntie

Differential Revision: D74573321

fbshipit-source-id: fe05b0204a7200c1c91aac2614aa786bbbced2a5
2025-05-12 04:53:20 -07:00
Mateo Guzmán 25abb0acdf Migrate PromiseImpl to Kotlin (#51241)
Summary:
Migrate com.facebook.react.bridge.PromiseImpl to Kotlin.

## Changelog:

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

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

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

Reviewed By: rshest

Differential Revision: D74567102

Pulled By: cortinico

fbshipit-source-id: 1a7a36a88c0499e5bc35dc37d276219aaf823c90
2025-05-12 04:48:28 -07:00
Nick Lefever a12d9f9d33 Fix image source size props in getDiffProps (#51222)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51222

The size parameters are flattened in the source object in the Android image component. This diff converts the `size` object to `width` and `height` props directly set on the source object, fixing image source setting more than one image source.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D74477884

fbshipit-source-id: f6064b4222d5eeafd5d74f9a2044babedd1e291b
2025-05-12 04:01:03 -07:00
Nick Lefever 3edc8d4e2c Add getDiffProps for Paragraph component (#51219)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51219

See title

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D74473177

fbshipit-source-id: 88d8d29a1640fd9217460ac04f172f821bb47a91
2025-05-12 04:01:03 -07:00
Nick Lefever 571a0ae7bc Add getDiffProps for Text component (#51218)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51218

See title

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D74473101

fbshipit-source-id: 7303a8b184f42e8b264a2d37c5a6570252c64d54
2025-05-12 04:01:03 -07:00
Nick Lefever 0cdf5c16b4 Add updateDiffProps to BaseTextProps (#51217)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51217

Add helper method to build the prop diffing based on the BaseTextProps which are used by the Text and Paragraph props.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D74473004

fbshipit-source-id: 0ae8c0c033ee136da3b8376bd485f8926310dcd4
2025-05-12 04:01:03 -07:00
zhongwuzw 3461e98936 Fabric: Fixes Text style prop 'writingDirection' not working on IOS New Architecture (#51238)
Summary:
Fixes https://github.com/facebook/react-native/issues/51235 .

## Changelog:

[IOS] [FIXED] - Fabric: Fixes Text style prop 'writingDirection' not working on  IOS New Architecture

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

Test Plan: Repro please see https://github.com/facebook/react-native/issues/51235

Reviewed By: sammy-SC

Differential Revision: D74564832

Pulled By: cipolleschi

fbshipit-source-id: 82702ec3b3e963c454e23a9b18543cae6f378749
2025-05-12 03:56:25 -07:00
Mateo Guzmán 77fccb73fe Make DeprecatedInNewArchitecture internal (#51201)
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.annotations.DeprecatedInNewArchitecture).

This class in particular is not in the ReactAndroid.api, so I have the question on whether we should leave these annotations marked as public in case we are already reducing the visibility in another way (and If that's the case, we can close this PR)

## Changelog:

[INTERNAL] - Make com.facebook.react.common.annotations.DeprecatedInNewArchitecture internal

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

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

Reviewed By: rshest

Differential Revision: D74461086

Pulled By: cortinico

fbshipit-source-id: a58aa4794c91d632ce9f21a1021de7aa23e662f8
2025-05-12 03:46:30 -07:00
Riccardo Cipolleschi a3da4abb31 Remove react-native-exit-app from nightly testing (#51230)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51230

react-native-exit-app last commit is from 2 years ago.
Removing it as it is broken with our nightly integration

## Changelog:
[Internal] - Remove react-native-exit-app from nightly testing

Reviewed By: cortinico

Differential Revision: D74527792

fbshipit-source-id: 0974b2d857aa6f76c59b0411204798a5fe48cffe
2025-05-12 02:36:39 -07:00
Jakub Piasecki 32ce95cc01 Move transforms to build-types (#50982)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50982

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D73667539

fbshipit-source-id: dc9ab6f3efef17f8ffd58a854363b39a31ec59d7
2025-05-11 22:49:43 -07:00
Tim Yung 77c1eb6154 RN: Migrate VirtualView to Feature Flags (#51233)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51233

Migrates internal operational and experimental feature flags to React Native's feature flag system, in order to simplify integration of other infrastructure features (e.g. Fantom).

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D74534921

fbshipit-source-id: 1559cba4f208a554bb043a203f331062036c60de
2025-05-11 00:30:21 -07:00
Rubén Norte 996be87071 Add Playground test (#51220)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51220

Changelog: [internal]

Just a playground file to do quick tests in the Fantom environment.

For example, I just used it to know if Hermes supports `AggregateError`, which does:

```
  it('...', () => {
    console.log('AggregateError', global.AggregateError);
  });
```

{F1977824992}

Reviewed By: lenaic

Differential Revision: D74474870

fbshipit-source-id: cbe8a287738b09afe336ae479cc3105d1474e58b
2025-05-10 01:53:28 -07:00
Jan Kassens 32fafdf980 cleanup shipped flag enableFabricCompleteRootInCommitPhase
Summary:
Flag was removed in {D74196673}, this cleans up the dynamic flag.

bypass-github-export-checks

Changelog: [internal]

Reviewed By: jackpope

Differential Revision: D74493584

fbshipit-source-id: 6ade542b7e1bd9c4367b7dbef4d2f1ec2d79d0df
2025-05-09 23:01:51 -07:00