Commit Graph

38536 Commits

Author SHA1 Message Date
Mateo Guzmán ccc8ce0d01 Remove lint-java (#52092)
Summary:
Following up from https://github.com/facebook/react-native/pull/52064#discussion_r2151906096, this PR removes lint-java and its related files.

The codebase is moving entirely to Kotlin and a Kotlin linter is being setup as well, the usage of the Java linter will become unnecessary.

## Changelog:

[INTERNAL] - Remove lint-java

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

Test Plan: Relying on CI here to be green.

Reviewed By: cortinico

Differential Revision: D76880712

Pulled By: sbuggay

fbshipit-source-id: 2736772e7347f435b17d007e0322e1afc2fb2d7b
2025-06-18 08:22:04 -07:00
Krzysztof Piaskowy 1cc12ce7fd Fix the serialization of the alpha channel in the rgba() color string format (#52087)
Summary:
The alpha channel in the `rgba()` color string format should be a value between [0, 1] instead of [0, 255], as stated in the [React Native Documentation](https://reactnative.dev/docs/colors#red-green-blue-rgb).

## Changelog:

[GENERAL] [FIXED] - Fix the serialization of the alpha channel in the `rgba()` color string format.

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

Test Plan: I didn't find any usage of that function in React Native, but it is part of the public API, and I just wanted to use it in Reanimated.

Reviewed By: fabriziocucci

Differential Revision: D76822560

Pulled By: javache

fbshipit-source-id: 370d9729881c1eda794c1b9fe54d258242fde814
2025-06-18 07:28:34 -07:00
Oskar Kwaśniewski 28986a7599 fix(iOS): allow to interactively swipe down the modal (#51483)
Summary:
This PR allows to interactively close the modal using the swipe down gesture.

It fixes 5 year old issue: https://github.com/facebook/react-native/issues/29319

In short it removes `modalInPresentation` which according to the documentation causes: "UIKit ignores events outside the view controller’s bounds and **prevents the interactive dismissal of the view controller while it is onscreen.**".

It also adds another delegate event to call onRequestClose whenever modal is closed by gesture.

https://github.com/user-attachments/assets/8849ecba-f762-47ec-a28b-b41c1991a882

## Changelog:

[IOS] [ADDED] - Allow to interactively swipe down the modal.
Add allowSwipeDismissal prop.

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

Test Plan: Test if swiping down the modal calls onRequestClose

Reviewed By: rshest

Differential Revision: D75125438

Pulled By: javache

fbshipit-source-id: d4f2c8b59447680f405b725d0809573a937f97cf
2025-06-18 07:18:40 -07:00
Zeya Peng ce75271d47 Gate logic to remove js sync at end of native animation loop (#52068)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52068

## Changelog:

[Internal] [Changed] - Gate logic to remove js sync at end of native animation loop

because https://github.com/facebook/react-native/pull/51264 is causing regression in some cases, and was recently reverted again in https://github.com/facebook/react-native/pull/51933 . Using an extra feature flag to gate this potential optimization

Reviewed By: lenaic

Differential Revision: D76759441

fbshipit-source-id: 6950ab746b02af6e0b710ded0ddb6993673e5212
2025-06-18 06:54:09 -07:00
Zeya Peng 99c60bfe0a Create feature flag cxxNativeAnimatedRemoveJsSync (#52067)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52067

## Changelog:

[Internal] [Changed] - Create feature flag cxxNativeAnimatedRemoveJsSync for optimization in cxx animated

Reviewed By: christophpurrer

Differential Revision: D76763197

fbshipit-source-id: 503d7cea53b6a5c3ed769b0d77a9d64730029433
2025-06-18 06:54:09 -07:00
Ruslan Shestopalyuk a477ee6ced Update ReactNativeCPP.api file (#52103)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52103

## Changelog:
[Internal] -

This got out of sync again, causing the corresponding signal to fail.

Reviewed By: lenaic

Differential Revision: D76893994

fbshipit-source-id: e0e78cd41633972be53aa883c6015588b547b9c2
2025-06-18 06:38:35 -07:00
Rubén Norte a17a7003b1 Remove unnecessary feature flags from fantom tests (#52101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52101

Changelog: [internal]

`enableAccessToHostTreeInFabric` is enabled by default in tests, so doesn't need to be explicitly set.

Reviewed By: lenaic

Differential Revision: D76894319

fbshipit-source-id: 437a763bd9c557ecbafa53e31410da1120151b86
2025-06-18 06:03:12 -07:00
Vincent Wong f70c01cc30 Revert D76757706: Fix LegacyViewManagerInteropComponentDescriptor
Differential Revision:
D76757706

Original commit changeset: 6fc6127b6ff4

Original Phabricator Diff: D76757706

fbshipit-source-id: 88a72c06dd799c322320870c69906cb843a6021d
2025-06-18 04:54:32 -07:00
Ruslan Shestopalyuk bc6b4f0525 Specify missing default destructor and assignment operator declarations in ImageRequest (#52099)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52099

# Changelog:
[Internal] -

Fixes a linter warning for the `ImageRequest` class declaration (AKA "C++ rule of 5").

Reviewed By: javache

Differential Revision: D76888523

fbshipit-source-id: aa080a582942bd083030d6b6ecd82294566b507c
2025-06-18 04:43:28 -07:00
Enrique López Mañas 73133a31d5 Deprecating SafeAreaView (#51896)
Summary:
`SafeAreaView` has been marked for deprecation some time ago. The [following discussion](https://github.com/react-native-community/discussions-and-proposals/discussions/827) summarizes some of the arguments for it, but in a nutshell: it is iOS-only, limited in functionality, and incompatible with Android 15's enforced edge-to-edge rendering.

~~The Android/Kotlin classes have also been deprecated.~~ Not anymore, they are internal and might stay as they are.

## Changelog:

[General] [Deprecated] - Deprecate SafeAreaView due to its iOS-only support and incompatibility with Android 15 edge-to-edge behavior; recommend using react-native-safe-area-context instead.

<!-- 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/51896

Test Plan: Access `SafeAreaView` in your code and check that the deprecation warning logs exactly once in the console.

Reviewed By: rshest

Differential Revision: D76816160

Pulled By: cortinico

fbshipit-source-id: 60f539f9425f8ed8e19578a4530cb1f7d9b54488
2025-06-18 04:15:05 -07:00
Nicola Corti 9258e90c92 Publish, Close and Release the Maven repository during build_npm_package
Summary:
Due to us moving to central.sonatype.com for publishing, we cannot publish and release the Maven repository in 2 distinct invocations.
This consolidates all the publishing job to happen during build_npm_package

Changelog:
[Internal] [Changed] -

Reviewed By: fabriziocucci

Differential Revision: D76888543

fbshipit-source-id: 3cb0db6176ed2221a12b4f3f1f575232aa006a6c
2025-06-18 04:02:28 -07:00
Fabrizio Cucci f783d30beb Add changelog for 0.79.4 (#52100)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52100

As pet title.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D76889179

fbshipit-source-id: 7551ade832a88ff8d6501945228e50d2572006bb
2025-06-18 03:16:48 -07:00
Samuel Susla 2915902763 introduce gesture driven animations sync mechanism for C++ Animated (#52081)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52081

changelog: [internal]

# The problem in Java and Obj-C Native Animated
--------------------

Event based animations in Native Animated have one big problem: detecting when the gesture is completed. This has led to number of bugs over the years that manifest as Pressable's onPress not triggering. The root cause of the problem is disconnect between where a piece of UI is on the screen and where Fabric thinks it is. Fabric is used for hit testing, and other things like intersection observing, and if Fabric does not have up to date values, weird things start happening.

This diff implements completion detection for event based animations. Unlike previous solutions, it does not depend on sequence of events nor it uses React setState to update shadow tree.

# Completion Detection
--------------------

The key mechanism for marking event animations as completed is in the `onRender` method:

- After processing animations, if `onAnimationFrame` returns false - indicating no UI changes, the system assumes all event-driven animations have completed.
- it then:
    *   Collects all animated value nodes connected to event drivers.
    *   Updates all nodes connected to these "finished" animations.
    *   isEventAnimationInProgress_ to false.
    *   Commits final property values to the UI.

The benefits over the previous solution:
- It works across all platforms without the need to emit "completion events".
- It uses a UI frame that wouldn't animate anything to do syncing work. Using main thread IDLE time towards bookkeeping.
- No need to call into JavaScript for synchronisation.

Reviewed By: zeyap

Differential Revision: D76743467

fbshipit-source-id: b21ab5ef9c71ff93fd0250e6af6b22ded395be8d
2025-06-18 02:38:43 -07:00
Soe Lynn c31ff55b92 Fix LegacyViewManagerInteropComponentDescriptor (#52094)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52094

Changelog [Internal]:
- LegacyViewManagerInteropComponentDescriptor was initiaizing Module just to get the `Class` for `componentName`. This can cause deadlock issue when we have module that needs mainQueue to initialize.

Reviewed By: RSNara

Differential Revision: D76757706

fbshipit-source-id: 6fc6127b6ff472fda509364f0c3daa13b6a6df1e
2025-06-17 22:16:43 -07:00
Jorge Cabiedes Acosta d405e306e3 Make experimental_accessibilityOrder a View prop only (#52056)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52056

This prop should only be used on Views using it in Text is not very intuitive and also would require some unnecessary edge case handling on Android which we now also remove

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D76744972

fbshipit-source-id: 23113789747295ea1a306727f1e29e3ddc078ac4
2025-06-17 18:07:58 -07:00
Ramanpreet Nara ad88309843 Compile out the legacy runtime
Summary:
Compile out the legacy c++ core from android.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D72991984

fbshipit-source-id: 56bb6ca1c4797adb9235e982121712b11e85e109
2025-06-17 16:02:03 -07:00
FBLite Revert Bot fd29d68c16 Revert D76793705: Fix possible invalid measurements when width or height is zero pixels
Differential Revision:
D76793705

Original commit changeset: ea4c00e68891

Original Phabricator Diff: D76793705

fbshipit-source-id: 95d6b66ab08e073da9fb07fd4094a7e30e2f453b
2025-06-17 14:33:32 -07:00
Nick Gerleman 5348f9ff1e Fix possible invalid measurements when width or height is zero pixels (#52073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52073

X-link: https://github.com/facebook/yoga/pull/1820

Fixes https://github.com/facebook/yoga/issues/1819

Yoga has a fast path when measuring a node, if it thinks it knows its dimensions ahead of time.

This path has some eroneous logic, to set both axis to owner size, if *either* will evaluate to zero, while having an `YGMeasureModeAtMost`/`FitContent` constraint. This means that if a node is given a zero width, and Yoga later measures with with `FitContent`, its height will become the maximum allowable height, even if it shouldn't be that large.

We can fix this, by only allowing if both axis are this fixed case, instead of just one.

This bug has existed for about a decade (going back to at least D3312496).

Changelog:
[General][Fixed] - Fix possible invalid measurements with width or height is zero pixels

Reviewed By: yungsters

Differential Revision: D76793705

fbshipit-source-id: ea4c00e688912a58c08801e4a14ddf1b293a5d86
2025-06-17 12:15:55 -07:00
Nick Gerleman e08e27a6fa Support Facsimile Views in Jest E2E Text Selectors (#52070)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52070

Changelog: [Internal]

Reviewed By: joevilches, rshest

Differential Revision: D76783111

fbshipit-source-id: 5f4c3a9cf6d59eff15a071761ef83425bd4c6d23
2025-06-17 12:13:27 -07:00
Nick Gerleman ded4ae1f78 Fix antialiasing for Facsimile on Android < 10 (#52069)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52069

Noticed an E2E tests against old emulator version showed aliased Text against Facsimile. This is because non-scratch-paint path does not explicitly enable anti-aliasing (like TextView does), older versions of Android don't enable by default, and `updateTextPaint()` no longer sets, after call to `paint.reset()` was removed.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D76780749

fbshipit-source-id: 26f0de6d6558649fe08339f1ac91390bbd4cce3c
2025-06-17 10:51:23 -07:00
Riccardo Cipolleschi 331fab0683 Remove JSC related files from the repo (#51945)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51945

Remove code from jsc folder from React Native

## Changelog:
[iOS][Removed] - Remove code from jsc folder from React Native

Reviewed By: rshest

Differential Revision: D76419587

fbshipit-source-id: 6d5079c8f2843872172620601629e9643c7debdc
2025-06-17 09:38:21 -07:00
Nicola Corti 33aa7b9161 Remove unreferenced CMakeLists.txt for ReactCommon/jsc (#52078)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52078

This Cmake file is not imported anymore and can be removed now.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D76808417

fbshipit-source-id: 81824c7c46080bc16c891b5c11c3a8946f16c1b9
2025-06-17 06:26:18 -07:00
Christian Falch 560ac23001 Added missing define to target .reactRuntime (#52082)
Summary:
The target needs the HERMES_ENABLE_DEBUGGER flag in debug just like .reactHermes does.

This commit fixes this by adding the define to the reactRuntime target.

## Changelog:

[IOS] [FIXED] - Added HERMES_ENABLE_DEBUGGER to debug configuration for the reactRuntime target.

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

Test Plan: Prebuild React Core

Reviewed By: robhogan

Differential Revision: D76813200

Pulled By: cipolleschi

fbshipit-source-id: cb81a40fb9c5a91ca40c3a27ae4ccdf043186bac
2025-06-17 06:21:19 -07:00
Pieter De Baets 87cd1c0a0a Add rncore stub headers for backwards-compat (#52083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52083

These headers were removed in D55037569 but we may have some targets still depending on them. Add redirection headers with warnings to help users migrate without this being a breaking change.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D76810433

fbshipit-source-id: 43cddcc69eefbcff0c0140e165fb893bee493c79
2025-06-17 06:18:49 -07:00
Riccardo Cipolleschi 3ea4f156c9 Change imports from jsireact to reacthermes (#52011)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52011

This change aligns the import path of `jsireact/HermesExecutorFactory` to the OSS one: `reacthermes/HermesExecutorFactory`

## Changelog:
[Internal] -

Reviewed By: javache

Differential Revision: D76600638

fbshipit-source-id: d9ae35dec000196e4a51668c482fc27f3e6018b4
2025-06-17 05:51:02 -07:00
Nicola Corti 5e1768746a Unblock RNTester which is currently instacrashing. (#52077)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52077

RNTester is currently crashing on release due to a stripped `mHybridData` field.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D76808165

fbshipit-source-id: 049cca49f683c5dc92aa1f9a37dd7b4371dcbfd6
2025-06-17 04:54:47 -07:00
Samuel Susla e259961e8b return object with string keys from getDirectManipulationProps
Summary:
changelog: [internal]

make API getDirectManipulationProps slightly nicer by returning `[string]: mixed` instead of mixed.

Reviewed By: rubennorte

Differential Revision: D76763893

fbshipit-source-id: 56c56578251b991f5fb3e68d44e834da17fc4a3b
2025-06-17 04:49:44 -07:00
Andrew Datsenko aeaae4294f Add hermes and jsi (#52060)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52060

Changelog: [Internal]

Add hermes and jsi so we can evaluate JS.

Reviewed By: christophpurrer

Differential Revision: D76746362

fbshipit-source-id: a5fbb90d06a8608154b6ae80242b969e7cb03cea
2025-06-17 04:18:08 -07:00
Andrew Datsenko 74b6acb1f0 Add gflags (#52015)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52015

Changelog: [Internal]
Add gflags to fantom_tester so we can pass in data like featureFlags

Reviewed By: cortinico

Differential Revision: D76618409

fbshipit-source-id: a18e642a02c405eef972a7418a606a5980253b6a
2025-06-17 04:18:08 -07:00
Fabrizio Cucci a91e598e6a Minor renaming in ViewManagerRegistry (#52079)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52079

After the conversion to Kotlin (D74571782), there seems to be a synchronization issue when iterating on `viewManagers` (see T226095884).

There could a shadowing problem kicking in in a few places due to the fact that we are declaring a `viewManagers` local variable when there is already a `viewManagers` instance variable within `ViewManagerRegistry`.

To remove any ambiguity, here we are renaming the instance variable `viewManagers` as `viewManagersMap` (which also makes more sense).

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D76807070

fbshipit-source-id: 4f598700e04251409ee19b60515639e90699cc9e
2025-06-17 04:12:54 -07:00
Rubén Norte 10cabcc0a7 Refactor surface creation in Fantom (#52076)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52076

Changelog: [internal]

This refactors the implementation of surface creation in Fantom to make the surface ID handled in native, and treated as an opaque type the same way we do at runtime in RN.

Reviewed By: andrewdacenko

Differential Revision: D76744096

fbshipit-source-id: 1b49a1cbdf0a8d6804de3b87ede727207bc662d9
2025-06-17 03:52:09 -07:00
zhongwuzw 3bfbaa8455 Fabric: Only add selection of textinput payload when event is selectionChange (#51051)
Summary:
Fixes https://github.com/facebook/react-native/issues/51020: TextInputChangeEventData does not contain selection (see [here](https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts#L515-L518)). Additionally, Android does not have selection either (see [here](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextChangedEvent.kt#L33-L37)) (iOS old arch also not contains it). We can consolidate these to prevent any misleading information.

## Changelog:

[IOS] [FIXED] -  Fabric: Only add selection of textinput payload when event is selectionChange

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

Test Plan: TextInput `onChange`'s event should not contains `selection`.

Reviewed By: javache

Differential Revision: D76253999

Pulled By: cipolleschi

fbshipit-source-id: 8a889cce4998be0e31f4aa33961759e7d228e06f
2025-06-17 03:23:48 -07:00
Tim Yung 742ffa39fb RN: Update Fantom Path in EXCLUDED_FIRST_PARTY_PATHS (#52051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52051

In {D76368959}, I moved `react-native-fantom` from `packages/` to `private/` and missed this reference.

Changelog:
[Internal]

Reviewed By: rubennorte

Differential Revision: D76743071

fbshipit-source-id: f99d3f2ac5e14fd23f7cf208ca030541844dddc6
2025-06-17 02:59:42 -07:00
Dawid Małecki 6b40f35032 Add diff-api-snapshot for public API breaking change detection (#51972)
Summary:
This diff adds snapshot `diff-api-snapshot` script for public JS API breaking change detection.

### Motivation
Detecting if there are any breaking changes introduced in the commit. It is achieved by comparing `ReactNativeApi.d.ts` rollup from the current and previous revision.

This is a naive implementation with a three possible outcomes:
- BREAKING
- POTENTIALLY_NOT_BREAKING,
- NOT_BREAKING

The algorithm analyses exported top-level statements (after inlining) in both rollups and tries to create a mapping between them by name.

The **BREAKING** outcome happens whenever the statement is:
- removed
- renamed
- changed
- not exported anymore (private)

The **POTENTIALLY_NOT_BREAKING** outcome  happens if it's not BREAKING and the new statement is added.

The **NOT_BREAKING** outcome happens if public API snapshot doesn't change.

Changelog:
[General][Added] - Add public JS API breaking change detection under `yarn diff-api-snapshot` script.

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

Test Plan:
Signals, added tests.

In `react-native-github` run:
`yarn test scripts/diff-api-snapshot/__tests__/diffApiSnapshot-test.js`

Rollback Plan:

Reviewed By: j-piasecki

Differential Revision: D76430965

Pulled By: coado

fbshipit-source-id: 095a196aa4f643501db0af9262556ddefff5d30d
2025-06-17 02:27:53 -07:00
Rubén Norte 4556bdf4fc Make OpaqueNativeObserverHandle really opaque (#52054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52054

Changelog: [internal]

This makes `OpaqueNativeObserverHandle` really opaque and fixes the problems in the observer implementation caused by it.

Reviewed By: yungsters

Differential Revision: D76744094

fbshipit-source-id: a8b6fa43ee8a5ee9d15f0171a83fe0badd46d9c3
2025-06-17 02:24:22 -07:00
Rubén Norte 98fdc965b9 Make IdleCallbackID opaque in NativeIdleCallbacks implementation (#52055)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52055

Changelog: [internal]

This migrates NativeIdleCallbacks to use opaque types now that they're supported in the codegen

Reviewed By: yungsters

Differential Revision: D76744095

fbshipit-source-id: d9d1beea8df7f5635fc531a2cef001ea0aed38b4
2025-06-17 02:24:22 -07:00
Rubén Norte e8cdb99baa Make NativeIntersectionObserverToken opaque in NativeIntersectionObserver implementation (#52053)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52053

Changelog: [internal]

The codegen allows us to do this already! :D

Reviewed By: yungsters

Differential Revision: D76741113

fbshipit-source-id: d460685bc6ad6ba11f7132136e8603bd57488014
2025-06-17 02:24:22 -07:00
Rubén Norte a15fc102e6 Add support for opaque types in Flow codegen for native modules (#52052)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52052

Changelog: [General][Added] - Add support for Flow opaque types in codegen for native modules

This allows us to codegen native modules that expose opaque types, but the implementation sees the type the same way they're visible in the JS spec.

Reviewed By: yungsters

Differential Revision: D76741112

fbshipit-source-id: 100ca9aa7f93d35120c52153f756436c9c380b07
2025-06-17 02:24:22 -07:00
Samuel Susla 6ddfa708b0 small adjustments to when value listener is fired (#52063)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52063

changelog: [internal]

`addListener` API shouldn't fire when offset for node changes. Check https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/NativeAnimation/Nodes/RCTValueAnimatedNode.mm for reference.

Reviewed By: mdvacca

Differential Revision: D76740873

fbshipit-source-id: 04fb59ee9b630402803c4741f501d9d10591fa71
2025-06-17 02:16:32 -07:00
Samuel Susla 1456d06c86 add comment explaining why addListener and removeListeners are not needed (#52062)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52062

changelog: [internal]

- update comments to be more descriptive.
- use `#pragma mark -` to better group methods in `NativeAnimatedNodesManager`. It is nicely formatted in VSCode.

{F1979345410}

Reviewed By: mdvacca

Differential Revision: D76737257

fbshipit-source-id: c4b22ca45cd5dec2c72e7931bfec4466cda3070c
2025-06-17 02:16:32 -07:00
Jakub Piasecki 7bfadb429c Update prettier config for the API Snapshot (#52031)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52031

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D76710754

fbshipit-source-id: 36a07a2797b1270681420471aa66987163269a11
2025-06-17 00:06:13 -07:00
Jakub Piasecki faaec467b9 Strip unstable/experimental identifiers from the API snapshot (#52008)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52008

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D73102445

fbshipit-source-id: fe2ce04b32c9d839fec8b33eda9c67e551918ba3
2025-06-17 00:06:13 -07:00
Nick Gerleman 64ce7695f5 Fix Facsimile Hit Testing Bugs (#52065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52065

1. We can crash when tapping at the boundary between two spans. Previous ReactTextView had some custom heuristic for overlapping ReactTags, assuming they could be nested, which never happens (We only have a single tag per AttributedString fragment), but spans may overlap at a single character, where one is meant to be exclusive, and the other inclusive. We add logic for that.
2. We don't incorporate the offset of the text layout within the view for hit testing, needed for padding or `textAlignVertical`.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D76764051

fbshipit-source-id: 308756c45d8ff574420dfc1c88678bae7e03e767
2025-06-16 20:51:23 -07:00
Gabriel Donadel 3ae9328571 Bump @types/react to 19.1 (#52059)
Summary:
While testing I notice that `types/react` was not updated in some peer depencies

## Changelog:

[GENERAL] [CHANGED] - Bump types/react to 19.1

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

Test Plan: CI should be green

Reviewed By: christophpurrer

Differential Revision: D76763084

Pulled By: sbuggay

fbshipit-source-id: c078c03aa57ca04040c64986dd7957da8a6f2c2d
2025-06-16 17:45:11 -07:00
Christoph Purrer 89401b78cd Update outdated ReactNativeCPP.api (#52061)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52061

changelog: [internal] Update outdated ReactNativeCPP.api

Reviewed By: sammy-SC

Differential Revision: D76763455

fbshipit-source-id: bb9b72742594c19d70d930fa3827b450922428bb
2025-06-16 15:13:01 -07:00
Christoph Purrer 089fb10740 Remove folly::EvictingCacheMap (#52019)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52019

Replace folly::EvictionMap with pure std implementation

changelog: [internal][Breaking] Remove unused set() method of SimpleThreadSafeCache

Reviewed By: javache, sammy-SC

Differential Revision: D76631579

fbshipit-source-id: 15dfa8a8c0d2809440c214a72e48def6e1dba2f0
2025-06-16 15:06:17 -07:00
Samuel Susla 2528e48e93 implement Value.extractOffset in C++ Animated (#52049)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52049

changelog: [internal]

As title says, add implementation of [Value.extractOffset](https://reactnative.dev/docs/animatedvalue#extractoffset)

Reviewed By: zeyap

Differential Revision: D76735003

fbshipit-source-id: db09e2ed1c8b540d911970d2268fcd0374717e96
2025-06-16 14:30:19 -07:00
Samuel Susla cb24596c33 add Value.flattenOffset to C++ Animated (#52047)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52047

changelog: [internal]

implement AnimatedValue.[flattenOffset](https://reactnative.dev/docs/animatedvalue#flattenoffset) in C++ Animated.

Reviewed By: javache

Differential Revision: D76733524

fbshipit-source-id: df969cf8be421dd6fa22c4100ccd2c33aa7c91d8
2025-06-16 14:30:19 -07:00
Peter Abbondanzo cfb6c968dd Mark hasTVPreferredFocus as deprecated (#52043)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52043

The `hasTVPreferredFocus` prop is functionally similar to the `focusable` prop. On iOS, the props are identical. The primary difference appears on Android, where the prop attempts to request focus when set to true. Attempting to invoke imperative API calls through declarative means has been [a source of confusion](https://github.com/react-native-tvos/react-native-tvos/issues/237) and we should instead recommend requesting focus through imperative means, like calling `focus()` on a specific view's ref instead. Workarounds presented rely on lifecycle methods to request focus natively.

This change only marks these methods as deprecated on JS. In the following version, they will be removed from the public API.

Changelog: [General][Deprecated] - Deprecate `hasTVPreferredFocus`

Reviewed By: andrewdacenko

Differential Revision: D76732539

fbshipit-source-id: 64912b4dacb76cd40e79148c1082d8ed8f573879
2025-06-16 12:05:47 -07:00
Mathieu Acthernoene 3c17e101ee Add UiModeUtils.isDarkMode helper (#51925)
Summary:
This PR is part of the [edge-to-edge core implementation effort](https://github.com/facebook/react-native/pull/47554). It adds a helper to `ContextUtils`, called `isDarkMode` in order to be reused accross the Android codebase.

## Changelog:

- [Internal] [Added] - Add `UiModeUtils.isDarkMode` helper

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

Test Plan:
<img width="300" alt="Screenshot 2025-06-10 at 17 50 19" src="https://github.com/user-attachments/assets/48795406-e852-486a-bae8-54507ad769ee" />

<img width="300" alt="Screenshot 2025-06-10 at 17 50 42" src="https://github.com/user-attachments/assets/0dbdece9-04f7-487b-ace8-4786c8da381d" />

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76352849

Pulled By: alanleedev

fbshipit-source-id: fbbc772d1dfa3e30e62a71a711de11b85cdec446
2025-06-16 10:35:35 -07:00