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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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