Commit Graph

38536 Commits

Author SHA1 Message Date
Rick Hanlon e0797d0e03 Remove console.error patch (#48783)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48783

## Overview
This is the final boss of the new owner stacks feature. With owner stacks, we don't need to parse message strings to find the component stack for logbox. Instead, we can access the component stack directly with `captureOwnerStack`.

This means we don't need to install the LogBox console.error patch and can greatly simplify the process of handling errors and make it more reliable.

To do this, we rely only on adding LogBox to the ExceptionManager:
- `reactConsoleErrorHandler` -> `LogBox.addConsoleLog`
- `reportException` -> `LogBox.addException`

Changelog:
[General][Fixed] - Remove LogBox patch, de-duplicating errors

## Benefits
As a side effect, this removes a lot of duplicate errors. For example, currently if a component throws, you get 2 errors:

 {F1974436906}

After this, there's just the one you expect:

 {F1974436908}

## Followups
After this lands and doesn't need reverted for some reason, we can delete a ton of code from logbox for finding and detecting stacks from errors.

Reviewed By: javache

Differential Revision: D68380668

fbshipit-source-id: 68112f1e3992fada4d6aaffdf9bd618ce1834f7b
2025-06-05 14:30:30 -07:00
Nick Lefever e51a5f0ab8 Enable RSNRU only for React commits (#51843)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51843

Changelog: [Internal]

To avoid corrupting the React fiber tree when committing from multiple threads this diff only updates shadow node references within the fiber tree for commits originating from React.

This guarantees that during the update of the references no React render will start or is running, making the update of the shadow node reference safe to execute.

S527994

Reviewed By: sammy-SC

Differential Revision: D76043845

fbshipit-source-id: bfcbeaae7fc8b976a1c2db6682330cef9ca25ab8
2025-06-05 14:09:52 -07:00
Peter Abbondanzo fe66694faf Add example for focus events on Android (#51725)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51725

This change builds upon the focus/blur portion showcased in ViewExample but showcases several more components all in one spot. This can be shared with additional platforms or expanded to include more component examples like Image, but the goal is to target Android and not distract from the primary use cases.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D75747410

fbshipit-source-id: 7d53366d9f32192ca6b3da45dd127836fb6efdf6
2025-06-05 13:48:50 -07:00
Peter Abbondanzo e960a28af7 Add focus and blur dispatching logic to BaseViewManager (#51724)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51724

Moves focus change listener logic from `ReactViewManager` to `BaseViewManager` so all view managers that extend the class can get focus/blur event dispatching for free. This does so by applying event listeners where `addEventEmitters` is called, so any extending classes must try to call `super.addEventEmitters` or implement it themselves. In the case of TextInput, this logic is re-implemented because the component emits an additional event when the text input is blurred and I wanted to avoid duplicate calls to get the event emitter for the view instance.

In addition, I've added logic and a test case to ensure that any preexisting focus change listeners set on the view instance are called. There can only ever be one focus change listener tied to a view instance, so this ensures that ones created during view instantiation are retained. However, this does not guarantee that events are emitted for downstream users who overwrite the focus change listener later in the view's lifecycle (i.e. in response to a prop change or an extending view manager that doesn't call `super.addEventEmitters`). There is no clean way to enforce that the `BaseViewManager` focus change listener is always set without changing the generics and introducing a significant breaking change.

Changelog: [Android][Added] - Adds support for onFocus/onBlur event dispatching logic to all native views that implement `BaseViewManager`

Reviewed By: NickGerleman

Differential Revision: D75579321

fbshipit-source-id: 02e1e6d0e78e9d05e4ec5bb59789f3097b73b3f8
2025-06-05 13:48:50 -07:00
Nick Lefever cd5d74518b Fix image loading on props change without layout invalidation (#51791)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51791

On iOS the <Image> shadow node was expecting a layout call for every clone. With `passChildrenWhenCloningPersistedNodes` <Image> components may have the image source updated without layout being called on it due to the re-use of the previous layout data thanks to the improved handling of layout invalidation.

This diff triggers the image request as soon as possible if the cloned shadow node has a clean layout. The request will be made as soon as the image manager is set on the shadow node.

Changelog: [iOS][Fixed] - Fix RCTImageComponentView image loading after source props change with no layout invalidation

Reviewed By: NickGerleman, sammy-SC

Differential Revision: D75919671

fbshipit-source-id: 8b92a9c63b6ff4a62c7eb7b0dbe18dd2be989b81
2025-06-05 11:43:03 -07:00
Nick Gerleman 0581e88efe Avoid scratch TextPaint for Facsimile Layouts (#51827)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51827

TextLayoutManager has an optimization today, where it reuses a scratch TextPaint throughout layouts.

This is not safe in Facsimile, since the paint is included as part of `Layout`, and the `Layout` escapes the TextLayoutManager, to later be drawn. I.e. every `PreparedLayoutTextView` right now is sharing this same scratch Paint.

This change makes it so that we only ever use a scratch paint for the purpose of measurements, where the layout is short-lived.

A simpler approach could be to just abandon the scratch TextPaint, since they do not seem wildly expensive at a glance (though not trivial).

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D75987605

fbshipit-source-id: 3fe3519c6164828a25cb4e2b0ee6eded73695a95
2025-06-05 11:23:18 -07:00
David Vacca 7f8cf06bf9 Update codegen to use StateData (#51823)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51823

Refactor C++ codegen to use StateData for simple codegenerated components

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D75889787

fbshipit-source-id: 47edf5a2a7b7d0efa1f98d392b8c7457af5747c9
2025-06-05 11:04:13 -07:00
Tim Yung 0df71eac81 RN: Prohibit ESLint Warnings (#51825)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51825

Configures `yarn lint` to fail if there are any ESLint warnings.

Changelog:
[Internal]

Reviewed By: kassens, NickGerleman

Differential Revision: D75988059

fbshipit-source-id: 20f94492803d8b000f8424ef9ff8a19276f35fd9
2025-06-05 10:14:06 -07:00
Tim Yung cf9d28a097 RN: Improve lint-ci Script (#51853)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51853

While testing D75988059 with D76047973, I noticed a few opportunities to improve the script used by `yarn lint-ci`:

- The exit code does not currently propagate, meaning `lint-ci` will succeed when it shouldn't.
- The shell script uses some non-idiomatic practices, so this improves it.

Changelog:
[Internal]

Reviewed By: kassens, cipolleschi

Differential Revision: D76049502

fbshipit-source-id: ebefddf0909edc89cd97de756b93bfaaa3d7cdef
2025-06-05 10:14:06 -07:00
Peter Abbondanzo 8db12225a2 Forward onBlur/onFocus events to Pressability config (#51670)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51670

As the title suggests, forwards `onBlur`/`onFocus` props into the Pressability config that the component creates

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D75238328

fbshipit-source-id: ebc955ab603012362b6fd021333ab61c54ef3f72
2025-06-05 08:26:45 -07:00
Samuel Susla b4cf61901f add fantom tests for pointerevents (#51842)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51842

changelog: [internal]

add tests for pointerevents props.

Reviewed By: rshest

Differential Revision: D75991670

fbshipit-source-id: 16ed5f11bf3d3ec015141587171fe4ff0e914810
2025-06-05 08:22:28 -07:00
Tomasz Żelawski c783128f6e fix: ignore build/ and DerivedData/ dirs in when reading infoPlistFiles (#51833)
Summary:
https://github.com/facebook/react-native/pull/49927 introduced a regression where a Ruby script would read compilation artifacts and fail, when the user has relative build directories set in XCode.

After successful compilation `build/` dir and `DerivedData/` dir have `.plist` files that aren't in UTF-8 encoding and shouldn't be read by the script. If the user tries to reinstall pods at this point, he gets the following error:

![image](https://github.com/user-attachments/assets/6bd31907-66af-4ea5-b2a6-2847e0ee18e1)

This is how you enable relative build directories in XCode.

![Screenshot 2025-06-05 at 11 08 31](https://github.com/user-attachments/assets/22a555b4-a468-481d-8492-02c3b36bfa25)

## Changelog:

[IOS] [FIXED] - Ignore `build/` and `DerivedData/` directories when reading `.plist` files.

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

Test Plan: After applying this patch the problem doesn't occur anymore on my machine.

Reviewed By: cortinico

Differential Revision: D76030133

Pulled By: cipolleschi

fbshipit-source-id: 7ae8c2d0ce28b6925245a9172154e3dcafee126f
2025-06-05 03:21:10 -07:00
Samuel Susla 5661fe9e1f Add test for onScroll events (#51826)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51826

changelog: [internal]

To make this possible, we "fake" a UI tick whenever `flushMessageQueue` is called. This was, after every JavaScript task a UI tick happens.
Result:
- Animations are setup right after mounting automatically.
- Animation happens after Fantom.scrollTo is called.

Reviewed By: lenaic

Differential Revision: D75899915

fbshipit-source-id: 1ccb86df6741ff9124f16073c6d61ba716d7cfe6
2025-06-05 03:14:39 -07:00
Riccardo Cipolleschi 2c3fadd2a1 Add changelog for 0.79.3 (#51816)
Summary:
## Changelog:
[Internal] - Add Changelog for 0.79.3

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

Test Plan: N/A

Reviewed By: robhogan

Differential Revision: D75969644

Pulled By: cipolleschi

fbshipit-source-id: 8ff63e96235d4ccb63a033ef107f343d1df8b369
2025-06-05 03:08:12 -07:00
Mateo Guzmán d631ec9a6c Migrate ReactTextViewManager to Kotlin (#51721)
Summary:
Migrate com.facebook.react.views.text.ReactTextViewManager to Kotlin.

In this diff, `ReactTextAnchorViewManager` is made public again as it's extended by `ReactTextViewManager`.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.views.text.ReactTextViewManager to Kotlin

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

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

Reviewed By: mdvacca

Differential Revision: D75829457

Pulled By: NickGerleman

fbshipit-source-id: 425e9ec14f17de5470677b73d68873647bf28675
2025-06-04 21:24:00 -07:00
Tim Yung 1a335b3f25 RN: Require @flow Annotations (#51824)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51824

Configures ESLint to require `flow` (or `noflow`) annotations for JavaScript files in the React Native repository. This ensures that we uphold a high bar for type safety and correctness, or intentionally deviate when it makes sense.

Changelog:
[Internal]

Reviewed By: NickGerleman

Differential Revision: D75985490

fbshipit-source-id: 56f9fe7666a02c796ceb9cf076677e81b164b65e
2025-06-04 19:33:54 -07:00
Tim Yung e8e51ac1fb RN: Flowify Remaining Files (#51822)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51822

Adds `flow` to the remaining files without it, in React Native.

After this, every `*.{flow,js}` file in React Native will have either `flow` or `noflow`.

Changelog:
[Internal]

Reviewed By: NickGerleman

Differential Revision: D75980238

fbshipit-source-id: 84cd88e4eb0b0b1dc69df247de79a75c2119bf96
2025-06-04 19:33:54 -07:00
Nick Gerleman 48216b244a FabricUIManager.prepareLayout() -> FabricUIManager.prepareTextLayout() (#51787)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51787

Feedback left on D75826792

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D75896711

fbshipit-source-id: bc55e1e6b4beefbe7071fe3186caeeb49f74a9cd
2025-06-04 19:33:30 -07:00
Nick Gerleman add1113a02 Support ReactTextViewManagerCallback in Facsimile (#51759)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51759

Builds upon the changes in the last diff, to let Facsimile support `ReactTextViewManagerCallback`. We use the same new mechanism, of using `RCTTextViewManager` as the callback, if present, instead of relying on view manager measure function.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D75830964

fbshipit-source-id: 435798e6be08f579579eb0f2d30a67d4b1fcaf10
2025-06-04 19:33:30 -07:00
Nick Gerleman 2ba86caf18 Clean up measurements path and ReactTextViewManagerCallback injection (#51758)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51758

ViewManager’s may implement a measure function (using MapBuffer, or ReadableMap). This isn’t used automatically, but may instead be used, by calling into FabricUIManager via JNI, and passing the component name of the view manager to use.

This is only ever called manually, through specific C++ ShadowNodes. Confusingly, for some cases, like `TextInput`, we use the measure function on `RCTText` instead, because this call to FabricUIManager is hidden behind `TextLayoutManager`. This ends up really breaking Facsimile, since we want to measure these in a different way, while still measuring `TextInput` without preparing a layout.

This mechanism is also used to inject `ReactTextViewManager` from the Text View Manager, into the measurement process, for both Text, and TextInput.

I think we would ideally remove and replace the current View Manager measurement mechanism entirely. The interface doesn’t do what it claims to, and requires calling private Java methods via JNI, which we shouldn’t be encouraging external libraries to do. Only a single 3p librar (react-native-picker) uses this, but we have a lot of internal usages, and the current facility is valuable, for translating surface ID into a context. Ie we could not deprecate it without a well thought out replacement.

Instead, this change:
1. Removes the "generalized" version of this for MapBuffer, only ever used by Text
2. Given ourselves a `measureText` function, that will use a spannable processor provided, but go through TextLayoutManager, instead of trying to use this generalized path
3. Documents some of the weirdness of the current setup, without yet deprecating it

This will let the Facsimile View Manager:
1. Provide a ReactTextViewManagerCallback, like the previous version allowed, that influences measurement of both Text, and TextInput (which is... strange, but... not trying to boil the ocean here)
2. TextInput can now measure text, even if Facsimile View Manager doesn't implement this traditional measure interface

Changelog:
[Android][Breaking] - Remove FabricUIManager.measureMapBuffer() and MapBuffer measure functions on ViewManager. Please use ReadableMap variant.
[Android][Breaking] - Remove FabricUIManager.measure overload which accepts attachment positions

Reviewed By: javache

Differential Revision: D75826792

fbshipit-source-id: 6739b1e2e214351b9b95ba782d73cf4278211ab8
2025-06-04 19:33:30 -07:00
Jorge Cabiedes Acosta 997b7c99f6 Rewrite accessibilityOrder with virtual view hierarchy (#51692)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51692

The original algorithm for accessibilityOrder on Android had unexpected bugs. For some reason `.traversalAfter()` and `traversalBefore()` have unexpected behaviors when dealing with ancestor/descendant relationships getting more and more unexpected the further apart they are.

So we are ditching that approach entirely.

Now we have the view with accessibilityOrder create a virtual view hierarchy. We create a virtual node for each child that is in the order, and set the virtual node's position to be the same as the View it is trying to represent.

We then also populate that node with the same stuff we populate regular ax nodes with the `populateAccessibilityNodeInfo()` function and the content description of the view it is backing so we get matching descriptions with what would otherwise be the normal announcement.

**We have no way to exhaustively check every accessibility use case so we'll have to fine tune this as bugs come up, I'm expecting there to not be many issues since we populate the node the exact same way we populate every other node but anything that happens before React Native handles the node might miss some things**

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D74766296

fbshipit-source-id: 5e77c17bed1644bc5fbf5c1e19c3c6908cc1e3e9
2025-06-04 14:31:21 -07:00
Nick Gerleman c27a8804a6 Bump min Xcode to 16.1 (#51762)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51762

Apple requires Xcode 16 or later to submit to the app store. Let's bump the minimum checked for in build logic as well. https://developer.apple.com/news/upcoming-requirements/?id=02212025

GHA is already only testing against 16.2.0 as of D73924819

Changelog:
[iOS][Breaking] - Bump min Xcode to 16.1

Reviewed By: cipolleschi

Differential Revision: D75835304

fbshipit-source-id: a7ce22f958be3a5448a279439e27b615e9b20a2f
2025-06-04 14:15:45 -07:00
Tim Yung 5ce99e7eb2 RN: Flowify packages/react-native Mocks & Tests (#51794)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51794

Adds `flow` to the remaining mocks and tests that are lacking it in the `packages/react-native` directory.

This required adding numerous type annotations and suppressions.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D75930095

fbshipit-source-id: ebb1280adc656680e00fd579701e31521826b55c
2025-06-04 12:03:52 -07:00
Tim Yung f2ff8c9012 RN: Flowify packages/react-native/Libraries/Alert (#51792)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51792

Adds `flow` to the remaining files that are lacking it in the `packages/react-native/Libraries/Alert` directory.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75921478

fbshipit-source-id: e277cf8241b136da1409af2592fda6ec1f7e9502
2025-06-04 12:03:52 -07:00
Tim Yung d77057741d RN: Flowify Non-Library Files (#51790)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51790

Adds `flow` or `noflow` to the remaining files that are outside of `packages/react-native/{Library,src}`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75904614

fbshipit-source-id: cb2c0969065cf443c3a6e74da0fa3708fda67d18
2025-06-04 12:03:52 -07:00
Tim Yung 13e0965ed5 RN: Flowify packages/helloworld (#51789)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51789

Adds `flow` or `noflow` to the remaining files that are lacking it in the `packages/helloworld` directory.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75899853

fbshipit-source-id: 43990adb0827f35a8ca8c49c1787140ff47b8abb
2025-06-04 12:03:52 -07:00
Tim Yung 3e6423fe65 RN: Flowify packages/rn-tester (#51788)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51788

Adds `flow` to the remaining files that are lacking it in the `packages/rn-tester` directory.

This also adds any necessary type annotations and fixes lint warnings.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75899307

fbshipit-source-id: 27a74ed0007b3b754446a45931c2c148312d5e3a
2025-06-04 12:03:52 -07:00
Tim Yung 71bf0712e3 RN: Flowify packages/virtualized-lists (#51785)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51785

Adds `flow` to the remaining files that are lacking it in the `packages/virtualized-lists` directory. In one of the Jest tests, there are so many failures that for now, I just added `noflow`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75888514

fbshipit-source-id: 29d96292f3d59fd5cf2f5ba09b58fdfb9eabab2e
2025-06-04 12:03:52 -07:00
Tim Yung 3d55f229cb RN: Flowify packages/react-native-fantom (#51784)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51784

Adds `flow` to the remaining files that are lacking it in the `packages/react-native-fantom` directory.

This also adds any necessary type annotations (using comment syntax).

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75886119

fbshipit-source-id: 6045b4037da21791db2a8960fbdb83aa2fb5bbf2
2025-06-04 12:03:52 -07:00
Tim Yung 3728afa85f RN: Add @noflow to packages/react-native-compatibility-check (#51782)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51782

Adds `noflow` to a test in `packages/react-native-compatibility-check`.

In the future, this file should be migrated to use `flow strict-local` or `flow strict`. However, it currently has way too many type errors. Adding `noflow` makes it explicit that this is known to not be typechecked.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75885038

fbshipit-source-id: d0eccda52d39e7cb1938d395c44e4441918f7fcb
2025-06-04 12:03:52 -07:00
Tim Yung 404f3ebde2 RN: Flowify packages/react-native-codegen (#51781)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51781

Adds `flow` to the remaining files that are lacking it in the `packages/react-native-codegen` directory.

This also adds any necessary type annotations (using comment syntax).

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D75884727

fbshipit-source-id: 69e880b2dc63c3d6430f841652506e57436544a8
2025-06-04 12:03:52 -07:00
Tim Yung 9c38daf2ef RN: Flowify scripts (#51780)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51780

Adds `flow` to the remaining files that are lacking it (or `noflow`) in the `scripts` directory.

This also fixes what I believe to be a typo in one of the files.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75883851

fbshipit-source-id: 928b7a12a08269b6643379d46de888f2c61dcb29
2025-06-04 12:03:52 -07:00
Tim Yung cc9074884a RN: Add @noflow to Node.js Scripts (#51779)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51779

Adds `noflow` to a bunch of Node.js script files.

In the future, these files could be migrated to use `flow strict-local` or `flow strict` using comment syntax for type annotations. But for now, adding `noflow` makes it explicit that these are known to not be typechecked.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75883703

fbshipit-source-id: a8fed3aaa9c55ecda919a705940f8b34504cb07c
2025-06-04 12:03:52 -07:00
Tim Yung b344aec2ae RN: Add @noflow to ESLint & Babel Preset Files (#51778)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51778

Adds `noflow` to a bunch of ESLint and Babel files that are expected to be evaluated using Node.js without Babel. Additioanlly, these files tend to depend on ESLint and Babel type definitions that are not currently readily available.

In the future, these files could be migrated to use `flow strict-local` or `flow strict` using comment syntax for type annotations. But for now, adding `noflow` makes it explicit that these are known to not be typechecked.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75883642

fbshipit-source-id: 54236d123ca8773de42bce81189dfb5c0671563e
2025-06-04 12:03:52 -07:00
Tim Yung c1216d99f8 RN: Flowify flow-typed/{environment/node,npm/jest} (#51777)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51777

Just adding `flow` to these two libdefs that aren't sourced directly from `flow-typed/flow-typed`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75877692

fbshipit-source-id: 0ee0ec08e2046fdba38480cddca3686109e8ca45
2025-06-04 12:03:52 -07:00
Samuel Susla 27f4801c82 introduce Fantom.unstable_getDirectManipulationProps (#51814)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51814

changelog: [internal]

introduce Fantom.unstable_getDirectManipulationProps to make it possible to inspect what is changed by C++ Animated module before animation finishes.

Reviewed By: zeyap, rubennorte

Differential Revision: D75816105

fbshipit-source-id: 681829ca9d3f77e57213e9f88f4f24b340a982ed
2025-06-04 11:51:54 -07:00
Joe Vilches ed26358f63 Implement textVerticalAlign (#51680)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51680

Right now there are 2 flavors of vertical text alignment: `verticalAlign` and `textVerticalAlign`. Both do the same thing currently. For Facsimile, we actually want to "properly" implement `verticalAlign` so that it matches the web version, while leaving `textVerticalAlign` the same. That will take some time, however, so for now we are just going to implement the way it currently works, while fixing some issues with inline View's

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D75475915

fbshipit-source-id: ba6ff7c831bf769e9e60831ed215ab64faf143a4
2025-06-04 11:39:15 -07:00
Joe Vilches 55fd8b26f8 Move textAlignVertical to paragraph props (#51712)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51712

This prop only works on top level text components, yet it is stored as a TextAttribute. It should be a ParagraphAttribute, so I moved it there.

Changelog: [Android] [Breaking] - Move textAlignVertical to paragraph attributes instead of text attributes

Reviewed By: NickGerleman

Differential Revision: D75684576

fbshipit-source-id: 8ad2496f8a043a6a64924a6c43c7bad4593cf1db
2025-06-04 11:39:15 -07:00
Joe Vilches 573ba02530 Use PreparedLayout as opposed to Layout in PreparedLayoutTextView (#51711)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51711

This is needed to support textVerticalAlign as we are storing that offset in the prepared layout and need to read it from the new text view

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D75643360

fbshipit-source-id: 03620ecf09f525c45d0a60daad1dc1d9a5937362
2025-06-04 11:39:15 -07:00
Nicola Corti c7bbf120e3 Tweak visibility of fields inside NativeModuleRegistry (#51810)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51810

Tweaking the visiblity of some of the fields `NativeModuleRegistry` after the Kotlin migration
of that class.

Changelog:
[Internal] [Changed] -

Reviewed By: javache

Differential Revision: D75959962

fbshipit-source-id: b3d53fc29af3b0fe32a7bd6a61898814acf90123
2025-06-04 11:19:10 -07:00
Pieter De Baets 2ec21b4679 Remove unneeded folly deps (#51807)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51807

Remove unneeded deps from the build graph. Especially `//xplat/folly:logging_logging` ends up adding 418KB in development which is unused here.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D71316272

fbshipit-source-id: 39a73e26728cee23d4ffbdd5e4760de2029e671b
2025-06-04 11:01:19 -07:00
Gabriel Donadel f2b19608cc generate-artifacts-executor: fix parsing .class in complex classes (#51813)
Summary:
There is an edge case in the codegen `findRCTComponentViewProtocolClass` function where the parsing of the Component Class will fail if there is another `.class` call in the same file after the `Class<RCTComponentViewProtocol>` function. This ends up resulting in a `RCTThirdPartyComponentsProvider.mm` file that looks like the image bellow

<img width="1052" alt="image" src="https://github.com/user-attachments/assets/26ce93be-0370-4852-a949-9da21762ff7f" />

You can reproduce this with the following

```
Class<RCTComponentViewProtocol> XYZCls(void)
{
  return XYZ.class;
}
// this comment breaks codegen .class
```

## Changelog:

[IOS] [FIXED] - Fix codegen extracting `.class` from complex component classes

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

Test Plan: Run codegen locally, use this patch in the expo/expo repo and CI should be green

Reviewed By: cipolleschi

Differential Revision: D75964424

Pulled By: cortinico

fbshipit-source-id: 50e45aa2ac6e43c75ee6fdd76791c591d81d4df7
2025-06-04 10:46:49 -07:00
Riccardo Cipolleschi b266f7854d Back out "Improve e2e times by using deep links to open examples" (#51812)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51812

Commit [8960d9ea2c](https://github.com/facebook/react-native/commit/8960d9ea2cea22451e8f7c9d6c22ed1ed6de131f) fully broke the iOS tests on RNTester in CI.

All 8 of them consistently fails 5 times out of 5 within the workflow and for each retry.

Reverting the change to get CI back to green

## Changelog:
[Internal] - Reverting [8960d9ea2c](https://github.com/facebook/react-native/commit/8960d9ea2cea22451e8f7c9d6c22ed1ed6de131f)

Reviewed By: cortinico

Differential Revision: D75960750

fbshipit-source-id: 63b4a4b4cd830ec48fa60ca6cfcb4dd12a97a331
2025-06-04 09:48:42 -07:00
Samuel Susla 2be44354c0 rename advanceAnimationsByTime to produceFramesForDuration for clarify (#51811)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51811

changelog: [internal]

after a bit of discussion it was clear the name of this method was confusing. Let's rename it to `produceFramesForDuration` to make it more obvious what happens under the hood.

Reviewed By: rubennorte

Differential Revision: D75953355

fbshipit-source-id: a62933894f9d42fbb3692134d117c05208c62699
2025-06-04 09:45:47 -07:00
Samuel Susla 031aa4f8d3 add comment why FabricUIManagerBinding::getScheduler is public (#51801)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51801

changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D75902518

fbshipit-source-id: 4564982d8cc253df575ba93233b2eec0d336479d
2025-06-04 08:38:58 -07:00
Rubén Norte 1dae8d119f Add support for Error.cause in Fantom (#51800)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51800

Changelog: [internal]

This adds support for printing the cause of errors thrown in tests in Fantom, if available.

Reviewed By: lenaic

Differential Revision: D75946044

fbshipit-source-id: 579a2fc547cae92d2a65a4023ba1fb2e34a1f735
2025-06-04 08:28:48 -07:00
Samuel Susla 59fcc57e1a Make ShadowNode::transferRuntimeShadowNodeReference private (#51805)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51805

changelog: [internal]

this overload of transferRuntimeShadowNodeReference is only used within ShadowNode, let's make it private.

Reviewed By: lenaic

Differential Revision: D75903646

fbshipit-source-id: 1ea86b6d0771cdffaff2d425d591f1e58da330ca
2025-06-04 08:26:03 -07:00
Dawid Małecki 0de92b52ba Bring back @flow strict to composeStyles and fix Flow errors (#51803)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51803

The `flow strict` annotation was accidently removed in D74574293. This diff brings it back and fixes flow errors caused by this change. This makes generated TS types for `composeStyles` more relaxed but the main idea of inferring inputs base on output type annotation is preserved.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D75945388

fbshipit-source-id: c24ff8ad5d286e16bca3522e82f02e14f660c0dd
2025-06-04 06:56:05 -07:00
Samuel Susla b338a00467 make per UI tick calculation more predictable (#51802)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51802

changelog: [internal]

avoid conversions when dealing with time in C++ Animated. This makes tests more predictable.

Reviewed By: christophpurrer

Differential Revision: D75813200

fbshipit-source-id: b8934848237e5ea7c350d9a5f0175ac0f9202ffd
2025-06-04 05:05:19 -07:00
Mateo Guzmán dc7be7c7aa Migrate NativeModuleRegistry to Kotlin (#51734)
Summary:
Migrate com.facebook.react.bridge.NativeModuleRegistry to Kotlin.

In this diff, `JavaModuleWrapper` and some of its functions/properties had to be made public again as they are exposed by the migrated class – and if the functions are kept internal, there are crashes in legacy arch due to the C++ usages.

## Changelog:

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

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

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

Reviewed By: rshest

Differential Revision: D75938404

Pulled By: cortinico

fbshipit-source-id: 088286d4b100d1013cff43b81db39c6aec10f4e1
2025-06-04 04:53:45 -07:00