Commit Graph

12270 Commits

Author SHA1 Message Date
Sam Zhou 824e2deae0 Remove unused forwardRef import in SectionListModern (#51373)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51373

Followup of https://github.com/facebook/react-native/pull/51360

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D74825642

fbshipit-source-id: 1ba8f4f1934279a0be484b7809cadeacee03d59d
2025-05-15 11:45:46 -07:00
Christian Falch 9d11dcd3b0 make removeView open in ViewGroupManager (#51322)
Summary:
After conversion to Kotlin we could no longer override the removeView function since it is no longer open. The rest of this class can be overridden as before, but since functions are final by default this doesn't work for the new `removeView` function.

Expo is overriding the `removeView` functions in `GroupViewManagerWrapper.kt` (a lot of other ViewManager methods are also overridden here, but the `removeView` is introduced in `ViewGroupManager` and needs to be open as well. `GroupViewManagerWrapper.kt` is a replacement view manager that adds support for a delegate that will receive callbacks whenever one of the methods in the view manager are called.

This commit fixes this by making the removeView function explicitly open.

## Changelog:

[ANDROID] [FIXED] - Made function `removeView` open in Kotlin class

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

Test Plan: Verify that Expo can build against this class.

Reviewed By: javache

Differential Revision: D74807744

Pulled By: cortinico

fbshipit-source-id: 55f4b9deccb7d82ceb78be1d56c2b99a6f7e3ce9
2025-05-15 10:36:14 -07:00
Sam Zhou 2fa2c2071c Make use of ref-as-prop support in Text (#51361)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51361

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74810512

fbshipit-source-id: 0f902da8b487db353609b8de14f46a4cec23a46b
2025-05-15 10:01:54 -07:00
Sam Zhou 797705c00d Make use of ref-as-prop support in examples (#51358)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51358

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74812747

fbshipit-source-id: 7ded547ff62ca59d28abfc46a2f57466e2486acd
2025-05-15 09:55:32 -07:00
Joe Vilches d07b2a9d99 Remove useEditTextStockAndroidBehavior and resolve old android blur issue (#51338)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51338

There was some problems removing this feature flag earlier in that, on older android versions, we would try to focus the top most text input whenever any other text input would try to blur. This was ultimately and issue with how Android implements `clearFocus`. To fix this, lets block the focusability of all views while we clear the focus, then re-enable.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D74760594

fbshipit-source-id: 2811c08ad6ed0855da0a4d7fca89fb08f84905c2
2025-05-15 09:50:32 -07:00
Joe Vilches f6378c3390 Back out "Clean up useEditTextStockAndroidFocusBehavior feature flag"
Summary:
Original commit changeset: 4682cf709aa2

Original Phabricator Diff: D73954790

I want to pick this into 0.80 so users can enable the feature flag so this doesn't break older versions

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D74754010

fbshipit-source-id: 75dc96516b00035984741b43814d6fc7df6be0ac
2025-05-15 09:50:32 -07:00
Joe Vilches 7a04f985fd Back out "Fix issue where text inputs cannot blur on <= Android 8.1" (#51336)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51336

Original commit changeset: 12dcaf0c9c35

Original Phabricator Diff: D74678847

I plan on reverting this so that we can in turn revert the diff that this diff fixed so we can pick it into RN 0.80 so that users have some fix on all versions. Right now 0.80 will be broken for older android devices

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D74754164

fbshipit-source-id: fda17da3e9b61ca13f68f6681726ffb3f4f4f6c0
2025-05-15 09:50:32 -07:00
Nicola Corti 036e47ef9f Add a gradle task to download native 3p dependencies. (#51357)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51357

This adds a `prepareNative3pDependencies` Gradle task that downloads and prepares all the 3p dependecies.
This will be needed before we download native deps for Fantom.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D74812436

fbshipit-source-id: 85796d0bcffaeef05d3a21d50f39954ef39ae92c
2025-05-15 09:31:42 -07:00
Sam Zhou e7e4cdd12e Make use of ref-as-prop support in SectionListModern (#51360)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51360

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74812991

fbshipit-source-id: 9df7247bcdaed7a880ed0a75a5dcc33fce6f1d86
2025-05-15 09:17:45 -07:00
Rubén Norte 6e9a816940 Migrate test to use React.createRef insted of ref functions (#51345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51345

Changelog: [internal]

I just realized there were some tests where we didn't migrate to the new recommended pattern.

Reviewed By: rshest

Differential Revision: D74803018

fbshipit-source-id: b74468f1be35fba8d20d3b96ea2b55452a8175ee
2025-05-15 08:46:32 -07:00
Rubén Norte c7611e0d79 Add definition of setNativeProps in NativeDOM and use it if available (#51343)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51343

Changelog: [internal]

This implements `setNativeProps` as a method in the `NativeDOM` C++ TurboModule, so we can replace usages of the method from `FabricUIManager`.

Reviewed By: javache

Differential Revision: D74800815

fbshipit-source-id: cf3c2d4b75c8d30e2528f96d4d63318e1366096a
2025-05-15 08:46:32 -07:00
Rubén Norte 89e21b866a Add missing setNativeProps tests (#51342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51342

Changelog: [internal]

Adding a test for `setNativeProps`, as it was missing because we couldn't test this when this test suite was implemented.

Reviewed By: fabriziocucci

Differential Revision: D74800816

fbshipit-source-id: 5f4721e61d1fb41a1898f56be35e6e3b12c9537e
2025-05-15 08:46:32 -07:00
Rubén Norte f49083db69 Replace usage of FabricUIManager methods with NativeDOM methods where available (#51341)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51341

Changelog: [internal]

`measure`, `measureInWindow` and `measureLayout` have been defined in the `NativeDOM` C++ TurboModule for a while, but we didn't migrate the callsites in the DOM APIs to use them. This does that migration so we can remove a few `$FlowFixMe`s and use a cleaner API.

Reviewed By: javache

Differential Revision: D74800814

fbshipit-source-id: 117e4a8798036f2266e25cfc0931e91c148eaf52
2025-05-15 08:46:32 -07:00
Sam Zhou f4c9df5b38 Make use of ref-as-prop support in ActivityIndicator (#51356)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51356

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74808564

fbshipit-source-id: 68f55d31c07ceaf7282833bd4b04039e35987935
2025-05-15 08:30:33 -07:00
Sam Zhou a6a073765a Make use of ref-as-prop support in ScrollViewStickyHeader (#51355)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51355

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74810588

fbshipit-source-id: e979e8fb59d46be6dabc4327b47b20d635864aa9
2025-05-15 08:28:48 -07:00
Sam Zhou 28c375fb53 Make use of ref-as-prop support in Switch (#51353)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51353

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74809899

fbshipit-source-id: aaa4ef65ea4d4a20c9d9315ae95957e67484c2d8
2025-05-15 08:24:58 -07:00
Sam Zhou 83401b5d44 Make use of ref-as-prop support in Button (#51354)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51354

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74808349

fbshipit-source-id: a359278b5d516eb04fc88ea14c21b628f1053fec
2025-05-15 08:18:30 -07:00
Riccardo Cipolleschi 84c5f294e5 Fix Maestro E2E Tests (#51347)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51347

The new warnings on RNTester for the imports are covering the New Architecture list item, as you can see from the video.

This prevents maestro from clicking on the list item, and therefore the test fails.

{F1977997600}

## Changelog:
[Internal] - Fix E2E Tests

Reviewed By: cortinico

Differential Revision: D74803709

fbshipit-source-id: 747af57d04c96ba9b0ee642eb70ebf84bca3a3fa
2025-05-15 08:15:26 -07:00
Sam Zhou 34c9612f93 Make use of ref-as-prop support in DebuggingOverlay (#51352)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51352

Make use of the React 19 feature so that we can remove the remaining `forwardRef` in react native.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D74808254

fbshipit-source-id: 2f5f8d8dbe1bd5fcaba179bea5deed1592dc900c
2025-05-15 08:07:21 -07:00
Rubén Norte ca764bb511 Fix Fantom tests to avoid logging errors to test output (#51346)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51346

Changelog: [internal]

I saw that this test was logging errors to the console, which is considered a bad practice in Jest tests.

This prevents the logs from being printed in the test output and also adds assertions to verify what should be logged.

Reviewed By: rshest

Differential Revision: D74803463

fbshipit-source-id: 9c840a51e0e616a6bb15b7a40b3a6937fcb88b64
2025-05-15 05:27:02 -07:00
Chi Tsai bf26cf9c31 Add Hermes Root API in all other versions of Hermes (#51082)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51082

Introduces the `IHermesRootAPI` interface and a class implementation.
This root API will contain the previously static methods on
`HermesRuntime`.

The root API will serve as an entry point for users to create the Hermes
runtime and invoke methods that do not necessarily require a runtime.

Diff also moves all usages of the static methods on `HermesRuntime` to
getting the methods from the root API.

Multiple places are depending on Hermes, Hermes snapshot, and Shermes,
so this diff will also update all of these verions of Hermes at once.

Changelog: [Internal]

Reviewed By: neildhar

Differential Revision: D71132855

fbshipit-source-id: fddda83517682779b4aef062efe84e29fd027fae
2025-05-14 17:14:47 -07:00
Nick Gerleman 0455f8ff53 Use PreparedLayoutTextViewManager when Enabled by Gating (#51182)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51182

Wires up the logic to use Facsimile View Manager when flags for prepared layout enabled.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D73161911

fbshipit-source-id: dc8824ecf8a712d5ff52cb8e2d63e85646297d40
2025-05-14 16:10:08 -07:00
Nick Gerleman 9394813689 Update PreparedLayoutTextView for new state type (#51301)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51301

The type of the state we pass has changed, since the original prototype. Need to update the Java side to reflect this.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74417253

fbshipit-source-id: 9159689e07d6f00504b5116a647c7afdf79005f4
2025-05-14 16:10:08 -07:00
Nick Gerleman 729b5ae7d9 Send prepared layouts in Android ParagraphState updates (#51184)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51184

This change adds prepared layouts to `ParagraphState` on Android, for us to send to the client when gating is enabled

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D74356128

fbshipit-source-id: bd1dd5a457869075c561173de398ae1954a20ab5
2025-05-14 16:10:08 -07:00
Nick Gerleman 88de631d05 RN_SERIALIZABLE_STATE (#51185)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51185

Was running into issues with split Android ParagraphState, because a lot of code is tied to `#ifdef ANDROID`, which also builds for react-native-cxx.

This does that spliitting, and also introduces `RN_SERIALIZABLE_STATE` to replace previous ANDROID checks related to state serialization, so we can cofine that to just the Android platform. These changes are dependent on each other.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D74374376

fbshipit-source-id: ffb246ea2e16773f85de12209f2d88a95f8bb792
2025-05-14 16:10:08 -07:00
Nick Lefever 09832198cc Add role and screenReaderFocusable to prop diffing for View component (#51332)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51332

See title

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74747715

fbshipit-source-id: dc0380b0402d6023971a902f22d44b87bad0edde
2025-05-14 15:43:33 -07:00
Nick Lefever b6d7451291 Add missing borderEndColor prop diffing for View component (#51331)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51331

See title

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74744566

fbshipit-source-id: dc70310e47dfd5e29070519fa29b7af7ce6ffeab
2025-05-14 15:43:33 -07:00
Nick Lefever c301a25251 Add hitSlop prop diffing to View component (#51329)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51329

See title

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74741639

fbshipit-source-id: da7317c8800d2f25c69ecd7d3aca9b75350c2a56
2025-05-14 15:43:33 -07:00
Nick Lefever 07c64ba341 Add mixBlendMode prop diffing to View component (#51326)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51326

See title

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74739648

fbshipit-source-id: 3123f001cf7520d39bc3e92cee79b1baa17bd7cf
2025-05-14 15:43:33 -07:00
Nick Lefever d4ee62793d Add filter prop diffing to View component (#51325)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51325

See title

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74738361

fbshipit-source-id: 71c704b1a977327c05d06e48f5572753c2847b38
2025-05-14 14:33:53 -07:00
Nick Lefever 37ad315ebc Add outline prop diffing to View component (#51321)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51321

See title

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74734893

fbshipit-source-id: f9b96c7bbfc791fa601dd8e4d8c1a4a27b94e36c
2025-05-14 14:33:53 -07:00
Joe Vilches 14e53e4845 Allow links in facsimile to be keyboard focusable (#51305)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51305

tsia, there is a lot of TextView specific API calls and instance checks in the delegate that need to be modified. Additionally, facsimile has some custom focusing logic we do not need if we have a delegate

I opted to just do a lot of instance specific logic using `is` . That seems easier for the time being with this text view that should replace our other text view over time.

I also expose a new way of focusing a span on facsimile, which may not be the best way to do that, lmk

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D74104419

fbshipit-source-id: 87c2259bb1698d93afad88ed91cb6322b90714f0
2025-05-14 14:24:21 -07:00
Ramanpreet Nara 99505e0c74 RuntimeExecutor: Make executeSynchronouslyOnSameThread_CAN_DEADLOCK more readable (#51324)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51324

This diff just renames the mutexes, so that the method is more understandable.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74692506

fbshipit-source-id: 3e928ee0465ebed90f9c95ba3eaf28ea148b0e60
2025-05-14 14:22:59 -07:00
Chi Tsai 6766cf6285 Used shared_ptr<Runtime> in jsi testlib (#51081)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51081

After introducing the interfaces, runtime should be managed through a
shared pointer instead of a unique pointer.

This diff will change the usage in JSI testlib. Later diffs will
actually change the HermesRuntime usages.

Changelog: [Internal]

Reviewed By: lavenzg

Differential Revision: D70113190

fbshipit-source-id: ea831dd8f79750851fd626afe0f1f5550142ac05
2025-05-14 13:44:49 -07:00
Chi Tsai f7f60dc794 Add castInterface API in JSI (#49604)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49604

Add JSI castInterface API. This provides a structured way to provide
optional APIs that may or may not be supported in all engines.

Every interface will have its own set of APIs. For instance, Hermes
will provide an interface (`IHermes`) containing Hermes-specific
APIs. In the future, an interface may be created to expose optional
APIs.

A runtime will inherit the interfaces of which the APIs are supported by
the runtime. Users who want to access a specific API may call
castInterface with the UUID of interface containing the API.

For backwards compatibility, the current `jsi::Runtime` will remain as
an object, and its functionalities will not be described by an
interface. However, this may be revisited later.

Changelog: [Internal]

Reviewed By: tmikov

Differential Revision: D68964360

fbshipit-source-id: 3efe61c5bc1a0fa113a192f4abad6d0f135b4301
2025-05-14 13:44:49 -07:00
Ramanpreet Nara e275da45ea Migrate surface view off RCTSurface (#51328)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51328

RCTSurface is a legacy class. We might be able to kill it off.

Let's decouple RCTSurfaceView from RCTSurface.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D72582309

fbshipit-source-id: 0ffb6c2d08c5ee1eda6ae90955ccbc14f57036b7
2025-05-14 13:10:41 -07:00
Ramanpreet Nara 70eeb9f541 Migrate display link off RCTModuleData (#51327)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51327

RCTModuleData is a legacy class. We might be able to kill it off.

Let's deocuple bridgeless from RCTModuleData.

Changelog: [ios][Breaking] - Migrate RCTDisplayLink's API from RCTModuleData

Reviewed By: cipolleschi

Differential Revision: D72582306

fbshipit-source-id: 3e06f8b2036e1f65425c8312644cc92c076e958e
2025-05-14 13:10:41 -07:00
Nick Gerleman 2fe6c1a947 Include fallback line spacing in BoringLayout Metrics (#51304)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51304

A potential source of truncation we previously experienced with D65171352 is difference in how TextView calculates line spacing with StaticLayout.

As of Android 13, this also appies to how TextView creates the metrics of BoringLayout. Oddly, this is not also applied to `BoringLayout.make()` (I think it ends up only impacting metrics), so we don't pass the flag there. See https://cs.android.com/android/_/android/platform/frameworks/base/+/78c774defb238c05c42b34a12b6b3b0c64844ed7

This could cause some theoretical truncation of simple single line text, so let's match TextView expectations.

Changelog:
[Android][Fixed] - Include fallback line spacing in BoringLayout

Reviewed By: javache, joevilches

Differential Revision: D74694483

fbshipit-source-id: 76dd980b827824f19ac755b3a9a1ec8912cd6ff1
2025-05-14 12:03:44 -07:00
Ruslan Lesiutin 3148f0fb2b Deduplicate strings and provide std::string_view (#51098)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51098

# Changelog: [Internal]

Depending on the sampling rate, there could be lots of samples recorded. Right now, React Native requests the rate to be 10kHz. In reality, Hermes will be slower. How exactly slower will depend on the platform, because sampling profiler implementation is platform-specific. Windows peaks at ~500Hz, whereas iOS and Android that are using signals can reach up to 5kHz, based on my observations. This means that we could record sample approximately every 0.5ms.

For 30 seconds of sampling, we can get around 150k samples, every one of which may have up to 500 call frames (it is a custom limitation on Hermes side). Previously, every call frame could have a unique copy of function name string and url string.

This diff changes the approach to deduplicate strings, keeping a single copy for every unique string. A new abstraction `StringEntry` is added that will keep a const pointer to the string storage and an offset to the entry in this storage.

On React Native side, we are going to re-use these `std::string_view` and keep Hermes' `Profile` alive as long as they are used. We are going to achieve this by keeping unique pointer to the Hermes' `Profile` in React Native's Profile abstraction - `RuntimeSamplingProfile`, which is agnostic to the runtime.

Reviewed By: fbmal7

Differential Revision: D73106068

fbshipit-source-id: bdc7026e19c2677e39e20f14c8532080c5842026
2025-05-14 11:34:14 -07:00
Zeya Peng 2d7342f8b4 Remove native animation fabric sync in JS and infinite animation loop workaround (#51264)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51264

## Changelog:

[General] [Changed] - Remove native animation fabric sync in JS and infinite animation loop workaround, when cxxNativeAnimated is enabled

when cxxNativeAnimated is enabled, we'll sync native animation props back to Fabric in native, when that happens we can remove the code in JS for same purpose

Reviewed By: lenaic

Differential Revision: D74198568

fbshipit-source-id: 5b313a5e8c07058f939134e9a6d60dcfa3b45842
2025-05-14 11:31:11 -07:00
Nick Lefever 109fe1394a Add missing view events to View prop diffing (#51318)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51318

Adding parsing and diffing for
- `onClickCapture`
- `onPointerOutCapture`
- `onPointerOverCapture`

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74732872

fbshipit-source-id: 458f476f645970e2bee608e020b63c14e7affafe
2025-05-14 10:25:28 -07:00
Nick Lefever 85994c9f62 Add boxShadow prop diffing to View component (#51314)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51314

See title

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D74726605

fbshipit-source-id: 4a26d05af51a7d77f3aade9fbea3dff47b2ea4ed
2025-05-14 10:25:28 -07:00
Riccardo Cipolleschi 8d634267f8 Add E2E test for FabricInteropLayer (#51269)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51269

This adds an E2E Tests for the fabric interop layer in RNTester, so we can make sure that we don't break the mechanism to add children after the view is rendered

## Changelog:
[Internal] - Add E2E test for FabricInteropLayer

Reviewed By: sammy-SC

Differential Revision: D74590458

fbshipit-source-id: 9483d1ac648d923a8494d6402b9b2f971b9b2547
2025-05-14 10:11:03 -07:00
Christian Falch d53a60dd23 fix adding children (#51213)
Summary:
See https://github.com/facebook/react-native/issues/51212 - children aren't updated correctly in an old arch native view using the interop layer under Fabric.

This is caused by the mountChildComponentView method not updating the view, only adding the new view to a list that will be used on the next update to mount the child.

This commit fixes this by adding the same pattern as in unmountChildComponentView where children are inserted directly if the underlying paperview is available in the adapter - otherwise it uses the mounting list as before.

#Closes 51212

bypass-github-export-checks

## Changelog:

[IOS] [FIXED] - fixed adding child views to a native view using the interop layer

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

Test Plan:
**Previous output**:

<image src="https://github.com/user-attachments/assets/472b95e7-0921-46c9-be6a-f31759c0cd26" width="200px" />

**After fix**:

<image src="https://github.com/user-attachments/assets/554387cd-c264-483e-9c52-d9cd40b42601" width="200px" />

Reviewed By: sammy-SC

Differential Revision: D74471278

Pulled By: cipolleschi

fbshipit-source-id: 798f9e7be389359bd6e3aa1b6a6e9fb799fcb369
2025-05-14 10:11:03 -07:00
Riccardo Cipolleschi e9c8fee4ef Add Example for InteropLayer on RNTester (#51260)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51260

This is a preparatory change that adds an example to RNTester for the Fabric interop layer on iOS.
This example is needed to create a Jest E2E tests that will make sure that the Fabric Interop Layer can properly add views as subviews.

We discovered the bug thanks to react-native-maps.

## Changelog:
[Internal] - Add Example for the Fabric Interop Layer to RNTester iOS

Reviewed By: cortinico

Differential Revision: D74579737

fbshipit-source-id: 0c1bbb06790b01313cd98aa4b7152d8aba0cded3
2025-05-14 10:11:03 -07:00
Vitali Zaidman 337ae3bacb improve the message displayed when opening devtools while bundle builds (#51315)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51315

Changelog: [General][Internal] improve the message displayed when opening devtools while bundle builds

Reviewed By: motiz88

Differential Revision: D74718454

fbshipit-source-id: 8b0cc9ca08dc98d766ddd5a3685d60b5d2800119
2025-05-14 09:11:34 -07:00
Pieter De Baets 039a333df5 Remove any props set by default on View (#51225)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51225

We process a number of props by default in View, so we can provide some amount of compatibility with web API's. The way we then pass these to React means we end up setting a number of props with 'undefined' values. These props need to be diffed, sent to native (so string keys copied via JSI) and serialized to folly::dynamic (on Android) which is just wasteful.

Instead we can mutate the destructured props object and update/insert keys only as necessary to reduce the props payload size.

Changelog: [General][Breaking] View no longer sets any default accessibility props, which should not result in visible changes in behaviour but may affect snapshot tests.

Reviewed By: yungsters

Differential Revision: D74472767

fbshipit-source-id: 462a4495c0672d4bf1752a532acff49b14598e8e
2025-05-14 09:02:00 -07:00
Jakub Piasecki ee9bd851ac Add a custom Jest resolver to opt out from handling "exports" in tests (#51307)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51307

D72228547 added the `exports` field to the main `react-native` package, in which all imports from `./src/*` are explicitly disallowed. This was expected to be a breaking change and to limit the surface area of it, this diff will allow using all imports in jest tests.

Changelog: [General][Added] Added a custom Jest resolver to opt out from handling "exports" in tests

Reviewed By: huntie

Differential Revision: D74708701

fbshipit-source-id: 9a2714f4e6f78ffbad9e56b5bb92657c9ea908ef
2025-05-14 08:01:15 -07:00
Dawid Małecki 4d0f2b2ca7 Align ImageStyle overflow prop type and compose function type (#51285)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51285

The `composeStyles` function should correctly determine the type of the input styles (`ViewStyle`, `ImageStyle`, `TextStyle`) base on the output type:

```ts
const combinedStyle8: StyleProp<ImageStyle> = StyleSheet.compose(
  // ts-expect-error
  composeTextStyle,
  composeTextStyle,
);
```

This diff adds generic type checking for `compose` function and fixes `ImageStyle` overflow prop type which accepted `scroll` property (which wasn't previously accepted in manual types) and which enables type system to distinguish `ImageStyle` from `ViewStyle` and `TextStyle`:

previous:
```ts
overflow?: 'visible' | 'hidden' | 'scroll'
```

current:
```t
overflow?: 'visible' | 'hidden'
```

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D74574293

fbshipit-source-id: 751a44f2d3cd43055d93031343995f16ef87b185
2025-05-14 07:44:05 -07:00
Vitali Zaidman b817b1a75b Update debugger-frontend from 3d17e0f...f5506e6 (#51316)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51316

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

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

Reviewed By: motiz88

Differential Revision: D74727700

fbshipit-source-id: b0923b7fd1a7c1d721b9b4322270507c07fcedaf
2025-05-14 07:23:45 -07:00